- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- ProLiant Servers (ML,DL,SL)
- >
- Re: Bug on iLo connect with POSH REST?
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
Forums
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
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
03-04-2024 02:54 AM - last edited on 03-07-2024 07:52 AM by support_s
03-04-2024 02:54 AM - last edited on 03-07-2024 07:52 AM by support_s
Hi,
not shure, if this is a Bug...
I am collecting Powerinformation from a couple of iLos in a 5 Minute Loop. I am using an AD-Account for this. The Loop runs 3 times without any Problems. With the 4th run, the iLos start with Connection-Issues.
Invoke-WebRequest : The remote server returned an error: (401) Unauthorized. At C:\scripts\iLo-Scripte\draft_iLo_REST_Powerconsumtion.ps1:19 char:20 + ... $session = Invoke-WebRequest -Uri "https://$ilo/redfish/v1/Sessions" ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
After this, it is not possible to connect with an AD-Account anymore. I have to Reset the iLo to make the AD-Login work again. Seems to be no Problem with an Local Account.
Is there any experience on this?
$ilos @("iLo1","iLo2",...)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$bodycred = @{
"UserName"= $ilocred.UserName
"Password"=$ilocred.GetNetworkCredential().Password
} | ConvertTo-Json
do{
Write-Host "Script starts/continuing collecting $(get-date) ..."
foreach($ilo in $ilos){
Write-Host "Collecting from $ilo..." -foregroundcolor Cyan
$session = Invoke-WebRequest -Uri "https://$ilo/redfish/v1/Sessions" -Method Post -Body $bodycred -ContentType "application/json"
-UseBasicParsing
$AuthHeaders = @{ "X-Auth-Token" = $Session.Headers.'X-Auth-Token' }
#Datacollection every 10 seconds from the last 5 Minnutes
$r = @()
$r = Invoke-WebRequest -Uri "https://$ilo/redfish/v1/chassis/1/power/fastpowermeter" -Method get -Headers $AuthHeaders -
ContentType "application/json"
$powerreading = (($r.Content | ConvertFrom-Json).powerdetail) | Select-Object -Last 30 | select
Time,Average,CpuWatts,DimmWatts,Minimum,Peak
$powerreading | Export-Csv c:\Temp\$($ilo)Powerreading.csv -Append -Delimiter "," -NoTypeInformation
}
Write-Host "Script sleeping 5 Minutes $(get-date)..."
sleep 300
}until ($i -eq "2")
POSH-Version: 5.1
HPEiLOCmdlets: 4.2.0.0
ILO-Version: iLo 5 v3.01
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 03:55 AM
03-04-2024 03:55 AM
Query: Bug on iLo connect with POSH REST?
System recommended content:
1. HPE iLO 6 1.57 User Guide | Directory authentication and authorization settings in iLO
2. HPE iLO 5 3.02 User Guide | Directory authentication and authorization settings in iLO
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
03-04-2024 06:20 AM
03-04-2024 06:20 AM
Re: Bug on iLo connect with POSH REST?
Hello,
Please refer to the RESTful Interface Tool User Guide and see if it helps.
Regards,
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[All opinions expressed here 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
03-06-2024 03:40 AM
03-06-2024 03:40 AM
Re: Bug on iLo connect with POSH REST?
Please try installing latest HPEiLOCmdlets and check
https://support.hpe.com/connect/s/softwaredetails?softwareId=MTX_f775bbe394154fbda123632379&language=en_US&tab=revisionHistory
[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
03-07-2024 03:56 AM
03-07-2024 03:56 AM
Re: Bug on iLo connect with POSH REST?
Please update
[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
03-11-2024 12:52 AM
03-11-2024 12:52 AM
Re: Bug on iLo connect with POSH REST?
I am using REST for Connecting to the iLo's. So using the newest iLo-Cmdlets isn't a helpful solution for this specific issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 04:16 AM - edited 12-20-2024 04:17 AM
12-20-2024 04:16 AM - edited 12-20-2024 04:17 AM
SolutionHi,
I'm not saying this is your problem, but as with all REStful interfaces, it is best practise to disconnect the session after you're done. Otherwise you run the risk of reaching the session limit on the iLO. Sessions expire after 30 mins by default, so its unlikely in your case.
However, why not try either of the following to see if your code becomes more robust?
- don't reconnect to a new session each time - an initial session created before the loop will stay active, as long as you make a request before the 30 minute expiry.
- disconnect the session each time following your query.
I'm an HPE employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]