pnp4nagios graph not generate proper with nagios core 4.3.4

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Mavenvista
Posts: 5
Joined: Thu Jul 12, 2018 11:46 pm

pnp4nagios graph not generate proper with nagios core 4.3.4

Post by Mavenvista »

Hi,

I have configured pnp4nagios graph with nagios core in centos 7, so issue is graph is not showing proper like in server currant load graph it showing 20m,40m can any on have idea about this issue?

hear I attached currant load graph screen shot.
Attachments
Currant_load.png
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by jomann »

Can we see the output of the plugin that is being used to generate this graph also?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Mavenvista
Posts: 5
Joined: Thu Jul 12, 2018 11:46 pm

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by Mavenvista »

Below I mentioned plugin output for graph generate


ATATYPE::SERVICEPERFDATA TIMET::1531723531 HOSTNAME::localdev SERVICEDESC::Root Partition SERVICEPERFDATA::/=102415MB;136444;153500;0;170556 SERVICECHECKCOMMAND::check_nrpe!check_root_partition!20%!10%!/ HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723531 HOSTNAME::localdev SERVICEDESC::Total Processes SERVICEPERFDATA::procs=371;150;200;0; SERVICECHECKCOMMAND::check_nrpe!check_total_procs!250!400!RSZDT HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::CRITICAL SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723531 HOSTNAME::localdb SERVICEDESC::Root Partition SERVICEPERFDATA::/=117204MB;136464;153522;0;170580 SERVICECHECKCOMMAND::check_nrpe!check_root_partition!20%!10%!/ HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723531 HOSTNAME::localdb SERVICEDESC::Swap Usage SERVICEPERFDATA::swap=23008MB;6399;3199;0;31999 SERVICECHECKCOMMAND::check_nrpe!check_swap!20!10 HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723535 HOSTNAME::localdb SERVICEDESC::Total Processes SERVICEPERFDATA::procs=167;150;200;0; SERVICECHECKCOMMAND::check_nrpe!check_total_procs!250!400!RSZDT HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::WARNING SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723535 HOSTNAME::localqa SERVICEDESC::PING SERVICEPERFDATA::rta=0.031000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0 SERVICECHECKCOMMAND::check_ping!100.0,20%!500.0,60% HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723536 HOSTNAME::vendxapp SERVICEDESC::Backup Partition SERVICEPERFDATA::/backup=20455MB;77509;87198;0;96887 SERVICECHECKCOMMAND::check_nrpe!check_backup_partition!20%!10%!/backup HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723537 HOSTNAME::vendxdb SERVICEDESC::Current Load SERVICEPERFDATA::load1=0.068;7.000;10.000;0; load5=0.052;6.000;9.000;0; load15=0.058;5.000;8.000;0; SERVICECHECKCOMMAND::check_nrpe!check_load!7.0,6.0,5.0!10.0,9.0,8.0 HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723541 HOSTNAME::vendxdirectory SERVICEDESC::Current Users SERVICEPERFDATA::users=3;20;50;0 SERVICECHECKCOMMAND::check_local_users!20!50 HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
DATATYPE::SERVICEPERFDATA TIMET::1531723541 HOSTNAME::vendxmain SERVICEDESC::HTTP SERVICEPERFDATA::time=0.516021s;;;0.000000 size=10083B;;;0 SERVICECHECKCOMMAND::check_http HOSTSTATE::UP HOSTSTATETYPE::HARD SERVICESTATE::OK SERVICESTATETYPE::HARD
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by tgriep »

It could be that there is a template that is modifying the performance data output and changing the graph.
We would need to see how the check is defined in Nagios to figure out the name of the template, so can you post that service's configuration?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Mavenvista
Posts: 5
Joined: Thu Jul 12, 2018 11:46 pm

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by Mavenvista »

Here I attache templates.cfg and localhost.cfg file please find attachment
Attachments
templates.cfg
templates.cfg file
(11.2 KiB) Downloaded 345 times
localhost.cfg
localhost.cfg file
(8.34 KiB) Downloaded 339 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by tgriep »

Can you run the following and post the output so we can see what the

Code: Select all

./check_nrpe -H localqa -c check_load -w 7.0,6.0,5.0 -c 10.0,9.0,8.0
You may have to adjust the command to fit your environment.

Then, take a look at the check_load PNP template to see if it is changing the way the graph is being built.
The default location is typically here.

Code: Select all

/usr/local/pnp4nagios/share/templates.dist/check_load.php
Below is the default settings in the template.

Code: Select all

<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_load
#
$opt[1] = "--vertical-label Load -l0  --title \"CPU Load for $hostname / $servicedesc\" ";
#
#
#
$def[1]  = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::def("var2", $RRDFILE[2], $DS[2], "AVERAGE");
$def[1] .= rrd::def("var3", $RRDFILE[3], $DS[3], "AVERAGE");

if ($WARN[1] != "") {
    $def[1] .= "HRULE:$WARN[1]#FFFF00 ";
}
if ($CRIT[1] != "") {
    $def[1] .= "HRULE:$CRIT[1]#FF0000 ";       
}
$def[1] .= rrd::area("var3", "#ff0000", "load 15") ;
$def[1] .= rrd::gprint("var3", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
$def[1] .= rrd::area("var2", "#EA8F00", "Load 5 ") ;
$def[1] .= rrd::gprint("var2", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
$def[1] .= rrd::area("var1", "#EACC00", "load 1 ") ;
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
?>
Be sure to check out our Knowledgebase for helpful articles and solutions!
Mavenvista
Posts: 5
Joined: Thu Jul 12, 2018 11:46 pm

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by Mavenvista »

Here I send you output of command which u suggested

root@qa libexec]# ./check_nrpe -H localqa -c check_load -w 7.0,6.0,5.0 -c 10.0,9.0,8.0
./check_nrpe: invalid option -- 'w'

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.12
Last Modified: 03-10-2008
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required

Usage: check_nrpe -H <host> [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

Options:
-n = Do no use SSL
-u = Make socket timeouts return an UNKNOWN state instead of CRITICAL
<host> = The address of the host running the NRPE daemon
[port] = The port on which the daemon is running (default=5666)
[timeout] = Number of seconds before connection times out (default=10)
[command] = The name of the command that the remote daemon should run
[arglist] = Optional arguments that should be passed to the command. Multiple
arguments should be separated by a space. If provided, this must be
the last option supplied on the command line.

Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here. Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin. This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.

[root@qa libexec]#

Also I send you one more command output,this output is perfect.

[root@qa libexec]# /usr/lib64/nagios/plugins/check_load -r -w 7.0,6.0,5.0 -c 10.0,9.0,8.0
OK - load average per CPU: 0.03, 0.04, 0.05|load1=0.028;7.000;10.000;0; load5=0.043;6.000;9.000;0; load15=0.052;5.000;8.000;0;
[root@qa libexec]#
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by tgriep »

Sorry, I missed the -a option for the check_nrpe command from my example.

But the plugin's performance data output looks correct so the PHP4Nagios template will have to be checked to see if it changing the way the graph is generated.
Search the Nagios system for this file and post it here.

Code: Select all

check_load.php
Be sure to check out our Knowledgebase for helpful articles and solutions!
Mavenvista
Posts: 5
Joined: Thu Jul 12, 2018 11:46 pm

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by Mavenvista »

I can't able to attache check_load.php file,so below I mention file's output.

sysadmin@Sysadmin:~$ cat check_load.php
<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_load
#
$opt[1] = "--vertical-label Load -l0 --title \"CPU Load for $hostname / $servicedesc\" ";
#
#
#
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::def("var2", $RRDFILE[2], $DS[2], "AVERAGE");
$def[1] .= rrd::def("var3", $RRDFILE[3], $DS[3], "AVERAGE");

if ($WARN[1] != "") {
$def[1] .= "HRULE:$WARN[1]#FFFF00 ";
}
if ($CRIT[1] != "") {
$def[1] .= "HRULE:$CRIT[1]#FF0000 ";
}
$def[1] .= rrd::area("var3", "#ff0000", "load 15") ;
$def[1] .= rrd::gprint("var3", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
$def[1] .= rrd::area("var2", "#EA8F00", "Load 5 ") ;
$def[1] .= rrd::gprint("var2", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
$def[1] .= rrd::area("var1", "#EACC00", "load 1 ") ;
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
?>
sysadmin@Sysadmin:~$
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: pnp4nagios graph not generate proper with nagios core 4.

Post by tgriep »

The template looks standard so that should not be causing the issue but you may want to check the php4nagios website and see if there are and configs or special templates causing the graph to display differently.
https://docs.pnp4nagios.org/pnp-0.6/start

One thing to try is to delete the .rrd and .xml files for that service and see if they get recreated correctly.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked