SNMP (Simple Network Management Protocol) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behavior. It is widely used for network monitoring, infrastructure management, and IoT device supervision.
The SNMP driver needs a licence on the gateway. If the gateway does not start and its log shows
missing license, contact support@weble.ch to enable it.
The Weble universal gateway SNMP driver operates as a manager (client) that polls SNMP agents (devices) to read their OID values. It supports all three major versions of the protocol:
The driver also supports SNMP trap receiving, allowing the gateway to listen for unsolicited notifications sent by SNMP agents (e.g. link down, cold start, authentication failure).
For a complete example (MIB files, Walk, values to the BMS, history and an e-mail when the UPS switches to battery), see Monitoring a UPS or a network switch with SNMP.
Create a new gateway and select the SNMP driver. Configure the target device host and the SNMP version to use. Once the gateway is started, you can either manually insert addresses (OIDs) or use the built-in Walk function to automatically discover all available OIDs on the target device.
Insert a new gateway with the SNMP driver. The minimum required parameters are:
v1, v2c, or v3 depending on the device capabilities.public).MIB (Management Information Base) files provide human-readable names and descriptions for OIDs. When MIB files are uploaded, the driver uses them to resolve OID numbers into meaningful names in the address tree.
Once the gateway is started, open it and use the menu bar above the address table (next to Live table and Selection): SNMP Methods > MIB Files. From this dialog you can:
.mib file from your computer.MIB names are applied when addresses are imported by Walk: upload the MIB files of the device first, then run Walk. Uploading a MIB afterwards does not rename the addresses that already exist; only the labels of the tree are refreshed, the next time an address is added, changed or removed, or when the gateway restarts. MIB files are stored per gateway: upload them on each SNMP gateway that needs them. Only files with the .mib extension are accepted.
Once the gateway is started, open it and use the menu bar above the address table (next to Live table and Selection): SNMP Methods > Walk. Enter the root OID to scan (e.g. 1 for the full tree, or 1.3.6.1.2.1 for the standard MIB-II subtree). The driver will perform an SNMP walk and import the discovered OIDs as addresses.
The walk progress is displayed as a percentage. Depending on the size of the device MIB tree, this operation can take from a few seconds to several minutes.
The imported addresses hold the value read during the walk but they are not polled: their Polling field is empty. Tick the addresses you need, open Selection > Update addresses and set Polling (milliseconds, minimum 1000). Delete the addresses you do not need: a full walk of a switch or a UPS can create several thousand addresses. Running Walk again only adds the OIDs that are not present yet.
| Label | JSON Key | Description |
|---|---|---|
| Name | name | A descriptive name for this SNMP gateway instance. |
| Cluster ID | cluster | 0 (default): the gateway runs in its own process. Any other number: the gateway shares one process with the gateways that have the same number. See Gateway clusters. |
| Description | description | Optional description for this gateway. |
| Role | role | The SNMP role. Currently only manager (SNMP client/manager) is supported. |
| Host | host | IP address or hostname of the target SNMP agent (device). |
| Port | port | UDP port of the SNMP agent. Default: 161. |
| Retries | retries | Number of retry attempts when an SNMP request times out. |
| Timeout | timeout | Request timeout in milliseconds before the driver considers the request as failed. Default: 5000. |
| Version | version | SNMP protocol version: v1, v2c, or v3. This selection controls which authentication parameters are visible (see below). |
| ID bits size | idBitsSize | SNMP request ID bit size: 32 (default) or 16. Use 16 for older devices that do not support 32-bit request IDs. |
| Trap port | trapPort | UDP port of the remote host to which the driver sends its own SNMP notifications. Default: 162. This is not the port on which traps are received (see Receiver port). Leave the default value. |
Keep this gateway on Cluster ID
0: the driver restarts its process when the connection fails, which would restart every gateway of a shared cluster.
The authentication parameters depend on the selected SNMP version.
| Label | JSON Key | Description |
|---|---|---|
| Community String | communityString | The community string used for authentication. This acts as a shared password between the manager and the agent. Default: public. Common values are public (read-only) and private (read-write). |
The User block is shown when Version is v3. All its fields are always displayed; the driver only uses the ones required by the selected Level.
| Label | JSON Key | Description |
|---|---|---|
| Context | context |
SNMPv3 context name. Leave empty unless the device requires one. |
| Name | user.name |
SNMPv3 user name configured on the device. A new gateway is pre-filled with the sample name blinkybill: replace it. |
| Level | user.level |
noAuthNoPriv (no authentication, no encryption), authNoPriv (authentication only) or authPriv (authentication and encryption). |
| Auth protocol | user.authProtocol |
md5 or sha. Used with authNoPriv and authPriv. |
| Auth key | user.authKey |
Authentication passphrase. Used with authNoPriv and authPriv. |
| Priv. protocol | user.privProtocol |
des or aes. Used with authPriv only. |
| Priv. key | user.privKey |
Encryption passphrase. Used with authPriv only. |
The SNMP driver can also act as a trap receiver, listening for unsolicited notifications from SNMP agents on the network.
| Label | JSON Key | Description |
|---|---|---|
| Receiver | receiver | Enable or disable the SNMP trap receiver. |
| Receiver port | receiverPort | UDP port on which to listen for incoming traps. Default: 162. Only visible when receiver is enabled. |
| Receiver auth | receiverAuth | Leave disabled. When disabled (default), the receiver accepts notifications whatever their community. The gateway form has no field to declare the communities or SNMPv3 users allowed to send notifications, so enabling this option makes the receiver reject them. Only visible when receiver is enabled. |
Enable the receiver only when you need it, and restrict access to the Receiver port to the devices that send notifications (firewall or network segmentation).
When the receiver is enabled, incoming traps are emitted on special addresses:
%snmp_trap:receiver — receives all raw trap notifications (full PDU payload).%snmp_trap:all — receives all trap events with their type.%snmp_trap:<type> — receives traps filtered by type: LinkDown, LinkUp, ColdStart, AuthenticationFailure, EgpNeighborLoss, EnterpriseSpecific.{
"role": "manager",
"host": "192.168.1.100",
"port": 161,
"retries": 1,
"timeout": 5000,
"receiver": false,
"receiverPort": 162,
"receiverAuth": false,
"version": "v2c",
"idBitsSize": 32,
"trapPort": 162,
"communityString": "public"
}
SNMP v3 example:
{
"role": "manager",
"host": "192.168.1.100",
"port": 161,
"retries": 1,
"timeout": 5000,
"receiver": false,
"version": "v3",
"idBitsSize": 32,
"trapPort": 162,
"context": "",
"user": {
"name": "myuser",
"level": "authPriv",
"authProtocol": "sha",
"authKey": "my_auth_passphrase",
"privProtocol": "aes",
"privKey": "my_priv_passphrase"
}
}
The address name is a label: %snmp: followed by letters, digits, _, - and dots. The value that is read is always the one of the OID field.
%snmp:sysDescr — address named after the MIB object (its OID field holds 1.3.6.1.2.1.1.1.0)%snmp:1.3.6.1.2.1.1.1.0 — address named after its numeric OIDWhen OIDs are discovered via the Walk function with MIB files loaded, the addresses are automatically named using the MIB-resolved names and organized in a tree structure based on the OID hierarchy.
| Label | JSON Key | Description |
|---|---|---|
| OID | oid | The numeric Object Identifier read from the agent, in dotted notation and including the instance suffix: .0 for a scalar (e.g. 1.3.6.1.2.1.1.1.0 for sysDescr), the row index for a table column (e.g. 1.3.6.1.2.1.2.2.1.10.3). Names are not accepted in this field: a non-numeric value fails with invalid oid, and an OID without its instance returns no such object (SNMP v2c / v3) or an error (SNMP v1). |
| Polling | polling | Polling interval in milliseconds. If set, the driver will periodically read this OID at the specified interval. The minimum effective polling interval is 1000 ms. If left empty or set to 0, the address is only read once at startup. |
| Description | description | Optional description for this address. |
| Log | log | Logging mode: never (no logging), on update (log only when value changes), always (log every poll), or a duration in milliseconds for timed logging. |
Each SNMP address has the following properties:
| Property | Value |
|---|---|
| Readable | Yes |
| Writable | No (read-only). A write is refused with read only. |
| Routable | Yes |
| Loggable | Yes |
Note: The SNMP driver is currently read-only. Writing values to SNMP agents (SET operations) is not supported.
{
"oid": "1.3.6.1.2.1.1.3.0"
}
When the trap receiver is enabled (see section 2.3), trap-specific addresses are automatically created using the %snmp_trap: prefix. These addresses receive values whenever a matching trap notification arrives.
| Address | Description |
|---|---|
%snmp_trap:receiver |
Raw trap notification payload (full PDU with varbinds and sender info). |
%snmp_trap:all |
All trap events with their type as the first element. |
%snmp_trap:LinkDown |
Link down notifications. |
%snmp_trap:LinkUp |
Link up notifications. |
%snmp_trap:ColdStart |
Device cold start (reboot) notifications. |
%snmp_trap:AuthenticationFailure |
Authentication failure notifications. |
%snmp_trap:EgpNeighborLoss |
EGP neighbor loss notifications. |
%snmp_trap:EnterpriseSpecific |
Vendor-specific enterprise trap notifications. |
In addition, when a varbind of an incoming notification has an OID for which an address named %snmp:<numeric OID> exists on this gateway, that address is updated with the received value. A device can therefore push a value without waiting for the next poll.
These trap addresses are routable like any other address. They can be used in routes to forward trap data to other protocols (e.g. MQTT, BACnet) or to trigger alerts via SMTP or SMS drivers.
| Symptom | Cause and fix |
|---|---|
The gateway restarts in a loop; the log shows connection to <host> failed: ... (restarting in 5s) |
The agent does not answer or rejects the credentials. Check Host, Port (UDP 161), Version, the community string or the SNMPv3 user, and that the agent accepts requests from the IP address of the box. |
Address error invalid oid or missing oid |
The OID field must contain a numeric OID (1.3.6.1...), not a name. |
Address error no such object |
The agent has no value for this OID. Add the instance suffix (.0 for a scalar). |
The Walk window stops with timeout |
No progress was reported for 15 seconds (large tree or slow agent). The walk may go on in the background and keep adding addresses: wait, refresh the address table, and if needed start again from a narrower subtree, e.g. 1.3.6.1.2.1. |
Walk stops with invalid oid |
The root OID must be numeric. |
| Values do not change after a Walk | Imported addresses are not polled: set Polling. |
Writing returns read only |
SNMP SET is not supported. |
The log shows missing license at start |
The SNMP driver is not enabled in the licence of the gateway. Contact support@weble.ch. |