Increase range of Top Alert Producers from 24 hours?

This support forum board is for questions relating to Nagios Fusion.
Locked
david_sloboda
Posts: 33
Joined: Mon Apr 30, 2012 1:26 pm
Location: Burnaby, Canada

Increase range of Top Alert Producers from 24 hours?

Post by david_sloboda »

My manager is very interested in this Nagios Fusion page:

Top Alert Producers Last 24 Hours
http:// nagiosserver /nagiosfusion/includes/components/fusioncore/topalertproducers.php

Is there a way I can change the report period
from 24 hours
to 7 days (168 hours) ?

I've looked through the php files in
/usr/local/nagiosfusion
trying to find where the period of 24 hours is defined,
but I have not found the display_dashlet function yet.

Thanks,
David Sloboda
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Increase range of Top Alert Producers from 24 hours?

Post by sreinhardt »

Technically yes this could be done. However it is not as simple as altering a database query since the data is stored in an array within postgres. It would require sorting and filtering of the array for the data you want. I will see about speaking with our developer to find a solution.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
david_sloboda
Posts: 33
Joined: Mon Apr 30, 2012 1:26 pm
Location: Burnaby, Canada

Re: Increase range of Top Alert Producers from 24 hours?

Post by david_sloboda »

Thank you for looking into it.

My workaround at present is to make daily copies of the Top Alert Producers page and then extrapolate trends over 30 days.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Increase range of Top Alert Producers from 24 hours?

Post by mguthrie »

Line 140 of /usr/local/nagiosfusion/html/includes/utils-topalertproducers.inc.php is what you'd need to modify:

Code: Select all

	$cmd="&cmd=gettopalertproducers&reportperiod=last24hours&records=25"; 
To:

Code: Select all

	$cmd="&cmd=gettopalertproducers&reportperiod=thisweek&records=25"; 
That won't get you the last 7 days, but it will aggregate the weeks top alert producers. Just note that this change won't be preserved through an upgrade.
david_sloboda
Posts: 33
Joined: Mon Apr 30, 2012 1:26 pm
Location: Burnaby, Canada

Re: Increase range of Top Alert Producers from 24 hours?

Post by david_sloboda »

Thanks, I will test that on our development Nagios XI server and update the thread.
I really appreciate your time and attention to this.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Increase range of Top Alert Producers from 24 hours?

Post by sreinhardt »

Great! Interested to see how this works for you.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
david_sloboda
Posts: 33
Joined: Mon Apr 30, 2012 1:26 pm
Location: Burnaby, Canada

Re: Increase range of Top Alert Producers from 24 hours?

Post by david_sloboda »

The numbers look correct.

I have edited
/usr/local/nagiosfusion/html/includes/components/fusioncore/topalertproducers.php
to fix the title of the HTML page.

It looks like something else is setting the title of the page in the body to state "Last 24 Hours""
The HTML source shows this as:
<div class="infotable_title">Top Alert Producers Last 24 Hours</div>

I have not found that remaining "Last 24 Hours" text
in the body of the page
to change that to "Last Seven Days" or "This Week"

[root@nagios ~]# diff /usr/local/nagiosfusion/html/includes/utils-topalertproducers.inc.php.20130222 /usr/local/nagiosfusion/html/includes/utils-topalertproducers.inc.php
140c140
< $cmd="&cmd=gettopalertproducers&reportperiod=last24hours&records=25";
---
> $cmd="&cmd=gettopalertproducers&reportperiod=thisweek&records=25";
213c213
< ?>
\ No newline at end of file
---
> ?>
[root@nagios ~]# diff /usr/local/nagiosfusion/html/includes/components/fusioncore/topalertproducers.php.20130222 /usr/local/nagiosfusion/html/includes/components/fusioncore/topalertproducers.php
27c27
< do_page_start(array("page_title"=>'Top Alert Producers'),true);
---
> do_page_start(array("page_title"=>'Top Alert Producers Last 7 days'),true);
36c36
< ?>
\ No newline at end of file
---
> ?>
[root@nagios ~]#

Thanks,
David Sloboda
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Increase range of Top Alert Producers from 24 hours?

Post by scottwilkerson »

Again, this won't be preserver through an upgrade, but what you are looking for is in
/usr/local/nagiosfusion/html/includes/dashlets/topalertproducers/topalertproducers.inc.php

line 100
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked