Host/Service Status Totals via SMS/pager?

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Thu Dec 12 00:28:00 CET 2002


Dear Sir,

On Wed, Dec 11, 2002 at 02:12:53PM -0800, Jon Lyons wrote:
> 
> Hi,  

> Anyone have any suggestions on how I can get the Host & Service status totals(The small tables at the top of service problems)
> and a list of the hosts/services in a critical state in a plain text 
> format? (ie..Up 165 Down 30)

> I've written 2 scripts that allow me to acknowledge host/service 
> problems via my Nextel phone.
> It'd be great if I could get a simple quick stats of all 
> hosts/services.....(I have VERY basic perl skills).....
>  

It seems to me you have two challenges

1 Getting the totals

This may go part of the way

perl -e 'open(F, "status.log"); $/ = ""; $x = <F>; $h++ while $x 
=~/CRITICAL|DOWN/gs; print $h. "\n" '

and can almost certainly be refined and scriptified.


2 Having them displayed/notified on some stimulus  (eg state change ==> 
gloabl service handler ==> get totals | notify)

Part 2 is left as 'exercise to the reader'.


If you really want to read this stuff from the status.cgi you could also 
use LWP but this would take more work.

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:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/




More information about the Users mailing list