Upload
geona
View
49
Download
0
Embed Size (px)
DESCRIPTION
Agent & PDK. JBossNetwork Enterprise Manager. Agenda. Overview of the Agent Architecture Server Agent communications Plugin Development Kit MX4J Example. Agent overview. The JBN EM Server Controls all agents Provides the user interface for interactive monitoring - PowerPoint PPT Presentation
Citation preview
The Professional Open Source™ Company
Agent & PDK
JBossNetwork Enterprise Manager
2 The Professional Open Source™ Company
Agenda
• Overview of the Agent Architecture• Server Agent communications• Plugin Development Kit
MX4J Example
3 The Professional Open Source™ Company
• The JBN EM Server Controls all agents Provides the user interface for
interactive monitoring Tracks and stores historical
information including metrics data and control history
Provides security and access control to agent features
Agent overview
4 The Professional Open Source™ Company
Agent overview
• JBN EM Agent Acts on behalf of the server Organizes auto-inventory scans Collects metrics information according to
the server configured schedule Accumulated metrics information is
streamed to the server on a regular basis
5 The Professional Open Source™ Company
Server agent communication
JBN EM
Server
Platform AJBN EM
Agent
JBoss A
JBoss BApache
Platform BJBN EM
Agent
JBoss A
JBoss B
Apache
Platform CJBN EM
Agent
JBoss
Tomcat
Apache
plugins
ControlMetrics
6 The Professional Open Source™ Company
Plugin overview
• A JBN EM Plugin is a self-contained jar or xml file representing a platform, server or service that can be monitored
• They include metadata about the inventory hierarch of these resource types in the form of an xml descriptor
• This metadata is loaded by both the server and the agent
• Plugin hooks are available for Measurement (metrics) Control Auto Inventory Response Time
7 The Professional Open Source™ Company
Plugin descriptor
• The plugin descriptor is named “hq-plugin.xml” when deployed in a plugin jar
<plugin package="net.hyperic.hq.product.mx4j">
<property name="template-config“ value="jmxUrl=%jmxUrl%"/>
<filter name="ServerInfo“ value="hyperic:type=ServerInfo"/>
<server name="Example Server“ version="1.0"
description="Example MX4J 3.0 Based Server">
<!-- package attribute above is prepended -->
<plugin type="measurement“ class="MX4JMeasurementPlugin"/>
<plugin type="autoinventory“ class="MX4JDetector"/>
…
8 The Professional Open Source™ Company
Plugin services
• Metrics are defined against platforms, servers and services
….
<service name="Echo Service">
<plugin type="control“ class="MX4JControlPlugin"/>
<config>
<option name="service.name"
description="Service Name"
default=""/>
</config>
<actions include="start,stop"/>
<metrics include="echo-service"/>
</service>
…
9 The Professional Open Source™ Company
Plugin metrics
• Metrics are point in time recordings of numeric information from a resource
• Metrics are defined against resources in the descriptor
• The server can manage metrics templates that define the default collection interval
• The server can define custom collection intervals for a specific sevice
10 The Professional Open Source™ Company
Plugin metrics
….
<metrics name="echo-service“>
<metric name="Availability"
alias="Availability"
template="${EchoService},name=%service.name%:${alias}"
category="AVAILABILITY"
defaultOn="true"
indicator="true"
units="percentage"
collectionType="dynamic"/>
<metric name="Uptime"
alias="Uptime"
template="${EchoService},name=%service.name%:${alias}"
category="AVAILABILITY"
defaultOn="true"
indicator="false"
units="ms"
collectionType="static"/>
</metrics>
11 The Professional Open Source™ Company
Plugin metrics implementation
public class MX4JMeasurementPlugin extends MeasurementPlugin {
public MetricValue getValue(Metric metric)
throws PluginException,
MetricNotFoundException,
MetricUnreachableException
{
String jmxUrl = metric.getProperties().getProperty(PROP_JMXURL);
String objectName = metric.getObjectName();
String attribute = metric.getAttributeName();
JMXServiceURL url = new JMXServiceURL(jmxUrl);
JMXConnector connector = JMXConnectorFactory.connect(url);
MBeanServerConnection conn = connector.getMBeanServerConnection();
ObjectName objName = new ObjectName(objectName);
return conn.getAttribute(objName, attribute);
double val = Double.valueOf(obj.toString()).doubleValue();
return new MetricValue(val);
} …
12 The Professional Open Source™ Company
Example metrics defaults
13 The Professional Open Source™ Company
Plugin controls
• Below is an example of resource control provided by a plugin
• This plugin implements three control actions, start, stop and reload via <actions include="start,stop,restart"/>
• These actions can be scheduled and are historically tracked
14 The Professional Open Source™ Company
Plugin controls implementation
public void doAction(String action) throws PluginException {
String jmxUrl = this.config.getValue(MX4JUtil.PROP_JMXURL);
String name = this.config.getValue(MX4JDetector.PROP_SERVICE_NAME);
String object = "hyperic:type=EchoServer,name=" + name;
// Default to error
setResult(RESULT_FAILURE);
if (action.equals("start")) {
setState(STATE_STARTING);
MX4JUtil.invoke(jmxUrl, object, action);
setResult(RESULT_SUCCESS);
setState(STATE_STARTED);
} else if (action.equals("stop")) {
setState(STATE_STOPPING);
MX4JUtil.invoke(jmxUrl, object, action);
setResult(RESULT_SUCCESS);
setState(STATE_STOPPED);
}
}
15 The Professional Open Source™ Company
Plugin autoinventory
• The autoinventory plugin can search for known services using means appropriate to the service HTTP server management could attempt
connection to an admin URL on port 80 for example
• Autoinventory plugins can also configure file system properties to integrate with the search architecture
• Implements List discoverServices(ConfigResponse serverConfig)
16 The Professional Open Source™ Company
Review
• We’ve covered The Server/Agent architecture of JBN EM The Server management and display of
metrics collection, control operation and autoinventory
The Agent plugin architecture including• The execution of plugin implementations• The definition of resource metadata• The implementation of metrics gathering
17 The Professional Open Source™ Company
Thanks for your time!
Q & A