Extracting Resource Allocation Data for Chargeback in a HP Virtual Server Environment for HP Integrity Servers
The mxreport “Inventory - Servers” command also provides the same information about
partitions of a complex physical server. To find the total memory for a complex, the amount in each
partition must be added together. The following example script uses the mxquery “All
nPartition Servers”, mxquery “All nPartitions” and mxreport “Inventory –
Servers” commands to report the amount of memory for complexes in the environment. For
example:
CMS # cat ./cmplxmem.sh
for i in `mxquery -e "All nPartition Servers" | grep "^DeviceName"
| awk '{print $2}'`; do
printf "%s " $i
let CMEM=0
for n in `mxquery -e "All nPartitions" | awk -v RS="" '{
printf "%s %s\n",$34,$12}' | grep $i | awk '{print $2}'`; do
let NMEM=`mxreport -e -n -S $n "Inventory -
Servers" -x CSV | sed 's/\"//g' | grep "^$n" | awk -v FS=","
'{print $6}'`
let CMEM="$CMEM + $NMEM"
done
print $CMEM
done
CMS #
This procedure produces the following output:
CMS # ./cmplxmem.sh
va00-cplx_USE4452HL6 33413528
50