Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

p5 system name (not LPAR) finding from AIX command line

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
PL
is there any way to get (from AIX command line) p5 system name where LPAR is created on? (not using HMC, CSM...)

I am able to find HMC address using "/usr/sbin/rsct/bin/lsrsrc IBM.ManagementServer" but have no idea how to find P5 system name from AIX command line.
 
You have to setup the ssh id and then use this script:

Code:
#!/usr/bin/ksh

PROGNAME=${0##*/}

HMCUSER="hscroot"       # User on HMC with super admin privilege
HMC="p5hmc"             # TCP/IP host name of HMC

function Die
{
  print -u2 "$PROGNAME: $*"
  exit 1
}

function GetManagedSystem
{
  typeset LPAR="$*" TESTLPAR= TSYSTEM=
  integer i
  ssh $HMCUSER@$HMC lssyscfg -r sys -F name |
  while read TSYSTEM
  do
    SYSTEM[${#SYSTEM[*]}]="$TSYSTEM"
  done
  (( i = 0 ))
  while (( i < ${#SYSTEM[*]} )); do
    ssh $HMCUSER@$HMC lssyscfg -r lpar -m \"${SYSTEM[i]}\" -F "lpar_id name" |
    while read TESTLPAR
    do
      if [[ $TESTLPAR = $LPAR ]]
      then
        echo "${SYSTEM[i]}"
        return
      fi
    done
    (( i += 1 ))
  done
  echo ""
}

LPAR=$(uname -L)        # ID and name of this partition

# Get name of managed system to which this LPAR belongs
SYSTEM="$(GetManagedSystem "$LPAR")"
[[ $SYSTEM != "" ]] || Die "not able to determine managed system"

echo $SYSTEM

Regards,
Khalid
 
By p5 system name - do you mean the frame that the lpar is on? or do you mean the lpar name?

If you mean the lpar name, then this should get you what you need:

lsrsrc IBM.LPAR

Otherwise I think you will have to use the HMC to get the info you are seeking.
 
I mean the frame/box that the lpar is on...

I would like to know if it is possible to check it from the AIX if I have no HMC connected to the system at the moment.
 
Then i think what hfaix would be the only thing you can get! prtconf (System Model, Machine Serial Number) but i don't think that you will be able to get the Machine Name as this will have to go thru HMC! I don't think that the LPAR is aware of that!

Regards,
Khalid
 
sbrews when i tried your command, i couldn't get the IBM.LPAR in there!?! is there any thing that i should do before that?
 
khalidaaa


you didnt drop any letters from the command did you?

lsrsrc IBM.LPAR

works on all of my systems.
 
Oh i'm sorry! i think i was trying lssrc IBM.LPAR!

sorry my mistake!

Regards,
Khalid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top