[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

@ -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 contact.impression.command mail -s "Munin - ${var:graph_title}" impression@crans.org
# Nagios # 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 contacts nagios
# Les graphes sont réalisés via le CGI # Les graphes sont réalisés via le CGI
graph_strategy cgi graph_strategy cgi
cgiurl /cgi-bin cgiurl /cgi-bin
cgiurl_graph /cgi-bin/munin-cgi-graph cgiurl_graph /cgi-bin/munin-cgi-graph
#============================== Les switchs ================================ #============================== Les switchs ================================
#Il ne s'agit pas de clients bcfg2 et ne sont par ailleurs pas des nœuds munin #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: for host in switchs:
print '[switchs.crans.org;%s]' % host print '[switchs.crans.org;%s]' % host
print ' address localhost\n' 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] #@[switchs.crans.org;supervision.switchs.crans.org]
#@update no #@update no
### Todo: bornes: host -l 148.231.138.in-addr.arpa
# #
#@# Les adherents #@# Les adherents
#@[association.crans.org;adherents] #@[association.crans.org;adherents]
@ -76,7 +95,7 @@ all_servers = metadata.query.all()
all_servers.sort(key=lambda x: x.hostname) all_servers.sort(key=lambda x: x.hostname)
for client in all_servers: for client in all_servers:
print """[%(profile)s] print """[crans.org;%(profile)s]
address %(hostname)s address %(hostname)s
apt.graph yes apt.graph yes
postfix_mailqueue.deferred.warning 1000 postfix_mailqueue.deferred.warning 1000