Page 1 of 1
Performance Graph: Last and Average are always the same
Posted: Wed Aug 05, 2015 2:07 pm
by vmesquita
Hello,
We realized that the last and average values on the graphs plotted by Nagios are always the same value, regardless of the service we are checking, or the time period. So it makes sense to assumo it's miscalculating. How can we fix this?
Re: Performance Graph: Last and Average are always the same
Posted: Wed Aug 05, 2015 2:32 pm
by ssax
I'm experiencing the same on mine, let me take a look at the code to see what the issue is, I'll let you know what I find.
Re: Performance Graph: Last and Average are always the same
Posted: Wed Aug 05, 2015 3:50 pm
by ssax
I've submitted a bug report for this:
Code: Select all
NEW TASK ID 6200 created - Nagios XI Bug Report: Perfgraph "Last" field is showing same as "Avg"
What version of XI are you running? I have a workaround that will fix it for you but I need to know what version you are using.
Re: Performance Graph: Last and Average are always the same
Posted: Fri Aug 14, 2015 4:51 pm
by vmesquita
We are running the latest Nagios XI 2014R2.7
Re: Performance Graph: Last and Average are always the same
Posted: Mon Aug 17, 2015 9:06 am
by ssax
Edit this file:
Code: Select all
/usr/local/nagiosxi/html/includes/components/graphexplorer/templates/perfdata.inc.php
Change line 58 from this:
Code: Select all
$perfdata_extra[$i]['last'] = $data[$j-1];
To this:
Code: Select all
$perfdata_extra[$i]['last'] = $data[$j-5];
Then change line 201 from this:
Code: Select all
name: \"{$args['names'][$i]} (Last: ".round($perfdata_extra[$i]['avg'], 2).$units[$i].", Avg: ".round($perfdata_extra[$i]['avg'], 2).$units[$i].", Max: ".round($perfdata_extra[$i]['max'], 2).$units[$i].")\",
To this :
Code: Select all
name: \"{$args['names'][$i]} (Last: ".round($perfdata_extra[$i]['last'], 2).$units[$i].", Avg: ".round($perfdata_extra[$i]['avg'], 2).$units[$i].", Max: ".round($perfdata_extra[$i]['max'], 2).$units[$i].")\",
That should fix it.