diff --git a/plugins/op_waf/shell/cpu_usage.sh b/plugins/op_waf/shell/cpu_usage.sh new file mode 100644 index 000000000..7ea6e3009 --- /dev/null +++ b/plugins/op_waf/shell/cpu_usage.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +DST_DIR=/www/server/op_waf +DIS_FILE=${DST_DIR}/cpu.info + +CPU_USAGE=`top -bn 1 | fgrep 'Cpu(s)' | awk '{print 100 -$8}' | awk -F . '{print $1}'` +echo $CPU_USAGE > $DIS_FILE \ No newline at end of file