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

Conflicting tags #3425

Closed
rvojcik opened this issue Nov 3, 2017 · 2 comments
Closed

Conflicting tags #3425

rvojcik opened this issue Nov 3, 2017 · 2 comments

Comments

@rvojcik
Copy link

rvojcik commented Nov 3, 2017

Hi Guys,
I think this is somehing wich was the case in #662

Bug report

I tried add tags to second SNMP Instance with different value and I get this

017/11/03 16:02:22 I! Using config file: /etc/telegraf/telegraf.conf
2017/11/03 16:02:22 E! Error parsing /etc/telegraf/telegraf.d/dc_doors.conf, toml: line 26: key `sensor' is in conflict with line 19

Relevant telegraf.conf:

[[inputs.snmp]]
  agents = [ "212.158.128.154:40160" ]
  timeout = "5s"
  retries = 3
  version = 1
  community = "public"
  name = "Doors"

  [[inputs.snmp.field]]
    name = "value"
    oid = "SNMPv2-SMI::enterprises.21796.3.3.1.1.4.1"
    conversion = "int"
    [inputs.snmp.tags]
      sensor = "door_1"

  [[inputs.snmp.field]]
    name = "value"
    oid = "SNMPv2-SMI::enterprises.21796.3.3.1.1.4.2"
    conversion = "int"
    [inputs.snmp.tags]
      sensor = "door_2"

System info:

Debian Wheezy
Telegraf version 1.4.3-1

Expected behavior:

I was expected that I will have measurement called Doors with value and different tags.
I have many of these sensors so it must be tagged to know which sensor is which.

@phemmer
Copy link
Contributor

phemmer commented Nov 3, 2017

[[inputs.snmp.field]] adds a field. [inputs.snmp.tags] has to go in an [[inputs.snmp]] section. You can't apply a tag to a field.
If you want to create multiple series, your options are to either set up an SNMP table (using [[inputs.snmp.table]], or define multiple [[inputs.snmp]] sections.

@rvojcik
Copy link
Author

rvojcik commented Nov 6, 2017

Thank you, I'd love to use snmp.table but sadly it's proprietary sensors solution and I cant use it. I define it separately. Thank you.

@rvojcik rvojcik closed this as completed Nov 6, 2017
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

2 participants