Nagios HTML mail

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
ericosman
Posts: 20
Joined: Thu Oct 30, 2014 4:11 am

Re: Nagios HTML mail

Post 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$"
}
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios HTML mail

Post 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.
Former Nagios employee
Locked