DMTF / libredfish

libRedfish is a C client library that allows for Creation of Entities (POST), Read of Entities (GET), Update of Entities (PATCH), Deletion of Entities (DELETE), running Actions (POST), receiving events, and providing some basic query abilities.
Other
48 stars 22 forks source link

Help needed to get redfishtest working #166

Closed berrfred closed 4 months ago

berrfred commented 5 months ago

Sending requests to an iLO using the python-ilorest-library just works fine, either using basic or session auth, I do get the json output with e.g. all the temperatures.

#!/usr/bin/python3

import json
import redfish

ilo_host="https://10.224.115.109"
ilo_account="Administrator"
ilo_password="xxx"

REDFISH_OBJ = redfish.RedfishClient(base_url=ilo_host, username=ilo_account, password=ilo_password)
REDFISH_OBJ.login(auth="basic")
response = REDFISH_OBJ.get("/redfish/v1/Chassis/1/Thermal/")
print(json.dumps(response.dict, indent = 1))

I'd like to achieve the same thing using libredfish and associated plugin in collectd, however it seems to give the same error I get while trying with redfishtest.

./redfishtest -v -H "https://10.224.115.109" -u Administrator -p xxx -W verdoc /redfish/v1/Chassis/1/Thermal/
Got a failure, httpCode = 65535
./redfishtest -v -H "https://10.224.115.109" -u Administrator -p xxx -W verdoc -S /redfish/v1/Chassis/1/Thermal/
Unable to create service enumerator
journalctl -f -u collectd.service
giu 01 12:39:15 hp-probook-450-g5-fred collectd[38042]: redfish: Query has failed, HTTP code = 65535

Help appreciated to understand what I am missing ... I hope that if I can understand what's wrong with redfishtest then I have a chance to also get collectd plugin right since they basically use the same parameters.

pboyd04 commented 5 months ago

Redfishtest does not use URIs directly. It uses Redpath, (see the README or the Redpath spec). So for this case the Redpath would be "/Chassis[0]/Thermal" which translates to the chassis collection, the first entry in that collection, then the Thermal node under that resource.

mraineri commented 4 months ago

@berrfred were you able to try the above suggestion?

berrfred commented 4 months ago

Well I got the point for the redfishtest but that does not solve my issue with collectd plugin ... in the end I chose to run my python piece of code as a collectd exec and that does the job. Thanks

mraineri commented 4 months ago

Closing; let us know if you need more help with the library.