Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedFish - Power MemberID & Processor MaxMHz Invalid #99

Closed
RyanW8 opened this issue Nov 24, 2020 · 10 comments · Fixed by #100
Closed

RedFish - Power MemberID & Processor MaxMHz Invalid #99

RyanW8 opened this issue Nov 24, 2020 · 10 comments · Fixed by #100

Comments

@RyanW8
Copy link
Contributor

RyanW8 commented Nov 24, 2020

Hey so I'm currently using the RedFish prometheus exporter which uses this library for interacting with the RedFish API. During scraping of targets I get the below errors:

2020/11/24 15:35:14 error error getting power data from chassis Chassis=Self app=redfish_exporter collector=ChassisCollector error=json: cannot unmarshal number into Go struct field PowerControl.PowerControl.MemberId of type string operation=chassis.Power() target=

2020/11/24 15:35:28 error error getting processor data from system System=Self app=redfish_exporter collector=SystemCollector error=json: cannot unmarshal string into Go struct field .MaxSpeedMHz of type int operation=system.Processors() target=

Upon further investigation of the data returned by the Dell hardware it seems that the MemberID field isn't always a string and is sometimes cast to a number. Also looks like our specific models are not capturing the MaxSpeedMHz of the processors and are just returning an empty string.

https://gist.github.com/RyanW8/42803cee457e5ebe6d198a2141224be6 This is for PowerControl Grabbed using https://<host_ip>/redfish/v1/Chassis/Self/Power. Looks to be that some MemberIDs are strings and some are numbers

https://gist.github.com/RyanW8/74c4904706b486e0862703d96c5f9235 This is the CPU information. Grabbed using https://<host_ip>/redfish/v1/System/Self/Processors/1 & https://<host_ip>/redfish/v1/System/Self/Processors/2. Looks like MaxSpeedMHz isn't set.

Would it be possible to add in fixes into this library?

@stmcginnis
Copy link
Owner

I think I remember the MemberID string versus int values being fixed by Dell. It might be possible to update your iDRAC firmware to get around this.

Thanks for the JSON output, that helps a lot! I'll see if we can handle this in the library to get around it.

The spec does declare these as strings and integers, so if an upgrade does not take care of it, it could be worth submitting a bug report to Dell to get them to conform to the spec.

@RyanW8
Copy link
Contributor Author

RyanW8 commented Nov 24, 2020

Not sure if it's gonna be possible to upgrade the firmware anytime soon as we're approaching the Christmas change freeze. Adding it into the library would be ideal. If the spec declares them as strings & integers then surely Dell is conforming to the spec (Since their returning strings & integers)?

@stmcginnis
Copy link
Owner

I meant to say those types respectively for the values in error.

MaxSpeedMHZ can be either integer or null (not included in the output), but you are getting back an empty string, so that is invalid.
https://redfish.dmtf.org/schemas/v1/Processor.v1_10_0.json

MemberID type must be a string, but you are getting back an integer.
https://redfish.dmtf.org/schemas/v1/Power.v1_6_1.json

So whatever version of iDRAC firmware running on those machines in not conforming to the Redfish spec completely.

@RyanW8
Copy link
Contributor Author

RyanW8 commented Nov 24, 2020

Ahhh okay that makes sense. In the meantime how hard would it be to get the library to handle this?

@stmcginnis
Copy link
Owner

Looking at that now. Doesn't look like it should be too bad, so I think I could have something for you to try shortly.

@stmcginnis
Copy link
Owner

Just notes in case this makes it back to Dell. The PowerMetrics also have an invalid type returned. IntervalInMin is defined as an "integer" type. "Number" type allows floating point values, but "integer" is an actual while integer number. Sample output is returning:

"IntervalInMin": 0.083333333333333,

stmcginnis added a commit that referenced this issue Nov 24, 2020
Some implementations are not following the Redfish spec exactly and
returning values in types other than what is defined in the spec. This
adds some workarounds to try to address some of these in the Power and
Processor objects.

Closes: #99

Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
@stmcginnis
Copy link
Owner

PR is up to address the issues found in the sample JSON output you provided. If you can test that out to see if it fixes your issue, that would be great.

Otherwise I will just merge this a little later today and we can address anything else in follow up patches.

Thanks!

@RyanW8
Copy link
Contributor Author

RyanW8 commented Nov 24, 2020

I don't think I'll be able to test it until this is merged into master, and the RedFish exporter updates the version of GoFish used https://github.com/jenningsloy318/redfish_exporter

@RyanW8
Copy link
Contributor Author

RyanW8 commented Nov 25, 2020

Can this be tagged with a new version/release please?

@stmcginnis
Copy link
Owner

I've just tagged v0.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants