Unit SNMPSend
SNMP client
Description
Implementation of SNMP v1 protocol.
RFC: 1157
Supported features are:
- all method of SNMP protocol, except traps. For trap support is separate unit SNMPtrap.
- all possible data types (integers, strings, OIDs, IP addresses, etc...) for all methods (SET, GET, etc...).
- multiparameter queries. (i.e. you can get more values by one query)
- native code, not need any support DLLs!
- helper function for easy use GET method or SET method.
- helper function for easy retrieve SNMP tables
Small sample:
{you must create object for SNMP session}
SNMP:=TSNMPSend.Create;
try
{set address of SNMP server}
SNMP.TargetHost:=SNMPHost;
{build query...}
{set COMMUNITY for grant accessto SNMP server}
SNMP.Query.Community:=COMMUNITY;
{set type of PDU to define requested SNMP operation. Possible values are: PDUGetRequest, PDUGetNextRequest and PDUSetRequest}
SNMP.Query.PDUtype:=PDUGetRequest;
{define query OIDs...}
{add MIBOID as string to set of MIBs}
SNMP.Query.MIBAdd(FirstMIBOID,'',ASN1_NULL);
SNMP.Query.MIBAdd(SecondMIBOID,'',ASN1_NULL);
//...etc...
{send query to SNMP server}
if SNMP.DoIt then {In Reply structure is response from SNMP server}
{set Value with value of searched MIBOID}
Value:=Snmp.Reply.MIBGet(MIBOID); //...etc...
else {error connecting to server} ;
finally
{destroy SNMP object}
SNMP.Free;
end;
Classes
TSNMPMib
TSNMPRec
TSNMPSend
Procedures
SNMPGet
SNMPGetNext
SNMPGetTable
SNMPGetTableElement
SNMPSet