5

I would like to define a host group on Nagios 4. In recon it should be defined somewhere in /usr/local/nagios/etc. I tried creating a file hostgroups.cfg that with contents:

define hostgroup{
   hostgroup_name   webservers
   members          *
}

Is this the right place to add that configuration? (I'm a Nagios-newbie)

murze
  • 169
  • 1
  • 1
  • 7

2 Answers2

5

In your nagios.cfg file, you can add a line pointing to the hostgroups.cfg file you created, thus telling nagios to include that file.

cfg_file=/usr/local/nagios/etc/hostgroups.cfg

You can also specify a directory, and nagios will process any of the files found within:

cfg_dir=/usr/local/nagios/etc/directory_containing_cfg_files
80bower
  • 233
  • 1
  • 9
0

I just put in the host group entry into my hosts.cfg file. Once Nagios was checked for errors and restarted, my host groups were there and available. I didn't have to edit the nagios.cfg file this way, either. It just works. Using Nagios Core 4 (4.4.1)

Shawn
  • 1