Nagios Core Create hostgroups configure hostgroups

Nagios Core Create hostgroups Configure Hostgroups, Why we have to create hostgroups in Nagios Core and Nagios XI. What is the use of hostgroups. Nagios hostgroups means number of hosts (servers) making as group.

Hostgroups Advantages

  • Easily identify category – Production / Dev / Test
  • Simply know what is the application installed in server – Create application based groups
  • Single click you can schedule down time
  • Easily understand device location by creating location based groups
  • Operating system based hostgroups
  • Enable and disable host alerts in single click

Nagios Core Create hostgroups configure hostgroups

One host can be added to multiple hostgroups, we can manage host from multiple host groups. Let’s see how to configure hostgroups in Nagios.

change directory path and create .cfg file add hostgroup definition

[root@Nagios-Arkit ~]# cd /usr/local/nagios/etc/objects/
[root@Nagios-Arkit monitor]# vi HG-NETAPPS.cfg
define hostgroup{
        hostgroup_name   NetappFilers ; The name of the hostgroup
        alias            ALL Locations Netapp Filers  ; Long name of the group
        members netapp01,netapp02,Netapp03,Netapp04
}

define hostgroup{
        hostgroup_name EMCControllers
        alias           All EMC Controllers
        members emcvnx-dm,sny-vnx5300-SPA,sny-vnx5300-SPB,fremont-vnxe
        }
:wq

You can see an above host group configuration definition using single configuration file we can create multiple host groups or single hostgroup based on your decision.

Best Practice: Recommendation is to create single group in single config file. Config file name should be same as hostgroup name.

Let’s see what are the above config lines meaning

hostgroup_name = host group name should be without any space, you can use _(under score) -(hyphen) .(dot) characters in place of space. This hostgroup name will be visible in (HostGroupName) Example screen shot is below

Nagios Hostgroup

alias = It is a long description of your host group, you can write anything which describe your host group.

members = Names separated by comma list. Name should exactly match your host name which is defined in host configuration file.

Another Way to Add Host to Host Groups

Create hostgroup configuration file

[root@Nagios-Arkit monitor]# vi WindowsServers.cfg
define hostgroup{
        hostgroup_name   WindowsServers
        alias            ALL Windows Servers
        members windows01
}

:wq

Edit the host configuration file and add below config line in host config file.

hostgroups                      WindowsServers

Here you should be know that host group name should be exact as it is in hostgroup config file

That’s it about creating hostgroups in Nagios Core.

Conclusion: Hostgroups are used to identify host/server category, installed applications, location and Operating system so an.

Related Posts

Nagios Core Installation and Configuration

Installing Linux NRPE Agent

Gathering contact Information of each host and service in Nagios

Nagios Admin Interview Questions and Answers

Thanks for your wonderful Support and Encouragement