[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
|
@ -34,16 +34,35 @@ 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue