VMware Cloud Community
janylj
Contributor
Contributor

Why my simple JMX plugin doesn't work?

Hi,

I followed the wiki page and created this simple JMX plugin (as attached). And I have my standalone java app exposing at service:jmx:rmi:///jndi/rmi://localhost:1234/jmxrmi. JConsole connects through this url just fine.

However,
$ java -Dplugins.include=test2 -jar pdk/lib/hq-product.jar -m discover -a metric
0 servers detected

I have spent the whole day changing small changes to the plugin.xml. But it doesn't work. Any help is very much appreciated.

I am using Hyperic 4.1.2.
0 Kudos
6 Replies
mcmesser
Hot Shot
Hot Shot

Try this command line test:

$ java -Dplugins.include=test2 -jar pdk/lib/hq-product.jar -t "CustomJMX" \
-m discover -a metric -Dlog=DEBUG

Results?
0 Kudos
joshdevins
Contributor
Contributor

Same problem with an even simpler plugin (attached). Debug log shows pretty much nothing. I've also banged my head against my desk all day trying every combination possible...

java -Djmx.url=service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi -Dplugins.include=test-jvm -jar hq-product.jar -m metric -Dlog=debug

INFO [main] [ProductPluginManager] agent.pdkDir=/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk
INFO [main] [ProductPluginManager] agent.pdkPluginDir=/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/plugins
INFO [main] [ProductPluginManager] agent.pdkWorkDir=/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/work
DEBUG [main] [ProductPluginManager] Initializing in client mode (pdk=/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk)
DEBUG [main] [MIBTree] No MIBs in directory: /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/mibs
INFO [main] [ProductPluginManager] Loading plugin: system-plugin.jar
DEBUG [main] [PluginData] etc/plugin.properties => null
DEBUG [main] [PluginData] etc/hq-plugin.xml => jar:file:/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/plugins/system-plugin.jar!/etc/hq-plugin.xml
DEBUG [main] [SystemPlugin] sigar.mirror.procnet=null
INFO [main] [ProductPluginManager] Loading plugin: netservices-plugin.jar
DEBUG [main] [PluginData] etc/plugin.properties => null
DEBUG [main] [PluginData] etc/hq-plugin.xml => jar:file:/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/plugins/netservices-plugin.jar!/etc/hq-plugin.xml
INFO [main] [MeasurementPlugin] Register TCP Socket proxy for domain: socket
INFO [main] [MeasurementPlugin] Register HTTP proxy for domain: http
INFO [main] [MeasurementPlugin] Register HTTP proxy for domain: url.availability
INFO [main] [MeasurementPlugin] Register FTP proxy for domain: ftp
INFO [main] [ProductPluginManager] Loading plugin: sqlquery-plugin.jar
DEBUG [main] [PluginData] etc/plugin.properties => jar:file:/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/plugins/sqlquery-plugin.jar!/etc/plugin.properties
DEBUG [main] [PluginData] etc/hq-plugin.xml => jar:file:/home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/plugins/sqlquery-plugin.jar!/etc/hq-plugin.xml
DEBUG [main] [PluginLoader] sqlquery-plugin.jar expanding /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc...
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/postgresql-7.4.3.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/oracle12.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/msutil.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/db2jcc_license_cu.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/mysql-connector-java-5.0.5-bin.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/msbase.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/ifxjdbc.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/mssqlserver.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/db2jcc.jar
DEBUG [main] [PluginLoader] sqlquery-plugin.jar += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/jdbc/jconn3.jar
INFO [main] [SQLQueryMeasurementPlugin] Registered proxy for domain: sql
INFO [main] [ProductPluginManager] Loading plugin: test-jvm-plugin.xml
DEBUG [main] [PluginLoader] test-jvm-plugin.xml expanding /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/mx4j...
DEBUG [main] [PluginLoader] test-jvm-plugin.xml += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/mx4j/mx4j-rjmx.jar
DEBUG [main] [PluginLoader] test-jvm-plugin.xml += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/mx4j/hq-jmx.jar
DEBUG [main] [PluginLoader] test-jvm-plugin.xml += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/mx4j/mx4j-tools.jar
DEBUG [main] [PluginLoader] test-jvm-plugin.xml += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/mx4j/mx4j-jmx.jar
DEBUG [main] [PluginLoader] test-jvm-plugin.xml += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/mx4j/mx4j.jar
DEBUG [main] [PluginLoader] test-jvm-plugin.xml += /home/hyperic/hyperic-hq-agent-4.1.2/bundles/agent-4.1.2-1053/pdk/lib/mx4j/mx4j-remote.jar
0 Kudos
joshdevins
Contributor
Contributor

I have also tried the original plugin provided above with both command lines to no avail. Same log output too -- nothing to report!
0 Kudos
j22033
Contributor
Contributor

Did any of you find a solution to this problem, I'm having the same issues banging my head for more than a day now. Any help is appreciated.

Thanks
0 Kudos
j22033
Contributor
Contributor

Did any of you find a solution to this problem, I'm having the same issues banging my head for more than a day now. Any help is appreciated.

Thanks
0 Kudos
ravisingh983
Contributor
Contributor

I have the same issue and poste a query with subject "Hyperic unable to detect application's JVM by using JMX plugin". I tried to test the plugin by providing -Dproc.java.home (refer to my post mentioned above) argument and it was able to detect my application's process but i have no clue how to provide the same inside my plugin xml.
0 Kudos