send mail notifications

Andreas Schrogl a.schrogl at 21torr.com
Mon Sep 16 11:27:35 CEST 2002


Hi Nicole,

you can use the Mail Command but on some linux version, also mine,
the default configuration won't work.
I had to change the script a little bit, i changed it also to the 
sendmail command. it looks like this (misccommand.cfg):


with mail command:

define command {
command_name                   notify-by-email
command_line                   /usr/bin/printf "%b" "***** Nagios 1.0b5 
*****\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/mail -s "** $NOTIFICATIONTYPE$ alert - 
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}


with sendmail command (i use this to send xml mails to the sms server):
define command {
command_name                   notify-by-epager
command_line                   /usr/bin/printf "%b" "From: 
xxxxxxx at 21torr.com\nTo: smsserver at xxxxxxxxxxx\nSubject: SEND SMS\n<?xml 
version=\"1.0\" encoding=\"iso-8859-1\" ?>\n<batch password=\"xxxxxxxxxx\"
cid=\"xxxxxxxx\">\n<sms>\n<to>$CONTACTPAGER$</to>\n<from>0049171234567</from>\n<text>Service: 
$SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: 
$SERVICESTATE$\nInfo: $OUTPUT$\nDate: 
$DATETIME$</text>\n</sms>\n</batch>" | /usr/sbin/sendmail -t
}

Try one of these, it should work for you.

Regards
Andreas Schrogl




Nicole Hähnel wrote:
> Hi,
> after solving most of my troubles with nagios with the help of this mailing
> list
> it's working very good.
> But how do I send mails?
> By default nagios uses the mail command, but this cannot send to another
> machine?!
> Do I need to configure a MTA sth. like sendmail (or procmail?) to send
> the mail to our internal domino-mail server?
> If so, can anybody help me to configure it?
> We have a domino server behind our FW which accepts mails per smtp,
> but how do send mail to this server?
> 
> Thanks
> Nicole
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 

-- 
Andreas Schrogl                   21TORR AGENCY GmbH
Email:a.schrogl at 21torr.com        System Administrator
Tel: +49-711-62 00 91-339         Augustenstrasse 124
Fax: +49-711-62 00 91-399         D-70197 Stuttgart

21TORR - die neue medien leidenschaft

www.21torr.com



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list