You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi to all readers,
I would like to send a clean e-mail with postfix using nagios notifier.As you may have seen, defauts emails are ugly.
I thought bout sending an html email using postfix, shell, and perl. Here are the files i used. 2 files that i have modified (notifier.cfg and a new shell file i created and put in /srv/eyesofnetwork/notifier/etc ) All files have 777 permissions as i am just testing it.
By defaut, i received emails starting with "eyesofnetwork" (please don't count the number of "*", if you are used to EON, you may know what i' talking about). I then added the 2 files below, gave them 777 permissions, and changed the nagios command (see below). I then received a notification starting with "Nagios" (again, please don't count the number or ""). It means EOn wasn't using the same command (eon_host_notifier and notify_by_email_host). Why another command was used ? i still don't know.
I used theses commands in command line interface, using values instead ot arguments ($1 ->9 ) and it worked perfectly.
Where is the problem pleasE ?
Hi to all readers,
I would like to send a clean e-mail with postfix using nagios notifier.As you may have seen, defauts emails are ugly.
I thought bout sending an html email using postfix, shell, and perl. Here are the files i used. 2 files that i have modified (notifier.cfg and a new shell file i created and put in /srv/eyesofnetwork/notifier/etc ) All files have 777 permissions as i am just testing it.
By defaut, i received emails starting with "eyesofnetwork" (please don't count the number of "*", if you are used to EON, you may know what i' talking about). I then added the 2 files below, gave them 777 permissions, and changed the nagios command (see below). I then received a notification starting with "Nagios" (again, please don't count the number or ""). It means EOn wasn't using the same command (eon_host_notifier and notify_by_email_host). Why another command was used ? i still don't know.
I used theses commands in command line interface, using values instead ot arguments ($1 ->9 ) and it worked perfectly.
Where is the problem pleasE ?
**** notifier.pl
$NOTIFICATIONTYPE$ $HOSTNAME$ $HOSTSTATE$ $HOSTADDRESS$ $HOSTOUTPUT$ $LONGDATETIME$ $HOSTSTATE$ $HOSTNAME$ $CONTACTEMAIL$
$NOTIFICATIONTYPE$ $HOSTNAME$ $HOSTSTATE$ $HOSTADDRESS$ $HOSTOUTPUT$ $LONGDATETIME$ $HOSTSTATE$ $HOSTNAME$ $CONTACTEMAIL$
0
<log_file>/srv/eyesofnetwork/notifier/log/notifier.log</log_file>
email-host = /srv/eyesofnetwork/notifier/etc/sendmail.sh
email-service =/srv/eyesofnetwork/notifier/etc/sendmail.sh
****sendmail.sh
#!/bin/sh
(
***** EYESOFNETWORK *****echo "To: $9
echo "Subject: Host $7 alert for $8 !"
echo "Content-Type: text/html"
echo "MIME-Version: 1.0"
echo ""
echo -e '
Notification Type: $1
Host: $2
Address: $4
state: $3
Date/time: $5
Additional Info: $6
' ) | /usr/sbin/sendmail -t
****the nagios command
$USER3$ /bin/notifier.pl -t host -c $USER3$ /etc/notifier.cfg -r $USER3$ /etc/notifier.rules -T "$LONGDATETIME$" -h "$HOSTNAME$" -e "$HOSTSTATE$" -i "$HOSTADDRESS$" -n "$NOTIFICATIONTYPE$" -C "$CONTACTEMAIL$" -O "$HOSTOUTPUT$" -A "$HOSTGROUPNAME$" -G "$CONTACTGROUPNAMES$" -X "$TIME$" -Y "$HOSTNOTIFICATIONNUMBER$"
The text was updated successfully, but these errors were encountered: