DMTF / Redfishtool

A Python34 program that implements a command line tool for accessing the Redfish API.
Other
224 stars 68 forks source link

Can redfishtool replace ipmitool watchdog functionality? #98

Closed levin23 closed 2 months ago

levin23 commented 2 years ago

I'm on a Dell. I see the setting in /redfish/v1/Systems/System.Embedded.1, but I can't seem to get a POST command to work.

levin23 commented 2 years ago

Actually, I was able to enable with a Patch command:


$ redfishtool -v -r <ip> -u <user> -p <password> raw PATCH -d '{"HostWatchdogTimer": {
    "FunctionEnabled": true,
    "Status": {
        "State": "Enabled"
    },
    "TimeoutAction": "None"
}}' /redfish/v1/Systems/System.Embedded.1
levin23 commented 2 years ago

It seems like redfish is touted as the replacement for ipmi. Is there any way to get the other watchdog functionalities that ipmitool provides?

$ ipmitool mc watchdog help
usage: watchdog <command>:
   get    :  Get Current Watchdog settings
   reset  :  Restart Watchdog timer based on most recent settings
   off    :  Shut off a running Watchdog timer
$ ipmitool mc watchdog get
Watchdog Timer Use:     SMS/OS (0xc4)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      480 sec
Present Countdown:      476 sec

I guess specifically, the info that the get subcommand above gives and the reset subcommand?

mraineri commented 2 years ago

Actually, I was able to enable with a Patch command:

$ redfishtool -v -r <ip> -u <user> -p <password> raw PATCH -d '{"HostWatchdogTimer": {
    "FunctionEnabled": true,
    "Status": {
        "State": "Enabled"
    },
    "TimeoutAction": "None"
}}' /redfish/v1/Systems/System.Embedded.1

Yes, this is the correct way to set those properties. POST is used to perform actions and to create new resources, whereas PATCH is for modifying an existing resource.

It seems like redfish is touted as the replacement for ipmi. Is there any way to get the other watchdog functionalities that ipmitool provides?

$ ipmitool mc watchdog help
usage: watchdog <command>:
   get    :  Get Current Watchdog settings
   reset  :  Restart Watchdog timer based on most recent settings
   off    :  Shut off a running Watchdog timer
$ ipmitool mc watchdog get
Watchdog Timer Use:     SMS/OS (0xc4)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      480 sec
Present Countdown:      476 sec

I guess specifically, the info that the get subcommand above gives and the reset subcommand?

The functionality brought into Redfish was limited to what users expect from an external management interface. In terms of controlling the timers, usage, and petting functionality, the thought to date has been this is managed via internal controls the OS would use to manage these things. If there's a strong need to have identical functionality, we'd had to discuss this further, but to date the only items that have been seen as in scope for Redfish have been the enable/disable control, warning action, timeout action, and status reporting of the watchdog.

levin23 commented 2 years ago

Thanks for responding. So are there different timers? When I change the timeout action with the PATCH, it doesn't seem to affect whatever ipmitool is looking at. ipmitool still reports "No action".

$ redfishtool -v -r <ip> -u <user> -p <password> raw PATCH -d '{"HostWatchdogTimer": {
        "FunctionEnabled": true,
        "Status": {
            "State": "Enabled"
        },
        "TimeoutAction": "ResetSystem"
    }}' /redfish/v1/Systems/System.Embedded.1

... # printed the whole Systems patch

$ ipmitool mc watchdog get
Watchdog Timer Use:     SMS/OS (0xc4)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      480 sec
Present Countdown:      473 sec
$ redfishtool -v -r <ip> -u <user> -p <password> raw GET /redfish/v1/Systems/System.Embedded.1 | grep Watchdog -A 6
    "HostWatchdogTimer": {
        "FunctionEnabled": true,
        "Status": {
            "State": "Enabled"
        },
        "TimeoutAction": "ResetSystem"
    },
mraineri commented 2 years ago

It's entirely possible some implementations map things to different timers underneath the covers. I would generally expect implementations that have a lot of IPMI history would map the two together, but that isn't a requirement.

mraineri commented 2 months ago

Closing; currently the Redfish model does not expose lower timing values or "pet" functionality like IPMI does. If further requests are needed, this would need to be requested in DMTF to extend the model.