Logging Tivoli Performance Viewer data using scripting

You can use the wsadmin tool to start and stop Tivoli® Performance Viewer logging in your environment.

About this task

Tivoli Performance Viewer provides an easy way to store real-time data for system resources, WebSphere® Application Server 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. You 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 the wsadmin scripting tool.
  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 you want to start logging, call the following operation:
    o	print "--- TPV Calling startLogging ---"
    o	AdminControl.invoke_jmx(perfOName, "startLogging", params, sigs )
  6. When you want 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 your 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 stand-alone application server environment, type the path to the log file. The profile_root /logs/tpv directory is the default on a Windows system.
      3. Click View Log. The log is displayed with log control buttons at the top of the view.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms of Use | Feedback

Last updatedLast updated: Sep 19, 2011 5:16:49 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-base-iseries&topic=txml_loggingtpvdata
File name: txml_loggingtpvdata.html