Boolean trigger test configuration example
Network requirements
As shown in Figure 54, the device acts as the agent. The NMS uses SNMPv3 to monitor and manage the device. Configure a trigger and configure a Boolean trigger test for the trigger. When the trigger condition is met, the device sends an mteTriggerFired notification to the NMS.
Figure 55: Network diagram
Configuration procedure
Configure the device:
# Add the user owner1 to the SNMPv3 group g3. Assign g3 the right to access the MIB view a.
<Sysname> system-view [Sysname] snmp-agent usm-user v3 owner1 g3 [Sysname] snmp-agent group v3 g3 read-view a write-view a notify-view a [Sysname] snmp-agent mib-view included a iso
# Configure the device to use the username owner1 to send SNMPv3 notifications to the NMS at 192.168.1.26.
[Sysname] snmp-agent target-host trap address udp-domain 192.168.1.26 params securityname owner1 v3
# Enable SNMP notifications for Event MIB.
[Sysname] snmp-agent trap enable event-mib
Set the Event MIB minimum sampling interval to 50 seconds and set the maximum number to 100 for object instances that can be concurrently sampled.
[Sysname] snmp mib event sample minimum 50 [Sysname] snmp mib event sample instance maximum 100
Configure the Event MIB object lists. When a notification action is triggered, the system adds the objects in the specified object list to the notification.
[Sysname] snmp mib event object list owner owner1 name objectA 1 oid 1.3.6.1.4.1.25506.2.6.1.1.1.1.6.11 [Sysname] snmp mib event object list owner owner1 name objectB 1 oid 1.3.6.1.4.1.25506.2.6.1.1.1.1.7.11 [Sysname] snmp mib event object list owner owner1 name objectC 1 oid 1.3.6.1.4.1.25506.2.6.1.1.1.1.8.11
Configure an event:
# Create an event. Specify its owner as owner1 and its name as EventA.
[Sysname] snmp mib event owner owner1 name EventA
# Specify the notification action for the event.
[Sysname-event-owner1-EventA] action notification
# Specify the notification object hh3cEntityExtMemUsageThresholdNotification by its OID 1.3.6.1.4.1.25506.2.6.2.0.5 for the notification.
[Sysname-event-owner1-EventA-notification] oid 1.3.6.1.4.1.25506.2.6.2.0.5
# Specify the object list to be added to the notification when the notification action is triggered
[Sysname-event-owner1-EventA-notification] object list owner owner1 name objectC [Sysname-event-owner1-EventA-notification] quit
# Enable the event.
[Sysname-event-owner1-EventA] event enable [Sysname-event-owner1-EventA] quit
Configure a trigger:
# Create a trigger. Specify its owner as owner1 and its name as triggerA.
[Sysname] snmp mib event trigger owner owner1 name triggerA
# Set the sampling interval to 60 seconds. Make sure the interval is greater than or equal to the global minimum sampling interval.
[Sysname-trigger-owner1-triggerA] frequency 60
# Specify the monitored object by its OID.
[Sysname-trigger-owner1-triggerA] oid 1.3.6.1.4.1.25506.2.6.1.1.1.1.9.11
# Specify the object list to be added to the notification when the notification action is triggered.
[Sysname-trigger-owner1-triggerA] object list owner owner1 name objectA
# Enable the Boolean trigger test. Specify the comparison type, reference value, event, and object list for the test.
[Sysname-trigger-owner1-triggerA] test existence [Sysname-trigger-owner1-triggerA-existence] quit [Sysname-trigger-owner1-triggerA-boolean] comparison greater [Sysname-trigger-owner1-triggerA-boolean] value 10 [Sysname-trigger-owner1-triggerA-boolean] event owner owner1 name EventA [Sysname-trigger-owner1-triggerA-boolean] object list owner owner1 name objectB [Sysname-trigger-owner1-triggerA-boolean] quit
# Enable the trigger.
[Sysname-trigger-owner1-triggerA] trigger enable [Sysname-trigger-owner1-triggerA] quit
Verifying the configuration
# Display Event MIB configuration and statistics
[Sysname] display snmp mib event summary TriggerFailures : 0 EventFailures : 0 SampleMinimum : 50 SampleInstanceMaximum : 10 SampleInstance : 1 SampleInstancesHigh : 1 SampleInstanceLacks : 0
# Display information about the Event MIB object lists.
[Sysname] display snmp mib event object list Object list objectA owned by owner1: ObjIndex : 1 ObjID : 1.3.6.1.4.1.25506.2.6.1.1.1.1.6.11<hh3cEntityExt CpuUsage.11> ObjIDWildcard : false Object list objectB owned by owner1: ObjIndex : 1 ObjID : 1.3.6.1.4.1.25506.2.6.1.1.1.1.7.11<hh3cEntityExt CpuUsageThreshold.11> ObjIDWildcard : false Object list objectC owned by owner1: ObjIndex : 1 ObjID : 1.3.6.1.4.1.25506.2.6.1.1.1.1.8.11<hh3cEntityExt MemUsage.11> ObjIDWildcard : false
# Display information about the event.
[Sysname]display snmp mib event event owner owner1 name EventA Event entry EventA owned by owner1: EvtComment : N/A EvtAction : notification EvtEnabled : true Notification entry: NotifyOID : 1.3.6.1.4.1.25506.2.6.2.0.5<hh3cEntityExtMemUsag eThresholdNotification> NotifyObjOwner : owner1 NotifyObjName : objectC
# Display information about the trigger.
[Sysname] display snmp mib event trigger owner owner1 name triggerA Trigger entry triggerA owned by owner1: TriggerComment : N/A TriggerTest : boolean TriggerSampleType : absoluteValue TriggerValueID : 1.3.6.1.4.1.25506.2.6.1.1.1.1.9.11<hh3cEntityExt MemUsageThreshold.11> TriggerValueIDWildcard : false TriggerTargetTag : N/A TriggerContextName : N/A TriggerContextNameWildcard : false TriggerFrequency(in seconds): 60 TriggerObjOwner : owner1 TriggerObjName : objectA TriggerEnabled : true Boolean entry: BoolCmp : greater BoolValue : 10 BoolStartUp : true BoolObjOwner : owner1 BoolObjName : objectB BoolEvtOwner : owner1 BoolEvtName : EventA
# When the value of the monitored object 1.3.6.1.4.1.25506.2.6.1.1.1.1.9.11 is greater than 10, the NMS receives an mteTriggerFired notification.