Nagis TimeZine Asia/Amman Not listed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Nagis TimeZine Asia/Amman Not listed

Post by fsodah »

Hello,
I have a question regarding the Nagios Core XI web interface, Problem As below:

Server Timezone is (Asia/Amman (EEST, +0300)
While in Nagios web interface (Admin->System settings->Timezone setting) the timezone is not listed there.

can you please Help with this .!
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: Nagis TimeZine Asia/Amman Not listed

Post by fsodah »

Any idea here !
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagis TimeZine Asia/Amman Not listed

Post by pbroste »

Hello @fsodah

Thanks for reaching out, want to have you verify that the synced across:

Code: Select all

date
ls -l /etc/localtime
php -r 'echo date("D M j G:i:s T Y")."\n";'
grep "date.timezone =" /etc/php.ini
grep date.timezone /etc/php.ini
mysql -h 127.0.0.1 -uroot -pnagiosxi -e 'SELECT NOW(); SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;'
Here is our support article:

https://assets.nagios.com/downloads/nag ... m_Time.pdf

Please let us know how things look.

Thanks,
Perry
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: Nagis TimeZine Asia/Amman Not listed

Post by fsodah »

Hello, Here is the output for the commands:

[root@nagios ~]# ls -l /etc/localtime
lrwxrwxrwx 1 root root 30 Feb 28 20:54 /etc/localtime -> /usr/share/zoneinfo/Asia/Amman

[root@nagios ~]# php -r 'echo date("D M j G:i:s T Y")."\n";'
Thu Mar 3 14:30:26 EEST 2022

[root@nagios ~]# grep "date.timezone =" /etc/php.ini
date.timezone = Asia/Amman

[root@nagios ~]# grep date.timezone /etc/php.ini
; http://php.net/date.timezone
date.timezone = Asia/Amman

[root@nagios ~]# mysql -h 127.0.0.1 -uroot -pnagiosxi -e 'SELECT NOW(); SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;'
+---------------------+
| NOW() |
+---------------------+
| 2022-03-03 14:30:58 |
+---------------------+
+--------------------+---------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone |
+--------------------+---------------------+
| SYSTEM | SYSTEM |
+--------------------+---------------------+
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagis TimeZine Asia/Amman Not listed

Post by pbroste »

Hello @fsodah

Looking at the timezone configuration, we provide the following options located here:

Code: Select all

/usr/local/nagiosxi/html/includes/utils-time.inc.php
'(UTC+03:00) Baghdad' => 'Asia/Baghdad',
'(UTC+03:00) Kuwait' => 'Asia/Kuwait',
'(UTC+03:00) Istanbul' => 'Europe/Istanbul',
'(UTC+03:00) Minsk' => 'Europe/Minsk',
'(UTC+03:00) Nairobi' => 'Africa/Nairobi',
'(UTC+03:00) Riyadh' => 'Asia/Riyadh',
'(UTC+03:00) Volgograd' => 'Europe/Volgograd',


Thanks,
Perry
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: Nagis TimeZine Asia/Amman Not listed

Post by fsodah »

Hello @Perry

Actually, we have two environments, Production and test one.

The two environments are on the same verion "5.8.7", The timezone (Asia/Amman) is available in the test environment, while it is not in Production.

it's very weird!!.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagis TimeZine Asia/Amman Not listed

Post by pbroste »

Hello @fsodah

Thanks for following up, and you are correct that it is pretty strange that two environments' same version is showing different.

You can go ahead and manually add to the config and select it by doing the following:

Code: Select all

vi /usr/local/nagiosxi/html/includes/utils-time.inc.php
Look for and add:
'(UTC+03:00) Baghdad' => 'Asia/Baghdad',
'(UTC+03:00) Kuwait' => 'Asia/Kuwait',
'(UTC+03:00) Istanbul' => 'Europe/Istanbul',
'(UTC+03:00) Minsk' => 'Europe/Minsk',
'(UTC+03:00) Amman' => 'Asia/Amman',
'(UTC+03:00) Nairobi' => 'Africa/Nairobi',
'(UTC+03:00) Riyadh' => 'Asia/Riyadh',
'(UTC+03:00) Volgograd' => 'Europe/Volgograd',
Then restart the services by bouncing:

Code: Select all

systemctl restart nagios mysqld httpd
Thanks,
Perry
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: Nagis TimeZine Asia/Amman Not listed

Post by fsodah »

Thank Perry

I added it manually and it works fine
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagis TimeZine Asia/Amman Not listed

Post by pbroste »

Excellent, thanks for following up. locking

Regards,
Perry
Locked