Page 1 of 1

Nagis TimeZine Asia/Amman Not listed

Posted: Sun Feb 27, 2022 3:00 pm
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 .!

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Mon Feb 28, 2022 12:33 pm
by fsodah
Any idea here !

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Tue Mar 01, 2022 5:50 pm
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

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Thu Mar 03, 2022 6:32 am
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 |
+--------------------+---------------------+

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Thu Mar 03, 2022 5:46 pm
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

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Fri Mar 04, 2022 7:40 am
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!!.

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Fri Mar 04, 2022 5:23 pm
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

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Sat Mar 05, 2022 6:49 am
by fsodah
Thank Perry

I added it manually and it works fine

Re: Nagis TimeZine Asia/Amman Not listed

Posted: Mon Mar 07, 2022 12:36 pm
by pbroste
Excellent, thanks for following up. locking

Regards,
Perry