Saturday, March 8, 2008

ITM 6.1 Situation Status Log in the Data Warehouse

Are you logging your situations in the data warehouse in ITM 6.1? If you select the 'History Configuration'(Ctrl+H) from the TEP you can configure the 'Situation_Status_Log'attribute group by selecting the 'CCC Logs'product.

Once you start data collection for the 'Situation_Status_Log'attribute group you should start seeing a new table in your data warehouse called 'Status_History'Now you can creates reports against your situations.
Here is a Javascript/ADO example of a report getting a count of situations in your DW database sorted by highest count.

var _dsn = "ITM Warehouse";
var _user = "itmuser";
var _pwd = "abcdeft";
var conn = WScript.CreateObject("ADODB.Connection");

sql = "SELECT COUNT(\"Situation_Name\") AS Count ,\"Situation_Name\" AS Situation, \"Managed_System\" AS System FROM ITMUSER.\"Status_History\" WHERE \"Status\" = 'Raised' OR \"Status\" = 'Y' GROUP BY \"Situation_Name\", \"Managed_System\" ORDER BY COUNT DESC ";

conn.CommandTimeout = 200;
conn.Open(_dsn, _user, _pwd);
rs=conn.Execute(sql);

for (;!rs.EOF;rs.moveNext ())
{
WScript.Echo( rs(1) + " " + rs(2) + " " + rs(0));
}

No comments: