Tag: scripts

  • 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.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    #!/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