Need help in disk monitoring script in Solaris & Linux
Hi All,
I need help I could find below script works fine on all Unix Flavours except solaris .Kindly any one help me how can i make this scripts make work on all Unix Flavour #!/bin/sh warninglimit=40000 lowlimit=15000 filesystems="/opt/apps" for fs in $filesystems do size=`df -kP $fs|grep $fs|awk '{ print $4; }'` if [ $size -le $lowlimit ] then mailx -s "URGENT: Low disk space for $fs ($size)" break fi if [ $size -le $warninglimit ] then mailx -s "WARNING: Low disk space for $fs ($size)" fi done |
Quote:
|
Error msg in Solaris .df -k seems to be working fine on solaris .How can i make my script to work on all Unix Flavours
bash-3.2$ df -kP df: unknown option: P Usage: df [-F FSType] [-abeghklntVvZ] [-o FSType-specific_options] [directory | block_device | resource] bash-3.2$ |
Quote:
On my Centos 6.5, df -kP has the following fields:
If df -k on Solaris also has the available space in the fourth field, you can just leave out the -P option. If not, you have to replace the $4 in the awk command by the correct field. |
Hi
df -k works fine on all unix distribution .Alter your script using df -k |
All times are GMT -5. The time now is 04:41 PM. |