[Nagiosplug-devel] changing check_disk -E behaviour

Andreas Ericsson ae at op5.se
Mon Sep 17 16:05:57 CEST 2007

Matthias Eble wrote:
> hi all,
> I'm currently working on check_disk to let users ignore 
> mountpoints/devices based on regular expressions.
> There seems to be a problem with parsing of the options I want to hear 
> your opinion about.
> To compare the regexes against devname and mountdir, the best_match 
> pointer needs to be set. Unfortunately this clashes with -E (exact 
> match) which is allowed to be specified everywhere in the command line.
> I'd suggest to change -E to be only allowed prior to -p and -r 
> arguments. This would cause an incompatibility but would also become 
> revealed instantly after upgrading (check_disk exiting UNKNOWN).

Hand-parse the arguments once before going through the optind routines.
That way you can bail with a sane error message.

> Thanks
> Matthias
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________________
> Nagios Plugin Development Mailing List Nagiosplug-devel at lists.sourceforge.net
> Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> ::: Please include plugins version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null

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