Shell Script to kill all java processes on different hosts

Shell Script to kill all java processes on different hosts.

The scripts assumes auto login using shh is enabled. The steps are explained here

#!/bin/bash

####################################
# Set These Values to correspond to your environment
####################################
BLHOSTS=(linhtr1 linhtr2 linhtr3 linhtr4);

SH_CMD=ssh
####################################

SCRIPT_HOME=`dirname $0`

for host in ${BLHOSTS[@]}; do
     echo $SH_CMD $host "ps -ef | grep java|cut -b10-15|xargs kill -9"
     $SH_CMD $host "ps -ef | grep java|cut -b10-15|xargs kill -9"
done

Comments

Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Vmstat Output explained

Verifications and Error Handling in LoadRunner *Web_reg_find and Web_reg_save_param*