dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
609 stars 279 forks source link

Fetch logs by GetIdracSelLogsREDFISH.py on old version of iDRAC get dif result #215

Closed kwangsing3 closed 2 years ago

kwangsing3 commented 2 years ago

Hi, my task is fetching system logs from dell server between serval version. now, I got 2 machine in system. idrac_lib

... 242 - It runs fine as expectation. ... 241 - it redirect me to different route and cause script throw error. Command

python3 GetIdracSelLogsREDFISH.py -ip 0.0.0.241  -u root -p pass > 1654744059550.xml

throw Error

Error: Dell fetch error: Error: Command failed: python3 GetIdracSelLogsREDFISH.py -ip 0.0.0.241  -u root -p pass > 1654744059550.xml
Traceback (most recent call last):
  File "GetIdracSelLogsREDFISH.py", line 130, in <module>
    get_SEL_logs()
  File "GetIdracSelLogsREDFISH.py", line 80, in get_SEL_logs
    for i in data['Members']:
KeyError: 'Members'

Follow the path in script and cURL , they return different results ("/redfish/v1/Managers/iDRAC.Embedded.1/LogServices/Sel/Entries")

242: (Works Fine)

{
...... ,
"Members": [],
}

241: (which redirect me to "/redfish/v1/Managers/iDRAC.Embedded.1/LogServices/Sel ") and cause Error.

{
"@odata.context":"/redfish/v1/$metadata#LogService.LogService",
"@odata.id":"/redfish/v1/Managers/iDRAC.Embedded.1/LogServices/Sel",
"@odata.type":"#LogService.v1_1_3.LogService",
"Actions":{"#LogService.ClearLog": ...
}

In Fact, There's temporarily solution nw, I found there's different path in doc. iDRAC 8/7 v2.40.40.40 Redfish API Reference Guide

I turn

/redfish/v1/Managers/iDRAC.Embedded.1/LogServices/Sel/Entries

into

/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Sel

then I got the same struct of result which both I need from them.

My conclusion is, maybe there're some route issues between old and new iDRAC version ? and did influence .py scripts .

Feel free to tell me if you need more details, and I'm willing to figure out if misunderstanding : )

texroemer commented 2 years ago

Hi @kwangsing3

Thanks for pointing out this issue with behavioral differences between iDRAC 7/8 and 9. I updated the script to support both iDRAC versions and new version has been uploaded to GitHub. Please try it out and let me know if you hit any issues.

Thanks Tex

kwangsing3 commented 2 years ago

Hi @kwangsing3

Thanks for pointing out this issue with behavioral differences between iDRAC 7/8 and 9. I updated the script to support both iDRAC versions and new version has been uploaded to GitHub. Please try it out and let me know if you hit any issues.

Thanks Tex

Hi, thanks for your help and my issues gone
Let me close this : )