Projet

Général

Profil

Révision c9157be3

IDc9157be3fe0bdcc3fb54855056e1cebe94e4dcd5
Parent 0b07e636
Enfant 0d775b28, 2078cab6, 863d326b

Ajouté par Lars Kruse il y a presque 8 ans

iptables-related plugins: use "-w" for consistent results

The parameter "-w" forces iptables to wait for a lock before
printing data.

The parameter requires iptables 1.6 (released 2015).

See https://github.com/munin-monitoring/munin/issues/586

Voir les différences:

plugins/network/ipt_accounting_
42 42

  
43 43
if [ "$1" = "autoconf" ]; then
44 44
        if [ -r /proc/net/dev ]; then
45
                iptables -L INPUT -v -n -x >/dev/null 2>/dev/null
45
                iptables -L INPUT -v -n -x -w >/dev/null 2>/dev/null
46 46
                if [ $? -gt 0 ]; then
47 47
                        echo "no (could not run iptables as user `whoami`)"
48 48
                        exit 1
......
57 57
fi
58 58

  
59 59
if [ "$1" = "suggest" ]; then
60
        iptables -L INPUT -v -x -n 2>/dev/null | sed -n 's/^.*\/\* ACC\-\([a-zA-Z]*\) \*\/.*$/\1/p'
60
        iptables -L INPUT -v -x -n -w 2>/dev/null | sed -n 's/^.*\/\* ACC\-\([a-zA-Z]*\) \*\/.*$/\1/p'
61 61
        exit 0
62 62
fi
63 63

  
......
79 79
        exit 0
80 80
fi;
81 81

  
82
iptables -L INPUT -v -n -x | grep -m1 "\/\* ACC\-"$ACC" \*\/" | awk "{ print \"in.value \" \$2 }"
83
iptables -L OUTPUT -v -n -x | grep -m1 "\/\* ACC\-"$ACC" \*\/" | awk "{ print \"out.value \" \$2 }"
82
iptables -L INPUT -v -n -x -w | grep -m1 "\/\* ACC\-"$ACC" \*\/" | awk "{ print \"in.value \" \$2 }"
83
iptables -L OUTPUT -v -n -x -w | grep -m1 "\/\* ACC\-"$ACC" \*\/" | awk "{ print \"out.value \" \$2 }"

Formats disponibles : Unified diff