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