Elevated alerts
jmoseley at corp.xanadoo.com
jmoseley at corp.xanadoo.com
Fri Jan 9 18:18:43 CET 2009
You wouldn't need to modify the notify-by-pager command you already have
setup. After all, you are still sending mail to an email address. I don't
know why your command definitions have @MAIL_PROG at . That must be defined
someplace else in another config file if it's working. If that command
isn't working, simply replace that variable string with /bin/mail.
James Moseley
Grant Lowe
<glowe at sbcglobal.
net> To
jmoseley at corp.xanadoo.com
01/09/2009 10:52 cc
AM nagios-users at lists.sourceforge.net
Subject
Re: [Nagios-users] Elevated alerts
Thank you for the response. I like your idea. I think I need to embellish
it some. A couple of questions about it.
In our environment, I think I only have to make one change. Here's what
currently happens. A regular email goes to user at company.com, but pages go
to user at pager.company.com. So I thought I would setup the paging like this
(at least for starters):
The notify-by-email works just fine. Don't want to mess with this one.
# 'notify-by-email' command definition
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios @VERSION@
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ alert -
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Here's a notfiy-by-pager that I would like to use. Just a clone of the
notify-by-email, but modified for pages.
# 'notify-by-pager' command definition
define command{
command_name notify-by-pager
command_line /usr/bin/printf "%b" "***** Nagios @VERSION@
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ alert
- $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
How would I modify notify-by-pager to send to the "user at pager.company.com"
we use? I'm
asking because I only see @MAIL_PROG@, no /bin/mail anywhere, like in
the notify-host-by-email and notify-service-by-email definitions. I think
I would then use the two different contacts for the same person as you said
in your email.
Does this sound like reasonable?
----- Original Message ----
From: "jmoseley at corp.xanadoo.com" <jmoseley at corp.xanadoo.com>
To: Grant Lowe <glowe at sbcglobal.net>
Cc: nagios-users at lists.sourceforge.net
Sent: Thursday, January 8, 2009 4:33:30 PM
Subject: Re: [Nagios-users] Elevated alerts
Grant Lowe <glowe at sbcglobal.net> wrote:
>Hi All,
>
>I'm trying to figure out how an elevated alert would work. This one isn't
exactly clear to me from the documentation. So say, I have an alert that
>gets elevated, from a "WARNING" alert to a "CRITICAL" alert, how can you
get Nagios to send off something say to a pager as well as email? I think
I >have my setups good now, and I'm seeing states of WARNING, CRITICAL, and
RECOVERY in email, but I'm not sure how to implement these changes.
Thanks!
The easiest thing to do is just to send all alerts to both an email and
pager/phone. If you want to send warnings to just email addresses, and
then send critical alerts to both the email and pager address for a
particular contact, then one way to do that would be to create two contacts
for the same person. In the first contact (for warnings) entry, you'd have
something like:
service_notification_options w,u,,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
In the *critical* contact entry, you'd have:
service_notification_options u,c,r
host_notification_options d,u,r
service_notification_commands notify-by-epager
host_notification_commands host-notify-by-epager
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
Then you'd make both contacts the member of the same contact group. In the
above example, when a service goes to warning state, the contact would be
sent an email only. When the service goes to critical, the contact would
get both an email and a pager/phone alert. In the above scenario, the
contact would get duplicate emails for unreachable and recovery states, so
you may want to adjust that to your needs.
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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