Конфигурация агента RHQ/JON для мониторинга верблюжьего маршрута
Я написал собственный плагин для мониторинга верблюжьих маршрутов в Jboss Operational Network(JON). Но в RHQ server/JON метрики для мониторинга не добавляются.
В лог-файле RHQ-агента я вижу следующее.
2012-12-04 13:47:13,515 DEBUG [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Executing discovery for [Srikanth Custom Service] Resources...
2012-12-04 13:47:13,515 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent)- Discovering MBean resources with object name query template: org.apache.camel:type=routes,*
2012-12-04 13:47:13,531 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent)- Found [1] mbeans for query [org.apache.camel:type=routes,*].
2012-12-04 13:47:13,531 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent)- **[0] services have been added**
2012-12-04 13:47:13,531 DEBUG [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Discovery for [Srikanth Custom Service] resources completed in [16] ms
Здесь я отправляю код плагина, который развернут на JON.
RHQ-plugin.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Writing custom plugin for RHQ/JON -->
<plugin name="SampleRHQPlugin"
displayName="Sample RHQ JMX Plugin"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
xmlns:c="urn:xmlns:rhq-configuration">
<!-- Writing custom plugin for RHQ/JON -->
<depends plugin="JMX" useClasses="true"/>
<!-- Custom service metrics-->
<service name="Srikanth Custom Service"
description="Our Srikanth MBean custom service that has a code associated with it."
discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
class="org.rhq.plugins.jmx.MBeanResourceComponent">
<!-- Custom run Inside-->
<runs-inside>
<parent-resource-type name="JMX Server" plugin="JMX"/>
<parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
</runs-inside>
<!-- plugin configuration metrics-->
<plugin-configuration>
<c:simple-property name="objectName" readOnly="true" default="org.apache.camel:type=routes,*" />
<c:simple-property name="connectorAddress" default="service:jmx:rmi://localhost:44444/jndi/rmi://localhost:1099/karaf-root" required="false" type="string" description="The connection url in the form of a JMXServiceURL - this should only be set if the JVM has JMX Remoting enabled" />
<c:simple-property name="installURI" required="false" type="string" description="The installation path for the selected server type which will be used to find client libraries (if appropriate)" />
<c:simple-property name="principal" required="false" default="smx" description="The login principal/username" />
<c:simple-property name="credentials" required="false" type="password" default="smx" description="The login credentials/password" />
</plugin-configuration>
<!-- Custom metrics-->
<metric property="ExchangesCompleted"
displayName="ExchangesCompleted"
defaultOn="true"
displayType="summary"
defaultInterval="30000"
description="Number of completed exchanges"/>
<!-- END of Custom metrics -->
</service>
<!-- END of service -->
</plugin>
<!-- END of plugin-->
Как добавить эти показатели ExchangesCompleted на сервер JON для мониторинга?
Пожалуйста, помогите мне.
2 ответа
Просто чтобы убедиться, знаете ли вы, что JON предоставляет плагин для продуктов Fuse, предоставляемых Red Hat?
Я понимаю, что во время написания вашего сообщения оно еще не поддерживалось и не предоставлялось, поскольку продукты Fuse под торговой маркой JBoss еще не были выпущены.
Надеюсь, но теперь вы использовали эти плагины вместо того, чтобы заново изобретать колесо.
Приветствия.
Хотя я почти ничего не знаю о продуктах Fuse, я подозреваю, что вы просто не нашли правильное выражение для названия собственности в
<metric property="ExchangesCompleted"
тем более, что здесь вы используете шаблон имени объекта:
<c:simple-property name="objectName" readOnly="true" default="org.apache.camel:type=routes,*" />
Убедитесь, что для объектов с org.apache.camel:type=routes,*
ExchangesCompleted
действительно существует.
Возможно, начните с сужения этого, не используя шаблон имени объекта, а одно конкретное имя объекта.