Page 1 of 2

Issue with Performance Grapher in Nagios XI

Posted: Mon Feb 17, 2020 5:44 am
by RIDS_I2MP
Hi Team,

We are seeing issue with Performance Grapher in Nagios XI. We tried to start it from GUI, we are not able to do so. We are using Nagios XI 5.6.8 version. We found that "npcd" service is not running. We tried to restart the service but, unable to do it. Below is the error:

[root@eu2napu003 hosts]# systemctl restart npcd.service
Job for npcd.service failed because the control process exited with error code. See "systemctl status npcd.service" and "journalctl -xe" for details.
[root@eu2napu003 hosts]#

We checked the status as below:

[root@eu2napu003 hosts]# systemctl status npcd.service
● npcd.service - LSB: Nagios NPCD Initscript
Loaded: loaded (/etc/rc.d/init.d/npcd; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2020-02-17 09:26:01 GMT; 19min ago
Docs: man:systemd-sysv-generator(8)
Process: 31306 ExecStart=/etc/rc.d/init.d/npcd start (code=exited, status=1/FAILURE)
Main PID: 14670 (code=exited, status=0/SUCCESS)

Feb 17 09:26:01 eu2napu003 systemd[1]: Starting LSB: Nagios NPCD Initscript...
Feb 17 09:26:01 eu2napu003 npcd[31306]: An error occured while reading your config on line 146
Feb 17 09:26:01 eu2napu003 npcd[31306]: Message was: "Could not open pidfile '/usr/local/nagiosxi/var/subsys/npcd.pid': No such file or directory"
Feb 17 09:26:01 eu2napu003 systemd[1]: npcd.service: control process exited, code=exited status=1
Feb 17 09:26:01 eu2napu003 npcd[31306]: Could not start NPCD
Feb 17 09:26:01 eu2napu003 systemd[1]: Failed to start LSB: Nagios NPCD Initscript.
Feb 17 09:26:01 eu2napu003 systemd[1]: Unit npcd.service entered failed state.
Feb 17 09:26:01 eu2napu003 systemd[1]: npcd.service failed.
[root@eu2napu003 hosts]#


I checked the perfdata.log file as well:

[root@eu2napu003 pnp]# tail -f /usr/local/nagios/var/perfdata.log
2020-01-30 04:30:59 [1507] [0] *** TIMEOUT: Timeout after 5 Sec. ****
2020-01-30 04:30:59 [1507] [0] *** TIMEOUT: Deleting current file to avoid NPCD loops
2020-01-30 04:30:59 [1507] [0] *** TIMEOUT: Please check your process_perfdata.cfg
2020-01-30 04:30:59 [1507] [0] *** TIMEOUT: /usr/local/nagios/var/spool/perfdata//1580358635.perfdata.service-PID-1507 deleted
2020-01-30 04:30:59 [1507] [0] *** process_perfdata.pl terminated on signal ALRM
2020-01-30 04:30:59 [1508] [0] *** TIMEOUT: Timeout after 5 Sec. ****
2020-01-30 04:30:59 [1508] [0] *** TIMEOUT: Deleting current file to avoid NPCD loops
2020-01-30 04:30:59 [1508] [0] *** TIMEOUT: Please check your process_perfdata.cfg
2020-01-30 04:30:59 [1508] [0] *** TIMEOUT: /usr/local/nagios/var/spool/perfdata//1580358650.perfdata.service-PID-1508 deleted
2020-01-30 04:30:59 [1508] [0] *** process_perfdata.pl terminated on signal ALRM
^C


[root@eu2napu003 pnp]# tail -f /usr/local/nagios/var/npcd.log
[01-29-2020 04:45:52] NPCD: ERROR: Executed command exits with return code '1'
[01-29-2020 04:45:52] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /usr/local/nagios/var/spool/perfdata//1580273135.perfdata.host'
[01-29-2020 04:45:52] NPCD: ERROR: Executed command exits with return code '1'
[01-29-2020 04:45:52] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /usr/local/nagios/var/spool/perfdata//1580273136.perfdata.service'
[01-30-2020 04:30:59] NPCD: ERROR: Executed command exits with return code '1'
[01-30-2020 04:30:59] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /usr/local/nagios/var/spool/perfdata//1580358634.perfdata.host'
[01-30-2020 04:30:59] NPCD: ERROR: Executed command exits with return code '1'
[01-30-2020 04:30:59] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /usr/local/nagios/var/spool/perfdata//1580358635.perfdata.service'
[01-30-2020 04:30:59] NPCD: ERROR: Executed command exits with return code '1'
[01-30-2020 04:30:59] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /usr/local/nagios/var/spool/perfdata//1580358650.perfdata.service'


We referred to https://support.nagios.com/kb/article.php?id=9 as well and made the changes accordingly, still the issue persists.

Please help us on the same.

Thanks in advance!!

Re: Issue with Performance Grapher in Nagios XI

Posted: Mon Feb 17, 2020 9:24 am
by scottwilkerson
RIDS_I2MP wrote:Feb 17 09:26:01 eu2napu003 npcd[31306]: An error occured while reading your config on line 146
You're getting the error above that is stopping it from starting, can you post the output of the following so we can see what is erroring on line 146

Code: Select all

cat /usr/local/nagios/etc/pnp/npcd.cfg

Re: Issue with Performance Grapher in Nagios XI

Posted: Tue Feb 18, 2020 4:48 am
by RIDS_I2MP
Hi,

PFB the output for cat /usr/local/nagios/etc/pnp/npcd.cfg command:

[nagios@eu2napu003 pnp]$ cat /usr/local/nagios/etc/pnp/npcd.cfg
# NPCD.cfg - sample configuration file for PNPs NPCD
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# $Id: npcd.cfg-sample.in 440 2008-04-24 09:08:20Z hendrikb $

# Privilege Options

user = nagios
group = nagios


# Logging Options

# log_type - define if you want your logs to
# 'syslog' or to a 'file'
#
# log_type = <value>
#

log_type = file
#log_type = syslog


# log_file - define a path to your logfile
# needed if 'log_type'='file'
#
# log_file = </path/to/logpath/filename>
#

log_file = /usr/local/nagios/var/npcd.log


# max_logfile_size - defines the maximum filesize (bytes)
# before the logfile will rotated.
#
# max_logfile_size = <value> (default 10Mbyte)
#

max_logfile_size = 10485760


# log_level - how much should we log?
#
# log_level = <integer value>
#
# 0 = No logging - except errors
# 1 = Small logging - some few more output
# 2 = More Logging (actual ALL logs)
# -1 = DEBUG Mode - ALL Logging and slower processing
#

log_level = -1


# NEEDED OPTIONS
#
# perfdata_spool_dir - where we can find the
# performance data files
#
# perfdata_spool_dir = </path/to/directory/>
#

perfdata_spool_dir = /usr/local/nagios/var/spool/perfdata/


# Execute following command for each found file
# in 'perfdata_spool_dir'
#
# perfdata_file_run_cmd = </path/to/command>
#
# Must be executable by user/group from above
#
# perfdata_file_run_cmd = </path/to/filename>
#

perfdata_file_run_cmd = /usr/local/nagios/libexec/process_perfdata.pl


# perfdata_file_run_cmd_args (optional)
#
# If you wish, you can apply more arguments to the
# perfdata_file_run_cmd
#
# Hint:
# NPCD will create a command line like this:
# '<perfdata_file_runc_cmd> <perfdata_file_runc_cmd_args> <filename_from_spool_dir>'
#

perfdata_file_run_cmd_args = -b


# npcd_max_threads - define how many parallel threads we
# should start

npcd_max_threads = 5

# sleep_time - how many seconds should npcd wait between dirscans
#
# sleep_time = 15 (default)

sleep_time = 15


# EXPERIMENTAL
#
# use_load_threshold - enables/disables load watching
#
# use_load_threshold = <0 / 1> (default: 0)
#

#use_load_threshold = 0


# EXPERIMENTAL
#
# load_threshold - npcd won't start new threads
# if your system load is over this threshold
#
# load_threshold = <float value> (default: 10.0)
#
# Hint: Do not use "," as decimal delimeter
#

load_threshold = 10.0


# location of your pid file

#pid_file=/var/run/npcd.pid
pid_file=/usr/local/nagiosxi/var/subsys/npcd.pid


# We have to end with a newline
[nagios@eu2napu003 pnp]$

Re: Issue with Performance Grapher in Nagios XI

Posted: Tue Feb 18, 2020 8:20 am
by scottwilkerson
Hmm, that looks normal, Can you post the output of the following commands

Code: Select all

ls -ld /usr/local/nagiosxi/var/subsys
ls -ld /usr/local/nagiosxi/var
ls -ld /usr/local/nagiosxi
df -h

Re: Issue with Performance Grapher in Nagios XI

Posted: Wed Feb 19, 2020 2:31 am
by RIDS_I2MP
Hi,

Below is the output:

[root@eu2napu003 var]# pwd
/usr/local/nagiosxi/var
[root@eu2napu003 var]# ls -ld /usr/local/nagiosxi/var/subsys
ls: cannot access /usr/local/nagiosxi/var/subsys: No such file or directory
[root@eu2napu003 var]# ls -ld /usr/local/nagiosxi/var
drwxrwxr-x 5 nagios nagios 4096 Feb 19 07:30 /usr/local/nagiosxi/var
[root@eu2napu003 var]# ls -ld /usr/local/nagiosxi
drwxr-xr-x 10 root nagios 4096 Feb 5 2014 /usr/local/nagiosxi
[root@eu2napu003 var]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv 9.1G 171M 8.4G 2% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 778M 7.0G 10% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/rootvg-usrlv 30G 25G 3.2G 89% /usr
/dev/sdb1 453M 115M 312M 27% /boot
/dev/mapper/rootvg-tmplv 9.1G 389M 8.2G 5% /tmp
/dev/mapper/rootvg-homelv 9.1G 3.7G 5.0G 43% /home
/dev/mapper/rootvg-varlv 110G 2.5G 102G 3% /var
/dev/mapper/rootvg-storelv 9.1G 5.7G 2.9G 67% /store
tmpfs 1.6G 0 1.6G 0% /run/user/1001
[root@eu2napu003 var]#

Re: Issue with Performance Grapher in Nagios XI

Posted: Wed Feb 19, 2020 7:15 am
by scottwilkerson
That's weird you are missing a directory

Lets run the following

Code: Select all

mkdir -p /usr/local/nagiosxi/var/subsys
chown nagios.nagios /usr/local/nagiosxi/var/subsys
chmod rwx+ug /usr/local/nagiosxi/var/subsys
systemctl restart npcd.service

Re: Issue with Performance Grapher in Nagios XI

Posted: Thu Feb 20, 2020 2:41 am
by RIDS_I2MP
Hi,

We have created the missing directory, its working now. We are good to close the ticket.
Thanks a lot!!

Re: Issue with Performance Grapher in Nagios XI

Posted: Thu Feb 20, 2020 4:21 am
by RIDS_I2MP
Hi,

We checked the graphs after starting npcd service.
We are not able to see any graph data. Do we need to perform any additional steps?

Re: Issue with Performance Grapher in Nagios XI

Posted: Thu Feb 20, 2020 7:58 am
by scottwilkerson
It may take a bit for them to appear, if you still have none, can you get a profile.zip from Admin -> System Profile and PM it to me for inspection

thanks

Re: Issue with Performance Grapher in Nagios XI

Posted: Thu Feb 20, 2020 9:13 am
by RIDS_I2MP
Hi,

We can see the graphs now.
We are good to close the ticket.

Thanks a lot again!!