Who is using more cpu resources on the linux server?



Here is the script that you can use :

----
This script is used to identify overloading script (http & non-http scripts)...


----
#!/bin/bash

echo
echo "Date/Time CPU% ProcessID ScriptPath"
echo =======================================================================
ps auxw | grep -v root | grep -v /mysql/ | awk '{printf "%d %d\n",$2,$3}' | \
( while read psid cpu; do

if [ $cpu -gt 2 ]; then
lsof -p $psid | grep /home | grep -v sess_ | awk '{print $9}' | \
( while read script_path; do

date +"%m/%d/%Y %H:%M:%S $cpu $psid $script_path"
date +"%m/%d/%Y %H:%M:%S,$cpu,$psid,$script_path" >> /root/sshd-script-overload.log
#mail -s "DDOS ALRT: ESTAB atk on domain.com from $ips ($num conn). Atkr blocked." root < /dev/null > /dev/null

done
)

fi
done

)
echo
----
By : cpanel.net



Related Posts:



Responses

0 Respones to "Who is using more cpu resources on the linux server?"

Post a Comment

»Thank you for reading this article
If you have questions or comments, please leave a comment
»You can click on the Subscribe by email to subscribe comments of this post
»You can register directly link pictures, mp3, video on the comment form.
»You may use some HTML tags such
»Please post comments polite and typing accented Vietnamese if possible
»Thank the good faith comment

 

Categories

Recent Comments

Total Pageviews

Return to top of page ©Web Server Tips Tricks 2010 | Develop by Mr.PhanQuan .Powered by Blogger . All rights reserved.