VMware Cloud Community
wjenki1
Contributor
Contributor

Custom Plugin loads but does not display metrics

Hello,

I am new to creating custom plugins and actually attempted to use hyperic support before posting here. If anyone has access to the hyperic Jira at http://jira.hyperic.com, my ticket reference is SUPPORT-3321. We worked on the issue for over 2 weeks before the lady helping me suddenly realized that I didn't have custom plugin support. Regardless, the support given was of very little use. My situation now is that I have a custom plugin that loads through the UI when it is in /home/hyperic/hq-plugins, but does not display metrics. The lady helping me told me it should be in /home/hyperic/agent-3.1.4/pdk/plugins/ only, but that caused stack trace errors (PluginNotFoundException) in the UI. I was wondering if some one could take a look at the attached custom plugin and the associated MIB file and possibly tell me what I may be doing wrong? When I run:

java -jar /home/hyperic/agent-3.1.4/pdk/lib/hq-product.jar -Dplugins.include=sotechProductLS -m discover -a metric -Dlog=debug > outa.txt

I receive:

[DEBUG] MIBTree - Loading MIB: '/usr/share/snmp/mibs/product_nozero.mib.txt': success
[DEBUG] PluginDiscoverer - Set platform.type=sotechProductLS
[DEBUG] PluginDiscoverer - No detector for product
[DEBUG] PluginDiscoverer - Adding Auto Scanners=[]
[DEBUG] Scanner - Running discovery for another platform: sotechProductLS=localhost/127.0.0.1
[WARN] Scanner - No server signatures were found.
[DEBUG] Scanner - Running discovery for another platform: sotechProductLS=localhost/127.0.0.1

The associated outa.txt file contains:

0 servers detected

Any help or guidance will be appreciated.
0 Kudos
27 Replies
jvalkeal_hyperi

It would be nice to see server and agent logs what this plugin is actually trying to do.

3.1.4 is rather old and at least I havent never used it. In version 4.x this plugin wont deploy until classpath setting in xml is moved from platform section to plugin section. Don't know why, perhaps 3.1.4 has different xml validation. Also in version 4.x, default enabled mertics for this plugin has collection interval of 30 minutes, so in any case it would take some time to collect any metrics. But I guess you have changed those since you were able to deploy the plugin.

I belive JIRA doesn't show others support tickets, so it's difficult to know what you have discussed with hyperic.

I'm about to do my own custom plugins for snmp, so this case sounds interesting.
0 Kudos
andrewstaflin
Contributor
Contributor

Does it really worth it that much to purchase Virtual Center? Would it be worth it to purchase Virtual center
If I don't upgrade my VI3 from standard to Enterprise. The post above cheered me up a lot into buying it, but it did not
mention what it will give & not give in standard edition.

http://www.virtualizationteam.com/virtualization-vmware/vmware-virtual-server-virtualization-vmware/...
0 Kudos
wjenki1
Contributor
Contributor

I attached both the server.log and the agent.log for your viewing. As far as the classpath in the XML it is already in the plugin and not the platform as you can see in the plugin.xml file:

<plugin>
<property name="MIBDIR" value="/usr/share/snmp/mibs"/>

<property name="MIBS"
value="${MIBDIR}/product.mib.txt,${MIBDIR}/product_nozero.mib.txt"/>
<classpath>

<include name="pdk/plugins/netdevice-plugin.jar"/>

</classpath>

<platform name="sotechProductLS">

Maybe you are indicating that I should try to move it to the platform section incase 3.1.4 is different that 4.x as far as placement goes. Any further advise is appreciated.
0 Kudos
jvalkeal_hyperi

OK, your server and agent logs seems to be full of errors. So it will be hard to tell what is wrong, but it's better to start fixing problems one by one.

So let's start and fix this 'Unable to load org.hyperic.hq.product.NetworkDeviceDetector for plugin sotechProductLS' problem in your agent log.

As you know, this package doesn't exist. This NetworkDeviceDetector class is coming from the netdevice-plugin.jar, which you have tried to include in the classpath. It's not:

<plugin type="autoinventory" class="org.hyperic.hq.product.NetworkDeviceDetector"/>

Correct path is:

<plugin type="autoinventory" class="org.hyperic.hq.plugin.netdevice.NetworkDeviceDetector"/>


You can see this from source code or from jar file:

# unzip -l pdk/plugins/netdevice-plugin.jar |grep Network
10200 09-19-08 13:28 org/hyperic/hq/plugin/netdevice/NetworkDeviceDetector.class
1140 09-19-08 13:28 org/hyperic/hq/plugin/netdevice/NetworkDeviceMeasurementPlugin.class
6047 09-19-08 13:28 org/hyperic/hq/plugin/netdevice/NetworkDevicePlatformDetector.class
908 09-19-08 13:28 org/hyperic/hq/plugin/netdevice/NetworkDeviceProductPlugin.class
2149 09-19-08 13:28 org/hyperic/hq/plugin/netdevice/NetworkHostDetector.class
wjenki1
Contributor
Contributor

I noticed that error and began to research what it should be for 3.1. Unfortunately there is no information for 3.1 in the SNMP plugins section. I looked at 3.2 and determined what you have here to be correct. So I replaced my entries as listed below:


<plugin type="autoinventory"
class="org.hyperic.hq.plugin.NetworkDevicePlatformDetector"/>

<server name="product">
<config>
<option name="if.name"
description="Interface name"
default="www"/>
</config>

<plugin type="autoinventory"
class="org.hyperic.hq.plugin.NetworkDeviceDetector"/>

However, the agent.log still displays the following errors:

2008-12-22 11:41:07,071 ERROR [ProductPluginXML] Unable to load org.hyperic.hq.plugin.NetworkDevicePlatformDetector for plugin sotechProductLS
2008-12-22 11:41:07,071 ERROR [ProductPluginXML] Unable to load org.hyperic.hq.plugin.NetworkDeviceDetector for plugin product
0 Kudos
jvalkeal_hyperi

Be accurate man... Still wrong path

<plugin type="autoinventory" class="org.hyperic.hq.plugin.netdevice.NetworkDeviceDetector"/>

Missing netdevice from that path...
0 Kudos
wjenki1
Contributor
Contributor

I noticed my mistake, just before your post. My fault...

That cleared up that issue. My latest log files are attached.
0 Kudos
jvalkeal_hyperi

Could you post your lates sotechProductLS-plugin.xml. I may want to try this myself.

Btw, those errors in server log looks pretty nasty. If you remove this plugin from server, does those errors still occur? Are you in position to wipe you HQ installation, because that maybe something what you need to do. (hope this is your testing instance)

I looks like there is something in the database what should not exist.
0 Kudos
wjenki1
Contributor
Contributor

I attached my latest version of the plugin. This is my lab instance and I am prepared to blow it away if need be after testing. However, the server log looks good for the most part when I rename the plugin to .new, though a temp file throws an error on that file in the deploy directory.
0 Kudos
jvalkeal_hyperi

OK, here we go.

1. Those unzip errors are not related to this. You propably have some extra files what it's trying to deploy.

2. This loads to my 4.x instance without errors. So, I would suggest you to try this on clean HQ installation.

3. I believe there's something what needs to be added to xml file:

I would use <config include="snmp" />. I don't exactly know what that include, but you may have already manually added those configs.

I think server section also needs this
<plugin type="measurement" class="net.hyperic.hq.product.SNMPMeasurementPlugin"/>
definition. If you later want get metrics from there, I think.

Last what comes to my mind, is filters. I think snmp measurement wont work until some filters are introduced(you see these within every plugin). I've seen those used in snmp plugins. At least you are setting template on your metrics, so this may not be that big issue.

I had a plan to do plugin for our printers and ip-phones. I don't need it, but my colleague wants to have it.

But, first you need to be able to load your plugin without errors.
wjenki1
Contributor
Contributor

That has me a lot closer than I have been so far. I still get some nasty DB errors in the server log, so I am probably going to have to reinstall to resolve that. Here are the latest plugin and log files. I will probably wipe the db today and let you know how it loads on a new install.
0 Kudos
jvalkeal_hyperi

This line from server.log:

2008-12-23 10:19:26,459 INFO [main] [org.hyperic.hq.product.server.session.ProductManagerEJBImpl] sotechProductLS unknown -- registering

When I tried to deploy your plugin, I also got that line. I forget to copy those mibs to that /usr/share/snmp/mibs directory on server side. Once I did that, plugin deployed without errors. You propably have mibs in place, just wanted to tell you this.
0 Kudos
wjenki1
Contributor
Contributor

I am not sure why that line is appearing. I have the mibs in that directory:

[root@server mibs]# pwd
/usr/share/snmp/mibs
[root@server mibs]# ls | grep product
product.mib
product.mib.txt
product_nozero.mib
product_nozero.mib.txt

Also, further up in the log it states the following:

2008-12-23 11:04:51,324 INFO [ScannerThread] [org.hyperic.hq.product.server.mbean.ProductPluginDeployer] HQ plugin sotechProductLS registered

So I am not sure why this is happening.

Message was edited by: wjenki1
0 Kudos
jvalkeal_hyperi

Ah, ok. Is sotechProductLS now visible under 'administration tab' -> 'Monitoring defaults' -> 'Platform types' ?

And if it is, can you now create new platform from resources tab. Like new platform -> select sotech as new platform type and agent which you want to use this new platform?
0 Kudos
wjenki1
Contributor
Contributor

Yes, sotech... is now available under Monitoring defaults | Platform types. I am also able to add it through browse resources | tools | new platform | sotech... However, I have been able to do that for some time. The issue is that I never get any metrics. The icon or availability indicator is always a grey ? and never a green check. I have waited for over 30 minutes on every occasion that I have created it and never see the status change.
0 Kudos
jvalkeal_hyperi

You know, I don't know how that older hq version is working but there should be some kind of error somewhere. For the UI is showing error because from the agent I don't have any snmp devices to connect to.

Are you really seeing empty metric table. I mean empty table where those merics are just unavailable? Or do you mean that completely page is blank?

I think this could work If my agent would find matching snmp device with correct values.

What comes for the availability, your xml is missing metric for availability. As you can see it from 'monitoring default' page.

I think you are getting pretty close to get this working 🙂
0 Kudos
wjenki1
Contributor
Contributor

When I select the platform that the plugin is assigned to, no metrics display. It states "There are no indicator metrics to display." I added the filter and the availability metric. My latest plugin is attached along with logs.
I am going to blow away my DB to see if that will resolve the remainder of the errors in the server.log.
0 Kudos
wjenki1
Contributor
Contributor

Okay, after deleting my DB and starting over everything loads without error using the attached plugin. However, when I try to add the plugin now through browse resources | tools | add platform, I receive the following error:

The configuration has not been set for this resource due to : Invalid configuration: Invalid request: Failed to lookup OID for name=usageChange (last lookup failure=null)

I thought my metrics maybe programmed incorrectly. I am going to look that one up and try a few things.
0 Kudos
jvalkeal_hyperi

Right, now you got same error than I did. So some progress. Indeed, you had some db problems.

Btw, have you tried to use snmp browser together with those mib files to get values from your device. I could try to check where this error message comes..
0 Kudos