Configuring a monitor policy from the CLI

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. (Optional.) Set the size for the EAA-monitored log buffer.

rtm event syslog buffer-size buffer-size

The default size of the EAA-monitored log buffer is 50000.

3. Create a CLI-defined policy and enter its view.

rtm cli-policy policy-name

By default, no CLI-defined monitor policies exist.

If a CLI-defined policy already exists, this command enters CLI-defined policy view.

4. Configure an event in the policy.

  • Configure a CLI event:event cli { async [ skip ] | sync } mode { execute | help | tab } pattern regular-exp

  • Configure an event to monitor a member device for joining or leaving the IRF fabric or a subcard slot for subcard hot-swapping:event hotplug [ insert | remove ] 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 priority msg msg occurs times period period

  • Configure a track event:event track track-list state { negative | positive } [ suppress-time suppress-time ]

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 an event, the new event overrides the old event.

The subslot subslot-number option is available only for the HPE FlexFabric 5940 2-slot switch (JH397A) and HPE FlexFabric 5940 4-slot switch (JH398A).

5. Configure the actions to take when the event occurs.

  • Configure the action to execute a command:action number cli command-line

  • Configure a reboot action:action number reboot [ slot slot-number [ subslot subslot-number ] ]

  • Configure an active/standby switchover action:action number switchover

  • Configure a logging action:action syslog priority priority facility local-number msg msg-body

By default, a monitor policy does not contain any actions.

Repeat this step to add a maximum of 232 actions to the policy.

When you define an action, you can specify a value or specify a variable name in $variable_name format for an argument.

The subslot subslot-number option is available only for the HPE FlexFabric 5940 2-slot switch (JH397A) and HPE FlexFabric 5940 4-slot switch (JH398A).

6. (Optional.) Assign a user role to the policy.

user-role role-name

By default, a monitor policy contains user roles that its creator had at the time of policy creation.

A monitor policy supports a maximum of 64 valid user roles. User roles added after this limit is reached do not take effect.

An EAA policy cannot have both the security-audit user role and any other user roles. Any previously assigned user roles are automatically removed when you assign the security-audit user role to the policy. The previously assigned security-audit user role is automatically removed when you assign any other user roles to the policy.

7. (Optional.) Configure the policy runtime.

running-time time

The default runtime is 20 seconds.

8. Enable the policy.

commit

By default, CLI-defined policies are not enabled.

A CLI-defined policy can take effect only after you perform this step.