X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=config%2Fbuild-nagios;h=1eb3977d4adb88dec9300b3b5073538451b699c0;hb=fe48e95a0647e27ab2f042f0f8125ae176bae520;hp=545e4fde1ab1da2ad1785b02c6bbda2be788379f;hpb=0226baa6bf0d6a8ebcf632584b14fbed3cb8a773;p=mirror%2Fdsa-nagios.git diff --git a/config/build-nagios b/config/build-nagios index 545e4fd..1eb3977 100755 --- a/config/build-nagios +++ b/config/build-nagios @@ -127,11 +127,13 @@ $nrpe = Nrpe.new() # host/service/etc definitions # # It skips over such keys as are listed in exclude_keys -# and also skips private keys (those starting with an underscre) +# and also skips private keys (those starting with an underscore) def print_block(fd, kind, hash, exclude_keys) fd.puts "define #{kind} {" hash.each_pair{ |key, value| - next if key[0,1] == '_' + next if key == '_extinfo' + next if key == '_hostgroups' + next if key == '_memberlist' next if exclude_keys.include? key fd.puts " #{key} #{value}" } @@ -241,7 +243,7 @@ def find_hosts(service, servers, hostgroups) excludehosts.uniq.each{ |host| if hosts.delete(host) == nil - throw "Cannot remove host #{host} from service #{service['service_description']}: it's not included anyway." + puts "info: [service #{service['service_description']}] not excluding host #{host} - it's not included anyway." end }