<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sandro 🦖☄️</title>
    <description>The latest articles on DEV Community by Sandro 🦖☄️ (@sgumz).</description>
    <link>https://dev.to/sgumz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F538857%2Ffeefe1c8-6595-4375-a30b-c69c49903d0b.jpg</url>
      <title>DEV Community: Sandro 🦖☄️</title>
      <link>https://dev.to/sgumz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sgumz"/>
    <language>en</language>
    <item>
      <title>Stop Over-Engineering: A 100-line bash script that saved my servers</title>
      <dc:creator>Sandro 🦖☄️</dc:creator>
      <pubDate>Mon, 20 Oct 2025 05:20:04 +0000</pubDate>
      <link>https://dev.to/sgumz/stop-over-engineering-a-100-line-bash-script-that-saved-my-servers-134g</link>
      <guid>https://dev.to/sgumz/stop-over-engineering-a-100-line-bash-script-that-saved-my-servers-134g</guid>
      <description>&lt;p&gt;We've all been there. Your website goes down at 3 AM. MySQL crashed. NGINX stopped responding. And you're scrambling to SSH into the server while your phone buzzes with angry customer emails.&lt;/p&gt;

&lt;p&gt;Then someone suggests: &lt;em&gt;"You should use Prometheus + Grafana + Alertmanager + PagerDuty!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Sure. Or... hear me out... you could just use a &lt;strong&gt;100-line bash script&lt;/strong&gt; that checks your sites every minute and restarts services automatically when they fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem with Enterprise Monitoring
&lt;/h2&gt;

&lt;p&gt;Don't get me wrong - tools like Datadog, New Relic, and Prometheus are amazing. But they're also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎯 &lt;strong&gt;Overkill&lt;/strong&gt; for small projects&lt;/li&gt;
&lt;li&gt;💰 &lt;strong&gt;Expensive&lt;/strong&gt; for startups&lt;/li&gt;
&lt;li&gt;🧩 &lt;strong&gt;Complex&lt;/strong&gt; to set up and maintain&lt;/li&gt;
&lt;li&gt;🐌 &lt;strong&gt;Slow&lt;/strong&gt; to deploy (days/weeks of configuration)&lt;/li&gt;
&lt;li&gt;📚 &lt;strong&gt;Require&lt;/strong&gt; learning new query languages and dashboards&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Meanwhile, your website is still down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter: The 100-Line Solution
&lt;/h2&gt;

&lt;p&gt;What if monitoring could be this simple?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Add your websites&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"https://example.com"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; sites.txt

&lt;span class="c"&gt;# 2. Install&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; ./install.sh

&lt;span class="c"&gt;# 3. Done. Seriously.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Every minute, your server now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;✅ Checks if your websites respond&lt;/li&gt;
&lt;li&gt;🔍 Detects if services are overwhelmed (not just down!)&lt;/li&gt;
&lt;li&gt;🔧 Automatically restarts MySQL, NGINX, or Apache&lt;/li&gt;
&lt;li&gt;📝 Logs only failures (no disk space waste)&lt;/li&gt;
&lt;li&gt;🔄 Tracks failure counts to avoid false positives&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How It Works (The Smart Part)
&lt;/h2&gt;

&lt;p&gt;Most monitoring tools just check if a service is "running." That's not enough.&lt;/p&gt;

&lt;p&gt;Here's what makes this script &lt;strong&gt;intelligent&lt;/strong&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Load-Based Detection
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Don't just check if MySQL is running...&lt;/span&gt;
&lt;span class="c"&gt;# Check if it's actually RESPONSIVE&lt;/span&gt;
check_mysql_health&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;# Try to ping MySQL&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;timeout &lt;/span&gt;3 mysqladmin ping&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
        &lt;span class="c"&gt;# It's alive! But is it overwhelmed?&lt;/span&gt;
        &lt;span class="nv"&gt;current_connections&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;mysqladmin status | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oP&lt;/span&gt; &lt;span class="s1"&gt;'Threads: \K\d+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$current_connections&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-gt&lt;/span&gt; 150 &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
            &lt;span class="c"&gt;# Too many connections - restart before it crashes&lt;/span&gt;
            &lt;span class="k"&gt;return &lt;/span&gt;1
        &lt;span class="k"&gt;fi
    fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your site can be down even when services show as "running" - when they're overloaded with traffic or locked up processing queries.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Advanced Health Checks
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# NGINX example: Test config + connectivity + load&lt;/span&gt;
check_nginx_health&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;# 1. Validate config before trying to use it&lt;/span&gt;
    nginx &lt;span class="nt"&gt;-t&lt;/span&gt; 2&amp;gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="k"&gt;return &lt;/span&gt;1

    &lt;span class="c"&gt;# 2. Can it accept connections?&lt;/span&gt;
    &lt;span class="nb"&gt;timeout &lt;/span&gt;2 bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"echo &amp;gt; /dev/tcp/localhost/80"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="k"&gt;return &lt;/span&gt;1

    &lt;span class="c"&gt;# 3. Is it drowning in connections?&lt;/span&gt;
    &lt;span class="nv"&gt;active_conn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; http://localhost/nginx_status | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oP&lt;/span&gt; &lt;span class="s1"&gt;'Active connections: \K\d+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$active_conn&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-gt&lt;/span&gt; 1000 &lt;span class="o"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;return &lt;/span&gt;1

    &lt;span class="k"&gt;return &lt;/span&gt;0  &lt;span class="c"&gt;# All good!&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Smart Recovery Logic
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Only restart after 3 consecutive failures (avoid false positives)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$current_failures&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-ge&lt;/span&gt; 3 &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="c"&gt;# Restart services in order: Database first, then web server&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;service &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;SERVICES&lt;/span&gt;&lt;span class="p"&gt;[@]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
        &lt;/span&gt;systemctl restart &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$service&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;done
fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-World Example
&lt;/h2&gt;

&lt;p&gt;Let's say your e-commerce site suddenly gets featured on Reddit (congrats! 🎉). Traffic spikes 10x:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traditional Monitoring:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📊 Dashboards show high CPU/memory&lt;/li&gt;
&lt;li&gt;🚨 Alerts fire&lt;/li&gt;
&lt;li&gt;👨‍💻 You get paged&lt;/li&gt;
&lt;li&gt;⏰ You wake up, investigate, manually restart services&lt;/li&gt;
&lt;li&gt;💸 Lost sales during downtime&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This Script:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔍 Detects MySQL has 200 active connections (threshold: 150)&lt;/li&gt;
&lt;li&gt;🤖 Automatically restarts MySQL in 3 seconds&lt;/li&gt;
&lt;li&gt;📝 Logs: &lt;code&gt;"MySQL OVERLOADED (200 connections) - restarted"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;😴 You stay asleep&lt;/li&gt;
&lt;li&gt;💰 Sales continue&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation (Seriously, It's This Easy)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Clone the repo&lt;/span&gt;
git clone https://github.com/YOUR_USERNAME/site-monitor.git
&lt;span class="nb"&gt;cd &lt;/span&gt;site-monitor

&lt;span class="c"&gt;# 2. Add your websites&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sites.txt &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
https://example.com
https://api.example.com
https://www.example.com
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="c"&gt;# 3. Optional: Customize thresholds&lt;/span&gt;
vim config.conf  &lt;span class="c"&gt;# Adjust MySQL/NGINX/Apache thresholds&lt;/span&gt;

&lt;span class="c"&gt;# 4. Install (creates cron job, sets up logging)&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; ./install.sh

&lt;span class="c"&gt;# 5. Watch it work&lt;/span&gt;
&lt;span class="nb"&gt;sudo tail&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /var/log/site-monitor/monitor.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[2025-10-20 14:23:45] FAILURE: https://example.com - HTTP 000 (1/3 failures)
[2025-10-20 14:24:45] FAILURE: https://example.com - HTTP 000 (2/3 failures)
[2025-10-20 14:25:45] FAILURE: https://example.com - HTTP 000 (3/3 failures)
[2025-10-20 14:25:46] RECOVERY: Starting recovery for https://example.com
[2025-10-20 14:25:47] RECOVERY: MySQL OVERLOADED (187 connections) - restarted
[2025-10-20 14:25:49] RECOVERY: NGINX responsive - no action needed
[2025-10-20 14:25:50] RECOVERY: Recovery completed
[2025-10-20 14:26:45] SUCCESS: https://example.com back online (HTTP 200)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration Options
&lt;/h2&gt;

&lt;p&gt;Everything is configurable in &lt;code&gt;config.conf&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# HTTP Settings&lt;/span&gt;
&lt;span class="nv"&gt;TIMEOUT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10                    &lt;span class="c"&gt;# Request timeout&lt;/span&gt;
&lt;span class="nv"&gt;FAILURE_THRESHOLD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3           &lt;span class="c"&gt;# Failures before recovery&lt;/span&gt;

&lt;span class="c"&gt;# Services to manage (in order)&lt;/span&gt;
&lt;span class="nv"&gt;SERVICES&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;&lt;span class="s2"&gt;"mysql"&lt;/span&gt; &lt;span class="s2"&gt;"nginx"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;    &lt;span class="c"&gt;# Or: ("mysql" "apache2")&lt;/span&gt;

&lt;span class="c"&gt;# Load Thresholds&lt;/span&gt;
&lt;span class="nv"&gt;MYSQL_MAX_CONNECTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;150     &lt;span class="c"&gt;# Restart if connections exceed this&lt;/span&gt;
&lt;span class="nv"&gt;NGINX_MAX_CONNECTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1000    &lt;span class="c"&gt;# Restart if connections exceed this&lt;/span&gt;
&lt;span class="nv"&gt;APACHE_MAX_WORKERS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;150        &lt;span class="c"&gt;# Restart if busy workers exceed this&lt;/span&gt;

&lt;span class="c"&gt;# Logging&lt;/span&gt;
&lt;span class="nv"&gt;LOG_SUCCESS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;             &lt;span class="c"&gt;# Only log failures (save disk space)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When to Use This vs. Enterprise Tools
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Use This Simple Script When:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🎯 You have &amp;lt; 50 websites to monitor&lt;/li&gt;
&lt;li&gt;💰 You're on a budget (it's free!)&lt;/li&gt;
&lt;li&gt;⚡ You need it deployed TODAY&lt;/li&gt;
&lt;li&gt;🔧 You manage your own Ubuntu servers&lt;/li&gt;
&lt;li&gt;🎓 You want to understand what's happening (no black box)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Enterprise Tools When:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📊 You need fancy dashboards and metrics&lt;/li&gt;
&lt;li&gt;🌍 You have distributed microservices&lt;/li&gt;
&lt;li&gt;👥 You have a dedicated DevOps team&lt;/li&gt;
&lt;li&gt;💼 You need compliance/audit trails&lt;/li&gt;
&lt;li&gt;🔗 You need integration with 50+ other tools&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance &amp;amp; Resource Usage
&lt;/h2&gt;

&lt;p&gt;This script is incredibly lightweight:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU&lt;/strong&gt;: Near zero (runs for ~1 second per minute)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory&lt;/strong&gt;: ~5MB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disk&lt;/strong&gt;: &amp;lt;1MB logs per month (with default settings)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network&lt;/strong&gt;: One HTTP GET per site per minute&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compare that to running Prometheus + Grafana (hundreds of MB of RAM).&lt;/p&gt;

&lt;h2&gt;
  
  
  Production-Ready Features
&lt;/h2&gt;

&lt;p&gt;Don't let the simplicity fool you - this runs in production:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;State Tracking&lt;/strong&gt;: Counts consecutive failures per site&lt;br&gt;
✅ &lt;strong&gt;Log Rotation&lt;/strong&gt;: Yearly rotation via logrotate&lt;br&gt;
✅ &lt;strong&gt;Error Handling&lt;/strong&gt;: Graceful failures, timeout protection&lt;br&gt;
✅ &lt;strong&gt;No Dependencies&lt;/strong&gt;: Just bash + curl + systemctl (already on Ubuntu)&lt;br&gt;
✅ &lt;strong&gt;Tested&lt;/strong&gt;: Works on Ubuntu 22.04 LTS&lt;/p&gt;
&lt;h2&gt;
  
  
  Advanced Use Cases
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Multi-Server Deployment
&lt;/h3&gt;

&lt;p&gt;Deploy to multiple servers with different site lists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Server 1: Monitor frontend sites&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"https://app.example.com"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sites.txt

&lt;span class="c"&gt;# Server 2: Monitor API endpoints&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"https://api.example.com"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sites.txt

&lt;span class="c"&gt;# Server 3: Monitor admin tools&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"https://admin.example.com"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sites.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Custom Services
&lt;/h3&gt;

&lt;p&gt;Not just MySQL/NGINX! Add any systemd service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add Redis, PHP-FPM, whatever you need&lt;/span&gt;
&lt;span class="nv"&gt;SERVICES&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;&lt;span class="s2"&gt;"mysql"&lt;/span&gt; &lt;span class="s2"&gt;"nginx"&lt;/span&gt; &lt;span class="s2"&gt;"redis-server"&lt;/span&gt; &lt;span class="s2"&gt;"php8.1-fpm"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Integration with Existing Tools
&lt;/h3&gt;

&lt;p&gt;Still want Slack notifications? Just add a webhook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# In monitor.sh, add after line 320:&lt;/span&gt;
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"YOUR_SLACK_WEBHOOK"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"{&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;🚨 &lt;/span&gt;&lt;span class="nv"&gt;$url&lt;/span&gt;&lt;span class="s2"&gt; is down! Auto-recovering...&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Philosophy: Simple &amp;gt; Complex
&lt;/h2&gt;

&lt;p&gt;This project follows the Unix philosophy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do one thing well&lt;/li&gt;
&lt;li&gt;Use plain text for data&lt;/li&gt;
&lt;li&gt;Build small, composable tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your monitoring doesn't need to be fancy. It needs to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Detect failures&lt;/strong&gt; ✅&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fix them automatically&lt;/strong&gt; ✅&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tell you what happened&lt;/strong&gt; ✅&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Mission accomplished in 100 lines of bash.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;The code is open source (MIT License):&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/sgumz/site-monitor" rel="noopener noreferrer"&gt;https://github.com/sgumz/site-monitor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Installation takes 2 minutes. Give it a try!&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;Sometimes the best solution isn't the one with the most features - it's the one that &lt;strong&gt;solves your problem today&lt;/strong&gt; without creating new ones.&lt;/p&gt;

&lt;p&gt;Could this bash script replace Datadog for a Fortune 500 company? No.&lt;/p&gt;

&lt;p&gt;Could it save your small SaaS business from 3 AM wake-up calls? Absolutely.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What's your take?&lt;/strong&gt; Do you prefer simple scripts or enterprise monitoring? Any horror stories about over-engineered solutions? Drop a comment below! 👇&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>devops</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
