Xymon Mailing List Archive search

New perl library and client channel script added to xymonton

5 messages in this thread

list David Baldwin · Thu, 29 Jul 2010 17:19:07 +1000 ·
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
user-cbbf693f2c89@xymon.invalid          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.
list Buchan Milne · Thu, 29 Jul 2010 22:35:56 +0100 ·
quoted from David Baldwin
On Thursday, 29 July 2010 08:19:07 David Baldwin wrote:
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:xymonext.pm
Note that, since no one developing perl modules such as this discusses them first on the development mailing list, there are now at *least* three modules doing very similar things in different ways, with different name spaces.

I would very much like to see a single official API for each scripting language, with a good feature set, rather than 3 different ones with different but overlapping feature sets.

If no one else discusses these in advance, I will just pick one and commit it to svn and wait for patches ... which is obviously not the best approach, but no one else seems to worry about that.

Regards,
Buchan
list David Baldwin · Fri, 30 Jul 2010 17:06:39 +1000 ·
Buchan,
quoted from David Baldwin
On Thursday, 29 July 2010 08:19:07 David Baldwin wrote:
  
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:xymonext.pm
    
Note that, since no one developing perl modules such as this discusses them 
first on the development mailing list, there are now at *least* three modules 
doing very similar things in different ways, with different name spaces.

I would very much like to see a single official API for each scripting language, 
with a good feature set, rather than 3 different ones with different but 
overlapping feature sets.

  
Totally fair call. In fact I came up with the different namespace
exactly because Xymon.pm already existed in xymonton, but I didn't take
the time to even look at it. I could just have cut'n'pasted the
functions required into the script, but that wouldn't have achieved a
great deal either.
quoted from Buchan Milne
If no one else discusses these in advance, I will just pick one and commit it 
to svn and wait for patches ... which is obviously not the best approach, but 
no one else seems to worry about that.

  
OK, let's do an inventory of these libraries, work out the overlap and
separate areas of functionality and come up with a namespace. Heck, it
can even go into CPAN.

It will surely make it easier to write perl-based tests in the longer
term. Sure, if you only write one or two standalone tests you can copy
and paste code, but once you have a bunch spread across several systems
it becomes a pain not using common libraries.

Please reply to me on or off list as appropriate. Send me URLs or file
attachments, either will do. I'll see what I can come up with.

Thanks, David.
quoted from David Baldwin

-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          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.
list Jerald Sheets · Fri, 30 Jul 2010 08:10:00 -0400 ·
I'm in a job-change right now, but once things settle down, I'd love to be a part of this...  I'm doing a Xymon presentation at our Perl Mongers in December here, and I'd love to have a complete/mature .pm to be able to illustrate to them as well.  

--jms
quoted from David Baldwin


On Jul 30, 2010, at 3:06 AM, David Baldwin wrote:
Buchan,
On Thursday, 29 July 2010 08:19:07 David Baldwin wrote:
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:xymonext.pm
Note that, since no one developing perl modules such as this discusses them first on the development mailing list, there are now at *least* three modules doing very similar things in different ways, with different name spaces.

I would very much like to see a single official API for each scripting language, with a good feature set, rather than 3 different ones with different but overlapping feature sets.

Totally fair call. In fact I came up with the different namespace
exactly because Xymon.pm already existed in xymonton, but I didn't take
the time to even look at it. I could just have cut'n'pasted the
functions required into the script, but that wouldn't have achieved a
great deal either.
If no one else discusses these in advance, I will just pick one and commit it to svn and wait for patches ... which is obviously not the best approach, but no one else seems to worry about that.

OK, let's do an inventory of these libraries, work out the overlap and
separate areas of functionality and come up with a namespace. Heck, it
can even go into CPAN.

It will surely make it easier to write perl-based tests in the longer
term. Sure, if you only write one or two standalone tests you can copy
and paste code, but once you have a bunch spread across several systems
it becomes a pain not using common libraries.

Please reply to me on or off list as appropriate. Send me URLs or file
attachments, either will do. I'll see what I can come up with.

Thanks, David.

-- 
David Baldwin - IT Unit
Australian Sports Commission          www.ausport.gov.au
Tel 02 62147830 Fax 02 62141830       PO Box 176 Belconnen ACT 2616
user-cbbf693f2c89@xymon.invalid          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.

list W.J.M. Nelis · Mon, 02 Aug 2010 09:55:46 +0200 ·
quoted from David Baldwin
On Thursday, 29 July 2010 08:19:07 David Baldwin wrote:
      
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:xymonext.pm
          
Note that, since no one developing perl modules such as this discusses them first on the development mailing list, there are now at *least* three modules doing very similar things in different ways, with different name spaces.

I would very much like to see a single official API for each scripting language, with a good feature set, rather than 3 different ones with different but overlapping feature sets.

      
Totally fair call. In fact I came up with the different namespace
exactly because Xymon.pm already existed in xymonton, but I didn't take
the time to even look at it. I could just have cut'n'pasted the
functions required into the script, but that wouldn't have achieved a
great deal either.
  
Module Xymon.pm on xymonton is not an perl API to build and sent data or status reports to Xymon, but a set of perl object definitions to synchronize a Xymon configuration file with a configuration database.
It's name was chosen by lack of both a better name and a name space in which it could be embedded. If the latter exists, I do not mind changing the name of the module.

Regards,
  Wim Nelis.


*******************************************************************************************************
The NLR disclaimer (http://www.nlr.nl/emaildisclaimer) is valid for NLR e-mail messages.
*******************************************************************************************************