Skip to content

Instantly share code, notes, and snippets.

@artttj
Last active October 31, 2017 07:41
Show Gist options
  • Save artttj/a1bd6b37de458287d917bcdcc44a9568 to your computer and use it in GitHub Desktop.
Save artttj/a1bd6b37de458287d917bcdcc44a9568 to your computer and use it in GitHub Desktop.
check inodes disk space and mail
#!/bin/bash
MAILTO="y@b.biz,e@b.biz,a@b.biz,t@b.com"
USAGE=90 # inode usage - value in percent
dui=$(df -hi | sed -n '4p' |awk '{print $5}' | grep -v U|cut -d% -f1)
if [ $dui -gt $USAGE ]
then
echo "Inode usage on 52.52.52.135 is exceeded - $dui%" |mailx -s "Inode usage on $(hostname)" $MAILTO
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment