Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Configure servers with scripting


Log Tivoli Performance Viewer data using scripting

We can use wsadmin.sh to start and stop Tivoli Performance Viewer logging in the environment.

Tivoli Performance Viewer provides an easy way to store real-time data for system resources, WAS pools and queues, application-related statistics, and others in log files for later retrieval. The wsadmin tool helps you start and stop logging using the command line. We can use the command line to start and stop Tivoli Performance Viewer logging.

The following task assumes that you are using Jython script.


Procedure

  1. Start wsadmin.sh.

  2. Identify the server where you want logging to be started, and assign it to the following variable:
    o tpvName = AdminControl.completeObjectName("type=TivoliPerfEngine,*" )
    o tpvOName = AdminControl.makeObjectName(perfName
    

  3. Create a UserPreferences object.
    o pref = com.ibm.ws.tpv.engine.UserPreferences()
    o pref.setServerName("server1")
    o pref.setNodeName("mynode")
    o pref.setLogFileName("tpv_log_1")
    
  4. 4. Create the necessary arguments and invoke monitorServer action on the Tivoli Performance Viewer MBean.
    o list_p = java.util.ArrayList()
    o list_p.add(pref)
    o params=jarray.array(list_p,java.lang.Object)
    
    o list_s = java.util.ArrayList()
    o list_s.add("com.ibm.ws.tpv.engine.UserPreferences")
    o sigs = jarray.array(list_s,java.lang.String)
    
    o print "--- TPV Calling monitorServer ---"
    o AdminControl.invoke_jmx(perfOName, "monitorServer", params, sigs )
    

  5. When to start logging, call the following operation:
    o print "--- TPV Calling startLogging ---"
    o AdminControl.invoke_jmx(perfOName, "startLogging", params, sigs )
    

  6. When to stop logging , call the following operation:
    o print "--- TPV : Now Stop Logging ---"
    o AdminControl.invoke_jmx(perfOName, "stopLogging", params, sigs )
    


What to do next

By default, the log files are stored in the $PROFILE_ROOT//logs/tpv directory on the node on which the server is running. Tivoli Performance Viewer automatically compresses the log file when it finishes writing to it to conserve space. At this point, there must only be a single log file in each .zip file and it must have the same name as the .zip file. Complete the following steps to view the log files:

  1. Click Monitoring and Tuning > Performance Viewer > View Logs in the navigation tree.

  2. Select a log file to view using either of the following options:

    • Explicit path to a log File

      Choose a log file from the machine on which the browser is currently running. Use this option if you have created a log file and transferred it to the system. Click  Browse to open a file browser on the local machine and select the log file to upload.

    • Server file

      1. Specify the path of a log file on the server.

      2. In a deployment management environment, click the Browse button next to the input to browse the various nodes and find the log file to view.

      3. Click View Log. The log is displayed with log control buttons at the top of the view.


Use the wsadmin scripting AdminConfig object for scripted administration
Log performance data with Tivoli Performance Viewer
Monitor performance with Tivoli Performance Viewer


Related


Node administration scripts
Commands for the AdminConfig object using wsadmin.sh

+

Search Tips   |   Advanced Search