WAS v8.5 > Script the application serving environment (wsadmin) > Manage servers and nodes with scripting

Obtain server version information with scripting

Use wsadmin and scripting to obtain server version information.

Before starting this task, wsadmin must be running. See the topic about starting the wsadmin scripting client using wsadmin.sh 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

    Example output:

    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, you must have write permission for the app_server_root/properties/version/ and app_server_root/properties/version/history directories.

    • Jacl:

        $AdminControl getAttribute $server serverVersion
    • Jython:

        print AdminControl.getAttribute(server, 'serverVersion')


Related


Use the wsadmin scripting AdminControl object for scripted administration
Use wsadmin scripting
Get started with wsadmin scripting
Start the wsadmin scripting client using wsadmin.sh


Reference:

Commands for the AdminControl object using wsadmin.sh


+

Search Tips   |   Advanced Search