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

lenovo_add_alert_recipient.py Can't use extra args #369

Open
Molanito13 opened this issue Jul 22, 2024 · 12 comments
Open

lenovo_add_alert_recipient.py Can't use extra args #369

Molanito13 opened this issue Jul 22, 2024 · 12 comments

Comments

@Molanito13
Copy link

Hi, I'm trying to use the script but I can't make it work, when I add the extra parameters like --RecipientName for example:

python lenovo_add_alert_recipient.py -i 10.10.10.10 -u USERID -p PASSW0RD --RecipientName example --Address 10.10.10.10:514 --Enabledstate 1 --AlertType Syslog

It doesn't work, I only get the error: unrecognized arguments: --RecipientName example --Address 10.10.10.10:514 --Enabledstate 1

@wyyfly
Copy link

wyyfly commented Jul 23, 2024

Hi,Molanito,

Can you tell me the server information you are using? Include product name, fw version, and FFDC log.

@Molanito13
Copy link
Author

Molanito13 commented Jul 23, 2024 via email

@wyyfly
Copy link

wyyfly commented Jul 23, 2024

Hi,Molanito,
The Redfish API used is: "/redfish/v1/Managers/1/Oem/Lenovo/Recipients".

@Molanito13
Copy link
Author

Molanito13 commented Jul 23, 2024 via email

@wyyfly
Copy link

wyyfly commented Jul 23, 2024

The python environment I use looks the same as yours:
Python: 3.11.7
configparser: 7.0.0
argparse: 1.4.0

However, the result of my execution has not been able to reproduce your error.
lenovo_add_alert_recipient

Can you give us the full command you used? Is there any special format for the specified parameter values?

@Molanito13
Copy link
Author

Molanito13 commented Jul 23, 2024 via email

@wyyfly
Copy link

wyyfly commented Jul 24, 2024

I have written a debug script named “lenovo_add_alert_recipient_debug.py“.
lenovo_add_alert_recipient_debug.zip

Please put it in the same directory as "lenovo_add_alert_recipient.py" and execute it with the same parameters as before.
A "debug.log" file will be generated in the current execution directory. You can send this "debug.log" file to us.

The IP, user, and password information in the log file has been replaced with *** for privacy.

@wyyfly
Copy link

wyyfly commented Jul 24, 2024

As for the requirements of fw update mentioned below, we are investigating and will inform you of the results.

As an extra question if you can resolve it, is it possible to update
firmware like UEFI/BMC using Lenovo's repository? All I've found both in
scripts and documentation is a semi-manual update where you need to have
the file downloades by yourself beforehand

@wyyfly
Copy link

wyyfly commented Jul 25, 2024

After investigation and testing, the script "update_firmware.py" can specify lenovo's official website address without downloading img in advance. The following is an example:
fw_update

Please contact us if you have any further questions.

@Molanito13
Copy link
Author

Molanito13 commented Jul 25, 2024 via email

@Molanito13
Copy link
Author

Hi, I'm testing the debug script you sent me and it works completely fine.

I removed arguments on purpose and it gives me a different error output.

Non debug one
image

Debug one
image

The lenovo_add_alert_recipient.py used was the latest one in case it could be an older version, it just doesn't recognize the extra arguments. The debug one works completely fine, tested twice with different arguments.

Related to the update_firmware.py script, I've tested and I can download from the repo, however, I don't know how to know the --imageurl to use, because I want to automate it so it's up to date always without even having to check for the URI once in a while, can you get the latest URI of the firmware using a RedFish endpoint or another automated option?

@wyyfly
Copy link

wyyfly commented Jul 30, 2024

The version I am using is the latest one downloaded from here:
https://github.com/lenovo/python-redfish-lenovo/blob/master/examples/lenovo_add_alert_recipient.py

To automate getting the latest fw img, you can use the tool OneCli.Can download it from https://datacentersupport.lenovo.com/us/en

The following command can download the latest fw img:
OneCli.exe update acquire --includeid lnvgy_fw_xcc_esx328b-4.51_anyos_comp --scope latest --dir SR650V3LatestFW

The combination of the parameters "includeid" and "scope latest" will download the latest fw package when a new version is released, even if the old id is specified.

image

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