Nagios running fine, but don't send Email :(

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.
Locked
giorgio
Posts: 4
Joined: Tue Oct 18, 2011 10:22 am
Location: Italy

Nagios running fine, but don't send Email :(

Post by giorgio »

Hi all,

I hope it is a good day for you, because is not for me :)

I have Nagios set up and running fine, except for email notifications.
I checked the nagios debug output, and it seems to be invoking the mail command fine, and returning ok, however no email is sent. In the mail.log file, there is also no output.

I don't know if that issue is related, but yesterday, before the stopping that the receiving the email, I've installed the plugin "check_snmp_netint.pl".

Because that plugins seems not worikng in the first instance, I made some changes into the system ( Linux version 2.6.18-274.3.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)).
In particular to use that plugin, I find a FAQ (http://nagios.manubulon.com/ ) I follow that:
The scripts outputs "Can't locate Net/SNMP.pm in @INC....."
You don't have Net::SNMP installed, see below
How do I install Net::SNMP perl module ?
There are 2 ways of doing thi
1) By CPAN (best
on command line, as root
[your_host]# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.76)
ReadLine support enabled
cpan> install Net::SNMP
If it's the first time you run CPAN, it will probably ask you some (simple) questions.
CPAN will also ask you to satisfy some dependencies (Crypt::DES, Digest::MD5, etc..).

Now that plugin is working fine with nagios... only I don't receive the email by nagios.

Sending an email using user nagios by cli & webmin is working fine.
nagios.cfg is configured to send the email.

I don't have any idea where to see...
Could anyone help me?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios running fine, but don't send Email :(

Post by lmiltchev »

Did you check if your notifications are still enabled? I've seen cases when notifications got disabled for some reason and no e-mails were sent out. Check in your "/usr/local/nagios/etc/nagios.cfg" file for the line: "enable_notifications=1". If it is set to "0", change it to "1".
Be sure to check out our Knowledgebase for helpful articles and solutions!
giorgio
Posts: 4
Joined: Tue Oct 18, 2011 10:22 am
Location: Italy

Re: Nagios running fine, but don't send Email :(

Post by giorgio »

Hi lmiltchev,

thank's for your reply.
I confirm you, the configuration is ok. See Below:

[root@xxxxx etc]# cat nagios.cfg | grep noti
# If you don't want notifications to be logged, set this value to 0.
# If notifications should be logged, set the value to 1.
log_notifications=1
# service checks, host checks, event handlers, notifications, the
notification_timeout=30
# service options. For example, you can disable host notifications for
# a contact, but leave service notifications enabled for them.
# service notifications when it is initially (re)started.
# Values: 1 = enable notifications, 0 = disable notifications
enable_notifications=1
# notifications for that host/service until it stops
# stripped from macros before being used in notifications, event
# using the $ADMINEMAIL$ and $ADMINPAGER$ macros in your notification
# and system commands (event handlers, notifications, etc.) are

Any Idea?
giorgio
Posts: 4
Joined: Tue Oct 18, 2011 10:22 am
Location: Italy

Re: Nagios running fine, but don't send Email :(

Post by giorgio »

Hi lmiltchev,

thank's you for your relpy.

I've checked the nagios.cfg. The value of the notification is right now:
enable_notifications=1

?__? Any idea
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios running fine, but don't send Email :(

Post by jsmurphy »

If you check your /var/log/mail log file does that provide any clues? Are you able to post the results of an email attempt from the logs.
giorgio
Posts: 4
Joined: Tue Oct 18, 2011 10:22 am
Location: Italy

Re: Nagios running fine, but don't send Email :(

Post by giorgio »

Hi jsmurphy,

the /var/log/mail log don't show any messages to understand if all works fine or not.
But @ in this moment, I've reset all the configuration, and i go to add step by step all objects host and checks

About that issue... I don't know if is my own to close the post or not...

Thank's for the suggestion to all.
I inform you if the issue occours... again!

CIAO! :D
monical
Posts: 1
Joined: Fri Nov 04, 2011 11:40 am

Re: Nagios running fine, but don't send Email :(

Post by monical »

Hope you get it sorted. Have to say, this has never caused a problem for me.
Locked