Need assistance on finding hostsgroups

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Need assistance on finding hostsgroups

Post 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 ?
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Need assistance on finding hostsgroups

Post 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...
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Need assistance on finding hostsgroups

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked