Pysnmp - No SNMP response received before timeout

187 views
Skip to first unread message

Míriam Félix

unread,
Jan 11, 2017, 9:36:58 PM1/11/17
to Python Brasil
Boa noite, preciso de uma luz. 
Nesse codigo ele recebe o ip e a community e deveria me retornar os dados, mas minha unica resposta é No SNMP response received before timeout. 
Se eu consigo executar o ping no ip, a configuração errada certamente deve estar no codigo. 

from pysnmp.hlapi import *
from os import *
import index
import oid


g = errorIndication, errorStatus, errorIndex, varBinds = next(
getCmd(SnmpEngine(),
CommunityData(index.comunity,mpModel=1),
UdpTransportTarget((index.ip, 161)),
ContextData(),
ObjectType(ObjectIdentity(oid.Descr)),

),

)

if errorIndication:
print(errorIndication)
elif errorStatus:
print('%s at %s' % (errorStatus.prettyPrint(),
errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
else:

print (g),



Reply all
Reply to author
Forward
0 new messages