Page 1 of 1
Need assistance on finding hostsgroups
Posted: Wed Sep 14, 2016 1:10 pm
by bosecorp
Need to know which hostgroups are associated with each services. Is there a way to find that out through cli ? Or probably run a report on it ?
Re: Need assistance on finding hostsgroups
Posted: Wed Sep 14, 2016 1:35 pm
by gormank
Here's one way, but it doesn't tell which services have no hostgroup.
grep hostgroup_name /usr/local/nagios/etc/services/* | awk '{print $NF "\t" $1}'
For a count you could do this.
cd /usr/local/nagios/etc/services/
grep -c hostgroup_name * | awk -F : '{print $NF "\t" $1}'
There are probably better, or prettier ways, but I like the shell...
Re: Need assistance on finding hostsgroups
Posted: Wed Sep 14, 2016 2:04 pm
by bwallace
For viewing purposes there's this, via the Hostgroup Overview page (you'll have the same options on the Hostgroup Summary page as well)
Hostgroup Service Details.jpg