Conversation

Problem with IdSNMP Trap [Edit]

(overview of excerpts from articles in conversation)

Newsgroup: embarcadero.public.delphi.internet.winsock

# Lines
wrote on 09-Jun-2010:

I write a idsnmp trap receiver, it can receive trap v1 ok. It can receive v2c trap but the result is below
{code}
Version: 1 RequestId: 0 ErrorStatus: 0 ErrorIndex: 0
$30 = 1.3.6.1.6.3.1.1.4.1.0
$30 = 1.3.6.1.4.1.2011.6.3.10.2.1.2.1.1
40
  
Remy Lebeau (TeamB) replied on 09-Jun-2010:

wrote in message news:✉forums.embarcadero.com...
  (snip)

TIdSNMP only supports SNMP v1 at this time. The formatting of v2 PDUs,
  including Traps, is different than PDUs in v1.
  --
  Remy Lebeau (TeamB)
13
  
=?Utf-8?Q?Pierre_Dupr=C3=A8s?= replied on 13-Aug-2010:

(snip)

Well, I would really be very interested in knowing how you have managed to succefully receive traps with the idsnmp.receivetrap function !
  Impossible for my part, with delphi7, windows XP and TIdSNMP component !
  Note that the short code you've wrotten can't work as you don't use the idsnmp.create constructor...
  By the way, does anyone can tell me he has been able to receive snmp traps with delphi and idsnmp ?
  Because I've been searching all day long on the web, and expect lots of posts of unscuccessfully operation to do it, I've never seen yet someone telling (except here !) he had done it successfully !
89
    
Remy Lebeau (TeamB) replied on 13-Aug-2010:

"Pierre Dupr__s" <=?Utf-8?Q?Pierre_Dupr=C3=A8s?=> wrote in message
    news:✉forums.embarcadero.com...
    (snip)

He showed you exactly how he is doing it.
    (snip)

Did you upgrade to a newer Indy version yet?
    (snip)

Obviously, when he posted is just a snippet of larger code and not meant to
49
  
=?Utf-8?Q?Pierre_Dupr=C3=A8s?= replied on 14-Aug-2010:

(snip)







Edited by: Pierre Dupr__s on Aug 14, 2010 1:38 AM
  
  
  
  
81
  
=?Utf-8?Q?Pierre_Dupr=C3=A8s?= replied on 16-Aug-2010:

Here is the wireshark capture as asked, note that the trap is well in snmp v1 format, but shoes an OID named "snmpv2-smi", hope you won't misunderstood this and believe trap is in snmp v2 format !! (I do myself think that this OID name isn't very clever and can be confusing if the reader of the trap doesn't know traps frames format...).
  The link : http://a.imageshack.us/img808/8808/capturewireshark.jpg
  NB : I have also desactivated my firewall, but nothing has changed.
  
  
19
  
=?Utf-8?Q?Pierre_Dupr=C3=A8s?= replied on 17-Aug-2010:

Well, no reaction ?
  The wireshark capture has not been helpfull ?
  No one has an idea why my receivretrap() calls do not see any of all of the traps my 162 port is continuously receiving ?
  And about the "indy upgrade", what is it about ? We have never had to upgrade anything in our Delphi 6 and 7 professional packs and have developped several professional functionning softwares.
  
15
    
Remy Lebeau (TeamB) replied on 17-Aug-2010:

"Pierre Dupr__s" <=?Utf-8?Q?Pierre_Dupr=C3=A8s?=> wrote in message
    news:✉forums.embarcadero.com...
    (snip)

You need to have patience when dealing with online forums. You posted the
    screenshot yesterday. I did not see it until just a moment ago.
    (snip)

After reviewing TIdSNMP's internal logic, I do not believe it is even
25
  
=?Utf-8?Q?Pierre_Dupr=C3=A8s?= replied on 17-Aug-2010:

(snip)

OK thanks for All Remy. At least now I know (and my boss too) that we can't receive traps for the moment with this component.
  (snip)

  
  
  
34
    
Remy Lebeau (TeamB) replied on 19-Aug-2010:

"Pierre Dupr__s" <=?Utf-8?Q?Pierre_Dupr=C3=A8s?=> wrote in message
    news:✉forums.embarcadero.com...
    (snip)

I already checked in a new version of TIdSNMP that works with traps now.
    --
    Remy Lebeau (TeamB)
14
  
Remy Lebeau (TeamB) replied on 19-Aug-2010:

wrote in message news:✉forums.embarcadero.com...
  (snip)

That is exactly the bug that has been fixed now.
  (snip)

That will bind all outbound SNMP requests to local port 162 as well, instead
  of local port 161 as before. TIdSNMP has been fixed to use both ports now
  (TIdSNMP has a separate TrapPort property, afterall - it just was not
37
  
=?Utf-8?Q?Pierre_Dupr=C3=A8s?= replied on 19-Aug-2010:

Well I'm now working on another very important project, so that I will have time to see snmp only (maybe) in several weeks.
  Will I have to go to the link given by NGuyen, or to another link of yours, Remy ?
  Thanks to you both.
  
  
9
    
Nguyen Diep replied on 19-Aug-2010:

(snip)
Do you see an "ICMP destination unreachable (Port unreachable)" sent back on receiving a SNMP trap ? This means your IdSNMP was not listening on port 162, please check with "netstat -an -p udp" in command prompt.
    You must set the property snmp.BoundPort = 162 so that it is listening on this port and can process snmp trap meassage.
    (snip)
If the idsnmp still does not work, please try to update Indy, see this topic https://forums.embarcadero.com/thread.jspa?messageID=226925
    Packages *70.pkg may be suitable for Delphi7
    This is my code to receive trap, press button bbtStart to start, the IdSNMP is on form (no need to call Create). Trap will be processed continuously, real-time, no need to use a timer.
93
    
Nguyen Diep replied on 19-Aug-2010:

(snip)
I have checked and confirm with mr Remy that Indy latest version (19 Aug, 2010) has fixed the bug with TrapPort now (my Indy version is a few months old, at that time I navigated source code and saw that TrapPort took no effect, so I must use BoundPort).
    (snip)
To Pierre Dupr__s: of course you do not need to use BoundPort any more
    
    
    
38
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 01 Nov 2024 02:31:48 UTC
Copyright © 2009-2024
HREF Tools Corp.