Existence trigger test configuration example
Network requirements
As shown in Figure 54, the device acts as the agent. Use Event MIB to monitor the device. When interface hot-swap or virtual interface creation or deletion occurs on the device, the agent sends an mteTriggerFired notification to the NMS.
Figure 54: 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
# Set the SNMP context to contextnameA.
[Sysname] snmp-agent context contextnameA
# 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 [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 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 sampling interval is greater than or equal to the Event MIB minimum sampling interval.
[Sysname-trigger-owner1-triggerA] frequency 60
# Specify the object IfIndex OID 1.3.6.1.2.1.2.2.1.1 as the monitored object. Enable wildcard search for OIDs.
[Sysname-trigger-owner1-triggerA] oid 1.3.6.1.2.1.2.2.1.1 [Sysname-trigger-owner1-triggerA] wildcard oid
# Configure the context contextnameA for the monitored object and enable wildcard search for contexts.
[Sysname-trigger-owner1-triggerA] context contextnameA [Sysname-trigger-owner1-triggerA] wildcard context
# Specify the existence trigger test for the trigger.
[Sysname-trigger-owner1-triggerA] test existence [Sysname-trigger-owner1-triggerA-existence] quit
# Enable the trigger.
[Sysname-trigger-owner1-triggerA] trigger enable [Sysname-trigger-owner1-triggerA] quit
Verifying the configuration
# Display Event MIB brief information.
[Sysname] display snmp mib event summary TriggerFailures : 0 EventFailures : 0 SampleMinimum : 50 SampleInstanceMaximum : 100 SampleInstance : 20 SampleInstancesHigh : 20 SampleInstanceLacks : 0
# Display information about the trigger with the owner owner1 and the name trigger A.
[Sysname] display snmp mib event trigger owner owner1 name triggerA Trigger entry triggerA owned by owner1: TriggerComment : N/A TriggerTest : existence TriggerSampleType : absoluteValue TriggerValueID : 1.3.6.1.2.1.2.2.1.1<ifIndex> TriggerValueIDWildcard : true TriggerTargetTag : N/A TriggerContextName : contextnameA TriggerContextNameWildcard : true TriggerFrequency(in seconds): 60 TriggerObjOwner : N/A TriggerObjName : N/A TriggerEnabled : true Existence entry: ExiTest : present | absent ExiStartUp : present | absent ExiObjOwner : N/A ExiObjName : N/A ExiEvtOwner : N/A ExiEvtName : N/A
# Create VLAN-interface 2 on the device.
[Sysname] vlan 2 [Sysname-vlan2] quit [Sysname] interface vlan 2
The NMS receives an mteTriggerFired notification from the device.