Skip to content

Redfish and Dell iDRAC

Preface

This documentation outlines a Prometheus exporter  for Dell iDRAC (Redfish API) designed for air-gapped OpenShift environments.

This exporter exposes hardware health, inventory, power, thermal, fan, storage, memory, network, and SEL event data from iDRAC via Redfish, and integrates cleanly with OpenShift User Workload Monitoring, Prometheus, and Grafana.

Exported Metrics Include

  • System health & uptime
  • BIOS, firmware, model, service tag, serial
  • CPU count & memory size
  • Fan RPMs & temperature sensors
  • PSU input/output & power consumption
  • Storage drive health & capacity
  • Memory module inventory & health
  • Network adapter & port status
  • SEL / Event log entries (as Prometheus annotations)

Architecture

Prometheus (User Workload)
        |
        |  ServiceMonitor
        v
Redfish Exporter (Pod)
        |
        |  Redfish API (HTTPS)
        v
iDRAC (Bare Metal Hosts)

Prerequisite

  • Redfish service enabled on iDRAC
  • OpenShift cluster is able to reach iDRAC
  • Service Accounts created within iDRAC

Installation

Validating the Redfish Endpoint

From Outside the Cluster:

curl -k -u 'user:pass' https://<idrac_ip>/redfish/v1/Chassis

# Or via Sessions:
curl -k -i -X POST https://<idrac_ip>/redfish/v1/SessionService/Sessions \
  -H 'Content-Type: application/json' \
  -d '{"UserName":"<user>","Password":"<pass>"}'

From within the Cluster:

oc run -it --rm netshoot --image=nicolaka/netshoot -- sh
# inside pod:
curl -k https://<IDRAC_IP>/redfish/v1

#or
curl -v "http://redfish-exporter:9348/health"
curl -v "http://redfish-exporter:9348/metrics?target=150.1.1.203"

1. Namespace creation, label and service accounts

oc create ns redfish-exporter
oc label ns redfish-exporter openshift.io/user-monitoring=true
oc create sa -n redfish-exporter redfish-exporter

2. Create Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: redfish-exporter
  namespace: redfish-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: redfish-exporter
  template:
    metadata:
      labels:
        app: redfish-exporter
    spec:
      serviceAccountName: redfish-exporter
      containers:
        - name: redfish-exporter
          image: <repo:image> ## Replace with your internal repo if pulling in an air-gapped environment
          ports:
            - name: http
              containerPort: 9348
          env:
            - name: VERIFY_TLS
              value: "false"
            - name: CONFIG_PATH
              value: "/etc/prometheus/idrac.yml"
          volumeMounts:
            - name: cfg
              mountPath: /etc/prometheus
              readOnly: true
      volumes:
        - name: cfg
          secret:
            secretName: redfish-exporter-config
            items:
              - key: idrac.yml
                path: idrac.yml

3. Create Service

apiVersion: v1
kind: Service
metadata:
  name: redfish-exporter
  namespace: redfish-exporter
  labels:
    app: redfish-exporter
spec:
  ports:
    - name: http
      port: 9348
      targetPort: 9348
  selector:
    app: redfish-exporter

4. Create Secret

apiVersion: v1
kind: Secret
metadata:
  name: redfish-exporter-config
  namespace: redfish-exporter
type: Opaque
stringData:
  idrac.yml: |
    hosts:
      default:
      # iDRAC login credentials
        username: <iDRAC Service Account Username>
        password: <iDRAC Service Account Password>

5. Create Service Monitor

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: redfish-exporter
  namespace: redfish-exporter
spec:
  selector:
    matchLabels:
      app: redfish-exporter
  endpoints:
    - port: http
      path: /metrics
      interval: 1m
      params:
        target: ["<IP_ADDR_NODE5>"]
      relabelings:
        - sourceLabels: [__param_target]
          targetLabel: instance

    - port: http
      path: /metrics
      interval: 1m
      params:
        target: ["<IP_ADDR_NODE4>"]
      relabelings:
        - sourceLabels: [__param_target]
          targetLabel: instance

    - port: http
      path: /metrics
      interval: 1m
      params:
        target: ["<IP_ADDR_NODE3>"]
      relabelings:
        - sourceLabels: [__param_target]
          targetLabel: instance

    - port: http
      path: /metrics
      interval: 1m
      params:
        target: ["<IP_ADDR_NODE2>"]
      relabelings:
        - sourceLabels: [__param_target]
          targetLabel: instance