ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / SNMP Protocol functions
  • Overview
  • Activation
  • Implementation
  • Connecting to the device
  • Reading information
  • Identifier, OID and MIB
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Managing the SNMP protocol
Overview
SNMP (Simple Network Management Protocol) is the standard protocol for managing the network devices. SNMP functions can be used to create applications capable of monitoring network elements: PCs, servers, switches, automation devices, etc. These functions can also be used to:
  • Monitor the network load
  • Optimize the operating mode of the network
  • Manage the potential network problems.
Note SNMP version V1 and v2 is supported.
Activation
In order for the PCs found on a network to provide information, the SNMP agent must be enabled.
In Windows, the following steps must be performed:
  1. Display the control panel.
  2. Select "Add/Remove programs".
  3. Select "Add/Remove Windows components".
  4. Add (if necessary) the "Management and monitoring tool" module.
  5. Start the Windows service manager and select "SNMP service".
  6. In the service properties (right-click), in the "Security" tab, add two communities: a "public" community with read rights and a "private" community with read/write rights.
Implementation
The SNMP functions are implemented in two steps:
  1. Connecting to the relevant device.
  2. Retrieving the requested information.

Connecting to the device

The connection is established by SNMPStartSession.
IDSession = SNMPStartSession("TestDoc", "public")
This function requires:
  • The IP address of the device.
  • The name of the SNMP community with which the dialog will be implemented.
The returned identifier is used to dialog with the device.

Reading information

The information is read in the SNMP tree structure by SNMPGet.
This function requires:
  • the session identifier,
  • the SNMP identifier of the value to retrieve ("1.3.6.1.2.1.1.1.0" for the RAM for example).
Identifier, OID and MIB
The identifier of the value to retrieve is named OID. This value can be found:
  • on Internet for the standard values.
  • in the documentation of the device. This documentation is called MIB and it groups all the specific values of your device.
Note: The SNMPLoadMIB function is used to load information from a MIB into memory, so that the OID's string identifier is used instead of its Numerical identifier.
Related Examples:
The SNMP functions Unit examples (WINDEV): The SNMP functions
[ + ] Using SNMP functions
See also
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/02/2025

Send a report | Local help