Page 1 of 1

MAX result value conflict between Graph and CLI

Posted: Mon Mar 04, 2019 8:17 am
by zaji_nms
dear Expert

this is my template to plot latency graph (/usr/local/nagios/share/pnp/templates/)

$def[1] = "DEF:var1=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "GPRINT:var1:MIN:\"%8.0lf MIN\" " ;
$def[1] .= "GPRINT:var1:AVERAGE:\"%8.0lf AVG\" " ;
$def[1] .= "GPRINT:var1:MAX:\"%8.0lf MAX\" " ;
$def[1] .= "GPRINT:var1:LAST:\"%8.0lf LAST\\n\" " ;

Please check the attached rrd graph
MIN = 29
AVG = 33
MAX = 49
LAST = 35

and compare below CLI result.............why only MAX value is not same...........I tried many other Bandwidth and Latency graph but MAX value in CLI not matching with graph value.

rrdtool graph dummy -s20190101 -e20190201 DEF:test=$chorchor:1:AVERAGE PRINT:test:MIN:'Value - %.3lf'
Value - 29.021

rrdtool graph dummy -s20190101 -e20190201 DEF:test=$chorchor:1:AVERAGE PRINT:test:AVERAGE:'Value - %.3lf'
Value - 33.244

rrdtool graph dummy -s20190101 -e20190201 DEF:test=$chorchor:1:AVERAGE PRINT:test:MAX:'Value - %.3lf'
Value - 44.497 <<<<<<<<<<< why only this value not matching with attached rrd graph

rrdtool graph dummy -s20190101 -e20190201 DEF:test=$chorchor:1:AVERAGE PRINT:test:LAST:'Value - %.3lf'
Value - 35.000

Re: MAX result value conflict between Graph and CLI

Posted: Mon Mar 04, 2019 3:38 pm
by tgriep
I think how your command is defined, you are printing the MAX of the Average data.
Try this instead to get the Max value.

Code: Select all

rrdtool graph dummy -s20190101 -e20190201 DEF:test=$chorchor:1:MAX PRINT:test:MAX:'Value - %.3lf'

Re: MAX result value conflict between Graph and CLI

Posted: Tue Mar 05, 2019 1:12 am
by zaji_nms
I had tried many combinations but no luck

rrdtool graph dummy -s20190101 -e20190201 DEF:test=$chorchor:1:MAX PRINT:test:MAX:'Value - %.3lf'
Value - 56.924

Can you please do trial and error in your lab environment?

Re: MAX result value conflict between Graph and CLI

Posted: Tue Mar 05, 2019 9:42 am
by tgriep
I did run some tests and it seemed to match up.
Take a look at the raw data during that time to see if the numbers match up.