From docs
"....
The program is fed details about the trap to its
standard input, in the following format, one entry per
line:
HOSTNAME
The name of the host in question that
sent the trap, as determined by gethostbyaddr(3).
IPADDRESS
The IP address of the host that sent
the trap.
VARBINDS
..."
In fact snmptrapd v5.1 uses incorrect order:
IPADDRESS
HOSTNAME
VARBINDS
Logged In: YES
user_id=88893
Thanks for the bug report! We've fixed the problem in the
5.1.x code branch and the main development tree,
so it should be fixed in future releases of the net-snmp package.
Logged In: YES
user_id=85836
If the agent IP address contains a 0 (such as 192.168.0.1)
it will not output the snmpTrapAddress in the traphandle.
This is fixed with this patch:
--- agent/agent_trap.c.org 2004-01-30
15:41:05.000000000 -0500
+++ agent/agent_trap.c 2004-01-30 15:40:43.000000000 -0500
@@ -491,10 +491,7 @@
*/
var = find_varbind_in_list( template_v2pdu->variables,
agentaddr_oid,
agentaddr_oid_len);
- if (!var && template_v1pdu->agent_addr[0]
- && template_v1pdu->agent_addr[1]
- && template_v1pdu->agent_addr[2]
- && template_v1pdu->agent_addr[3]) {
+ if (!var && template_v1pdu->agent_addr) {
if (!snmp_varlist_add_variable(
&(template_v2pdu->variables),
agentaddr_oid, agentaddr_oid_len,
ASN_IPADDRESS,