PNP4Nagios All Values the same

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
jpl
Posts: 6
Joined: Mon Nov 01, 2010 11:14 am

PNP4Nagios All Values the same

Post by jpl »

Having a weird problem with PNP4Nagios. In my memory graphs all the values for the different things (cache, buffers, total mem, used mem, etc...) are all the same value...the total memory value. Nagios version 3.5.1 and PNP v0.6.26.The template has 4 data sources defined:

$ds_name[1] = "sysinfo";
$opt[1] = "--vertical-label \"Bytes\" -l0 --title \"Memory usage for $hostname / $servicedesc\" ";
# Total Memory
$def[1] = "DEF:mem_total=$RRDFILE[1]:$DS[1]:AVERAGE " ;
# Used Memory
$def[1] .= "DEF:mem_used=$RRDFILE[1]:$DS[2]:AVERAGE " ;
# Cache
$def[1] .= "DEF:mem_cache=$RRDFILE[1]:$DS[3]:AVERAGE " ;
# Buffer
$def[1] .= "DEF:mem_buffer=$RRDFILE[1]:$DS[4]:AVERAGE " ;

The output of the check command looks like:

MEMORY OK - Total: 3789 MB - Used: 3003 MB - 79% used|TOTAL=3973943296;;;0;3973943296 USED=3149709312;3179154432;3576548352;0;3973943296 CACHE=616673280;;;0;3973943296 BUFFER=0;;;0;3973943296

The XML file in the perfdata folder has the same value (max memory in the system) in the <MAX></MAX> tag and I see the proper values in the <ACT></ACT> tags however the graph does not show those values.

Sample image attached.
Attachments
Capture.PNG
Last edited by jpl on Wed Nov 06, 2019 12:28 pm, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PNP4Nagios All Values the same

Post by scottwilkerson »

Is this the whole template? You aren't showing any GPRINT lines... Please share the whole template.

We will try to help, but PNP4Nagios is not our project and more information can be found here
http://docs.pnp4nagios.org/
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jpl
Posts: 6
Joined: Mon Nov 01, 2010 11:14 am

Re: PNP4Nagios All Values the same

Post by jpl »

I'm asking here because I don't see any forums or anything on the PNP4Nagios website. Here is the rest of the template:

Code: Select all

# Memory Cache
        $def[1] .= rrd::cdef("mem_cache_tmp", "mem_cache,mem_buffer,+,mem_used,+");
        $def[1] .= rrd::area("mem_cache_tmp", "#DCDDD5", "Disk Cache");
        $def[1] .= "GPRINT:mem_cache:LAST:\"%3.2lf %sB Last \" ";
        $def[1] .= "GPRINT:mem_cache:MAX:\"%3.2lf %sB Max \" ";
        $def[1] .= "GPRINT:mem_cache" . ':AVERAGE:"%3.2lf %sB Average \j" ';
        # Memory Buffer
        $def[1] .= rrd::cdef("mem_buffer_tmp", "mem_buffer,mem_used,+");
        $def[1] .= rrd::area("mem_buffer_tmp", "#3E606F", "I/O Buffers");
        $def[1] .= "GPRINT:mem_buffer:LAST:\"%3.2lf %sB Last \" ";
        $def[1] .= "GPRINT:mem_buffer:MAX:\"%3.2lf %sB Max \" ";
        $def[1] .= "GPRINT:mem_buffer" . ':AVERAGE:"%3.2lf %sB Average \j" ';
        # Memory Used
        $def[1] .= rrd::area("mem_used", "#193441", "Processes");
        $def[1] .= "GPRINT:mem_used:LAST:\"%3.2lf %sB Last \" ";
        $def[1] .= "GPRINT:mem_used:MAX:\"%3.2lf %sB Max \" ";
        $def[1] .= "GPRINT:mem_used" . ':AVERAGE:"%3.2lf %sB Average \j" ';
        # Memory Total
        $def[1] .= rrd::line1("mem_total", "#000000", "Total");
        $def[1] .= "GPRINT:mem_total:LAST:\"%3.2lf %sB Last \" ";
        $def[1] .= "GPRINT:mem_total:MAX:\"%3.2lf %sB Max \" ";
        $def[1] .= "GPRINT:mem_total" . ':AVERAGE:"%3.2lf %sB Average \j" ';
        if ($WARN[2] != "") {
                $def[1] .= "HRULE:$WARN[2]#ffff00:\"Warning threshold for Processes\j\" ";
        }
        if ($CRIT[2] != "") {
                $def[1] .= "HRULE:$CRIT[2]#ff0000:\"Critical threshold for Processes\" ";
        }
?>
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PNP4Nagios All Values the same

Post by scottwilkerson »

These look correct, but again we have limited knowledge of PNP v0.6.26

Is it possible that this check could be picking up a different template?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jpl
Posts: 6
Joined: Mon Nov 01, 2010 11:14 am

Re: PNP4Nagios All Values the same

Post by jpl »

No, because if I break the template it complains about the same file I change. It's definitely using the template.

In the generated XML here is the reference to the tmeplate:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<NAGIOS>
  <DATASOURCE>
    <TEMPLATE>check_linux_mem</TEMPLATE>
check_linux_mem.php is the name of the template file in the templates folder.
Last edited by jpl on Wed Nov 06, 2019 12:56 pm, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PNP4Nagios All Values the same

Post by scottwilkerson »

jpl wrote:No, because if I break the template it complains about the same file I change. It's definitely using the template.
Hmm.

I'll leave the topic open in case a community member has encountered this and can chime in, but I would still recommend contacting the projest author
http://docs.pnp4nagios.org/
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jpl
Posts: 6
Joined: Mon Nov 01, 2010 11:14 am

Re: PNP4Nagios All Values the same

Post by jpl »

If I find a solution I will post it here as well.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: PNP4Nagios All Values the same

Post by scottwilkerson »

jpl wrote:If I find a solution I will post it here as well.
Thanks!

Good luck!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked