I'm sending a trap using pysnmp, but somehow the trap is getting there via TCP instead of UDP, and it is also changing the port, which I told it to use 162, but it's sending as 4222.
This is the code:
next(sendNotification(SnmpEngine(),
CommunityData('public', mpModel=0),
UdpTransportTarget(('ipv4', 162)),
ContextData(),
'trap',
[ObjectType(ObjectIdentity('1.3.6.1.2.1.1.1.0'), OctetString('TEST TEST TEST'))]))
I have no idea why this is happening. Any thoughts?
It looks like the IP address is not correct for UdpTransportTarget()
or
try giving transportAddr=('127.0.0.1', 162)