- Community Home
- >
- Software
- >
- HPE OneView
- >
- REST API retrieve iLO thermal data
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 05:05 AM - last edited on 11-27-2022 05:07 PM by support_s
11-21-2022 05:05 AM - last edited on 11-27-2022 05:07 PM by support_s
I'm trying to find the correct REST API call to retrieve the thermal data from iLOs. I can get it via the redfish API, but would rather like to see if I can get it directly from OneView. Using Redfish API:
i=1
TMP=$(mktemp)
for SERVER in my-server-r{1..2}-n{1..12}.myorg.com; do
echo "Getting thermal data from ${SERVER}"
UUID=$(jq -r '.members[] | select(.serverName=="'${SERVER}'") | "\'(.uuid)"' ${HARDW}
read iLOSSO iLOAuth <<< $(curl --insecure --silent --header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" --request GET ${OneView}/rest/server-hardware/${UUID}/remoteConsoleUrl | \
jq -r '.remoteConsoleUrl' | sed -e 's|hplocons|https' -e 's|addr=||' -e 's|^\(.*\)&sessionkey=\(.*\)$|\1 \2')
curl --insecure --silent --output thermal${i} --header "X-Auth-Token: ${iLOAuth}" --request GET ${iLOSSO}/redfish/v1/chassis/1/thermal
jq '. + { "serverName": "'${SERVER}'" }' thermal${i} > ${TMP}
cat ${TMP} > thermal${i}
((i++))
done
#
((i--))
j=${i}
THERMAL=thermal
CMD=""
for (( i=1; i<=${j}; i++ )); do
CMD="${CMD} ${THERMAL}${i}"
done
cat $(echo "${CMD}") > ${THERMAL}
/bin/rm ${THERMAL}? ${THERMAL}?? ${TMP}
#
jq -r '.serverName as $name | .Temperatures[] | { "serverName": $name,"Name":.name,"PhysicalContext":.PhysicalContext,"ReadingCelsius":.ReadingCelsius }' ${THERMAL}
If anyone has insights on how to retrieve from OneView, I'd love to hear it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 06:07 AM
11-21-2022 06:07 AM
Query: REST API retrieve iLO thermal data
System recommended content:
Please click on "Thumbs Up/Kudo" icon to give a "Kudo".
Thank you for being a HPE valuable community member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 07:16 AM
11-21-2022 07:16 AM
Re: Query: REST API retrieve iLO thermal data
I have no idea whom posted that alert. It had nothing to do with my question. I gave a redfish example of how I retrieve iLO thermal data - not ethernet interfaces. And I asked how to get the information through the OneView REST API and not using iLO Redfish API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 12:25 AM
11-24-2022 12:25 AM
Re: REST API retrieve iLO thermal data
Establish a session with oneview using REST client.
Add below headers.
X-API-Version - 3200 (Based on OV Version)
Content Type - application/json
Add below content to Body:
{
"userName":"Administrator",
"password":"Password"
}
Note: use the correct credentials.
Use the Method as POST and URL : POST: https://<Appliance IP>/rest/login-sessions
Response should be 200 OK.
You will get a session ID under response.
Use the session ID and another header as below.
Auth
<Session ID>
Then use the below command to retrieve the temperature of the server.
https:///rest/server-hardware//utilization?fields=AmbientTemperature&view=hour
This will retrieve the Ambient Temperature of the server per hour.
You can also change the view=day.
The output looks like this.
{
"refreshTaskUri": null,
"uri": "/rest/server-hardware/",
"resolution": 86400000,
"sliceStartTime": "2022-11-16T00:00:00.000Z",
"sliceEndTime": "2022-11-25T00:00:00.000Z",
"newestSampleTime": "2022-11-24T07:40:00.000Z",
"oldestSampleTime": "2022-11-16T03:45:00.000Z",
"isFresh": true,
"metricList": [{
"metricName": "AmbientTemperature",
"metricSamples": [
[1669248000000, 22],
[1669161600000, 21],
[1669075200000, 21],
[1668988800000, 16],
[1668902400000, 19],
[1668816000000, 22],
[1668729600000, 18],
[1668643200000, 17],
[1668556800000, 20]
],
"metricCapacity": 35
}]
}
You can also try : https:///rest/server-hardware//environmentalConfiguration
But this will not give you each and every sensor temperature as we see in ILO REST.
Hope this helps.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 03:42 AM - edited 11-28-2022 03:43 AM
11-28-2022 03:42 AM - edited 11-28-2022 03:43 AM
SolutionThanks for that. However, it only gives the inlet ambient temperature. That only tells me how warm the air is going in to the server. Also, there is an error in the documentation: OneView REST API Reference 4200 . It shows using serial number:
GET https://{appl}/rest/server-hardware/USE7335NW3/utilization
It needs to the the UUID. I think the answer appears to be that OneView does not pull this temperature data back.
Thanks!