See www.zabbix.com for the official Zabbix site.
Display notification in frontend when Zabbix server is not running
For now there is information about Zabbix server status in "Status of Zabbix" dashboard widget and report, these are available only for super admins. To make it more notable and available for all users it's extended to be a separate check with warning about failing.
The new check can be enabled in the Administration->GUI form, new option "Show warning if Zabbix server is down" added.
To determine if Zabbix server is running, PHP tries to open a socket wtih host and port taken from the config file "$ZBX_SERVER" and "$ZBX_SERVER_PORT" variables. Socket timeout is 3 seconds by default (can be changed in defines.inc.php "ZBX_SOCKET_TIMEOUT" constant).
Check is performed on page refresh (with 5 sec delay, to prevent socket flooding on fast browsing) or if current time exceeds previous check time plus 10 seconds. Result and timestamp of last check are cached in PHP session, so if many tabs are open in browser, socket won't be opened for every tab separately.
When check fails, warning is shown on top of almost every frontend page except Login, Install, Popups, Dashboard widgets, DB down message page.
- Check interval is 10 seconds.
- Check can be disabled or enabled in Administration->GUI. "Show warning if Zabbix server is down" option.
- On page load check is delayed for 5 seconds.
- After page is loaded check is initiated every 10 seconds by ajax call from client side.
- Zabbix server ip and port are taken from zabbix.conf.php file.
- Check results are cached in PHP session. All users share cache data.
Warning message specs
- If check fails warning is shown shown at the top of page.
- Warning text is "Zabbix server is not running: the information displayed may not be current."
- Warning is shown for all users.
- Warning disappears if we move mouse close or over the message box and appears when mouse is not there.
- Warning position is scroll independent, i.e. it can be always seen.