Daily status report?
Stanley Hopcroft
stanleyhopcroft at gmail.com
Wed Aug 16 00:39:08 CEST 2006
Dear Folks,
I writing to thank you for an interesting thread and say,
On 16/08/06, rader at ginseng.hep.wisc.edu <rader at ginseng.hep.wisc.edu> wrote:
>
> > From: Josh Yost
> > what kind of output are you wanting exactly?
>
> Something like this:
>
> bash$ nagiosr --help
> usage: nagiosr [args]
> --state str report about state str (down, critical, warning or unknown)
> --yesterday report about yesterday
> --day str report for day str
> --start str report starting at str
> --end str report ending at str
> --soft include soft state alerts
> default reporting period is for all of today
> bash$ nagiosr --yesterday
>
> Critical Nagios Alerts during Monday, August 14 2006
>
> Date & Time Down Date & Time Up Description Plugin Output Duration
> ---------------- ---------------- ------------------------------------------ --------
> Mon Aug 14 10:25 Mon Aug 14 10:27 login01 SSH Service socket timed out 2m20s
> Mon Aug 14 11:52 Mon Aug 14 11:58 sesame Load Average 6.83 loadave 5m32s
> Mon Aug 14 13:27 ** still down ** cilanto NSR tape 99 GB avail 1d2h3m
>
> Almost exactly a decade ago I coded just such a report generator
> for an old network montoring package (NOCOL). Someday I hope to
> do the same for nagios.
>
This looks pretty good.
There is also a Perl module which you can use to create your own
reports from avail.cgi in a variety of formats.
The distro examples/host_down_report contains an example of a quick
and dirty but useful report derived from the module.
/usr/local/bin/host_down_report { -t <timeperiod> | -h '<host_regex> }'
Displays host outages for the hosts matching the -h option, in the
interval defined by the timeperiod.
for each outage in the interval, sorted in ascending order of time
down (ie when the outage occurred)
displays the
host_name
time the host went down
time the host came up
the outage
timeperiod ::= today | yesterday |
thisweek | lastweek |
thismonth | lastmonth |
thisyear | lastyear |
last12hours | last24hours | last7days | last31days |
last<days>days | last<hours>hours | last<mins>min(ute)?(s)? |
HHMM | HH:MM |
DD.MM.YY | DD.MM.YYYY | MM/DD/YY | MM/DD/YYYY |
24hourtime date |
date1 - date2 |
24hourtime date1 - 24hourtime date2 |
Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec (YYYY)?
Timeperiods other than 'yesterday', 'lastweek', 'lastmonth' or
'lastyear' end now.
If the -h option is missing, select all (host) outages in the time period.
If the -t option is missing but the -h option is present, select all
matching hosts for 'thismonth'.
One or both of the -t and -h options must be used.
...
The version on CPAN & Nag exchange (0.002) works fine but has been
enhanced for the half the world that don't use Euro date formats.
Should be out in soon.
Yours sincerely.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&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