RFC: avail.cgi wrapper - does el-quicko availability reports for services.
Stanley Hopcroft
Stanley.Hopcroft at IPAustralia.Gov.AU
Mon Jun 2 03:19:48 CEST 2003
Dear Ladies and Gentlemen,
I am writing to request comments on a wrapper for avail.cgi that
provides a quicker than using the Nag CGIs means of service accessing
availability.
Background:
The Nag availability CGIs are comprehensive but require the user fill
out a number of forms and be aware of the meaning of parameters like
. number of logs to backtrack
. initial service state
. use state retention
etc.
This is less than optimum for two applications
1 PHBs - since PHBs won't use anything that isn't Excel
2 Finding out how long the recent disaster to subsystem X cost you.
Accordingly I have written a (Perl CGI.pm) wrapper that accepts a
service and an interval and then presents the avialbility as
. (edited) text in the browser
. the full colourful Nag avail report for that service
. a CSV file of log records mailed to an address that will (on most
MS Win systems I think) invoke Excel on the log records.
Here is the panel
tsitc> lynx -dump -nolist auth=Foo:Bar
http://tsitc:/cgi-bin/nag_svc_avail_report
Service availability
If you select nothing the data is extracted for yesterday
Start End Shortcut
Day [1.] [1.] [_] Start day only
Week [Mon May 26 00:05:00 2003] [Fri May 30 23:59:00 2003] [_] Start
and End week interval (will include weekends)
Month [Jun] [Jun] [_] Start month only
Year [2003] [2003] [_] Start year only
[DH5000 | Network
reachability........................................
.....]
(_) Display in browser
(_) Mail to address
(_) Draw graph
______________________________
do it clear
_________________________________________________________________
There are a few 'shortcuts' such as for the day, week, month, or year
only. Otherwise, all the records are extracted for the interval between
the 'Start' and 'End'.
Most of the input is accepted via scrolling text boxes (mmmm - probably
a dumb idea).
Here is some sample output,
Service availability between Fri May 30 00:00:00 2003 and Sat May 31
23:59:59 2003
Service 'Network reachability'
On Host 'so-per'
30-05-2003 00:00:00 to
31-05-2003 23:59:59
Duration: 1d 23h 59m
59s
Service State
Breakdowns:
State Type / Reason Time
% Total Time % Known Time
OK Unscheduled 1d 4h 21m
25s 59.077% 59.247%
Scheduled 0d 1h 57m
40s 4.086% 4.097%
Total 1d 6h 19m 5s
63.163% 63.344%
WARNING Unscheduled 0d 0h 0m 0s
0.000% 0.000%
Scheduled 0d 0h 0m 0s
0.000% 0.000%
Total 0d 0h 0m 0s
0.000% 0.000%
UNKNOWN Unscheduled 0d 0h 0m 0s
0.000% 0.000%
Scheduled 0d 0h 0m 0s
0.000% 0.000%
Total 0d 0h 0m 0s
0.000% 0.000%
CRITICAL Unscheduled 0d 17h 32m
39s 36.551% 36.656%
Scheduled 0d 0h 0m 0s
0.000% 0.000%
Total 0d 17h 32m
39s 36.551% 36.656%
Undetermined Nagios Not Running 0d 0h 8m 15s
0.286%
Insufficient Data 0d 0h 0m 0s
0.000%
Total 0d 0h 8m 15s
0.286%
All Total 1d 23h 59m
59s 100.000% 100.000%
Service Log
Entries:
Event Start Time Event End Time Event Duration Event/State
Type Event/State Information
06-05-2003 23:29:27 06-05-2003 23:29:28 0d 0h 0m 1s SERVICE OK
First Service State Assumed (Faked Log Entry)
30-05-2003 20:22:16 30-05-2003 20:24:36 0d 0h 2m 20s HOST DOWNTIME
START Start of scheduled downtime
30-05-2003 20:24:36 30-05-2003 22:22:16 0d 1h 57m 40s SERVICE
CRITICAL CRITICAL - Plugin timed out after 15 seconds
30-05-2003 22:22:16 31-05-2003 12:09:05 0d 13h 46m 49s HOST DOWNTIME
END End of scheduled downtime
31-05-2003 13:57:15 31-05-2003 19:49:09 0d 5h 51m 54s SERVICE OK
PING ok - Packet loss = 0%, RTA = 80.94 ms
It is pretty trivial but helpful for me.
If there is any interest, I will rewrite this to to be more
useful/robust since at the moment it uses code that is not public.
The code will use Patricks Nag config parser when it gets on CPAN.
Yours sincerely.
--
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------
'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'
from Meditation 17, J Donne.
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
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