influxdata / telegraf

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

Sensors plugin strconv.ParseFloat: parsing "": invalid syntax #1716

Closed penguinpowernz closed 8 years ago

penguinpowernz commented 8 years ago

Bug report

Relevant telegraf.conf:

Comments and empty lines omitted for brevity.

[global_tags]
[agent]
  interval = "30s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  hostname = ""
  omit_hostname = false
[[outputs.influxdb]]
  urls = ["http://xxx:8086"] # required
  database = "madmax" # required
  retention_policy = ""
  write_consistency = "any"
  timeout = "5s"
[[inputs.cpu]]
  percpu = true
  totalcpu = true
  fielddrop = ["time_*"]
[[inputs.disk]]
  ignore_fs = ["tmpfs", "devtmpfs"]
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]
[[inputs.net]]
[[inputs.net_response]]
    protocol = "tcp"
    address = "dns1.stabletransit.com:53"
    timeout = "1s"
[[inputs.sensors]]
[[inputs.hddtemp]]

System info:

Should parse all of the sensors -A -u output:

nouveau-pci-0100
temp1:
  temp1_input: 58.000
  temp1_max: 95.000
  temp1_max_hyst: 3.000
  temp1_crit: 125.000
  temp1_crit_hyst: 2.000
  temp1_emergency: 135.000
  temp1_emergency_hyst: 5.000

atk0110-acpi-0
Vcore Voltage:
  in0_input: 1.136
  in0_min: 0.800
  in0_max: 1.600
 +3.3 Voltage:
  in1_input: 3.360
  in1_min: 2.970
  in1_max: 3.630
 +5 Voltage:
  in2_input: 5.112
  in2_min: 4.500
  in2_max: 5.500
 +12 Voltage:
  in3_input: 12.040
  in3_min: 10.200
  in3_max: 13.800
CPU FAN Speed:
  fan1_input: 1721.000
  fan1_min: 600.000
  fan1_max: 7200.000
CHASSIS1 FAN Speed:
  fan2_input: 1506.000
  fan2_min: 600.000
  fan2_max: 7200.000
POWER FAN Speed:
  fan3_input: 0.000
  fan3_min: 600.000
  fan3_max: 7200.000
CPU Temperature:
  temp1_input: 30.500
  temp1_max: 60.000
  temp1_crit: 95.000
MB Temperature:
  temp2_input: 22.000
  temp2_max: 45.000
  temp2_crit: 95.000

coretemp-isa-0000
Core 0:
  temp2_input: 32.000
  temp2_max: 82.000
  temp2_crit: 100.000
  temp2_crit_alarm: 0.000
Core 1:
  temp3_input: 32.000
  temp3_max: 82.000
  temp3_crit: 100.000
  temp3_crit_alarm: 0.000
Core 2:
  temp4_input: 30.000
  temp4_max: 82.000
  temp4_crit: 100.000
  temp4_crit_alarm: 0.000
Core 3:
  temp5_input: 33.000
  temp5_max: 82.000
  temp5_crit: 100.000
  temp5_crit_alarm: 0.000

Actual behavior:

It only parses the first section (chip: nouveau-pci-0100). That first section appears in the Influx database:

Then it fails with the following error:

2016/09/07 09:55:30 ERROR in input [sensors]: strconv.ParseFloat: parsing "": invalid syntax

Additional info:

I tried to figure out how to fix it myself but couldn't quite follow the code flow.

/cc @zbindenren @md14454 (authors of the file)

Cheers :)

zbindenren commented 8 years ago

Could you provide the output of sensors -A -u?

penguinpowernz commented 8 years ago

Sorry updated the issue.

sparrc commented 8 years ago

closed by https://github.com/influxdata/telegraf/pull/1749

penguinpowernz commented 8 years ago

Amazing! Thanks guys :)