Nagios Core Graphs Showing Incorrect Time – Resolved
We are using Nagios Core for Monitoring our entire environment which consist of Windows/Linux/MAC/Unix and Storage Devices. Recently i observed an error in pnp4nagios graphs after changing Nagios server timezone. Nagios Core Graphs showing Incorrect Time.
As shown in above picture One entry is showing like 8 Hours and another is showing like 21 Hours. I thought maybe correct due to format change like 24 hours and 12 hours but morning 8 hours is not considered as 20 Hours or 21 Hours. Completely wrong data showing.
Basically i thought its an timezone difference (Example: Malaysia (MYT) – India Standard Time (IST) but not matching.
Resolution Nagios Core Graphs Showing Incorrect Time
Step1: Check Current Server time and match with timezone. Note (Keep Ready) Timezone name.
Step2: You know PNP4Nagios will run/depend on PHP. Go to /etc/php.ini PHP configuration file and find the string name called date.timezone un-comment it and add your timezone.
# vi /etc/php.ini
; Defines the default timezone used by the date functions
date.timezone = Australia/Brisbane <-- mention timezone
Step3: Now you need to restart Web Services and check the graphs
# service httpd restart
# systemctl restart httpd.service
Hurray.!! Issue resolved and Nagios Core Graphs Showing Incorrect –> Correct Time. Looks to be simple but simple trick/tweak can’t be an ready made solution. After this article it is ready made solution for you.
Thanks. Please do comment your feedback about this blog/web site.