I am using 8.3sp2, and haven't seen any issues when I use this command in my scripts...
Using 8.3.03 - Have a script that runs listAllServers, saves to variable, then loops through the list to pull other server properties and writes to a file. The file ended up listing many servernames as blank. Not a big deal, was just curious if anyone else has seen this. Maybe there is a cleanup command missing somewhere...
Tried modifying the script to use HOST property and see how that matches up with the server name?
I pull HOST and FQ_HOST both are blank yet somehow it pulls other custom server properties for those hosts. I might rerun and convert name to id and drop that in the export as well to see if there is any correlation.
Here's the current script
FIELDS="HOST FQ_HOST BUILD_STATE OS ENVIRONMENT NETWORK_LOCATION PHYSICAL_LOCATION"
blcli_setoption authType BLSSO && blcli_setoption serviceProfileName blapp && blcli_setoption roleName BLAdmins && blcli_connect
blcli_execute Server listAllServers
for SERVER in $SERVER_LIST; do
for FIELD in $FIELDS; do
blcli_execute Server printPropertyValue $SERVER $FIELD
echo "$SINGLE_ENTRY" >> /C/temp/production_inventory_$DATE.csv
So the server name isn't blank, just some properties that shouldn't be blank are... I would modify the output to '$SERVER' so at least you know which of the servers in bladelogic are having some issues. Maybe you just need to update the server properties for those that have blank properties?
maybe there are eol or other control characters in your return that are causing a problem. try stripping those out w/ tr or something.