self-testing plugins

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Wed Feb 11 21:38:08 CET 2004


Dear Sir,

I am writing to thank you for your letter and say,

On Tue, Feb 10, 2004 at 08:34:36PM -0800, nagios-users-request at lists.sourceforge.net wrote:
> 
> Message: 18
> From: "Hu Thomas Pan" <thomaspan at usa.net>
> 
> Anyone has some idea to self-test Nagios plugins?
>

It depends what you mean by 'self-testing'.

If you mean a plugin option to preform a test against a known good
or bad service so as to demonstrate the plugin is working Ok, then
possibly by having this option evaluate options for -H and so on that
the plugin author knows in advance _will_ succeed and whine if the
plugin returns anything other than OK.

(In the Nag plugin distros, the files ending in .t contain Perl test
harness code that works in conjunction with values supplied by the user
(IIRC) at configure/make time to provide the .t files with test targets
of known quality. Make tests basically runs the plugins against these
targets and fail the plugin if it returns CRITICAL)

Surely however you can demonstrate that the plugin is Ok by exercising
it manually against a service you know is OK.

I think that the common approach to demonstrate the plugin is behaving
properly is for plugins to provide a debug switch that exposes what they
are doing.

Here's a check_citrix like plugin in debug mode

tsitc> /usr/local/nagios/libexec/check_ica_browse -P metaframe -B
10.255.255.255 -d
Sending helo datagram. datagram number: 1
Querying 10.255.255.255 for master browser
0000  1e 00 01 30 02 fd a8 e3 00 02 f5 95 9f f5 30 07  ...0..........0.
0010  00 00 00 00 00 00 00 00 00 00 00 00 01 00        ..............

metaframe.aipo.gov.au:1604 responded with: 48 bytes
0000  30 00 01 31 02 fd a8 e3 02 00 06 44 0a 00 64 17  0..1.......D..d.
0010  00 00 00 00 00 00 00 00 00 00 00 00 02 00 06 44  ...............D
0020  0a 00 64 17 00 00 00 00 00 00 00 00 00 00 00 00  ..d.............

Master browser = metaframe/10.0.100.23
Preferred master browser "metaframe" __is__ the master browser
("metaframe/10.0.100.23") of the "10.255.255.255" subnet.
tsitc> 

> 
> Best,
> Thomas
>

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.


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
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