Nagios XI Report Time frame

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Nagios XI Report Time frame

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios XI Report Time frame

Post 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.
Former Nagios employee
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Nagios XI Report Time frame

Post by emartine »

Nagios XI 2014R2.6
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios XI Report Time frame

Post 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?
Former Nagios Employee
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Nagios XI Report Time frame

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI Report Time frame

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios XI Report Time frame

Post 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.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Nagios XI Report Time frame

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI Report Time frame

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Nagios XI Report Time frame

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