Email Notifications (One More Try)

David Gitman David at feedroom.com
Wed Apr 9 20:05:23 CEST 2003


I wish I could. My configuration doesn't like the -r option. When I run mailx it calls sendmail, a qmail script.

[-d]

-----Original Message-----
From: Fredrik Wänglund [mailto:fredrik.wanglund at datavis.se] 
Sent: Wednesday, April 09, 2003 1:28 PM
To: David Gitman
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Email Notifications (One More Try)

Use mailx -r option to set the return address:

command_line /usr/bin/printf "%b" "***** Nagios 1.0 
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: 
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: 
$SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n 
$OUTPUT$" | /usr/bin/mailx -r nagios at nagiosserver.com -s "** 
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ 
**" $CONTACTEMAIL$


/FredrikW


David Gitman wrote:

> My email notifications are being sent from root at host. When I run the 
> command definition by hand it comes from nagios at host. Nagios is 
> running as nagios.
>
> I'm running Solaris 7 and using mailx, simply because I couldn't get 
> it to work with mail.
>
> Could Nagios be starting as root and su'ing to nagios?
>
> Any other ideas?
>
> ps -ef | grep nagios
>
> nagios 6314 1 0 Mar 20 ? 48:26 /local/project/nagios/bin/nagios -d 
> /local/project/nagios/etc/nagios.cfg
>
> dgitman 17296 4466 0 12:38:52 pts/18 0:00 grep nagios
>
> # 'notify-by-email' command definition
>
> define command{
>
> command_name notify-by-email
>
> command_line /usr/bin/printf "%b" "***** Nagios 1.0 
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SE
>
> RVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: 
> $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n
>
> $OUTPUT$" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ alert - 
> $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
>
> }
>




-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.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