From jbers at bbn.com Thu Jun 14 15:40:25 2007 From: jbers at bbn.com (Josh Bers) Date: Thu Jun 14 19:43:22 2007 Subject: [snmp] trap redirection question Message-ID: <002401c7aeb3$78ec7590$010010ac@JBERS2> I would like to use a trap redirector to forward traps received from an agent on port 162 to a Westhawk based manager application listening on some other port. My question is how does the Westhawk stack demultiplex SNMP v1 traps to the appropriate trap context? Does it use the IP address found in the src field of the ip header of the trap message or does it use the agent-addr field of the trap PDU itself to determine which context should receive the trap? thanks, Josh From jbers at bbn.com Fri Jun 15 13:05:11 2007 From: jbers at bbn.com (Josh Bers) Date: Fri Jun 15 17:09:22 2007 Subject: [snmp] listening on 162 on linux Message-ID: <002f01c7af66$f7825fb0$010010ac@JBERS2> Is there a way on linux to allow non-root processes to listen on port 162 (snmp-trap)? thanks, Josh From thp at westhawk.co.uk Fri Jun 15 18:21:41 2007 From: thp at westhawk.co.uk (Tim Panton) Date: Fri Jun 15 17:24:41 2007 Subject: [snmp] listening on 162 on linux In-Reply-To: <002f01c7af66$f7825fb0$010010ac@JBERS2> References: <002f01c7af66$f7825fb0$010010ac@JBERS2> Message-ID: <34A0847D-4083-4F88-A351-03CFED4FD082@westhawk.co.uk> On 15 Jun 2007, at 17:05, Josh Bers wrote: > Is there a way on linux to allow non-root processes to listen on > port 162 > (snmp-trap)? > It depends on your OS. On Linux the easiest way is to get iptables to port forward 162 to 11162 (or whatever) and have the stack listen there. Solaris used to have a feature where you could manage the range of privileged ports with ndd - but I don't think it is supported in the most recent version. Tim. > thanks, > > Josh > _______________________________________________ > snmp mailing list > snmp@snmp.westhawk.co.uk > http://snmp.westhawk.co.uk/mailman/listinfo/snmp From D.T.Shield at csc.liv.ac.uk Fri Jun 15 19:17:20 2007 From: D.T.Shield at csc.liv.ac.uk (Dave Shield) Date: Fri Jun 15 21:28:35 2007 Subject: [snmp] listening on 162 on linux In-Reply-To: <002f01c7af66$f7825fb0$010010ac@JBERS2> References: <002f01c7af66$f7825fb0$010010ac@JBERS2> Message-ID: On 15/06/07, Josh Bers wrote: > Is there a way on linux to allow non-root processes to listen on port 162 > (snmp-trap)? The usual approach would be to start the process as root, and have it open the root-only port, before relinquishing root privileges and switching to run as a different user/group. See 'setuid()', 'setgid()' and (on some systems) 'setgroups()' or 'initgroups()' for details. Dave From birgit at westhawk.co.uk Tue Jun 19 12:25:10 2007 From: birgit at westhawk.co.uk (Birgit Arkesteijn) Date: Tue Jun 19 11:27:41 2007 Subject: [snmp] trap redirection question In-Reply-To: <002401c7aeb3$78ec7590$010010ac@JBERS2> References: <002401c7aeb3$78ec7590$010010ac@JBERS2> Message-ID: <4677AF06.9080908@westhawk.co.uk> Hi Josh, I was on holiday last week, hence my late reply. It's the first of the two: The context receives and compares the IP address of the machine from which the datagram packet was received. (see java.net.DatagramPacket.getAddress()) More in details (not sure you care): stack.AbstractSnmpContext.rawPduReceived(RawPduEvent evt) { String hostAddress = evt.getHostAddress(); int version = evt.getVersion(); if (version == this.getVersion()) { if (hostAddress != null && hostAddress.equals(this.getSendToHostAddress()) == true) { // process message and consume event ... } ... } ... } evt.getHostAddress() returns the value that originates as 'receiveFromHostAddr': net.StandardSocket.receive(int maxRecvSize) { ... DatagramPacket p = new DatagramPacket(data, maxRecvSize); ... soc.receive(p); receiveFromHostAddr = p.getAddress(); ... item = new StreamPortItem(receiveFromHostAddr.getHostAddress(), .... ... } Hope this answers your question. BTW, did you fix/solve your "snmpv3 context receiver thread destoyed" problem? Cheers, Birgit Josh Bers wrote: > I would like to use a trap redirector to forward traps received from > an agent on port 162 to a Westhawk based manager application > listening on some other port. My question is how does the Westhawk > stack demultiplex SNMP v1 traps to the appropriate trap context? > > Does it use the IP address found in the src field of the ip header of > the trap message or does it use the agent-addr field of the trap PDU > itself to determine which context should receive the trap? > > thanks, > > Josh > _______________________________________________ > snmp mailing list > snmp@snmp.westhawk.co.uk > http://snmp.westhawk.co.uk/mailman/listinfo/snmp -- -- Birgit Arkesteijn, birgit@westhawk.co.uk, -- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK -- Company no: 1769350 -- Registered Office: -- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK. -- tel.: +44 (0)161 237 0660 -- From thp at westhawk.co.uk Thu Jun 28 12:27:28 2007 From: thp at westhawk.co.uk (Tim Panton) Date: Thu Jun 28 11:31:01 2007 Subject: [snmp] Outage Message-ID: Our mail/web server for snmp.westhawk.co.uk crashed yesterday. I've just rebooted it - it's a sad moment since the uptime was 992 days on hardware that must be 10+ years old. Anyhow this is an announcement we are back in the air and a check that we are :-) Tim. (P.S. the CVS archive on sourceforge was unaffected) T.