avail.cgi patch to allow CSV output from servicegroups / hostgroups and some questions...

Michael Medin michael at medin.name
Sun May 29 14:54:57 CEST 2005


Hi,

Wanted to do some reporting and needed to get availability reports based 
on host groups, and after some extreme regexp/wget scripting I decided 
it would be simpler to modify the code to actually produce the data I 
wanted as opposed to me parsing it out.

So I added some code to generate CSV reports to avail.cgi. As I wrote it 
I added a bunch of helper functions (being a sucker for small simple 
functions and refactoring) thus things (HTML version of the same) might 
be broken, but I hope not.
But since I have changed the HTML output the code is a bit experimental 
(I don't have a very good test-base at home, so I'll have to try it out 
more at work next week) but it would simplify things if others also 
tried things (as I don't really use half of the features in nagios). 
Thus I wouldn't incorporate this into the codebase just yet, but 
everyone is free to try it. It wont (I hope) mess anything up and if the 
numbers check (so check reports before and after and see if the numbers 
line up) out then I suppose it works, if not let me know and Ill modify 
things...

A few questions:

1, As I did some refactoring (broke out the "print" code) the same 
functions could be used for the two existing CSV printers the benefit 
would be. A, the code would be "more correct" (as in more things using 
the same functions as opposed to everyone reimplementing the same code), 
and B, adding/changing the printing/formatting code would be simpler.

2, Would XML-output be useful ?
My initial idea was to produce XML as its quite simple to make PDF:s out 
of XML. But I suppose you could do something similar using perl and CSV?
Whats the common way to "hand over" (SLA) reports? I think that HTML is 
a bit to "cheep" but I want something that is easy to automate and 
pretty much could email PDF:s to the supervisor at regular intervalls.

// Michael Medin
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: avail.c.patch
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20050529/37a48cad/attachment.ksh>


More information about the Developers mailing list