Reporting and misc rave.
Steve Shipway
s.shipway at auckland.ac.nz
Mon Feb 6 21:43:53 CET 2006
Stanley Hopcroft wrote:
> Mr Shipways approach is too process the Nag logs periodically
> with private/in-house (AFAIK) code to extract the entries of
> interest and insert them as rows in a table(s).
>
> (Incidentally, this sounds very enterprising since the
> extraction code has to deal with all the cases handled by
> avail.cgi. The difficulty of extracting outages from the logs
> is why I chose to use avail.cgi as a source of availability data).
My perl script eats the nagios log files (from the archive directory), and
copies them straight to a database. It actually filters out just the ones
I'm currently interested in - host and service alerts, and host and service
downtime. The script also creates all the database tables and so on if
necessary. Then, my reporting tool takes care of calculating on a per-host
and service basis what the downtime is (much easier using a database).
The problem with it is that a particular stretch of downtime may lie partly
in scheduled and partly in unscheduled, or the parent host of a service may
be down for part of it. This means you cannot flag each event with a
'scheduled/unscheduled' flag. It is possible, though, to calculate event
length as you go although the ends of a logfile present a bit of a problem,
too. I did think of splitting events up into scheduled/unscheduled
portions, but this would give problems when counting events from the log.
I'm also putting together some scripts (using Nagios::Config as suggested)
which load the current configuration of hosts, services, and hostextinfo
into a database, mainly for reading purposes (we have a different tool which
maintains the config files). The hostextinfo is a useful one, since I've
already modified an existing tool for maintaining the 2d-coords to
read/write its data to the mysql database.
Once this is a bit more stable and documented, I hope to upload to
nagiosexchange.
It does bring the question, though, of why Nagios itself does not contain at
least mysql database support, and preferably some sort of database plugin
for this.
Steve
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list