influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.62k stars 5.58k forks source link

[1.2.1] SNMP plugin not giving data, snmpget does #2441

Closed sandervandegeijn closed 7 years ago

sandervandegeijn commented 7 years ago

Relevant telegraf.conf:

[[inputs.snmp]]
  agents = [ "192.168.2.1:161" ]
  version = 1
  community = "public"
  interval = "60s"
  name = "Router"

[[inputs.snmp.field]]
  name = "InternetifOutOctets"
  oid = ".1.3.6.1.2.1.2.2.1.16.7"
  is_tag = true
  conversion = "int"

[[inputs.snmp.field]]
  name = "InternetifInOctets"
  oid = ".1.3.6.1.2.1.2.2.1.10.7"
  is_tag = true
  conversion = "int"
neo@neo-linuxhosting:~$ snmpget -On -v1 -c public 192.168.2.1:161 iso.3.6.1.2.1.2.2.1.10.7
.1.3.6.1.2.1.2.2.1.10.7 = Counter32: 933063644
neo@neo-linuxhosting:~$ snmpget -On -v1 -c public 192.168.2.1:161 .1.3.6.1.2.1.2.2.1.10.7
.1.3.6.1.2.1.2.2.1.10.7 = Counter32: 933371265
neo@neo-linuxhosting:~$ snmpget -On -v1 -c public 192.168.2.1:161 iso.3.6.1.2.1.2.2.1.16.7
.1.3.6.1.2.1.2.2.1.16.7 = Counter32: 1118845490
neo@neo-linuxhosting:~$ snmpget -On -v1 -c public 192.168.2.1:161 .1.3.6.1.2.1.2.2.1.16.7
.1.3.6.1.2.1.2.2.1.16.7 = Counter32: 1132910967

System info:

neo@neo-linuxhosting:~$ telegraf --version
Telegraf v1.2.1 (git: release-1.2 3b6ffb344e5c03c1595d862282a6823ecb438cff)
neo@neo-linuxhosting:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial
neo@neo-linuxhosting:~$

Steps to reproduce:

  1. ...
  2. ...

Expected behavior:

Give me data in the telegraf database

Actual behavior:

neo@neo-linuxhosting:~$ influx
Connected to http://localhost:8086 version 1.2.0
InfluxDB shell version: 1.2.0
> show databases
name: databases
name
----
_internal
telegraf
test
home
parents

> use telegraf
Using database telegraf
> show series
key
---
mqtt_consumer,host=neo-linuxhosting,topic=/nest/get/thermostat/ambientTemperatureC
mqtt_consumer,host=neo-linuxhosting,topic=/nest/get/thermostat/humidity
mqtt_consumer,host=neo-linuxhosting,topic=/nest/get/thermostat/targetTemperatureC
mqtt_consumer,host=neo-linuxhosting,topic=/parentsmonitor/solarpanels/Count
mqtt_consumer,host=neo-linuxhosting,topic=/parentsmonitor/solarpanels/Time
mqtt_consumer,host=neo-linuxhosting,topic=/parentsmonitor/solarpanels/Total
mqtt_consumer,host=neo-linuxhosting,topic=/parentsmonitor/splitheatpump/Count
mqtt_consumer,host=neo-linuxhosting,topic=/parentsmonitor/splitheatpump/Time
mqtt_consumer,host=neo-linuxhosting,topic=/parentsmonitor/splitheatpump/Total
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/countergasconsumption
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/counterpowerconsumptionhightariff
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/counterpowerconsumptionlowtariff
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/counterpowerproductionhightariff
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/counterpowerproductionlowtariff
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/solarproduction/Count
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/watermeter/Count
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/watermeter/Time
mqtt_consumer,host=neo-linuxhosting,topic=/utilitiesmonitor/watermeter/Total
mqtt_consumer,host=neo-linuxhosting,topic=/wpmonitor/MonoEnergy/Count
mqtt_consumer,host=neo-linuxhosting,topic=/wpmonitor/MonoEnergy/Total
mqtt_consumer,host=neo-linuxhosting,topic=/wpmonitor/SplitEnery/Count
mqtt_consumer,host=neo-linuxhosting,topic=/wpmonitor/SplitEnery/Total
mqtt_consumer,host=neo-linuxhosting,topic=/wpmonitor/TempAirLeavingSplitUnit/Temperature
mqtt_consumer,host=neo-linuxhosting,topic=/wpmonitor/TempOutside/Temperature

No SNMP series found

Additional info:

Telegraf log:

2017-02-19T23:37:06Z I! Starting Telegraf (version 1.2.1)
2017-02-19T23:37:06Z I! Loaded outputs: influxdb
2017-02-19T23:37:06Z I! Loaded inputs: inputs.mqtt_consumer inputs.mqtt_consumer inputs.snmp
2017-02-19T23:37:06Z I! Tags enabled: host=neo-linuxhosting
2017-02-19T23:37:06Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"neo-linuxhosting", Flush Interval:10s
2017-02-19T23:37:06Z I! MQTT Client Connected
2017-02-19T23:37:06Z I! MQTT Client Connected

Sidenote: mqtt does work

phemmer commented 7 years ago

In your configuration, all your [[inputs.snmp.field]] are set with is_tag = true. Thus you don't have any non-tag fields. You cannot send data to InfluxDB without any fields.

sandervandegeijn commented 7 years ago

You are right, thanks, my bad!