Host RegEx in servicegroups members

John A. Sullivan III jsullivan at opensourcedevel.com
Sat Apr 22 15:56:17 CEST 2006


On Sat, 2006-04-22 at 04:17 -0400, John A. Sullivan III wrote:
> Hello, all.  I'm thoroughly enjoying Nagios (I am very new to it) but am
> having a difficult time using regular expressions in Nagios 2.0 while
> trying to define members in a service group.  I've even generated
> segfaults during the pre-flight check!
> 
> use_regexp_matching=1
> use_true_regexp_matching=0
> 
> Here is a segment of a large file which is causing me grief (I also
> tried without escaping the legitimate ".":
> 
> define servicegroup{
>         servicegroup_name       Tunnels2Buffalo
>         alias                   Tunnels terminating in Buffalo
>         members                 ^.*GW\.niag$,^Tun.*-10.[125]$
> }
> 
> #---------------------------------------------------------NiagaraRASGW
> define service{
>         host_name               NiagaraRASGW.niag
>         service_description     Tun172.20.100-10.1
>         check_command           check_tunnelping!atlas!172.20.100.1!
> 10.1.1.36!10.1.1.22
>         use                     NiagService
>         }
> define service{
>         host_name               NiagaraRASGW.niag
>         service_description     Tun172.20.98-10.1
>         check_command           check_tunnelping!atlas!172.20.98.1!
> 10.1.1.36!10.1.1.22
>         use                     NiagService
>         }
> define service{
>         host_name               NiagaraRASGW.niag
>         service_description     Tun172.20.100-10.2
>         check_command           check_tunnelping!atlas!172.20.100.1!
> 10.2.1.20!10.2.1.70
>         use                     NiagService
>         }
> define service{
>         host_name               NiagaraRASGW.niag
>         service_description     Tun172.20.98-10.2
>         check_command           check_tunnelping!atlas!172.20.98.1!
> 10.2.1.20!10.2.1.70
>         use                     NiagService
>         }
> 
> Here is what I get on a pre-flight check:
> 
> Checking service groups...
> Error: Service 'Tun10.50-10.1' on host '^.*GW\.niag$' specified in
> service group 'Tunnels2Buffalo' is not defined anywhere!
> Error: Service 'Tun10.50-10.2' on host '^.*GW\.niag$' specified in
> service group 'Tunnels2Buffalo' is not defined anywhere!
> Error: Service 'Tun10.50-10.5' on host '^.*GW\.niag$' specified in
> service group 'Tunnels2Buffalo' is not defined anywhere!
> Error: Service 'Tun10.51-10.1' on host '^.*GW\.niag$' specified in
> service group 'Tunnels2Buffalo' is not defined anywhere!
> Error: Service 'Tun10.51-10.2' on host '^.*GW\.niag$' specified in
> service group 'Tunnels2Buffalo' is not defined anywhere!
> Error: Service 'Tun10.51-10.5' on host '^.*GW\.niag$' specified in
> service group 'Tunnels2Buffalo' is not defined anywhere!
> 
> And a whole lot more.  The services are indeed in the file but it seems
> like it is interpreting the host name literally.
> 
> I then changed the file to this (snippet):
> 
> define servicegroup{
>         servicegroup_name       Tunnels2Buffalo
>         alias                   Tunnels terminating in Buffalo
>         members                 ^.*GW\.niag$,Tun172.20.100-10.1
> }
> 
> #---------------------------------------------------------NiagaraRASGW
> define service{
>         host_name               NiagaraRASGW.niag
>         service_description     Tun172.20.100-10.1
>         check_command           check_tunnelping!atlas!172.20.100.1!
> 10.1.1.36!10.1.1.22
>         use                     NiagService
>         }
> define service{
>         host_name               NiagaraRASGW.niag
>         service_description     Tun172.20.98-10.1
>         check_command           check_tunnelping!atlas!172.20.98.1!
> 10.1.1.36!10.1.1.22
>         use                     NiagService
>         }
> 
> Note that the service is an exact match of the first service listed.  To
> my shock, I got this:
> 
> [nagios at ltskbunk bin]$ ./nagios -v ../etc/nagios.cfg
> 
> Nagios 2.0
> Copyright (c) 1999-2006 Ethan Galstad (http://www.nagios.org)
> Last Modified: 02-07-2006
> License: GPL
> 
> Reading configuration data...
> 
> Segmentation fault
> 
> Can anyone tell me what is going on and what I am doing wrong? Using
> regexps would make my life dramatically easier on this moderately large
> installation.  Thanks - John
<snip>
I did notice the unescaped "." in the IP address.  I changed it and
still had the same results - John
-- 
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan at opensourcedevel.com

Financially sustainable open source development
http://www.opensourcedevel.com



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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