2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/ip6/ip6t_accounting
Lars Kruse c9157be3fe 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
2018-02-24 22:58:50 +01:00

23 lines
549 B
Bash
Executable File

#!/bin/sh
if [ "$1" = "config" ]; then
cat <<EOF
graph_title ip6tables bites ipv6
graph_vlabel bites numbers
graph_scale no
graph_category network
graph_args -l 0
graph_info ip6tables bites ipv6
EOF
ip6tables -vx -w -L | grep -E 'ACC|REJ'|grep -v ^Chain|sed -e 's/dpt://g' -e 's/ .*://g'|awk '{print $NF"-"$4".label", $NF" "$4"\n",$NF"-"$4".min", 0}'|sed 's/^\s*//g'
exit 0
fi
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
ip6tables -vx -w -L | grep -E 'ACC|REJ'|grep -v ^Chain|awk '{print $NF"-"$4".value", $2}'|sed 's/^dpt://'