Sending SNMP traps from icinga2 => TrapX

snmp
icinga2

(Siarhei Pishchyk) #1

I’m working on implementation sending SNMP traps by Icinga2 toward TrapX. I’d created EventCommand object and simple script to check event command itself. I understand, for sending tarps i need create/use Icinga2 OID/MIBs for my alert events.

Can I use MIBs created by me or Icinga2 uses own OID/MIBs?
Can Icinga2 generate MIBs files based on existing events in Icinga2 itself (service/hardware states or triggers)?

Many thanks for any information


(Michael Friedrich) #2

Icinga 2 doesn’t know anything about MIBs and won’t generate such. I would also advise against event commands, as they are only executed on state changes, and not e.g. on a new check result itself. Furthermore, you can use reliable http techniques with the REST API and event streams in a better way.

The question remains, what exactly would be needed in such a MIB, as lots of the data is rather generic (host, service, output, perfdata, state_type, etc.)

Do you have any details on TrapX, how it expects such traps being sent, or does it have sort of dynamic mapping/aggregation?


(Siarhei Pishchyk) #3

dnsmichi, thank for your answer.

TrapX team asked me about icinga2 MIB files, i think for import to Spectrum monitoring tool (they are going use Icinga2 as source of alert => TrapX => Spectrum).

I used this command to checking traps send/receive inside
snmptrap -v 2c -c COMMUNITY TrapX_IPs OID TYPE VALUE

I think, I need clarify this part OID TYPE VALUE and send them list like
SOME_OID.0 STRING "HOST"
SOME_OID.0.1 STRING "NAME_SERVICE_01"
SOME_OID.0.1.1 STRING "STATE_OF_SERVICE_01"
SOME_OID.0.1.2 INTEGER "CRITICAL_VALUE"
SOME_OID.0.1.3 STRING "PERF_DATA/PLUGIN_OUTPUT"
SOME_OID.0.2 STRING “SERVICE_02”


(Michael Friedrich) #4

As there is no official MIB, you probably need to create a custom one, if the tool really relies on that. That also involves to choose an OID prefix for that matter.

TrapX seems like a commercial tool with no public docs about interfaces. That’s a tough one then.


(Siarhei Pishchyk) #5

Thank you for clarification.
I think, I will begin create own OID list like this
<SOME_VARIABLE_ENTERPRISE_BASE_ID.MY.ID.suffix>

As I see, Your answer was confirmed my next steps. I have heard same recommendations from another people.

Many thanks for this conversation


(Uwe Ebel) #6

Have a look at

for a base snmp mib in icinga2.

It includes definition for attributes and objects that are usefull in icinga2.
Also notification definition for sending traps to an snmp trap receiver.

Give a try send some feedback.