unit converstion problem in PNP graphs

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
sattanathan
Posts: 23
Joined: Tue Oct 23, 2012 8:10 am

unit converstion problem in PNP graphs

Post by sattanathan »

Hi,

I am facing problem in PNP graph for Physical memory usage. The server is having a 2GB of physical memory and its utilization varies between 650 MB to 1.5 GB. The default PNP template displays the unit for last received performance data and hence the graphs are plotted wrongly in PNP. I have attached the screenshots for your reference. please help me in fixing this issue.

Example scenario:
in 1 st polling The performance data passed is 768 MB, in 2nd polling it is 859 MB and in 3rd it is 946 MB. so the graph will be plotted with these value and unit will be MB. But in the 4th polling,5th polling and so on the usage goes beyond 1 GB and in this case the unit is converted to GB and the maximum value is displaying as 946 GB instead of 1.xx GB.

Please help me in getting a PNP template that can understand this differnce and dispaly graphs correctly or help me doing the chnages that i need to do to achieve proper graphs.

All the attachments are taken from the same host..

Thanks in advance.

Regards,
Sattanathan.S
Attachments
This graph represent the MB value in GB since the last polling value was around 1.89 GB.
This graph represent the MB value in GB since the last polling value was around 1.89 GB.
PNP graph that has to be displayed in GB is taking the value ofcurrent data unit. This graph has been taken from the empty place of the 1st attachment.
PNP graph that has to be displayed in GB is taking the value ofcurrent data unit. This graph has been taken from the empty place of the 1st attachment.
PNP graph that shows MB as the unit and displaying the values. The empty region in the graph is the place where the usage was above 1 GB.
PNP graph that shows MB as the unit and displaying the values. The empty region in the graph is the place where the usage was above 1 GB.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: unit converstion problem in PNP graphs

Post by sreinhardt »

The simplest method of this, would be to alter the performance data going into pnp so that it is always MB or always GB. This way your graphs will show information correctly. You could create a wrapper script that if the perfdata is in MB, divides by 1024 and returns in GB, or if the current plugin allows get it to always send in MB. The issue with going from GB to MB would be inaccurate graphing due to calculating say 1.5GB to ~1500MB would not necessarily be accurate of what amount was\is in use. Always reporting in MB would be best though, as you would have the most detailed information available.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked