Skip to main content

SNMP Agent

The SNMP Agent feature lets network management systems monitor and control your device over SNMP. The agent answers GET, GETNEXT (walk) and SET requests, exposes the standard MIB-2 system group, and serves any number of custom MIB objects that your application can read and write.

The agent supports SNMPv1 and SNMPv2c with community strings. SNMPv3 with the User-based Security Model (USM) can be enabled when authenticated or encrypted access is required.

Availability

The SNMP Agent is available on Zephyr-based devices with a network interface (Ethernet, Wi-Fi or Cellular).

Configuration​

General​

  • SNMP Agent Enabled: turns the agent on. All other properties are disabled while the agent is off.
  • Port: UDP port the agent listens on. The standard port is 161.
  • Read Community: community string required for read (GET) access in SNMPv1/v2c. Defaults to public.
  • Write Community: community string required for write (SET) access in SNMPv1/v2c. Defaults to private. Leave it empty to refuse all SET requests.
  • Custom MIB Objects: the scalar objects your device exposes. See Custom MIB Objects below.

System (MIB-2)​

These values populate the standard system group that every SNMP manager queries first.

PropertyOIDDescription
sysDescr1.3.6.1.2.1.1.1Textual description of the device. Defaults to Tibbo Device.
sysObjectID1.3.6.1.2.1.1.2Vendor identification of the device. Defaults to 1.3.6.1.4.1.20738. This is also the root of all custom MIB objects.
sysContact1.3.6.1.2.1.1.4Contact person for the device.
sysName1.3.6.1.2.1.1.5Administratively assigned name of the device.
sysLocation1.3.6.1.2.1.1.6Physical location of the device.

SNMPv3​

  • SNMPv3 Enabled: enables the User-based Security Model.
  • SNMPv3 Users: the accounts allowed to access the agent over SNMPv3. Each user has:
    • User Name
    • Security Level: No Auth, No Priv, Auth, No Priv, or Auth & Priv (default).
    • Auth Protocol: MD5 or SHA (default).
    • Auth Password: authentication passphrase, at least 8 characters.
    • Privacy Protocol: DES or AES (default).
    • Privacy Password: encryption passphrase, at least 8 characters.

Enabling SNMPv3 automatically adds the MbedTLS library to the project for its cryptography.

Advanced​

  • MIB Object Table Size: total number of slots in the custom object table (default 16). Objects configured in the editor occupy the first slots. The remaining slots can be filled at runtime, for example by a custom plugin. The size is raised automatically if it is smaller than the number of configured objects.
  • Log Level: verbosity of the agent's log output, from None to Verbose.

Custom MIB Objects​

Each custom object is a scalar value with the following properties:

  • Name: the name used to select the object in blocks.
  • OID: derived automatically; it cannot be edited. See below.
  • Data Type: Integer, Octet String, Object ID, IP Address, Counter32, Gauge32, TimeTicks, Opaque, or Counter64.
  • Access: Read Only or Read / Write. Only read/write objects can be changed by an SNMP manager.
  • Value: the initial value of the object. It can be bound to a variable.

Object OIDs​

Custom objects live under the device's sysObjectID. The nth object in the list (counting from 1) is served at:

<sysObjectID>.1.<n>.0

With the default sysObjectID, the first object can be read with:

snmpget -v2c -c public 192.168.1.125 .1.3.6.1.4.1.20738.1.1.0

Because the OID follows the object's position, reordering or deleting objects changes the OIDs of the objects after it. Add new objects at the end of the list to keep existing OIDs stable.

To walk every custom object:

snmpwalk -v2c -c public 192.168.1.125 .1.3.6.1.4.1.20738

MIB File​

When at least one custom object is defined, a matching SMIv2 MIB module named TIBBO-DEVICE-MIB is generated at app/mib/TIBBO-DEVICE-MIB.txt in the project. Load it into your SNMP manager so it displays the objects by name instead of by numeric OID.

Example​

To publish a temperature reading and let a manager switch a relay:

  1. Add two objects: temperature (Integer, Read Only) and relay (Integer, Read / Write).
  2. On a timer, read the sensor and write the result with Set SNMP Object Value into temperature.
  3. Use On SNMP Object Set on relay to drive the output from the written value.

See Also​