grep out_of_memory /var/log/messages
Find load causing processes
ps aux | awk ‘{print $4″\t”$11}’ | sort | uniq -c | awk ‘{print $2″ “$1″ “$3}’ | sort -nr | head
How to install iftop
Centos 5
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install iftop
Summary of load average for all domains in WHM server
/usr/local/cpanel/bin/dcpumonview
Load average script
for ((i=0; i<=2160; i++)); do uptime; sleep 120; done
Where 120 is the time in seconds
How to install sar using yum
yum install sysstat
Ddos attack
Check which IP address is taking maximum connection using the command:
netstat -alpn | grep :80 | awk ‘{print $5}’ | cut -d: -f1 |sort |uniq -c
Check the IP address of the server having maximum connection using the command:
netstat -alpn | grep :80 | awk ‘{print $4}’ | cut -d: -f1 |sort |uniq -c
How to check load average for a day using sar
sar -q
sar -f /var/log/sa/sa … –> To view load average for previous days
Max http connection from different IP.
netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n