The Origin: Protecting Production Environments As I began hosting more complex platforms on my bare-metal Linux VPS—such as the Ghina Invest portal and the Al Wave School CMS—server uptime became a critical priority. If a rogue process spiked the CPU or a database query caused a memory leak, the server would crash, taking all my client and community websites offline. I needed a way to monitor my server's hardware health in real-time without having to manually SSH into the terminal every few hours.
Technical Execution: Webhooks and Hardware Telemetry To solve this, I engineered a lightweight, automated telemetry bot using Python. I utilized the psutil library to hook directly into the Linux operating system, allowing the script to continuously poll the exact percentage of CPU utilization and virtual memory consumption.
The next challenge was delivering that data efficiently. Instead of building a complex web dashboard that I would have to proactively check, I decided to push the data directly to where I already spend my time: Discord. I integrated the Discord Webhook API into the script using the requests library. I configured the daemon to run continuously in the background of my VPS. If the server's CPU or RAM crosses an 85% threshold, the script automatically crafts a JSON payload and fires an HTTP POST request to the webhook, instantly sending a critical alert directly to my phone.
Technical Growth and Takeaways This project was an introduction to Site Reliability Engineering (SRE). It taught me that deploying code is only half of the software engineering lifecycle; actively monitoring and maintaining the infrastructure that runs that code is equally important. By leveraging APIs to automate server administration, I created a proactive maintenance system that allows me to scale my hosted projects with confidence.