Skip to content

Instantly share code, notes, and snippets.

View tfluehmann's full-sized avatar
💭
😎

Tobias Flühmann tfluehmann

💭
😎
View GitHub Profile
@alexanderadam
alexanderadam / Ansible Disk Check
Created September 15, 2018 12:40 — forked from mahemoff/Ansible Disk Check
Show disk space and warn about disk full in Ansible
* Shows a message while asserting like:
ok: [host] => {
"msg": "disk usage 4.2B of total 20.0GB (21.0%) (should exceed limit 90.0%)"
}
* Note this only looks at first mount point on current node
* Fails if disk is near-full
* Last step pushes to a push-based monitoring service, which will alert us if it doesn't get there after some time
* Need to setup a variable `disk_limit`, which is the max acceptable usage ratio, e.g. set it to 0.8 if you want to keep disks within 80% of max size