IBM Computer Hardware Computer Hardware User Manual


 
Hardware Management Console (HMC) Case Configuration Study for LPAR Management 33
Comparing profile values with current settings
If you perform a dynamic LPAR operation and you want to make this change
permanent, you have to do maintenance on the appropriate profile. Otherwise,
after the next shutdown and power on of the LPAR, the partition will have the old
properties and this might not be desired.
The script in Example 15 compares minimum, desired, and maximum values
regarding CPU and memory of a the profiles with the current settings. You can
use it to monitor these settings.
In Example 15, hmc1 and hmc2 are monitored. To use this script, you have to
change hmc1 and hmc2 with the names of your HMCs. The amount of HMCs is
variable as long as they are in quotation marks and comma separated.
Place this script on a partition that has ssh access with a special user to every
HMCs you want to monitor. In the example, we used the user hscroot. It is
necessary that you can get access without the need to type in the password. To
do so, please refer to “Enabling ssh access to HMC” on page 13.
Example 15 Monitoring sample script
#!/usr/bin/perl
$fmem = "curr_min_mem,curr_mem,curr_max_mem,lpar_name"; # define output fields
$fproc = "curr_min_procs,curr_procs,curr_max_procs,lpar_name";
$flds =
"min_mem,desired_mem,max_mem,min_procs,desired_procs,max_procs,min_mem,lpar_nam
e";
for $hmc ("hmc1", "hmc2") { # for all my HMC to check
$syscfg = "ssh hscroot\@$hmc lssyscfg -r "; # command to get
HMC-Sys-Info
@ceclist = split(/\n/, `$syscfg sys -F name`); # get names of CECs
for $cec (@ceclist) { # for every cec in list
$hwres = "ssh hscroot\@$hmc lshwres -m $cec -r ";# cmd to get current value
@lparlist = split(/\n/, `$syscfg lpar -m $cec -F name`);# read lpars for
curr cec
for $lpar (@lparlist) { # read the values for lpar
($p->{min_mem}, $p->{des_mem}, $p->{max_mem},
$p->{min_procs}, $p->{des_procs}, $p->{max_procs}) = split(/,/,
`$syscfg prof -m $cec --filter lpar_names=$lpar -F $flds`);
($a->{min_mem}, $a->{des_mem}, $a->{max_mem}) = split(/,/,
`$hwres mem --level lpar --filter lpar_names=$lpar -F $fmem`);
($a->{min_procs}, $a->{des_procs}, $a->{max_procs}) = split(/,/,
`$hwres proc --level lpar --filter lpar_names=$lpar -F $fproc`);
for $field (keys %$p) { # output data and any
difference
printf("\n%8s %8s %12s %12s: prof=%8d ", $hmc, $cec, $lpar, $field,
$p->{$field});
printf("curr=%8d", $a->{$field}) unless ($p->{$field} == $a->{$field});