Created
September 9, 2011 16:58
-
-
Save fapestniegd/1206733 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| snmp_extend_oid (){ | |
| oid=$1; tag=$2; | |
| taglen=$(expr length $tag) | |
| tag_oid=$( | |
| echo "${tag}"| sed 's/\(.\)/\1\n/g'| while read char ;do | |
| if [ ! -z "${char}" ];then | |
| echo -n . | |
| echo -n $(( ( 256 + $(printf '%d' "'$char"))%256 )); | |
| fi | |
| done | |
| ) | |
| echo ${oid}.4.1.2.${taglen}${tag_oid}.1 | |
| } | |
| swalk eir $(snmp_extend_oid .1.3.6.1.4.1.32372.1.1.2.1.1.1.1 w.time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment