Copy the attached xml file to the /om/br/xml/cli directory and you can run the following complex commands:
I hope you don't want all properties and their values. That seems harder.
Works like a charm.
I am actually looking for all Server - Property combinations where a value has not been set. Any optimizations better than retrieving a list of servers and a list of properties and attempting to get a value for each combination?
Beyond writing additional complex commands, you pretty much got what you need to get at this information. Now, performance is another question, but here are the commands you could use:
- Property listAllServerProperties (gives a list of properties)
- Server listAllServers (gives a list of all servers)
- Server getPropertyValue (gives value for each server)
So you'd have to iterate through the servers and, for each server, iterate through the properties to get their values. Again, I have no idea what the performance would be like, but with some simple scripting you should be able to test it out.
And attached is set_empty.nsh. The script will find any server - property combinations that do not have a value and set a value of "".
This is useful for smart groups where you want a list of servers that do not have a value for a property. e.g. use PROD_STATUS for smart groups for Development, Testing, Production and "Unset". In the UI for the "Unset" smart group, make the smart group property be "Where PROD_STATUS equals (nothing)".
This uses the complex commands posted above.
set_empty.nsh 757 bytes
You want it faster? Do it in via the JLI.
Do we have blcli to list down the ServerGroup property?
do you mean the properties on the group object itself, or do you mean properties used in a smart group condition ?
Properties on the group object itself
there's a Group.getPropertyValueAsString. why do you need properties on the group ?