Users Guide

Monitoring and Alerting Policy Suite Administrator’s Guide 31
53-1002933-02
Working with MAPS rules and actions
4
mapspolicy --enable policy
The following example creates a rule to generate a RASLog message if the CRC counter for a group
of critical ports is greater than 10 in an hour. This rule is added to the daily_policy, and the
daily_policy is re-enabled for the rule to take effect.
switch:admin> mapsrule --create check_crc -monitor crc -group critical_ports
-timebase hour -op g -value 10 -action raslog -policy daily_policy
switch:admin> mapsrule --show check_crc
Rule Data:
----------
RuleName: check_crc
Condition: critical_ports(crc/hour>10)
Actions: raslog
Policies Associated: daily_policy
switch:admin> mapspolicy --enable daily_policy
To accommodate creating a rule for a flow, mapsrule accepts a flow name as a value for the -group
parameter. The following example illustrates the structure.
switch:admin> mapsrule --create check_crc2 -monitor crc -group MyFlow
-timebase min -op g -value 15 -action raslog -policy daily_policy2
Modifying a rule
You can modify only user-defined rules. You cannot modify the default rules.
To modify a user-defined policy rule, complete the following steps.
1. Enter mapsRule --show to display the rule you want to modify.
mapsrule --show rule_name
2. Enter mapsRule --config followed by the parameters you are changing to modify the rule.
mapsrule --config check_crc2 -timebase hour
You only need to specify the parameters you are changing. Any parameters you do not specify
are not changed. The configuration settings you specify replace the existing configuration
settings for the rule.
3. Enter mapsRule --show to display the new rule.
mapsrule --show rule_name
4. If the rule is included in the active policy, you must re-enable the policy for the modified rule to
take effect.
mapspolicy --enable policy
The following example modifies the check_crc rule to generate a RASLog message if the CRC
counter for a group of critical ports is greater than 15 in an hour. This rule is part of the active
policy, so the policy is re-enabled for the change to take effect.
switch:admin> mapsrule --show check_crc
Rule Data:
----------
RuleName: check_crc
Condition: critical_ports(crc/hour>10)
Actions: raslog
Policies Associated: daily_policy
switch:admin> mapsrule --config check_crc -monitor crc -group critical_ports
-timebase hour -op g -value 15 -action raslog -policy daily_policy