WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  AIX shell script calls wsadmn.sh - check return code

    Posted 06/04/14 12:34 PM
    I created jython scripts to monitor the jms queue depth.        The jython scripts are called from AIX shell script.    The jython scripts are working. 

    But sometimes there are problems with the job schedule.    One of my scripts are submitted when the WebSphere Application server is down.    If WebSphere application server is down,   the wsadmin.sh command will fail.      What is the best way to check results from wsadmin.sh command?     

      



        


  • 2.  AIX shell script calls wsadmn.sh - check return code

    Posted 06/09/14 11:02 AM

    My shell script commands to verify if WebSphere is active

      ############################################################################# # Is WebSphere Active? ############################################################################# proccnt=`ps -ef | grep wmsadmin | grep server | grep -v vi | wc -l`


    if [ $proccnt -eq 0 ]; then     
       print "\n WebSphere Server application is not active..." >> $LOG     
       ps -ef | grep wmsadmin | grep server >> $LOG
       RC=2     print "RC = $RC"          
       exit $RC    
    fi



  • 3.  AIX shell script calls wsadmn.sh - check return code

    Posted 08/06/14 09:37 PM
    Wouldn't a wc retun a success even it it retured a 0?  


    Maybe use wsadmin - something like :
    def getAppStatus(appName):
        # If appStat is blank then the app is not running.
        appStat = AdminControl.completeObjectName('type=Application,name='appName',*')
        if appStat == "":
            print your 'not active' status to logs
        else:
            run your wsadmin commands


  • 4.  AIX shell script calls wsadmn.sh - check return code

    Posted 08/21/14 08:35 AM
    Multiple options.
    1. you can check the status of the server by using "serverStatus.sh" under bin directory by passing the servername as parameter and structure your logic based on output.
    2. If you are grepping the processing then the immediate return code '$?' should tell if the process is available or not. 

    eg :

    ps -ef | grep -i server1 >> /dev/null

    status= $?

    if status value is 0 then process exists or else it doesn't. 

    3. Use the wsadmin command as mentioned in previous post