VMware Cloud Community
O-RzA
Contributor
Contributor

Can't see MBean in HQ UI

Hi,
I''ve been trying to create a custom plugin for my MBean and see it through the HQ UI but i cannot.

i can connect to my MBean through jconsole and see the attributes and run the operations but no luck with HQ

Here is my plugin content(Stat1, Stat1 are the attributes from my MBean)

<?xml version="1.0"?>

<plugin name="testBean" package="org.hyperic.hq.product.jmx">

<service name="HelloThere Plugin" server="Sun JVM" version="1.5">
<config>
<option name="jmx.url" description="JMX URL to MBeanServer" default="service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi"/>
<option name="jmx.username" description="JMX username" optional="true" default=""/>
<option name="jmx.password" description="JMX password" optional="true" default="" type="secret"/>
</config>

<property name="OBJECT_NAME" value="SimpleAgent:name=hellothere"/>

<plugin type="autoinventory"/>
<plugin type="measurement" class="org.hyperic.hq.product.jmx.MxMeasurementPlugin"/>
<plugin type="control" class="org.hyperic.hq.product.jmx.MxControlPlugin"/>

<metric name="Availability"
template="${OBJECT_NAME}:Availability"
indicator="true"/>

<metric name="Used Memory"
template="${OBJECT_NAME}:Composite.Usage.used"
indicator="true"
units="B"/>

<metric name="Commited Memory"
template="${OBJECT_NAME}:Composite.Usage.committed"
indicator="true"
units="B"/>

<metric name="Status"
category="PERFORMANCE"
template="${OBJECT_NAME}:Status"
indicator="true"/>

<metric name="Status1"
template="${OBJECT_NAME}:Stat1"
indicator="true"/>

<metric name="Status2"
template="${OBJECT_NAME}:Stat2"
indicator="true"/>

<actions include="updateStats"/>

</service>
</plugin>

and when i try to run it from my agent directory with this command
java -jar pdk/lib/hq-product.jar -Dplugins.include=jmx,testBean -m discover -a metric -Dlog=debug

I get the following output
[DEBUG] ProductPluginManager - Initializing in client mode (pdk=C:\Program Files
\Hyperic HQ 3.2.3\agent-3.2.3\pdk)
[DEBUG] MIBTree - No MIBs in directory: C:\Program Files\Hyperic HQ 3.2.3\agent-
3.2.3\pdk\mibs
[INFO] ProductPluginManager - Loading plugin: system-plugin.jar
[DEBUG] SystemPlugin - sigar.mirror.procnet=null
[INFO] ProductPluginManager - Loading plugin: netservices-plugin.jar
[INFO] MeasurementPlugin - Register TCP Socket proxy for domain: socket
[INFO] MeasurementPlugin - Register HTTP proxy for domain: http
[INFO] MeasurementPlugin - Register HTTP proxy for domain: url.availability
[INFO] MeasurementPlugin - Register FTP proxy for domain: ftp
[INFO] ProductPluginManager - Loading plugin: sqlquery-plugin.jar
[DEBUG] ProductPluginManager - adding to sqlquery classpath:
[DEBUG] ProductPluginManager - d C:\Program Files\Hyperic HQ 3.2.3\agent-3.2.
3\pdk\lib\jdbc
[INFO] SQLQueryMeasurementPlugin - Registered proxy for domain: sql
[INFO] ProductPluginManager - Loading plugin: jmx-plugin.xml
[DEBUG] ProductPluginManager - adding to jmx classpath:
[DEBUG] ProductPluginManager - d C:\Program Files\Hyperic HQ 3.2.3\agent-3.2.
3\pdk\lib\mx4j
[INFO] ProductPluginManager - Loading plugin: testBean-plugin.xml
[DEBUG] ProductPluginXML - Trying data ClassLoader to load: org.hyperic.hq.produ
ct.jmx.MxControlPlugin for plugin Sun JVM 1.5 HelloThere Plugin
[DEBUG] ProductPluginXML - Unable to load org.hyperic.hq.product.jmx.MxControlPl
ugin for plugin Sun JVM 1.5 HelloThere Plugin: java.lang.ClassNotFoundException:
org.hyperic.hq.product.jmx.MxControlPlugin
[DEBUG] ProductPluginXML - Trying data ClassLoader to load: org.hyperic.hq.produ
ct.jmx.MxMeasurementPlugin for plugin Sun JVM 1.5 HelloThere Plugin
[DEBUG] ProductPluginXML - Unable to load org.hyperic.hq.product.jmx.MxMeasureme
ntPlugin for plugin Sun JVM 1.5 HelloThere Plugin: java.lang.ClassNotFoundExcept
ion: org.hyperic.hq.product.jmx.MxMeasurementPlugin
[DEBUG] PluginDiscoverer - Adding Auto Scanners=[ServerSignature {stName=Sun JVM
1.5, match=[null], exclude=[null], regMatch=[null]}]
[DEBUG] PluginDiscoverer - Adding Registry Scanners=[]
[DEBUG] AutoScan - Running AutoServerDetector for: Sun JVM 1.5
[DEBUG] WindowsRegistryScan - Windows Registry Scan starting...
[DEBUG] WindowsRegistryScan - Windows Registry Scan completed, took: 0
0 servers detected

I dunno why i get the class not found exception but even if i remove the two lines from the plugin so as to not get any exceptions i do not see the plugin in the Auto-Discovery panel in the HQ dashboard nor anywhere is. could it be working and i just dunno where to look?

Any help would be much appreciated, Thanx
0 Kudos
25 Replies
scottmf
Enthusiast
Enthusiast

It would also help to set your agent on DEBUG mode in order to debug this.
0 Kudos
O-RzA
Contributor
Contributor

i have this line in my plugin
<plugin type="log_track" class="org.hyperic.hq.product.jmx.MxNotificationPlugin"/>
which enables the log options on the configure server screen.

But i do not have a 'Log Files' box to input the list of log files i want it to track.

do i have to specify what log file i want it to look at to get the data in the configure Platform screen? in the platform.log_track.eventlogs box?
0 Kudos
scottmf
Enthusiast
Enthusiast

The MxNotificationPlugin does not track log files, only jmx notifications. You need to use another type.

An example of another type is the log4j log track class->

<plugin type="log_track" class="org.hyperic.hq.product.Log4JLogTrackPlugin"/>

Unfortunately if you need to track more than log4j logs then you probably need to write a custom log tracker.

For an example of how to do this, see the coldfusion plugin in our source repo. It is called ColdfusionErrorLogPlugin
0 Kudos
O-RzA
Contributor
Contributor

ok so i changed that line to this one
<property name="DEFAULT_LOG_FILE" value="log/mybean.log"/>

<plugin type="log_track" class="org.hyperic.hq.product.Log4JLogTrackPlugin"/>

and it seems that the fields are all there...gonna test it now.
0 Kudos
O-RzA
Contributor
Contributor

Another point is the alerts...i have specified a user with both an email address and an SMSaddress and when the alert is triggered the user is not getting notified.
I have added the user under the NotifyUser tab as well as the Notify roles tab by adding the role the user is under.

but no email or sms is being sent.. is there something specific i have to do to enable this?
Is there a setup required for the email or sms service that i have to go through seperate from the initial install?

..ok so i guess i have to edit the hq-server.conf file to get it working..

Message was edited by: O-RzA
0 Kudos
O-RzA
Contributor
Contributor

got the emails working, still trying to figure out the SMS
this forum post was really useful...

http://communities.vmware.com/message/1922304#1922304
0 Kudos