Comparison rule examples
These examples demonstrate how to configure #comparison rules and their operands. Examples 1 and 2 use the same device command and top operand — they differ only in how the bottom operand is defined: Example 1 uses a static value, Example 2 uses a variable. Example 3 is an independent scenario that uses the % operator to compare two values both extracted from the device response.
Example 1: Verify device memory (static threshold)
This example verifies that a Cisco CSR has at least 3000 MB of installed memory. The IOS command show platform software vmemory info returns memory statistics including total system memory.
Build the top operand
Enter a regular expression
Type Total System Memory:\s+\d+ MB in the rule field to match the line containing the memory value.
Test
Click Test This Command. A green check confirms the expression matches. A red dash indicates an error in the expression.
Build the bottom operand
Example 2: Verify device memory (variable threshold)
This example extends Example 1. Instead of comparing against a hardcoded value, the threshold is passed in as a variable, allowing the same template to be reused with different thresholds at runtime.
Bottom operand
Type <!MEM-THRESH!> in the Compare with field. The variable MEM-THRESH is passed to the template at execution time.
Example 3: Verify BGP prefix count against warning threshold
This example verifies that the number of accepted BGP prefixes from a neighbor has not exceeded the configured warning threshold. The adjacency allows a maximum of 10 prefixes and logs a warning at 80%.
The IOS command show ip bgp neighbor X.X.X.X returns the accepted prefix count, the maximum prefix limit, and the warning threshold.