Wednesday, June 12, 2013

Reset HP ILO using SSH

There are times when your HP ILO (Integrated Lights-Out) web interface stop responding, and you need to reset it to get it working again. You can use SSH session to do the reset. 

This will not reset the server, just the ILO session.

1) open up an SSH session (you can use PuTTy) to your ILO (using the same IP as web interface) and login
2) once in, type "cd /map1" without the quotes, then press ENTER
3) type "reset" without the quotes, then press ENTER again
4) wait for about a minute, then try to login to your web interface again.

It should be something like this. 




User:######### logged-in to ##############
iLO 2 Standard Blade Edition 2.05 at 13:38:05 Dec 16 2010
Server Name: ###################
Server Power: On 
</>hpiLO-> cd /map1 
status=0
status_tag=COMMAND COMPLETED
/map1 
</map1>hpiLO-> reset 
status=0
status_tag=COMMAND COMPLETED 
Resetting iLO. 
CLI session stopped

Wednesday, June 5, 2013

powershell script to get number of CPU and Memory

takes input list of servers from C:\servers.txt and output the result to C:\ram-cpu.csv

make sure your powershell/powerCLI has admin rights


get-wmiobject Win32_ComputerSystem -computer (gc C:\servers.txt) | select Name,@{name="TotalPhysicalMemory(MB)";expression={($_.TotalPhysicalMemory/1mb).tostring("N0")}},NumberOfProcessors | export-csv C:\ram-cpu.csv

Get logical disk layout from OS level (windows)

run this in powerCLI / powershell. make sure you have admin rights (elevated for the powerCLI/powershell)

it takes list of servers from c:\servers.txt and output the result to c:\Disk-GB.csv

gwmi -query "SELECT SystemName,Caption,VolumeName,Size,Freespace FROM win32_logicaldisk WHERE DriveType=3" -computer (gc c:\servers.txt) | Select-Object SystemName,Caption,VolumeName,@{Name="Size(GB)"; Expression={"{0:N2}" -f ($_.Size/1GB)}},@{Name="Freespace(GB)"; Expression={"{0:N2}" -f ($_.Freespace/1GB)}}, @{n="% Free";e={"{0:P2}" -f ([long]$_.FreeSpace/[long]$_.Size)}} | sort "Systemname","caption" | export-csv c:\Disk-GB.csv