different timeouts for same service

Andreas Ericsson ae at op5.se
Tue Nov 2 14:13:12 CET 2004


Karolis Dautartas wrote:
> hi,
> 
> I am using nagios for several months now, still can't figure out
> some things. I would like to do the following things:
> 
> 1. Say I am monitoring a certain service on a certain host. I want to
> be notified about service being down by email and a pager. I would
> like to recieve an email if the host has been down for 3 minutes (3
> checks every minute), and a pager if the service has been down for say
> 10 minutes. The only solution I could come up with, is running 2
> instances of nagios with different config files. But that is not
> exactly the clean way :)
> 

Check out escalations in the documentation. With nagios 2.0 you can do 
wildcard definitions, or use hostgroup_name to define escalations for a 
whole range of services or hosts in one go.

> 2. For some service notifications I would like to only recieve an
> email. For others, I want both email and pager. My way of doing this:
> create contact groups "critical" and "warning", and put contacts that
> should get pager notifications into "critical", while others go into
> "warning". Then in a service definition, I would have to list either
> critical or warning contact groups, or both. The problem here is that
> most of the contacts would have to be defined twice: one contact with their
> pager address, and another with their email address. This is also not
> a very clean way...
> 

This is in fact the recommended way of doing things, since most people 
don't want pager notifications during workhours or night-time.
If you want to be able to send both kinds of notifications I suggest you 
write a script to send them for you.
The command would look something like this;
define command{
command_name   pager-email-notify
command_line   /path/to/notification-script -p "$CONTACTPAGER$" -m 
"$CONTACTEMAIL$" (followed by the necessary macros however you want them).
}

Then all you need to do is (in the script) check if pager and email are 
  not zero length and call the (currently imaginary) 
functions/procedures/subroutines/whatever pager_notify and email_notify.
That way you can use this command to send all your notifications, and 
it's fairly simple to add logic to check if it's a service notification 
or a host notification as well, leaving you with a single notification 
command that handles it all.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list