Exporting KPI history

Using the ExportKpiHistory script, you can export the key performance indicator (KPI) history for one or more KPIs to a tab delimited file so that the KPI history can be imported on another Monitor server or altered and re-imported onto the same Monitor server.

Purpose

The ExportKpiHistory script exports the KPI history for one or more KPIs to a tab delimited file so that the KPI history can be imported on another Monitor server or altered and re-imported onto the same Monitor server.

Location

monitor_root/scripts.wbm/kpi/exportKpiHistory.jy

Export KPI History file format

KPI History files are extracted onto the Monitor server using the Jython script described in the next section. The KPI History Export utility generates a tab delimited file in the following format. All timestamps are in GMT timezone:

Table 1.
Field Example Description
Model ID Order Item Monitor model ID
KPI_ID avgPriceToday Key performance indicator (KPI) ID
VERSION 20080918060000 Version of the monitor model
PERIOD_TIMESTAMP 2009-01-01T04:00:00 Reference timestamp for the KPI history
OBSERVED_TIME 2009-01-01T04:04:21 Actual time the KPI history was recorded
OBSERVED_VALUE 556.23 Actual value of the KPI when observed. Duration KPIs are specified in milliseconds.
TARGET 1000 Target value of the KPI
HISTORY_UPDATE_TIME 2009-01-01T04:04:21 Time the KPI history value was last updated
HISTORY_VALUE 556.23 Value used for KPI history when retrieved by REST. This value is the value that is actually presented for graphing by the KPI History REST service. Duration KPIs are specified in milliseconds.
PREDICTION_BASIS_TIME 2009-01-01T04:04:21 Time the KPI Prediction Basis value was last updated
PREDICTION_BASIS_VALUE 556.23 Value used for KPI prediction utility. This value can be updated to smooth out historical anomalies that might cause KPI predictions to be erroneous. Duration KPIs are specified in milliseconds.

Parameters

Parameter Description Comments
export_type One of: [ALL, SPECIFIED].  
KPI_list A list of kpiIds separated by commas. Applicable when export_type =SPECIFIED.
host_name The name of the host where IBM® Business Monitor is installed (this may be localhost).  
port_number The SOAP connector port of the WebSphere® Application Server server. Using the WebSphere Application Server administrative console, you can find this information by clicking Servers > Server Types > WebSphere application servers > server1 > Ports (SOAP_CONNECTOR_ADDRESS)  
Windows

Windows usage

For a stand-alone IBM Business Monitor environment:

profile_root\bin> wsadmin -wsadmin_classpath "..\..\..\plugins\com.ibm.wbimonitor.lifecycle.spi.jar;..\..\..\plugins\com.ibm.wbimonitor.repository.jar" -lang jython -f "..\..\..\scripts.wbm\kpi\exportKpiHistory.jy" export_filename.csv model_ID version_ID export_type [KPI_list] -conntype SOAP -host host_name -port port_number

For Rational® Application Developer development toolkit:

profile_root\bin> wsadmin -wsadmin_classpath "..\..\..\plugins\com.ibm.wbimonitor.lifecycle.spi.jar;..\..\..\plugins\com.ibm.wbimonitor.repository.jar" -lang jython -f "..\..\..\scripts.wbm\kpi\exportKpiHistory.jy" export_filename.csv model_ID version_ID export_type [KPI_list] -conntype SOAP -host host_name -port port_number

For Integration Designer development toolkit:

profile_root\bin> wsadmin -wsadmin_classpath "..\..\..\plugins\com.ibm.wbimonitor.lifecycle.spi.jar;..\..\..\plugins\com.ibm.wbimonitor.repository.jar" -lang jython -f "..\..\..\scripts.wbm\kpi\exportKpiHistory.jy" export_filename.csv model_ID version_ID export_type [KPI_list] -conntype SOAP -host host_name -port port_number

The following example is for a stand-alone environment:
exportKpiHistory.jy "c:\kpiHistoryExport.csv" Mymodel 2007-12-31T23:59:59 SPECIFIED "Kpi1,Kpi2,Kpi3" -conntype SOAP -host localhost -port 8880
Linux Unix

Linux and UNIX usage

For a stand-alone IBM Business Monitorenvironment:

profile_root/bin> ./wsadmin.sh -wsadmin_classpath "../../../plugins/com.ibm.wbimonitor.lifecycle.spi.jar:../../../plugins/com.ibm.wbimonitor.repository.jar" -lang jython -f "../../../scripts.wbm/kpi/exportKpiHistory.jy" export_filename.csv model_ID version_ID export_type [KPI_list] -conntype SOAP -host host_name -port port_number

The following example is for a stand-alone environment:
exportKpiHistory.jy "/kpiHistoryExport.csv" Mymodel 2007-12-31T23:59:59 SPECIFIED "Kpi1,Kpi2,Kpi3" -conntype SOAP -host localhost -port 8880