Configure Websphere from Shell Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajujrk
    New Member
    • Aug 2008
    • 107

    Configure Websphere from Shell Script

    Hi All,

    Is it possible to configure websphere application server console from shell script. Configurations like Datasource & JNDI creation, Bus, Queue, Activation Specification creation and so on..

    If its possible, what are the neccessary steps needed to write the shell script?

    Please reply..

    Thanks in Advance
    Raju
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    I'm not familiar with Websphere, however I found a simple Google search to show many promising links. Have you tried researching this on your own and run into a specific issue we can help with?

    Comment

    • rajujrk
      New Member
      • Aug 2008
      • 107

      #3
      I found the solution for this. I got it by using Shell Script integrated with JACL and finished.

      Anyhow Thanks for your response Sicarie.

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        Awesome, glad you were able to find it!

        Would you mind posting what you did so that someone else with the same question might benefit as well?

        Comment

        • rajujrk
          New Member
          • Aug 2008
          • 107

          #5
          I used wsadmin scripting tool and jacl to achieve this, i have given below the sample shell script and jacl to create the JDBC Provider in webshere Appserver

          jdbcprovider.sh

          Code:
          # Used to Fetch the KEY and VALUES from properties file
          get_prop(){ 
          	propfile=$1
          	key=$2
          	grep  "^${2}=" ${1}| sed "s%${2}=\(.*\)%\1%"
          }
          
          NODE_NAME=`get_prop AppServerConfig.properties NODE_NAME`
          CELL_NAME=`get_prop AppServerConfig.properties CELL_NAME`
          SERVER_NAME=`get_prop AppServerConfig.properties SERVER_NAME`
          
          APP_SERVER_JDBC_PROVIDER=`get_prop AppServerConfig.properties JDBC_PROVIDER`
          APP_SERVER_JDBC_IMPLCLS=`get_prop AppServerConfig.properties JDBC_IMPLCLS`
          APP_SERVER_JDBC_CLSPATH=`get_prop AppServerConfig.properties JDBC_CLASPTH`
          
          echo ""
          echo "*************************************************************************"
          echo ""
          echo "Starting JDBC provider creation"
          echo ""
          echo "*************************************************************************"
          echo ""
          
          sh /hosting/products/WebSphereD01/bin/wsadmin.sh -f JDBCProvider/wsjdbcprovider.jacl $CELL_NAME $NODE_NAME $APP_SERVER_JDBC_PROVIDER $APP_SERVER_JDBC_IMPLCLS $APP_SERVER_JDBC_CLSPATH
          And the jacl file is JDBCProvider\ws jdbcprovider.ja cl

          Code:
          if { !($argc == 5) } {
            puts "This script requires 5 parameters:"
            puts "Arg #1. NODE NAME "
            puts "Arg #2. CELL NAME "
            puts "Arg #3. JDBC Provider Name "
            puts "Arg #4. Implementation Class Name "
          }else{
          set cellNm		 [lindex $argv 0]
          set nodeNm		 [lindex $argv 1]
          set jdbcName 	 [lindex $argv 2]
          set implName 	 [lindex $argv 3]
          set clsPath		 [lindex $argv 4]
          set node [$AdminConfig  getid  /Cell:$cellNm/Node:$nodeNm/]
          
          set n1[list name $jdbcName]
          
          set implCN[list implementationClassName $implName]
          
          set clspth[list classpath $clsPath]
          
          set desc[list description $jdbcName]
          
          set  jdbcAttrs[list  $n1  $implCN $clspth $desc]
          
          puts "************************************************************"
          puts ""
          puts "Creating new JDBC provider $n1"
          puts ""
          puts "************************************************************"
          
          $AdminConfig create JDBCProvider $node $jdbcAttrs
          
          puts ""
          puts "$n1 JDBC Provider Created."
          puts ""
          puts "Saving Configuration..."
          $AdminConfig save
          puts ""
          puts "Saved."
          }
          Hope it will be useful.

          Thanks Sicarie..

          Thanks and Regards
          Rajkumar

          Comment

          Working...