Emails not recieved from Nagios
Posted: Thu Jan 07, 2016 7:25 am
Hi Everyone,
I've had to rebuild my Nagios on a new physical server, I'm using Ubuntu Server 14.04.3 LTS with the latest build of Nagios. I've managed to port all the relevant .cfg files from the old server to the new server but the emails aren't working.
I'm using Postfix and have tested this, email are received. So i can only see it as a Nagios Problem, I also use a script from http://nagios.fm4dd.com/howto/nagios-fl ... ations.htm
The commands.cfg looks like this;
I ran 'which mail'
I can email straight from POSTFIX to myself, Mailserver is ping able and the script itself works;
The contacts.cfg
Any ideas?
Nathan
I've had to rebuild my Nagios on a new physical server, I'm using Ubuntu Server 14.04.3 LTS with the latest build of Nagios. I've managed to port all the relevant .cfg files from the old server to the new server but the emails aren't working.
I'm using Postfix and have tested this, email are received. So i can only see it as a Nagios Problem, I also use a script from http://nagios.fm4dd.com/howto/nagios-fl ... ations.htm
The commands.cfg looks like this;
Code: Select all
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
#
################################################################################
# '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" \
-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" \
-f multi -u
}
Code: Select all
nagios@nagios:/usr/local/nagios/etc/objects$ which mail
/usr/bin/mail
Code: Select all
nagios@nagios:/usr/local/nagios/libexec$ ./nagios_send_host_mail.pl
Error: no recipients have been provided
Usage: ./nagios_send_host_mail.pl [-v] [-V] [-h] [-t] [-H <SMTP host>] [-p <customername>]
[-r <to_recipients>] or -g <to_group>] [-c <cc_recipients>] [-b <bcc_recipients>]
[-f <text|html|multi|graph>] [-u] [-l <en|jp|fr|de|(or other languages if added)>]
nagios@nagios:/usr/local/nagios/libexec$ ./nagios_send_service_mail.pl
Error: no recipients have been provided
Usage: ./nagios_send_service_mail.pl [-v] [-V] [-h] [-t] [-H <SMTP host>] [-p <customername>]
[-r <to_recipients> or -g <to_group>] [-c <cc_recipients>] [-b <bcc_recipients>]
[-f <text|html|multi|graph>] [-u] [-l <en|jp|fr|de|(or other languages if added)>]
nagios@nagios:/usr/local/nagios/libexec$
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]
}
define contact{
contact_name marketing
alias Marketing Department
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]
}
Nathan