11-Network Management and Monitoring Configuration Examples

HomeSupportSwitchesS7500E SeriesConfigure & DeployConfiguration ExamplesH3C S7500E Switch Series Configuration Examples-R7585P05-6W10011-Network Management and Monitoring Configuration Examples
04-H3C_EAA_Configuration_Examples
Title Size Download
04-H3C_EAA_Configuration_Examples 126.39 KB

H3C EAA Configuration Examples

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Software version: Release 7585P05

Document version: 6W100-20200330

 

Copyright © 2020 New H3C Technologies Co., Ltd. All rights reserved.

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



Introduction

This document provides EAA configuration examples.

Prerequisites

The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.

This document assumes that you have basic knowledge of EAA.

Example: Configuring an interface event monitor policy by using Tcl

Network configuration

Configure a monitor policy to monitor the incoming traffic statistic on Ten-GigabitEthernet 1/0/1.

Trigger the policy when the following events occur:

·          The traffic statistic reaches or exceeds the start threshold (500000000 bps) for the first time.

·          The traffic statistic reaches or exceeds the start threshold each time after it reaches or exceeds the restart threshold (200000000 bps).

Configure the policy to execute the following actions when it is triggered:

·          Sends the message "XGE1/0/1 input rate exceeded 500000000bps" with a priority of 1 from logging facility local1.

·          Displays the current CPU usage statistics, and saves the statistics to the file XGE0_info.txt.

·          Displays information about Ten-GigabitEthernet 1/0/1, and saves the information to the file XGE0_info.txt.

Procedures

Editing a Tcl script file

# Configure the policy to monitor the incoming traffic on Ten-GigabitEthernet 1/0/1. Set the start and restart thresholds (in bps) to 500000000 and 200000000, respectively.

::comware::rtm::event_register interface ten-gigabitethernet1/0/1 monitor-obj rcv-bps start-op ge start-val 500000000 restart-op ge restart-val 200000000 user-role network-admin

# Add an action that sends the message "XGE1/0/1 input rate exceeded 500000000bps" with a priority of 1 from the logging facility local1.

::comware::rtm::action syslog priority 1 facility local1 msg "XGE1/0/1 input rate exceeded 500000000bps"

# Enable the action.

::comware::create-cli

# Add an action that displays the current CPU usage statistics and saves the statistics to the file XGE0_info.txt.

::comware::write-cli cli0 "display cpu-usage >> XGE0_info.txt"

# Add an action that displays information about Ten-GigabitEthernet 1/0/1 and saves the information to the file XGE0_info.txt.

::comware::write-cli cli0 "display interface ten-gigabitethernet1/0/1 >> XGE0_info.txt"

::comware::write-cli cli0 "end"

Configuring the device

# Assign an IP address to Ten-GigabitEthernet 1/0/1.

<Device> system-view

[Device] interface ten-gigabitethernet 1/0/1

[Device-Ten-GigabitEthernet1/0/1] ip address 192.168.100.66 255.255.255.0

[Device-Ten-GigabitEthernet1/0/1] quit

[Device] quit

# Download the Tcl script file test.tcl from the TFTP server at 192.168.100.14.

<Device> tftp 192.168.100.14 get test.tcl

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   189  100   189    0     0   7900      0 --:--:-- --:--:-- --:--:-- 12600

# Create the Tcl-defined policy test and bind it to the Tcl script file. In this example, the script file name is test.tcl.

<Device> system-view

[Device] rtm tcl-policy test test.tcl

[Device] quit

Verifying the configuration

# Display information about the policy.

<Device> display rtm policy registered

Total number: 1

Type  Event      TimeRegistered        PolicyName

TCL   INTERFACE  May 05 06:46:20 2019  test

# Verify that XGE0_info.txt was created.

<Device> dir

Directory of cfa0:

   0 -rw-        3227 Nov 19 2019 17:28:36   1.cfg

   1 -rw-        2296 Apr 26 2019 18:55:08   5660_data.ak

   2 -rw-        2304 Apr 26 2019 18:54:56   5660_security.ak

   3 -rw-        2298 Apr 26 2019 18:55:16   5660_voice.ak

   4 -rw-        3227 Nov 19 2019 17:15:19   STARTUP110.CFG

   5 drw-           - Mar 10 2019 04:10:10   diagfile

   6 -rw-         567 Jul 17 2019 14:25:00   dsakey

   7 -rw-         223 Jul 17 2019 14:25:00   ecdsakey        

   8 -rw-         278 Jul 17 2019 14:25:00   XGE0_info.txt

   9 -rw-         735 Jul 17 2019 14:25:00   hostkey

  10 -rw-         492 Nov 18 2019 16:40:50   ifindex.dat

  11 -rw-         276 Apr 23 2019 19:00:00   lauth.dat

  12 drw-           - Jul 17 2019 11:26:34   license

  13 drw-           - Apr 24 2019 12:39:38   logfile

  14 -rw-    18839552 Nov 14 2019 16:42:12   msr56-cmw710-boot-r000706.bin

  15 -rw-     1150976 Nov 14 2019 16:43:00   msr56-cmw710-data-r000706.bin

  16 -rw-    47470592 Nov 14 2019 16:42:24   msr56-cmw710-system-r000706.bin

  17 -rw-     2975744 Nov 14 2019 16:42:56   msr56-cmw710-voice-r000706.bin

  18 -rw-    70445056 Nov 14 2019 17:41:08   msr56.ipe

  19 -rw-    70445056 Nov 14 2019 16:40:00   msr56NN.ipe

  20 drw-           - Aug 21 2019 16:23:10   pkey

  21 -rw-         189 Nov 19 2019 17:49:34   test.tcl

  22 drw-           - Mar 10 2019 04:10:10   seclog

  23 -rw-         591 Jul 17 2019 14:25:00   serverkey

  24 -rw-        3227 Nov 18 2019 16:40:50   startup.cfg

 

507492 KB total (298412 KB free)

# Upload XGE0_info.txt to the TFTP server at 192.168.100.14.

<Device> tftp 192.168.100.14 put XGE0_info.txt

# Verify that XGE0_info.txt contains the CPU usage statistics and information about Ten-GigabitEthernet 1/0/1.

Unit CPU usage:

      15% in last 5 seconds

      14% in last 1 minute

      13% in last 5 minutes

Ten-GigabitEthernet1/0/1

Current state: UP

Line protocol state: UP

Description:  Ten-GigabitEthernet1/0/1 Interface

Bandwidth: 1000000 kbps

Maximum transmission unit: 1500

Allow jumbo frames to pass

Broadcast max-ratio: 100%

Multicast max-ratio: 100%

Unicast max-ratio: 100%

Internet address: 192.168.100.66/24 (primary)

IP packet frame type: Ethernet II, hardware address: 5cdd-7000-a07c

IPv6 packet frame type: Ethernet II, hardware address: 5cdd-7000-a07c

Loopback is not set

Media type is twisted pair, port hardware type is 1000_BASE_T

Port priority: 0

1000Mbps-speed mode, Full-duplex mode

Link speed type is autonegotiation, link duplex type is autonegotiation

Flow-control is not enabled

Maximum frame length: 9216

Last link flapping: 0 hours 0 minutes 14 seconds

Last clearing of counters: Never

 Peak input rate: 4 bytes/sec, at 2019-09-21 15:09:37

 Peak output rate: 1 bytes/sec, at 2019-09-21 15:09:37

 Last 300 seconds input rate: 568710000.25 bytes/sec, 64970 bits/sec, 4.96 packets/sec

 Last 300 seconds output rate: 568710000.25 bytes/sec, 64970 bits/sec, 4.96 packets/sec Input (total):  1703 packets, 2336882000 bytes

          0 unicasts, 0 broadcasts, 4 multicasts, 0 pauses

 Input (normal):  1703 packets, - bytes

          0 unicasts, 0 broadcasts, 4 multicasts, 0 pauses

 Input:  0 input errors, 0 runts, 0 giants, 0 throttles

          0 CRC, 0 frame, - overruns, 0 aborts

          - ignored, - parity errors

 Output (total): 1706 packets,  2337062000 bytes

          0 unicasts, 5 broadcasts, 0 multicasts, 0 pauses

 Output (normal): 1706 packets, - bytes

          0 unicasts, 5 broadcasts, 0 multicasts, 0 pauses

 Output: 0 output errors, - underruns, - buffer failures

          0 aborts, 0 deferred, 0 collisions, 0 late collisions

          0 lost carrier, - no carrier

Configuration files

·          Tcl script file:

::comware::rtm::event_register interface ten-gigabitethernet1/0/1 monitor-obj rcv-bps start-op ge start-val 500000000 restart-op ge restart-val 200000000 user-role network-admin

::comware::rtm::action syslog priority 1 facility local1 msg "XGE1/0/1 input rate exceeded 500000000bps"

::comware::create-cli

::comware::write-cli cli0 "display cpu-usage >> XGE0_info.txt"

::comware::write-cli cli0 "display interface ten-gigabitethernet1/0/1 >> XGE0_info.txt"

::comware::write-cli cli0 "end"

·          Device:

#

interface Ten-GigabitEthernet1/0/1

 port link-mode route

 ip address 192.168.100.66 255.255.255.0

#

rtm tcl-policy test test.tcl

#

Example: Configuring an interface event monitor policy from the CLI

Network configuration

Configure a monitor policy to monitor the incoming traffic statistic on Ten-GigabitEthernet 1/0/1.

Trigger the policy when the following events occur:

·          The traffic statistic reaches or exceeds the start threshold (500000000 bps) for the first time.

·          The traffic statistic reaches or exceeds the start threshold each time after it reaches or exceeds the restart threshold (200000000 bps).

Configure the policy to execute the following actions when it is triggered:

·          Sends the message "XGE1/0/1 input rate exceeded 500000000bps" with a priority of 1 from the logging facility local1.

·          Displays the current CPU usage statistics, and saves the statistics to the file XGE0_info.txt.

·          Displays information about Ten-GigabitEthernet 1/0/1, and saves the information to the file XGE0_info.txt.

To conserve system resources, limit the policy runtime to 30 seconds. When the runtime is reached, the system stops executing the policy even if the execution is not finished.

Restrictions and guidelines

When you configure a CLI-defined policy, follow these restrictions and guidelines:

·          A monitor policy can contain only one event and one runtime setting. If the monitor policy already contains an event or runtime setting, the new setting replaces the old setting.

·          A new action overwrites the previous action with the same ID.

·          You must execute the commit command for a CLI-defined policy to take effect. After changing the settings (such as the event, runtime, CLI action, and user role configurations) in the policy, you must re-execute this command for the changes to take effect.

·          For EAA to execute an action in a monitor policy, you must assign the policy the user role that has access to the action-specific commands and resources. If EAA lacks access to an action-specific command or resource, EAA does not perform the action and all the subsequent actions.

·          You cannot assign a monitor policy user roles that have higher privilege than the user roles you are logged in with.

Procedure

# Assign an IP address to Ten-GigabitEthernet 1/0/1.

<Device> system-view

[Device] interface ten-gigabitethernet 1/0/1

[Device-Ten-GigabitEthernet1/0/1] ip address 192.168.100.66 255.255.255.0

[Device-Ten-GigabitEthernet1/0/1] quit

# Create the CLI-defined policy 1 and enter its view.

[Device] rtm cli-policy 1

# Configure the policy to monitor the incoming traffic on Ten-GigabitEthernet 1/0/1. Set the start and restart thresholds (in bps) to 500000000 and 200000000, respectively.

[Device-rtm-1] event interface ten-gigabitethernet 1/0/1 monitor-obj rcv-bps start-op ge

 start-val 500000000 restart-op ge restart-val 200000000

# Add an action that sends the message "XGE1/0/1 input rate exceeded 500000000bps" with a priority of 1 from logging facility local1.

[Device-rtm-1] action 1 syslog priority 1 facility local1 msg "XGE1/0/1 input rate exceeded 500000000bps"

# Add an action that displays the current CPU usage statistics and saves the statistics to the file XGE0_info.txt.

[Device-rtm-1] action 2 cli display cpu-usage >> XGE0_info.txt

# Add an action that displays information about Ten-GigabitEthernet 1/0/1, and saves the information to the file XGE0_info.txt.

[Device-rtm-1] action 3 cli display interface ten-gigabitethernet 1/0/1 >> XGE0_info.txt

# Set the policy runtime to 30 seconds.

[Device-rtm-1] running-time 30

# Specify the network-admin user role for executing the policy.

[Device-rtm-1] user-role network-admin

# Enable the policy.

[Device-rtm-1] commit

[Device-rtm-1] quit

Verifying the configuration

# Display information about the policy.

<Device> display rtm policy registered

Total number: 1

Type  Event      TimeRegistered        PolicyName

CLI   INTERFACE  May 04 00:12:40 2019  1

# Verify that XGE0_info.txt was created.

<Device> dir

Directory of cfa0:

   0 -rw-        3227 Nov 19 2019 17:28:36   1.cfg

   1 -rw-        2296 Apr 26 2019 18:55:08   5660_data.ak

   2 -rw-        2304 Apr 26 2019 18:54:56   5660_security.ak

   3 -rw-        2298 Apr 26 2019 18:55:16   5660_voice.ak

   4 -rw-        3227 Nov 19 2019 17:15:19   STARTUP110.CFG

   5 drw-           - Mar 10 2019 04:10:10   diagfile

   6 -rw-         567 Jul 17 2019 14:25:00   dsakey

   7 -rw-         223 Jul 17 2019 14:25:00   ecdsakey

   8 -rw-         278 Jul 17 2019 14:25:00   XGE0_info.txt

   9 -rw-         735 Jul 17 2019 14:25:00   hostkey

  10 -rw-         492 Nov 18 2019 16:40:50   ifindex.dat

  11 -rw-         276 Apr 23 2019 19:00:00   lauth.dat

  12 drw-           - Jul 17 2019 11:26:34   license

  13 drw-           - Apr 24 2019 12:39:38   logfile

  14 -rw-    18839552 Nov 14 2019 16:42:12   msr56-cmw710-boot-r000706.bin

  15 -rw-     1150976 Nov 14 2019 16:43:00   msr56-cmw710-data-r000706.bin

  16 -rw-    47470592 Nov 14 2019 16:42:24   msr56-cmw710-system-r000706.bin

  17 -rw-     2975744 Nov 14 2019 16:42:56   msr56-cmw710-voice-r000706.bin

  18 -rw-    70445056 Nov 14 2019 17:41:08   msr56.ipe

  19 -rw-    70445056 Nov 14 2019 16:40:00   msr56NN.ipe

  20 drw-           - Aug 21 2019 16:23:10   pkey

  21 -rw-         189 Nov 19 2019 17:49:34   test.tcl

  22 drw-           - Mar 10 2019 04:10:10   seclog

  23 -rw-         591 Jul 17 2019 14:25:00   serverkey

  24 -rw-        3227 Nov 18 2019 16:40:50   startup.cfg

 

507492 KB total (298412 KB free)

# Upload XGE0_info.txt to the TFTP server at 192.168.100.14.

<Device> tftp 192.168.100.14 put XGE0_info.txt

# Verify that XGE0_info.txt contains the current CPU usage statistics and information about Ten-GigabitEthernet 1/0/1.

Unit CPU usage:

      15% in last 5 seconds

      14% in last 1 minute

      13% in last 5 minutes

Ten-GigabitEthernet1/0/1

Current state: UP

Line protocol state: UP

Description:  Ten-GigabitEthernet1/0/1 Interface

Bandwidth: 1000000 kbps

Maximum transmission unit: 1500

Allow jumbo frames to pass

Broadcast max-ratio: 100%

Multicast max-ratio: 100%

Unicast max-ratio: 100%

Internet address: 192.168.100.66/24 (primary)

IP packet frame type: Ethernet II, hardware address: 5cdd-7000-a07c

IPv6 packet frame type: Ethernet II, hardware address: 5cdd-7000-a07c

Loopback is not set

Media type is twisted pair, port hardware type is 1000_BASE_T

Port priority: 0

1000Mbps-speed mode, Full-duplex mode

Link speed type is autonegotiation, link duplex type is autonegotiation

Flow-control is not enabled

Maximum frame length: 9216

Last link flapping: 0 hours 0 minutes 14 seconds

Last clearing of counters: Never

 Peak input rate: 4 bytes/sec, at 2019-09-21 15:09:37

 Peak output rate: 1 bytes/sec, at 2019-09-21 15:09:37

 Last 300 seconds input rate: 568710000.25 bytes/sec, 64970 bits/sec, 4.96 packets/sec

 Last 300 seconds output rate: 568710000.25 bytes/sec, 64970 bits/sec, 4.96 packets/sec Input (total):  1703 packets, 2336882000 bytes

          0 unicasts, 0 broadcasts, 4 multicasts, 0 pauses

 Input (normal):  1703 packets, - bytes

          0 unicasts, 0 broadcasts, 4 multicasts, 0 pauses

 Input:  0 input errors, 0 runts, 0 giants, 0 throttles

          0 CRC, 0 frame, - overruns, 0 aborts

          - ignored, - parity errors

 Output (total): 1706 packets,  2337062000 bytes

          0 unicasts, 5 broadcasts, 0 multicasts, 0 pauses

 Output (normal): 1706 packets, - bytes

          0 unicasts, 5 broadcasts, 0 multicasts, 0 pauses

 Output: 0 output errors, - underruns, - buffer failures

          0 aborts, 0 deferred, 0 collisions, 0 late collisions

          0 lost carrier, - no carrier

Configuration files

#

interface Ten-GigabitEthernet1/0/1

 port link-mode route

 ip address 192.168.100.66 255.255.255.0

#

rtm cli-policy 1

 event interface Ten-GigabitEthernet1/0/1 monitor-obj rcv-bps start-op ge start-val 500000000 restart-op ge restart-val 200000000

 action 1 syslog priority 1 facility local1 msg "XGE1/0/1 input rate exceeded 500000000bps"

 action 2 cli display cpu-usage >> XGE0_info.txt

 action 3 cli display interface ten-gigabitethernet 1/0/1 >> XGE0_info.txt

 running-time 30

 user-role network-admin

#

Example: Configuring a track event monitor policy from the CLI

Network configuration

As shown in Figure 1, Device A has established BGP sessions with Device D and Device E. Traffic from Device D and Device E to the Internet is forwarded through Device A.

Configure a CLI-defined EAA monitor policy on Device A to disconnect the sessions with Device D and Device E when Ten-GigabitEthernet 1/0/1 connected to Device C is down. As a result, traffic from Device D and Device E to the Internet is forwarded through Device B.

Figure 1 Network diagram

 

Procedure

# Display BGP peer information for Device A.

<DeviceA> display bgp peer ipv4

 

 BGP local router ID: 1.1.1.1

 Local AS number: 100

 Total number of peers: 3                  Peers in established state: 3

 

  * - Dynamically created peer

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  10.2.1.2                200       13       16    0       0 00:16:12 Established

  10.3.1.2                300       13       16    0       0 00:10:34 Established

  10.3.2.2                300       13       16    0       0 00:10:38 Established

# Create track entry 1 and associate it with the link state of Ten-GigabitEthernet 1/0/1.

<DeviceA> system-view

[DeviceA] track 1 interface ten-gigabitethernet 1/0/1

# Configure a CLI-defined EAA monitor policy so that the system automatically disables session establishment with Device D and Device E when Ten-GigabitEthernet 1/0/1 is down.

[DeviceA] rtm cli-policy test

[DeviceA-rtm-test] event track 1 state negative

[DeviceA-rtm-test] action 0 cli system-view

[DeviceA-rtm-test] action 1 cli bgp 100

[DeviceA-rtm-test] action 2 cli peer 10.3.1.2 ignore

[DeviceA-rtm-test] action 3 cli peer 10.3.2.2 ignore

[DeviceA-rtm-test] user-role network-admin

[DeviceA-rtm-test] commit

[DeviceA-rtm-test] quit

Verifying the configuration

# Shut down Ten-GigabitEthernet 1/0/1.

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] shutdown

# Display BGP peer information.

<DeviceA> display bgp peer ipv4

 BGP local router ID: 1.1.1.1

 Local AS number: 100

 Total number of peers: 0                  Peers in established state: 0

  * - Dynamically created peer

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

Configuration files

#

rtm cli-policy test

 event track 1 state negative

 action 0 cli system-view

 action 1 cli bgp 100

 action 2 cli peer 10.3.1.2 ignore

 action 3 cli peer 10.3.2.2 ignore

 user-role network-operator

 user-role network-admin

#

track 1 interface ten-gigabitethernet 1/0/1

#

Related documentation

·          H3C S7500E Switch Series Network Management and Monitoring Configuration Guide-R758X

·          H3C S7500E Switch Series Network Management and Monitoring Command Reference-R758X

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网