Siebel System Monitoring and Diagnostics Guide >

Sample Files for Monitoring Siebel Application Servers


Using the JMX API (Java Management Extensions application program interface), you can write Java code that performs application server monitoring operations across an enterprise.

This appendix contains the following sample JMX files for your use in monitoring Siebel application server operations at the enterprise, server, and component level:

Copy and modify these sample files for your specific monitoring needs. For more information about monitoring Siebel application servers, see About Monitoring Application Server Operations Across an Enterprise and Process of Monitoring Siebel Application Server Operations Across an Enterprise.

key1.txt Sample JMX File

Use this file to create a unique key for generating an encrypted password. For example, you might use the following key:

sadmin1234567890

1srvr.xml Sample JMX File

Use this file to monitor a single application server across an enterprise. Edit the following code for your specific deployment:

<?xml version="1.0" encoding="UTF-8" ?>
- <Config>
<KeyFileName>D:\src\key1.txt</KeyFileName>
- <Enterprises>
- <Enterprise EnterpriseName="siebel" Username="SADMIN" Password="BNFJYDmXMiE=">
- <Agents>
<AgentSetting ServerName="sdchs21n625"
URL="service:jmx:rmi://sdchs21n625/jndi/rmi://sdchs21n625:1599/jmx/siebel/agent" />
</Agents>
</Enterprise>
</Enterprises>
</Config>

where:

2srvr.xml Sample JMX File

Use this file to monitor two or more application servers across an enterprise. Edit the following code for your specific deployment:

<?xml version="1.0" encoding="UTF-8" ?>
- <Config>
<KeyFileName>D:\src\key1.txt</KeyFileName>
- <Enterprises>
- <Enterprise EnterpriseName="siebel" Username="SADMIN" Password="BNFJYDmXMiE=">
- <Agents>
<AgentSetting ServerName="sdchs21n019"
URL="service:jmx:rmi://sdchs21n019/jndi/rmi://sdchs21n019:1499/jmx/siebel/agent" />
<AgentSetting ServerName="sdchs21n078"
URL="service:jmx:rmi://sdchs21n078/jndi/rmi://sdchs21n078:1599/jmx/siebel/agent" />
</Agents>
</Enterprise>
</Enterprises>
</Config>

where:

Enterprise.java Sample JMX File

Use this file to generate the Java code for monitoring enterprise operations across an enterprise, making sure the enterprise and component names are correct.

/**
*
*/
import com.siebel.management.jmxapi.*;
public class Enterprise
{
/**
* @param args
*/
public static void main(String[] args)
{
JmxEnterpriseMBean emb = new JmxEnterprise();
try
{
//+ The following 2 need to be changed by the person using this program
String ent = "siebel"; // enterprise name

//get servers//
System.out.println("Servers:");
String[] Servers = emb.getServers (ent);
for (int i = 0; i < Servers.length; i++)
{
System.out.println(" " + Servers[i]);
}

//getConnectedServers//
System.out.println("ConnectedServers:");
String[] ConnectedServers = emb.getConnectedServers (ent);
for (int i = 0; i < ConnectedServers.length; i++)
{
System.out.println(" " + ConnectedServers[i]);
}

//getDisconnectedServers//
System.out.println("DisconnectedServers:");
String[] DisconnectedServers = emb.getDisconnectedServers (ent);
for (int i = 0; i < DisconnectedServers.length; i++)
{
System.out.println(" " + DisconnectedServers[i]);
}

//get comp availability//
String arg = "ServerMgr";
Float compState = emb.getComponentAvailability (ent, arg);
System.out.println("getComponentAvailability('" + arg + "'):" + compState);

//shutdownComponent//
String arg1 = "Dbxtract";
Boolean shutdownComp = emb.shutdownComponent(ent, arg1, false);
System.out.println("shutdownComponent('" + arg1 + "'):" + shutdownComp);

//A sleep time of 2min before staring the component//
System.out.println("SleepTime:2 min");
try {
Thread.sleep( 120000 ); }
catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );}

//startComponent//
//String arg1 = "Dbxtract";
Boolean startComp = emb.startComponent(ent, arg1);
System.out.println("startComponent('" + arg1 + "'):" + startComp);

//A sleep time of 2min before staring the component//
System.out.println("SleepTime:2 min");
try {
Thread.sleep( 120000 ); }
catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );}

//getparam//
String arg2 = "Connect";
String Param = emb.getParam (ent, arg2);
System.out.println("getParam('" + arg2 + "'):" + Param);

//shutdownEnterprise//
Boolean shutdownEnt = emb.shutdownEnterprise (ent);
System.out.println("shutdownEnterprise('" + ent + "'):" + shutdownEnt);

//A sleeptime of 5 min before starting the enterprise//
System.out.println("SleepTime:5 min");
try {
Thread.sleep( 300000 ); }
catch ( InterruptedException e ) { System.out.println( "awakened prematurely" ); }

//startEnterprise//
Boolean startEnt = emb.startEnterprise (ent);
System.out.println("startEnterprise('" + ent + "'):" + startEnt);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Server.java Sample JMX File

Use this file to generate the Java code for monitoring server operations across an enterprise, making sure the enterprise and component names are correct.

/**
*
*/
import com.siebel.management.jmxapi.*;
public class Server
{
/**
* @param args
*/
public static void main(String[] args)
{
JmxServerMBean smb = new JmxServer();
try
{
//+ The following 2 need to be changed by the person using this program
String ent = "siebel"; // enterprise name
String srv = "sdchs21n016"; // server name

//getstate//
String srvState = smb.getState (ent, srv);
System.out.println("getState('" + srv + "'):" + srvState);

//shutdownserver//
Boolean shutdownSrv = smb.shutdownServer (ent, srv);
System.out.println("shutdownServer('" + srv + "'):" + shutdownSrv);

//A sleep time of 5 min before starting the siebel server//
System.out.println("SleepTime:5 min");
try {
Thread.sleep( 300000 ); }
catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );}

//startserver//
Boolean startSrv = smb.startServer (ent, srv);
System.out.println("startServer('" + srv + "'):" + startSrv);

//A sleep time of 5 min before starting the siebel server//
System.out.println("SleepTime:5 min");
try {
Thread.sleep( 300000 ); }
catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );}

//getparam//
String param = "Connect";
String paramval = smb.getParam (ent, srv, param);
System.out.println("getParam ('" + param + "'):" + paramval);

//getstat//
String stat = "NumErrors";
String statval = smb.getStat (ent, srv, stat);
System.out.println("getStat ('" + stat + "'):" + statval);

//getsval//
String sval = "SrvrTasks";
String svalval = smb.getSval (ent, srv, sval);
System.out.println("getSval ('" + sval + "'):" + svalval);

//getComps//
String[] Comps = smb.getComps (ent, srv);
System.out.println("Components:");
for (int i = 0; i < Comps.length; i++)
{
System.out.println(" " + Comps[i]);
}

//getCompstate//
String arg = "ServerMgr";
String Compval = smb.getCompState (ent, srv, arg);
System.out.println("getCompState ('" + arg + "'):" + Compval);

//shutdowncomp//
String Comp = "Dbxtract";
Boolean compstop = smb.shutdownComp (ent, srv, Comp, false);
System.out.println("shutdownComp ('" + Comp + "'):" + compstop);

//A Sleep time of 2min before starting the component//
System.out.println("Sleeptime: 2 min");
try {
Thread.sleep( 120000 ); }
catch ( InterruptedException e ) { System.out.println( "awakened prematurely" ); }

//startComp//
Boolean compstart = smb.startComp (ent, srv, Comp);
System.out.println("startComp ('" + Comp + "'):" + compstart);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Component.java Sample JMX File

Use this file to generate the Java code for monitoring component operations across an enterprise, making sure the enterprise and component names are correct.

/**
*
*/
import com.siebel.management.jmxapi.*;
public class Component
{
/**
* @param args
*/
public static void main(String[] args)
{
JmxComponentMBean cmb = new JmxComponent();
try
{
//+ The following 3 need to be changed by the person using this program
String ent = "siebel"; // enterprise name
String srv = "sdchs21n625"; // server name
String Comp = "SRBroker"; //component name

//getState//
String State = cmb.getState (ent, srv, Comp);
System.out.println("getState('" + Comp + "'):" + State);

//getAvailability//
Float Availability = cmb.getAvailability (ent, srv, Comp);
System.out.println("getAvailability ('" + Comp + "'):" + Availability);

//getNumRunningTasks//
Float RunningTasks = cmb.getNumRunningTasks (ent, srv, Comp);
System.out.println("getNumRunningTasks ('" + Comp + "'):" + RunningTasks);

//getParam//
String param = "Connect";
String paramval = cmb.getParam (ent, srv, Comp, param);
System.out.println("getParam('" + param + "','" + Comp + "'):" + paramval);

//getStat//
String stat = "SleepTime";
String statval = cmb.getStat (ent, srv, Comp, stat);
System.out.println("getStat('" + stat + "','" + Comp + "'):" + statval);

//getSval//
String sval = "CompTasks";
String svalval = cmb.getSval (ent, srv, Comp, sval);
System.out.println("getSval('" + sval + "','" + Comp + "'):" + svalval);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Siebel System Monitoring and Diagnostics Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.