Tcl-Defined Policy Configuration Example - H3C SR6600-X Configuration Manual

Hide thumbs Also See for SR6600-X:
Table of Contents

Advertisement

# Add an action that enters system view when the event occurs.
[Sysname-rtm-test] action 0 cli system-view
# Add an action that creates the interface Loopback 0 and enters loopback interface view.
[Sysname-rtm-test] action 1 cli interface loopback 0
# Add an action that assigns the IP address 1.1.1.1 to Loopback 0. The loopback0IP variable is used in the
action for IP address assignment.
[Sysname-rtm-test] action 2 cli ip address $loopback0IP 24
# Add an action that sends the matching loopback0 command with a priority of 0 from the logging
facility local7 when the event occurs.
[Sysname-rtm-test] action 3 syslog priority 0 facility local7 msg $_cmd
# Specify the network-admin user role for executing the policy.
[Sysname-rtm-test] user-role network-admin
# Enable the policy.
[Sysname-rtm-test] commit
[Sysname-rtm-test] return
<Sysname>
Verifying the configuration
# Enable the information center to output log messages to the current monitoring terminal.
<Sysname> terminal monitor
# Execute the loopback0 command. Verify that the system displays the loopback0 message and a policy
successfully executed message on the terminal screen.
<Sysname> loopback0
<Sysname>
%Jan
3 09:46:10:592 2014 Device001 RTM/0/RTM_ACTION: -MDC=1; loopback0
%Jan 3 09:46:10:613 2014 Device001 RTM/6/RTM_POLICY: -MDC=1; CLI policy test is running
successfully.
# Verify that Loopback 0 has been created and assigned the IP address 1.1.1.1.
<Sysname> terminal monitor
<Sysname> display interface loopback brief
Brief information on interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface
Loop0
<Sysname>

Tcl-defined policy configuration example

Network requirements
As shown in
following requirements:
EAA sends the log message "rtm_tcl_test is running" when a command that contains the display
this string is entered.
Link Protocol Main IP
UP
UP(s)
Figure
60, use Tcl to create a monitor policy on the Device. This policy must meet the
Description
1.1.1.1
192

Advertisement

Table of Contents
loading

This manual is also suitable for:

R6600

Table of Contents