monitor disk usage
This commit is contained in:
parent
52e37f1799
commit
f4c966c815
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
|
||||
cron__crontab_jobs:
|
||||
|
||||
'renew-cert':
|
||||
special_time: 'daily'
|
||||
job: '/usr/bin/certbot renew --standalone >> /var/log/le-renew.log'
|
||||
|
||||
'check-disk-space':
|
||||
special_time: 'hourly'
|
||||
job: '/usr/local/lib/check-disk-space'
|
||||
|
||||
custom_files:
|
||||
|
||||
- dest: '/usr/local/lib/check-disk-space'
|
||||
content: |
|
||||
#!/bin/bash
|
||||
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
|
||||
THRESHOLD=80
|
||||
|
||||
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
|
||||
mail -s "Disk Space $(hostname).bij1.net" log@bij1.org << EOF
|
||||
Used disk: $CURRENT%
|
||||
EOF
|
||||
fi
|
Loading…
Reference in New Issue