Nagios "from" address change

Buechler, Frank Frank.Buechler at xerox.com
Tue May 22 14:58:50 CEST 2007


Thanks Chris !!

I actually managed to do what I needed using genericstables in sendmail,
but this is a much more elegant solution. I like it, and I think I'll
implement it here.

Thanks again!
Frank 

-----Original Message-----
From: Christopher Odenbach [mailto:odenbach at uni-paderborn.de] 
Sent: Tuesday, May 22, 2007 3:40 AM
To: nagios-users at lists.sourceforge.net
Cc: Buechler, Frank
Subject: Re: [Nagios-users] Nagios "from" address change


Hi,

> 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?

We do:

define command{
       command_name    notify-by-email
       command_line    /usr/bin/printf "%b" "***** Nagios  
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: 
$SERVICEDESC$\nHost: $HOSTALIAS$\nState: $SERVICESTATE$\n\nDate/Time: 
$LONGDATETIME$\n\nAdditional Info:
\n\n$SERVICEOUTPUT$" | /usr/bin/mail -a "From: 
linux-intern at zitmail.uni-paderborn.de" -a "Return-Path: 
linux-intern at zitmail.uni-paderborn.de" -a "List-Id: Nagios
<nagios.uni-paderborn.de>" -s "[Nagios] **$SERVICEDESC$ at $HOSTALIAS$
($NOTIFICATIONTYPE$) **" $CONTACTEMAIL$

}

So /usr/bin/mail allows you to add additional headers, like "From" 
or "List-Id".

Christopher

-- 
======================================================
    Dipl.-Ing. Christopher Odenbach
    Zentrum fuer Informations- und Medientechnologien
    Universitaet Paderborn
    Raum N5.110
    odenbach at uni-paderborn.de
    Tel.: +49 5251 60 5315
======================================================

-------------------------------------------------------------------------
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/
_______________________________________________
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