[Nagiosplug-devel] Nagios:Plugin feedback

Andreas Ericsson ae at op5.se
Fri Jan 19 03:12:27 CET 2007

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 :)
> 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.
> Questions:
> Is there a is_hostname function? is_ipaddr would be useful as well.

This is a common misconception and thoroughly annoying when encountered.
Resolver functions already recognize IP-addresses and return them
immediately in case one is passed to them as a hostname, so detecting if
something is a valid ip-address or not is not necessary.

Properly detecting if something is a valid hostname is an equally bogus
activity, because people invariably make such functions overly strict.
Again, the resolver will tell you if the name you chuck at it resolves
to an IP-address or not, and that's really all you need to know.

Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

More information about the Devel mailing list