Email on warning, page on critical?


#1

I have been asked to see if Nagios can be configured to email warning messages and send pages on criticals. The only way I could see to do this is to have two services definitions monitoring the same service with one notifying on warnings and the other criticals and add contact groups with contacts that have either the email or pager addresses configured respectively. I don’t really want to monitor the service twice, can anyone point me in the right direction? Thanks in advance.


#2

Nope, you don’t have to do it twice. All you need is 2 contacts for the same person. Joe get’s notified by email with warnings and recovers for services only. Joe2 get’s paged by pager for criticals and recovers for services and down and recovers for hosts. You absolutely want to be notified of recovers. The day it happens to you, you will know why. For example, you are at home and get paged with a critical. You put your pants on, get in the car and then “beep beep” you get paged with a recover message. So now, you don’t have to go to work, since the httpd service has recovered by itself somehow. It’s a big time saver so don’t let them talk you outa sending recover messages. They will thank you for it at some point.

Example:
contacts.cfg
contact_name joe
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email

contacts.cfg file, same file, same person, but different name for Joe
contact_name Joe2
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-by-pager
host_notification_commands host-notify-by-pager
Edited Fri Oct 14 2005, 10:54AM ]


#3

Thanks, I appreciate your quick response and help


#4

I had the same problem and what I did is :

  • define joe_mail and joe_pager
  • put them both in a contact group called joe, which is the one you use in hosts/services.

In fact I have different notification periods depending on criticality, so I went a step further :

joe_BC_pager 24x7 biz critical hosts/serv except warnings
joe_BC_email 24x7 biz critical hosts/serv warnings
joe_M_pager 12x5 medium criticality, etc
joe_M_email 12x5 medium criticality, etc
joe_L_email 8x5 low criticality, etc

then I just use the contact groups joe_BC, joe_M, joe_L, etc

Hope it helps
Cheers
Clipper