Code: Select all
/usr/local/nagios/var
I want to see the sendemail log file which is here.
Code: Select all
/var/log/sendemail
Code: Select all
/usr/local/nagios/var
Code: Select all
/var/log/sendemail
Code: Select all
/var/log/sendemail
Code: Select all
/var/log/sendemail
Code: Select all
[1554795345] wproc: NOTIFY job 24 from worker Core Worker 26250 is a non-check helper but exited with return code 1
[1554795345] wproc: host=KPI_VPC; service=(none); contact=nagiosadmin
[1554795345] wproc: early_timeout=0; exited_ok=1; wait_status=256; error_code=0;
[1554795345] wproc: stdout line 01: Apr 09 10:35:45 ubuntu sendemail[26823]: ERROR => You must specify a 'from' field! Try --help.
In your command definition, you are using the $USER5$ macro as the from address.-f ADDRESS
from (sender) email address
Code: Select all
command_line /usr/bin/printf "%b%b%b%b%b%b%b" "***** Nagios *****\n\n" "Notification Type: $NOTIFICATIONTYPE$\n" "Host: $HOSTNAME$\n" "State: $HOSTSTATE$\n" "Address: $HOSTADDRESS$\n" "Info: $HOSTOUTPUT$\n\n" "Date/Time: $LONGDATETIME$\n" | /usr/bin/sendemail -s $USER7$ -l /var/log/sendemail -f $USER5$ -t $CONTACTEMAIL$ -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
Code: Select all
resource_file=/usr/local/nagios/etc/resource.cfg
I ve resource.cfg file setting is in tje nagios.cfg file.tgriep wrote:I setup a email command like your notify-host-by-email command and it worked on my system.
The only difference is that I put it all on one line like this.I think that is the issue as the sendemail command may not be processing the from line.Code: Select all
command_line /usr/bin/printf "%b%b%b%b%b%b%b" "***** Nagios *****\n\n" "Notification Type: $NOTIFICATIONTYPE$\n" "Host: $HOSTNAME$\n" "State: $HOSTSTATE$\n" "Address: $HOSTADDRESS$\n" "Info: $HOSTOUTPUT$\n\n" "Date/Time: $LONGDATETIME$\n" | /usr/bin/sendemail -s $USER7$ -l /var/log/sendemail -f $USER5$ -t $CONTACTEMAIL$ -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
Couple of other things, make sure the resource.cfg file setting is in the nagios.cfg file.Restart the nagios process to make sure it loads the settings.Code: Select all
resource_file=/usr/local/nagios/etc/resource.cfg