Rather than begin by describing SNMP++ and all of its features, here is a simple example that illustrates its power and simplicity. This example obtains a SNMP MIB System Descriptor object from the specified agent. Included are all code needed to create a SNMP++ session, get the system descriptor, and print it out. Retries and time-outs are managed automatically. The SNMP++ code is in bold font.
The actual SNMP++ calls are made up of ten lines of code. A CTarget object is created using the IP address of the agent. A variable binding (Vb) object is then created using the object identifier of the MIB object to retrieve (System Descriptor). The Vb object is then attached to a Pdu object. An Snmp object is used to invoke an SNMP get. Once retrieved, the response message is printed out. All error handling code is included.