Hi,
i want to compare df -k value and if any mountpoint is more than 90%, i need to print only that details.. How can i edit this from df -k output?
Thanks in advance
renjesh raju
Hi,
i want to compare df -k value and if any mountpoint is more than 90%, i need to print only that details.. How can i edit this from df -k output?
Thanks in advance
renjesh raju
df -k | awk 'NR>2{print $4,$5}'| sed 's/%//g' | while read pct fs
do
if [ $pct -gt 90 ]; then
echo "exceeding FS for $fs: now at $pct%"
fi
done
cheers,
Devaraj Takhellambam
Thank u so much for ur quick and apt reply ...
Please help me once again
$ svmon
size inuse free pin virtual
memory 962560 399702 562858 200595 312303
pg space 983040 1353
work pers clnt other
pin 165772 0 0 34823
in use 312303 0 87399
O/p of svmon is like this in this i want only first two lines. how to proceed ...?
Thanks
Renjesh Raju
use head -2. What is the actual o/p you are looking for?
svmon | head -2
Can you try this?
svmon | head -2
-Nithin
Let try this ..
# cat test
#!/bin/bash
# Simple Disk Alert Script
DISKRATIO=40 # %40
for MOUNT in `df -k | awk '{print $6}' | grep -v "^Mounted"`
do
USAGE=$( (df -k|grep -w $MOUNT|awk '{print $5}'|awk -F% '{print $1}') )
if [ $USAGE -gt $DISKRATIO ] ; then
echo "On $MOUNT -- disk is usage about -- %$USAGE ratio ..."
fi
done
./test
On / -- disk is usage about -- %47 ratio ...
On /oracle -- disk is usage about -- %43 ratio ...