Last active
August 29, 2015 14:13
-
-
Save twr14152/79edc52a5898c36faa3f to your computer and use it in GitHub Desktop.
Pynet Week1 Ex2
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
#!/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++++++++++++++++++++++++++++++" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment