Hi everyone, I am a new Nagios admin, having taken over Nagios administration from someone who recently quit.
We are running Nagios Core 3.2.0 on RHEL 5.4, with Centreon web front-end. However I like command line and prefer to do most things on the RedHat server.
I am still coming up to speed and have a question.
I am looking at the /etc/nagios/hostgroups.cfg file and each hostgroup is defined like this:
In the example above, there are two directives, hostgroup_name and alias.
However my question is, where are the members? Shouldn’t there be a “members” directive that lists all the members of the host group?
Is this information kept in another file? If so, where?
If you search for 1005 (to keep on with the example) in the config files do you have any hits? ( should be ‘grep 1005 /usr/local/nagios/etc/objects/*’ )
Yes. What I have been able to learn is that apparently the hosts.cfg file is the place to go. It has each host, and each one has a line/directive showing what hostgroups that the host belongs to.
I’d like to have this information in reverse, i.e. a list of all hostgroups with the members of each group.
not defining the hosts in the group description ha the advantage that if you add or remove a host you don’t ave to change two files/locations each time, still you keep the ability to define a service for a whole hostgroup or simply have the servers grouped in the web interface… the other way round it’s easier to keep an eye on the files…