Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

This document provides a way to get the web intelligence server metrics using Business Intelligence platform Java SDK.

For more scripts and information on how to run these scripts refer to the blog avaiable here:

shawn.penner/blog/2013/06/04/scripts-and-samples

Below is the Java Server Pages (JSP) sample

Notes:

•You would need to change the userName, password, cmsName  to the values specific to your enterprise server in the provided sample code.

• The sample code is tested with BI 4.0 version of SAP BusinessObjects Platform

<%@ page import="java.util.*" %>
<%@ page import="com.businessobjects.sdk.plugin.desktop.common.IMetric"%>
<%@ page import="com.businessobjects.sdk.plugin.desktop.common.IMetrics"%>
<%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise"%>
<%@ page import="com.crystaldecisions.sdk.framework.IEnterpriseSession"%>
<%@ page import="com.crystaldecisions.sdk.framework.ISessionMgr"%>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObject"%>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoObjects"%>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.IInfoStore"%>
<%@ page import="com.crystaldecisions.sdk.plugin.desktop.server.*"%>
<html><head></head><body><table border="2" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<th width="30%">Server Name</th>
<th width="40%">Metric Name</th>
<th width="30%">Metric Value</th>
<%
   final String _userid = "administrator";  //use BO Enterprise User ID
   final String _password = "Password1";         //fill in password
   final String _cms = "localhost:6400";
   final String _authentication = "secEnterprise";
  
   IInfoStore boInfoStore = null;
   IInfoObjects boInfoObjects = null;
   IEnterpriseSession eSession = null;
   IServer currentServer = null;
   IServerMetrics webiAdmin = null;
try {
  ISessionMgr mySessionMgr = CrystalEnterprise.getSessionMgr();
  eSession = mySessionMgr.logon(_userid, _password, _cms,_authentication );    
  boInfoStore = (IInfoStore) eSession.getService("InfoStore");
  boInfoObjects = boInfoStore.query("Select * From CI_SYSTEMOBJECTS Where SI_PROGID='CrystalEnterprise.Server' and  SI_NAME='BIPW08R2.WebIntelligenceProcessingServer'");
  currentServer = (IServer) boInfoObjects.get(0);
 
  out.println ("<tr><td>" + currentServer.getTitle()+"</td>");
        webiAdmin = (IServerMetrics)currentServer.getMetrics();
        IMetrics serverMetrics=(IMetrics)webiAdmin.getMetrics("WebiServerAdmin");
        for(int j=0;j<serverMetrics.size();j++)
        {
        IMetric serverMetric=(IMetric)serverMetrics.get(j);
        out.println ("<td>" + serverMetric.getName()+"</td>");
        out.println ("<td>" + serverMetric.getValue()+"</td></tr>");
  out.println ("<tr><td></td>");
        }
  }
  catch (Exception e)
  {
  out.println(e);
  }
  finally
  {
  if(eSession != null)
  eSession.logoff();
  }
%>
</table>
</body>
</html>
4 Comments
Labels in this area