What I've done is create entries in contacts.cfg which don't relate to any
particular user, eg:
define contact{
contact_name pager-devunix
alias DEVUNIX on-call pager
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,r
service_notification_options c,r
host_notification_commands host-notify-by-epager
service_notification_commands notify-by-epager
pager pager-devunix
}
Notice the absence of notify-by-email/host-notify-by-email. Not required.
Notice also that this contact doesn't get warning notifications, just
down/critical/recovery notifications. And the e-mail address of
pager-devunix in the last line is resolved with the help of /etc/aliases.
More on this shortly.
Now for a 'real person' entry:
define contact{
contact_name joe1
alias Joe Person
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,r
service_notification_options c,w,r
host_notification_commands host-notify-by-email
service_notification_commands notify-by-email
email [email protected]
}
Notice the absence of notify-by-epager/host-notify-by-epager. That part is
already handled by pager-devunix. Notice that joe1 gets
down/critical/warning/recovery notifications, which is slightly different
from the virtual pager definition.
Now in contactgroups.cfg we have:
define contactgroup{
contactgroup_name unix-admins
alias UNIX Administrators
members pager-devunix,joe1
}
Then in your service{} definition you would reference the contact_groups of
unix-admins. Then when a service (with this contactgroup) returns a
warning, joe1 gets an e-mail, and pager-devunix gets nothing. If the
service returns a critical/down/recovery, both joe1 and pager-devunix get
it, which means that joe1 gets an e-mail and pager-devunix gets a page.
So far, so good. Now for the /etc/aliases details. Here's the relevant
entry from /etc/aliases:
pager-devunix: :include:/home/sipoc/oncall/DEVUNIX
which in turn contains a string, eg, Firstname_Lastname_pager. This string
also exists in /etc/aliases, which in turn resolves to [email protected]
(replace the n's with the appropriate numeric value).
This might appear a bit obtuse, but I created a menuing script which manages
whoever's on call. When the virtual pager is reassigned, the person rolling
off receives a notification page to that effect, and the person going on
call receives an appropriate page. The Firstname_Lastname_pager string is
displayed as the on-call person in one of the sub-menus.
I've pondered doing a PHP version so that it can be changed if you're an
authenticated Nagios user, but it's extremely low in my list of priorities
at the moment.
Hope this gives you some ideas.
jc
> -----Original Message-----
> From: Jeremy T. Bouse [mailto:[email protected]]
> Sent: Friday, January 31, 2003 2:44 PM
> To: [email protected]
> Subject: [Nagios-devel] Notification option
>
>
> One situation I've seen in a couple of environments I've had to
> work is the idea of a rotating call... Wondering if with the new
> template method for configuring if there might not be a way
> to encompass
> a group which only one person would be notified not all... This could
> then be setup to work with a pager or SMS system to only notify the
> person that is on "call" duty...
>
> Jeremy
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Nagios-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/lis ... gios-devel
>
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]