networklore / ansible-snmp

SNMP modules for Ansible
Other
8 stars 6 forks source link

Code not returning any data #2

Closed gavmckee80 closed 7 years ago

gavmckee80 commented 7 years ago

Hi ,

When I run the following code I get no data back from the device. When I run the module using Ansible I do get data back. Can you help explain that ?

from nelsnmp.snmp import SnmpHandler from nelsnmp.hostinfo.device import HostInfo

def main():

try:
    dev = SnmpHandler(host='1.1.1.1', community='xxxxx', version='2c')
    hostinfo = HostInfo(dev)

    print "trying..."
    print hostinfo.get_version()
except Exception as err:
    print "Must be a timeout or something", err

main()

ogenstad commented 7 years ago

Closing, duplicate of https://github.com/networklore/nelsnmp/issues/9