New perl library and client channel script added to xymonton

David Baldwin david.baldwin at ausport.gov.au
Thu Jul 29 09:19:07 CEST 2010


I've just spent a bit of time tidying up some code I've been meaning to
do for ages and put on xymonton.

http://xymonton.trantor.org/doku.php/monitors:check-client
http://xymonton.trantor.org/doku.php/monitors:xymonext.pm

check-client.pl
---------------
Listens on the client channel form hobbitd and produces new columns and
status reports - easily extended.
At present it reports on the following:
"pmem" - can be used to check physical memory size - I set this up to
ensure teh service console VM on ESX hosts had sufficient memory allocated
"route" - check that a host has the correct default route configured - I
had a couple of hosts that "lost' their default route, so wanted to make
sure that wouldn't happen again
"who" - any root login shows yellow. Lists currently logged in users
If additional sections are added on clients in the hobbitclient script,
this script can be extended to report on those.

XymonExt.pm
-----------
Based on the BigBrother.pm script from deadcat.net, with various xymon
extensions. Can be used on the xymon server to query bb-hosts for
various test tags, and on any client to query xymon server, track test
colours and report in various ways.

$ perldoc XymonExt.pm
XymonExt - Perl extension to simplify writing XymonExt external scripts
in PERL.

SYNOPSIS
         use XymonExt;

         XymonExt->import();

         test stuff...

         XymonExt->Report($HostName,$function,$color,$status);

DESCRIPTION
       Requires: $BBHOME environment variable to be set

       EXPORT

       None by default.

       Methods

       import()    This function imports the Xymon environment
referenced using $ENV{BBHOME}

       InitStatus([$host])
                   Resets test status to "green" (optionally for $host)

       UpdateStatus($status[,$host])
                   Updates test status to $status if more severe than
current status (optionally for $host)
                   order is: green clear yellow red

       GetStatus([$host])
                   Returns current test status (optionally for $host)

       Items($forkey)
                   returns space separated list of items that match $forkey

       HostItems($host,$forkey)
                   returns space separated list of items for $host that
match $forkey

       HostsByTest($test)
                   returns list of hosts for plain $test

       HostIP($host)
                   returns IP for $host

       Report($HostName,$test,$color,$status)
                   Reports to BB server that $Hostname.$test has status
$colour and with status message $status

       Client($HostName,$ostype,$configclass,$rep)
                   Reports client report for $Hostname with OS type
$ostype (linux,bbwin,etc) and config class $configclass
                   (linux,win32,etc) client report details in $rep

       QueryColor($HostName,$test)
                   returns current colour of test from hobbit server


-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
david.baldwin at ausport.gov.au          Leverrier Street Bruce ACT 2617


-------------------------------------------------------------------------------------
Keep up to date with what's happening in Australian sport visit http://www.ausport.gov.au

This message is intended for the addressee named and may contain confidential and privileged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender.
-------------------------------------------------------------------------------------



More information about the Xymon mailing list