Restarting Performance Grapher results in an error
Posted: Tue Nov 22, 2016 6:10 am
Hi,
Running Nagios XI 5.2.9 on Linux RHEL 6 x86-64.
When I restart Performance Grapher (NPCD) from the GUI (XI System Component Status), it comes back in error status (red exclamation mark).
I did some troubleshooting and found that the ownership of the PID file seems to be the problem.
1. after a reboot all systems are 'green'. NPCD runs with the following process info and the PID file is owned by nagios.nagcmd:
The privilege options in /usr/local/nagios/etc/pnp/npcd.cfg are:
Is this something that can be tweaked?
Running Nagios XI 5.2.9 on Linux RHEL 6 x86-64.
When I restart Performance Grapher (NPCD) from the GUI (XI System Component Status), it comes back in error status (red exclamation mark).
I did some troubleshooting and found that the ownership of the PID file seems to be the problem.
1. after a reboot all systems are 'green'. NPCD runs with the following process info and the PID file is owned by nagios.nagcmd:
2. After restart of NPCD in the GUI:$ ps aux | grep npcd
nagios 2245 0.0 0.0 368892 1028 ? S 10:28 0:00 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
$ ps -eo euser,ruser,suser,fuser,f,comm,label|grep npcd
nagios nagios nagios nagios 5 npcd system_u:system_r:initrc_t:s0
$ ls -l /usr/local/nagiosxi/var/subsys/npcd.pid
-rw-r-----. 1 nagios nagcmd 4 Nov 22 10:28 /usr/local/nagiosxi/var/subsys/npcd.pid
3. Changing ownership fixes the error: chown nagios. /usr/local/nagiosxi/var/subsys/npcd.pid$ ps aux | grep npcd
nagios 13876 0.0 0.0 162040 948 ? S 11:02 0:00 /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg
$ ps -e -o euser,ruser,suser,fuser,f,comm,label|grep npcd
nagios nagios nagios nagios 5 npcd system_u:system_r:initrc_t:s0
$ ls -l /usr/local/nagiosxi/var/subsys/npcd.pid
-rw-r-----. 1 root root 5 Nov 22 11:02 /usr/local/nagiosxi/var/subsys/npcd.pid
The privilege options in /usr/local/nagios/etc/pnp/npcd.cfg are:
NPCD is restarted as follows:# Privilege Options
user = nagios
group = nagios
So it appears that /etc/init.d/npcd, which is run at boot, sets the PID file correctly. But /usr/local/nagiosxi/scripts/manage_services.sh restart npcd does not.# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
...................................................PROCESSING COMMAND ID 209...
PROCESS COMMAND: CMD=113, DATA=a:1:{i:0;s:0:"";}
CMDLINE=sudo /usr/local/nagiosxi/scripts/manage_services.sh restart npcd
NPCD Stopped.
NPCD started.
OUTPUT=NPCD started.
RETURNCODE=0
Is this something that can be tweaked?