SylvainJuge / polarrose-jmx-rest-bridge

Automatically exported from code.google.com/p/polarrose-jmx-rest-bridge
0 stars 0 forks source link

Can't monitor composite attributes #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to fetch HeapMemoryUsage attribute...

According to 
http://www.zenoss.com/community/docs/zenoss-guide/2.1.1/ch23s02.html

2.1.5. Multi-Value Attribute Calls

If your MBean attribute defines multiple subattributes that you are interested 
in capturing you fall 
into the category of a "multi-value attribute" call. The JDK contains a few 
multi-value attributes 
you might be interested in capturing, including garbage collection statistics 
that were captured 
during the copy and mark-sweep compact collection cycles.

The JDK also provides heap memory information via a multi-value attribute. The 
amount of 
committed, used, and maximum heap memory can be viewed by setting up a 
multi-value 
attribute in Zenoss with the following information:

MBean Name: java.lang:type=Memory
Attribute Name: HeapMemoryUsage
Data Points:
committed (type: gauge)
used (type: gauge)
max (type: gauge)

So this is a composite attribute.

I tried using 
wget -q -O - 'http://polarrosehost/target/retrieveAttribute?
service=service:jmx:rmi:///jndi/rmi://jmxserver/jmxrmi&object=java.lang.Memory&a
ttribute=H
eapMemoryUsage'

But I get nothing in return and I get the following stacktrace on the server 
side:

javax.management.MalformedObjectNameException: Key properties cannot be empty
        at javax.management.ObjectName.construct(ObjectName.java:467)
        at javax.management.ObjectName.<init>(ObjectName.java:1403)
        at 
com.polarrose.jrb.controller.RetrieveAttributeController.retrieveAttribute(Retri
eveAttributeContro
ller.java:54)

Original issue reported on code.google.com by mrjclea...@gmail.com on 23 May 2009 at 10:29

GoogleCodeExporter commented 8 years ago
I also tried: wget -q -O - 'http://polarrosehost/target/retrieveAttribute?
service=service:jmx:rmi:///jndi/rmi://jmxserver/jmxrmi&object=java.lang&type=Mem
ory&attribute=HeapMemo
ryUsage' - same error.

Original comment by mrjclea...@gmail.com on 23 May 2009 at 10:32

GoogleCodeExporter commented 8 years ago
Resolved.

wget -q -O - 'http://polarrosehost/target/retrieveAttribute?
service=service:jmx:rmi:///jndi/rmi://jmxserver/jmxrmi&object=java.lang:type=Mem
ory&attribute=HeapMemor
yUsage'

Original comment by mrjclea...@gmail.com on 25 May 2009 at 3:33

GoogleCodeExporter commented 8 years ago
The output for composite objects becomes something like 
javax.management.openmbean.CompositeDataSupport(compositeType=javax.management.o
penmbean.Comp
ositeType(name=java.lang.management.MemoryUsag
e,items=((itemName=committed,itemType=javax.management.openmbean.SimpleType(name
=java.lang.Long)
),(itemName=init,itemType=javax.management.openmbean.SimpleType(name=java.lang
.Long)),(itemName=max,itemType=javax.management.openmbean.SimpleType(name=java.l
ang.Long)),(itemN
ame=used,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long))
)),contents={committed=5178195968, init=3221225472, max=5178195968, 
used=615967672}), 

Original comment by mrjclea...@gmail.com on 25 May 2009 at 4:00