用于测试 PySNMP 的 SNMP 模拟器?

问题描述

我正在寻找一种测试 PySNMP 脚本的方法,因为 demo.snmplabs.com 和 snmpsim.try.thola.io 似乎已关闭 - 至少我无法从以下示例脚本中获得响应PySNMP 文档。我可以尝试其他任何主机吗?

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]))

响应:超时前未收到 SNMP 响应

编辑:我已经尝试过 snmp.live.gambitcommunications.com、demo.snmplabs.com 和 snmpsim.try.thola.io 所以在这一点上我觉得我错过了一些东西。有什么想法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)