-
1. Re: Using blquery to get Machine Summary Model information.
Jim Wilson Jun 13, 2016 8:13 AM (in response to Stephen Sweeney)Discussion successfully moved from BladeLogic to Server Automation
-
2. Re: Using blquery to get Machine Summary Model information.
Yanick Girouard Jun 13, 2016 9:04 AM (in response to Stephen Sweeney)For which OS/Platform(s) ?
-
3. Re: Using blquery to get Machine Summary Model information.
Bill RobinsonJun 13, 2016 12:23 PM (in response to Stephen Sweeney)
Use the blcli Get command or a rest query to pull the data off the hardware/server info object on the server.
-
4. Re: Using blquery to get Machine Summary Model information.
Yanick Girouard Jun 13, 2016 12:39 PM (in response to Bill Robinson)Would you care to give us an example of how you can get the hardware info of a specific server using the get command ?
-
5. Re: Using blquery to get Machine Summary Model information.
Bill RobinsonJun 15, 2016 8:25 AM (in response to Yanick Girouard)
2 of 2 people found this helpfulthere's some info here, but i'll admit it's not that intuitive: Using BMC Server Automation - RESTful Web Services - BMC Server Automation 8.6 - BMC Documentation
so:
blcli_execute Server getServerDBKeyByName blapp88-1.local
blcli_storeenv serverKey
blcli_execute GenericObject getRESTfulURI ${serverKey}
blcli_storeenv serverURI
blcli_execute Get "${serverURI}/"
blcli_storeenv resp1
echo "${resp1}" | xmllint --format -
so that lists all the 'stuff' you can get from the server. if you look through the xml (i'm using xmllint to format the output because it was handy). so you want an asset:
Asset examples - BMC Server Automation 8.6 - BMC Documentation
so
blcli_execute Get "${serverURI}/Assets/"
blcli_storeenv resp2
echo "${resp2}" | xmllint --format -
(i'm not putting in the output here because it's too long)
lists all the assets (but not the properties and other stuff that the first query did).
what's a little confusing here is that the 'SystemInfo' asset is 'Hardware Information' in live browse. 'System Info' (w/ a space) is 'SystemInfo' in live browse.
so now i can go down another level w/ the 'systeminfo' uri from resp2:
blcli_execute Get "${serverURI}/Assets/SystemInfo"
blcli_storeenv resp3
echo "${resp3}" | xmllint --format -
so you wanted 'Model' right ?
so looking in the output of resp3 you should see the uri for that:
echo "${resp3}" | xmllint --format - | grep Model
<AssetAttributeValue name="Model" type="String" value="VMware Virtual Platform" uri="/id/SystemObject/Server/a279b6b7-c453-49fb-bf10-b1c6b6e0fb0a/Assets/SystemInfo/System/AssetAttributeValues/Model"/>
so you can get just that entry w/ the below or just process the /SystemInfo output.
blcli_execute Get "${serverURI}/Assets/SystemInfo/System/AssetAttributeValues/Model/"
blcli_storeenv resp4
echo "${resp4}" | xmllint --format -
which gives you:
<?xml version="1.0" encoding="UTF-8"?>
<RESTXMLResponse>
<AssetAttributeValueResponse>
<AssetAttributeValue>
<AssetAttributeValue name="Model" type="String" value="VMware Virtual Platform" uri="/id/SystemObject/Server/a279b6b7-c453-49fb-bf10-b1c6b6e0fb0a/Assets/SystemInfo/System/AssetAttributeValues/Model"/>
</AssetAttributeValue>
</AssetAttributeValueResponse>
</RESTXMLResponse>
and you can parse the xml and pull the 'value' tag out.
-
6. Re: Using blquery to get Machine Summary Model information.
Stephen Sweeney Jun 16, 2016 6:55 AM (in response to Yanick Girouard)In this case it would be Linux 5,6,7 AIX 6, 7 and Solaris 10, 11
But really, that model entry is available for all the different OS's... Even if it is blank.
Thanks Steve
-
7. Re: Using blquery to get Machine Summary Model information.
Stephen Sweeney Jun 16, 2016 6:57 AM (in response to Bill Robinson)1 of 1 people found this helpfulThanks VERY much Bill... I will give that a try and see how I make out.
Steve
-
8. Re: Using blquery to get Machine Summary Model information.
Yanick Girouard Jun 17, 2016 10:01 AM (in response to Stephen Sweeney)That's awesome Bill, thanks a lot for the example !