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

SNMP input plugin - Add table feature #540

Closed
titilambert opened this issue Jan 17, 2016 · 5 comments
Closed

SNMP input plugin - Add table feature #540

titilambert opened this issue Jan 17, 2016 · 5 comments

Comments

@titilambert
Copy link
Contributor

After a discussion with @TheFlyingCorpse, we designed a new config file like this:

[[plugins.snmp]]
  snmptranslatefile = "/tmp/oids.txt"
  # HOST
  [[plugins.snmp.host]]
    address = "192.168.2.2:161"
    community = "public"
    version = 2
    timeout = 2.0
    collect = ["sysuptime", "ifspeed"]
    [[plugins.snmp.host.table]]
      name = "iftable"
      include_instances = ["eth0", "eth1"]

  [[plugins.snmp.host]]
    address = "192.168.2.3:161"
    community = "public"
    version = 2
    timeout = 2.0
    collect = ["sysuptime"]
    [[plugins.snmp.host.table]]
      name = "iftable"
      exclude_instances = ["eth10", "eth20"]

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

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

  # SNMP TABLE
  [[inputs.snmp.table]]
    name = "iftable"
    oid = ".1.3.6.1.2.1.31.1.1.1"
    # if empty get all instances
    mapping_table = ".1.3.6.1.2.1.31.1.1.1.1" 
    # if empty get all subtables
    # sub_tables could be not "real subtables"  
    sub_tables=[".1.3.6.1.2.1.2.2.1.13", "bytes_recv", "bytes_send"]
    snmptranslate = true

  # SNMP SUBTABLE
  [[plugins.snmp.subtable]]
    name = "bytes_recv"
    oid = ".1.3.6.1.2.1.31.1.1.1.6"
    unit = "octets"

  [[plugins.snmp.subtable]]
    name = "bytes_send"
    oid = ".1.3.6.1.2.1.31.1.1.1.10"
    unit = "octets"
@cwegener
Copy link
Contributor

cwegener commented Feb 9, 2016

👍
I would love to be able to easily get multiple metrics(columns) from tables with many instances/rows (~100).

I don't understand the concept of 'SNMP SUBTABLE' and 'mapping_table' though.
Could you explain those 2 concepts? I can't find them used in any of the net-snmp apps.

@titilambert
Copy link
Contributor Author

@cwegener Hello ! This is not net-snmp concepts. It's just two small concepts for this plugin to make configuration easier.

@tux-00
Copy link

tux-00 commented Feb 16, 2016

Is it possible to change the polling interval by requests ?

@titilambert
Copy link
Contributor Author

Yes ! This is a feature of telegraf. You can specify an interval by plugin conf :

[[plugins.snmp]]
  interval = "30s"
  snmptranslatefile = "/tmp/oids.txt"
  # HOST
  [[plugins.snmp.host]]
    address = "192.168.2.2:161"
    community = "public"
    version = 2
    timeout = 2.0
    collect = ["sysuptime"]
  # SNMP GET
  [[plugins.snmp.get]]
    name = "sysuptime"
    oid = ".1.3.6.1.2.1.1.3.0"
    unit = "seconds"


[[plugins.snmp]]
  interval = "5m"
  snmptranslatefile = "/tmp/oids.txt"
  # HOST
  [[plugins.snmp.host]]
    address = "192.168.2.2:161"
    community = "public"
    version = 2
    timeout = 2.0
    collect = ["sysuptime"]
  # SNMP GET
  [[plugins.snmp.get]]
    name = "sysuptime"
    oid = ".1.3.6.1.2.1.1.3.0"
    unit = "seconds"

See example: https://github.com/influxdata/telegraf/blob/master/internal/config/testdata/single_plugin.toml

@tux-00
Copy link

tux-00 commented Feb 16, 2016

Nice!
Maybe can we put an example line in the sample config file ?

Because this is not always evident. (#704)

titilambert added a commit to titilambert/telegraf that referenced this issue Feb 17, 2016
titilambert added a commit to titilambert/telegraf that referenced this issue Feb 19, 2016
titilambert added a commit to titilambert/telegraf that referenced this issue Feb 22, 2016
titilambert added a commit to titilambert/telegraf that referenced this issue Feb 22, 2016
titilambert added a commit to titilambert/telegraf that referenced this issue Feb 22, 2016
titilambert added a commit to titilambert/telegraf that referenced this issue Feb 22, 2016
titilambert added a commit to titilambert/telegraf that referenced this issue Feb 22, 2016
titilambert added a commit to titilambert/telegraf that referenced this issue Mar 1, 2016
sparrc pushed a commit that referenced this issue Mar 3, 2016
@sparrc sparrc closed this as completed in 72027b5 Mar 3, 2016
geodimm pushed a commit to miketonks/telegraf that referenced this issue Mar 10, 2016
geodimm pushed a commit to miketonks/telegraf that referenced this issue Mar 10, 2016
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

3 participants