PNP4Nagios - 95th percentile
Posted: Wed Nov 09, 2016 2:49 am
Does anyone know how to configure the 95th percentile calculation in a PNP4Nagios template? Yes, I am using XI (all I had to do to get Nagios Core to see PNP graphs was put a few URL's in the host and service templates).
So, I'd like to add the 95th percentile calculation into a graph template. The following is "working", but not providing the correct calculation:
$def[$i] = "DEF:var1=$rrdfile:$DS[$i]:AVERAGE ";
$def[$i] .= "CDEF:var1_pct=var1,0.95,/ ";
$def[$i] .= "GPRINT:var1_pct:AVERAGE:\"%3.4lf $UNIT[$i] 95th_Percentile \\n\" ";
Which does put a value properly on the graph, but it is really calculating 95% of the AVERAGE of var1, not the 95th percentile. 95th percentile is calculated by first ordering the dataset from greatest to least, second dropping the top 5% of the data, then finally the 95th percentile is the MAX value of the remaining data.
Can anyone here help me do this in PNP4Nagios? Or recommend the best forum for an answer (should I go to RRD or PNP4Nagios)?
TIA!
-Josh
So, I'd like to add the 95th percentile calculation into a graph template. The following is "working", but not providing the correct calculation:
$def[$i] = "DEF:var1=$rrdfile:$DS[$i]:AVERAGE ";
$def[$i] .= "CDEF:var1_pct=var1,0.95,/ ";
$def[$i] .= "GPRINT:var1_pct:AVERAGE:\"%3.4lf $UNIT[$i] 95th_Percentile \\n\" ";
Which does put a value properly on the graph, but it is really calculating 95% of the AVERAGE of var1, not the 95th percentile. 95th percentile is calculated by first ordering the dataset from greatest to least, second dropping the top 5% of the data, then finally the 95th percentile is the MAX value of the remaining data.
Can anyone here help me do this in PNP4Nagios? Or recommend the best forum for an answer (should I go to RRD or PNP4Nagios)?
TIA!
-Josh