Page 1 of 2

Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 12:12 pm
by emartine
When creating a top alert producers report on Wednesday I tried using the time period called "This Week" which I thought was 7 days from the date that the report was being generated. Turns out that it only does Sunday until Wednesday. Is it possible to create a report on the last 7 days from the date that the report is created and have that report auto-generate a report of the last 7 days from the date the report is created/sent out? I tried doing a custom report for a period of 7 days but it seems to auto generate the same dates specified.

Re: Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 2:00 pm
by tmcdonald
Odd. What XI version are you on? I am on 5.2.2 and used the custom range from the 23rd to the 30th and it worked just fine. But you are correct, "This Week" and "Last Week" are not the last 7 days.

Re: Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 2:55 pm
by emartine
Nagios XI 2014R2.6

Re: Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 3:07 pm
by rkennedy
Can you post a screenshot of the result when you generate a top alert producers using the 'Custom' period for 7 days back?

Re: Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 3:31 pm
by emartine
Yes and if I do this for the last 7 days from today it will have the dates 12/23 to 12/30. If I set this in a schedule for next week it will still give me the same report of 12/23 to 12/30 the following week. Last week I created a custom report report 12/16 to 12/23 expecting to get 7 days from the date of the report but this was not the case. I received the same report today as when I had originally created it.

Re: Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 4:09 pm
by lmiltchev
You are correct. Currently, there is no option "Last 7 days" in the drop-down menu. "This week" and "Last week" is NOT the same, and the "Custom" period won't do it for what you would like to accomplish. You are welcome to post a feature request about adding this functionality. Perhaps our developers can add "Last 168 Hours" to the drop-down menu. I can also post an internal feature request to our system if you want me to. Thanks!

Re: Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 4:21 pm
by ssax
You can edit this file:

Code: Select all

/usr/local/nagiosxi/html/includes/utils-reports.inc.php
Around line 667 change this:

Code: Select all

        case "last24hours":
            $start = strtotime("24 hours ago");
            $end = $now;
            break;
To this:

Code: Select all

        case "last24hours":
            $start = strtotime("24 hours ago");
            $end = $now;
            break;
        case "last7days":
            $start = strtotime("7 days ago");
            $end = $now;
            break;
Around line 714 change this:

Code: Select all

       "last7days" => gettext("Last 7 Days"),
To this:

Code: Select all

        "last24hours" => gettext("Last 24 Hours"),
        "last7days" => gettext("Last 7 Days"),

That should get you a dropdown value for the last 7 days.


Let me know if that works for you.

Re: Nagios XI Report Time frame

Posted: Wed Dec 30, 2015 5:19 pm
by emartine
lmiltchev yes I would appreciate it added as a feature request.
ssax thank you very much for modification in the report. Will this change when I upgrade from 2014R2.6 to the latest XI version?

Re: Nagios XI Report Time frame

Posted: Mon Jan 04, 2016 10:21 am
by lmiltchev
lmiltchev yes I would appreciate it added as a feature request.
Done. TASK ID 7371.
ssax thank you very much for modification in the report. Will this change when I upgrade from 2014R2.6 to the latest XI version?
Yes, the changes will be wiped out. You will have to redo the mods.

Re: Nagios XI Report Time frame

Posted: Mon Jan 04, 2016 11:44 am
by emartine
:/ I'm going to have to start keeping a list of all the modifications that need to be done every time I upgrade.