Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regex like * doesn't work in hostgroup > hostgroup_members #354

Closed
36roentgen opened this issue Mar 29, 2017 · 7 comments
Closed

regex like * doesn't work in hostgroup > hostgroup_members #354

36roentgen opened this issue Mar 29, 2017 · 7 comments

Comments

@36roentgen
Copy link

It does work in hostgroup > members.

The documentation leads me to believe this should work:

Regular expressions can be used in any of the fields used in the examples below (host names, hostgroup names, service names, and servicegroup names).

This behavior is the same regardless of the setting of use_regexp_matching

This is tested on Core 4.2.4

@box293
Copy link
Contributor

box293 commented Mar 29, 2017

Can you provide a hostgroup definition example please.

@36roentgen
Copy link
Author

36roentgen commented Mar 31, 2017

define hostgroup {
        hostgroup_name                          hostgroup_test
        alias                                   hostgroup_test_alias
        members                                 *
        hostgroup_members                       *
        }

Or any type of regex in hostgroup_members

@jfrickson jfrickson added this to the 5.0.0 milestone Apr 21, 2017
@hales8181
Copy link

+1 on this. I'd like the config below to create the hostgroup 'hostgroup_test', and populate it with all of the hostgroups that end with abctesting.

define hostgroup {
hostgroup_name hostgroup_test
alias hostgroup_test_alias
hostgroup_members *abctesting
}

@box293
Copy link
Contributor

box293 commented May 17, 2017

I had a good test of this and I can confirm that it just throws the following error:

Error: Could not find member group '*' specified in hostgroup 'hostgroup_test' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 11)

I tried a couple of different variations and all I could do was confirm that it doesn't work as expected.

@jfrickson jfrickson self-assigned this Jun 8, 2017
jfrickson pushed a commit that referenced this issue Jun 8, 2017
Fix for issue #354

hostgroup_members will now accept a "*" or regexes if regexes are enabled
@jfrickson
Copy link
Contributor

Fixed via commit d1f789e into branch nv5dev, which is the Core 5 development branch, and may become unstable at a moment's notice.

Both * and regexes (if enabled) will now work in hostrgroup_members.

@hales8181
Copy link

Thanks - what version of XI will this be fixed in?

@hedenface
Copy link
Contributor

Core 5 isn't officially scheduled for a specific release date. This likely won't be in XI until the version of Core that it's released in is considered stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants