Page 3 of 3

Re: Nagios HTML mail

Posted: Thu Nov 27, 2014 2:23 am
by ericosman
abrist wrote:
ericosman wrote:Nagios still wont sent mails to me but whenn i execute them in terminal i recive an mail...
Were you running it as user nagios?
Can you post the command definitions you are using?
Now edit the nagios/etc/objects/command.cfg and replace the [notify-service-by-email] block with the following Block...

define command{
command_name notify-service-by-email
command_line /usr/local/nagios/libexec/nagios_service_mail "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTALIAS$" "$HOSTSTATE$" "$HOSTADDRESS$" "$SERVICEOUTPUT$" "$SHORTDATETIME$" "$SERVICEDESC$" "$SERVICESTATE$" "$CONTACTEMAIL$" "$SERVICEDURATIONSEC$" "$SERVICEEXECUTIONTIME$" "$TOTALSERVICESWARNING$" "$TOTALSERVICESCRITICAL$" "$TOTALSERVICESUNKNOWN$" "$LASTSERVICEOK$" "$LASTSERVICEWARNING$" "$SERVICENOTIFICATIONNUMBER$"
}

Also replace the [notify-host-by-email] code block with this block below...

define command{
command_name notify-host-by-email
command_line /usr/local/nagios/libexec/nagios_host_mail "$NOTIFICATIONTYPE$" "$HOSTNAME$" "$HOSTALIAS$" "$HOSTSTATE$" "$HOSTADDRESS$" "$HOSTOUTPUT$" "$SHORTDATETIME$" "$SERVICEDESC$" "$SERVICESTATE$" "$CONTACTEMAIL$" "$TOTALHOSTSUP$" "$TOTALHOSTSDOWN$"
}

Re: Nagios HTML mail

Posted: Mon Dec 01, 2014 12:14 pm
by tmcdonald
When you ran the commands in the terminal and received the emails successfully, were you running the commands as the nagios user or as root? You will need to run them as nagios for a real test of their functionality.