projects
/
mirror
/
dsa-nagios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
67b0daa
)
sort more stuff
author
Peter Palfrader
<peter@palfrader.org>
Sun, 24 Feb 2013 16:10:07 +0000
(17:10 +0100)
committer
Peter Palfrader
<peter@palfrader.org>
Sun, 24 Feb 2013 16:10:07 +0000
(17:10 +0100)
config/build-nagios
patch
|
blob
|
history
diff --git
a/config/build-nagios
b/config/build-nagios
index
2b9fba1
..
7b2a7d6
100755
(executable)
--- a/
config/build-nagios
+++ b/
config/build-nagios
@@
-315,7
+315,8
@@
config['servicegroups'] = {} unless config.has_key? 'servicegroups'
##############
# HOSTS
##############
##############
# HOSTS
##############
-config['servers'].each_pair{ |name, server|
+config['servers'].keys.sort.each{ |name|
+ server = config['servers'][name]
# Formerly we used 'ip' instead of 'address' in our source file
# Handle this change but warn XXX
if server.has_key?('ip')
# Formerly we used 'ip' instead of 'address' in our source file
# Handle this change but warn XXX
if server.has_key?('ip')
@@
-358,7
+359,9
@@
config['servers'].each_pair{ |name, server|
##############
# HOSTGROUPS
##############
##############
# HOSTGROUPS
##############
-config['hostgroups'].each_pair{ |name, hg|
+config['hostgroups'].keys.sort.each{ |name|
+ hg = config['hostgroups'][name]
+
next if hg['private']
throw "Empty hostgroup #{name}" if hg['_memberlist'].length == 0
next if hg['private']
throw "Empty hostgroup #{name}" if hg['_memberlist'].length == 0
@@
-447,7
+450,9
@@
config['services'].each{ |service|
##############
# SERVICEGROUPS
##############
##############
# SERVICEGROUPS
##############
-config['servicegroups'].each_pair{ |name, sg|
+config['servicegroups'].keys.sort.each{ |name|
+ sg = config['servicegroups'][name]
+
set_complain_if_set sg, 'servicegroup_name', name , 'Servicegroup', name
print_block files['servicegroups'], 'servicegroup', sg, %w()
set_complain_if_set sg, 'servicegroup_name', name , 'Servicegroup', name
print_block files['servicegroups'], 'servicegroup', sg, %w()
@@
-457,7
+462,8
@@
config['servicegroups'].each_pair{ |name, sg|
##############
# NRPE config file
##############
##############
# NRPE config file
##############
-$nrpe.checks.each_pair{ |name, check|
+$nrpe.checks.keys.sort.each{ |name|
+ check = $nrpe.checks[name]
files['nrpe'].puts "command[#{ name }]=#{ check }"
}
files['nrpe'].puts "command[#{ name }]=#{ check }"
}