snmp sensor platform simple displays the information which are available through the Simple Network Management Protocol (SNMP). SNMP uses a tree-like hierarchy where each node is an object.
To enable this sensor in your installation, add the following to your
# Example configuration.yaml entry sensor: - platform: snmp host: 192.168.1.32 baseoid: 18.104.22.168.4.1.2021.10.1.3.1
- host (Required): The IP address of your host, eg.
- port (Option): The SNMP port of your host. Defaults to
- name (Optional): Name of the SNMP sensor.
- community (Optional): The SNMP community which is set for the device. Most devices have a default community set to to
publicwith read-only permission (which is sufficient).
- baseoid (Required): The OID where the information is located. It’s advised to use the numerical notation.
- unit_of_measurement (Optional): Defines the unit of measurement of the sensor, if any.
The OIDs may vary on different system because they are vendor-specific. Beside the device’s manual is the OID Repository a good place to start if you are looking for OIDs. The following OIDs are for the load of a Linux systems.
- 1 minute Load: 22.214.171.124.4.1.2021.10.1.3.1
- 5 minute Load: 126.96.36.199.4.1.2021.10.1.3.2
- 15 minute Load: 188.8.131.52.4.1.2021.10.1.3.3
There is a large amount of tools available to work with SNMP.
snmpwalk let you easily retrieve the value of a OID.
$ snmpwalk -Os -c public -v 2c 192.168.1.32 184.108.40.206.4.1.2021.10.1.3.1 laLoad.1 = STRING: 0.19