Redfish Event Listener in PowerShell

The Redfish specification supports event mechanism through which the target Redfish devices can send events from different components in the system to an event listener. The PSRedfishEventListener project provides an event listener that is create in native PowerShell.

Full documentation of commands with examples is available at: https://psredfishlistener.readthedocs.io/en/latest/

Example Workflow

  1. Start an event listener using the Start-PSRedfishEventListener command.
1
Start-PSRedfishEventListener -IPAddress 172.16.102.76 -Port 9090 -LogPath C:\RedfishEvents

The above command will start new event listener that is bound to a specific IP address on the local host and to port 9090. The log path will be set to C:\RedfishEvents.

  1. Perform registration on a Redfish Endpoint to send alerts to the listener. This is done using the Register-PSRedfishEventSubscription command.
1
2
$credential = Get-Credential -Message 'Credentials to authenticate to the Redfish device ...'
Register-PSRedfishEventSubscription -EventDestination https://172.16.102.76 -IPAddress 172.16.100.21 -Credential $credential

The above command will register (create an event subscription) Redfish device 172.16.100.21 to send all event types to listener at https://172.16.102.76.

  1. Test event subscription using theSend-PSRedfishTestEvent.
1
2
$credential = Get-Credential -Message 'Credentials to authenticate to the Redfish device ...'
Send-PSRedfishTestEvent -IPAddress 172.16.100.21 -Credential $credential -EventDestination https://172.16.102.76 -Verbose

The above command will submit a test event from Redfish device with an IP address 172.16.100.21 to the event listener at 172.16.102.76. The event type and message ID will be set to the defaults defined by the function.

4.Stop the event listener using the Stop-PSRedfishEventListener command.

1
Stop-PSRedfishEventListener -IPAddress '172.16.102.76' -Verbose

I have a few new features lined up for the next release. Similar to PowerShell object events, with the upcoming release, you will be able to tag an action associated to a specific event type from all Redfish device source or a specific source.

Share on: