From 2d0c82de8126a1602c8b30f107eb724be144dff4 Mon Sep 17 00:00:00 2001 From: Martin Ness Date: Sat, 13 Sep 2014 22:10:22 +0200 Subject: [PATCH] arp_ wspace fix --- plugins/network/arp_ | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/plugins/network/arp_ b/plugins/network/arp_ index 471d17f3..79159e94 100755 --- a/plugins/network/arp_ +++ b/plugins/network/arp_ @@ -27,28 +27,28 @@ if [ "$1" = "autoconf" ]; then fi if [ "$1" = "suggest" ]; 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 '.' '_' - exit 0 - else - exit 1 - fi + 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 '.' '_' + exit 0 + else + exit 1 + fi fi if [ "$1" = "config" ]; then - echo "graph_title ARP entries for $INTERFACE" - echo 'graph_args --base 1000 -l 0' - echo 'graph_vlabel Entries' - echo 'graph_category network' - echo 'graph_scale no' - 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.draw LINE2' - echo 'entries.type GAUGE' - echo 'entries.info Number of ARP entries' - exit 0 + echo "graph_title ARP entries for $INTERFACE" + echo 'graph_args --base 1000 -l 0' + echo 'graph_vlabel Entries' + echo 'graph_category network' + echo 'graph_scale no' + 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.draw LINE2' + echo 'entries.type GAUGE' + echo 'entries.info Number of ARP entries' + exit 0 fi arp -an -i "$INTERFACE" | awk 'BEGIN { regex="";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}'