6 ms·
If you're interested in learning about Systemd, you could service that runs in the background. Here's an an example of a Slack it I wrote... A couple years ago
by PopeDotNinja 7y ago
If you're interested in learning about Systemd, you could service that runs in the background. Here's an an example of a Slack it I wrote...
A couple years ago & at the last minute, I needed to cover for a sys admin on a new, complicated system that didn't yet have much automation or monitoring. I only got 2 hours of instruction before he needed to disappear for two weeks. We had a status page that showed the status of services, but it wasn't wired to email alerts, PagerDuty, etc.
I really didn't want to keep staring at the status page. So I wrote a simple bash script that curled the status page once per minute. Then the script grep-ed thru the html looking for a line that indicated there was a critical failure. Finally, I did a curl post request to a slack channel that said "the servers are on fire" if there was something to report, and occasionally posted a "the servers are not on fire" if everything was fine. It was a great hack that made life easier while I learned how to properly manage the system, and help with wiring up the monitoring. It was pretty quick to write, too!