Rule deletion – Brocade Monitoring and Alerting Policy Suite Administrators Guide (Supporting Fabric OS v7.3.0) User Manual
Page 60
![background image](/manuals/361669/60/background.png)
Cloning a rule and changing its values
When you clone a rule, you can also specify the parameters you want to be
different from the old rule in the new rule. To modify the rule, use the --config
keyword. The following example clones “myOldRule” as “myNewRule” and
changes the flow that is being monitored to “flow2” and assigns it the monitor
“monitor2”. It then displays the rule.
switch:admin> mapsrule --clone myOldRule -rulename myNewRule
switch:admin> mapsrule --config -group flow2 -monitor monitor2
admin> mapsrule --show myNewRule
RuleName: myNewRule
Action: Raslog, Fence, Decom
Condition: Switch(SEC_IDB/Hour>10)
Policies Associated: slow_monitor2
Cloning a rule and changing its time base
The following example creates a clone of “Rule1” with a time base of an hour,
and then displays the rule.
switch:admin> mapsrule --clone Rule1 -rulename NewRule2 -timebase hour
switch:admin> mapsrule --show NewRule2
RuleName: NewRule2
Action: Raslog, Fence, SNMP
Condition: Switch(SEC_IDB/Hour>0)
Policies Associated: none
Rule deletion
A rule must be removed from every policy that references it before it can be deleted.
While you can use the mapsRule --delete rule_name command to delete individual instances of a
user-defined rule, you have to remove the rule individually from every policy that uses the rule before
you could finally delete the rule itself. This could be problematic if the rule had been added to many
policies. If you try to remove a rule while it is still in a policy without using the -force option, it will fail.
Adding the -force keyword to the command allows you to delete the named user-defined rule from
every policy that uses the rule before deleting the rule itself.
NOTE
There is a difference between using the -force keyword to delete a rule and using it to delete a group.
When you delete a rule using this option, the rule is first removed from all policies, and then the rule
itself is deleted. When you delete a group, first the rule is deleted and then the group is deleted. Refer
to
on page 41 for information on deleting groups.
Rule deletion
60
Monitoring and Alerting Policy Suite Administrator's Guide
53-1003147-01