Simple AJAX in Nagios

Sébastien Barbereau barbereau at gmail.com
Thu Nov 3 11:27:04 CET 2005


Hi,

This are some tries to add some AJAX technology to Nagios.

Sample1 & Sample2:
This 2 samples are very similar. They provide a way to refresh the status
pages only when some HARD status change occurs.

To achieve this I modified the status.cgi so that it loads a simple
javascript (nagiosajax.js) at startup and set a hidden var in the page. The
javascript
polls every 5 seconds a PHP script wich returns the last HARD change time.
this value is compared to the one stored into the page and reloads the frame
if
they are different.

=> Sample1 is built on top of a nagios1.3 with mysql support. Therefor we
use some SQL query to get the laststatechange.
=> Sample2 is built on top of a nagios2.0b4. We use a global event handler
to "log" the last HARD state change.

Files can be found here:

http://www.barbich.net/websvn/wsvn/nagios/nagios/divers/ajaxify_nagios_cgi/sample1/
http://www.barbich.net/websvn/wsvn/nagios/nagios/divers/ajaxify_nagios_cgi/sample2/

 Please this are only simple tests, they need imporvment and may not work in
your case. Also, before trying this out please make backups.

Seb.B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051103/23802091/attachment.html>


More information about the Users mailing list