Check for connected clients on MQTT

Hi all, I have a question
I am working on a flow to create dashboard which represents different switch status from 3 nodes (esp8266) using mqtt
I also wanted to check if the nodes are alive or not? how can this be possible?

any suggestions?

Have a search for LWT MQTT