1. In your example as you suggested I changed
<property name="PROC_MAIN_CLASS" value="com.test.TestLoader"/>
<property name="PROC_HOME_PROPERTY" value="/ais_local/share/ravi/testInstall/jdk"/>
here "/ais_local/share/ravi/testInstall/jdk" is the install path of JDK for the application.
but it doesn't detect the process on running
java -jar /opt/hyperic/hyperic-hq-agent/bundles/agent-4.1.2-1053/pdk/lib/hq-product.jar -Dplugins.include=JMX-metrics -m discover -a metric -Dlog=debug
Here JMX-metrics is the name of the plugin
2. Then i commented the PROC_HOME_PROPERTY property tag and ran the same command
DEBUG [main] [PluginDiscoverer] Adding Auto Scanners=[ServerSignature {stName=Java 1.5.x, match=[null], exclude=[null], regMatch=[null]}, ServerSignature {stName=Java 1.6.x, match=[null], exclude=[null], regMatch=[null]}]
DEBUG [Thread-1] [AutoScan] Running AutoServerDetector for: Java 1.5.x
DEBUG [Thread-1] [MxServerDetector] State.Name.sw=java,Args.*.eq=com.test.RaviLoader matched 6 processes
ERROR [Thread-1] [AutoScan] AutoScan failed for Java 1.5.x
java.lang.NullPointerException
at org.hyperic.hq.product.jmx.MxServerDetector.isMatch(MxServerDetector.java:160)
at org.hyperic.hq.product.jmx.MxServerDetector.getServerProcessList(MxServerDetector.java:251)
at org.hyperic.hq.product.jmx.MxServerDetector.getServerResources(MxServerDetector.java:309)
at org.hyperic.hq.autoinventory.scanimpl.NullScan.scan(NullScan.java:83)
at org.hyperic.hq.autoinventory.Scanner.start(Scanner.java:196)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:141)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
at org.hyperic.hq.autoinventory.ScanManager$1.run(ScanManager.java:107)
DEBUG [Thread-1] [AutoScan] Running AutoServerDetector for: Java 1.6.x
DEBUG [Thread-1] [MxServerDetector] State.Name.sw=java,Args.*.eq=com.test.RaviLoader matched 6 processes
ERROR [Thread-1] [AutoScan] AutoScan failed for Java 1.6.x
java.lang.NullPointerException
at org.hyperic.hq.product.jmx.MxServerDetector.isMatch(MxServerDetector.java:160)
at org.hyperic.hq.product.jmx.MxServerDetector.getServerProcessList(MxServerDetector.java:251)
at org.hyperic.hq.product.jmx.MxServerDetector.getServerResources(MxServerDetector.java:309)
at org.hyperic.hq.autoinventory.scanimpl.NullScan.scan(NullScan.java:83)
at org.hyperic.hq.autoinventory.Scanner.start(Scanner.java:196)
at org.hyperic.hq.autoinventory.ScanManager.mainRunLoop(ScanManager.java:141)
at org.hyperic.hq.autoinventory.ScanManager.access$000(ScanManager.java:41)
at org.hyperic.hq.autoinventory.ScanManager$1.run(ScanManager.java:107)
0 servers detected
3. Then i commented the PROC_MAIN_CLASS property tag and uncommented PROC_HOME_PROPERTY and wrote it as given in the JMX plugin example
<property name="PROC_HOME_PROPERTY" value="proc.java.home"/>
Then I ran
java -jar /opt/hyperic/hyperic-hq-agent/bundles/agent-4.1.2-1053/pdk/lib/hq-product.jar -Dplugins.include=JMX-metrics -m discover -a metric -Dlog=debug
This command deducted 0 processes
4. Then I ran the command
java -Dproc.java.home=/ais_local/share/ravi/testInstall/jdk -jar /opt/hyperic/hyperic-hq-agent/bundles/agent-4.1.2-1053/pdk/lib/hq-product.jar -Dplugins.include=JMX-metrics -m discover -a metric -Dlog=debug
On running this it gave me an output 1 processes matched with the metrics.
Now obviously i can't do this as there is no way i should be passing the same in hq-agent.sh other than modifying <Hq-agent-Install>/bundles/agent-4.1.2-1053/bin/hq-agent.sh which I should not.