Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###################
- #Get Host, iLO, Blade Enc Information - return data to your #screenversion
- #Version 0.1
- #Platform: Powershell
- #2014-02-26
- # to run use .\script.ps1 ilohostname
- ###################
- param($snfi1)
- $targetiLO=$snfi1
- Write-Host "Our target iLO is: $targetiLO"
- #Creating the RemoteLookup Object to accept XML
- $rmlu=New-object System.XML.XMLDocument
- #Building the standard iLO URL to retrieve the XML data
- $iloURL=$("http://" + $targetiLO + "/xmldata?item=All")
- Write-Host "Our target XML is located here: "$iloURL
- #Trapping any errors that occur during lookup and exiting
- try
- {
- #Loading the XML data from the URL into our RemoteLookup object
- $rmlu.Load("$iloURL")
- #Outputting the details we're concerned with
- Write-Host "------------------------------------------------------------------------------------"
- Write-Host "Outputting Host Information"
- Write-Host "------------------------------------------------------------------------------------"
- Write-Host "Host Serial: "$rmlu.RIMP.HSI.SBSN
- Write-Host "Host Model: "$rmlu.RIMP.HSI.SPN
- Write-Host "------------------------------------------------------------------------------------"
- Write-Host "Here's iLO Data for $targetiLO"
- Write-Host "------------------------------------------------------------------------------------"
- Write-Host "Model: "$rmlu.RIMP.MP.PN
- Write-Host "Firmware: "$rmlu.RIMP.MP.FWRI $rmlu.RIMP.MP.BBLK
- Write-Host "Serial: "$rmlu.RIMP.MP.SN
- Write-Host "------------------------------------------------------------------------------------"
- if ($rmlu.RIMP.BLADESYSTEM.MANAGER.ENCL) {
- Write-Host "`Here's Chassis Data for "$rmlu.RIMP.BLADESYSTEM.MANAGER.ENCL
- Write-Host "------------------------------------------------------------------------------------"
- Write-Host "`ENC NAME: "$rmlu.RIMP.BLADESYSTEM.MANAGER.ENCL
- Write-Host "RACK: "$rmlu.RIMP.BLADESYSTEM.MANAGER.RACK
- Write-Host "BAY: "$rmlu.RIMP.BLADESYSTEM.BAY
- Write-Host "MANAGER TYPE: "$rmlu.RIMP.BLADESYSTEM.MANAGER.TYPE
- Write-Host "MGMT IP: "$rmlu.RIMP.BLADESYSTEM.MANAGER.MGMTIPADDR
- }
- }
- catch
- {
- if ($error[0].Exception -match "The remote name could not be resolved:")
- {
- Write-Error "Please check the URL, it seems invalid: "$iloURL
- exit 1;
- }
- else
- {
- Throw ("Oh No! Something went wrong! " + $error[0].Exception)
- exit 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement