OpenSolaris

You are not signed in. Sign in or register.

SMF JMX Agent

JMX in a nutshell

JMX is a standard for managing things through Java, where "managing things" means getting information about and performing operations on software objects. Managed objects are represented by MBeans ("Management Beans"), and they are accessed through MBean servers. To manage an object, an application obtains a reference to the MBean server in which the object's MBean is registered and then sends requests with the name of the MBean to get or set MBean attributes, or invoke MBean operations.

The SMF JMX Agent

The SMF JMX Agent currently lives in usr/src/java/org/opensolaris/os/smf/jmx in the vp source. When it is started, it walks the SCF repository, creates an MBean for each service (instance), and registers them in the JVM's platform MBean server (essentially the default one). It then listens for service creations or deletions, and creates new MBeans or destroys MBeans as appropriate.

SMF service MBeans are defined by the org.opensolaris.os.smf.jmx.Service class, and have names (instances of the ObjectName class) of the form "org.opensolaris.os.smf:type=service,service=<service_name>,instance=<instance_name>", where service_name is the service name component of the service's FMRI, and instance_name is the instance name component.

The service MBeans currently offer a static interface which exposes both low-level semantics (individual properties) and high-level semantics (dependencies, methods, temporary enable, etc.). Attributes include Enabled, Restarter, State, and NextState. Informational operations include getMethodNames, getPropertyValues, and getDescription, and action operations include restart, refresh, and maintain.

See load_services() in usr/src/cmd/vp/vp/Overview.java for how vp obtains the list of names of service MBeans. See usr/src/cmd/vp/vp/ServicePanel.java for examples of retrieving information from service MBeans, and invoking operations (invoke() calls).