RG017 RES Wisdom – Tips & Tricks
Updated feb 10th – Annotations in red below
An article on all the neat stuff you can do behind the scenes with RES Wisdom has been long overdue. This collection of tips and tricks for RES Wisdom have been gathered from the product help files, administrative guide, release notes and other publicly available sources. There are several topics covered in this article, specifically:
- How to enable debugging mode in RES Wisdom
- How to set the maximum connections on the Dispatcher
- Using the $workspace tag in Wisdom
- Scheduling Wisdom jobs from the commandline
- Wisdom Agent installation parameters
- Configuring environment variables to remain untranslated
- DB creation during an unattended installation of RES Wisdom
- The Wisdom @REPLACE function
- New input options for parameters
- Prepared4Embedded: New method for using Agents in an image
- Dealing with console lockout
Okay, here we go:
How to enable debugging mode in RES Wisdom
To facilitate debugging on what’s going on in the Wisdom environment, you can enable debugging mode on the agents. This is the procedure is the same for both the Dispatcher and the Agents. Note: This works for RES Wisdom series 5 and up. Add the following registry values:
Registry key: HKEY_LOCAL_MACHINESOFTWARERESWISDOM
Value Name: Trace
Data Type: REG_SZ (String Value)
Value Data: (Yes = enabled, No = disabled)
Registry key: HKEY_LOCAL_MACHINESOFTWARERESWISDOM
Value Name: TraceDetailed
Data Type: REG_SZ (String Value)
Value Data: (Yes = enabled, No = disabled)
System Key: [HKEY_LOCAL_MACHINESOFTWARERESWISDOM]
Value Name: TraceFile
Data Type: REG_SZ (String Value)
Value Data: <path_to_logfile><filename>
Please note the following:
- This reghack can be applied to both an Agent and a Dispatcher
- The file will always be 2 MB. Older lines will be overwritten within the file. If the trace is running for a longer period the file should be copied on a regular basis.
- A dispatcher that is moderately used can fill up the 2 MB in a matter of minutes.
- The bottom line in the file is not necessarily the latest entry.
How to set the maximum connections on the Dispatcher
Notice: The need to use this option has been eliminated in Wisdom 2009, because we no longer keep all connections open. In real life, it would take about 1000 agents to get to the hardcoded maximum. What needs to be mentioned is that the current maximum is 150 agents so this setting is only effective if you specify a value over 150. Recently, we have noticed that 150 concurrent connections is actually too much for a dispatcher machine, so in fact this setting is not really usable anymore.
The registry value will let you override the number of max connections that a given Dispatcher will accept. The key is:
HKLMSoftwareRESWisdomDispatcherMaxConnections (REG_DWORD)
This key does not exist as default.
Carefull with this one. Out of the box, the Wisdom 2009 Dispatcher is pretty smart and will work out how many connections it safely can handle. If you for some reason disagree with this, it can be changed. This is at your own peril however. Don’t mess with it just because you can.
Using the $workspace tag in Wisdom
This one’s really a lifesaver. Imagine that you want to use some files in an Execute command task. Using what we know so far, we would probably create a Download Resource task first, so we are sure we have the stuff we need locally on the target machine before we begin. Instead it is possible to directly reference the Global Uniquie Identifier of the ressource in the commandline without worrying about downloading it and where it physically is downloaded to. Wisdom will take care of it.
Let’s say we want to execute this command: sysocmgr.exe /open:datafile.dat
The important thing to note is that the sysocmgr.exe in this example is a local executable already in place in the OS. What we would do different in this example, is to:
- go to the resource for the file datafile.dat
- mark and copy the GUID. Lets assume it is {66A0E2A2-BCE2-475C-B988-BED6A1306657}
- Create the task for executing the command. The command line would then look like this: sysocmgr.exe /open:$workspace{66A0E2A2-BCE2-475C-B988-BED6A1306657}
That way you avoid adding a download task to the module.
Another example would be that you need a specific exefile to run on the target machine. If you have already uploaded that .exe file as a Wisdom ressource, you can just enter $workspace{GUID-OF-THE-APP} in the command line field of the task.
Remember, you don’t have to type the GUID’s. Just go to the properties of the object (module, agent, etc) and copy the guid from the dialog box. Also, you can just rightclick in the fields which supports using a resource tag. This will allow you to browse the ressource catalog and add the proper workspace tag.
Scheduling Wisdom jobs from the commandline
You can make your own custom shortcuts into the Wisdom environment by using parameters of the wmc.exe which is the console. So instead of giving certain low-access helpdesk users a wisdom console as such, you can just define an icon on their desktop to run a given runbook. You can schedule a job unattended by running the wmc.exe from the command line using the following parameters:
| Parameter | Value | Functionality |
| /action= | schedule | Specifies the action, in this case schedule. (Another option is “importbb” to import a Building Block unattended.) |
| /module=or/project=or/runbook= | <GUID> | Identifies the Module, Project or Run Book. |
| /agent=or/team= | <GUID> | Identifies the Agent or Team.This parameter can be left out for Run Books for which all target Agents or Teams have already been configured. |
| /user=and/password= | <user>and<password> | Optional: the RES Wisdom credentials to access the Console. |
| /silent | Optional: suppresses any messages. | |
| /onlineagentsonly | Optional: restrict Job to online Agents in a Team only. |
Example 1:
“%programfiles%res wisdomwmcwmc.exe” /action=schedule /Module={69A0BC21-41F6-46DC-B6DE-5574138EF03C} /team={26E7EB95-35A8-41D3-AED9-FCE71571D6BD} /user=jsmith /password=secret /onlineAgentsonly
The above commandline will run a specific module on the machines which are online in a specific team, authenticating against wisdom with credentials jsmith/secret. If windows authentication is being used, the /user and /password parameters are not necessary. A popup will show on the machine where the command is executed to show the module has been scheduled.
Example 2:
“%programfiles%res wisdomwmcwmc.exe” /action=schedule /Module={69A0BC21-41F6-46DC-B6DE-5574138EF03C} /agent={26E7EB95-35A8-41D3-AED9-FCE71571D6BD} /user=jsmith /password=secret /silent /onlineAgentsonly
This commandline will run a module on a specific agent, providing it is online. Authention is as before, however the module will run silent on the machine executing the command.
Wisdom Agent installation parameters
The following public properties (MSI parameters) are available for RES Wisdom Agent .msi files, to configure the newly installed component to connect to an existing environment:
SITELICENSE: Specifies the RES Wisdom Site ID. You can find this in the Licensing node.
DISPATCHERLIST: By default, the Agent will autodetect Dispatchers. To use a fixed list of Dispatchers instead, use this optional property to specify the names or GUIDs of Dispatchers to use. Separate multiple entries with a semi-colon (;).
DISPATCHERAUTODETECTFIRST: If you are using the property DISPATCHERLIST (see above), set the property DISPATCHERAUTODETECTFIRST with the value:
“1″ if the Agent should try autodetecting Dispatchers before using the Dispatcher list.
“0″ if the Agent should only use the Dispatcher list.
DISPATCHERGETLIST: Specifies whether the Wisdom Agent should extend its list of Dispatchers by getting lists of Dispatchers from the discovered Dispatcher. Set the value:
“1″ if the Agent should try to retrieve more Dispatchers through the discovered Dispatcher.
“0″ if the AAgent should not retrieve more Dispatchers through the discovered Dispatcher.
ADDTOTEAM: With this property, the newly installed Agent can be made member of an existing Team. This makes it possible to categorize the new Agent correctly right from the start. To make the new Agent member of one or more Teams, use this optional Property to specify the names or GUIDs of the Teams. Separate multiple entries with a semi-colon (;). Another option for adding agents to teams is to use the Wisdom 2009 Team Rules. These make it possible for an agent to automagically join a team depending on rules on that team. The memebership takes place immediatly.
INVOKEPROJECT: To run one or more Projects on the new Agent as soon as it comes online, use this optional Property to specify the GUIDs of the Projects. You can find these GUIDs in the Projects node. Separate multiple entries with a semi-colon (;).
Example:
The site license for your RES Wisdom environment is “RES-AAAA-BBBB-CCCC-DDDD-EEEE-FFFF-1111-2222″. The Agent must connect to two Dispatchers after it has started, “qa-xptest01″ and “qa-w2ktest10″. The Agent is not allowed to use other Dispatchers. After the Agent gets online, it must be member of the Team “Exchange Servers”, and it must run a Project with the following GUID: “{301620AE-B650-4B87-BA02-05B6114E1F83}”. The command line to install this Agent unattended would be:
Msiexec /i “c:res-wisdom-Agent-x.x.x.x.msi” SITELICENSE=”RES-AAAA-BBBB-CCCC-DDDD-EEEE-FFFF-1111-2222″ DISPATCHERLIST=”qa-xptest01;qa-w2ktest10″ DISPATCHERGETLIST=”0″ ADDTOTEAM=”Exchange Servers” INVOKEProject=”{301620AE-B650-4B87-BA02-05B6114E1F83}” /qn
Note: Components (meaning Consoles, Dispatchers and Agents) can also be exported as a preconfigured MSI file. By going to the components node of the Wisdom console, you can rightclick on either one and save it. A dialog box will prompt you for the parameters which you want to brand into the MSI file.
Configuring environment variables to remain untranslated
Sometimes environment variables should not be translated to their value on a specific Agent, but should remain as variables. If double percentage signs (%) are placed around a variable, the variable is not translated to a value but remains a variable. For example, with double percentage signs, %%WINDIR%% is translated to %WINDIR% and not to C:windows.
Here’s an example scenario: You want to set the userprofile path for all Active Directory users as a variable, like %profilepath%, so that this path can be defined depending on the Operating System: C:WindowsProfiles%username% on Windows 2003 machines, and C:WINNTProfiles%username% on Windows 2000 machines.
To achieve this, first use the Task Set Environment Variables to create the system environment variable %profilepath% with the correct values on Windows 2003 and 2000 machines. Then configure the Task Manage Active Directory User to set %%profilepath%% as the Active Directory Property user profile path for all users.
As a result, all user profile paths in Active Directory are: %profilepath%. Due to this variable, the user profile path is resolved depending on the Operating System under which a user logs on: C:WindowsProfiles%username% or C:WINNTProfiles%username%.
DB creation during an unattended installation of RES Wisdom
It was previously possible to run an unattended installation of RES Wisdom, but only if connecting to an existing database. It is now possible to include the creation of a new MSSQL, ORACLE or MYSQL database in the unattended installation of RES Wisdom. Furthermore, license files can also be imported during the unattended installation of RES Wisdom.
Note: Because of the different characteristics of the DB2 database system, it is not possible to create a DB2 database during an unattended RES Wisdom installation. However, it is possible to connect to an existing one. Public properties for installing RES Wisdom unattended are as follows:
DBTYPE: Specifies the database type. This can be either MSSQL, DB2, ORACLE or MYSQL.
DBSERVER: Specifies the database server that RES Wisdom should connect to.
DBNAME: Specifies the database name that RES Wisdom should connect to.
DBUSER: Specifies the database username that RES Wisdom should use to connect to the database.
DBPASSWORD: Specifies the database password that RES Wisdom should use to connect to the database.
DBPROTOCOLENCRYPTION: Specifies whether SQL protocol encryption should be used when connecting to Microsoft SQL Server. Values are “yes” or “no”. Default is “no”.
DBCREATE: Specifies whether a new database should be created using the values above. Values are “yes” or “no” (default is “no”). (Note that a DB2 database cannot be created during an unattended installation.)
DBCREATEUSER: Specifies the database username that should be used to create the new database, e.g. “sa”.
DBCREATEPASSWORD: Specifies the database password that should be used to create the new database.
DBIMPORTLICENSE: Specifies a license file (including full path) to be imported after creating a new database (optional).
Here’s a few examples.
To install RES Wisdom unattended and to create a new datastore:
Msiexec /i “c:res-wisdom-2009.msi” DBSERVER=”SQLSERVER01″ DBNAME=”RESWisdom” DBUSER=”RWUser” DBPASSWORD=”RWUserPassword” DBTYPE=”MSSQL” DBPROTOCOLENCRYPTION=”No” DBCREATE=”Yes” DBCREATEUSER=”SA” DBCREATEPASSWORD=”SAPassword” DBIMPORTLICENSE=”c:program filesres wisdomlicensefile.xml” /qn
To install RES Wisdom unattended and to connect to an existing datastore:
Msiexec /i “c:res-wisdom-2009.msi” DBSERVER=”SQLSERVER01″ DBNAME=”RESWisdom” DBUSER=”RWUser” DBPASSWORD=”RWUserPassword” DBTYPE=”MSSQL” DBPROTOCOLENCRYPTION=”No” /qn
The Wisdom @REPLACE function
It is now possible to use the function @[REPLACE(<expression>, <find>, <replacewith>)] when configuring Tasks, to replace characters in a specific expression with another character. This is for example useful when you want to execute an Active Directory Task to add an e-mail address for a user based on Active Directory properties. Here’s a couple of examples:
Displayname in AD: James T Kirk
Function: @[REPLACE(%d@starfleet.org, ,)]
Result: JamesTKirk@starfleet.org
Displayname in AD: Harley-Davidson
Function: @[REPLACE(%d@yourcompany.com,-,.)
Result: Harley.Davidson@yourcompany.com
New input options for parameters
In Wisdom 2009, additional input settings are now available for parameters:
- Request input confirmation: If you select this option, you will be asked an extra time for the parameter, when you schedule the job. This can be usefull for verifying information which you want to be absolutely sure has been entered correctly.
- Always request input (even if parameter is not used directly) : shows the parameter at the input moment of the parameter, even if it is not used directly in any modules.
- Parameter value is required (may not be empty): The value of the parameter must not be empty.
- Use input mask: creates a restrictive field for text entry. The values that you can enter at the input moment of the parameter are restricted to the specified mask. For example, if you want to show a prompt for a telephone number that is restricted to numeric values only, but the area code should be in between parentheses, you could define your mask as Phone No: (000) 000-0000. This results in the following prompt: Phone No: (___) ___-____, in which only numeric values can be entered.
The following characters are available when defining a mask:
-
- 0 - Numeric (0-9)
- 9 - Numeric (0-9) or space ( )
- # – Numeric (0-9) or space ( ) or (+) or (-)
- L - Alpha (a-Z)
- ? - Alpha (a-Z) or space ( )
- A- Alpha numeric (0-9 and a-Z)
- a – Alpha numeric (0-9 and a-Z) or space ( )
- H - Hex digit (0-9 and A-F)
- X - Hex digit (0-9 and A-F) and space ( )
- & - Any character
Note: The selected input options will be ignored if either
- the parameter is a Module parameter and linked to a Project parameter or Run Book parameter, or
- the parameter is a Project parameter and linked to a Run Book parameter.
Prepared4Embedded: New method for using Agents in an image
In previous versions of RES Wisdom, you could use “Prepare Agent for Image” to roll out new Agents that are identical copies of the original Agent. When you install a new Agent by using the image, the new Agent will start automatically and register itself in the Datastore with its new computer name. A drawback of this method is that the Agent in the image must be preconfigured to connect to a specific RES Wisdom environment. (This is done by the Wizard using the GUID of the RES Wisdom environment.)
A more generic method is now available to preconfigure the correct RES Wisdom environment. Instead of relying on the environment identifier of a RES Wisdom environment, you can now use the name of the RES Wisdom environment.
This is done by setting the REG_SZ value HKEY_LOCAL_MACHINESOFTWARERESWISDOMAgentPrepared4Embedded to the RES Wisdom environment name in the image. Then, when you install a new Agent using the image, the new Agent will automatically start and will look for a RES Wisdom environment of the given name. If it finds the RES Wisdom environment, it will register itself in the Datastore and start executing scheduled Jobs. The Wisdom environment name is configured in the console under Infrastructure | Datastore | Settings | Global Settings. Look for the setting called Environment name
Again one of the support guys at RES has offered some valuable insight for us to share:
“The GUID of the Wisdom environment is not configured in the Wizard but is already present in the Agent Registry. The only GUID you specify in the Wizard is the one of the Project to be run when the agent comes online. Prepared4Embedded was implemented specifically for the Cranberry Smart Client devices, which have the name of the environment to connect to embedded in the image. You can however use this entry to alter the environment to connect it to your database.”
Dealing with console lockout
If access to the RES Wisdom Management Console is protected by RES Wisdom credentials, users can potentially lock themselves out of the console if they forget their RES Wisdom credentials. You can now start the Console using a command line with the parameter /lockedout (e.g. “%programfiles%RES WisdomWMCwmc.exe” /lockedout).
If the user can provide the correct database credentials (dbuser and dbpassword), the user’s Windows credentials are added to the default Security Role “Full Access”, so that the legitimate user can get access to the Console again.
Use of the /lockedout method, including failed attempts, is logged in the Audit Trail.
This concludes the first round of Tips and Tricks for Wisdom. Thanks to all contributers for your input. As soon as a suficcient number of new and interesting things have been collected a new article will be posted. Stay tuned
/TRG
6 Comments
Other Links to this Post
RSS feed for comments on this post. TrackBack URI
By Domino1270, 2009/02/09 @ 23:16
Great info!!! Very nice list of “Easter Eggs”. Has anyone stumbled across the current method of grabbing parts of variables? If, for example, I wish to create a username based on the first initial of the first name and the first five letters of the last name. I think that info would be a nice add to this list.
By RESguru, 2009/02/10 @ 21:56
Hi Domino1270.
You should be able to do this using the function
@substring(%variable%,1,1) in Wisdom 2009.
/TRG
By Rene de Goeij, 2010/04/26 @ 12:13
i was trying to create user in ad with login name i would like to do the following
cg@substring($[firstname],1,1)@substring($[lastname],1,6)
to get bv cgjlinsse for Jan Linssen
but then i get message that i reached 20 characters limit
By RESguru, 2010/04/27 @ 15:14
That sound really odd. If I were you, I would make sure I can replicate the issue, then contact RES Support.
Cheers,
Max
By Rene de Goeij, 2010/04/28 @ 06:44
i forgot some brackets
cg@substring($[firstname],1,1)@substring($[lastname],1,6)
should be
cg@[substring]($[firstname],1,1)@[substring]($[lastname],1,6)
By Rene de Goeij, 2010/04/28 @ 06:46
sorry
cg@[substring($[firstname],1,1)]@[substring($[lastname],1,6)]