Skip to content

Instantly share code, notes, and snippets.

@philk
Created March 1, 2013 04:05
Show Gist options
  • Select an option

  • Save philk/5062402 to your computer and use it in GitHub Desktop.

Select an option

Save philk/5062402 to your computer and use it in GitHub Desktop.
I don't know if Ruby will let me do this and I'm pretty sure it shouldn't but I'm really enjoying this crazy idea.
cloud_monitoring_alarm "memory_usage alarm" do
check_label "memory"
criteria do
warn_if(
percentage("used", "total"),
">",
100,
"Used percentage too high"
)
warn_if metric("thing"), "<", 1
ok "This thing is fine"
end
notification_plan_id npid
action :create
end
memory_usage_check = cloud_monitoring_criteria do
warn_if(
percentage("used", "total"),
">",
100,
"Used percentage too high"
)
warn_if metric("thing"), "<", 1
ok "This thing is fine"
end
cloud_monitoring_alarm "memory_usage alarm" do
check_label "memory"
criteria memory_usage_check
notification_plan_id npid
action :create
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment