We implemented Nagios and found that trying to display their web interface and some other interfaces on a projector screen was not working. I am not a dedicated programmer but i decided to code my own web interface. It is coded in PHP. It requires that PHP5 be installed on your Nagios box. The PHP script is quite flexible and can be edited easily.
The web interface is being used on our live Nagios box, version 3.0.3. Put script in /var/www and point your web browser to your nagiosbox/nagios.php
It will display hosts/services in a table with different colors etc indicating whether the host/service is up, down, warning, critical.
This might help someone somewhere somehow. Script attached.
Screens attached. Screens are from live environment without hosts column and services column.The data for the table is pulled straight from status.dat.
This looks good! . I have started using it with bit more customization and gave a Netcool look.
Is it possible to alter this script to get status of a particular hostgroup? Did someone try that ?
We are actually using the modified version from dingleberry.me (Thanks to them as well) so the line numbers don’t match up but the offending lines are:
if ($servicearray$servicecount] != “”) { //if the host has a service being checked
and
if ($servicearray$servicecount] == “”) { //if the host has no service being checked
The problem is we have a few entities which don’t have services (used as parents) so $servicearray[0] isn’t a valid array index at the point of those evaluations.
To remedy the problem I added an ‘else’ to an earlier evaluation which determines if there are any services. If there are no services then it sets $servicearray[0]="".
The code follows.
I would be completely lost without threads like this, thank you guys for working on this nice script and plucking away and the errors, you guys are giving me some good guidelines to work within. I was getting a bit worried that I might have to run a pst repair tool or something to that effect, but all seems well on the home front. I officially give this thread an A+.