以下是基于Python的RESTful库客户端(由HP https://developer.hpe.com/platform/ilo-restful-api/home推荐),该客户端使用Redfish REST API(https://github.com/HewlettPackard/python-ilorest-library)连接到基于ProLiant DL360 Gen10的硬件的远程HPE iLO5服务器

#! /usr/bin/python
import redfish

iLO_host = "https://xx.xx.xx.xx"
username = "admin"
password = "xxxxxx"

# Create a REST object
REST_OBJ = redfish.redfish_client(base_url=iLO_host,username=username, password=password, default_prefix='/redfish/v1')

# Login into the server and create a session
REST_OBJ.login(auth="session")

# HTTP GET request
response = REST_OBJ.get("/redfish/v1/systems/1", None)

print response

REST_OBJ.logout()


创建REST对象时出现RetriesExhaustedError。但是,我可以从运行此脚本的VM(RHEL7.4)成功地对服务器进行SSH。身份验证详细信息已正确给出。我验证了在“ iLO安全性-访问”设置中启用了Web服务器(端口443和80)。另外,在我的VM框中,防火墙服务已停止并且IPTables已刷新。但是仍然无法建立连接。我还能尝试其他什么可能性?

最佳答案

我找到了根本原因。问题在于通过Python代码完成SSL证书验证。
在运行代码解决问题之前,可以通过设置环境变量PYTHONHTTPSVERIFY = 0来关闭此功能。

10-06 02:07