add to acpid-hosts
[mirror/dsa-nagios.git] / config / build-nagios
index 53b441d..7a80f0a 100755 (executable)
@@ -131,9 +131,7 @@ $nrpe = Nrpe.new()
 def print_block(fd, kind, hash, exclude_keys)
        fd.puts "define #{kind} {"
        hash.keys.sort.each{ |key|
-               next if key == '_extinfo'
-               next if key == '_hostgroups'
-               next if key == '_memberlist'
+               next if key[0,1] == '_'
                next if exclude_keys.include? key
                fd.puts "       #{key}          #{hash[key]}"
        }
@@ -178,7 +176,6 @@ def addService(hosts, service, files, servers)
 
                exclude_keys = %w(nrpe runfrom remotecheck
                                  depends
-                                 no-servicegroups
                                  hosts hostgroups excludehosts excludehostgroups)
                if servers[host]['no-servicegroups']
                        exclude_keys << 'servicegroups'
@@ -335,7 +332,7 @@ config['servers'].keys.sort.each{ |name|
        set_if_unset        server, 'use'          , HOST_TEMPLATE_NAME
        set_if_unset        server, 'check_command', HOST_ALIVE_CHECK    unless server['pingable'] == false
 
-       print_block files['hosts']      , 'host'       , server            , %w(hostgroups pingable)
+       print_block files['hosts']      , 'host'       , server            , %w(hostgroups pingable no-servicegroups)