16 lines
No EOL
433 B
Bash
16 lines
No EOL
433 B
Bash
#!/bin/bash
|
|
|
|
mingigs=2
|
|
avail=$(df | awk '$6 == "/" && $4 < '$mingigs' * 1024*1024 { print $4/1024/1024 }')
|
|
topicurl=https://ntfy.domain.tld/topic
|
|
token=token
|
|
|
|
if [ -n "$avail" ]; then
|
|
curl \
|
|
-d "Only $avail GB available on the root disk. Better clean that up." \
|
|
-H "Title: Low disk space alert on $(hostname)" \
|
|
-H "Priority: high" \
|
|
-H "Tags: warning,cd" \
|
|
-H "Authorization: Bearer $token" \
|
|
$topicurl
|
|
fi |