Saturday, March 8, 2008

Importing TEC rules for new ITM 6.1 user's

If you have created a new rule for TEC to process events from ITM 6.1 you will need to import it into the TEC server's rulebase. In this article I am going to discuss how to this the hard way (i.e., the documented way) or the easy way (the undocumented way).

The documented way

First you have to import using the wrb command into the rulebase. Then you have to import the same rule into the default target rulebase (i.e., EventServer). Here is an example.

I have a new ruleset called itm61New.rls here is what I would do to import it. Notice on the imptgtrule you don't use the file name. You use the rule name (i.e., itm61New).

1) wrb -imprbrule itm61New.rls MyRB

2) wrb -imptgtrule itm61New EventServer Myrb

3) wrb -comprules MyRb

4) wrb -loadrb -use MyRb

If you want to make a change to the itm61New.rls you then have to do the following:

1) wrb -deltgtrule itm61New EventServer MyRb

2) wrb -delrbrule itm61New adv2

3) Make your changes to you original itm61New.rls file

4) wrb -imprbrule itm61New.rls MyRB

5) wrb -imptgtrule itm61New EventServer Myrb

6) wrb -comprules MyRb

7) wrb -loadrb -use MyRb

The undocumented way

If you have a test and a production set of TEC servers you can save alot of time if you just edit the rulebase directory directly. Here are the steps:

1) Copy your itm61New.rls to the TEC_RULES directory in your rulebase directory.

e.g.,
cp /export/home/gbs100/itm61New.rls /usr/local/Tivoli/RB/MyRB/TEC_RULES

2) Edit the rule_sets file in the TEC_RULES directory.

e.g., vi /usr/local/Tivoli/RB/MyRB/TEC_RULES/rule_sets

add this line in the rule_sets file:

rule_set('itm61New', 'itm61New.rls', active).

3) Edit the rule_sets_EventServer file in the TEC_RULES directory.

e.g., vi /usr/local/Tivoli/RB/MyRB/TEC_RULES/rule_sets_EventServer

add this line in the rule_sets_EventServer file:

rule_set: itm61New

Note: This step isn't even necessary if you delete the rule_sets_EventServer file and you delete the /usr/local/Tivoli/RB/MyRb/.rbtargets directory. The target rulebase is a legacy feature that was related to a now defunt product called AIM. Since AIM no longer exists there is no reason to use target rulebases.

4) wrb -comprules MyRb

5) wrb -loadrb -use Myrb

If you want to make a change to the itm61New.rls you then have to do the following:

1) Make you changes to the itm61New.rls file

2) wrb -comprules MyRb

3) wrb -loadrb -use MyRb

No comments: