Page 1 of 1

Restarting Performance Grapher results in an error

Posted: Tue Nov 22, 2016 6:10 am
by mvndnburg
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:
$ 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
2. After restart of NPCD in the GUI:
$ 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
3. Changing ownership fixes the error: chown nagios. /usr/local/nagiosxi/var/subsys/npcd.pid


The privilege options in /usr/local/nagios/etc/pnp/npcd.cfg are:
# Privilege Options

user = nagios
group = nagios
NPCD is restarted as follows:
# 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
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.

Is this something that can be tweaked?

Re: Restarting Performance Grapher results in an error

Posted: Tue Nov 22, 2016 11:46 am
by avandemore
How was your install done? Has it been modified in any way?

My clean install of XI 5.2.9 on CentOS 6 gives the following:

Code: Select all

[email protected]'s password:
Last login: Thu Oct 13 15:42:03 2016 from 192.168.5.16
[root@avandemore-centos6 ~]# ll /usr/local/nagiosxi/var/subsys/npcd.pid
-rw-r--r--. 1 root root 4 Nov 22 10:37 /usr/local/nagiosxi/var/subsys/npcd.pid
[root@avandemore-centos6 ~]# ll /usr/local/nagiosxi/var/subsys/npcd.pid
-rw-r--r-- 1 root root 4 Nov 22 10:39 /usr/local/nagiosxi/var/subsys/npcd.pid
I am unable to account for the behavior you're seeing.

/usr/local/nagiosxi/scripts/manage_services.sh uses the same init script.

Re: Restarting Performance Grapher results in an error

Posted: Tue Nov 22, 2016 11:57 am
by mvndnburg
That snapshot helped.

Changing the permissions on the PID file from 640 to 644 made the error go away, so it appears to be a umask setting.

You can go ahead and close the thread.

Re: Restarting Performance Grapher results in an error

Posted: Tue Nov 22, 2016 11:59 am
by avandemore
Good to hear your issue is resolved. If you have further issues please open a new thread or ticket.