hi all, I have made some progress where the trap was not received due to a firewall configuration (tcp config instead of udp!)
I now receive the trap, but only the HostIP information is available. As for the rest, MIBGet values are empty and MIBCount returns '0'. How do I retrieve the information that was set in MIBAdd that was called in the client, in the server side application? Regards and many thanks W On Tue, Jun 30, 2009 at 3:06 PM, Werner Hauptfleisch < [email protected]> wrote: > Hi Everyone, > > Perhaps someone can help me out here (note my SNMP knowledge currently is a > bit limited) > > I am trying to send some system specific information via SNMP traps to a > SNMP server. From the examples, I found that I can create the client sending > the traps similar to the following: > > snmpsend := TSNMPSend.Create; > snmpSend.TargetHost := '192.168.1.11'; //IP of SNMP server > snmpSend.TargetPort := '8000'; //Port of SNMP server > snmpSend.Query.Version:= 3; > snmpsend.Query.Community := 'public'; > snmpsend.Query.MIBAdd('1','TEST TRAP', ASN1_OCTSTR); > snmpsend.Query.PDUType := PDUTrap; > if snmpsend.SendTrap then > Writeln('TRAP SENT'); > > The above seems to be executing correctly and I SendTrap is returning true. > > Now for the SNMP server, I have some difficulty in receiving the trap that > was sent and think the server code might be wrong. I can also not find any > examples on how this is achieved, but gave it a go as follows: > > snmpRecv := TSNMPSend.Create > snmpRecv.TargetPort := '8000'; > repeat > if snmpRecv.RecvTrap then > begin > Writeln('Received Trap'); > Writeln('snmpRecv.HostIP); //here, I am expecting the display the IP > of the client that sent the trap > Writeln('snmpRecv.Query.MIBGet('1')); //Here, I would expect to see > the value of the trap, ie: 'TEST TRAP' > end > else > Writeln('No Trap Received yet'); > until false; > > Can anyone perhaps point me into some direction as to why this is not > working. > > Thanks in advance!! > > W >
------------------------------------------------------------------------------
_______________________________________________ synalist-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/synalist-public
