Graph are not shown in PNP4NAGIOS


(Usama) #1

Hello All,

I getting an issue on nagios core PNP graphs can’t load for all hosts and services as you can see in attached screenshot.

perl verify_pnp_config --mode bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc/
[INFO] ========== Starting Environment Checks ============
[INFO] My version is: verify_pnp_config-0.6.26-R.44
[INFO] Start Options: verify_pnp_config --mode bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc/
[INFO] Reading /usr/local/nagios/etc/nagios.cfg
[OK ] Running product is ‘nagios’
[OK ] object_cache_file is defined
[OK ] object_cache_file=/usr/local/nagios/var/objects.cache
[INFO] Reading /usr/local/nagios/var/objects.cache
[OK ] resource_file is defined
[OK ] resource_file=/usr/local/nagios/etc/resource.cfg
[INFO] Reading /usr/local/nagios/etc/resource.cfg
[INFO] Reading /usr/local/pnp4nagios/etc//process_perfdata.cfg
[INFO] Reading /usr/local/pnp4nagios/etc//pnp4nagios_release
[OK ] Found PNP4Nagios version “0.6.26”
[OK ] Configured User is ‘nagios’
[OK ] Effective User is ‘nagios’
[OK ] User nagios exists with ID ‘533’
[OK ] Configured Group is ‘nagios’
[OK ] Effective group is ‘nagios’
[OK ] Group nagios exists with ID ‘533’
[INFO] ========== Checking Bulk Mode + NPCD Config ============
[OK ] process_performance_data is 1 compared with ‘/1/’
[OK ] service_perfdata_file is defined
[OK ] service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
[OK ] service_perfdata_file_template is defined
[OK ] service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
[OK ] PERFDATA template looks good
[OK ] service_perfdata_file_mode is defined
[OK ] service_perfdata_file_mode=a
[OK ] service_perfdata_file_processing_interval is defined
[OK ] service_perfdata_file_processing_interval=15
[OK ] service_perfdata_file_processing_command is defined
[OK ] service_perfdata_file_processing_command=process-service-perfdata-file
[OK ] host_perfdata_file is defined
[OK ] host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
[OK ] host_perfdata_file_template is defined
[OK ] host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
[OK ] PERFDATA template looks good
[OK ] host_perfdata_file_mode is defined
[OK ] host_perfdata_file_mode=a
[OK ] host_perfdata_file_processing_interval is defined
[OK ] host_perfdata_file_processing_interval=15
[OK ] host_perfdata_file_processing_command is defined
[OK ] host_perfdata_file_processing_command=process-host-perfdata-file
[CRIT] service_perfdata_command is defined (service_perfdata_command=process-service-perfdata)
[CRIT] service_perfdata_command is not allowed in mode ‘bulk+npcd’
[CRIT] host_perfdata_command is defined (host_perfdata_command=process-host-perfdata)
[CRIT] host_perfdata_command is not allowed in mode ‘bulk+npcd’

perfdata.log:

2018-09-11 22:09:15 [13397] [0] RRDs::update /usr/local/pnp4nagios/var/perfdata/.pnp-internal/runtime_update.rrd 1536689339:4
2018-09-11 22:09:15 [13397] [0] RRDs::update ERROR /usr/local/pnp4nagios/var/perfdata/.pnp-internal/runtime_update.rrd: illegal attempt to update using time 1536689339 when last update time is 1536689340 (minimum one second step)
2018-09-11 22:09:15 [13397] [0] RRDs::update /usr/local/pnp4nagios/var/perfdata/.pnp-internal/runtime_create.rrd 1536689339:0
2018-09-11 22:09:15 [13397] [0] RRDs::update ERROR /usr/local/pnp4nagios/var/perfdata/.pnp-internal/runtime_create.rrd: illegal attempt to update using time 1536689339 when last update time is 1536689340 (minimum one second step)monit


#2

Please check your settings, details can be found here.
If you have a correct configuration, please check whether the rrd/xml files are created.


(Usama) #3

Hi Wolfgang,

Both are correct.


#4

Assuming you mean that the xml files contains “<RC>0</RC>” lines please check the web server logs for error messages.


(Usama) #5

Hi Wolfgang,

No error generated in web server logs.


#6

Just to get back to these messages. They wouldn’t be there if your configuration is correct.

Apart from that the check log seems incomplete compared with the one shown on the PNP web site.


(Usama) #7

How do I reinstall and remove pnp4nagios on nagios server ?


#8

That depends on how you installed it…


(Usama) #9

I have removed pnp4nagios and reinstalled it but still getting same issue. On the other hand I have setup on other server with same configuration it’s working. Kindly let me know how can i troubleshoot it further ?


(Usama) #10

I have enabled the log level but logs are not generating in npcd.log:

Starting npcd:DEBUG: Config File = /usr/local/pnp4nagios/etc/npcd.cfg
CONFIG_OPT_LOGTYPE = syslog
CONFIG_OPT_LOGFILE = /usr/local/pnp4nagios/var/npcd.log
CONFIG_OPT_LOGFILESIZE = 10485760
CONFIG_OPT_LOGLEVEL = -1
CONFIG_OPT_SCANDIR = /usr/local/pnp4nagios/var/spool
CONFIG_OPT_RUNCMD = /usr/local/pnp4nagios/libexec/process_perfdata.pl
CONFIG_OPT_RUNCMD_ARG = --bulk
CONFIG_OPT_MAXTHREADS = 5
CONFIG_OPT_LOAD = 0.0
CONFIG_OPT_USER = nagios
CONFIG_OPT_GROUP = nagios
CONFIG_OPT_PIDFILE = /var/run/npcd.pid
CONFIG_OPT_SLEEPTIME = 15
CONFIG_OPT_IDENTMYSELF = 1
---------------------------
DEBUG: load_threshold is disabled - ('0.000000')
 done.

#11

Looking at the documentation you’ll see the cause.


(Usama) #12

Documentation couldn’t help regarding this issue.


#13

The image shows the way the spool directory is filled. Somebody has enabled the call of the NPCD daemon. PNP4Nagios processes these temporary files (if configured correctly) so removing PNP will not decrease the number of files in the spool directory.


(Usama) #14

So which thing preventing the rrdtool running with php ? When i clicked on that image(attached pic in previous post) it shows “The requested URL /pnp4nagios/graph was not found on this server.”


#15

Your Apache config might be wrong. Please check the Apache logs.


(Usama) #16

There’s no logs generates in apache because when we install pnp it creates pnp4nagios.conf file in apache folder which doesn’t have logs directive in that file.


#17

… which only means that there are no separate log files. Instead the ones defined in httpd.conf (or subsequent files) are used.

Please provide details on your setup (OS / version / monitoring core / …).


(Usama) #18

OS: centos6.9 , Nagios Version 4.3.0


#19

So this might be an SELinux issue. Please verify that SELinux is disabled and retry.


(Usama) #20

It’s disabled already.