Skip to content

Instantly share code, notes, and snippets.

@tcuthbert
Created February 11, 2016 14:21
Show Gist options
  • Save tcuthbert/bb9845f0ec49d80db367 to your computer and use it in GitHub Desktop.
Save tcuthbert/bb9845f0ec49d80db367 to your computer and use it in GitHub Desktop.
import sys
from trigger.cmds import StructuredOutput
from twisted.python import log
class ShowSNMP(StructuredOutput):
"""Execute 'show clock' on a list of Cisco devices."""
vendors = ['cisco']
commands = ['show snmp community']
if __name__ == '__main__':
log.startLogging(sys.stdout, setStdout=False)
device_list = ['r1.demo.local']
show_snmp_community = ShowSNMP(devices=device_list)
show_snmp_community.run() # Commando exposes this to start the event loop
print '\nResults:'
print show_snmp_community.results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment