Technical data
24 Monitoring and Alerting Policy Suite Administrator’s Guide
53-1002933-02
Working with MAPS policies
4
Working with MAPS policies
The following sections discuss working with MAPS policies.
Viewing policy information
MAPS allows you to view all the policies on a switch by using mapsPolicy --show. You can use this
command to show all policies, only a particular policy, or a summary.
To view a summary of all the policies on a switch, enter the following command:
switch:admin> mapspolicy --show -summary
This command displays the policy names and the number of rules in each policy.
To view the features of all the policies on a switch, enter the following command:
switch:admin> mapspolicy --show -all
This command displays for all policies, the policy names, rule names, actions, and condition for
each policy.
To view the features of a specific policy, enter the following command:
switch:admin> mapspolicy --show policyname
This command displays for the named policy, the policy names, rule names, actions, and condition.
Creating a policy
In some cases you need multiple policies, for example, to apply a different set of rules when
maintenance operations are in progress. You can create multiple policies beforehand and then
easily switch between policies when necessary.
To create policies and then add rules to them, complete the following steps.
1. Create a new policy or clone a policy from one of your existing policies.
Use mapsPolicy with --create to create a policy, or --clone to clone an existing policy.
2. Create rules or modify rules to configure the required thresholds in the new policy.
Use mapsRule with --add to create rules, or --config to modify existing rules.
The policy is automatically saved, but not enabled. It is not enabled unless you explicitly enable it.
The following example creates a policy by cloning another policy, and adds a rule to the new policy.
switch:admin> mapspolicy --clone defpol -name backup_pol
switch:admin> mapsrule --create chassiscpu -monitor CPU -group chassis -op ge
-value 70 -action raslog -policy backup_pol
Enabling a policy
A policy must be enabled before it takes effect. If the active policy is changed, or if the rules in the
active policy are changed, the active policy must be re-enabled for the changes to take effect. Only
one policy can be enabled at a time. To enable a policy, enter mapsPolicy --enable policyname.
When you do this, the previously enabled policy is automatically disabled and the specified policy is
then enabled.