Regex

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
sysmo
Posts: 1
Joined: Sat Apr 27, 2013 4:49 am

Regex

Post by sysmo »

I'm kind of struggeling with the regex syntax.
i;ve managed te obviouse "all" : .*
and grouping by first characters of the name : ^Site-1.*
but i'm kind of lost on the rest. eg. how to exclude just two hosts from the .* expression or an regex to match characters in the middle (eg regex for 'router' to match the hosts Site1-router-881 and Site-2-router-887)

Is there an simple tutorial for regex as nagios uses it?
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: Regex

Post by yancy »

sysmo,

Are you using regular expressions to define hostgroups?

a great resource for regular expressions can be found here:

http://www.regular-expressions.info

Thanks,

-Yancy
Locked