Using Simple Network Management Protocol (SNMP) in ATEasy 8.0

Knowledge Base Article # Q200199

Read Prior Article Read Next Article
Summary A guide to using SNMP in ATEASY via third-party software or the ATEasy WinSNMP driver
SNMP (Simple Network Management Protocol) is a networking protocol used to monitor and control network-attached devices such as adapters, routers, switches, workstations, and servers.  To use SNMP to communicate with a device, the device must both support SNMP and have SNMP enabled.  The primary functions that can be performed through SNMP are device identification, device property querying and device configuration.  Since SNMP can be integrated with ATEasy, a technician using ATEasy can automate the testing of SNMP-enabled devices.

In this guide, we will discuss two ways to utilize SNMP within ATEasy:
  • Using 3rd party software
  • Using the WinSNMP API with the ATEasy SNMP.drv driver

Using 3rd party software

There are a few open-source SNMP Managers available to utilize for basic testing.  This example will demonstrate using Net-SNMP.  When installed, Net-SNMP adds command-line executables such as the SNMPGET, SNMPGETNEXT, and SNMPSET functions for OID querying, SNMPWALK for device location, and SNMPSTATUS and SNMPNETSTAT for device status information.  Only a couple of these features will be used in the article for demonstration.  The complete list of features is available on the Net-SNMP webpage.

The example below demonstrates calling the executable SNMPGet to query an OID for information and saving the results to a text file.

Procedure SNMPGet(): Void
    sAgent: String
    sSaveFile: String
    sOID: String
    sCommunity: String
    sCommunity = "public"
    sAgent = "" ! Local Host
    ! Object Identifier Descriptor for the device we're talking with
    sOID = "sysDescr.0"
    sSaveFile = "snmpgetresults.txt"

    ! Calls device SNMP and saves results to text file
    WinExec("SNMPGET -v 1 -c " + sCommunity + " " + sAgent + " " + sOID + " > " \
        + sSaveFile)

    ! display results
    WinExec("notepad " + sSaveFile) ! Opens text file for viewing the SNMPGET results

In the first WinExec command an OID, sysDescr.0, is requested from the local host and saved into "snmpgetresults.txt".  The second WinExec command opens that file so the data can be viewed.

Results of SNMPGET: The string information stored at sysDescr.0 on the agent at

The SNMPGet procedure can be modified to use the other Net-SNMP features, such as SNMPNETSTAT which gives us the assignment of an agent's TCP and UDP ports.

Results of SNMPNETSTAT: The first few open TCP ports and their remote hosts.

Using the ATEasy v8.0 WinSNMP Driver

Another way to communicate with a target agent using SNMP protocol is to directly access the WinSNMP API provided with Microsoft Windows. The implementation is simplified through use of the WinSNMP ATEasy driver, which is available in ATEasy v8.0 and above. The driver also lists the procedure to install and configure the WinSNMP service required when using the Windows driver.

In the ATEasy implementation of WinSNMP, an SNMPGET call can request and retrieve the value of an Object Identifier in a single command, as shown here:

! Request the System Contact from the agent
TestResult = SNMP Function Get("")

With the ATEasy Driver included in the project, the preceding line of code acquires the System Contact octet string and assigns it back to the TestResult variable for use in ATEasy.

Similarly, the included function "SNMP Function Walk(...)" can be used to traverse a system and returns back all of the nodes between the start and stop OID specified.

!Return the data stored at all OIDs between and
TestResult = SNMP Function Walk("", "")

Example results of an SNMP Walk: = NULL: 0 = STRING: Hardware: x86 Family 15 Model 4 Stepping 7 AT/AT COMPATIBLE = TIMETICKS: 52335668 = STRING: Victor Brode = STRING: My CTS box


This demonstration of features just barely scratches the surface of the utility that SNMP provides.  A complete listing of the WinSNMP ATEasy driver is available in ATEasy v8.0 and above.  Hopefully, if your project is required to automate SNMP communication, this article has given you a good idea where to start.
Article Date 7/8/2010 9:38:38 AM     Updated: 11/22/2010 11:34:56 AM
Keywords Configuration, Remote, Network, Device, Monitor, OID, SNMP, Agent, MIB, ATEasy 8

1 ratings | 5 out of 5
View Comment
Rating: 5 out of 5 | Manish G. from Mason, OH | Thursday, July 22, 2010
As a note with NET-SNMP, you can edit the /usr/etc/snmp/snmp.conf file to allow you to add in custom mib files, and if using SNMPv3, you can define all the security/authentication parameters here, and you can add in custom mib files. This will make the net-snmp output easier to read and parse.
Read Prior Article Read Next Article