Emails not recieved from Nagios

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.
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Emails not recieved from Nagios

Post by nathanplatt »

Code: Select all

[1452259965] wproc: NOTIFY job 16 from worker Core Worker 24096 is a non-check helper but exited with return code 255
[1452259965] wproc:   host=AD1; service=(none); contact=itsupport
[1452259965] wproc:   early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1452259965] wproc:   stdout line 01: Error: no recipients have been provided
[1452259965] wproc:   stdout line 02: Usage: /usr/local/nagios/libexec/nagios_send_host_mail.pl [-v] [-V] [-h] [-t] [-H <SMTP host>] [-p <customername>]
[1452259965] wproc:   stdout line 03:        [-r <to_recipients>] or -g <to_group>] [-c <cc_recipients>] [-b <bcc_recipients>]
[1452259965] wproc:   stdout line 04:        [-f <text|html|multi|graph>] [-u] [-l <en|jp|fr|de|(or other languages if added)>]
I've checked the logs and this seems to be the case, so I added into the commands.cfg

Code: Select all

# 'service-email-html-int-en' command definition
# sends HTML e-mails in English and includes Nagios URL for Intranet access
define command{
        command_name    service-email-html-int-en
        command_line    /usr/local/nagios/libexec/nagios_send_service_mail.pl \
-p "Ramsdens Financial" \
-H 192.168.87.114 \
-c "$CONTACTADDRESS1$" \
-f multi -u
}

# 'host-email-html-int-en' command definition
# sends HTML e-mails in English and includes Nagios URL for Intranet access
define command{
        command_name    host-email-html-int-en
        command_line    /usr/local/nagios/libexec/nagios_send_host_mail.pl \
-p "Ramsdens Financial" \
-H 192.168.87.114 \
-c "$CONTACTADDRESS1$" \
-f multi -u
}
The contacts.cfg

Code: Select all

define contact{
        contact_name                    itsupport
        alias                           IT Support
        service_notification_period     workhours
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   service-email-html-int-en
        host_notification_commands      host-email-html-int-en
        email                           [email protected]
        }
so i must not be passing the variable across, any idea?
nathanplatt
Posts: 267
Joined: Thu May 07, 2015 4:59 am

Re: Emails not recieved from Nagios

Post by nathanplatt »

I've solved this now, thanks for all the help. I had to enable macros in the nagios.cfg file.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Emails not recieved from Nagios

Post by bwallace »

Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked