Performance Graph: Last and Average are always the same

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Performance Graph: Last and Average are always the same

Post 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?
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Performance Graph: Last and Average are always the same

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Performance Graph: Last and Average are always the same

Post 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.
vmesquita
Posts: 315
Joined: Fri Aug 10, 2012 12:52 pm

Re: Performance Graph: Last and Average are always the same

Post by vmesquita »

We are running the latest Nagios XI 2014R2.7
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Performance Graph: Last and Average are always the same

Post 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.
Locked