常用的运维命令(不断收集中....)
实时查看正在执行的sql语句
#/usr/sbin/tcpdump -i eth0 -s 0 -l -w - dst port 3306 |
strings | egrep -i
'SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER|CALL'
查看http连接
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key
in state) print key,"t",state[key]}'
查看SYN状态的http连接
netstat -an | grep SYN | awk '{print $5}' | awk -F:
'{print $1}' | sort | uniq -c | sort -nr | more
查看TIME_WAIT状态的http连接
netstat -tna | cut -b 49- |grep TIME_WAIT | sort |more
netstat -an | grep TIME_WAIT | awk '{print $5}' | awk
-F: '{print $1}' | sort | uniq -c | sort -nr | more
查看ESTABLISHED状态的http连接
netstat -an | grep ESTABLISHED | awk '{print $5}' |
awk -F: '{print $1}' | sort | uniq -c | sort -nr | morenetstat -an |
grep ":80" | grep ESTABLISHED | sort | more
批量kill进程
ps -efww|grep sqlr-listener|grep -v grep|cut -c
9-15|xargs kill -9
查看活动的php-cgi连接数
netstat -anpo|grep php-cgi|wc -l
阅读(839) | 评论(0) | 转发(0) |