flapjack / flapjackfeeder

Nagios/Icinga event broker module (neb), inserts events to Flapjack's Redis queue
GNU General Public License v2.0
8 stars 5 forks source link

tagging checks #8

Closed pulecp closed 9 years ago

pulecp commented 9 years ago

question

We are just trying to deploy flapjack with Icinga.

We would need to tagging checks going from Icinga to flapjack or add some special field from Icinga like "servicegroups" or " membership" of host/service. We would like to use tagging as in Sensu, where you can define for every check any tags.

I found definition of NEB module which Flapjackfeeder is using http://larsmichelsen.com/nagios/nagios-event-broker/. There is noted that full list of information which we can get from Icinga through this module can be found in the nebcallbacks.h https://github.com/Icinga/Icinga-core/blob/master/include/nebcallbacks.h. But I'm not sure if is possible to get above mentioned information about check. If it would be possible then we could adjust Flapjackfeeder to sending relevant data to the Flapjack where we can parse it.

jessereynolds commented 9 years ago

At the moment you can’t add custom tags to be passed by flapjackfeeder, but note that every word in your check definition / name will be created as ephemeral tags on the event in flapjack, also the domain and host parts of the fqdn (eg foo-app-01.example.com creates tags “foo-app-01” and “example.com”)

eg if check name is “HTTP Regex for www.example.com” then you get that split into 4 tags also ‘HTTP’, ‘Regex’, etc

It may be possible to extend flapjackfeeder to create event tags to carry through the servicegroups etc, eg "servicegroup:group_1", "servicegrouop:group_2" etc

pulecp commented 9 years ago

Matching hostname is good way but it's not enough.

Are you sure that NEB provides information about servicegroups beacuse I didn't find it defined it here: https://github.com/Icinga/Icinga-core/blob/master/include/nebcallbacks.h

jessereynolds commented 9 years ago

@pulecp sorry no I'm not at all sure that it's possible. I was discussing this with @bs-github yesterday, perhaps he can shed some more light.

jessereynolds commented 9 years ago

@bs-github is now working on this. The plan is to pick up the following custom variables from the Nagios/Naemon/Icinga configuration:

bs-github commented 9 years ago

The code is still not 100%, but a good part of it should be done. https://github.com/flapjack/flapjackfeeder/commit/2699b49f39552d47750ead7c794e9dfafd9c1212

One thing is implemented differently: For _tags - containing tags delimited by ! the code ignores the !s completely. But you can use multiple _tags lines instead.

jessereynolds commented 9 years ago

Excellent work.

With _tags - do you mean that Nagios doesn't send through the full value including the !s? Or that you haven't done the split yet?

bs-github commented 9 years ago

I haven't done a split on ! and I do even think multiple _tags lines are more elegant. Also that already works. So, I tend to not implement the split thing.

jessereynolds commented 9 years ago

OK. Perhaps we should change it to _tag (singular) then.

bs-github commented 9 years ago

done.