I'm trying to define a host group which will take all hosts which have (odd numbers). But we do have one exception, and I would like to exclude it.
We have these configurations enabled in nagios.cfg:
use_regexp_matching=1
use_true_regexp_matching=1
This works perfectly, but I can't exclude that webapp17 server.
Code: Select all
define hostgroup{
hostgroup_name odd-servers
alias PROD Servers Odd
members (^.*prod-.*\d*[13579]\..*$)
}Code: Select all
define hostgroup{
hostgroup_name odd-servers
alias PROD Servers Odd
members (^.*prod-.*\d*[13579]\..*$)(?<!^blablabla-prod-webapp17\.foo\.bar\.com$)
}Code: Select all
define hostgroup{
hostgroup_name odd-servers
alias PROD Servers Odd
members (^(?!^blablabla-prod-webapp17\.foo\.bar\.com$).*prod-.*\d*[13579]\..*$)
}
Code: Select all
define hostgroup{
hostgroup_name odd-servers
alias PROD Servers Odd
members (^.*prod-.*\d*[13579]\..*$),?!^blablabla-prod-webapp17\.foo\.bar\.com$
}I tried to define three host groups and try to use the exclusion on hostgroup_members, same thing.
Code: Select all
define hostgroup{
hostgroup_name odd
alias odd servers
members ^.*prod-.*\d*[13579]\..*$
}
define hostgroup{
hostgroup_name odd-exception
alias odd server exception
members blablabla-prod-webapp17.foo.bar.com
}
define hostgroup{
hostgroup_name target-odd-servers
alias odd servers but the exceptional one
hostgroup_members odd,?!odd-exception
}
Tried without the ?
Code: Select all
define hostgroup{
hostgroup_name odd
alias odd servers
members ^.*prod-.*\d*[13579]\..*$
}
define hostgroup{
hostgroup_name odd-exception
alias odd server exception
members blablabla-prod-webapp17.foo.bar.com
}
define hostgroup{
hostgroup_name target-odd-servers
alias odd servers but the exceptional one
hostgroup_members odd,!odd-exception
}
Any clue how to get it working?