It is found that NET-SNMP Agent sets the first UP and RUNNING interface
IP address as the AgentAddress in the trap message send from the Agent
to the SystemManager, instead of the IP address of the actual interface
that is connected to the SystemManager.
This can be explained using the example below :
Example:
--------
Suppose eth3(10.100.138.82) is connected to the System
Manager(10.100.138.252) , eth2 (10.90.91.93) is connected to another
machine.
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:50:5B:A9:0A
inet addr:10.90.90.91 Bcast:10.90.90.255 Mask:255.255.255.0
inet6 addr: fe80::200:50ff:fe5b:a90a/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:214 (214.0 b)
Base address:0xa000
eth1 Link encap:Ethernet HWaddr 00:00:50:5B:A9:0B
inet addr:192.168.100.91 Bcast:192.168.100.255
Mask:255.255.255.0
inet6 addr: fe80::200:50ff:fe5b:a90b/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:214 (214.0 b)
Base address:0xc000
eth1:1 Link encap:Ethernet HWaddr 00:00:50:5B:A9:0B
inet addr:192.168.16.17 Bcast:192.168.16.255
Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
Base address:0xc000
eth2 Link encap:Ethernet HWaddr 00:00:50:5B:A9:0C
inet addr:10.90.91.93 Bcast:10.90.91.255 Mask:255.255.255.0
inet6 addr: fe80::200:50ff:fe5b:a90c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13619 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3584642 (3.4 MiB) TX bytes:460 (460.0 b)
Interrupt:16
eth3 Link encap:Ethernet HWaddr 00:00:50:5B:A9:0D
inet addr:10.100.138.82 Bcast:10.100.138.255
Mask:255.255.255.0
inet6 addr: fe80::200:50ff:fe5b:a90d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:209686 errors:0 dropped:0 overruns:0 frame:0
TX packets:207828 errors:0 dropped:0 overruns:0 carrier:0
collisions:428 txqueuelen:1000
RX bytes:26283807 (25.0 MiB) TX bytes:21405284 (20.4 MiB)
Interrupt:17
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5368 errors:0 dropped:0 overruns:0 frame:0
TX packets:5368 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:580628 (567.0 KiB) TX bytes:580628 (567.0 KiB)
------
Here it is seen that the first UP and RUNNING interface is eth2. So
NET-SNMP sets the AgentAddress in the trap message as the IP address of
eth2 (10.90.91.93) instead of eth3 (10.100.138.82), even-though the
interface connected to SystemManager is eth3. As a result, the
AgentAddress displayed in the trap message in the SystemManager will the
IP address of eth2 and not eth3.
snmptrapd (NET-SNMP Version: 5.3.1) captures the trap message send from
the Agent to the SystemManager using the below command. snmptrapd runs
on the monitoring machine, for e.g SystemManager.
/usr/sbin/snmptrapd -Lf snmptrapd.log udp:3565
[-Lf snmptrapd.log -> Log into file snmptrapd.log]
By default, any trap message sent from the Agent to SystemManager will
be logged as below (with reference to the above example) :
2011-08-11 21:59:20 10.90.91.93 (via UDP: [10.100.138.82 ]:36903) TRAP,
SNMP v1, community public
SNMPv2-SMI::enterprises.343.2.14.2 Enterprise Specific Trap (25)
Uptime: 1 day, 18:06:31.40
SNMPv2-SMI::enterprises.343.2.14.2.5 = STRING: "Time : Fri Aug
12 04:58:45 2011 , Location : , Chassis Serial # : XXXXXXXXX ,
Board : chassis , Sensor : 0:Log Usage , Event : Log Area Reset/Cleared:
Assertion , Event Code : 0x0542"
I expected the AgentAddress to be displayed as 10.100.138.82(IP address
of the interface that is actually connected the SystemManager). Instead
it shows the AgentAddress as 10.90.91.93(IP address of First UP and
RUNNING interface).
So the questions :
1. Is it the SNMP specification to send the first UP and RUNNING
interface IP address as the AgentAddress in the trap message send from
the Agent to the SystemManager ? If yes, please give a link to the
specification which mentions this.
2. Is there any way to set the AgentAddress in the trap message
send from the Agent to the SystemManager as the IP address of the actual
Interface that is connected to the SystemManager, from the SNMP Agent
side?
Thanks,
-Nitin
------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users