9/min run get_max_mem_process.sh

if swap >= 3G or thread number >= 1800.
then colloect the information.

	modified:   install_shell/crontab
	modified:   install_shell/get_max_mem_process.sh

Signed-off-by: Qin, Bo <bqin@linx-info.com>
This commit is contained in:
Qin, Bo
2014-04-22 15:24:01 +08:00
parent e160026dbf
commit 60cec884db
2 changed files with 7 additions and 5 deletions

View File

@@ -10,6 +10,5 @@ MAILTO=""
0 20 * * * sysadmin /usr/sbin/runjobs /etc/cron/daily
0 20 * * * d5000 /usr/sbin/xrm.sh
#Every Sunday morning, 5:0
0 5 * * 7 audadmin /usr/sbin/linx-watch-top.sh&
0 * * * * sysadmin /usr/sbin/update_time.sh
*/1 * * * * sysadmin /usr/sbin/get_max_mem_process.sh
*/9 * * * * sysadmin /usr/sbin/get_max_mem_process.sh

View File

@@ -1,8 +1,11 @@
#!/bin/bash
LOAD_AVERAGE_15_MINUTES=$(uptime|awk -F ',' '{print $5}'|awk -F '.' '{print $1}')
if [ ${LOAD_AVERAGE_15_MINUTES} -ge 20 ];then
swap=$(free -g|grep "^Swap:"|awk '{print $3}')
thread_num=$( top -b -H -n 1|grep "^Tasks:"|awk '{print $2}')
# swap >= 3G or thread_num >= 1800
if [ ${swap} -ge 3 -o ${thread_num} -ge 1800 ];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
top -H -b -n 1 -d 10 >> /var/log/messages
fi