Dynamic Groups

You can create dynamic groups of hosts based on a select  (SQL-like) string. This select string is used to search the hosts database to dynamically determine the list of hosts in the group.   For example, you can define a query that runs a command on all hosts whose names begin with the same three characters, or all hosts containing a certain type of network card.

Type the select string in the SELECT Query field. This is the select string that is used to dynamically determine which  nodes belong to this group. The syntax for this select string is determined by the type of node database you are working with (as indicated in the Query syntax box on this tab). If your node database is a file type, use normal SQL syntax.  If it is of rmc type, use the syntax described in the IBM RSCT for AIX 5L: Administration Guide.

You can find more detailed help on the following elements of this window:


Browse Groups...

Displays a selection list of previously defined dynamic group definitions.  Select a group from the list to work with.


Browse Hosts...

Displays a list of hosts in the CSM domain that satisfy the query specified in the "Select query" field.  This list can change over time, as different hosts satisfy the query.  The list of hosts is not saved with the dynamic group definition, but is generated each time a command is run using this dynamic group definition.


Save Group

Select this button to save your changes to the current dynamic group definition.  The Save Group button is not available until you specify a group name and a SELECT statement.  Saving a group does not cause a command specification to be run on any host.  After saving a group, you can return to the General tab and select that group using the Browse button.


Delete Group

Select this button to delete the selected dynamic group definition.  You will no longer be able to select the deleted group for running distributed commands.


Group name

Displays the name of the selected group.  When creating a new dynamic group definition, enter the group's name here.


SELECT query

SELECT Query - This is the select string that is used to dynamically determine which nodes belong to this group. The syntax for this select string is determined by the type of node database you are working with (as indicated in the Query syntax box on this panel).  If your node database is of type file, normal SQL syntax is used.  If it is of type rmc, the syntax is described in the Using Expressions chapter in the IBM Cluster Systems Management for AIX Administration Guide.

Dynamic Group Usage Examples

You can write your own SQL queries to determine specific dynamic grouping criteria. By specifying the resource attribute in
the SQL query, you can create a group on which a command can be run. These attributes are the node definitions in the IBM
Cluster System Management database. Only persistent attributes can be used in a SELECT Query.

Discovering Attributes Available for Queries

To list all persistent attributes for resource IBM.ManagedNode, type the following command at the command line:

     lsrsrcdef -t -a p IBM.ManagedNode |  awk '{print $1}' | xargs -n3

The following output displays:
 
Resource  program_name Hostname
Macaddr  HWType HWModel
 HWSerialNum  LParID  ConsolePortNum
ConsoleServerName HWControlPoint  SvcProcName
 OSType  OSVersion OSDistribution
OSKernel   InstallDiskType InstallDisk
InstallMethod  UniversalId  ConsoleMethod
ConsoleServerNumber PowerMethod

To list all available attributes of managed nodes, type the following command at the command line. Only persistent attributes can be used in creating a SQL query to determine a dynamic group.

     lsnode -Al

Output similar to the following displays:

     Hostname = endive.austin.ibm.com

     OSVersion =

     UniversalId = 158933068
     .
     .
     .
     ConfigChanged = 0
     Status = 1
     OST

To list dynamic attributes that belong to the IBM.ManagedNode object, type the following command at the command line.

     lsrsrc -a d IBM.ManagedNode

Output similar to the following displays:

     Resource Dynamic Attributes for: IBM.ManagedNode

     resource 1:

     PowerStatus = 127

     Status = 1

     ConfigChanged = 0

Examples of Dynamic Grouping SQL Queries Usage

To list the names of all the nodes types such as host name c54 and exclude c54n01 host names, type the following in the SELECT Query text area in the GUI:

     Hostname like 'c54%' && Hostname != 'c54n01.ppd.pok.ibm.com'

To list the names of all the node types with a special power control, type the following in the SELECT Query text area in the GUI:

     PowerMethod == 'netfinity'

To list all node names with the operating system type linux, type the following in the SELECT Query text area in the GUI:

     OSType like 'Linux%'

The OSType attribute is defined during installation and is not a required attribute. If you did define the OSType attribute during the node installation, the above examples could be useful.

To list all node names 'soft' or that have PowerMethod equal to 0, type:

     Hostname like 'soft%' || PowerMethod == '0'

For more detailed query and command syntax, see the CSM Administration Guide, Chapter 3: Using Expressions, and the CSM Technical Reference.



Query syntax

Shows the  version of query syntax that is being used.  Currently, the only possible value is "rmc,"  indicating that rmc syntax is used, rather than SQL syntax.