HostGroups and Configuring Services
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
Re: HostGroups and Configuring Services
I shouldn't have to define a host and a host group to get it to work if the whole idea is to use hostgroups.cfg right?
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: HostGroups and Configuring Services
You need both to use hostgroups, they are an abstration layer for hosts. They can be defined in the same file, but must be defined where Nagios knows where to look for them.
Previous Nagios employee
-
rbizzell39
- Posts: 112
- Joined: Thu Dec 17, 2015 1:24 pm
Re: HostGroups and Configuring Services
So if I have a 100 host I have to add each individual host.cfg or windows.cfg and then use the hostgroups.cfg
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: HostGroups and Configuring Services
You can put the 100 host definitions in the one host.cfg file if you like.
Nagios doesn't care about what objects the files are stored in, you could have a config like:
It all comes down to what works for you.
Technically you can put all of your host, service, command, group definitions into one single file. It's generally broken out into different config files to make it easier for humans to administer.
When defining your hosts you can specify in the host configuration directive the name of the hostgroup(s) it should be a member of.
OR
In your hostgroup definition you can define all the hosts that are members of the hostgroup.
Nagios doesn't care about what objects the files are stored in, you could have a config like:
Code: Select all
cfg_file=/usr/local/nagios/etc/bananas.cfg
cfg_file=/usr/local/nagios/etc/apples.cfg
cfg_dir=/usr/local/nagios/etc/vegetablesTechnically you can put all of your host, service, command, group definitions into one single file. It's generally broken out into different config files to make it easier for humans to administer.
When defining your hosts you can specify in the host configuration directive the name of the hostgroup(s) it should be a member of.
OR
In your hostgroup definition you can define all the hosts that are members of the hostgroup.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.