Obtaining server version information with scripting


Use wsadmin and scripting to obtain server version information.

Before starting this task, wsadmin must be running. See the Start wsadmin article for more information.

Perform the following steps to query the server version information:

 

  1. Identify the server and assign it to the server variable.

    • Jacl...

      set server [$AdminControl completeObjectName type=Server,name=server1,node=mynode,*]
      
    • Jython...

      server = AdminControl.completeObjectName('type=Server,name=server1,node=mynode,*') print server
      

    For example...

    WebSphere:cell=mycell,name=server1,mbeanIdentifier=server.xml#Server_1, type=Server,node=mynode,process=server1,processType=ManagedProcess
    

  2. Query the server version. The server version information is stored in the serverVersion attribute. The getAttribute command returns the attribute value of a single attribute, passing in the attribute name.

    To run the following commands as a non-root user, have write permission for the APP_ROOT/properties/version/ and APP_ROOT/properties/version/history directories.

    • Jacl...

      $AdminControl getAttribute $server serverVersion
      
    • Jython...

      print AdminControl.getAttribute(server, 'serverVersion')
      

    Example output for an ND installation follows:

    IBM WAS VReport
       ---------------------------------------------------------------------------
    
            Platform Information
            ------------------------------------------------------------------------
    
                    Name: IBM WAS
                    V: 5.0
    
    
            Product Information
            ------------------------------------------------------------------------
    
                    ID: BASE
                    Name: IBM WAS
                    Build Date: 9/11/02
                    Build Level: r0236.11
                    V: 5.0.0
    
    
            Product Information
            ------------------------------------------------------------------------
    
                    ID: ND
                    Name: IBM WAS for ND
                    Build Date: 9/11/02
                    Build Level: r0236.11
                    V: 5.0.0
    
       ---------------------------------------------------------------------------
       End Report
       ---------------------------------------------------------------------------
    
    
    

 

Related tasks


Use AdminControl for scripted administration
Use scripting (wsadmin)
Getting started with scripting

 

Related


Commands for AdminControl