Using Boolean Operations to Track Static Routes with Watcher Profiles

You can configure a watcher profile to monitor IP performance metrics (IPPM) and take specific actions based on the results using boolean conditions.

The following task configures a watcher profile to monitor two pre-configured IPPM profiles, "p1" and "p2", and configure actions based on their validation results. It selects static routes to track against a watcher profile so that the device modifies the static route mapped to the watcher profile based on the reachability of the profile.

Note: A maximum of four IPPM profiles can be mapped to a single watcher profile using a boolean AND or a boolean OR operation.
IPPM profiles should already be configured before following these steps. Refer to Creating and Modifying an IP Performance Metrics Profile for more information. In this task, two IPPM profiles, "p1" and "p2" have already been configured.
  1. Enter global configuration mode.
    device# configure terminal
  2. Configure a watcher.
    device(config)# watcher name w2
    This example creates a watcher called "w2" and places the device in watcher configuration mode.
  3. Specify the IPPM profile to monitor, and the frequency at which the watcher checks for the IPPM test validation results.
    device(config-watcher-w2)# watch ippm p2 frequency 90
    This example specifies that the IPPM profile called "p2" is monitored, and that the watcher checks for the IPPM test validation results every 90 seconds.
  4. Specify another IPPM profile to monitor, and the frequency at which the watcher checks for the IPPM test validation results.
    device(config-watcher-w2)# watch ippm p1 frequency 90
    This example specifies that the IPPM profile called "p1" is monitored, and that the watcher checks for the IPPM test validation results every 90 seconds.
  5. Configure the watcher profile using a boolean condition.
    device(config-watcher-w2)# watch ippm p1 frequency 90
  6. Configure an action for a watcher configuration upon successful validation.
    device(config-watcher-w2)# success and ippm p2 fail ippm p1 success
    This command specifies that syslog messages are logged when the IPPM profile p1 indicates success, meaning the target is reachable, and the IPPM profile p2 indicates failure, meaning the target is unreachable.
  7. Configure an action for a watcher configuration upon successful validation.
    device(config-watcher-w2)# action success logging enable
    This command enables logging syslog messages upon successful IPPM validation tests.
  8. Configure an action for a watch configuration upon failed validation.
    device(config-watcher-w2)# action failure logging enable
    This command enables logging syslog messages upon failed IPPM validation tests.
  9. Return to global configuration mode.
    device(config-watcher-w2)# exit
  10. Select a static route to track against a watcher profile.
    device(config)# ip route 10.5.5.1/24 10.4.4.4 watcher w2
    This command configures a static route (10.5.5.1/24) with a next-hop address of 10.4.4.4. It associates this static route with the watcher profile "w2".

The following example configures a watcher profile to monitor two pre-configured IPPM profiles, "p1" and "p2", and configure actions based on their validation results. It selects static routes to track against a watcher profile so that the device modifies the static route mapped to the watcher profile based on the reachability of the profile.

device# configure terminal
device(config)# watcher name w2
device(config-watcher-w2)# watch ippm p2 frequency 90
device(config-watcher-w2)# watch ippm p1 frequency 90
device(config-watcher-w2)# success and ippm p2 fail ippm p1 success
device(config-watcher-w2)# action success logging enable
device(config-watcher-w2)# action failure logging enable
device(config-watcher-w2)# exit
device(config)# ip route 10.5.5.1/24 10.4.4.4 watcher w2