6 Replies Latest reply on Mar 13, 2015 10:52 AM by Daniel Suen

    RestAPI access the Hardware Information under Live

    Daniel Suen

      After reading through documentation, it is not very clear to me if there is a way to access the hardware information (like CPU, clock speed, memory size) through the RestAPI under server automation. I checked the property dictionaries and still cannot find anything associated with it. Under "Hardware Information", there is a path and object property name, but not sure if they are relevant under the RestAPI context. Appreciate if someone has such experience point me to the right direction. Thanks.


      Daniel.

        • 1. Re: RestAPI access the Hardware Information under Live
          Bill Robinson

          it's loosely covered here:

          Asset examples - BMC Server Automation 8.5 - BMC Documentation

           

          w/ the blcli i can use the 'Get' but the URIs would be the same:

          blcli_execute Server getServerDBKeyByName blapp-1

          blcli_execute GenericObject getRestURI DBKey:SDeviceModelKeyImpl:2000000-2039149

          blcli_storeenv uri

          blcli_execute Get "${uri}/Assets/"

          -> what are the assets i can get from this server object ?

          blcli_execute Get "${uri}/Assets/SystemInfo/"

          -> 'Hardware Info' is actually called 'SystemInfo' internally, not to be confused w/ 'System Info' ...

          blcli_execute Get "${uri}/Assets/SystemInfo/Hardware/Processors/"

          -> list some CPUs

          blcli_execute Get "${uri}/Assets/SystemInfo/Hardware/Processors/cpu0/"

          -> bunch of stuff about that cpu

          blcli_execute Get "${uri}/Assets/SystemInfo/Hardware/Processors/cpu0/AssetAttributeValues/Model/"

          -> want the model # for example.

           

          you can do the same thing w/ WS w/ the same URIs.

          • 2. Re: RestAPI access the Hardware Information under Live
            Daniel Suen

            Thanks. I figure out how to get the hardware info and also the OS-related info. I use the right-click-properties to figure out the paths. However, one thing I am not sure. There is a section named "System Info" in the console, and underneath it, there are CPU information for instance. It looks to me that the info under this section is different (sometimes more details) from the stuff I saw in the hardware info section. For instance, in the "System Info", it says the type of CPU is "GenunieIntel Intel(R) Xeon(R) CPU E7 - 2860 @ 2.27GHz", while underneath the hardware info, it is Xeon E7-2860, and with some other attributes. I am just wondering if there is a way to retrieve the "System Info" stuff as the right-click-properties trick does not work in this section.

             

            Also, if I want to retrieve the complete profile of a given server, it seems that I have to make several REST calls (one for a section of the profile, like 'processors', 'physical memory devices', 'physical memory arrays', 'BIOS'). There is no way that I can do few calls to retrieve those, right? Or I have to use the query interface?

             

            Thanks.


            Daniel.

            • 3. Re: RestAPI access the Hardware Information under Live
              Bill Robinson

              -> 'Hardware Info' is actually called 'SystemInfo' internally, not to be confused w/ 'System Info' ...

               

              so 'System Info' is the node, not 'SystemInfo'...

              • 4. Re: RestAPI access the Hardware Information under Live
                Daniel Suen

                OK. Thanks.

                 

                I tried the RestAPI and notices that for some servers, when I make the request, it hangs....

                 

                GET /id/SystemObject/Server/808b9697-6dc4-4a36-947a-2e037f85842c/Assets/SystemInfo/Hardware/VideoCards/

                 

                while the same kind of request with different object ID returns OK. I checked in the console that the one that hangs does have such path and I can access it (no hanging) inside the console. Is there anything that I can do to troubleshoot such situation? Thanks.

                 

                Daniel.

                • 5. Re: RestAPI access the Hardware Information under Live
                  Daniel Suen

                  OK, I found that that server also locks up when accessed through the console. On the other hand, it is very weird that when accessing the same path like above, sometimes I get an attribute value and sometimes I don't. Do you know if this API is stable? For instance, for the above URL or similar, query one time I get memory attribute, and query another time I don't get that attribute. Does it do real-time querying the agents for these values?

                   

                  Daniel.

                  • 6. Re: RestAPI access the Hardware Information under Live
                    Daniel Suen

                    One instance is also interesting, where cpus where identified from cpu0 to cpu3 for a server. Query one time does give these four processors correctly, yet another time I got cpu1 to cpu4...that is very weird.

                     

                    Daniel.