Skip to content

Instantly share code, notes, and snippets.

View jonmarkhall's full-sized avatar

Jonathan Hall jonmarkhall

View GitHub Profile
@jonmarkhall
jonmarkhall / gist:ac6b783b1ac1e35730e4ee964f76ea83
Created July 20, 2017 21:44 — forked from djangofan/gist:3113588
Cron job script to give a disk space usage alert email
#!/bin/sh
# this script was initially written for Redhat/CentOS
# file is /etc/cron.daily/diskAlert.cron
# requires enabling outgoing sendmail from localhost to a valid
# smtp server, which is usually disabled by default
ADMIN="jausten@adomain.com,another@adomain.com"
THRESHOLD=90
df -PkH | grep -vE '^Filesystem|tmpfs|cdrom|media' | awk '{ print $5 " " $6 }' | while read output;
do