Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-07

SNMP For Accessing PDUs

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Robert Wolfe

Good morning, folks!

I am in desperate need of an SNMP unit that will let me pull information from an APC PDU via SNMP for some network monitoring software I need to write. I currently use Synapse, however, and the program I have currently seems to connect to the PDU via SNMP, but it fails to retrieve any data.

Any suggestions would be greatlfully appreciated!

Reply by email

Mattias Gärtner
to Robert Wolfe

Zitat von Robert Wolfe :

Show quoted text 9 lines
Good morning, folks! I am in desperate need of an SNMP unit that will let me pull information from an APC PDU via SNMP for some network monitoring software I need to write. I currently use Synapse, however, and the program I have currently seems to connect to the PDU via SNMP, but it fails to retrieve any data. Any suggestions would be greatlfully appreciated!

This works:

procedure MiniSNMPTest;
var
  OIDSysName: String;
  aSNMPSend: TSNMPSend;
  i: Integer;
  CurMIB: TSNMPMib;
begin
  aSNMPSend := TSNMPSend.Create;
  aSNMPSend.Query.Clear;
  aSNMPSend.Query.Community := 'public';
  aSNMPSend.Query.PDUType := PDUGetRequest;
  aSNMPSend.TargetHost := '192.168.0.1';
  OIDSysName:='1.3.6.1.2.1.1.5.0'; // system.sysName.0
  aSNMPSend.Query.MIBAdd(OIDSysName, '', ASN1_NULL);
  if aSNMPSend.SendRequest then begin
    for i:=0 to aSNMPSend.Reply.MIBCount-1 do begin
      CurMIB:=aSNMPSend.Reply.MIBByIndex(i);
      if CurMIB.OID=OIDSysName then
        writeln('Decription: ',CurMIB.Value);
    end;
  end else begin
    writeln('SNMP failed');
  end;
  aSNMPSend.Free;
end;

Mattias

Reply by email