[Nagiosplug-devel] Nagios:Plugin feedback

Gavin Carr gavin at openfusion.com.au
Fri Jan 19 04:46:58 CET 2007


On Thu, Jan 18, 2007 at 02:13:53PM -0800, Thomas Guyot-Sionnest wrote:
> I just switched two of my checks (BigIP checks I put on NagiosExchange under
> the name 'dermoth') to Nagios::Plugin. Since it's still brand new I though
> you would like to hear some feedback :)

Absolutely!

> First of all it's awesome! Most of my functions and multi-line conditional
> statements were replaced by one-liners. Makes the code much simpler thus
> leaving more room for debug code and enhancements. The interface is simple
> yet powerful.

Great, thanks.

> So far I came across only two glitches:
> 
> 1. Installing Nagios::Plugins with CPAN on Slackware 11.0, there's one
> dependency that isn't installed, Test::Exception.

Thanks - fixed in CVS.

> 2. Default shortname, 'uc basename $0', return "P1" with ePN. 

Yes. Ethan has applied a patch to ePN to workaround this in CVS, I 
believe.

> I'm not sure
> if there's a way around this, but maybe using 'uc $np->plugin' (actually it
> won't be that, but you get the idea) so at least if plugin is set (it was in
> my case) there won't be need to explicitly define shortname.

Yes, that's sensible too. I need to look at cleaning up the interaction
between plugin and shortname.

> Is there a is_hostname function? is_ipaddr would be useful as well.
> What about passing argument check code directly in the add_arg() arguments?
> 
> Would look like this (Not 100% sure about the syntax, I'm not a Perl guru ):
> $p->add_arg(
>   spec => 'name|n=s',
>   help => qq{-n, --name=<name>)
>   check => &namecheck
>   failure => "Name argument must me a name"
> );

My feeling is that we wouldn't add datatype stuff to Nagios::Plugin, 
largely because it's pretty well covered already in other CPAN modules.

The idea of adding explicit checks to arguments is interesting though.
I'll have to think about that. If we did this, we'd presumably want
an interface that would allow multiple checks and messages though, I 
guess?

Cheers,
Gavin

-- 
Gavin Carr
- http://www.openfusion.com.au - Linux, Perl, and Web Consulting
- http://www.xool.com.au - Xool, Australian property search engine
* Fashion is a variable, but style is a constant - Programming Perl





More information about the Devel mailing list