Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to key Protocol when create subscription with rf_event_service.py #138

Open
FelixD999 opened this issue Feb 1, 2024 · 7 comments
Open

Comments

@FelixD999
Copy link

Hi,
As far as I know Destination and Protocol are necessary to create a subscription, but I don't know how to enter the value about Protocol when creating the subscription.
Not sure if the failure to send the command is related to missing necessary parameters.
fail

Attached the request body about creating Subscription via Redfish:
{
"Context": "Event_Sub",
"Destination": "https://192.168.0.110:4443",
"Protocol": "Redfish",
"EventFormatType": "Event",
"ResourceTypes": [
"EventService",
"Systems",
"AccountService",
"TelemetryService",
"Chassis",
"Managers",
"TaskService"
],
"RegistryPrefixes": [
"EventLog",
"IPMI",
"HttpStatus",
"SyncAgent",
"Security",
"Base",
"Task"
]
}

Thanks,
Felix

@mraineri
Copy link
Contributor

mraineri commented Feb 1, 2024

Right now the tool automatically puts in "Redfish" for you; it's not provided as an option.

This is where the payload is built for the subscription request:

It starts with just the provided destination and fills in Protocol to always be Redfish, then optionally fills in other properties based on whatever else is provided by the user.

If you add --debug to the script input, it'll produce a log file with HTTP traces to show exactly what is sent/received.

@mraineri
Copy link
Contributor

mraineri commented Feb 1, 2024

But at least from the error message on the console, it looks like either EventTypes isn't supported by the service or one of the values provided isn't supported.

@mraineri
Copy link
Contributor

mraineri commented Feb 1, 2024

It's also possible you're hitting an old bug from a few years ago where the tool was always sending "EventTypes" as part of the payload. Given your sample script input, you're clearly not specifying EventTypes.

Can you check your version of Tacklebox? The issue I'm thinking of was fixed in 1.2.9.

@FelixD999
Copy link
Author

FelixD999 commented Feb 2, 2024

Thanks for your help and answers!
I checked the version is the latest "3.2.3" and code also have be fixed but still have error message.
scripts__rf_event_service

@mraineri
Copy link
Contributor

mraineri commented Feb 9, 2024

Can you try with --debug and provide the .log file generated?

@FelixD999
Copy link
Author

I refer the --help info, but I'm not sure how to add --debug correctly, Could you help correct me?
debug

@mraineri
Copy link
Contributor

Are you sure you have the latest version of the tool? It looks like you're using an older version. With how you're invoking the tool, it will run from the installation and not from the source code you've checked out.

$ pip3 show redfish_utilities
Name: redfish-utilities
Version: 3.2.4
Summary: Redfish Utilities
Home-page: https://github.com/DMTF/Redfish-Tacklebox
Author: DMTF, https://www.dmtf.org/standards/feedback
Author-email: 
License: BSD 3-clause "New" or "Revised License"
Location: /usr/local/lib/python3.11/dist-packages
Requires: redfish, XlsxWriter
Required-by: 

$ rf_event_service.py --help
usage: rf_event_service.py [-h] --user USER --password PASSWORD --rhost RHOST [--debug] {info,subscribe,unsubscribe} ...

A tool to manage the event service on a Redfish service

positional arguments:
  {info,subscribe,unsubscribe}
    info                Displays information about the event service and subscriptions
    subscribe           Creates an event subscription to a specified URL
    unsubscribe         Deletes an event subscription

options:
  -h, --help            show this help message and exit
  --user USER, -u USER  The user name for authentication
  --password PASSWORD, -p PASSWORD
                        The password for authentication
  --rhost RHOST, -r RHOST
                        The address of the Redfish service (with scheme)
  --debug               Creates debug file showing HTTP traces and exceptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants