HMC

 View Only
  • 1.  Is the "System Location" and "Description" field of HMC v10 accessible via CLI?

    Posted Mon November 28, 2022 09:25 AM

    Hello!

    I´ve added location info and a short description to each of my Power8 and Power9 systems in our v10 HMC, but when I access it on the CLI to gather information for our CMDB via "lssyscfg" these fields are not shown.

    Is there a way to get this fields via CLI or an API?


    "lssyscfg -r sys --header -F
    name,type_model,serial_num,ipaddr,ipaddr_secondary,sp_type,state,state_detail,detailed_state,sys_time....,curr_addr_broadcast_perf_policy,pend_addr_broadcast_perf_policy,avail_vtpm_lpars,uuid"



    Thanks in advance,

    With kind regards,

    Stephan Dietl



    ------------------------------
    Stephan Dietl
    ------------------------------


  • 2.  RE: Is the "System Location" and "Description" field of HMC v10 accessible via CLI?

    Posted Tue November 29, 2022 10:51 AM
    It varies a bit based on HMC version, but in general, open the HMC GUI, Select Resources->Systems, click on the desired system, select General Settings from the left hand menu bar and you should have updatable fields for Location and Description.

    Great idea to update those fields.  It really makes locating a server much easier in some cases.

    ------------------------------
    Vincent Greene
    IT Consultant
    Technology Services
    IBM
    Vincent.Greene@ibm.com


    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    ------------------------------



  • 3.  RE: Is the "System Location" and "Description" field of HMC v10 accessible via CLI?

    Posted Tue November 29, 2022 11:17 AM
    And now I see that I replied to the wrong question.

    I cannot find those fields in the CLI - lssyscfg is where I would expect to find them, same as you.

    They are available via the XML output of the  REST API in the Description and SystemLocation Elements of the ManagedSystem Element.

    ------------------------------
    Vincent Greene
    IT Consultant
    Technology Services
    IBM
    Vincent.Greene@ibm.com


    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    ------------------------------



  • 4.  RE: Is the "System Location" and "Description" field of HMC v10 accessible via CLI?

    Posted Mon December 12, 2022 10:35 AM

    Hello!

    Thanks for your @Vincent Greene and @Peter Hornung correct answers, I was able to pull it out via:

    export KEY_REST_API_LOGON=`curl -ks -c cookies.txt -i -X PUT -H "Content-Type: application/vnd.ibm.powervm.web+xml; type=LogonRequest" -H "Accept: application/vnd.ibm.powervm.web+xml; type=LogonResponse" -H "X-Audit-Memento: hmc_test" -d @secrets/login.xml https://HMC_IP:12443/rest/api/web/Logon|grep X-API|awk '{ print $3}'|cut -f 2 -d ">"|cut -f 1 -d "<"`​​

    and

    curl -ks -c cookies.txt -i -X GET -H "Content-Type: application/vnd.ibm.powervm.uom+xml; Type=ManagedSystem" -H "Accept: application/vnd.ibm.powervm.uom+xml; Type=ManagedSystem" -H "X-API-Session: $KEY_REST_API_LOGON" https://HMC_IP:12443/rest/api/uom/ManagedSystem|grep -E "SystemName|SystemLocation|Description ksv"|cut -f 2 -d ">"|cut -f 1 -d "<"|paste -d ";" - - -


    Thanks,

    With kind regards,

    Stephan Dietl



    ------------------------------
    Stephan Dietl
    ------------------------------



  • 5.  RE: Is the "System Location" and "Description" field of HMC v10 accessible via CLI?

    Posted Tue November 29, 2022 11:03 AM
    Hi Stephan,
    as mentioned in IBM ideas portal (formerly known as RFE) https://ibm-power-systems.ideas.ibm.com/ideas/HMC-I-325 there should be an opportunity to get these information using REST API. CLI does not provide this functionality. I'm not really sure about the HMC version this API request was implemented ....
    And one additional information:
    This description or location information are stored within the HMC itself, not within the Managed System ... so if you are using redundant HMCs you have to synchronize these information on both HMCs manually! 
    At least this is my latest state of information ;-) ....
    Regards
    Peter Hornung, SVA

    ------------------------------
    Peter Hornung
    ------------------------------