Configure a variable map
This example creates a variable map to an existing server.
- Idenitfy the server and assign it to the server variable.
set server [$AdminConfig getid /Cell:cellname/Node:nodename/Server:server2/]- Create an empty variable map for the server and assign it to the varMap variable.
set varMap [$AdminConfig create VariableMap $server {}]This example is to create a variable map. If your server already has an existing variable map, then you can use the following to get its configuration object:
set varMap [$AdminConfig getid /Cell:cellname/Node:nodename/Server:server2/VariableMap:/]- Set up variable map entry attributes.
In the following example, you create variable map entries DB2_INSTALL_ROOT and DB2_LIB_DIR. DB2_LIB_DIR is going to refer back to DB2_INSTALL_ROOT:
set nameattr1 [list symbolicName DB2_INSTALL_ROOT] set valattr1 [list value "/usr/local/db2/sqllib"] set nameattr2 [list symbolicName DB2_LIB_DIR] set valattr2 [list value "\${DB2_INSTALL_ROOT}/lib"] set attr1 [list $nameattr1 $valattr1] set attr2 [list $nameattr2 $valattr2] set attrs [list $attr1 $attr2]Example output:
{{symbolicName DB2_INSTALL_ROOT} {value /usr/local//db2/sqllib}} {{symbolicName DB2_LIB_DIR} {value {${DB2_INSTALL_ROOT}/lib}}}- Modify the entries attribute in the variable map to add the two new entries.
$AdminConfig modify $varMap [subst {{entries {$attrs}}}]- To view the variable map:
Example output:$showall $varMap
{entries {{{symbolicName DB2_INSTALL_ROOT} {value /usr/local/db2/sqllib}} {{symbolicName DB2_LIB_DIR} {value ${DB2_INSTALL_ROOT}/lib}}}}
- Save changes:
$AdminConfig save