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

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

Closed
penguinpowernz opened this issue Sep 7, 2016 · 4 comments
Closed
Labels
bug unexpected problem or unintended behavior

Comments

@penguinpowernz
Copy link

penguinpowernz commented Sep 7, 2016

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:

  • Telegraf - version 1.0.0-rc1
  • Linux 4.2.0-16-generic x86_64
  • Ubuntu 15.10
  • lm-sensors 1:3.4.0-2 amd64

Steps to reproduce:

  1. Install lm-sensors
  2. Add [[inputs.sensors]] to telegraf.conf
  3. Start telegraf
  4. Inspect /var/log/telegraf/telegraf.log for errors

Expected behavior:

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:

  • Series name: sensors,chip=nouveau-pci-0100,feature=temp1,host=madmax
  • temp_crit
  • temp_crit_hyst
  • temp_emergency
  • temp_emergency_hyst
  • temp_input
  • temp_max
  • temp_max_hyst

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
Copy link
Contributor

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

@sparrc sparrc added the bug unexpected problem or unintended behavior label Sep 7, 2016
@penguinpowernz
Copy link
Author

Sorry updated the issue.

zbindenren added a commit to zbindenren/telegraf that referenced this issue Sep 11, 2016
zbindenren added a commit to zbindenren/telegraf that referenced this issue Sep 11, 2016
sparrc pushed a commit that referenced this issue Sep 12, 2016
@sparrc
Copy link
Contributor

sparrc commented Sep 12, 2016

closed by #1749

@sparrc sparrc closed this as completed Sep 12, 2016
@penguinpowernz
Copy link
Author

Amazing! Thanks guys :)

jackzampolin pushed a commit that referenced this issue Oct 7, 2016
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

No branches or pull requests

3 participants