Regex in hostgroup members

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kobazik
Posts: 5
Joined: Tue Feb 09, 2016 11:52 am

Regex in hostgroup members

Post by kobazik »

Hi,

Does regex in nagios support all standard regex filters?

I can't get case-insenstive filter to work in below example:

define hostgroup
hostgroup_name Prod
memebers ^(?i)(prd|PRD).*
}
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Regex in hostgroup members

Post by eloyd »

Taken from https://assets.nagios.com/downloads/nag ... ricks.html:
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).
Hope that helps.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Regex in hostgroup members

Post by rkennedy »

Thanks @eloyd!

@kobazik - let us know if you need any further assistance.
Former Nagios Employee
Locked