DMTF / Redfish-Event-Listener

The Redfish Event Listener is a lightweight HTTPS server that can be deployed to read and record events from Redfish services.
Other
31 stars 15 forks source link
redfish

Redfish Event Listener

Copyright 2017-2024 DMTF. All rights reserved.

About

The Redfish Event Listener is a lightweight HTTP(S) server that can be deployed to read and record events from Redfish services. It can also subscribe to multiple services.

Prerequisites

The Redfish Event Listener requires Python3 on the user's system. Additionally, the following Python packages are required:

To install the required packages, use either command:

pip install <package name> pip install -r requirements.txt

To upgrade already installed packages, use the command:

pip install --upgrade <package name>

The target Redfish services must also be configured to send Redfish events.

Configuration

The file config.ini contains a default configuration for the tool. This can be used as a template for real configurations or edited as needed. Sample Configuration with All Options shows an example with all possible configuration options.

The configuration file is broken into different sections with different options.

The Information section contains details about the configuration file itself. The tool does not parse any information in this section, and is used to help users track configuration files. The following options are found in this section:

The SystemInformation section contains settings for the system acting as the event listener. All options in this section are required. The following options are found in this section:

The CertificateDetails section contains the certificate information for the system acting as the event listener. This section and its options are only required if UseSSL in SystemInformation is set to on. The following options are found in this section:

The SubscriptionDetails section contains subscription information so that the Redfish service can send the desired events to the event listener. The Destination option is required; other options can be omitted or have an empty value. The following options are found in this section:

The ServerInformation section contains information about the Redfish services that will transmit events to the event listener. All options in this section, except LoginType, are required. The following options are found in this section:

Running the Tool

Execute using python RedfishEventListener_v1.py

Received event details will be captured on the console and recorded into a file named Events_.txt in the working directory. Individual files will be generated for each subscribed service.

The tool can be stopped by issuing a keyboard interrupt (CTRL-C).

Limitations

Sample Configuration with All Options

The following example shows a configuration file with all possible options supported by the tool. Many Redfish services do not support every possible option, so if a service is returning the HTTP 400 Bad Request status code, inspect the error message to determine which options are not supported, and modify the configuration file accordingly.

[Information]
Updated = February 24, 2023
Description = Redfish Event Listener Tool Full Config

[SystemInformation]
ListenerIP = 0.0.0.0
ListenerPort = 443
UseSSL = on

[CertificateDetails]
certfile = cert.pem
keyfile = server.key

[SubscriptionDetails]
Destination = https://<ListenerIP>/
EventTypes = [
    "Alert",
    "ResourceRemoved",
    "ResourceAdded" ,
    "ResourceUpdated",
    "StatusChange"]
Context = Public
Format = Event
Expand = false
ResourceTypes = ["Chassis"]
Registries = ["ResourceEvent"]

[ServerInformation]
ServerIPs = ["https://<RedfishIP1>","https://<RedfishIP2>"]
UserNames = ["Username1","Username2"]
Passwords = ["Password1","Password2"]
LoginType = ["Session","Basic"]

Release Process

  1. Go to the "Actions" page
  2. Select the "Release and Publish" workflow
  3. Click "Run workflow"
  4. Fill out the form
  5. Click "Run workflow"