Issues with Grap Explorer since R2.0

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Issues with Grap Explorer since R2.0

Post by WillemDH »

Hello,

First of all, thank you for the patch. nice work, again! :D I installed R2.0 on my Nagios XI QA server. Tested some functionalities and it seems there is something wrong with the 'last 4 hours' timeperiod option in the Graph Explorer.
1) It is not displaying the last 4 hours
2) The time in the graph is all around 1 january..

Last 24 hours etc still seem correct.

Check screenshot.

Grtz

Willem
You do not have the required permissions to view the files attached to this post.
Nagios XI 5.8.1
https://outsideit.net
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Issues with Grap Explorer since R2.0

Post by slansing »

Just confirmed this, as did a few others in-house, reporting it right internally right now, thanks!

For the time being, you could pop the graphs out to 24 hours to get the correct, current time. This is only affecting the last 4 hours period.

Internal task_id=4435
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Issues with Grap Explorer since R2.0

Post by jomann »

We've fixed this for the next release. It looks like all timeframes work except the 4 hour timeframe. To fix this now, you can make an edit to a file.

The file to edit is: /usr/local/nagiosxi/html/includes/components/graphexplorer/visFunctions.php

Line 106 (ish) should look like:

Code: Select all

if ($start == '-24h') {
Replace it with:

Code: Select all

if ($start == '-4h') {
        return (time() - 4*60*60);
    } else if ($start == '-24h') {
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jwelch
Posts: 225
Joined: Wed Sep 05, 2012 12:49 pm

Re: Issues with Grap Explorer since R2.0

Post by jwelch »

Shouldn't the following line also be changed from 2*24*60*60 to 24*60*60?

FROM:
// Then check for start time...
if ($start == '-24h') {
return (time() - 24*60*60);
} else if ($start == '-48h') {
return (time() - 2*24*60*60);


TO:
// Then check for start time...
if ($start == '-4h') {
return (time() - 4*60*60);
} else if ($start == '-24h') {
return (time() - 24*60*60);
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Issues with Grap Explorer since R2.0

Post by cmerchant »

The code should look like this after the patch: (with numbers on), the -48h indicates last two days.

Code: Select all

    105     // Then check for start time...
    106     if ($start == '-4h') {
    107         return (time() - 4*60*60);
    108     } else if ($start == '-24h') {
    109         return (time() - 24*60*60);
    110     } else if ($start == '-48h') {
    111         return (time() - 2*24*60*60);
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Issues with Grap Explorer since R2.0

Post by WillemDH »

Guessing we are talking about visFunctions.inc.php not visFunctions.php?

Code: Select all

drwxr-x---   7 nagios nagios  4096 Jan 29  2014 .
drwxr-x---. 62 nagios nagios  4096 Sep 10 11:35 ..
drwxr-x---   2 nagios nagios  4096 Jan 27  2014 ajax
-rw-r-----   1 nagios nagios  2994 Oct  9 11:50 CHANGELOG.txt
-rw-r-----   1 nagios nagios  1345 Oct  9 11:50 dashifygraph.php
-rw-r-----   1 nagios nagios  2303 Oct  9 11:50 dashlet.inc.php
-rw-r-----   1 nagios nagios  2054 Jan 27  2014 dashlet.inc.php.backup
-rw-r-----   1 nagios nagios  3155 Oct  9 11:50 fetch_rrd.php
-rwxr-x---   1 nagios nagios  1219 Jun 18  2013 graphexplorerinclude.js
-rw-r-----   1 nagios nagios  6158 Oct  9 11:50 graphexplorer.inc.php
-rw-r-----   1 nagios nagios 14127 Oct  9 11:50 graphexplorer.js
drwxr-x---   3 nagios nagios  4096 Jan 27  2014 images
drwxr-x---   2 nagios nagios  4096 Jan 27  2014 includes
-rw-r-----   1 nagios nagios 15528 Oct  9 11:50 index.php
-rw-r-----   1 nagios nagios   474 Jun 18  2013 lists.php
-rw-r-----   1 nagios nagios  1875 Oct  9 11:50 sanity.sh
drwxr-x---   6 nagios nagios  4096 Aug 22  2012 .svn
drwxr-x---   3 nagios nagios  4096 Jul 30 14:13 templates
-rw-r-----   1 nagios nagios   947 Oct  9 11:50 visApi.php
-rw-r-----   1 nagios nagios 25554 Oct  9 11:50 visFunctions.inc.php
So I changed it to

Code: Select all

    // Then check for start time...
    if ($start == '-4h') {
        return (time() - 4*60*60);
    } else if ($start == '-24h') {
        return (time() - 24*60*60);
    } else if ($start == '-48h') {
        return (time() - 2*24*60*60);
    } else if ($start == '-1w') {
        return strtotime("-7 days");
    } else if ($start == '-1m') {
        return strtotime("-1 month");
    } else if ($start == '-1y') {
        return strtotime("-1 year");
    }
And it seems my performance grapher stopped working.

So I tried to start it, but couldn't do it with the gui, so I did service npcd start and was able to start it..

The last 4 hour option in the graph explorer does seem to work now.

Thanks and grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Issues with Grap Explorer since R2.0

Post by slansing »

Excellent, thank you for providing us with an update!
Locked