HI!
Is there a way to change the default of 'Last Week' reporting time period? The default is Sunday to Monday. We run our week from Monday to Sunday. How can I change this? I want to automatically run a report every Monday for the last week.
Thank you!
Change setting for Default Last Week in Reporting
Re: Change setting for Default Last Week in Reporting
To change the This week and Last week to start on Monday instead of Sunday, edit the following file
Go to this section on line 750 (or close to it) and change it from
to
Then go to this section on line 787 (or close to it) and change it from
to
Save the file and that should make the start day Monday instead of Sunday.
FYI, if you upgrade the Nagios XI server, you will have to re-edit the file and put the changes in as the upgrade will over write this file.
Code: Select all
/usr/local/nagiosxi/html/includes/utils-reports.inc.phpCode: Select all
case "thisweek":
if (date('D', $now) == 'Sun') {
$start = strtotime("today");
} else {
$start = strtotime("last sunday");
}
$end = $now;
break;Code: Select all
case "thisweek":
if (date('D', $now) == 'Mon') {
$start = strtotime("today");
} else {
$start = strtotime("last monday");
}
$end = $now;
break;Code: Select all
case "lastweek":
//$start=strtotime("first day of last week");
//$end=strtotime("first day of this week");
$start = strtotime("last sunday -7 days");
$end = strtotime("last sunday");
break;Code: Select all
case "lastweek":
//$start=strtotime("first day of last week");
//$end=strtotime("first day of this week");
$start = strtotime("last monday -7 days");
$end = strtotime("last monday");
break;FYI, if you upgrade the Nagios XI server, you will have to re-edit the file and put the changes in as the upgrade will over write this file.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Change setting for Default Last Week in Reporting
At line 753 I see this instead of the above. Do I just need to change sunday to monday? I see no if statements.tgriep wrote:To change the This week and Last week to start on Monday instead of Sunday, edit the following file
Go to this section on line 750 (or close to it) and change it fromCode: Select all
/usr/local/nagiosxi/html/includes/utils-reports.inc.php
toCode: Select all
case "thisweek": if (date('D', $now) == 'Sun') { $start = strtotime("today"); } else { $start = strtotime("last sunday"); } $end = $now; break;.Code: Select all
case "thisweek": if (date('D', $now) == 'Mon') { $start = strtotime("today"); } else { $start = strtotime("last monday"); } $end = $now; break;
Code: Select all
753 case "thisweek":
754 //$start=strtotime("first day of this week");
755 $start = strtotime("last sunday");
756 $end = $now;
757 break;
Re: Change setting for Default Last Week in Reporting
Yes, you would just have to change sunday to monday and it should work for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Change setting for Default Last Week in Reporting
Working as expected. Thank you!
Re: Change setting for Default Last Week in Reporting
Glad to hear! Are we okay locking the thread at this point?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.