Different types of notifications

Janet Post Janet.Post at excapsa.ca
Sun Dec 17 05:09:57 CET 2006


Hello Mattia,

I have done this using a mixture of contacts and contact groups with
different settings -- although in my case I used it for creating
different RSS feeds, but this technique will work for you as well.

Here are some pieces of my config files as an example for you.  I am
using nagios 1.4, so if there are any differences in the configs,
someone with experience in 2.x will have to keep me honest.  :-)

define contact{
	contact_name			notify-sms-1
	alias				 	Notify SMS 1 for
check_ping
	service_notification_commands	notify-by-sms-1
	}

define contact{
	contact_name			notify-sms-2
	alias				 	Notify SMS 2 for
check_internet
	service_notification_commands	notify-by-sms-2
	}

define contact{
	contact_name			notify-by-email
	alias				 	Notify by Email
service_notification_commands	commandtoemail
	}

define contact{
	contact_name			notify-sms-critical
	alias				 	Notify SMS for critical
service_notification_commands	commandtosms
	service_notification_options	c
	}

NOTICE the service_notification_options in the last contact.  We are
telling it to ONLY send notices if the event is a "critical".  This is
(obviously) important.  


Then create the contact groups. For your needs, I would suggest 3
contact groups:

define contactgroup{
	contactgroup_name		check-ping-sms-group
	alias				check-ping-sms-group
	members			notify-sms-1
	}

define contactgroup{
	contactgroup_name		check-internet-sms-group
	alias				check-internet-sms-group
	members			notify-sms-2
	}

And finally:

define contactgroup{
	contactgroup_name		everyone_else
	alias				Everyone Else
	members			notify-by-email,notify-by-sms-critical
	}


Under your service definition for check_ping, put the
check-ping-sms-group as the contact.  For the check_internet check, put
the check-internet-sms-group as the contact.  For everything else, use
the everyone_else group.  Both notify-by-email and
notify-by-sms-critical can be in the group, but the sms member will only
be used if it is a critical alert.

The only caveat in this, is that the person getting the sms alert will
not receive recovery alerts.  As far as I know, recover alerts will send
whether the alert was a "warning" or a "critical"...it makes no
distinction.   So, you can either send sms recoveries for alerts that
they have no visibility to, or they can receive none.  Your choice.  :-)

Hope this is helpful,

Janet



-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Mattia
Martinello
Sent: December 16, 2006 1:23 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Different types of notifications

Hi.

I need different types of notifications for different services.
For example, I need the notification type "notification-by-sms-1" for 
the service "check_ping" and the notification type 
"notification-by-sms-2" for the service "check_internet".
For all other services I need the e-mail notification for all states and

the sms notification only for the critical state.

How I can configure this?

Thank you very much and goodbye,
Mattia.


------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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