CHECKING STATUS
I AM LISTENING TO
|

Keeping Tabs on Your Disk Space (Without Losing Your Mind)

25. November 2025
.SHARE

Table of Contents

You know that moment when your server suddenly decides it’s had enough and refuses to write any more data? Yeah, that’s usually when you discover your disk is at 100% and has been crying for help for weeks. Fun times.

Setting up NTFY with Docker: NTFY Self-Hosted Push Notification Service

The Problem: Disk Space Sneaks Up on You

Here’s the thing about disk space – it’s like that pile of laundry in the corner. You know it’s growing, but you keep telling yourself “I’ll deal with it later.” Except with disk space, “later” often means “when everything breaks at 2:00.”

Sure, you could SSH into your server every day and run df -h like some kind of digital janitor. Or you could set up a proper monitoring solution that costs more than your coffee budget. But who has time for that?

The Solution: A Bash Script That Actually Works

So I built this little bash script that does all the heavy lifting for you. And when I say “all,” I mean ALL:

  • Basic disk usage – The usual suspects: how much space you have, how much you’re using, and how much panic you should be in / QUICK CHECK
  • Inode tracking – Because running out of inodes is like running out of parking spaces even when the lot is half empty / PRETTY QUICK
  • I/O statistics – See exactly how much your disk is sweating under pressure / PRETTY QUICK
  • Top space hogs – Find out which directories are eating all your storage (looking at you, Docker images) / TAKES TIME
  • Smart alerts – Warning levels that actually make sense: OK → Notice → Warning → CRITICAL

The Cool Part: Notifications That Don’t Suck

Here’s where it gets fun. The script can shoot notifications straight to your phone via ntfy. No complicated setup, no enterprise monitoring platform, just a simple curl command and boom – you’re informed.

And it’s smart about it too:

  • Disk at 65%? No notification, you’re good.
  • Hit 70%? You get a friendly heads-up with a ⚡ emoji.
  • Climbing to 80%? Now you get a warning with proper urgency.
  • 90%+? DEFCON 1 – urgent priority notification with skull emojis because at this point, we’re past subtle hints.

Pick Your Sections, Skip the Noise

The best part? You don’t need to see everything every time. Just want a quick check on disk usage? Use -s basic. Need to hunt down what’s eating your space? Go with -s basic,analysis,consumers.

It’s like ordering à la carte at a restaurant, except instead of overpriced appetizers, you’re getting exactly the disk stats you need.

Command Line Magic

The Technical Bits (For us / the Nerds)

Under the hood, it’s collecting everything into a single OUTPUT variable and dumping it all at once at the end. Why? Because watching text scroll line by line is so 1990s, and also because it makes the ntfy notifications actually readable.

It uses df, lsblk, /proc/diskstats, and a bunch of other Unix utilities that have been around since dinosaurs roamed the data centers. Nothing fancy, nothing that’ll break in the next kernel update.

Configuration: Three Lines and You’re Done

At the top of the script:

Change those three lines to match your setup, and you’re golden. No YAML files, no JSON configuration, no “config.d” directories with seventeen different files. Just three variables. As it should be.

Real Talk: Why This Actually Helps

Look, we’ve all been there. You’re working on something important, deadline’s looming, and suddenly your deploy fails because there’s no disk space. Then you spend an hour hunting down what filled it up, clearing cache files, and cursing past-you for not setting up monitoring.

This script is basically future-you doing a solid for present-you. Set it up once in a cron job, point it at your ntfy instance, and forget about it until you actually need to know.

The “Oh Crap” Scenarios It Handles

  • Log files gone wild? The “consumers” section shows you exactly which directory is the culprit.
  • Mystery disk usage? The analysis section tells you if it’s space or inodes causing the problem.
  • Performance issues? Check the I/O stats to see if your disk is basically crying.
  • Multiple disks? Just change the device parameter: -d /dev/sdb1

Bonus: It’s All Open Source

The whole thing is a bash script you can read, understand, and modify in about 10 minutes. No black boxes, no “trust us it works,” no vendor lock-in. Just good old-fashioned shell scripting that does exactly what it says on the tin.

Example Output (Basic section)

Final Thoughts

Monitoring disk space shouldn’t be complicated. You shouldn’t need a PhD in systems administration to know when your server is running out of room. And you definitely shouldn’t need to pay a monthly subscription for something that bash can do in 400 lines.

So yeah, this script exists now. Use it, modify it, improve it, break it and fix it again. That’s the fun part about open source solutions – they’re yours to do with as you please.

And hey, if it saves you from one 2:00 “disk full” panic attack, it’s already paid for itself in prevented stress and saved sleep. It already helping me to stay sane!

Happy monitoring!

SETUP

THE SCRIPT


P.S. – If you’re reading this at 2:00 because your disk is full right now, my condolences. But hey, at least now you have a script for next time.

Let’s Talk!

Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.

Get in touch,
and let’s create something amazing together!

RELATED POSTS

If you’re looking for alternatives to Dozzle or just want to know what’s out there for centralizing Docker logs with a nice dashboard, you’ve come to the right place. I’ve done the research and tested these solutions, so here’s the breakdown of what actually works, ranked from easiest to most complex. Top Solutions by Setup […]

So, you’ve got containers running on your server, and they’re churning out log files like crazy? Yeah, that’s pretty much every Docker setup ever. If you don’t manage those logs, they’ll eventually eat up all your disk space, and nobody wants that surprise at 2:00. Enter blacklabelops/logrotate – a super handy Docker container that sits […]

mosparo’s rule packages are a powerful way to protect your forms from spam without relying on external services. As an open-source spam protection solution, mosparo puts you in control of your form security through customizable rule sets that analyze submitted content in real-time. One of mosparo’s standout features is its rule package system, which not […]

Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs


I have a deep passion for programming, design, and server architecture—each of these fuels my creativity, and I wouldn’t feel complete without them.

With a broad range of interests, I’m always exploring new technologies and expanding my knowledge wherever needed. The tech world evolves rapidly, and I love staying ahead by embracing the latest innovations.

Beyond technology, I value peace and surround myself with like-minded individuals.

I firmly believe in the principle: Help others, and help will find its way back to you when you need it.