From 626f42fafe732753fdf08898864bfe28e30bfa9e Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Sun, 2 Jun 2013 13:09:43 -0700 Subject: [PATCH] move arp plugins to network directory --- plugins/arp/arp | 42 ----------------------------------- plugins/network/arp | 18 +++++++++++---- plugins/{arp => network}/arp_ | 0 3 files changed, 14 insertions(+), 46 deletions(-) delete mode 100755 plugins/arp/arp rename plugins/{arp => network}/arp_ (100%) diff --git a/plugins/arp/arp b/plugins/arp/arp deleted file mode 100755 index 8addffa3..00000000 --- a/plugins/arp/arp +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# Plugin to monitor total ARP entries -# -# Parameters understood: -# -# config (required) -# autoconf (optional) -# -# Made by Sven Hartge (sven AT svenhartge DOT de) -# - -#%# family=contrib -#%# capabilities=autoconf - -if [ "$1" = "autoconf" ]; then - # Search for arp - which arp >/dev/null 2>/dev/null || (echo "no (can't find arp binary)" && exit 1) - - # ...or success - echo yes - exit 0 -fi - - - -if [ "$1" = "config" ]; then - echo 'graph_title ARP entries' - 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.' - 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 | awk 'BEGIN { regex="";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}' - diff --git a/plugins/network/arp b/plugins/network/arp index ae7e99cc..896b38bb 100755 --- a/plugins/network/arp +++ b/plugins/network/arp @@ -1,10 +1,20 @@ #!/bin/sh +# +# Plugin to monitor total ARP entries +# +# Parameters understood: +# +# config (required) +# autoconf (optional) +# +# Made by Sven Hartge (sven AT svenhartge DOT de) +# #%# family=contrib #%# capabilities=autoconf if [ "$1" = "autoconf" ]; then - # Search for arpwatch + # Search for arp which arp >/dev/null 2>/dev/null || (echo "no (can't find arp binary)" && exit 1) # ...or success @@ -19,13 +29,13 @@ if [ "$1" = "config" ]; then 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.' echo 'entries.label ARP entries' - echo 'entries.draw STACK' + echo 'entries.draw LINE2' echo 'entries.type GAUGE' echo 'entries.info Number of ARP entries' exit 0 fi -echo -n "entries.value " -arp -an | wc -l +arp -an | awk 'BEGIN { regex="";} { if (!match($4,regex)) { a[$4] }} END{for(i in a){n++};print "entries.value " n}' diff --git a/plugins/arp/arp_ b/plugins/network/arp_ similarity index 100% rename from plugins/arp/arp_ rename to plugins/network/arp_