Nagios Emails not working -
i've tried figure out im failing or maybe im overlooking something. i've setup nagios server , clients. problem im having server not send email contact or contactgroup. instead see notifications in /var/log/syslog (ubuntu server).
postfix installed fine , have sent numerous tests using mail , mailx (read somewhere mailx preferred nagios3).
i should mention, same problem happening on icinga runs on same host.
any appreciated.
thanks,
patrick
you config file command.cfg should have similar this:
define command{ command_name notify-host-by-email command_line /usr/bin/printf "%b" "***** nagios *****\n\nnotification type: $notificationtype$\nhost: $hostname$\nstate: $hoststate$\naddress: $hostaddress$\ninfo: $hostoutput$\n\ndate/time: $longdatetime$\n" | /usr/bin/mail -s "** $notificationtype$ host alert: $hostname$ $hoststate$ **" $contactemail$ } define command{ command_name notify-service-by-email command_line /usr/bin/printf "%b" "***** nagios *****\n\nnotification type: $notificationtype$\n\nservice: $servicedesc$\nhost: $hostalias$\naddress: $hostaddress$\nstate: $servicestate$\n\ndate/time: $longdatetime$\n\nadditional info:\n\n$serviceoutput$" | /usr/bin/mail -s "** $notificationtype$ service alert: $hostalias$/$servicedesc$ $servicestate$ **" $contactemail$ } and edit file contact.cfg looks this:
define contact{ contact_name nagiosadmin ; short name of user use generic-contact ; inherit default alias nagios admin ; full name of user email tandn@eposi.vn ; <<***** change email } afterwards, check nagios restart it:
sudo /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg sudo /etc/init.d/nagios restart
Comments
Post a Comment