Displaying and maintaining eaa settings, Configuration examples, Tcl-defined policy configuration example – H3C Technologies H3C MSR 5600 User Manual
Page 238: Network requirements, Configuration procedure, Verifying the configuration
225
Displaying and maintaining EAA settings
Execute display commands in any view.
Task Command
Display user-defined EAA environment variables. display rtm environment [ var-name ]
Display EAA monitor policies.
display rtm policy { active | registered } [ policy-name ]
Configuration examples
Tcl-defined policy configuration example
Network requirements
Use Tcl to create a monitor policy on the Device in
for EAA to send the log message
"rtm_tcl_test is running" when a command that contains the dis this string is entered. The system can
execute the command only after it executes the policy successfully.
Figure 64 Network diagram
Configuration procedure
# Edit a Tcl script (rtm_tcl_test.tcl in this example) for EAA to send the message "rtm_tcl_test is running"
when a command that contains the dis this string is executed.
::comware::rtm::event_register cli sync mode execute pattern dis this user-role
network-admin
::comware::rtm::action syslog priority 1 facility local4 msg rtm_tcl_test is running
# Download the Tcl script file from the TFTP server at 1.2.1.1.
# Enter system view.
# Create the Tcl-defined policy test and bind it to the Tcl script file.
[Sysname] rtm tcl-policy test rtm_tcl_test.tcl
Verifying the configuration
# Display information about the policy.
Total number: 1
PolicyName Type Event TimeRegistered User-role
test TCL CLI Apr 21 16:33:00 2012 network-admin
# Execute the dis this command.