[Nagiosplug-devel] Plugin guideline suggestion

Andreas Ericsson ae at op5.se
Tue Jan 18 12:35:39 CET 2005


Jason Martin wrote:
> On Tue, Jan 18, 2005 at 08:23:52AM -0000, Voon, Ton wrote:
> 
>>While I think this suggestion has merit, we usually use check_xxx --version
>>to grab the version number (which also displays the release version too). Is
>>there a specific reason you want the what identifiers?
> 
> I've found that --version isn't uniformly handled in the
> plugins. Some look for -V, --version, -v, and so on.  Adding
> support for --version to all the plugins would entail making
> some large enhancements to some of them as they aren't using
> getopts at all (such as many of the contrib ones). Adding the
> what/ident idenfiers is very easy to do in all languages since
> one just has to either enter a comment or define a string
> variable. Updating all the existing plugins to do this would be
> very easy.
> 

for p in plugins/*.c plugins-scripts/*.{pl,sh}; do
	echo '# ident "$Id: $"' >> $p
done

Would work nicely with
grep --text '\\$Id:' check_xxx
regardless of plugin type (compiled or script) but the #ident 
preprocessor directive isn't supported by all compilers.

> --version also requires that the plugin work. If there are any
> libraries / modules missing then the plugin can't execute to
> return the data. what/ident does not require the plugin be in
> working order.
> 

Nice plan. I'm all for it.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer




More information about the Devel mailing list