New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


SNMP-Trap should create warning on value 42

Votes:

0

Your Vote:

Up

Down

I want to send an SNMP-trap to prtg with a value of 42. PRTG should go to warning when getting it. The trap can be seen in messages, but there is no action done (getting yellow) from PRTG.

This is what I have done:

Create a PRTG-Sensor of type SNMP Trap Receiver

Port: 162
Purge Messages after: 2 hours
Include filter: source[10.x.x.x] AND community[public]
Warning filter: bindings[1.3.6.1.4.8072.100.2.1,42,equal]

Sending an SNMP-Trap by Shell from a Debian-Linux

{{{export COMMUNITY=public export SNMP_VERSION=2c export SNMPTRAP_RECEIVER=prtg.xxxxxxxxxxxxxxxxxxxxx.de

  1. every Trap must send an Uptime, this can be done with "" or 0
  2. to fetch the value from the operating system export UPTIME=0
  1. official Start-OID to make tests: export TEST_OID_BASE=1.3.6.1.4.8072
  1. something I was inventing. The device shall send a heartfrequence as trap
  2. when something is wrong with the patient. The patient has more than one heart
  3. to send values export OID_HEART_FREQUENCY=${TEST_OID_BASE}.100.2
  1. all variable-types found her: snmpset -h
  2. variable-type=i -> integer
  3. variable-type=s -> string

export VARTYPE=i export MESSAGE=42 export MESSAGE2=10

  1. Send two values .0 und .1 (this could be the left and the right heart snmptrap -c $COMMUNITY -v $SNMP_VERSION $SNMPTRAP_RECEIVER $UPTIME ${OID_HEART_FREQUENCY} ${OID_HEART_FREQUENCY}.0 $VARTYPE $MESSAGE ${OID_HEART_FREQUENCY}.1 $VARTYPE $MESSAGE2 }}}

How it looks like in PRTG

In the sensor in PRTG I see in the tab "Messages" that the snmp-trap arrived:

+Bindings+
SNMPv2-MIB::snmpTrapOID.0 = SNMPv2-SMI::private.8072.100.2
SNMPv2-SMI::private.8072.100.2.0 = 42
SNMPv2-SMI::private.8072.100.2.1 = 10

So the trap arrived in the right sensor-"slot".

In "Overview" I see these channels:

Messages, Drops, Errors, Warnings.

I don't see channel 100.2.0 oder 100.2.1

What I would like to see

PRTG should go to warning state.

snmp-trap value warning

Created on Feb 19, 2020 3:08:24 PM by  Richard Lippmann (160) 1 1



2 Replies

Votes:

0

Your Vote:

Up

Down

I was thinking much to complicate about this check. After investigating I found this wisdom for myself:

There is a scanning interval for the sensor I created not on the probe (toplevel) but on a single machine which shall be observed by PRTG. I set this scanning interval down from 5 minutes which I use to 60 seconds.

When an SNMP-Trap is fetched by this sensor I see this in "Messages" of this SNMP-Trap-Receiver-Sensor. Not everything is fetched by my sensor because I am "filtering" to see only what I want to see:

Include filter: source[10.x.x.x] AND community[public]

What is a warning? An SNMP-trap is seen as a warning when define the condition to be a warning in "Warning Filter". I did it like this:

Warning filter: bindings[1.3.6.1.4.8072.100.2.1,42,greater]

This means that an SNMP-trap with the oid 1.3.6.1.4.8072.100.2.1 and a value > 42 leads to a warning.

This PRTG SNMP-Trap-Receiver now waits for a whole scanning interval (in my example 60 seconds) and ONLY COUNTS warnings. It does not create channels automatically, it ONLY COUNTS the number of warnings in the scanning period. When there is at least one warning the status of the sensor is warning.

In the next scanning interval when there is a warning again -> Sensor is warning.

In the next scanning interval when there is NO warning trap -> Sensor is ok.

As I can see there is no collection of data to graphs. The only collecting which is made by PRTG is collecting the messages (in tab "Messages" of the sensor). These messages are only human readable, the values are not collected to a graph. The messages get removed by PRTG after 2hours here, this is the time I can choose in the settings of the sensor: SNMP Trap Specific -> Purge Messages After: 2 hours (or 12 hours, a week, a year...)

Created on Feb 20, 2020 7:37:57 AM by  Richard Lippmann (160) 1 1



Votes:

0

Your Vote:

Up

Down

Thanks for posting the actual solution here, Richard! Most appreciated!

Created on Feb 20, 2020 11:18:26 AM by  Stephan Linke [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.