#!/bin/bash
ROOTPART=$(df | grep -w / | awk '{ print $5}' | sed 's/%//g')
MNTSHARE=$(df | grep -w /mnt/share | awk '{ print $5}' | sed 's/%//g')
THRESHOLD=15
if [ "$ROOTPART" -gt "$THRESHOLD" ] ; then
mail -s 'Disk Space Alert' prem.londhe@netcracker.com << EOF
The root partition is used: $ROOTPART% on $HOSTNAME
EOF
fi
if [ "$MNTSHARE" -gt "$THRESHOLD" ] ; then
mail -s 'Disk Space Alert' prem.londhe@netcracker.com << EOF
The root partition is used: $MNTSHARE% on $HOSTNAME
EOF
fi
No comments:
Post a Comment