You are not logged in.
Pages: 1
Hey, guys. I want to get racks power consumption using API.
So there are two parameters in racks - Max. power (in watts) and Measured power (in watts).
I've added power consumptions to all servers models and it shows it in Rack stats field (say 4200/5000).
But Measured power still equals to zero. Do I have to fill it manually? Or how do I get numbers from Rack stats Power field?
Offline
There is also an error in json response. I suppose it should be "measured", not "mesured"... )
"max_power": 5100,
"mesured_power": 0,
Offline
There is also an error in json response. I suppose it should be "measured", not "mesured"... )
"max_power": 5100, "mesured_power": 0,
No, "mesured_power" is considered correct because that is what the database column is named. It is indeed a typo, but maybe not one that can be fixed easily. The new API coming with GLPI 11 is more abstracted from the underlying database schema/code and this field is renamed properly through the new API.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
I can live with it, but still how do I fill measured power parameter? I suppose it should be filled automatically? Don't say that I need to parse GUI to fill all my racks)))
Offline
I don't actually know the purpose of this field, but looking at the code I can tell it isn't automatically calculated. My best guess is that it is meant to be filled manually with the actual/average power draw for the rack or automatically updated using some kind of plugin that can import the data from another software.
The 4200/5000 stat is saying that the current expected maximum power draw is 4200 while that maximum the rack itself can support is 5000.
Since the 4200 is calculated based on the models of the items in the rack, there is no field in the rack table itself for it.
The 4200 number probably won't ever be available in the current API and would have to be calculated each time by whatever is querying the API.
It is something that could be added in the new API though (not a promise) since there is more flexibility in the data it provides.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thank for reply! I've spent some time to fill my racks with max_power and measured_power parameters, and now I'm facing another issue... When I try to get all racks from API using this:
response=$(curl -s -X GET "${API_URL}/DCRoom/2/rack" \
--header "Content-Type: application/json" \
--header "App-Token: ${APP_TOKEN}" \
--header "Session-Token: ${session_token}")
It returns only 16 random racks for each DCRoom. Is this normal behavior?
Offline
No it isn't, and its difficult for me to understand how that could happen at all.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Pages: 1