3 ms·
I happen to run a couple of small servers myself and here's a better version of this approach. Create a cron job that will run a simple self-testing script once
by john_moscow 6y ago
I happen to run a couple of small servers myself and here's a better version of this approach. Create a cron job that will run a simple self-testing script once every few hours. My self-test does this:
1. Checks that all domains can be accessed via HTTP and HTTPS. If not, DNS might have died.
2. Checks that a few known CMS-generated pages contain some phrases they should contain. If not, SQL might have died.
3. Checks that the HTTPS certificate has enough runway left. If not, certbot might have died.
4. Sends a basic email message from my domain to a gmail account. Receives it via IMAP and sends a reply. Then, verifies the reply. This catches a whole bunch of mail-related issues.
5. Checks the free RAM and disk space. Updates an internal "dashboard" page and sends me an email if they are off.
It only took a couple of hours to hack this together and I must say, I get a much better night time sleep ever since.
- chime 6y agoThis would be an awesome apt package that I could configure with a few options and install on any server.
- john_moscow 6y agoAnd I would even love to maintain and support it if there was a culture of paid software on Linux. But because the status quo is that everything should be free and "if you publish it, it's your duty to support it", we're stuck reinventing our own wheels.