jenningsloy318 / redfish_exporter

exporter to get metrics from redfish based hardware such as lenovo/dell/superc servers
Apache License 2.0
70 stars 61 forks source link

Absent blades are trying to be scraped and not getting health checked #74

Closed kyleprice closed 9 months ago

kyleprice commented 9 months ago

I am having an issue with absent blades still trying to be scraped. I have a super micro blade chassis that is missing some blades and when I try and scrape the chassis I get the following error messages:

2 error(s) occurred:
* [from Gather #2] collected metric "redfish_system_total_processor_count" { label:<name:"hostname" value:"" > label:<name:"resource" value:"system"  > label:<name:"resource" value:"system: > label:<name:"system_id" value:"" > gauge:<value:0 > } was collected before with the same name and label values
* [from Gather #2] collected metric "redfish_system_total_memory_size" { label:<name:"hostname" value:"" > label:<name:"resource" value:"system"  > label:<name:"resource" value:"system: > label:<name:"system_id" value:"" > gauge:<value:0 > } was collected before with the same name and label values

In looking through the code I see the system collector seems to run against both of these without checking the health of the system, which is absent. The other metrics in that area check the health of the system. Does this seem to track? If so I can submit a PR to fix this:

https://github.com/jenningsloy318/redfish_exporter/blob/22dcce0a3939b7f1416cc2cb8e14d382daaadf91/collector/system_collector.go#L172

https://github.com/jenningsloy318/redfish_exporter/blob/22dcce0a3939b7f1416cc2cb8e14d382daaadf91/collector/system_collector.go#L180

kyleprice commented 9 months ago

This branch fixes the issue by adding the commands under the same other validation logic as the others in the system collector:

https://github.com/kyleprice/redfish_exporter

kyleprice commented 9 months ago

PR here, please let me know if you have any issues or comments as I would like to get this merged to fix an issue I am having.

https://github.com/jenningsloy318/redfish_exporter/pull/75

jenningsloy318 commented 9 months ago

@kyleprice

Thank you very much your contribution, I checked and merged.