Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this plugin be extended to receive snmp traps? #44

Closed
tchenscw opened this issue Nov 19, 2018 · 12 comments
Closed

Can this plugin be extended to receive snmp traps? #44

tchenscw opened this issue Nov 19, 2018 · 12 comments
Assignees

Comments

@tchenscw
Copy link

Hi,
Since snmpv3 support for snmptrap plugin has been opened for a long time, I was wondering whether there is a way to extend this plugin to receive snmp traps via v3 protocol.

@edperry
Copy link

edperry commented Nov 20, 2018

@tchenscw
Copy link
Author

Hi edperry,
I did. But this issues logstash-plugins/logstash-integration-snmp#49 remains opened since 2015. Even longer for the ruby support of snmpv3. My angle is since snmp input plugin act similar as snmp manager, extending it with trap receiver would not be as far fetched. Any thoughts?

Thanks

@edperry
Copy link

edperry commented Nov 21, 2018

I am not the repo manager, but it seems the reason the logstash-input-snmptrap did not implement is because the "gem" snmp library does not support it. I don't know if both are using the same library or not. This a bet would be that they are.

As for adding it to this project, IMO it would not be appropriate, since this is a "Polling" plugin and receiving SNMP traps is a Passive operation (Listening) those are completely 2 different functions and again IMO should be 2 seperate functions like logstash-input-file and logstash-input-tcp similar functionality but different logic and behavior.

but again, these are only my thoughts based on my observation of the Logstash community over the years. I would defer to any of the repo-admins to their opinions.

@axrayn
Copy link
Contributor

axrayn commented Nov 21, 2018

@tchenscw Pretty much as @edperry says. The logstash-input-snmptrap is a purely ruby implementation using the http://github.com/hallidave/ruby-snmp gem for the SNMP parts whereas this plugin is JRuby using the SNMP4J Java library.

The problem arises because (last I checked) the author of the ruby gem said back in 2011 that he didn't have the time or motivation to add it (hallidave/ruby-snmp#2 (comment)) in writing v3 support.

As for including SNMP trap support in this plugin, whilst @colinsurprenant does have it listed in the 'Post GA' plans in the META issue logstash-plugins/logstash-input-snmptrap#2, I'd be inclined to agree with @edperry that this plugin is more designed as a poller not a listener.

@colinsurprenant
Copy link
Contributor

@tchenscw @edperry @axrayn thanks for your input here!

  • Yes the legacy snmptrap input is mostly unmaintained at this time and does rely on an old gem that does not support v3.
  • The original plan per support multiple community strings logstash-input-snmptrap#2 Post V1 GA tasks is to bring back the trap handling into this new snmp input plugin.
  • I do not see any problem in handling both polling and receiving traps into this same plugin. If someone really want separate handling for polling and trap handling then it will be possible to use two plugin instances (in 2 defferent pipelines if needed too) just for that.
  • The usage of the solid SNMP4J library here will provide more robust trap handling and we will be able to reuse all rest of the infrastructure code we have here too.

@colinsurprenant colinsurprenant self-assigned this Nov 21, 2018
@axrayn
Copy link
Contributor

axrayn commented Nov 21, 2018

Ironically, after I posted, I started looking at whether I could rewrite the snmptrap plugin from scratch using the SNMP4J library. I stopped after the third or fourth "I'll just borrow this function from the snmp plugin...." and had realised the craziness. :)

@colinsurprenant
Copy link
Contributor

@axrayn, any PRs for that are welcome 😄 I myself likely won't be able to work on that in the next few weeks.

@axrayn
Copy link
Contributor

axrayn commented Nov 22, 2018

@colinsurprenant I'm still struggling with tables, that's a higher priority for our needs at work. Will definitely see what I can do though.

@colinsurprenant
Copy link
Contributor

@axrayn finding the best way to represent snmp tables is definitely high on my priorities too. I'd love to hear your thoughts, let's open a separate "design" issue about this.

@colinsurprenant
Copy link
Contributor

@axrayn opened #45 for this.

@tchenscw
Copy link
Author

@colinsurprenant @axrayn
Thanks for the explanation. Glad to hear there is a plan to support trap receiver. Our group has some expertise in Java but not in Ruby. We will follow closely and see if there's anything we can help.

@colinsurprenant
Copy link
Contributor

Issue #46 discusses trap handling. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants