low-disk-space.sh hinzugefügt
This commit is contained in:
parent
8431fd008c
commit
9398a14b99
1 changed files with 16 additions and 0 deletions
16
low-disk-space.sh
Normal file
16
low-disk-space.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/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
|
Loading…
Add table
Add a link
Reference in a new issue