Extracting Resource Allocation Data for Chargeback in a HP Virtual Server Environment for HP Integrity Servers
"va00np00","Intel(R) Itanium(R) 2 Processor","1500","1"
"va00np00","Intel(R) Itanium(R) 2 Processor","1500","2"
"va00np00","Intel(R) Itanium(R) 2 Processor","1500","0"
...
CMS #
The following is an example of a simple script that issues the three commands and processes the
output to count CPU cores in a complex:
CMS # cat cmplxcores.sh
for i in `mxquery -e "All nPartition Servers" | grep "^DeviceName"
| awk '{print $2}'`; do
printf "%s " $i
let CCPUS=0
for n in `mxquery -e "All nPartitions" | awk -v RS="" '{
printf "%s %s\n",$34,$12}' | grep $i | awk '{print $2}'`; do
let NCPUS=`mxreport -e "CPU - Servers" -x CSV |
grep $n | wc -l`
let CCPUS="$CCPUS + $NCPUS"
done
print $CCPUS
done
CMS #
This script produces the following output:
CMS # ./cmplxcores.sh
va00-cplx_USE4452HL6 8
CMS #
Memory
The mxreport “Inventory - Servers” command includes a line for every server, with a field in
the output for the amount of physical memory in that server. You can include the names of specific
physical servers on the command line. For example:
CMS # mxreport -e -n -S va01sv,va02cm "Inventory - Servers" -x CSV
Inventory - Servers
Associated systems: va01sv,va02cm
Report date and time: Tuesday, October 2, 2007 1:50:28 PM EDT
Inventory
"System Name","Product Type","Product Model","Serial Number","Asset
Tag","Memory Size (KB)","Operating System Name","Operating System
Vendor","Location","System Owner"
"va01sv","Server","ia64 hp server
rx4640","USE4452N2H","0001","33541676","HP-UX","HP","",""
"va02cm","Server","ia64 hp server
rx2600","US40576064","0002","8377064","HP-UX","HP","",""
CMS #
49