]> git.sven.stormbind.net Git - sven/scripts.git/blobdiff - mrtg-alix/mrtg-scripts/explore_net
Import Alix mrtg scripts
[sven/scripts.git] / mrtg-alix / mrtg-scripts / explore_net
diff --git a/mrtg-alix/mrtg-scripts/explore_net b/mrtg-alix/mrtg-scripts/explore_net
new file mode 100755 (executable)
index 0000000..f9f51af
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+
+DEV="$1"
+if test -z "$DEV"; then echo No device specified; exit 1; fi
+
+INFO=`grep $DEV /proc/net/dev | tr -s ' ' ' ' | cut -d: -f2`
+RECEIVE=`echo $INFO | cut -d" " -f1`
+TRANSMIT=`echo $INFO | cut -d" " -f9`
+
+echo $RECEIVE
+echo $TRANSMIT
+echo ""
+hostname -s