LINUX-002 · Script
Alert on High Disk Usage
Checks space and inode usage on every local filesystem (or the ones you list) and raises an alert when a threshold is exceeded: exit code 1 for your RMM, plus optional syslog, webhook and email alerts.
Version 1.0.0Language bashUpdated November 2026Report only, changes nothing
What it does
Read-only. Nothing is deleted or changed. Network filesystems (nfs, cifs) are checked like any other unless you add their type to --exclude-types. The webhook URL is treated as a secret and is never written to the log.
Requirements
Any Linux with df (coreutils). Root recommended. curl for --webhook-url, mail or sendmail for --email. No prompts.
How to run it
- Run from: an admin workstation or scheduled task with the Microsoft modules installed and app sign-in configured
- This is an admin script for your Linux tenant, not a per-device endpoint script
- User interaction: none with app-only sign-in
- Schedule: run on demand, or weekly for reports
Settings
| Name | What it does | Options | Default |
|---|---|---|---|
| threshold | percent space used that triggers an alert; default 90 | 90 | |
| inode-threshold | default 90; percent inodes used that triggers an alert; 0 turns the inode check off | 90 | |
| mounts | comma-separated mount points to check, for example /,/var,/home; default all | ||
| exclude-types | comma-separated filesystem types to skip; leave empty for the built-in list: tmpfs, devtmpfs, squashfs, overlay, iso9660, ramfs, efivarfs | ||
| syslog | write alerts to syslog with logger; default yes | yes, no | yes |
| webhook-url | optional; posts a JSON body with a text field, for example a chat incoming webhook | ||
| optional; needs a working mail or sendmail | |||
| report-dir | CSV of every checked filesystem; default /var/lib/runbookia/reports | /var/lib/runbookia/reports |
Exit codes
- 0 = All checked filesystems are below the thresholds
- 1 = One or more filesystems are over a threshold (alert sent if configured)
- 2 = Script error
Testing steps
- Run it on one test tenant or small OU and check the output and log.
- Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
- Roll out to a small group next, then everyone.
Rollback steps
Report only. Nothing is changed, so nothing needs to be rolled back.
Version and change log
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | November 2026 | First release. |