Hi,
I want to create a hostgroup which has all my db servers (assume "database" is in the hostname)
and another hostgroup which has all my non-db servers (the ones that don't have "database" in the hostname.)
Assume all that there is presently is one hostgroup "all" which has everything.
A question about one solution:
step 1) modify hostgroups.cfg.erb
add:
define hostgroup {
hostgroup_name database_servers
alias All database servers
members ^.*database.*$
}
define hostgroup {
hostgroup_name non-database_servers
alias Not database servers
members !database_servers
}
step 2) modify /etc/nagios/nagios.cfg
use_regexp_matching=1
use_true_regexp_matching=0
step3) reload nagios
service nagios reload
Any problems with the above?
Is there a way to do it without regexp without explicit listing of the hostgroup?
Conversely, in services.cfg, is there a way for a defined service
to omit a certain class of hosts within the define service {}?
Thanks.
hostgroups.cfg
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: hostgroups.cfg
I've played with this before and you cannot perform exclusions in servicegroups or hostgroups.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 35
- Joined: Sat Sep 25, 2010 12:53 pm
Re: hostgroups.cfg
You are correct - you cannot exclude hostgroups from hostgroup definitions.
Be sure to check out our Knowledgebase for helpful articles and solutions!