New perl library and client channel script added to xymonton
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.
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.
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
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.
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 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.
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
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.
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 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.
To unsubscribe from the xymon list, send an e-mail to xymon-unsubscribe at xymon.com
participants (3)
-
bgmilne@staff.telkomsa.net
-
david.baldwin@ausport.gov.au
-
questy@gmail.com