Custom Nagios Availability Report

Currently when you run a report on Hostgroups > ** ALL HOSTGROUPS ** It gives you a layout with your average uptime for your hostgroups and all the servers listed in those hostgroups. How can I make it so it only gives averages for all my hostgroups? I need just a basic report of the averages for the hostgroups, not the individual hosts.

I’m not sure if you can do that with any of Nagios options. The easiest thing I can think of is to make script that would save the page you want and then play a bit with sed or awk to delete the content you do not want to apper in the page and leave just the average rows of hostgroup’s availabilty reports.


It would appear as this. If that would do for you, that is the easiest (as far as I could think of now) way to do that. I have done this by manually deleting the unwanted lines from the html, but it could be accomplished automaticaly with sed/awk.

This is exactly what I’m looking for. It sounds like to me modifying the html code would be the easiest way to accomplish this, as I’m not too script knowledgeable. My problem that I’ve had is I dont have the correct files to modify the cgi scripts. I’ve read there’s supposed to be a extinfo.c that you modify and recompile the extinfo.cgi script, but my installation does not have the source code available. Could you point me in the correct direction to get this? I’m running nagios 2.3 on FreeBSD. I’ve inherited this system and I was not the original creator, hence I dont know if this installation was compiled with source (i think not) but probably from a binary that didnt include the source.

You could just download the source cod, modify it and compile.
mirrorservice.org/sites/down … 2.3.tar.gz

But I think it has more to do with avail.cgi then to extinfo.cgi

Ok I got the source code installed and ready…what is this sek/awk you’re talking about?

If you have source code, then you should modify the things you want and compile it. That is a harder option, but if you know programming then you’ll get this right. :slight_smile:

Sed and awk are stream text editors which could help you if you choose the first option I’ve recomended (to download html page with the availability reports you want and then run it through sed or awk). Sed or Awk are linux programs which could be run from terminal and if you want to get familiar with those type:
man sed
or
man awk
and you’ll get much better explanation what they do.

Those programs (sed or awk) could help you if you save your availability report .html page to some folder of your choice on your Linux server and then run that page through sed or awk to delete the unwanted lines and get the availability report which looks like that I’ve posted in picture.