Page 1 of 1

Increase range of Top Alert Producers from 24 hours?

Posted: Mon Feb 04, 2013 5:24 pm
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

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

Posted: Tue Feb 05, 2013 11:35 am
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.

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

Posted: Fri Feb 08, 2013 2:12 pm
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.

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

Posted: Fri Feb 08, 2013 4:00 pm
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.

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

Posted: Tue Feb 19, 2013 7:49 pm
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.

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

Posted: Wed Feb 20, 2013 12:44 pm
by sreinhardt
Great! Interested to see how this works for you.

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

Posted: Fri Feb 22, 2013 4:26 pm
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

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

Posted: Mon Feb 25, 2013 10:09 am
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