We’re having problems with multiple recoveries being sent out.
[code]define contact {
contact_name mail_crit
use generic-contact
service_notification_options c,r
alias Mail
email email@mail
}
define contact {
contact_name mail_warn
use generic-contact
alias Mail
service_notification_options w,u,r
email email@mail
}
define contact {
contact_name pagerday_crit
use day-contact
alias Pager Day
email pager@gateway
service_notification_options c,r
service_notification_commands notify-service-by-pager
host_notification_commands notify-host-by-pager
}
define contact {
contact_name pagernight_crit
use night-contact
alias Pager Night
email pager@gateway
service_notification_options c,r
service_notification_commands notify-service-by-pager
host_notification_commands notify-host-by-pager
}
[/code]
Is it impossible to use recoveries with this kind of setup or is there a way to keep track when a service goes from WARNING -> RECOVERY and CRITICAL -> RECOVERY?
Erk, don’t think so… think a recovery is a recovery, like it doesn’t discern between warning->recovery and critical->recovery, just that it’s a recovery. Maybe there might be a way of using the macro
but you would probably have to do something along the lines of creating recovery-only contacts i.e.
define contact {
contact_name pagerday_recov
use day-contact
alias Pager Day
email pager@gateway
service_notification_options r
service_notification_commands notify-service-by-pager-recov
host_notification_commands notify-host-by-pager-recov
}
then create your notify-x-by-pager-recov in command.cfg and get it to pass accross everything as per usual (i.e. all the normal information you want in your notification - hostname, service, state, contact address etc) but also the $LASTSERVICESTATE$ macro, into an external script.
Your external script would then have to assess whether the content of the $LASTSERVICESTATE$ macro was valid to generate a recovery message for this contact, i.e. in the case of pagerday_recov one assumes that it would have to be CRITICAL in order to send the notification, not WARNING. Then, should it be appropriate for the case in hand, get your script to handle the generation of the notification in much the same way as nagios would.