From c91f83880b9a84d77478b51cd48557ad0e579692 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Wed, 15 May 2013 20:00:37 +0200 Subject: [PATCH] [munin] ajouts de quelques switchs et des bornes --- Python/etc/munin/munin-test.conf | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Python/etc/munin/munin-test.conf b/Python/etc/munin/munin-test.conf index d03f9bd..df33eeb 100755 --- a/Python/etc/munin/munin-test.conf +++ b/Python/etc/munin/munin-test.conf @@ -23,27 +23,46 @@ contact.roots.command mail -s "Munin - ${var:host} : ${var:graph_title}" nobody@ contact.impression.command mail -s "Munin - ${var:graph_title}" impression@crans.org # Nagios -contact.nagios.command /usr/sbin/send_nsca -H localhost -c /etc/send_nsca.cfg -to 120 +contact.nagios.command /usr/sbin/send_nsca -H localhost -c /etc/send_nsca.cfg -to 120 contacts nagios # Les graphes sont réalisés via le CGI graph_strategy cgi cgiurl /cgi-bin 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