Hello Team,
I need help in preparing script to check for high cpu utilisation for java process.
I have many java process on my system which consumes high cpu so i have to monitor
it using script.
---------- Post updated 12-10-10 at 02:21 AM ---------- Previous update was 12-09-10 at 09:08 AM ----------
Hello Team,
I got the command to check high cpu usage by java process.The command and it's output is as shown below.
bash-3.00$ ps -eo pid,pcpu,args | sort +1n | grep -i java
3385 0.0 grep -i java
8804 0.0 /opt/app/ccr/home/ccr/WebSphere/AppServer/java/bin/sparcv9/java -XX:+UnlockDiag
9241 0.0 /opt/app/ccr/home/ccr/WebSphere/AppServer/java/bin/sparcv9/java -XX:+UnlockDiag
18558 0.0 /opt/app/ccr/home/ccr/WebSphere/AppServer/java/bin/java -Xms128m -Xmx512m -DPOL
26719 0.0 /usr/jdk1.6.0_18/bin/java -Djava.compiler=NONE -Djava.security.auth.login.confi
64 6.0 /opt/app/ccr/home/ccr/WebSphere/AppServer/java/bin/sparcv9/java -server -Dwas.s
bash-3.00$
I have requirement to develope script in such a way that it should check output of above command for high cpu and should send an alert saying java process with this pid is consuming high cpu resources after comparing it with thershhodl value.