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
- Start the wsadmin scripting tool.
- Import the UserPreferences and jarray.
o import = com.ibm.ws.tpv.engine.UserPreferences
o import = jarray
- 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(tpvName
- 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. 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(tpvOName, "monitorServer", params, sigs )
- When you want to start logging, call the following operation:
o print "--- TPV Calling startLogging ---"
o AdminControl.invoke_jmx(tpvOName, "startLogging", params, sigs )
- When you want to stop logging , call the following operation:
o print "--- TPV : Now Stop Logging ---"
o AdminControl.invoke_jmx(tpvOName, "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:
- Click in the navigation tree.
- Select a log file to view using either of the following options: