Report in Nagios XI - Time format

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
saleemthupsee
Posts: 107
Joined: Wed Feb 15, 2017 4:22 am
Location: Paris France
Contact:

Report in Nagios XI - Time format

Post by saleemthupsee »

Hello,

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

Saleem
Saleem THUPSEE
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Report in Nagios XI - Time format

Post 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.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
saleemthupsee
Posts: 107
Joined: Wed Feb 15, 2017 4:22 am
Location: Paris France
Contact:

Re: Report in Nagios XI - Time format

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

Re: Report in Nagios XI - Time format

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
saleemthupsee
Posts: 107
Joined: Wed Feb 15, 2017 4:22 am
Location: Paris France
Contact:

Re: Report in Nagios XI - Time format

Post by saleemthupsee »

it alerts by hours of the day lmiltchev

see screen attached

I was wondering if 11pm could show 23hrs

Saleem
Paris
You do not have the required permissions to view the files attached to this post.
Saleem THUPSEE
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Report in Nagios XI - Time format

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
saleemthupsee
Posts: 107
Joined: Wed Feb 15, 2017 4:22 am
Location: Paris France
Contact:

Re: Report in Nagios XI - Time format

Post by saleemthupsee »

great it worked.

Thanks, you can close the thread lmiltchev

Cheers,
Saleem
Paris
Saleem THUPSEE
kyang

Re: Report in Nagios XI - Time format

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