Yes, based on that doc, as it's the only place that talks about regex or 
wildcards.

Elsewhere in our configs, we had a *-do-not-page that worked fine with the 
use_regexp_matching=1.  When I set use_regexp_matching to 0, I then got this 
error:
Could not find any hostgroup matching '*-do-not-page'
So the statement you made doesn't quite make sense:  if you enable regex, you 
need to make sure they are valid - '*' is not a valid regular expression, only 
a wildcard specifier, if not using regexp matching. note the 'contain' in the 
below paragraph.

For the situation I described earlier, setting use_regexp_matching=1 and 
setting the dependent_service_description to .* is working.          Thank you!

Icinga 1.4 was most likely the stable version at the time that we put it in 
place about a year ago or so.

Personally I find the ability to use regex/wildcards needing a bit more 
documentation.  There are generally good examples throughout the docs, and I 
feel like this is lacking how to configure things based on the global settings.

-Lori

From: Michael Friedrich [mailto:michael.friedr...@univie.ac.at]
Sent: Sunday, May 13, 2012 3:44 AM
To: icinga-users@lists.sourceforge.net
Subject: Re: [icinga-users] invalid regular expression

On 13.05.2012 01:07, Lori Adams wrote:
Icinga 1.4.0:

In the main icinga.cfg, we have:
use_regexp_matching=1

I try to create the following dependency:
define servicedependency {
        host_name                                    HOSTA
        service_description                    SERVICEA
        dependent_host_name             HOSTA
        dependent_service_description   *
        notification_failure_criteria   w,c
        }

Yet, I get this failure:
Error: Invalid regular expression '*' found while expanding service names in 
file '/path/to/file.cfg' starting on line 173. NOTE: regex could be inherited 
from a template in a different file.

Based on the docs, '*' is valid.   There is no template used, so it's not 
hidden somewhere else.

based on which docs? those? 
http://docs.icinga.org/latest/en/objecttricks.html#objecttricks-servicedependency

if you enable regex, you need to make sure they are valid - '*' is not a valid 
regular expression, only a wildcard specifier, if not using regexp matching. 
note the 'contain' in the below paragraph.

[--SNIP--]
Regular Expression Matching

The examples we give below use "standard" matching of object names. If you 
wish, you can enable regular expression matching for object names by using the 
use_regexp_matching config option. By default, regular expression matching will 
only be used in object names that contain *, ?, +, or \.. If you want regular 
expression matching to be used on all object names, enable the 
use_true_regexp_matching config option. Regular expressions can be used in any 
of the fields used in the examples below (host names, hostgroup names, service 
names, and servicegroup names).

    Note
Be careful when enabling regular expression matching - you may have to change 
your config file, since some directives that you might not want to be 
interpreted as a regular expression just might be! Any problems should become 
evident once you verify your configuration.
[--SNIP--]

a single dot, matching all with asterisk should do the trick - but keep in mind 
that enabled regex could require changes in your entire configuration.

btw - why 1.4.0 ?



Thoughts?





------------------------------------------------------------------------------

Live Security Virtual Conference

Exclusive live event will cover all the ways today's security and

threat landscape has changed and how IT managers can respond. Discussions

will include endpoint security, mobile security and the latest in malware

threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/




_______________________________________________

icinga-users mailing list

icinga-users@lists.sourceforge.net<mailto:icinga-users@lists.sourceforge.net>

https://lists.sourceforge.net/lists/listinfo/icinga-users




--

DI (FH) Michael Friedrich



Vienna University Computer Center

Universitaetsstrasse 7 A-1010 Vienna, Austria



email:     michael.friedr...@univie.ac.at<mailto:michael.friedr...@univie.ac.at>

phone:     +43 1 4277 14359

mobile:    +43 664 60277 14359

fax:       +43 1 4277 14338

web:       http://www.univie.ac.at/zid

           http://www.aco.net



Lead Icinga Core Developer

http://www.icinga.org
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to