[munin] ajouts de quelques switchs et des bornes

This commit is contained in:
Daniel STAN 2013-05-15 20:00:37 +02:00
parent 740c37a6c6
commit c91f83880b

View file

@ -34,16 +34,35 @@ cgiurl_graph /cgi-bin/munin-cgi-graph
#============================== Les switchs ================================
#Il ne s'agit pas de clients bcfg2 et ne sont par ailleurs pas des nœuds munin
"""
switchs = [ x.split('.')[0] for x in annuaires_pg.all_switchs() ] + ['backbone']
switchs = [ x[:x.rindex('.crans.org')] for x in annuaires_pg.all_switchs(hide=[]) ]
for host in switchs:
print '[switchs.crans.org;%s]' % host
print ' address localhost\n'
print """
#============================== Les bornes wifi ============================
#Idem."""
import subprocess
host_serv = metadata.query.by_groups(['dns-primary'])[0].hostname
req = subprocess.Popen(['/usr/bin/host', '-l', '148.231.138.in-addr.arpa', host_serv],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out,_ = req.communicate()
for line in out.split('\n'):
fqdn = line.split(' ')[-1][:-1]
if not fqdn: continue
profile = fqdn.split('.',1)[0]
print """[wifi.crans.org;%(profile)s]
address localhost
""" % { 'hostname': fqdn,
'profile': profile,
}
#@[switchs.crans.org;supervision.switchs.crans.org]
#@update no
### Todo: bornes: host -l 148.231.138.in-addr.arpa
#
#@# Les adherents
#@[association.crans.org;adherents]
@ -76,7 +95,7 @@ all_servers = metadata.query.all()
all_servers.sort(key=lambda x: x.hostname)
for client in all_servers:
print """[%(profile)s]
print """[crans.org;%(profile)s]
address %(hostname)s
apt.graph yes
postfix_mailqueue.deferred.warning 1000