[Nagiosplug-devel] check_procs changes for regexp argu matching and pst3 for solaris

Matthias Eble matthias.eble at mailing.kaufland-informationssysteme.com
Fri Feb 29 12:46:58 CET 2008


Ton Voon wrote:
> Looking through existing patches for check_procs, I've come across  
> this: http://sourceforge.net/tracker/index.php?func=detail&aid=576371&group_id=29880&atid=397599
> 
> Tom uses a regex flag, so that the the -a and -C fields are then  
> considered as regexp expressions rather than straight comparisons.
> 
> So that means instead of:
> 
> check_procs --ereg-argument-array="java.*http"
> 
> Tom's patch would make it:
> 
> check_procs -a "java.*http" --ereg
> 
> Tom's is more like check_snmp and check_http, but the current one is  
> more like check_disk. I guess check_disk is a special case because it  
> may want regular expressions for some things and not for others.
> 
> So I'm currently siding with Tom's proposal.
> 
> Any opinions?

hmm I cannot to see/understand this at the moment.
Is there a plugin using a flag to define regex usage?

check_http actually uses optarg of -r/-R.
     {"regex", required_argument, 0, 'r'},
     {"ereg", required_argument, 0, 'r'},
     {"eregi", required_argument, 0, 'R'},
...
       strncpy (regexp, optarg, MAX_RE_SIZE - 1);
       regexp[MAX_RE_SIZE - 1] = 0;
       errcode = regcomp (&preg, regexp, cflags);

same for check_snmp. I'd say implementing a flag like the above would 
bring us back some implification magic. Which of the possible options 
are affected by --ereg? --ereg-argument-array is a clear description 
what is actually done. So I'd prefer the old behavior for now.

matthias




More information about the Devel mailing list