I'm trying to populate a hostgroup using wild cards but having a bit of difficulty.
My nagios.cfg has this set:
use_regexp_matching=1
use_true_regexp_matching=0
Hostgroup template:
define hostgroup {
hostgroup_name Regex testing
alias Regex testing
hostgroup_members ^Reg ExTest.*Environments
}
define hostgroup {
hostgroup_name Reg ExTest ABC Environments
alias Reg ExTest ABC Environments
}
And the results of this is that the hostgroup Regex testing has one hostgroup member that is "^Reg ExTest.*Environments" and a disabled hostgroup named "^Reg ExTest.*Environments" is created.
What is it that I'm doing wrong?
Host group members and regex
-
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: Host group members and regex
Did you see this page?
https://assets.nagios.com/downloads/nag ... ricks.html
It states:
If you change that option, you'll need to restart or reload the nagios process to pick up the new config.
https://assets.nagios.com/downloads/nag ... ricks.html
It states:
https://assets.nagios.com/downloads/nag ... p_matchingIf you want regular expression matching to be used on all object names, enable the use_true_regexp_matching config option.
If you change that option, you'll need to restart or reload the nagios process to pick up the new config.
Previous Nagios employee
Re: Host group members and regex
I've seen this - I've tried that but then if I want to exclude a host with an exclamation mark from a service I'm getting an error:
Error: Failed to expand host list '!testserver.testdomain.local' for service 'Drive F: Disk Usage'
I really don't want to be messing around with regex's - all I'm trying to do is match a group of other hostgroups that have the same beginning and the same ending - therefore just a wildcard in the middle.
How is the best way to accomplish this?
Error: Failed to expand host list '!testserver.testdomain.local' for service 'Drive F: Disk Usage'
I really don't want to be messing around with regex's - all I'm trying to do is match a group of other hostgroups that have the same beginning and the same ending - therefore just a wildcard in the middle.
How is the best way to accomplish this?
-
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: Host group members and regex
I don't think regex can be used on hostgroup_members, only the members field.
I've filed this bug on it:
https://github.com/NagiosEnterprises/na ... issues/354
I've filed this bug on it:
https://github.com/NagiosEnterprises/na ... issues/354
Previous Nagios employee