root / plugins / network / pf_ipv4_ipv6_packets @ dd4afac8
Historique | Voir | Annoter | Télécharger (980 octets)
| 1 | c9bc1c1d | JCB | #!/bin/sh |
|---|---|---|---|
| 2 | pfctl='/sbin/pfctl' |
||
| 3 | |||
| 4 | if [ "$1" = "config" ]; then |
||
| 5 | cat <<EOF |
||
| 6 | graph_title OpenBSD pf packets ipv4/ipv6 |
||
| 7 | graph_vlabel packets numbers |
||
| 8 | graph_scale no |
||
| 9 | graph_category network |
||
| 10 | graph_args -l 0 |
||
| 11 | graph_info OpenBSD pf packets ipv4/ipv6 |
||
| 12 | EOF |
||
| 13 | cat <<EOF |
||
| 14 | ipv4in.label ipv4 IN |
||
| 15 | ipv4in.min 0 |
||
| 16 | ipv4in.type DERIVE |
||
| 17 | ipv4out.label ipv4 OUT |
||
| 18 | ipv4out.min 0 |
||
| 19 | ipv4out.type DERIVE |
||
| 20 | ipv6in.label ipv6 IN |
||
| 21 | ipv6in.min 0 |
||
| 22 | ipv6in.type DERIVE |
||
| 23 | ipv6out.label ipv6 OUT |
||
| 24 | ipv6out.min 0 |
||
| 25 | ipv6out.type DERIVE |
||
| 26 | EOF |
||
| 27 | exit 0 |
||
| 28 | fi |
||
| 29 | if [ "$1" = "autoconf" ]; then |
||
| 30 | echo yes |
||
| 31 | exit 0 |
||
| 32 | fi |
||
| 33 | |||
| 34 | ipv4_in=$(/sbin/pfctl -si 2>/dev/null | grep 'Bytes In' | awk '{print $3}')
|
||
| 35 | ipv6_in=$(/sbin/pfctl -si 2>/dev/null | grep 'Bytes In' | awk '{print $4}')
|
||
| 36 | ipv4_out=$(/sbin/pfctl -si 2>/dev/null | grep 'Bytes Out' | awk '{print $3}')
|
||
| 37 | ipv6_out=$(/sbin/pfctl -si 2>/dev/null | grep 'Bytes Out' | awk '{print $4}')
|
||
| 38 | echo "ipv4in.value $ipv4_in" |
||
| 39 | echo "ipv4out.value $ipv4_out" |
||
| 40 | echo "ipv6in.value $ipv6_in" |
||
| 41 | echo "ipv6out.value $ipv6_out" |
