Configuring static rule tracing


Rule tracing can be statically configured in mcell.conf. Each time the cell starts, it reverts to this rule trace configuration. While the cell is running, the rule trace configuration can be adapted dynamically.

The following mcell.conf parameters determine which rules are traced and the level of tracing:

  • TraceRuleLevel 
  • TraceRulePhases 
  • TraceRuleNames 
  • TraceRulePorts

The TraceRuleLevel parameter controls rule tracing globally. It can have the following values:

0—Completely disables rule tracing and run time error reporting. It is not recommended.
1—Enables run time error reporting, and disables rule tracing. This is the recommended setting for normal production environments.
2—Enables rule tracing. This must be used only in development, for analysis, or when debugging the Knowledge Base.

If rule tracing is enabled, the TraceRulePhases and TraceRuleNames parameters control which rules are traced. A rule is traced only if both the phase to which it belongs and the rule itself are configured for tracing.

The TraceRuleNames parameter contains a comma-separated sequence of module:rule combinations or the keyword ALL to indicate all modules and/or rules. Each rule name optionally can be prefixed with a (+) or (-) sign to indicate addition or removal from the list. To trace rules from the global module, enter the rule name by itself without an accompanying module name. The list is interpreted in sequential order.

The TraceRulePorts parameter determines the category of tracing messages that are reported. This parameter is a comma-separated list of any of the following trace message categories:

  • entry—A message is displayed when an event satisfies the main selector of a rule. If the rules refer to a policy, the messages are displayed for every policy instance that matches the event. For example:
im_internal.mrl, 60: refine im_internal_lowercase_hostname: EVENT #5: Rule execution starting with $EV = 0xd926d0 (class: EVENT, event_handle: 5, mc_ueid: mc.ruleTrc9612.7de944e.0)
  • using—A message is displayed when an object instance is retrieved by a query in a using block. For example:

    ruleTrc9612.mrl, 31: refine idx_data_s: IDX_EVENT #5: solution 1 to data query:
    $X = 0x13c5468 (class: IDX_DATA, data_handle: 374, mc_udid: mc.ruleTrc9612.7f100f7.327)
  • using_policy —A message is displayed when a policy is retrieved by a query in a using_policy block. For example:

    im_internal.mrl, 207: refine im_internal_timeout: EVENT #5: solution 1 to policy query:
    $POL = 0x109e4b8 (class: IM_TIMEOUT_POLICY, data_handle: 32, mc_udid: mc.ruleTrc9612.7de9405.19)
  • using_failure—A message is displayed when there are no instances that satisfy a query in a using block. For example:

    ruleTrc9612.mrl, 13: refine idx_event_h: IDX_EVENT #5: no solution for $X in context
    $E = 0x146ca80 (class: IDX_EVENT, event_handle: 5, mc_ueid: mc.ruleTrc9612.7f100f7.349)
  • using_policy_failure—A message is displayed when there are no instances that satisfy a query in a using_policy block. For example:

    im_internal.mrl, 18: refine im_internal_blackout: EVENT #5: no solution for $POL in context
    $EV = 0xd926d0 (class: EVENT, event_handle: 5, mc_ueid: mc.ruleTrc9612.7de940c.0)
  • assign—A message is displayed for each assignment instruction. For example:

    im_internal.mrl, 167: refine im_internal_default_location: EVENT #5: $EV.mc_location = 'bmc.com'

Static rule tracing configuration example

TraceRuleLevel=2
TraceRulePhases=ALL,-refine,-regulate
TraceRuleNames=TroubleTicketing:ALL,-TroubleTicketing:rule1,SendMail:rule1,SendMail:rule2
TraceRulePorts=entry,assign

These settings enable tracing of the following rules:

  • All rules from module TroubleTicketing that are not refine or regulate, except rule1 
  • Rules rule1 and rule2 from module SendMail, if they are not refine or regulate 
  • All entry to the specified rules is traced and assignments within those rules.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*