Skip to content

Instantly share code, notes, and snippets.

@twr14152
Last active August 29, 2015 14:13
Show Gist options
  • Save twr14152/79edc52a5898c36faa3f to your computer and use it in GitHub Desktop.
Save twr14152/79edc52a5898c36faa3f to your computer and use it in GitHub Desktop.
Pynet Week1 Ex2
#!/usr/bin/env python
import snmp_helper
COMMUNITY_STRING = '***'
IP = '*.*.*.*'
pynet_rtr1 = (IP, COMMUNITY_STRING, ****)
pynet_rtr2 = (IP, COMMUNITY_STRING, ****)
sys_descr = '1.3.6.1.2.1.1.1.0'
sys_name = '1.3.6.1.2.1.1.5.0'
for router in (pynet_rtr1, pynet_rtr2):
print "\n++++++++++++++++++++++++++++++"
for the_oid in (sys_name, sys_descr):
snmp_data = snmp_helper.snmp_get_oid(router, oid=the_oid)
output = snmp_helper.snmp_extract(snmp_data)
print output
print"\n++++++++++++++++++++++++++++++"
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment