2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

arp_ wspace fix

This commit is contained in:
Martin Ness 2014-09-13 22:10:22 +02:00
parent 36dbfa1b28
commit 2d0c82de81

View File

@ -27,28 +27,28 @@ if [ "$1" = "autoconf" ]; then
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
egrep '^ *(eth|wlan|ath|ra)[0-9]+(\.[0-9]+)?:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' | tr '.' '_' egrep '^ *(eth|wlan|ath|ra)[0-9]+(\.[0-9]+)?:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' | tr '.' '_'
exit 0 exit 0
else else
exit 1 exit 1
fi fi
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
echo "graph_title ARP entries for $INTERFACE" echo "graph_title ARP entries for $INTERFACE"
echo 'graph_args --base 1000 -l 0' echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel Entries' echo 'graph_vlabel Entries'
echo 'graph_category network' echo 'graph_category network'
echo 'graph_scale no' echo 'graph_scale no'
echo "graph_info This graph shows the number of ARP entries registered by the system for interface ${INTERFACE}." echo "graph_info This graph shows the number of ARP entries registered by the system for interface ${INTERFACE}."
echo 'entries.label ARP entries' echo 'entries.label ARP entries'
echo 'entries.draw LINE2' echo 'entries.draw LINE2'
echo 'entries.type GAUGE' echo 'entries.type GAUGE'
echo 'entries.info Number of ARP entries' echo 'entries.info Number of ARP entries'
exit 0 exit 0
fi fi
arp -an -i "$INTERFACE" | awk 'BEGIN { regex="<incomplete>";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}' arp -an -i "$INTERFACE" | awk 'BEGIN { regex="<incomplete>";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}'