JMX is a Java standard for monitoring and managing applications written in the Java development language. JMX supports distributed monitoring and management capabilities and allows access to JMX attributes and operations via a variety of access protocols.
Firescope leverages the access capabilities made available in JMX to deliver the ability to monitor or manipulate many JMX data attributes or operations. In order to deliver these capabilities several configurations must be initiated. The following document is intended to guide the user through the necessary configurations required to enable JMX capabilities for use with the FireScope appliance.
The figure below details a simple FireScope appliance monitoring 2 host each of which houses 2 Java applications.
Java Virtual Machine (JVM) configuration
Each Java virtual machine that will be monitored must be configured to allow access to the JMX server that runs inside of each monitored Java virtual machine. Configuration is accomplished by providing a few system parameters to the Java virtual machine upon application startup. The parameters are listed below along with their description.
|
Parameter |
Value Type |
Example |
Description |
Required |
|
com.sun.management.jmxremote |
None |
|
Instruct the JVM to enable remote JMX access |
Yes |
|
com.sun.management.jmxremote.port |
Numeric |
3900 |
Server port that JMX server allows access on. |
Yes |
|
com.sun.management.jmxremote.authenticate |
Boolean |
0 |
Currently authenticated access is not supported. |
Yes |
Example:
/
JConsole is a JVM monitoring application that has been in existence since the release of Java JDK 1.5.x. With JConsole it is possible to explore all JMX managed beans in a virtual machine once the JVM is configured to allow JMX remote access as described above. The JConsole executable can be found in the bin directory for your JDK1.5.x or greater installation.
Launch JConsole and select the "Remote Process" option button. Enter "localhost:
Once started, JConsole will display several tabs. Select the "Mbeans" tab. Along the left hand side is a tree view that lists each deployed Mbean in the JMX Managed Bean Server. The treeview allows exploring down to each Mbean and displays each Mbean attribute or operation. Once you have navigated down to the bean level JConsole will display the Mbean name in the display on the right hand side.
Individual JMX attribute access
FireScope makes available a client access tool called jmxclient for querying and setting individual Mbean attributes and invoking Mbean operations. As described above, the JConsole utility can be used to determine the names and attributes of Mbeans deployed in a particular java virtual machine. The bean names, attributes names and operation names are passed to the jmxclient tool for access.
First deploy the jmxclient.jar file to an appropriate location on your monitored system. The following example uses a bean names from a system that has a default Tomcat version 6.0.13 deployed running and configured for JMX access.
The jmxclient tool uses the following command format:
|
Parameter |
Required |
Description |
|
Yes |
Path to the Java VM executable file |
|
Yes |
Host for JMX access. Typically is localhost. |
|
Yes |
Port for JMX access. |
|
Yes |
Name of the managed bean of interest obtained via JConsole. |
|
No |
Name of the manager bean attribute or operation of interest obtained via JConsole. |
|
No |
The attribute or operation parameters if any |
|
No |
The name of a sub-element in a CompositeResult. |
The following example command line will retrieve the “requestCount� attribute from the deployed tomcat manager application that comes as a part of the standard Tomcat deployment:
Note the nested / complex bean name created by Tomcat shown again as follows:
Catalina:j2eeType=Servlet,name=HTMLManager,WebModule=//localhost/manager,J2EEApplication=none,J2EEServer=none
Invoking the above command returns the current requestCount.
Now invoke the manager via a web browser as follows:
http://localhost:8080/manager/html
Example of FireScope JMX Managed Beans
The FireScope solution is delivered with an application called SyslogListener. The SyslogListener application receives syslog messages over TCP/IP and transfers these messages to the FireScope database. The SyslogListener application contains a few managed beans which expose some data points which may be of interest to FireScope users. The exposed beans are described in the following table:
|
Bean Name |
Bean Attribute / Operation |
Description |
|
com.firescope.sysloglistener:name=ReceiveMessageCount |
PerMinuteMessageCount |
Number of messages received during the last minute of operation |
|
com.firescope.sysloglistener:name=ReceiveMessageCount |
DailyMessageCount |
Cumulative number of messages received since midnight |
|
com.firescope.sysloglistener:name=PersistedMessageCount |
PerMinuteMessageCount |
Number of messages saved during the last minute of operation |
|
com.firescope.sysloglistener:name=PersistedMessageCount |
DailyMessageCount |
Cumulative number of messages saved since midnight |
|
com.firescope.sysloglistener:name=MessageExecutionTime |
DurationMilliSeconds |
Processing time in milli-seconds for the last received message |
|
com.firescope.sysloglistener:name=DatabaseRefresher |
ForceDatabaseRefresh |
Force all queries to re-issue queries for the next message |
FireScope JMX agent configuration
To configure our new user parameter we edit the agent configuration file by adding the following line:
UserParameter=java.application.monitored.value,java -Dhost=localhost -Dport=4900 -DbeanName=application.MBean -Dattribute=property -jar /jars/jmxclient.jar
FireScope JMX server configuration
JMX enabling your own Java applications
The code listed below describes the steps necessary to make your applications JMX capable. The process covered outlines only standard Mbeans. For more information regarding other typs of Mbeans such as MXBeans, or DynamicBeans refer to the following JMX API documentation or Java tutorial: http://java.sun.com/javase/6/docs/api/
http://java.sun.com/javase/6/docs/technotes/guides/jmx/tutorial/tutorialTOC.html.
For any class that you wish to make available to JMX you must write an Mbean interface that lists the available JMX methods. The Mbean interface name must have the same prefix name as the implementing class.
public interface ExecutionMessageCounterMBean { public long getPerMinuteMessageCount(); public long getDailyMessageCount(); }
Then provide an implementation for the above interface such as the following:
import java.util.Calendar;
public class ExecutionMessageCounter implements ExecutionMessageCounterMBean
{
private int lastIndex;
private long[] perMinuteMessageCount;
public ExecutionMessageCounter()
{
super();
lastIndex = 0;
perMinuteMessageCount = new long[1440];
}
public long getPerMinuteMessageCount()
{
int perMinuteMessageCountIndex = getMinuteIndexNow();
return perMinuteMessageCount[perMinuteMessageCountIndex];
}
public long getDailyMessageCount()
{
long dailyMessageCount = 0;
for(long oneMinuteCount : perMinuteMessageCount)
{ dailyMessageCount += oneMinuteCount; }
return dailyMessageCount; }
private synchronized int getMinuteIndexNow()
{
Calendar calendar = Calendar.getInstance();
int resultIndex = calendar.get(Calendar.HOUR_OF_DAY) * 60 + calendar.get(Calendar.MINUTE); return resultIndex;
}
}
ExecutioinMessageCounter counter = new ExecutionMessageCounter();
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
try { ObjectName objectName = new ObjectName(“example:name=MessageCounterâ€); mBeanServer.registerMBean(counter, objectName); }
catch(Exception exception)
{ // Add appropriate exception handling }
Learn about the various ways FirScope can collect data from your networked assets, with links to step-by-step instructions on configuring data collection.
Monitoring Your First Device or SystemThis series of guides will walk you through setting up FireScope to monitor your first device or asset.
This document describes how to aggregate log data from any standard log file, including windows event logs.
Collecting Data via SNMP TrapThis document describes how to configure your FireScope appliance to listen for SNMP trap information.
Collecting Event Data via SyslogThis article describes how to capture event data via syslog.
Connecting to a Database via Enterprise Service BusThis document describes how to connect to a database via Enterprise Service Bus to execute queries and store results as attributes.
Grouped ChecksGroup Check attributes enable users to group and perform calculations on the same attribute across multiple Configuration Items within a single Logical Group. Multiple functions are supported, including averaging the current attribute value, identifying the maximum or minimum current value, or adding the values together for a group sum. This enables users to define a single event trigger that monitors a metric across multiple Configuration Items, especially useful in web farm scenarios.
How to collect Perfmon metricsThis article describes how to collect perfmon data from your windows servers and desktops.
How to Create Actions that Send Current ValuesCannot find a way to include the current parameter's value. Only ON or OFF, its key name, and hostname.
How to Setup a DeviceThis document describes how to setup a monitored asset or device with FireScope BSM.
Policies | Creating and EditingPolicies enable complex evaluations of the condition of Service Groups, and are commonly used to measure SLA's, SLO's or compliance policies. Each Policy is associated with a single Service Group, and can be made up of any combination of Thresholds or Aggregate Thresholds associated with CI's in that Service Group. The diagram below shows the relationship of the different types of Events.
From most event information displays in the application (configuration sidebar, service management event views, dashboard pagelets), you can select to View Event Details. The details page will show relevant information for that incident.
The connection of a FireScope Host is refused while using the item type Simple Checks.
For step by step instructions on setting up Service Groups, managed Configuration Items and your service-levels, browse the FireScope Administration Guide.