Monday, July 12, 2010

Checking warranty on 1000 HP servers


I have 1000+ HP servers to check Warranty on, and there is no real tool to
do this :-(



So, I found a script called findilos, which will list all hp serial numbers
by finding their ilo's.



But, serial numbers isn't enough, you also need their Product Number or
Product ID, and there is no way to script collecting this from the Ilo, and some
older ilo's don't tell you.



However, there is a UUID field, which has the first 6 digits of the product
ID, such as this product ID 435944R-421 would be displayed as 435944 in the
leading part of the UUID.



So, I modified findilos to also collect the UUID, and then had to write
scripts to turn this 6 digit number into a PID by crawling HP's pages with
PID's.



Then I had the serial and PID so I could poll HP's website to collect the
warranty data, phew !



So it goes like this



 



1) Use find ilos to scan subnet to file



               
sudo bash newfindilos 10.10.10.0/24 > my.ilos



2) 2 Use wget to get list of products and urls for product ID’s to file



               
wget -O- 'http://h40038.www4.hp.com/invtoday/it/inventory/category?categoryId=10026'
| grep categoryId |tr -d " " > hpurls



3) Make uniq list of server types found and use to get product id’s of these
server types to a file



               
grep ProLi ixn.ilos| cut -f5 -d"," | tr -d '"'  
| cut -f2 -d" " | sort | uniq | xargs 
| tr " " "|" | xargs -I z 
egrep '(z)' hpurls | grep -v bold | cut -d"\"" -f2 | xargs -I z wget -O- 'http://h40038.www4.hp.comz'
| grep '<tr><td height=20><b>'  | cut
-d"b" -f2 | tr -d "></"  > hp.pids



4) Make list of serials and productid’s (productnumbers) by finding
intersection of hp.pids and my.ilos and get warranty data



               
cat my.ilos | tr -d "\"" | sort -t"," -k6 -g | grep ProL | egrep -v
'N/A|\*' > my.ilos.srt



               
awk '{ print substr( $0, 0, 7 ) "," $0 }' hp.pids | sort | uniq >
hp.pids.srt



               
join -t "," -1 6 -2 1 my.ilos.srt hp.pids.srt | cut --output-delimiter="
" -d"," -f5,7 | xargs -Iz ./getwarrenty z

2 comments:

NBO said...

There is a tool
If you Install HP SIM (FREE) with
Insight Remote Support (try google it ) you will get info about warrenty and carepaq)

Desra said...

HP SIM's etc. all require an installed OS which is running HP agents AFAIK.

I don't see an option in Insight Remote Support to just query ILO's. I want to be able to catch powered off machines or machines running FreeBSD etc.

load testing