Disable notification for service when Unknown state

Hi,

We are having some service check that failed sometimes with an Unknown, we know why and can’t fix it for the moment, so in the mean time, is there a way to disable notification if check_command is snmp and state is unknown ?

  • you can apply a different notification rule to the broken services

  • you can modify your notification script and pass the check command as parameter → after that your notification script could decide to carry on delivering the notification, or just exit

  • service.check_command is available as a assign where option. you can use this to split the notification rule into two separate rules

apply Notification "SERVICE-snmp" to Service {
    import "service-notification"

    assign where service.check_command == "snmp"
    states = [ Critical, OK, Warning ]
}

apply Notification "SERVICE" to Service {
    import "service-notification"

    assign where service.check_command != "snmp"
    states = [ Critical, OK, Warning, Unknown ]
}

thanks @moreamazingnick for the tips… BUT, do you think it could be possible also with a dependency ?

idk, try and report back:

apply Dependency "test2" to Service {
    disable_notifications = true
    assign where service.check_command == "snmp"
    states = [ Unknown ]
}

it’s not valid…

Attribute ‘states’: State filter is invalid for host dependency.