$localinfo = yamlinfo('*', "/etc/puppet/modules/debian-org/misc/local.yaml")
$nodeinfo = nodeinfo($fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml")
$hosterinfo = whohosts($nodeinfo, "/etc/puppet/modules/debian-org/misc/hoster.yaml")
- $allnodeinfo = allnodeinfo("sshRSAHostKey", "ipHostNumber", "purpose")
- $mxinfo = allnodeinfo("mXRecord")
+ $allnodeinfo = allnodeinfo("sshRSAHostKey", "ipHostNumber", "purpose", "mXRecord")
notice("hoster for ${fqdn} is ${hosterinfo}")
include munin-node
end
mxregex = Regexp.new('^\d+\s+(.*)\.$')
-mxinfo.keys.sort.each do |host|
- mxinfo[host]['mXRecord'].each do |mx|
+allnodeinfo.keys.sort.each do |host|
+ next unless allnodeinfo[host]['mXRecord']
+ allnodeinfo[host]['mXRecord'].each do |mx|
mxmatch = mxregex.match(mx)
if mxmatches.include?(mxmatch[1])
route = host + ":\t\t" + host