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.
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.
Type Total System Memory:\s+\d+ MB in the rule field to match the line containing the memory value.
Click Test This Command. A green check confirms the expression matches. A red dash indicates an error in the expression.
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.
Type <!MEM-THRESH!> in the Compare with field. The variable MEM-THRESH is passed to the template at execution time.
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.