UPD: fixed memory column issue on EL
This commit is contained in:
parent
2ecce40ec1
commit
6da77dc13b
@ -7,7 +7,7 @@ echo "Date CPUUsed MEMUsed IOWait" > /tmp/sar-report.txt
|
||||
for f in $(ls $SARDIR/sa[0123]*); do
|
||||
SARDate=$(stat $f | grep Modify | awk '{print $2}')
|
||||
CPUUsed=$(sar -f $f | tail -1 | awk '{print 100-$NF}')
|
||||
MEMUsed=$(sar -r -f $f | tail -1 | awk '{print $5}')
|
||||
MEMUsed=$(sar -r -f $f | tail -1 | grep -Eo '[0-9]+\.[0-9]+' | head -1)
|
||||
IOWait=$(sar -f $f | tail -1 | awk '{print $6}')
|
||||
echo "$SARDate $CPUUsed $MEMUsed $IOWait" >> /tmp/sar-report.txt
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user