[munin] ajouts de quelques switchs et des bornes
This commit is contained in:
parent
740c37a6c6
commit
c91f83880b
1 changed files with 25 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue