VMware Cloud Community
MDNL
Contributor
Contributor

Using (REST) API to collect *ALL* measurements on an agent (resource)

Hi,

I have been playing around with the Hyperic API to query a Hyperic server for the metrics per connected agent (resource).

E.g. by using this: http://localhost:7080/hqu/hqapi1/metric/getMetrics.hqu

But unfortunately it only shows the more or less standard metrics like cpu memory, etc.

It does not show *all* the metrics/measurements which I can see from the webgui itself.

I have also created a few custom plugins by following these examples where keypairs are delivering the metric data towards Hyperic server.

In the webGUI I can see the measurement data, but again when I query the getMetrics API command on the resourceID the metrics are not shown.

Am I overlooking something simple?

I mean basically what I want to achieve is simply by using the API is querying a few hyperic servers to get:

1. per connected server (resource) what are the measurements configured

2. what are their threshold settings

3. what are the actual values of the measurements with timestamp of the last measurement.

Is this doable at all by using multipel API commands used in some scripting or will the API not give such information at all??

Maarten

Reply
0 Kudos
1 Reply
evolex
Enthusiast
Enthusiast

Unfortunately I haven't used this or know what this is as it's pointing to your localhost.

http://localhost:7080/hqu/hqapi1/metric/getMetrics.hqu?resourceId=12835http://localhost:7080/hqu/hqapi1/metric/getMetrics.hqu

When you say Hyperic API, are you referring to the out of the box HQAPI commands that use hqapi.sh or hqapi.bat?

If so, then

1. per connected server (resource) what are the measurements configured - yes

2. what are their threshold settings - yes

3. what are the actual values of the measurements with timestamp of the last measurement. - i've never gotten metrics from this, but the metricdata command may be what you're looking for

If not, then just some general observations when working with Hyperic.

From my experience, when you query for a resource, you'll only get metrics for that resource. So if you provide a resource id of just the server itself, you'll only get stuff like cpu and memory because those measurements belong to that resource.

Each server can have multiple resources so in order to extract information for those resources, a separate resource id that was created for it should be used.

Ex. serverabcd = resource id 1234 = measurements cpu, memory

      / mount ON serverabcd = resource id 12389 = measurements free space, space used, etc.

Reply
0 Kudos