Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Implementing health check for containerized MQTT server application?

Thinking about it a little more it gets a little more complicated, if I send the ping message via MQTT topic then I'm actually testing not only what's in my container but also the mosquito message broker and that's maybe not the right thing to do for a container health checker.  I'd also have to come up with a unique topic for each instance of my message responder and coordinate them between the responder and the health checker.

It might be worth setting up a listener on a socket so the checker and responder can just be on localhost within the container - setting up a REST API just for this sounds a bit heavy.

I guess all this is why I was asking what people's favorite pattern is for this.


On 7/23/2022 7:39 PM, Greg Troxel wrote:
It sounds like you want to know if all of the folllowing are true (if
not, alarm):
   worker program gets MQTT messages
   worker program's self-assessment is that it is ok
   worker program can send MQTT messages

so I'd make up a foo/healthcheck/ping topic, and have
nagios/zabbix/whatever post a nonce to it periodically, and expect the
worker program to post to foo/healthcheck/pong with json that has the
nonce and some assessment and stats.   Sort of faux snmp over mqtt.

Back to the top