197
Configuration restrictions and guidelines
When you configure monitor policies, follow these restrictions and guidelines:
• Make sure the actions in different policies do not conflict. Policy execution result will be
unpredictable if policies that conflict in actions are running concurrently.
• You can assign the same policy name to a CLI-defined policy and a Tcl-defined policy, but you
cannot assign the same name to policies that are the same type.
• The system executes the actions in a policy in ascending order of action IDs. When you add
actions to a policy, you must make sure the execution order is correct.
Configuring a monitor policy from the CLI
1. Enter system view.
system-view
N/A
2. Enter CLI-defined
policy view.
rtm cli-policy
policy-name
If the policy does not exist, this
command creates the policy first.
3. Configure an event in
the policy.
• Configure a CLI event:
event cli { async [ skip ] | sync }
mode { execute | help | tab } pattern
regular-exp
• Configure a hotplug event:
event hotplug [ slot slot-number
[ subslot subslot-number ] ]
• Configure an interface event:
event interface interface-type
interface-number monitor-obj
monitor-obj start-op start-op
start-val start-val restart-op
restart-op restart-val restart-val
[ interval interval ]
• Configure a process event:
event process { exception | restart |
shutdown | start } [ name
process-name [ instance
instance-id ] ] [ slot slot-number ]
• Configure an SNMP event:
event snmp oid oid monitor-obj
{ get | next } start-op start-op
start-val start-val restart-op
restart-op restart-val restart-val
[ interval interval ]
• Configure an SNMP-Notification
event:
event snmp-notification oid oid
oid-val oid-val op op [ drop ]
• Configure a Syslog event:
event syslog priority level msg msg
times
period
By default, a monitor policy does
not contain an event.
You can configure only one
event in a monitor policy. If the
monitor policy already contains
overrides the old event.
4. Configure the actions
event occurs.
• Configure a CLI action:
action number cli command-line
• Configure a reboot action:
action number reboot [ slot
slot-number [ subslot
subslot-number ] ]
• Configure a logging action:
By default, a monitor policy does
not contain any actions.
Repeat this step to add a
maximum of 232 actions to the
policy.