VMware Cloud Community
raybao_hyperic
Contributor
Contributor

Add metric in current servlet-plugin.xml

We newly installed Hyperic in our development enviroment, we are amazed by the functions and convience supplied by this product.
However, when I was trying to configure it to moninor our Jrun4 application server,
I have some questions.
Jrun4 has JMX build in, and I can access its metrics service and returns back the
attributes within a mertics snapshot, in the following snapshot, first column is the attribute name in jrun MertricsService, the sceond column is the value at that particular time.

JRun Service: MetricsService [jrunx.metrics.MetricsService@b7141a]
ejb.JRunSQLInvoker.active 0
ejb.JRunSQLInvoker.methodCount 0
ejb.JRunSQLInvoker.methodDuration 0
ejb.JRunSQLInvoker.passive 0
ejb.JRunSQLInvoker.pool 1
ejb.JRunSQLInvoker.timeouts 0
ejb.active 0
ejb.methodCount 0
ejb.methodDuration 0
ejb.passive 0
ejb.pool 1
ejb.timeouts 0
freeMemory 17843
jdbc.activeConnections 0
jdbc.cdm.activeConnections 0
jdbc.cdm.poolSize 1
jdbc.cdm.queryCount 0
jdbc.cdm.queryDuration 0
jdbc.cdm.timeouts 0
jdbc.cdm_lei.activeConnections 0
jdbc.cdm_lei.poolSize 1
jdbc.cdm_lei.queryCount 0
jdbc.cdm_lei.queryDuration 0
jdbc.cdm_lei.timeouts 0
jdbc.poolSize 2
jdbc.queryCount 0
jdbc.queryDuration 0
jdbc.timeouts 0
jndi.busyTh 0
jndi.bytesIn 0
jndi.bytesOut 0
jndi.delayMs 0
jndi.delayRq 0
jndi.delayTh 0
jndi.droppedRq 0
jndi.handledMs 0
jndi.handledRq 0
jndi.idleTh 0
jndi.listenTh 5
jndi.totalTh 5
jrpp.busyTh 1
jrpp.bytesIn 728
jrpp.bytesOut 0
jrpp.delayMs 0
jrpp.delayRq 0
jrpp.delayTh 0
jrpp.droppedRq 0
jrpp.handledMs 0
jrpp.handledRq 0
jrpp.idleTh 0
jrpp.listenTh 1
jrpp.totalTh 2
scheduler.busyTh 0
scheduler.delayMs 0
scheduler.delayRq 0
scheduler.delayTh 0
scheduler.droppedRq 0
scheduler.idleTh 0
scheduler.listenTh 23
scheduler.totalTh 23
sessions 4
sessionsInMem 4
totalMemory 32768
web.busyTh 0
web.bytesIn 0
web.bytesOut 0
web.delayMs 0
web.delayRq 0
web.delayTh 0
web.droppedRq 0
web.handledMs 0
web.handledRq 0
web.idleTh 0
web.listenTh 2
web.totalTh 2

My problem is the current Hyperic Jrun4 webApp monitor just defined fewer attributes than we need. I'm trying to extend it to get more attributes. Then I
found a hq-plugin.xml in servlet-plugin.jar, it seems Jrun is setup just using
the default "Web Applicaiton" metrics.

<metrics name="Web Application">
<metric name="Number of Requests Served"
alias="RequestCount"
template="hyperic-hq:type=Context,name=%context%:RequestCount"
category="THROUGHPUT"
group=""
indicator="true"
units="none"
collectionType="trendsup"/>

<metric name="Number of errors"
alias="ErrorCount"
template="hyperic-hq:type=Context,name=%context%:ErrorCount"
category="UTILIZATION"
group=""
units="none"
collectionType="trendsup"/>

<metric name="Sessions Created"
alias="SessionsCreated"
template="hyperic-hq:type=Context,name=%context%:SessionsCreated"
category="UTILIZATION"
group=""
indicator="true"
units="none"
collectionType="trendsup"/>
......

Question 1: Can I add some more metric tags for Jrun to fetch more attribute in
this hq-plugin.xml in servlet-plugin.jar, without doing any re-programming(write my own MBean?)
Question 2, I'm comparing the alias name and templates in this hq-plugin.xml with the list I got from Jrun MetricService. I'm confused how those two are linked together. How the template here are translated into Jrun's term? by configuration, or by programed logic in Hyperic. In the example, how the
"hyperic-hq:type=Context,name=%context%:RequestCount" is translated? Is there a document to describe those pre-defined variables, such as %context%,%connector%?

BTW, the Session created and Session destroyed don't work, they always show 0 in Heyperic screen while in fact, there are session creation/destory activites going on.
Reply
0 Kudos
2 Replies
admin
Immortal
Immortal

Currently the JRun plugin relies on the JRun server being instrumented with our servlet filter and webapp. We are currently looking into rewriting to plugin to not require instrumentation and instead use JMX and the metrics that JRun provides. This will probably involve breaking the JRun plugin out from the servlet-plugin.

We have some documentation on how to write a JMX plugin in our documentation:

http://support.hyperic.com/confluence/display/DOCSHQ27/JMX+Plugin

What specific version of Java and JRun are you using?

-Ryan
Reply
0 Kudos
raybao_hyperic
Contributor
Contributor

Hi, Ryan,
Thank you for your response, this is our Jrun server version:

Name: DefaultDomain:service=JRunServer
RootDirectory: C:\JRun4
ServerRootDirectory: C:\JRun4/servers/cdmint
ProductName: JRun
ProductVersion: 4.0
ProductBuildNumber: 92909

Our JDK version is 1.4.2.

Thanks.
Reply
0 Kudos