[Nagiosplug-devel] RFC adding functions to utils.pm
Stanley Hopcroft
Stanley.Hopcroft at IPAustralia.Gov.AU
Sun Nov 21 22:12:21 CET 2004
Dear Folks,
I would like to add two functions to utils.pm
sub tethereal2str ($$) # two scalar args
sub dump ($) # one scalar arg
tethereal2str($$) takes a string containing a 'tethereal' trace of one
network packet and a string containing a hex byte and returns the
string from that hex byte til the end of the trace, formatted as a Perl
scalar containing a string of characters corresponding to the hex codes
found in the trace.
This function is used by check_citrix and check_lotus (/contrib) to
replay a packet to simulate some part of a real clients interaction with
the server (this is only useful for protocols such as ICA and Lotus
Notes that are both proprietary [& undocumented] and binary).
dump($) takes a scalar containing a string and outputs in the
tethereal/hexdump -C style.
Ratioanale:
These functions are part of _two_ contributed (one of which at least is
used) plugins that currently duplicate this code. Code duplication leads
to inconsistency and minimises re-use.
Yours sincerely.
--
Stanley Hopcroft
Network specialist, IT Infrastructure
IP Australia
Ph: (02) 6283 3189 Fax: (02) 6281 1353
PO Box 200 Woden ACT 2606
http://www.ipaustralia.gov.au
More information about the Devel
mailing list