Skip to content

Instantly share code, notes, and snippets.

@calebhailey
Last active June 21, 2017 11:17
Show Gist options
  • Save calebhailey/8fed39a2eba3d230933f6d53de038f24 to your computer and use it in GitHub Desktop.
Save calebhailey/8fed39a2eba3d230933f6d53de038f24 to your computer and use it in GitHub Desktop.
{
"handlers": {
"example_handler": {
"type": "pipe",
"command": "notify_somebody.rb",
"timeout": 30,
"filter": "filter_weekly_maintenance"
}
}
}
{
"filters": {
"filter_july_29_maintenance": {
"negate": true,
"attributes": {
"timestamp": "eval: Time.new(2016,7,29,18,0,0,'-06:00') < value && value < Time.new(2016,7,30,6,0,0,'-06:00')",
"check": {
"name": "eval: ['check_foo','check_bar','check_baz'].include?(value)"
}
}
}
}
}
{
"filters": {
"filter_weekly_maintenance": {
"negate": true,
"attributes": {
"timestamp": "eval: (Time.at(value).wday == 5 && Time.at(value).hour > 18) || (Time.at(value).wday == 6 && Time.at(value).hour < 6)",
"check": {
"name": "eval: ['check_foo','check_bar','check_baz'].include?(value)"
}
}
}
}
}
@eklein
Copy link

eklein commented Jul 29, 2016

Thank you guys so much! This is exactly what I need until scheduled maintenance is available. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment