Guest User

Untitled

a guest
Jan 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. snmp_extend_oid (){
  2. oid=$1; tag=$2;
  3. taglen=$(expr length $tag)
  4. tag_oid=$(
  5. echo "${tag}"| sed 's/\(.\)/\1\n/g'| while read char ;do
  6. if [ ! -z "${char}" ];then
  7. echo -n .
  8. echo -n $(( ( 256 + $(printf '%d' "'$char"))%256 ));
  9. fi
  10. done
  11. )
  12. echo ${oid}.4.1.2.${taglen}${tag_oid}.1
  13. }
  14. swalk eir $(snmp_extend_oid .1.3.6.1.4.1.32372.1.1.2.1.1.1.1 w.time)
Add Comment
Please, Sign In to add comment