Host RegEx in servicegroups members

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


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
-- 
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan at opensourcedevel.com

If you would like to participate in the development of an open source
enterprise class network security management system, please visit
http://iscs.sourceforge.net



-------------------------------------------------------
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