Working with SNMP MIBs for some switches. I want to read the temperature for those switches. I've imported their MIBs and setup a custom SNMP library sensor. All this works fine. Except, the sensor only has the channels 'Downtime' and 'Response Time'. The temperature value is reported as a 'Message', whatever that means?

Screenshot: https://i.imgur.com/5KG1bP0.png

The problem with this is, I cannot setup alarms based on the message. That way I can never send alerts when the temperature gets too high. How do I work with this data?


Article Comments

Hello Michel,

Thank you for your message.

According to the information you provided, your device returns the temperature as a string and therefore the SNMP Library sensor automatically created a SNMP Custom String sensor.

In the settings of the sensor, you have the possibility to extract a number from the value, by using the option Extract a numeric value using a regular expression under Extended Processing.

Then, you have to use a regex to match the value. Here is a regex you can use for that:

[0-9]*\.?[0-9]+

Finally, the sensor should have a new channel with the temperature as value.

Regards.


Mar, 2021 - Permalink

Awesome, that worked! I thought the extract option was for current channels, I didn't realize that it would create a whole new channel. Thanks!


Mar, 2021 - Permalink

I have a different device that created a 'SNMP Custom Table' sensor instead of Custom string, even though it also reads a temperature value. With the Custom Table I don't have the 'Extended Processing' option. How do I go about that?


Apr, 2021 - Permalink

Hello Michel,

Thank you for your feedback.

Regarding the other device, there is indeed no option to process string data with the SNMP Custom Table sensor. Therefore, I can only invite you to add SNMP Custom String sensor(s) with the OID which returns the information you desire. You will find the OID(s) which correspond to the temperature by looking in the MIB file with MIB Importer.

As the sensor created is a custom table, the OID(s) (which refer to the temperature) probably belong to a table. Therefore, I invite you to execute a walk on the table OID with SNMP tester, on the corresponding device to get all temperature OIDs.

Regards.


Apr, 2021 - Permalink

Thanks again Florian. That worked perfectly!


Apr, 2021 - Permalink