diff --git a/deployment/config.json b/deployment/config.json index 8b253bf..c9da195 100644 --- a/deployment/config.json +++ b/deployment/config.json @@ -20,11 +20,20 @@ "oid": ".1.3.6.1.2.1.31.1.1.1.6.2", "label": "lan-in", "diff": "true" + }, + "oid": ".1.3.6.1.2.1.31.1.1.1.7.2", + "label": "lan-in-pkts", + "diff": "true" }, { "oid": ".1.3.6.1.2.1.31.1.1.1.10.2", "label": "lan-out", "diff": "true" + }, + { + "oid": ".1.3.6.1.2.1.31.1.1.1.11.2", + "label": "lan-out-pkts", + "diff": "true" } ] }, diff --git a/tools/mysnmpwalk.sh b/tools/mysnmpwalk.sh new file mode 100755 index 0000000..fea7f4d --- /dev/null +++ b/tools/mysnmpwalk.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +COMMUNITY="" +HOST="" +BASE_OID="" + +while getopts "c:h:b:" option; do + case $option in + c) COMMUNITY=$OPTARG + ;; + h) HOST=$OPTARG + ;; + b) BASE_OID=$OPTARG + ;; + ?) + echo "Usage $0 -c COMMUNITY -h HOST -b BASE_OID" + exit 1 + ;; + esac +done + +if [ "$COMMUNITY" = "" ]; then + echo "Set a community using -c" + exit 1 +fi + +if [ "$HOST" = "" ]; then + echo "Set a host using -h" + exit 1 +fi + +if [ "$BASE_OID" = "" ]; then + echo "Set a base oid using -b" + exit 1 +fi + + +snmpwalk -v 2c -c $COMMUNITY -On $HOST $BASE_OID | while read -r line; do + oid=`echo $line | awk '{print $1}'` + textoid=`snmptranslate $oid` + value=`echo $line | cut -d ' ' -f 3-` + echo "$oid ($textoid): $value" +done + +