We've recently been working on a design for arbitrary task checks [1] <https://docs.google.com/document/d/1VLdaH7i7UDT3_38aOlzTOtH7lwH-laB8dCwNzte0DkU/edit#heading=h.va2wsvg7t14p> in Mesos (currently called probes, but this will likely change). Please have a look and leave comments on the doc or start high-level discussion on this thread.
Alex. [1] https://docs.google.com/document/d/1VLdaH7i7UDT3_38aOlzTOtH7lwH-laB8dCwNzte0DkU