ActiveXperts Network Component SnmpManager Object
SNMP stands for Simple Network Management Protocol. Simple Network Management Protocol is a set of standards for communication with devices connected to a TCP/IP network. It is often used to communicate with hubs and switches.
Since it was developed in 1988, the Simple Network Managment Protocol has become the de facto standard for network management. Because it is a simple solution, requiring little code to implement, vendors can easily build SNMP agents to their products. SNMP is extensible, allowing vendors to easily add network management functions to their existing products. SNMP also separates the managment architecture from the architecture of the hardware devices, which broadens the base of multivendor support. Perhaps most important, unlike other so-called standards, SNMP is not a mere paper specification, but an implementation that is widely available today.
Network Component is compliant with SNMP v1 and SNMP v2c. Network Component automatically detects which SNMP version is running on the remote agent and adapts to it.
The Network Component SNMP object supports different data types, including:
- String types (also called "octet strings");
- Integer types (16bit, 32bit and unsigned integers);
- IP Address types;
- Timetick types;
- Counter types (32bit and 64bit counters);
- OID types (also called "Object ID's");
- Other, less frequently used datatypes.
The Network Component Snmp object defines the following operations:
- Get - Allows the Network Component Snmp object to retrieve an object variable from the (remote) agent;
- GetNext - Allows the Network Component Snmp object to retrieve the next object variable from a table or list within an agent;
- Set - Allows the Network Component Snmp object to set values for object variables within an agent;
The SnmpManager object is part of the Network Component. Overview of all Network Component objects:
DnsServer & DnsRecord - Ftp & FtpFile - Http - Icmp - IPtoCountry - Msn - Ntp - Radius - Rsh - Scp - SFtp - Ssh - SnmpManager - SnmpTrapManager - SnmpMibBrowser - Tcp - Tftp - TraceRoute - Udp - Xen - Wake-on-LAN - Xen (Citrix)
SnmpManager Sample code
VBScript sample: SNMP Get
Set objManager = CreateObject("AxNetwork.SnmpManager") objManager.Initialize objManager.Open "server03", "public" If( objManager.LastError <> 0 ) Then objManager.Shutdown WScript.Quit End If Set objSnmpObject = objManager.Get( "system.sysDescr.0" ) If( objManager.lastError = 0 ) Then WScript.Echo " OID : " & objSnmpObject.OID WScript.Echo "Value : " & objSnmpObject.Value WScript.Echo "Type : " & objSnmpObject.Type End If objManager.Close() objManager.Shutdown()
Visual Basic .NET sample: SNMP Walker
Imports AxNetwork Module Module1 Sub Main() Dim objManager As SnmpManager = New SnmpManager Dim objSnmpObject As SnmpObject Dim strOID As String = "system.sysDescr.0", strNextOID As String objManager.Initialize() objManager.Open("dell03", "public") If (objManager.LastError = 0) Then objSnmpObject = objManager.Get(strOID) While (objManager.LastError = 0) Console.WriteLine(objSnmpObject.OID + " : ") Console.WriteLine(" Value:" & objSnmpObject.Value) Console.WriteLine(" Type:" & objSnmpObject.Type) objSnmpObject = objManager.GetNext() End While End If objManager.Close() objManager.Shutdown() Console.WriteLine("Ready.") End Sub End Module
You can download the full samples here.