8
install_shell/get_max_mem_process.sh
Executable file
8
install_shell/get_max_mem_process.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
LOAD_AVERAGE_15_MINUTES=$(uptime|awk -F ',' '{print $5}'|awk -F '.' '{print $1}')
|
||||
if [ ${LOAD_AVERAGE_15_MINUTES} -ge 20 ];then
|
||||
date>>/var/log/messages
|
||||
echo "rss(KB) pmem%M pcpu%C vsize(SWAP+RES,KB) process ">>/var/log/messages
|
||||
ps -eo rss,pmem,pcpu,vsize,args | sort -k 1 -r -n|head -10>>/var/log/messages
|
||||
top -b -n 1 -d 10 >> /var/log/messages
|
||||
fi
|
||||
Reference in New Issue
Block a user