Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ groups:
group1:
username: group1_user
password: group1_pass
flakey:
username: "Administrator"
password: "Password"
disabled_metrics:
- "ethernet_interfaces"
```
Note that the ```default``` entry is useful as it avoids an error
condition that is discussed in [this issue][2].
Expand Down Expand Up @@ -60,6 +65,35 @@ curl '127.0.0.1:9123/redfish?target=10.10.12.23&collectlogs=true'

The `collectlogs` query parameter can be included in Prometheus config.

## Disabling collection of specific groups of metrics

Sometimes it isn't possible to gather all metrics from a BMC because
it doesn't conform to the Redfish standard due to a bug. Or perhaps
you don't need all the metrics. In either case, basic support exists
for skipping specific metric groups at the `default`, `group` or
`host` level:

```yaml
hosts:
10.36.48.24:
username: admin
password: pass
disabled_metrics:
- "ethernet_interfaces"
default:
username: admin
password: pass
disabled_metrics:
- "memory"
- "processor"
- "storage"
- "pcie_devices"
- "network_interfaces"
- "ethernet_interfaces"
- "simple_storage"
- "pcie_functions"
```

## Building

To build the redfish_exporter executable run the command:
Expand Down
4 changes: 2 additions & 2 deletions collector/redfish_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ type RedfishCollector struct {
}

// NewRedfishCollector return RedfishCollector
func NewRedfishCollector(host string, username string, password string, collectLogs bool, logger *log.Entry) *RedfishCollector {
func NewRedfishCollector(host string, username string, password string, collectLogs bool, disabledMetrics []string, logger *log.Entry) *RedfishCollector {
var collectors map[string]prometheus.Collector
collectorLogCtx := logger
redfishClient, err := newRedfishClient(host, username, password)
if err != nil {
collectorLogCtx.WithError(err).Error("error creating redfish client")
} else {
chassisCollector := NewChassisCollector(redfishClient, collectLogs, collectorLogCtx)
systemCollector := NewSystemCollector(redfishClient, collectLogs, collectorLogCtx)
systemCollector := NewSystemCollector(redfishClient, collectLogs, disabledMetrics, collectorLogCtx)
managerCollector := NewManagerCollector(redfishClient, collectLogs, collectorLogCtx)

collectors = map[string]prometheus.Collector{"chassis": chassisCollector, "system": systemCollector, "manager": managerCollector}
Expand Down
Loading