monitor disk usage

This commit is contained in:
Kiara Grouwstra 2023-04-10 01:21:20 +02:00
parent 52e37f1799
commit f4c966c815
Signed by: kiara
GPG Key ID: 47D3B7604FFCA83A
1 changed files with 25 additions and 0 deletions

View File

@ -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