Page 1 of 1

Report in Nagios XI - Time format

Posted: Thu Nov 23, 2017 3:43 am
by saleemthupsee
Hello,

is there a way to display the time format of reports in 24h format instead of AM and PM ?

Saleem

Re: Report in Nagios XI - Time format

Posted: Mon Nov 27, 2017 11:02 am
by lmiltchev
What report are you referring to? Can you show us a screenshot?

Some of the reports will show time in 24 hour format - see below:
example01.PNG
Please give us a specific example of what is not working.

Re: Report in Nagios XI - Time format

Posted: Tue Nov 28, 2017 6:09 am
by saleemthupsee
It is this same report lmiltchev. It shows 11pm. My manager is asking if it shows 23H instead if 11 PM ? Is it possible to show the format in 24h instead of 12h (AM/PM). Otherwise it looks good to him.

Re: Report in Nagios XI - Time format

Posted: Tue Nov 28, 2017 10:34 am
by lmiltchev
Which part of the report shows the "wrong" format? Is it under the "Top Alert Producers", "Alert Histogram" or something else? Can you show us a screenshot?

Re: Report in Nagios XI - Time format

Posted: Wed Nov 29, 2017 10:10 am
by saleemthupsee
it alerts by hours of the day lmiltchev

see screen attached

I was wondering if 11pm could show 23hrs

Saleem
Paris

Re: Report in Nagios XI - Time format

Posted: Wed Nov 29, 2017 10:58 am
by lmiltchev
In order to accomplish this, you will need to modify the "/usr/local/nagiosxi/html/reports/histogram.php" file. Keep in mind that your changes will be overwritten on an upgrade, so it's best to make a backup prior to an upgrade. It is also a very good idea to backup the original file, prior to modifying it. :)

Code: Select all

cd /usr/local/nagiosxi/html/reports
cp -p histogram.php histogram.php.original
Once you backup up the histogram.php, open it in a text editor, i.e. vi, and change the code around lines 896 and 973, so that it would look like this:

Code: Select all

if (empty($xarr) === TRUE) {
                    $xarr = array("00:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "Noon", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00");

Code: Select all

$hours = array(_("00:00"), _("1:00"), _("2:00"), _("3:00"), _("4:00"), _("5:00"), _("6:00"), _("7:00"), _("8:00"), _("9:00"), _("10:00"), _("11:00"), _("Noon"), _("13:00"), _("14:00"), _("15:00"), _("16:00"), _("17:00"), _("18:00"), _("19:00"), _("20:00"), _("21:00"), _("22:00"), _("23:00"));
Save, exit, and try accessing the report.

Here's an example from my test XI box:
example01.PNG

Re: Report in Nagios XI - Time format

Posted: Thu Nov 30, 2017 5:54 am
by saleemthupsee
great it worked.

Thanks, you can close the thread lmiltchev

Cheers,
Saleem
Paris

Re: Report in Nagios XI - Time format

Posted: Thu Nov 30, 2017 11:08 am
by kyang
Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!