[munin] strip wsp

darcs-hash:20100211115432-bd074-21666d2a895a1476c2af86a6968e60f6e011858e.gz
This commit is contained in:
Antoine Durand-Gasselin 2010-02-11 12:54:32 +01:00
parent 909aff2221
commit 2b2226644a
3 changed files with 14 additions and 14 deletions

View file

@ -49,7 +49,7 @@ if 'config' in sys.argv :
print "graph_args --base 1000";
print "graph_vlabel nb clients/chaines";
inc = 0
chaines = chaines.values()
chaines = chaines.values()
chaines.sort()
for nom in chaines :
if not nom : continue
@ -69,12 +69,12 @@ if 'config' in sys.argv :
if 'generate' in sys.argv :
stats = {} # { IP : [ prises ] }
for switch in all_switchs() :
# on vérifie que le switch est pingable
if os.system('ping -c 3 %s > /dev/null 2> /dev/null' % switch ) :
continue
sw = hpswitch(switch)
switch=switch.split('.')[0]
if switch[-1].isalpha() :
@ -84,19 +84,19 @@ if 'generate' in sys.argv :
bat = switch[-3].lower()
sw_num = int(switch[-1])
if bat not in uplink_prises: #Adg fait de la merde avec l'annuaire
continue
#if bat not in uplink_prises:
# continue
for ip, liste in sw.multicast().items() :
stats.setdefault(ip,[])
for port in liste :
num_port = 100 * sw_num + int(port)
if num_port not in uplink_prises[bat].keys() :
stats[ip].append('%s%03i' % (bat, num_port) )
total = 0
f = open('/var/lib/munin/tmp/audimat','w')
for ip, nom in chaines.items() :
if not nom : continue
nb_clients = len(stats.get(ip,[]))