$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", "mXRecord")
+ $allnodeinfo = allnodeinfo("sshRSAHostKey", "ipHostNumber", "purpose")
+ $mxinfo = allnodeinfo("mXRecord")
notice("hoster for ${fqdn} is ${hosterinfo}")
include munin-node
end
mxregex = Regexp.new('^\d+\s+(.*)\.$')
-allnodeinfo.keys.sort.each do |host|
- next unless allnodeinfo[host]['mXRecord']
- allnodeinfo[host]['mXRecord'].each do |mx|
+mxinfo.keys.sort.each do |host|
+ mxinfo[host]['mXRecord'].each do |mx|
mxmatch = mxregex.match(mx)
if mxmatches.include?(mxmatch[1])
route = host + ":\t\t" + host