Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/python
- #coding=UTF8
- import netsnmp, time
- host = '10.90.90.90'
- rcomm = 'public'
- start=time.time()
- oid = (netsnmp.VarList(
- netsnmp.Varbind('.1.3.6.1.2.1.2.2.1.10'),
- netsnmp.Varbind('.1.3.6.1.2.1.2.2.1.16'),
- ))
- res = netsnmp.snmpwalk(oid, Version = 2, DestHost = host, Community = rcomm, Timeout = 150000, Retries = 0, UseNumeric = 1)
- for o in oid:
- print "index: {}, vid: {}, type: {}, value: {}".format(o.tag,o.iid,o.type,o.val)
- print "\nElapsed Time: {:.4f}".format(time.time() - start)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement