Search code examples
pythonsnmppysnmp

SNMP Simulator for Testing PySNMP?


I am looking for a way to test PySNMP scripts, since it seems like demo.snmplabs.com and snmpsim.try.thola.io are down - at least I can't get a response with the following example script from the PySNMP docs. Are there any other hosts I could try?

from pysnmp.hlapi import *

for (errorIndication,
     errorStatus,
     errorIndex,
     varBinds) in nextCmd(SnmpEngine(),
                          CommunityData('public'),
                          UdpTransportTarget(('snmpsim.try.thola.io', 161)),
                          ContextData(),
                          ObjectType(ObjectIdentity('1.3.6.1.2.1.1.1.0')),
                          lookupMib=False):

    if errorIndication:
        print(errorIndication)
        break
    elif errorStatus:
        print('%s at %s' % (errorStatus.prettyPrint(),
                            errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
        break
    else:
        print("hello")
        for varBind in varBinds:
            print(' = '.join([x.prettyPrint() for x in varBind]))

Response: No SNMP response received before timeout

EDIT: I have tried snmp.live.gambitcommunications.com, demo.snmplabs.com, and snmpsim.try.thola.io so at this point I feel like I'm missing something. Any ideas?


Solution

  • While there were so many attempts to fill the gaps, you will find demo.pysnmp.com a more reliable option from me, as I plan to take over the whole ecosystem, https://github.com/etingof/pysnmp/issues/429