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.derekb wrote:Hi Tom!tgriep wrote:What problems are you having?
Can you provide what you have done already and any errors that you are receiving?
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.
Notification email address questions
Re: Notification email address questions
Former Nagios Employee
Re: Notification email address questions
rkennedy wrote: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.derekb wrote:Hi Tom!tgriep wrote:What problems are you having?
Can you provide what you have done already and any errors that you are receiving?
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.
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
Re: Notification email address questions
You need to adjust the permissions on it -
Code: Select all
chown nagios:nagios /tmp/notifier.txt
Former Nagios Employee
Re: Notification email address questions
Done.rkennedy wrote:You need to adjust the permissions on it -Code: Select all
chown nagios:nagios /tmp/notifier.txt
-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
Re: Notification email address questions
Did you make sure to check the prereqs?
Is it executable?
What happens if you run it manually as the nagios user?
Are you seeing anything in your /var/log/cron?
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 installedCode: Select all
rpm -qa |grep "perl-MIME-Lite\|perl-suidperl"Code: Select all
chmod +x /usr/local/nagios/libexec/notifier.plCode: Select all
su - nagios
/usr/local/nagios/libexec/notifier.plRe: Notification email address questions
I don't see anything in /var/log/cron for 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.
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
If I run notifier.pl manually, it seems to try to rotate the file as a notifier.txt.0 will get created.
Re: Notification email address questions
Change your /etc/crontab entry to:
Let us know if that resolves the issue.
Code: Select all
*/1 * * * * nagios /usr/local/nagios/libexec/notifier.pl