Creating service MBeans  Running the samples

Chapter 13: Using Systems Management

Creating MBean and service XML definitions

After you create a service MBean, define it in the appropriate product XML file, and add a service definition. An MBean definition must exist in one of the XML files that are read when the JMX agent starts. Initially, two service MBeans exist, EAS and Net-SNMP, which are defined in eas.xml and netsnmp.xml, respectively. To specify a new service MBean, edit the ROOT/agent.props file, and append the name of the MBean and the location of the XML file to the value of the com.sybase.management.jmx.boot.products property. By default, the property value is:

com.sybase.management.jmx.boot.products=(name=EAS,url=file:/<ROOT>/eas.xml), \
(name=NetSNMP,url=file:/<ROOT>/netsnmp.xml)

Where ROOT is your Systems Management installation directory.

If you create a service MBean called “YourProduct” and define it in the XML file ROOT/yourproduct.xml, edit the com.sybase.management.jmx.boot.products property value to look like this:

com.sybase.management.jmx.boot.products=(name=EAS,url=file:/<ROOT>/eas.xml), \
(name=NetSNMP,url=file:/<ROOT>/netsnmp.xml), \
(name=YourProduct,url=file:/<ROOT>/yourproduct.xml)

You can specify whether a service should be started automatically when the JMX agent starts, by setting the value of the startmode property in the service’s XML file—see the sample “Service builder”. The startmode property value can be one of: “automatic”, “manual”, or “disabled”.

You can invoke operations on service MBeans using the Web console—see “Using the Web console”.





Copyright © 2003. Sybase Inc. All rights reserved. Running the samples

View this book as PDF