State Change email alert

I am wondering if it’s possible to configure Nagios to send a single notification when a service changes state. What I’d like to do is use a ping and the first time the ping is successful have a single email sent. The first time a ping is unsuccessful have a single email sent. Any suggestions would be appreciated !

Do you want only one single notification no matter how long nagios is running, no matter if the state changes after the first change?
Or do you want always a single notification every time the state changes. For the latter you can use this configuration for the host or service:

notification_interval 0          ; only one single notification is sent after a state change
max_check_attempts 1         ; no rechecks so that nagios immediately sends a notifcation if state change occurs

In the contact definition use this

host_notification_options	d,u,r
service_notification_options  w,u,c,r

i’d rather use a sort of ecalation to only havbe a a single email sent… BUT i’d rather NOT send an email on the first failure, you 'd get way too many false positives… YMMV :wink: