Subject Line

Thomas Guyot-Sionnest dermoth at aei.ca
Sat Nov 3 03:34:50 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29/10/07 04:38 PM, Mike Hawley wrote:
> Hi guys and girls, can anyone let me know how I add a subject, and display
> the sent to (to:) line to the emails that leave the Nagios server.
> 
> I am running Nagios 3.0b5 on a OpenSuSe server, with Sendmail 8.13.

Here's an example of notification command (It's one line, please ignore
line warps):

command_line  /bin/echo -e "From: $USER6$\nTo: $CONTACTEMAIL$\nSubject:
$NOTIFICATIONTYPE$: $SERVICEDESC$ $SERVICESTATE$\n\n$HOSTALIAS$:
$SERVICEDESC$: $SERVICESTATE$\n\nPlugin output:
$SERVICEOUTPUT$\n\n$SERVICEACTIONURL$" | sendmail -t -f $USER6$ -i
$CONTACTEMAIL$

It has to follow the standard for SMTP emails (Headers, one blank line
then the body). Note that the "From:" and "To:" headers have nothing to
do with proper message delivery; message is only delivered to envelope
TO addresses (sendmail last argument in this example) and bounces are
sent back to the envelope FROM address (set with sendmail -f switch).

In the example above I set the From Address (%USER6$) in both the
message header and envelope, so that undeliverable bounces are sent back
to that address instead of the local user on the server.

There might be some additional sendmail configuration needed. I think
you might have to add the Nagios user to the trusted users list to allow
it forging the FROM headers. If you want to send external emails (i.e.
pager emails, etc) your server's external IP should forward and reverse
lookup properly in DNS (it doesn't have to be reachable from the outside
though). If the external domain associated to the IP is different than
the server's domainname then you will need to set up masquerading in
sendmail as well.

Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHK95K6dZ+Kt5BchYRApubAKCWlSRylq4y+XBw+V6gmGUA2qgedACfWVpF
Ga+iW5eifAnLuyICCgjKKj4=
=x9hW
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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