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

Translate option isn’t working #15617

Closed
PFraire opened this issue Jul 11, 2024 · 6 comments · Fixed by #15618
Closed

Translate option isn’t working #15617

PFraire opened this issue Jul 11, 2024 · 6 comments · Fixed by #15618
Labels
bug unexpected problem or unintended behavior

Comments

@PFraire
Copy link

PFraire commented Jul 11, 2024

Relevant telegraf.conf

[[inputs.snmp.field]]
    oid = "SNMPv2-MIB::sysObjectID.0"
    translate = true

Logs from Telegraf

[server test]$ telegraf --config telegraf.cfg --config-directory /test/ --debug --test
2024-07-11T12:06:17Z I! Loading config: telegraf.cfg
2024-07-11T12:06:17Z I! Loading config: /test/INPUTS_SNMPv2-MIB.conf
2024-07-11T12:06:17Z I! Starting Telegraf 1.30.3 brought to you by InfluxData the makers of InfluxDB
2024-07-11T12:06:17Z I! Available plugins: 233 inputs, 9 aggregators, 31 processors, 24 parsers, 60 outputs, 6 secret-stores
2024-07-11T12:06:17Z I! Loaded inputs: snmp
2024-07-11T12:06:17Z I! Loaded aggregators:
2024-07-11T12:06:17Z I! Loaded processors:
2024-07-11T12:06:17Z I! Loaded secretstores:
2024-07-11T12:06:17Z W! Outputs are not used in testing mode!
2024-07-11T12:06:17Z I! Tags enabled:
2024-07-11T12:06:17Z D! [agent] Initializing plugins
2024-07-11T12:06:30Z D! [agent] Starting service inputs
2024-07-11T12:06:30Z D! [agent] Stopping service inputs
2024-07-11T12:06:30Z D! [agent] Input channel closed
2024-07-11T12:06:30Z D! [agent] Stopped Successfully
> SNMPv2-MIB::system,SNMPv2-MIB::sysContact=X,SNMPv2-MIB::sysLocation=X,SNMPv2-MIB::sysName=X,source=172.18.35.21,sysDescr.0=X,sysObjectID.0=.1.3.6.1.4.1.2011.2.239.57 IF-MIB::ifNumber=60i,SNMPv2-MIB::sysUpTime=12535234.94 1720699590000000000
[server test]$ telegraf --config /test/telegraf.cfg --config-directory /test/ --debug --test
2024-07-11T12:08:22Z I! Loading config: /test/telegraf.cfg
2024-07-11T12:08:22Z W! DeprecationWarning: Value "netsnmp" for option "snmp_translator" of plugin "agent" deprecated since version 1.25.0 and will be removed in 2.0.0: Use 'gosmi' instead
2024-07-11T12:08:22Z I! Loading config: /test/INPUTS_SNMPv2-MIB.conf
2024-07-11T12:08:22Z W! DeprecationWarning: Value "netsnmp" for option "snmp_translator" of plugin "agent" deprecated since version 1.25.0 and will be removed in 2.0.0: Use 'gosmi' instead
2024-07-11T12:08:22Z I! Starting Telegraf 1.30.3 brought to you by InfluxData the makers of InfluxDB
2024-07-11T12:08:22Z I! Available plugins: 233 inputs, 9 aggregators, 31 processors, 24 parsers, 60 outputs, 6 secret-stores
2024-07-11T12:08:22Z I! Loaded inputs: snmp
2024-07-11T12:08:22Z I! Loaded aggregators:
2024-07-11T12:08:22Z I! Loaded processors:
2024-07-11T12:08:22Z I! Loaded secretstores:
2024-07-11T12:08:22Z W! Outputs are not used in testing mode!
2024-07-11T12:08:22Z I! Tags enabled:
2024-07-11T12:08:22Z D! [agent] Initializing plugins
2024-07-11T12:08:22Z D! [inputs.snmp] executing "snmptranslate" "-Td" "-Ob" "SNMPv2-MIB::sysDescr.0"
2024-07-11T12:08:22Z D! [inputs.snmp] executing "snmptranslate" "-Td" "-Ob" "SNMPv2-MIB::sysObjectID.0"
2024-07-11T12:08:23Z D! [agent] Starting service inputs
2024-07-11T12:08:23Z D! [agent] Stopping service inputs
2024-07-11T12:08:23Z D! [agent] Input channel closed
2024-07-11T12:08:23Z D! [agent] Stopped Successfully
> SNMPv2-MIB::system,SNMPv2-MIB::sysContact=X,SNMPv2-MIB::sysLocation=X,SNMPv2-MIB::sysName=X,source=172.18.35.21,sysDescr.0=X,sysObjectID.0=.1.3.6.1.4.1.2011.2.239.57 IF-MIB::ifNumber=60i,SNMPv2-MIB::sysUpTime=12535347.95 1720699703000000000

System info

Telegraf 1.30.3 CentOS Linux 7 (Core)

Docker

No response

Steps to reproduce

translate = true

Expected behavior

SNMPv2-MIB::sysObjectID=HUAWEI-MIB::ce6857-48S6CQ-EI

Actual behavior

SNMPv2-MIB::sysObjectID=.1.3.6.1.4.1.2011.2.239.57

Additional info

More debugging detail in:

https://community.influxdata.com/t/begginer-question-snmp-plugin-how-to-translate-oid-when-is-a-tag-value/34906

@PFraire PFraire added the bug unexpected problem or unintended behavior label Jul 11, 2024
Hipska added a commit to Super-Visions/telegraf that referenced this issue Jul 11, 2024
@Hipska
Copy link
Contributor

Hipska commented Jul 11, 2024

@PFraire please test the binary in PR #15618, available as soon as CI finished tests, and let me know if this works for you!

@PFraire
Copy link
Author

PFraire commented Jul 11, 2024 via email

@Hipska
Copy link
Contributor

Hipska commented Jul 12, 2024

You are right, a new fixed binary is on its way in the PR!

@PFraire
Copy link
Author

PFraire commented Jul 12, 2024

Hi!

It worked perfect!

I used my original imputs.snmp:

[[inputs.snmp.field]]
oid = ".1.3.6.1.2.1.1.2.0"
name = "SNMPv2-MIB::sysObjectID"
translate = true
is_tag = true

[server ~]$ telegraf --config telegraf.cfg --config-directory /test/ --debug --test
WARN[0000]log.go:244 gosnowflake.(*defaultLogger).Warn DBUS_SESSION_BUS_ADDRESS envvar looks to be not set, this can lead to runaway dbus-daemon processes. To avoid this, set envvar DBUS_SESSION_BUS_ADDRESS=$XDG_RUNTIME_DIR/bus (if it exists) or DBUS_SESSION_BUS_ADDRESS=/dev/null.
2024-07-12T15:00:06Z I! Loading config: /telegraf.cfg
2024-07-12T15:00:06Z I! Loading config: /test/INPUTS_SNMPv2-MIB.conf
2024-07-12T15:00:06Z I! Starting Telegraf 1.32.0-7417f686 brought to you by InfluxData the makers of InfluxDB
2024-07-12T15:00:06Z I! Available plugins: 234 inputs, 9 aggregators, 32 processors, 26 parsers, 61 outputs, 6 secret-stores
2024-07-12T15:00:06Z I! Loaded inputs: snmp (4x)
2024-07-12T15:00:06Z I! Loaded aggregators:
2024-07-12T15:00:06Z I! Loaded processors:
2024-07-12T15:00:06Z I! Loaded secretstores:
2024-07-12T15:00:06Z W! Outputs are not used in testing mode!
2024-07-12T15:00:06Z I! Tags enabled:
2024-07-12T15:00:06Z D! [agent] Initializing plugins
2024-07-12T15:00:18Z D! [agent] Starting service inputs

SNMPv2-MIB::system,SNMPv2-MIB::sysContact=X,SNMPv2-MIB::sysDescr=X,SNMPv2-MIB::sysLocation=X,SNMPv2-MIB::sysName=X,SNMPv2-MIB::sysObjectID=ce6857-48S6CQ-EI,source=172.18.35.21 IF-MIB::ifNumber=60i,SNMPv2-MIB::sysUpTime=12632062.7 1720796419000000000

Should I do something to clear that WARN?

@Hipska
Copy link
Contributor

Hipska commented Jul 12, 2024

That's up to you. See relevant issue: #13635

@PFraire
Copy link
Author

PFraire commented Jul 12, 2024

Ok! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants