VMware Cloud Community
Homer_13
Contributor
Contributor

Hyperic HQ Plugin: Monitor External Hard Drives

Hello dear forum members.

I have been trying to figure out how to make a plugin to monitor the external HDs mounted on our Agent machines and I feel like I'm facing a brick wall.

I have read quite a few tutorials and have some code already written but I don't know what to do.

The server can identify these external hard drives through the View~>Live Exec: df command but it won't show up as a resource so I can, then, add alerts and so on. So I guess writing a plugin is the solution.

Does someone know of a way to do this, or have already written one or something similar that I could adapt? I would appreciate it very much.

*sorry if this is the wrong place to ask for code/tips regarding the plugin I need&

Reply
0 Kudos
7 Replies
admin
Immortal
Immortal

Maybe I'm missing something. Do you see external HDs in your OS ? What OS do you have ?

So once you can see external HDs it should be discovered by system plugin.

Reply
0 Kudos
Homer_13
Contributor
Contributor

Maybe I wasn't clear enough. I have many agents, on Linux and on Win32 machines.

On a few of these agents, I have external HDs and/or NAS connected to them and Hyperic does not auto discover them. However, if I go to View->Live Exec>command df it will show me all the HDs and/or NAS, but you cannot put an alert here to fire when a certain % of usage is reached or whatever, so it's kind of useless for automatic monitoring.

Therefore, the system/regular plugin does not discover it. I believe it's not that hard to create a plugin that uses SIGAR to execute a df command and auto discover it from there...

Here's what I have so far:

<?xml version="1.0" encoding="UTF-8"?>

<plugin name="plugin-hd-externo">

  <service name="HD">

  <metric name="Availability"

  indicator="true"

  template="sigar:Type=ProcFd,Arg=/"/>

  <plugin type="measurement" class="org.hyperic.hq.product.MeasurementPlugin"/>

  </service>

</plugin>

I believe that the template is wrong, and I cannot find what to use here. Maybe the plugin type isn't "measurement" and the class probably isn't "org.hyperic.hq.product.MeasurementPlugin". And the template too.

Problem is, it's quite hard to find examples and documentation of templates, a list of options and types and whatnot. Very sad Smiley Sad.

Help, anyone?

Reply
0 Kudos
admin
Immortal
Immortal

You're missing the discovery “plugin” tag that point to your class…

Reply
0 Kudos
Homer_13
Contributor
Contributor

Is there any chance you (or anyone) could send me some code?

The documentation is very bad and it's hard to find out what I should do with the hints you just gave me.

Thanks for the help so far, but I really need more (help) as the documentation does not.

Reply
0 Kudos
Homer_13
Contributor
Contributor

Well, I guess it cannot be done. Too bad.

Good luck to whoever finds themselves in the same needs.

Reply
0 Kudos
admin
Immortal
Immortal

Sorry for delay.

Don't give up Smiley Happy

Please attach your class.

Reply
0 Kudos
admin
Immortal
Immortal

Here is an example of base demo plugin - hyperic/demo-plugin · GitHub

Good Luck

Reply
0 Kudos