Notification email address questions

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Notification email address questions

Post by rkennedy »

derekb wrote:
tgriep wrote:What problems are you having?
Can you provide what you have done already and any errors that you are receiving?
Hi Tom!
We're on XI latest. I've uploaded the plugins and made the command as outlined in the read me. I have a host that I'm testing with. I've set it to contact myself via the command also mentioned in the read me. The contact is set to use host notifications via that new command.

/tmp/notifier.txt didn't exist , so I did a touch to create it. I simply don't see any data being written to this file when an event is triggered. I do see events written in /var/log/messages for the host, though.
What are the permissions on /tmp/notifier.txt? ls -l /tmp/notifier.txt The user nagios will need to be able to write to this file.
Former Nagios Employee
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: Notification email address questions

Post by derekb »

rkennedy wrote:
derekb wrote:
tgriep wrote:What problems are you having?
Can you provide what you have done already and any errors that you are receiving?
Hi Tom!
We're on XI latest. I've uploaded the plugins and made the command as outlined in the read me. I have a host that I'm testing with. I've set it to contact myself via the command also mentioned in the read me. The contact is set to use host notifications via that new command.

/tmp/notifier.txt didn't exist , so I did a touch to create it. I simply don't see any data being written to this file when an event is triggered. I do see events written in /var/log/messages for the host, though.
What are the permissions on /tmp/notifier.txt? ls -l /tmp/notifier.txt The user nagios will need to be able to write to this file.

Code: Select all

[root@nagios ~]# touch /tmp/notifier.txt
[root@nagios ~]# ls -l /tmp/notifier.txt
-rw-r--r-- 1 root root 0 Jul 19 10:55 /tmp/notifier.txt
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Notification email address questions

Post by rkennedy »

You need to adjust the permissions on it -

Code: Select all

chown nagios:nagios /tmp/notifier.txt
Former Nagios Employee
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: Notification email address questions

Post by derekb »

rkennedy wrote:You need to adjust the permissions on it -

Code: Select all

chown nagios:nagios /tmp/notifier.txt
Done.
-rw-r--r-- 1 nagios nagios 0 Jul 19 10:55 notifier.txt

I made a host go down and brought it back up ,but still don't see anything writing in the /tmp/notifier.txt file
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Notification email address questions

Post by ssax »

Did you make sure to check the prereqs?

Code: Select all

PRE-REQUISITES
--------------
perl MIME::Lite		in RedHat/Centos 6, yum install perl-MIME-Lite, 
			otherwise use CPAN to install it
perl-suidperl		in RedHat/CentOS 6, yum install perl-suidperl,
			other distros may already have this installed

Code: Select all

rpm -qa |grep "perl-MIME-Lite\|perl-suidperl"
Is it executable?

Code: Select all

chmod +x /usr/local/nagios/libexec/notifier.pl
What happens if you run it manually as the nagios user?

Code: Select all

su - nagios
/usr/local/nagios/libexec/notifier.pl
Are you seeing anything in your /var/log/cron?
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: Notification email address questions

Post by derekb »

I don't see anything in /var/log/cron for notifier.pl

Code: Select all

[root@nagios ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
*/1 * * * *   /usr/local/nagios/libexec/notifier.pl
I also still don't see anything being written to /tmp/notifier.txt.
If I run notifier.pl manually, it seems to try to rotate the file as a notifier.txt.0 will get created.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Notification email address questions

Post by ssax »

Change your /etc/crontab entry to:

Code: Select all

*/1 * * * * nagios /usr/local/nagios/libexec/notifier.pl
Let us know if that resolves the issue.
Locked