Subdue Checks over the Weekend?

've read through the documentation and I see where you can subdue a check for certain hours, but can you also subdue it for specific hours and days? IE if I only want a check to run from 9-5 M-F, is that possible or do I need the handlers to not notify if outside of hours? I’d rather not have to push that logic out to the handlers if possible. Would another (not optimal) solution be to use cron to call the check from the API instead of letting the master schedule it?

Thanks.

I haven’t found a clean way to do this via subdue, but I did find this mutator:
https://github.com/sensu/sensu-community-plugins/blob/master/mutators/officehours.rb

I’m going to use a modified variant that will drop the event if it’s not within the hours bounds, that should do the trick.

-Brian

···

On Tuesday, July 1, 2014 3:57:30 PM UTC-4, Ichabod wrote:

've read through the documentation and I see where you can subdue a check for certain hours, but can you also subdue it for specific hours and days? IE if I only want a check to run from 9-5 M-F, is that possible or do I need the handlers to not notify if outside of hours? I’d rather not have to push that logic out to the handlers if possible. Would another (not optimal) solution be to use cron to call the check from the API instead of letting the master schedule it?

Thanks.

Can I ask how you dropped the event at mutator stage? Had a look through the official docs on the website, but I can’t find a suggested method for just stopping the event at that stage. Many thanks in advance,

Matt

···

On Monday, 7 July 2014 18:59:06 UTC+1, Ichabod wrote:

I haven’t found a clean way to do this via subdue, but I did find this mutator:
https://github.com/sensu/sensu-community-plugins/blob/master/mutators/officehours.rb

I’m going to use a modified variant that will drop the event if it’s not within the hours bounds, that should do the trick.

-Brian

On Tuesday, July 1, 2014 3:57:30 PM UTC-4, Ichabod wrote:

've read through the documentation and I see where you can subdue a check for certain hours, but can you also subdue it for specific hours and days? IE if I only want a check to run from 9-5 M-F, is that possible or do I need the handlers to not notify if outside of hours? I’d rather not have to push that logic out to the handlers if possible. Would another (not optimal) solution be to use cron to call the check from the API instead of letting the master schedule it?

Thanks.

OK scrap that, the mutator just has to print a modified JSON to STDOUT right. So I can just print out nothing and return exit code 0 from the mutator - going to go off and test this :slight_smile: Thanks anyways

···

On Friday, 18 September 2015 23:22:59 UTC+1, Matthew Ralph wrote:

Can I ask how you dropped the event at mutator stage? Had a look through the official docs on the website, but I can’t find a suggested method for just stopping the event at that stage. Many thanks in advance,

Matt

On Monday, 7 July 2014 18:59:06 UTC+1, Ichabod wrote:

I haven’t found a clean way to do this via subdue, but I did find this mutator:
https://github.com/sensu/sensu-community-plugins/blob/master/mutators/officehours.rb

I’m going to use a modified variant that will drop the event if it’s not within the hours bounds, that should do the trick.

-Brian

On Tuesday, July 1, 2014 3:57:30 PM UTC-4, Ichabod wrote:

've read through the documentation and I see where you can subdue a check for certain hours, but can you also subdue it for specific hours and days? IE if I only want a check to run from 9-5 M-F, is that possible or do I need the handlers to not notify if outside of hours? I’d rather not have to push that logic out to the handlers if possible. Would another (not optimal) solution be to use cron to call the check from the API instead of letting the master schedule it?

Thanks.