Want this feature implemented, too? Please upvote by clicking Thumbs up!
(Posts as a reply won't be published in this feature request thread. Read Me!)
User story
As a PRTG user, I want features and flexibility for MQTT sensors, which could improve the reliability of the results.
Details of user story
Currently, the MQTT Custom Sensor only can handle normal, numeric results. When no results are received, the sensor turns grey. If the MQTT message to the broker was flagged with "retain", the last result is always received. Either way there is no way to detect, if the MQTT client providing results has stopped sending them. As far as I know, there are two possible ways to detect a such issue, which both usually can't be utilised by PRTG:
- LWT Message a message available on the broker, telling if the device is online or if the connection has been lost ungracefully. I understand, that this message is usually pre-defined by the MQTT device and is a string (eg. "Online" or "Offline). Because there is no MQTT Sensor, which is able to match strings (like the SNMP Custom String Sensor), this can't be used. Of course, if the LWT messages were "1" and "2" a lookup could be used.
- Age of the result a timestamp of the last result from the device could be used to determine the age of the result, by subtracting the reported time from the current time. The timestamp could for example be in the format yyyy-MM-ddTHH:mm:ss.
Currently I have to use a self-made PowerShell Script for a Custom Sensor in order to use the LWT message or a timestamp from the result. As PRTG advertises to support MQTT natively, it seems a bit unintuitive to me. Without knowing, that the results are up to date, they can't be trusted. Being able to utilise the LWT message would probably be sufficient. Though, when the MQTT Client publishing the results is disconnected gracefully, LWT doesn't trigger. I can only imagine this happening due to misconfiguration, which isn't a monitoring issue but a user error.
Acceptance criteria
- Adding a sensor that can match strings from MQTT results. Basically would match the function of the SNMP Custom String Sensor, except it's for MQTT.
Status
Open