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

Add snmp input plugin #495

Closed
wants to merge 37 commits into from
Closed

Add snmp input plugin #495

wants to merge 37 commits into from

Conversation

titilambert
Copy link
Contributor

This is a new PR of #453 rebased on 0.3.0

@titilambert titilambert changed the title Add snmp plugin Add snmp input plugin Jan 8, 2016
sparrc and others added 2 commits January 14, 2016 09:21
With HTTP JSON or Elasticsearch, one can also process values nested in arrays.
@sparrc
Copy link
Contributor

sparrc commented Jan 14, 2016

@titilambert I don't quite understand how this is configured? Users can specify an OID file from snmptranslate, or they can input each OID into the config file?

Address string
Community string
// SNMP version. Default 2c
Version int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be a string?

@sparrc sparrc mentioned this pull request Jan 15, 2016
@TheFlyingCorpse
Copy link
Contributor

How would I go forward with this to get a table with interfaces and their metrics with correlation?

Would it be possible to choose one value over another, depending if it is present or not? Thinking IF-MIB 's ifXTable (counter64) vs interfaces (counter32) issue on some appliances even to this day.

I have a lot of data I want to gather that is in the snmp table format so I think this is imporant. I dont neccesarily want all columns/rows from the table either, I want to have some way to choose which results to insert. Maybe both on a given alias/name or only these columns. Thoughts?

@titilambert
Copy link
Contributor Author

Hello ! @TheFlyingCorpse I worked on an other SNMP project called SNMPbooster for Shinken (http://shinken-module-snmp-booster.readthedocs.org/en/latest/). I can try to adapt its concept to this plugin if you find it useful ...
Tell me what you think about.

@titilambert titilambert force-pushed the snmp branch 3 times, most recently from d7e1b44 to 2ca2af4 Compare January 16, 2016 18:02
@titilambert
Copy link
Contributor Author

@sparrc I add some comments in sample config output.
BTW, I waiting the @TheFlyingCorpse response, But I think this plugin could be merged now, And I could add feature when needs will be more clear.

@TheFlyingCorpse
Copy link
Contributor

@titilambert - if you could provide examples for how you would do tables like interfaces/ifXtable that would be great and really what I would need to be able to start testing myself.
SNMPbooster seems a bit complex for something simple like polling 1-2000 nodes for SNMP and giving that data to a backend like influxdb.
I was thinking of querying Influxdb with some tool to get a simple holtWinters or linear prediction to see if the values deviate too far in any way and show this in icinga or similar based on what value type it is (disk usage for example). Maybe Kapacitor could watch in the stream for this in the future :)

@titilambert
Copy link
Contributor Author

@TheFlyingCorpse here some examples
If you want to get a specific OID (with SNMP get)

  [[plugins.snmp.get]]
    name = "sysuptime"
    oid = ".1.3.6.1.2.1.1.3.0"
    unit = "seconds" 

if you want to get a entire table (with SNMP bulk)

  [[plugins.snmp.bulk]]
    name = "ifspeed"
    max_repetition = 127
    oid = ".1.3.6.1.2.1.2.2.1.5"

Then set your hosts

  [[plugins.snmp.host]]
    address = "192.168.2.2:161"
    community = "public"
    version = 2
    timeout = 2.0
    collect = ["sysuptime" ,"ifspeed"]

  [[plugins.snmp.host]]
    address = "192.168.2.3:161"
    community = "public"
    version = 2
    timeout = 2.0
    collect = ["sysuptime" ]

The collect array define which oid you want to get for the host.

To get oid translated

[[plugins.snmp]]
  snmptranslatefile = "/tmp/oids.txt"
  [[plugins.snmp.host]]
    address = "192.168.2.3:161"
    community = "public"
    version = 2
    timeout = 2.0
    collect = ["sysuptime" ]

  [[plugins.snmp.get]]
    name = "sysuptime"
    oid = ".1.3.6.1.2.1.1.3.0"
    unit = "seconds"
    snmptranslate = true

where /tmp/oids.txt is generated with snmptranslate -m all -Tz -On | sed -e 's/"//g' > /tmp/oids.txt

@titilambert
Copy link
Contributor Author

@TheFlyingCorpse about the ifXtable example, unfortunately, you have to add each OID manually (or script generated) :/

  [[plugins.snmp.get]]
    name = "eth0_in_octets"
    oid = "iso.3.6.1.2.1.31.1.1.1.6.1"
    snmptranslate = true

  [[plugins.snmp.get]]
    name = "eth1_in_octets"
    oid = "iso.3.6.1.2.1.31.1.1.1.6.2"
    snmptranslate = true

  [[plugins.snmp.get]]
    name = "eth0_out_octets"
    oid = "iso.3.6.1.2.1.31.1.1.1.10.1"
    snmptranslate = true

  [[plugins.snmp.get]]
    name = "eth1_out_octets"
    oid = "iso.3.6.1.2.1.31.1.1.1.10.2"
    snmptranslate = true

@titilambert
Copy link
Contributor Author

@TheFlyingCorpse about your first question, I'm agree with you to get something better with "metrics correlation". But, this feature need this plugin have to store some data between two checks... and I don't know how to do it. Maybe @sparrc can help me on this point ?

@titilambert
Copy link
Contributor Author

@TheFlyingCorpse to be short, this is only the first version of this plugin, the next one will be much better ;)

@TheFlyingCorpse
Copy link
Contributor

I'm not thinking correlation for past checks, thats up to the backend to do (counter32/64 etc). What I was hoping for was an example of how I could easily get ifXtable and select which columns (or rows by some string to an oid?), not adding all OIDs manually. What else are the SNMP MIB conversion process for?

@titilambert
Copy link
Contributor Author

@TheFlyingCorpse SNMP conversion process, it just convert your mib files into a single file with lines like:

...
ifHCInOctets            1.3.6.1.2.1.31.1.1.1.6
ifHCInUcastPkts         1.3.6.1.2.1.31.1.1.1.7
ifHCInMulticastPkts         1.3.6.1.2.1.31.1.1.1.8
ifHCInBroadcastPkts         1.3.6.1.2.1.31.1.1.1.9
ifHCOutOctets           1.3.6.1.2.1.31.1.1.1.10
ifHCOutUcastPkts            1.3.6.1.2.1.31.1.1.1.11
ifHCOutMulticastPkts            1.3.6.1.2.1.31.1.1.1.12
ifHCOutBroadcastPkts            1.3.6.1.2.1.31.1.1.1.13
...

It use to send ifHCInOctets instead of 1.3.6.1.2.1.31.1.1.1.6 to influxDB ....

Can we discuss about your needs on IRC ? It could be useful to get some specs :)

@TheFlyingCorpse
Copy link
Contributor

@titilambert Sure, I see I didnt catch the full example earlier. I'm on IRC under this nickname on freenode.

@titilambert
Copy link
Contributor Author

@sparrc After a discussion with @TheFlyingCorpse you can merge it, if you think this is good. I will release a new version of this plugin with more features later

- If we detect errors when gathering stat via socket, return those error
  so it canbe appear in Telegraf log
- Improve fcgi client, also upgrade it to current version of Go at
  https://golang.org/src/net/http/fcgi/fcgi.go
- Add test for unix socket and fcgi
  to remotely connect but only as an extra url field.
- Allow customization of fpm status path
- Document about using of `host` in case `unixsocket` that it isn't used
- Documet upgrade for new data layout

closes influxdata#499
closes influxdata#502
closes influxdata#538
@sparrc
Copy link
Contributor

sparrc commented Jan 18, 2016

Thanks @titilambert, can you change the PR to be pushing to master? that way it will be more clear the actual changes inbound

sparrc and others added 5 commits January 18, 2016 11:05
Gather metric by parsing XMLoutput of `passenger-status` utility.
More information of this utility:
https://www.phusionpassenger.com/library/admin/apache/overall_status_report.html

closes influxdata#522
With the advent of Kafka 0.9.0+ it is possible to set up TLS client
certificate based authentication to limit access to Kafka.

Four new configuration variables are specified for setting up the
authentication. If they're not set the behavior stays the same as
before the change.

closes influxdata#541
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

Successfully merging this pull request may close these issues.

7 participants