Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
sib
Posts: 111 Joined: Thu Dec 11, 2014 8:06 am
Post
by sib » Fri Jul 03, 2015 4:20 am
I can not figure out how to create a service for all hosts that are in 2 given hostgroups.
Example hostgroups:
Code: Select all
oracle: hostA, hostB
prod: hostB, hostC
Now I need a service for all hosts that are in both groups. In that case only for hostB
I tried to create a service like that. But this will include all prod servers
Code: Select all
define service {
service_description Oracle Filesystems
use Oracle_PROD_Service
hostgroup_name oracle,prod
check_interval 3
check_command check_nrpe!check_fs!pkgname:oracle:95:99!!!!!!!
register 1
}
lmiltchev
Former Nagios Staff
Posts: 13587 Joined: Mon May 23, 2011 12:15 pm
Post
by lmiltchev » Mon Jul 06, 2015 8:12 am
The easiest way to achieve this is to add this service to all desired hosts under the CCM.
CCM->Services-><your service>->Edit->Manage Hosts->...->Add Selected->Close->Save->Apply Configuration
In Nagios Core, you can use exclusions to exclude hosts or hostgroups by preceding the host/hostgroup by a "!" symbol. See our documentation on the topic here:
http://nagios.sourceforge.net/docs/nagi ... ricks.html
You cannot use exclusions in Nagios XI if you want to manage your objects under the CCM. You can however maintain your objects manually if you placed them in the "static" directory.
The document below explains how to do this:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Hope this helps.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
sib
Posts: 111 Joined: Thu Dec 11, 2014 8:06 am
Post
by sib » Tue Jul 07, 2015 8:26 am
Thanks. This config has worked for me
Code: Select all
define service {
service_description Oracle Filesystems
use Oracle_PROD_Service
hostgroup_name oracle,!devua
check_interval 3
check_command check_nrpe!check_fs!pkgname:oracle:95:99!!!!!!!
register 1
}
define service {
service_description Oracle Filesystems
use Oracle_DEV_Service
hostgroup_name oracle,!prod
check_interval 3
check_command check_nrpe!check_fs!pkgname:oracle:95:101!!!!!!!
register 1
}
tmcdonald
Posts: 9117 Joined: Mon Sep 23, 2013 8:40 am
Post
by tmcdonald » Tue Jul 07, 2015 9:09 am
I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee