Check Node Manager Script

Hi Again,

I just knocked up this nodemanager check script that you can run as a cron job making sure the Weblogic Java NodeManager is running and if not email you. See below for the script.


#!/bin/ksh
 #
 #########################################################
 # NAME:check_node_manager.sh #
 # AUTHOR: Paz #
 # DESC: Check no make sure Weblogic Node Manager is #
 # running #
 # DATE: 19/06/13 #
 # VERSION 1.0 #
 # CHANGE LOG: #
 # AP 19/06/2013 Creation #
 # #
 # #
 #########################################################
 #
 #set -x

. $HOME/.profile
 export SCRIPT_HOME='add you scripts home'
 ####################CHECK NODE MANAGER JAVA PROCESS IS RUNNING########################
 cd $SCRIPT_HOME

jps |grep -i NodeManager >Nodemgr_jps_status.log

sleep 2

nodemgr_jps_status=$(cat Nodemgr_jps_status.log |grep -i 'NodeManager' |wc -l)

if [ ${nodemgr_jps_status} -gt 0 ]
 then
 echo 'do nothing Node Manager Alive'
 else
 mailx -s 'NODEMANAGER DOWN' your@email.com
 fi

exit

EOF

The script can be changed if you use a script based nodemanager, if you change ‘jps’ for ‘ps -ef’ so the line would read:

ps -ef |grep -i NodeManager >Nodemgr_jps_status.log

Until next time

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s