@Paul welcome to the forum.
Here are a couple of ideas:
You could use MQTT Explorer
(a stand alone app) to see if it is active
You could have a MQTT-in
node with a topic of $SYS/broker/uptime
. That should receive a message at a regular interval. (in my test I get a message every 11 seconds). By adding a 1trigger` node you use that to identify when it wasn't active.
Here is an image of my test flow and the code so you can import it (note you will have to configure the mqtt-in
node to your broker)
[{"id":"1e934ab2256fd7b2","type":"debug","z":"21c74addd196f0d8","name":"debug 3425","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":580,"wires":[]},{"id":"c52c7c483ecaa05e","type":"mqtt in","z":"21c74addd196f0d8","name":"","topic":"$SYS/broker/uptime","qos":"2","datatype":"auto-detect","broker":"ad801e2e54d5319b","nl":false,"rap":true,"rh":0,"inputs":0,"x":310,"y":580,"wires":[["9eebd21f3e4951bb","4f0ed69cad9aebc8"]]},{"id":"9eebd21f3e4951bb","type":"trigger","z":"21c74addd196f0d8","name":"","op1":"","op2":"MQTT Broker down","op1type":"nul","op2type":"str","duration":"15","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":530,"y":580,"wires":[["1e934ab2256fd7b2"]]},{"id":"4f0ed69cad9aebc8","type":"debug","z":"21c74addd196f0d8","name":"debug 3426","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":640,"wires":[]},{"id":"ad801e2e54d5319b","type":"mqtt-broker","name":"","broker":"152.67.141.188","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
One more thing, my local MQTT Broker running on a Pi Zero W Rev 1.1 has been running non stop for 47 days.