it will send an alert only to critical & recovery states.
However, I am receiving numerous recovery alerts but no critical.
The service indeed is changing states between OK and Warning:
Code: Select all
define service{
use generic-service
host_name HOST
service_description Service_Name
is_volatile 0
check_period 24x7
max_check_attempts 2
normal_check_interval 2
retry_check_interval 2
contact_groups net-admins
notification_interval 240
notification_period 24x7
notification_options c,r
check_command COMMAND
}
The documentation says:
notification_options: This directive is used to determine when notifications for the host should be sent out. Valid options are a combination of one or more of the following: d = send notifications on a DOWN state, u = send notifications on an UNREACHABLE state, r = send notifications on recoveries (OK state), f = send notifications when the host starts and stops flapping, and s = send notifications when scheduled downtime starts and ends. If you specify n (none) as an option, no host notifications will be sent out. If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states. Example: If you specify d,r in this field, notifications will only be sent out when the host goes DOWN and when it recovers from a DOWN state.