From: Peter Palfrader Date: Sun, 24 Feb 2013 16:17:16 +0000 (+0100) Subject: Support dropping hosts from all servicegroups X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=65b6cbc1c7a2276f73251928d87c26347fccdb2c;p=mirror%2Fdsa-nagios.git Support dropping hosts from all servicegroups --- diff --git a/config/build-nagios b/config/build-nagios index 5e41e05..53b441d 100755 --- a/config/build-nagios +++ b/config/build-nagios @@ -176,9 +176,14 @@ def addService(hosts, service, files, servers) set_complain_if_set s, 'host_name', host, 'Service', s['service_description'] merge_contacts(servers[host], s) - print_block files['services'], 'service', s, %w(nrpe runfrom remotecheck - depends - hosts hostgroups excludehosts excludehostgroups) + exclude_keys = %w(nrpe runfrom remotecheck + depends + no-servicegroups + hosts hostgroups excludehosts excludehostgroups) + if servers[host]['no-servicegroups'] + exclude_keys << 'servicegroups' + end + print_block files['services'], 'service', s, exclude_keys } if service['depends']