Cmrelaymon - Monitor a Chatmail relay's port availability

I am a proponent of the healthchecks.io style of monitoring - tasks ping home only when they succeed, lack of pings indicates a failure, proceed to issue alerts. I whipped up a small script to remotely monitor the chatmail relay ports based on this goal:

tl;dr - uses curl’s innate ability to speak SMTP, IMAP and HTTP (as well as TLS handshakes) to connect and send a protocol appropriate disconnect command to each service endpoint. Requires nothing but bash and curl, should run on your smartwatch. systemd and envvar friendly. shellcheck clean. Smells great, too - kinda lavender scented. Has verbose mode to debug shenanigans.

Everything is hopefully explained in the README - realistically it’s 7 lines running simple curl commands surrounded by 700 lines of logic and bashisms and systemd juju and README file.

1 Like