What is the best way to integrate SNMP V2 alerts functionality into an existing Delphi software?
Are there any well known Delphi libraries? Is it easier to integrate SNMP libraries built in some other language?
Thanks!
Well, you can use the Indy-SNMP (delivered with Delphi) coponents. Here is a small example (console), this returns the sysDescr of the host:
program snmptest;
{$APPTYPE Console}
uses
SysUtils, IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient, IdSNMP;
var
Snmp: TIdSNMP;
Idx: Integer;
begin
Snmp := TIdSNMP.Create(nil);
try
Snmp.Query.Host := 'Hostname or IP'; //insert your host here...
Snmp.Query.Community := 'public';
Snmp.Query.PDUType := PDUGetRequest;
Snmp.Query.MIBAdd('1.3.6.1.2.1.1.1.0','');
if Snmp.SendQuery then
begin
WriteLn('Replies: ' + IntToStr(Snmp.Reply.ValueCount));
for Idx := 0 to Snmp.Reply.ValueCount - 1 do
WriteLn(Snmp.Reply.Value[0]);
end;
finally
Snmp.Free;
end;
end.
There are more examples, if you google "Delphi SNMP"..
Have a look at Synapse TCP/IP and serial library
http://synapse.ararat.cz/doku.php/download
This project is freeware and open source under modified BSD style license!
Description
SNMP client
Supports SNMPv1 include traps, SNMPv2c and SNMPv3 include authorization and privacy encryption.
Used RFC: RFC-1157, RFC-1901, RFC-3412, RFC-3414, RFC-3416, RFC-3826
Supported Authorization hashes: MD5, SHA1 Supported Privacy encryptions: DES, 3DES, AES
The library also supports many other protocols
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With