putting a Subject into the notification email

Hari Sekhon hpsekhon at googlemail.com
Thu Mar 8 13:00:07 CET 2007


I use the mail command rather than the sendmail command.

This will still use your local smtp mechanism.

printf "blah blah" | mail -s "this is the subject" me at mydomain.com

hth

-h

Hari Sekhon



Artyom Khmelnitsky wrote:
>  Hello,
>
> What command do you use to give the notification email a subject. Right now, if a box is down, it just sends an email with no subject at all. It would be nice to put a subject in there that has the Host's IP for instance.
>
> Currently, here's what we have:
>
> # 'host-notify-by-email' command definition
> define command{
> command_name host-notify-by-email
> command_line /usr/bin/printf "%b" "\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/lib/sendmail "Host $HOSTSTATE$ alert for $HOSTNAME$" $CONTACTEMAIL$
> }
>
> I take it the part after '| /usr/lib/senmail' is the subject of the email. Anyone know why it does not process it? We currently usq qmail server.
>
> Thank you for the help!
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> 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
>
>   

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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