Nagios "from" address change
Janet Post
Janet.Post at excapsa.ca
Tue May 29 22:38:34 CEST 2007
Hello,
I just saw your post on the nagios mailing list. I have changed my
nagios to put the name of the server as the "from" server and put the
severity and problem in the subject of the email. I have attached the
script that I use for this. It uses sendmail specifically, so you may
have to edit the sendmail path to suit your environment.
You would add the following line to your misccommands.cfg:
define command{
command_name notify-by-email-spawner
command_line /usr/bin/perl
/usr/local/nagios/bin/email-spawner --notif
icationtype "$NOTIFICATIONTYPE$" --notificationnumber
"$NOTIFICATIONNUMBER$" --se
rvicedesc "$SERVICEDESC$" --serviceduration "$SERVICEDURATION$"
--hostalias "$HOS
TALIAS$" --hostname "$HOSTNAME$" --hostaddress "$HOSTADDRESS$"
--servicestate "$S
ERVICESTATE$" --datetime "$LONGDATETIME$" --output "$SERVICEOUTPUT$"
--contactema
il "$CONTACTEMAIL$" --serviceackauthor "$SERVICEACKAUTHOR$"
--serviceackcomment "
$SERVICEACKCOMMENT$"
}
I have not done this for the host notifications, so you may want to play
with it for that. And this is for nagios 2.x You can play with it to
get it to work with nagios 1.x
Thanks,
Janet
________________________________
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of
Buechler, Frank
Sent: May 21, 2007 9:16 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Nagios "from" address change
Greetings all,
My apologies in advance if this question has been hashed out here
before. I have a request from management to change the "from" address in
Nagios alerts. In other words, notifications come from "nagios@, my boss
would like to see it be something different, as in "WhateverAlerts@".
I've tried playing with genericstable in sendmail, and have been
unsuccessful. Is there another way to do this?
Thanks in advance,
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070529/ecc214d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: email-spawner
Type: application/octet-stream
Size: 2694 bytes
Desc: email-spawner
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070529/ecc214d2/attachment.obj>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
-------------- next part --------------
_______________________________________________
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