Again some pattern matching problem now with use_true_regexp_matching=0
Robert Bossecker
nagios-d-rb at bossecker.de
Fri Jan 21 04:41:40 CET 2005
Andreas Ericsson wrote:
> Robert Bossecker wrote:
>
>> Hello,
>>
>> when trying no true patterns in service definitions all went fine
>> with "*" substitutions,
>> at least when using the asterisk at the end.
>>
>> i tried then using "?" in patterns and it failed.
>>
>
> Which is expected behaviour. ? by itself is not a special regex char,
> but a wildcard. There's a difference.
> I suppose you have the use_regexp_matching enabled?
>
yes
>> i have defined hosts named "sapt11ms" "sapt12ms" and so on
>>
>> now i created a service definition with a host_name "sap???ms" and
>> nagios complained
>> that there are no matches
>>
>
> Try host_name sap...ms
> I know the docs state otherwise, but I know for a fact that the regex
> matching is fairly new and replaced wildcard substitution not very
> long ago. It might just be that the docs aren't up to date with the
> code (it is beta after all, and people who want regex matching usually
> knows how to write regexes).
>
also the source code checks for "?" contained in the pattern and sets
"use_regexp=1", but this makes
only sense if then all "?" are converted to "." to match the documentation.
also when use_true_regexp is not set then a "*" must normally be
translated into ".*" otherwise the last
character of the "argument" is 0 or more times allowed, because
internally all patterns are computed
as regexp and not as globs as the documentation states.
But nevertheless i actually have converted my config to true regexps
Regards
Robert
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
More information about the Developers
mailing list