How do I 'except' or 'negate' a regex host_name in a service definition?

John P. Rouillard rouilj at cs.umb.edu
Mon Oct 31 23:19:19 CET 2005


In message <1130772078.25677.10.camel at chi101100.int.tt.local>,
jeff vier writes:

>On Fri, 2005-10-28 at 01:59 +0200, Andreas Ericsson wrote:
>> > I want to split off a group of similarly named hosts to a separate
>> > service from a more global check.
>> > Here's the "normal" (working) regex line:
>> > host_name                       ^chi-[a-z0-9]*-sim-[0-9]$
>> >=20
>> > Now...how do I define "not those" in the associated global check?
>> >=20
>> > I've tried the usual '!' before the host_name regex string.
>> This only matches a single char.
>
>Yes, I know this in normal-regex-land.  I meant "usual" as in "usually,
>in Nagios, I can say !host1,!host2"
>
>All I'm trying to figure out is how (where?) I can divide Nagios'
>interpretation from the regex itself, if that makes sense.
>
>As in, !{^chi-[a-z0-9]*-sim-[0-9]$} if Nagios would, then, limit the
>regex to within the {}.
>
>So, is there a way to do what I'm asking?  (I'm not even asking how at
>this point...just if it's possible)
>
>> > I've tried dropping the ^$ and appending a !.
>> Is this a make rule for dependencies?

Maybe something like:

define hostgroup{
  name 		my_filter_group
  alias		mfg
  members	{^chi-[a-z0-9]*-sim-[0-9]$}
}
Then in the services definition use

define service {
  hostgroup_name !my_filter_group
  host_name      <some regexp matching all hosts>
  ...
  }

Sadly you will end up seeing the hostgroup in the CGI, but.

				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list