Site icon EasyOraDBA

Simple Shell Script to Check Diskspace and Send Email on AIX

The below simple shell script will check all filesystems and create output file for only filesystems which are more than 80% full and send the log by email.
The below has been checked on AIX7.1 , not too Sure if it works on Solaris. I suppose the -P flag does not work on Solaris.

[code language="bash"]
#!/bin/ksh
df -P | grep -v Capacity | awk '{if ($5 >= 80) {print $5 $6;}}' > /home/root/diskspacelog
mailx -s "DiskSpace for Server Esb1" </home/root/diskspacelog sysadmin@company.com
[/code]

 

Exit mobile version