Configuration Examples
  • 05 Dec 2024
  • Dark
    Light
  • PDF

Configuration Examples

  • Dark
    Light
  • PDF

Article summary

Use the following examples to configure various rules and comparison operators and operands for a Command Template.

Example 1

In this example, we need to verify Cisco CSR has sufficient memory. The IOS command show platform software vmemory info prints memory statistics, including the total system memory.

In the application:

  1. Create a new Command Template.
  2. Select a device name for testing.
  3. Type show platform software vmemory info in the command field of Command #1.
  4. Keep the default contains operator.
  5. Click Test This Command.
  6. The test results will display.

Example Test Results

Memory Upgrade Limits:
    Total System Memory:        3890 MB
    Memory From Upgrade Licenses:   0 MB
    Memory From Feature Licenses:   0 MB
Memory Available For Upgrade:
    Available System Memory:    0 MB
    Available Upgrade Licensed Memory:  0 MB
    Available Feature Licensed Memory:  0 MB
Current Memory Allocation:
    IOSD:   2354 MB (default) + 0 MB upgrade
    Data Plane: 1536 MB (default) + 0 MB upgrade

Top Comparison Operand

To build a regular expression to select data:

  1. Select RegEx operator.
  2. Type a regular expression to select the command's output data containing the first operand. The line containing "Total System Memory" includes the first operand, 3890 MB.
  3. Type Total System Memory:\s+\d+ MB in the rule field.
  4. Click Test This Command.
  5. Verify a green check green check is displayed, indicating the rule matches.
  6. If a red dash red dash is displayed, check the regular expression for errors.

To build a capture group:

  1. Change the command operator to #comparison.

  2. Surround the regular expression rule with slash characters:

    /Total System Memory:\s+\d+ MB/
    
  3. Add a capture group by placing a pair of parentheses around the part of our regular expression matching installed memory:

    /Total System Memory:\s+(\d+) MB/
    

To set the comparison operator:

  1. Select >= comparison operator.

Bottom Comparison Operand

To define a comparison using a Bottom Operand:

  1. Type 3000 in the compare with field.
  2. Click Test This Command.
  3. Verify a green check 13_greenCheck is displayed, indicating the rule matches.
  4. If a red dash 14_redDash is displayed, check the top comparison operand regular expression for errors.

Example 2

This example extends the previous example; we need to verify Cisco CSR has sufficient memory. In the previous example, we compared installed memory to a static value. In this example, we compare installed memory to a variable.

Variable MEM-THRESH will be passed to the MOP command template.

Bottom Comparison Operand

  • Type <!MEM-THRESH!> in the Compare with field.

Example 3

In this example, we have an EBGP adjacency configured with a maximum prefix of 10 prefixes. The adjacency is configured to log warning messages when the neighbor sends 80% or more of the maximum number of prefixes, and the adjacency is reset if the neighbor sends more than 10 prefixes. In this example, we verify the number of sent prefixes is not greater than the warning threshold.

The IOS command show ip bgp neighbor X.X.X.X prints the number of accepted prefixes, the maximum prefix limit, and the warning threshold.

  1. In the application, create a new command template.

  2. Select a device name for testing.

  3. Type show ip bgp neighbor X.X.X.X in the command field for Command 1.

    • Replace X.X.X.X with a valid EBGP neighbor's router ID.
  4. Keep the default contains operator.

  5. Click Test This Command.

  6. The test results will display.

    Router_B#show ip bgp neighbor 10.0.0.1
    BGP neighbor is 10.0.0.1,  remote AS 200, external link
    BGP version 4, remote router ID 10.0.0.1
    BGP state = Established, up for 00:13:22
    Last read 00:00:21, hold time is 180, keepalive interval is 60 seconds
    Neighbor capabilities:
        Route refresh: advertised and received(old & new)
        Address family IPv4 Unicast: advertised and received
        IPv4 MPLS Label capability:
    Received 930 messages, 0 notifications, 0 in queue
    Sent 919 messages, 1 notifications, 0 in queue
    Default minimum time between advertisement runs is 30 seconds
    
    For address family: IPv4 Unicast
    BGP table version 30, neighbor version 30
    Index 1, Offset 0, Mask 0x2
    Route refresh request: received 0, sent 0
    9 accepted prefixes consume 432 bytes
    Prefix advertised 0, suppressed 0, withdrawn 0, maximum limit 10 (warning-only
    )
    Threshold for warning message 80%
    
    Connections established 2; dropped 1
    Last reset 00:29:13, due to BGP Notification sent, update malformed
    Message received that caused BGP to send a Notification:
        FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
        003C0200 00001940 01010040 02040201
        00C84003 040A0000 01800404 00000000
        180A000A 180A000B 180A000C
    External BGP neighbor can be up to 2 hops away.
    Connection state is ESTAB, I/O status: 1, unread input bytes: 0
    Local host: 10.0.0.2, Local port: 15668
    Foreign host: 10.0.0.1, Foreign port: 179
    
    Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)
    
    Event Timers (current time is 0x3A46EB54):
    Timer          Starts    Wakeups            Next
    Retrans            18          0             0x0
    TimeWait            0          0             0x0
    AckHold            22          9             0x0
    SendWnd             0          0             0x0
    KeepAlive           0          0             0x0
    GiveUp              0          0             0x0
    PmtuAger            0          0             0x0
    DeadWait            0          0             0x0
    
    iss: 2047376434  snduna: 2047376784  sndnxt: 2047376784     sndwnd:  16035
    irs:  821061364  rcvnxt:  821062116  rcvwnd:      16188  delrcvwnd:    196
    
    SRTT: 279 ms, RTTO: 500 ms, RTV: 221 ms, KRTT: 0 ms
    minRTT: 24 ms, maxRTT: 384 ms, ACK hold: 200 ms
    Flags: higher precedence, nagle
    
    Datagrams (max data segment is 536 bytes):
    Rcvd: 33 (out of order: 0), with data: 22, total data bytes: 751
    Sent: 29 (retransmit: 0, fastretransmit: 0), with data: 17, total data bytes: 349
    
  7. Select the #comparison operator.

  8. Type /maximum limit\s(\d+)/ in the Rule field.

  9. Select the %comparison operator.

  10. Type 80 in the Max accepted % field.

  11. Type /(\d+) accepted prefixes/ in the Compare with field.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.