Skip to content

Commit c5c26fa

Browse files
authored
Merge pull request #2383 from hpe-dev-incubator/cms/blog/the-redfish-event-service
Update Blog “the-redfish-event-service”
2 parents 4e26ec6 + 5cbdf0b commit c5c26fa

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

content/blog/the-redfish-event-service.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
---
2-
title: "The Redfish® Event Service"
2+
title: The Redfish Event Service
33
date: 2018-03-27T15:17:22.504Z
4-
author: François Donzé - Technical consultant
5-
tags: ["ilo-restful-api","Redfish","iLO"]
6-
authorimage: "/img/blogs/Avatar6.svg"
74
featuredBlog: false
8-
priority:
9-
thumbnailimage:
5+
priority: null
6+
author: François Donzé - Technical consultant
7+
authorimage: /img/fdz-photoprofile.png
8+
thumbnailimage: null
9+
tags:
10+
- ilo-restful-api
11+
- Redfish
12+
- iLO
1013
---
11-
# The Redfish Event Subscription Service
14+
<style> li { font-size: 27px; line-height: 33px; max-width: none; } </style>
15+
1216
Updated: October 2019
13-
17+
1418
## Scope of this article
1519

1620
This article describes the Redfish Event Subscription service implemented in HPE iLO 5 with a firmware version of 1.40 or later. The implementation of this service in iLO 4 may differ slightly.
1721

18-
The Event Receiver program presented in this blog is an alternative to the DMTF [Redfish-Event-Listener tool](https://github.com/DMTF/Redfish-Event-Listener).
22+
The Event Receiver program presented in this blog is an alternative to the DMTF <a href="https://github.com/DMTF/Redfish-Event-Listener" target="_blank">Redfish-Event-Listener tool</a>.
1923

2024
## Traps versus event subscriptions
2125

2226
The Simple Network Management Protocol (SNMP) uses a "trap" mechanism to report asynchronous events generated by managed nodes toward pre-configured management consoles. All events are sent on the network and then processed by the management consoles. This approach may saturate the network and/or the management console in case of a storm of unsolicited events.
2327

2428
Another approach consists in filtering the events at the source, so only selected events are sent on the network toward specified event receivers (i.e. management consoles). Practically, the event receivers send a subscription request to the managed nodes containing the types of event that they are prepared to receive and process.
2529

26-
The Web-Based Enterprise Management (WBEM) standard uses this subscription paradigm, as well as the [DMTF Redfish standard](https://www.dmtf.org/standards/redfish). Both of them define management web services but Redfish is much simpler for a common human being to understand, prototype and implement.
30+
The Web-Based Enterprise Management (WBEM) standard uses this subscription paradigm, as well as the <a href="https://www.dmtf.org/standards/redfish" target="_blank">DMTF Redfish standard</a>. Both of them define management web services but Redfish is much simpler for a common human being to understand, prototype and implement.
2731

28-
![Redfish Event Subscription functional diagram](https://redfish-lab.sourceforge.io/media/redfish-wiki/event-subscription-service/Event-subscription-diagram.png)
32+
![Redfish Event Subscription functional diagram](/img/event-subscription-diagram.png "Redfish Event Subscription functional diagram")
2933

3034
## Do it yourself, it doesn't hurt
3135

@@ -35,7 +39,6 @@ The following example is based on a simple PHP event receiver program installed
3539

3640
Start to configure the Web Server and let it know the location of the `EventReceiver.php` program; the code below added in the Apache configuration file (`httpd.conf`) tells Apache to redirect requests to directory `/opt/hpe/RedFishEventService`. You may want to better secure this configuration entry to suite your security policy.
3741

38-
3942
```xml
4043
Alias /RedfishEvents** "/opt/hpe/RedfishEventService"
4144
<Directory "/opt/hpe/RedfishEventService">
@@ -53,7 +56,6 @@ In the `/opt/hpe/RedFishEventService` directory of the Web Server, create the `E
5356

5457
Read the comments enclosed in `/*..*/` or following `//` to get a detailed explanation:
5558

56-
5759
```php
5860
<?php
5961
// Version 0.9999
@@ -104,11 +106,10 @@ Once the event receiver program is in place and Apache restarted, it waits for s
104106

105107
The exhaustive list of possible events to subscribe to is present at: `https://<ilo-IP>/redfish/v1/EventService/`
106108

107-
For testing and prototyping, the subscription can be done manually using the **[POSTMAN](https://www.getpostman.com/)** API development platform , PowerShell, or curl. In a production environment, I would recommend to use `ilorest` (former `hprest`) the [iLO RESTful Interface Tool](http://hpe.com/resttool/) or an application using the [best practices to crawl and parse remote managed nodes schemas](/blog/getting-started-with-ilo-restful-api-redfish-api-conformance).
109+
For testing and prototyping, the subscription can be done manually using the **[POSTMAN](https://www.getpostman.com/)** API development platform , PowerShell, or curl. In a production environment, I would recommend to use <a href="https://github.com/HewlettPackard/python-redfish-utility/releases/latest" target="_blank">iLOrest</a> (former `hprest`) the HPE iLO RESTful Interface Tool or an application using the <a href="https://developer.hpe.com/blog/getting-started-with-ilo-restful-api-redfish-api-conformance/" target="_blank">best practices to crawl and parse remote managed nodes schemas</a>.
108110

109111
Before posting the following payload toward your managed node at `https://<IP>/redfish/v1/EventService/EventSubscriptions/` you must edit and replace the `Destination` attribute with the `<IP>` address of the event receiver and its location. Optionally you can add or remove EventTypes:
110112

111-
112113
```json
113114
{
114115
"Destination": "https://<IP>/RedfishEvents/EventReceiver.php",
@@ -141,15 +142,14 @@ Moreover, the status message mentions as well in its `Location` header the locat
141142

142143
To avoid un-wanted network traffic or overloaded Redfish engine, HPE implemented an `Oem.Hpe` section containing attributes regulating subscriptions. In case a managed node continuously fails to post events at its destination, the subscription is deleted automatically after a certain amount of time (`DeliveryRetryAttempts * DeliveryRetryIntervalSeconds` seconds). Otherwise, a subscription has a infinite life time until it is deleted using a HTTPs `DELETE` request to it `Location` URI.
143144

144-
![](https://redfish-lab.sourceforge.io/media/redfish-wiki/event-subscription-service/Subscription.png)
145+
![](/img/subscription.png)
145146

146147
## Fake events
147148

148149
To test our event receiver PhP code, Redfish provides an URI in the managed node to simulate an event and send an alert to the subscribers.
149150

150151
POST the following JSON body to trigger a fake event in the managed node:
151152

152-
153153
```json
154154
{
155155
"EventType": "StatusChange",
@@ -165,7 +165,6 @@ POST the following JSON body to trigger a fake event in the managed node:
165165

166166
Check your Event Receiver, you should find an entry like the following in the `Redfish_events.txt` file:
167167

168-
169168
```json
170169
IP Address of Managed node: 192.168.1.111
171170
Host: 192.168.0.99
@@ -201,5 +200,6 @@ X_HP-CHRP-Service-Version: 1.0.3
201200

202201
## Conclusion
203202

204-
SNMP is still the preferred management protocol and may stay as such for a long time. However, modern alternatives like this Redfish Event Subscription exist for compute nodes and the upcoming [Swordfish](http://www.snia.org/forums/smi/swordfish). Swordfish is the extension of Redfish for storage devices from the [SNIA](http://www.snia.org/) proposing as well this Event Service in its Specification version 1.0.
203+
SNMP is still the preferred management protocol and may stay as such for a long time. However, modern alternatives like this Redfish Event Subscription exist for compute nodes and the upcoming [Swordfish](http://www.snia.org/forums/smi/swordfish). Swordfish is the extension of Redfish for storage devices from the <a href="http://www.snia.org/" target="_blank">SNIA</a> proposing as well this Event Service in its Specification version 1.0.
205204

205+
Don't forget to check out some of my other <a href="https://developer.hpe.com/search/?term=donze" target="_blank">blog posts</a> on the HPE Developer portal to learn more about Redfish tips and tricks.
79.6 KB
Loading

static/img/subscription.png

97.4 KB
Loading

0 commit comments

Comments
 (0)