vCenter

 View Only
Expand all | Collapse all

Custom Plugin loads but does not display metrics

  • 1.  Custom Plugin loads but does not display metrics

    Posted Dec 09, 2008 08:59 PM
    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.


  • 2.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 15, 2008 08:27 AM
    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.


  • 3.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 18, 2008 09:39 AM
    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/virtualcenter-for-vm-ware-server-real-value.html


  • 4.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 22, 2008 06:45 AM
    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.


  • 5.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 22, 2008 11:39 AM
    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


  • 6.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 22, 2008 12:51 PM
    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


  • 7.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 22, 2008 12:55 PM
    Be accurate man... Still wrong path

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

    Missing netdevice from that path...


  • 8.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 22, 2008 01:14 PM
    I noticed my mistake, just before your post. My fault...

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


  • 9.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 22, 2008 01:35 PM
    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.


  • 10.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 05:24 AM
    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.


  • 11.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 08:15 AM
    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.


  • 12.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 10:29 AM
    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.


  • 13.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 11:19 AM
    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.


  • 14.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 11:32 AM
    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


  • 15.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 11:46 AM
    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?


  • 16.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 11:54 AM
    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.


  • 17.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 23, 2008 12:46 PM
    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 :)


  • 18.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 24, 2008 09:28 AM
    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.


  • 19.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 24, 2008 12:11 PM
    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.


  • 20.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 24, 2008 12:40 PM
    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..


  • 21.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 24, 2008 12:48 PM
    This is from hq's mib parser:

    * MIB file parser intended ONLY for
    * OBJECT-TYPE name -> OID conversion
    * For example, converting:
    * "wwwServiceDescription"
    * to:
    * "1.3.6.1.2.1.65.1.1.1.1.2"

    And from your mib:
    usageChange TRAP-TYPE

    I think error comes because it can't find OID. Try to remove those metrics from xml which are related to snmp traps. Like availabilityStatus should work.


  • 22.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 25, 2008 04:47 AM
    Here is my latest plugin. It loads without error and can be added through browse resources | tools | new platform. The green check appears when I add it. However, I do not see any of the SNMP traps. How are those displayed through hyperic if you don't enter them into the plugin?

    Thank you for all your help so far and Happy Holidays.


  • 23.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 26, 2008 10:54 AM
    Do you see any metrics collected? Also you should not mix snmp traps with snmp gets. Gets are the way to collect metrics from network devices. Traps are totally different thing. While you network device could technically feed it's metrics to outside, it's not the correct way to use.

    Let's take example: Your network device has power supply. While mib object type power1Status could tell is it ok or not(1=ok, 0=error). Then you get use snmp gets to use this metric. With snmp traps you network device can notify other parties. So trap itself is usually some sort of alert. With gets you pull data from device. With traps you device is pushing the data. Also network device itself decides when to send traps.

    I believe HQ is not able to receive snmp traps.


  • 24.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 26, 2008 11:33 AM
    Isn't there a way to get traps into event logs of the resource?


  • 25.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 29, 2008 08:50 AM
    I do see metrics collected using availability and uptime. I need the traps to alert me when a certain condition occurs to that I may resolve it. Are you saying there is no way for hyperic to do this, or are you saying that by designing my metrics to capture snmp get information I can accomplish my desired results?


  • 26.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 29, 2008 10:29 AM
    Wow, I think my last post contained some BS. Check this page: http://support.hyperic.com/display/DOC/Configuring+HQ+as+an+SNMP+Trap+Receiver


  • 27.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 29, 2008 10:36 AM
    I'm still not clear. are the results in HQ show as events of the process? What severity will show for these events (warn/error/info)
    some snmp devices have mibs for snmp traps, how should those be used when creating an snmp plugin?

    Thanks,


  • 28.  RE: Custom Plugin loads but does not display metrics

    Posted Dec 31, 2008 09:41 AM
    I have the same questions. The directions do not make it clear how the traps are displayed and where. I suppose I'll have to pose this one to the hyperic people.