Administrator Handbook Table of contents version française LinkedIn social network LinkedIn social network LinkedIn social network LinkedIn social network Share on social media

Using snmp trap in Active View

The goal of this document is to explain how to use incoming snmp trap to change the color status of an Active View object.

Two examples are explained below

Remark  :  The host term define any device with n IP address, a router, a server, a switch, etc.

Example 1  (Based on the host trap counter)

The first example explains how to set up the Active View below.

The Active View displays hosts with a background color linked to the trap received counter.

When the value is different of 0 the host become red, the counter value is increased.

Working principles

Hosts are set up to send their snmp trap to LoriotPro.

When a snmp trap is received, an internal counter of Loriotpro is increased. Each host object in LoriotPro directory has an internal counter for the trap received from the host snmp agent.

In the Active View the graphical object for the host is setup to be green if the trap counter value is 0 and red in any other case.

An additional button is setup in the Active View to perform a reset of the counter

Creating the Active View

Add an Active View in the Directory Tree and create graphical objects for each host.

(See this chapter for Active View Creation)

Open the properties of the host object

Check the Activate Dynamic Aspect, choose a polling interval of 15 seconds.

In the Wizard select the condition Get trap counter for a host.

A popup is displayed choose the Wizard Mode and  No option for Use Default IP address


Find the host in the directory.

Answer No to the question Load Expression Filter ?

Add rules for the object color based on the counter value. See our example below

Do the same opération for all the hosts that you want to monitor trap.

Adding the host trap received counter value in the Active View

Create a button with a drag and drop of an Outlined text object. see below:

The object dynamic aspect is also base on the counter value but we do not enter rules to change the object color.

However, the Fill Text Object should be checked for displaying the returning counter value within the box.

Adding the Reset Button

Create a button with a drag and drop of an Outlined text object.

Open the properties of the button.

In the Mouse Action tab choose the Clear Host Trap Counter and choose the host IP address from the wizard.

The Active View example is finished, we can test it.

If no trap is received yet the host(s) object(s) should be green and the counter value should be 0, else do a Reset Trap Counteur.

When a trap is received from a host, the corresponding host on the Active View should become red. 

In our example, 8 trap were received in the Trap log, the counter is red and show the 8 value.


Example 2  (Based on a filtered snmp trap)

In this example the color depends from a counter base on a trap filter. Such counter is increase each time that the filter is satisfied by an incoming trap.

The snmp Trap used here is a Link Down trap snmp v2. This trap is send by an Ethernet switch in our example each time that a specific cable link is out of order or disconnected.

The Active View below shows two hosts, one switch and one router. The objects are green when Loriotpro successfully polls them. Under the switch the counter value for the link down trap of the network interface 9 is displayed.

If the value is different from 0 the value is displayed in a red box instead of green (default color).

The first configuration step consist of defining a trap filter for the Link Down trap that comes from that particular host and that are related to the network interface 9 of our switch.

The easiest way for defining the filter is to generate the trap by disconnecting physically the cable of the Interface 9. If it is not possible simulate the trap from the Trap Simulator (see example at the end of this document).

In the Trap log of LoriotPro you should have an entry for the incoming trap. Check the host snmp agent configuration is you don't receive the link down trap.(In our case the Alcatel switch requires that the Link Down trap is enable for each port of the switch)

(In our example the  switch  Alcatel 6624 is setup in snmp v2).

A double click on the trap display the snmp trap details:

The field parameters (variable binding) display information that we should filter.

The parameter 1 field provides the index number of the network interface. (OID = ifindex, Value = 1009)

The parameter 3 field provides the operational status of the port. (OID = ifoperstatus, Value = up)

From this trap in the log we can invoke the Wizard to create the filter.

The filter configuration should be made with cautious.

First, be sure that the IP address is the good one. The mask of will select this host and only this one.

Check the box for the %0 and %2 variables and choose the equal condition.

In the Action Wizard choose Play sound and a sound.

Adavnced properties are not changed

When done the new filter should be visible in the filter tree

Create the Active View and the objects and open the properties  (right click) of the object  counter (purple in our example below)

Select the Dynamic Aspect tab of the properties dialog box.

Set the Dynamic check box and the polling interval.

Choose the Get a Trap Filter Counter option of the wizard list box.

A popup ask you to use the Wizard, answer YES. Filter uses UID (large number defined in the trap filter file)) and selection by the wizard is recommended.

The Wizard is displayed, choose the filter that was previously created.

Add the rules for coloring the object in relation with the counter values. Value of 0, the object is green, value higher than 0 the object is red.

Finally check the Fill Text Object box for displaying the counter value in the object.

We can now add the behavior for the Reset button.

Open the Reset button properties


In the Mouse Action tab, choose the Clear Trap Filter Counter option. Thewizard is invoked and you can select the trap filter.

The configuration is terminted nd can be tested. The best way is to generate a trap by disconncting the cablee on the port. The trap log should display the trap few seconds later and the object of the view should become red and display the counter value in the next 15 seconds.

If the trap cannot be simultaed du to exploitation considerations,  use the Trap Simulator plugin of Loriotpro.