[munin/iptables_] On ne plante pas sur une chaine vide

This commit is contained in:
Valentin Samir 2013-04-25 14:33:39 +02:00
parent 19d782c0be
commit f6fa910ef8

View file

@ -51,7 +51,8 @@ else :
data = commands.getoutput("%s %s | uniq | awk '{print $4}' | grep 231 | awk -F '.' '{print $1$2$3}' | sort | uniq -c | grep 231" % (IPTABLES, chain)).split('\n') data = commands.getoutput("%s %s | uniq | awk '{print $4}' | grep 231 | awk -F '.' '{print $1$2$3}' | sort | uniq -c | grep 231" % (IPTABLES, chain)).split('\n')
total = 0 total = 0
for line in data : for line in data :
value, subnet = line.split() try: value, subnet = line.split()
except ValueError: continue
total += int(value) total += int(value)
if subnet[:8] == "10231136": if subnet[:8] == "10231136":
print "%sadm.value %s" % (nom, value) print "%sadm.value %s" % (nom, value)