More troubleshooting:
Changed the following:
/usr/local/nagios/etc/nagios.cfg
Changed log_event_handlers=0 to log_event_handlers=1
Did a sweep of the config and all fine as shown below
Code: Select all
[root@NagiosXI etc]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.0.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-29-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 50838 services.
Checked 687 hosts.
Checked 2 host groups.
Checked 75 service groups.
Checked 9 contacts.
Checked 4 contact groups.
Checked 115 commands.
Checked 15 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 687 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 15 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@NagiosXI etc]#
========================================================
Found this error when bringing up /usr/local/nagios/var/nagios.log:
Code: Select all
Jun 4 22:58:36 NagiosXI nagios: Error: Could not create external command file '/usr/local/nagios/var/rw/nagios.cmd' as named pipe: (17) -> File exists. If this file already exists and you are sure that another copy of Nagios is not running, you should delete this file.
Did the following to try repair it:
Code: Select all
[root@NagiosXI etc]# ll /usr/local/nagios/var/rw/nagios.cmd
-rw-rw-r-- 1 root nagcmd 726 Jun 4 23:03 /usr/local/nagios/var/rw/nagios.cmd
[root@NagiosXI etc]#
- Changed permissions to nagios:nagcmd of /usr/local/nagios/var/rw/nagios.cmd but after nagios service restart it reverts back to root:nagcmd
Did this to fix it:
Code: Select all
/etc/init.d/nagios stop
cd /usr/local/nagios/var/rw/
ls
rm -rf nagios.cmd
mkfifo nagios.cmd
chown nagios:nagcmd nagios.cmd
ll
chmod 660 nagios.cmd
service nagios start
Permissions fixed it seems as shown below:
Code: Select all
prw-rw---- 1 nagios nagcmd 0 Jun 4 23:22 nagios.cmd
I restarted snmptt and now SNMP are now flowing

, I am a happy camper.
I still have an underlying issue as when I apply all my config changes and nagios restarts nagios.cmd revert back to the root:nagcmd.
Temporarily I made this script to help me out.
Code: Select all
#!/bin/bash
/etc/init.d/nagios stop;
rm -rf /usr/local/nagios/var/rw/nagios.cmd;
mkfifo /usr/local/nagios/var/rw/nagios.cmd;
chown nagios:nagcmd /usr/local/nagios/var/rw/nagios.cmd;
chmod 660 /usr/local/nagios/var/rw/nagios.cmd;
service nagios start;
service snmptt restart;
I am also seeing the following process:
Code: Select all
[root@NagiosXI rw]# ps -aux |grep '<defunct>'
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
nagios 7699 0.1 0.0 0 0 ? Z 00:28 0:00 [nagios] <defunct>
BTW when I installed the new Nagios 2014R1.1 yesterday the only thing I did is download the tarball and ran ./upgrade that's all.
Should I have done this before ? ./configure --with-nagios-user=nagios --with-nagios-group=nagios
If this is the case what can I do now that it's already installed :/
If anyone could give me a permanent fix it would be greatly appreciated.
Michael