UPD: adding support for EL
This commit is contained in:
parent
c22d6c8ed7
commit
2ecce40ec1
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
SARDIR=/var/log/sysstat
|
||||
if [ -d /var/log/sa ]; then
|
||||
SARDIR=/var/log/sa
|
||||
fi
|
||||
echo "Date CPUUsed MEMUsed IOWait" > /tmp/sar-report.txt
|
||||
for f in $(ls /var/log/sysstat/sa[0123]*); do
|
||||
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}')
|
||||
|
Loading…
Reference in New Issue
Block a user