[SNMP4J] SNMP4J Digest, Vol 79, Issue 17

Chatterjee, Amarnath (Amarnath) chatterjeea at avaya.com
Mon Aug 23 11:56:49 CEST 2010


Tsiyona,

I have done similar checking on after extracting the ip-address using
getPeerAddress method of the CommandResponderEvent.

For example you do something like:

public void processPdu(CommandResponderEvent event) {

String ipAddr = getIpAddr(event.getPeerAddress().toString());
........
........
}

private String getIpAddr(String ipAddr) {
		String ipAddress = null;
		ipAddress = ipAddr.split("/")[0].trim();
		return ipAddress;
	}

-Amarnath
-----Original Message-----
From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On
Behalf Of snmp4j-request at agentpp.org
Sent: Monday, August 23, 2010 3:30 PM
To: snmp4j at agentpp.org
Subject: SNMP4J Digest, Vol 79, Issue 17

Send SNMP4J mailing list submissions to
	snmp4j at agentpp.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.agentpp.org/mailman/listinfo/snmp4j
or, via email, send a message with subject or body 'help' to
	snmp4j-request at agentpp.org

You can reach the person managing the list at
	snmp4j-owner at agentpp.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of SNMP4J digest..."


Today's Topics:

   1. How to handle traps that come from a specific ip address	only
      (Tsiyona)


----------------------------------------------------------------------

Message: 1
Date: Mon, 23 Aug 2010 10:08:24 +0300
From: Tsiyona <tsiyona at gmail.com>
Subject: [SNMP4J] How to handle traps that come from a specific ip
	address	only
To: snmp4j at agentpp.org
Message-ID:
	<AANLkTimGOz7-UTLJ1w0mmew70G_J6UgjNEBpOHSUcZet at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I am writing a trap receiver that only intercepts traps and analyzes
them.

In our system we have two servers on which snmp agents are generating
traps.
At a given time, only one server out of the two is an active server,
meaning
that only this
server's traps are to be processed, while the other server's traps are
to be
ignored.
These two servers have distinct ip addresses (different from one
another's).

Is there a way I can open an snmp session and start listening only for
traps
that
arrive from a specific ip address (i.e. from the active serve's ip
address
only) ?

Of course I could check the agent address in each received trap pdu and
ignore those
traps that come from a non-active server, but I am asking here whether
snmp4j infrastructure
itself provides means of doing that.

Thanks,
Tsiyona


------------------------------

_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j


End of SNMP4J Digest, Vol 79, Issue 17
**************************************



More information about the SNMP4J mailing list