Traceback (most recent call last):
File “MonitorNetworkPrint.py”, line 414, in <module>
File “MonitorNetworkPrint.py”, line 368, in Main
File “MonitorNetworkPrint.py”, line 189, in StartMonitor
File “MonitorNetworkPrint.py”, line 84, in SnmpGet
File “pysnmp\entity\rfc3413\oneliner\cmdgen.py”, line 166, in __init__
File “pysnmp\entity\engine.py”, line 88, in __init__
File “pysnmp\smi\builder.py”, line 377, in importSymbols
pysnmp.smi.error.MibNotFoundError: No module __SNMP-FRAMEWORK-MIB loaded at <pysnmp.smi.builder.MibBuilder object at 0x02974230>
Failed to execute script MonitorNetworkPrint
Когда запускаю питоновский файл, то все работает. В чем может быть причина?
Вот кусок кода где происходит ошибка:
def SnmpGet (MassOids,IpPrint):
MassGet = []
cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
cmdgen.CommunityData('public',mpModel=0),
cmdgen.UdpTransportTarget((IpPrint, 161),timeout=4,retries=1),
MassOids[0],MassOids[1],MassOids[2],MassOids[3]
)
if errorIndication:
print(errorIndication)
else:
if errorStatus:
print('%s at %s' % (
errorStatus.prettyPrint(),
errorIndex and varBinds[int(errorIndex)-1] or '?'
)
)
else:
for name, val in varBinds:
MassGet.append (val.prettyPrint())
print (MassGet)
WriteBd (IpPrint,MassGet)