[SNMP4J] Trap Messages using SampleAgent from the network not working

Frank Fock fock at agentpp.com
Sun Jul 25 13:13:59 CEST 2010


Hi,

I a bit confused by this thread.
The SnmpTargetAddrEntryRow.getAddress() instance must
contain the IP address of the trap target system
(PC2?)!
It has to be configured by you to have that address!

Thus, you do not need to change any code (for
production).

The agent does not care who monitors it and
who receives traps/notifications, however
a manager has to configure itself into the
SNMP-TARGET-MIB objects.

Please read RFC 3413 for details.

Best regards,
Frank

On 25.07.2010 12:45, Ver Allan N. Sumabat wrote:
> I have seen the problem. I changed this part of code in
> NotificationOriginatorImpl line 173:
>
> Address address = ((SnmpTargetAddrEntryRow)addr).getAddress();
>
> to this:
>
> Address address = GenericAddress.parse("udp:255.255.255.255/162");
>
> I'm now receiving traps on PC 2.
>
> My questions are:
>
> 1. Is this the correct approach? That is, I have to specify on the agent
> side the ip address of the monitor ip address? My idea is you deploy the
> agent and the agent doesn't care who monitors it. With this approach, the
> agent has to know who monitors it.
>
> 2. I haven't looked deeper but where is the address of this code
> "((SnmpTargetAddrEntryRow)addr).getAddress()" being stored 'cause as I see
> it, it always returns 127.0.0.1 which is only useful for development and not
> for production?
>
> Thanks and best regards,
> Allan
>
>
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On
> Behalf Of Ver Allan N. Sumabat
> Sent: Friday, July 23, 2010 7:13 PM
> To: 'Kazantsev, Andrey V.'
> Cc: snmp4j at agentpp.org
> Subject: Re: [SNMP4J] Trap Messages using SampleAgent from the network not
> working
>
> This is the part I'm not sure I understand. Correct me if I'm wrong, my
> understanding is let's say PC 1 (agent) generates a trap. The trap is caused
> by let's say a hardware malfunction. Shouldn't the trap message originate
> from PC 1 and not PC 2 because PC 1 has the failing hardware and the agent
> should simply report it to PC 2? That is, PC 2 is the trap receiver
> listening on port 162?
>
>
> -----Original Message-----
> From: Kazantsev, Andrey V. [mailto:kazantsev at axmor.com]
> Sent: Friday, July 23, 2010 6:52 PM
> To: Ver Allan N. Sumabat
> Cc: snmp4j at agentpp.org
> Subject: RE: [SNMP4J] Trap Messages using SampleAgent from the network not
> working
>
> Are you sure that snmp agent listens on address that is accessible for snmp
> monitor? I.e., PC 1 (agent) address is 192.168.1.1 and PC 2 (monitor)
> address is 192.168.1.2. Snmp agent should listen on 192.168.1.1:161, while
> snmp monitor should send notifications to 192.168.1.1:161 (using its
> 192.168.1.2 interface).
>
> If this is ok - check network connection between these two PCs, maybe there
> is a firewall on PC 1 that is blocking 161 port?
>
> If you work on linux, you can also use tcpdump to see what is going on
> network.
>
> -----Original Message-----
> From: Ver Allan N. Sumabat [mailto:allan.sumabat at aatitechnologies.com]
> Sent: Friday, July 23, 2010 17:44
> To: Kazantsev, Andrey V.
> Cc: snmp4j at agentpp.org
> Subject: RE: [SNMP4J] Trap Messages using SampleAgent from the network not
> working
>
> The thing is the traps and informs are received locally meaning on
> 127.0.0.1. When I use another machine to receive the traps, I cannot receive
> them. Let me elaborate further:
>
> Case 1:
>
> PC 1 - has snmp agent (SampleAgent from snmp4j source), has snmp monitor
> -----------------------
> result: traps are received by PC 1.
>
>
> Case 2:
>
> PC 1 - has snmp agent (snmp4j agent)
> PC 2 - has snmp monitor
> -----------------------
> Result: no traps received by PC 2
>
>
> Btw, I didn't change anything in the SampleAgent source to make it run.
>
>
> -----Original Message-----
> From: Kazantsev, Andrey V. [mailto:kazantsev at axmor.com]
> Sent: Friday, July 23, 2010 5:30 PM
> To: Ver Allan N. Sumabat
> Cc: snmp4j at agentpp.org
> Subject: RE: [SNMP4J] Trap Messages using SampleAgent from the network not
> working
>
> Hi,
>
> By default traps and informs use port 162, maybe be this is the cause of
> problem?
>
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On
> Behalf Of Ver Allan N. Sumabat
> Sent: Friday, July 23, 2010 16:09
> To: snmp4j at agentpp.org
> Subject: [SNMP4J] Trap Messages using SampleAgent from the network not
> working
>
> Hi List,
>
>
>
> I'm having a problem trying to get trap messages over the network using the
> SampleAgent class. I tried starting it with the following argument:
> udp:127.0.0.1/161
>
>
>
> Using the iReasoning MIBBrowser personal edition, I can receive trap
> messages locally. When I use another pc as snmp monitor, I could no longer
> receive those trap messages.
>
>
>
> I tried changing the program argument to udp:192.168.x.x/161 which is the ip
> address of the pc running the agent but still same result.
>
>
>
> Any ideas?
>
>
>
> Thanks,
>
> Allan
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list