adejoux / nmon2influxdb

Make NMON data dynamic with InfluxDB
GNU Affero General Public License v3.0
80 stars 29 forks source link

[feature request] HMC Import add temperatures & power usage for managed systems #47

Open Mikesch-mp opened 7 years ago

Mikesch-mp commented 7 years ago

Hello,

ist it possible also to include the temperatures and power usage for managed systems ? See here : POWER8 Energy (Watts & Temperature) via the HMC REST API Best regards, Carsten

adejoux commented 7 years ago

Hello :)

I am planning to do it. I need to upgrade my HMCs to 8.6.0 first. After that I will implement it. I hope it will be this month.

Regards,

Alain

adejoux commented 7 years ago

I forgot but if you want you can run nmon2influxdb on a HMC 8.6.0 with "--debug-file" and send me the output. If I find the energy metrics in the output I could add them quickly.

Thanks

Mikesch-mp commented 7 years ago

Hello Alain,

here a hmc scan with --debug-file for you.

Best regards, Carsten hmcout.zip

Mikesch-mp commented 7 years ago

Hello again,

think to get the data you have to set the type with "/ProcessedMetrics?Type=Energy" , see the example output from the link in my first post.

Best regards, Carsten

adejoux commented 7 years ago

Hello :)

I am wondering if I need to perform a specific request for the energy metrics or if this metrics will be along the system ones if I don't specify "type=Energy" in the request.

Bets Regards, Alain

Mikesch-mp commented 7 years ago

Hi,

found out you dont need to specify the "Type", but you need to enable it on the hmc for the managed systems. At the moment this can be only done via "POST" of an xml to the API, the hmc command "chperfmon" is still undocumented. I managed to enable EnergyMonitor on one of my HMCs. Now iam waiting to get some sample data for you.

Best regards, Carsten

Mikesch-mp commented 7 years ago

Hi again,

when i do curl -v -k -s -c cookies.txt -b cookies.txt -H "Accept: application/atom+xml; charset=UTF-8" https://hmc:12443/rest/api/pcm/preferences

and then

curl -k -s -c cookie -b cookie https://hmc:12443/rest/api/pcm/ProcessedMetrics/ManagedSystem_8ca70039-fa81-37d5-b8b8-c9c3cc1eb943_20170215T113001+0100_20170215T133301+0100_30.json | python -m json.tool

i don't get any data for energy/temperature. but if i do first

curl -v -k -s -c cookies.txt -b cookies.txt https://mqde01hmcsap01:12443/rest/api/pcm/ManagedSystem/f51a8309-deb4-34f2-94c5-eac2f60b3376/ProcessedMetrics?Type=Energy

and then

curl -v -k -s -c cookies.txt -b cookies.txt https://hmc:12443/rest/api/pcm/EnergyMetrics/ManagedSystem_f51a8309-deb4-34f2-94c5-eac2f60b3376_20170215T140502+0100_20170215T160502+0100_30.json | python -m json.tool

i get the data we want :) i attached a sample for you. output.zip

adejoux commented 7 years ago

A big thanks :) It's really helpful. So much I tried to code the Energy metrics without HMC :) I pushed a branch energy with my current code.

If you want you can test the binary attached. I am really not sure if it will work.

nmon2influxdb.zip

If it's not working you can try to run it in debug mode and send me the debug file:

nmon2influxdb --debug-file debug.txt hmc import --samples 10

Again a big thanks for your help :)

Regards,

Alain

Mikesch-mp commented 7 years ago

Hello Alain,

here the debug file.

Best regards, Carsten debug.zip