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: Handle error sentences from sensors #7718

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

ribalda
Copy link
Contributor

@ribalda ribalda commented Jun 23, 2020

Amdgpu drivers produces an output that cannot be handled by sensors:

root@qt5222:~# sensors -A -u
amdgpu-pci-0300
vddgfx:
ERROR: Can't get value of subfeature in0_input: Can't read
vddnb:
ERROR: Can't get value of subfeature in1_input: Can't read
edge:
temp1_input: 40.000
temp1_crit: 80.000
temp1_crit_hyst: 0.000

00000400100-mdio-4
temp1:
temp1_input: 59.000
temp1_crit: 100.000
temp1_max_alarm: 0.000

This results in an invalid parsing of its ouput. Eg:

sensors,chip=ERROR:\ Can't\ get\ value\ of\ subfeature\ in0_input:\ Can't\ read,feature=isl_curr_soc,host=qt5222,serial=${SERIAL_NUMBER} curr_input=1.6 1592920794000000000

The invalid parsing is due to the different buffer size of stdout and
stderr. Which results on stderr output out of sync with stdout.

Since we do not need the output of stderr, simply ignore it.

Signed-off-by: Ricardo Ribalda [email protected]

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

Amdgpu drivers produces an output that cannot be handled by sensors:

root@qt5222:~# sensors -A -u
amdgpu-pci-0300
vddgfx:
ERROR: Can't get value of subfeature in0_input: Can't read
vddnb:
ERROR: Can't get value of subfeature in1_input: Can't read
edge:
  temp1_input: 40.000
  temp1_crit: 80.000
  temp1_crit_hyst: 0.000

00000400100-mdio-4
temp1:
  temp1_input: 59.000
  temp1_crit: 100.000
  temp1_max_alarm: 0.000

This results in an invalid parsing of its ouput. Eg:

> sensors,chip=ERROR:\ Can't\ get\ value\ of\ subfeature\ in0_input:\ Can't\ read,feature=isl_curr_soc,host=qt5222,serial=${SERIAL_NUMBER} curr_input=1.6 1592920794000000000

The invalid parsing is due to the different buffer size of stdout and
stderr. Which results on stderr output out of sync with stdout.

Since we do not need the output of stderr, simply ignore it.

Signed-off-by: Ricardo Ribalda <[email protected]>
@danielnelson danielnelson added this to the 1.14.5 milestone Jun 23, 2020
@danielnelson danielnelson added the fix pr to fix corresponding bug label Jun 23, 2020
@danielnelson danielnelson merged commit e8461fe into influxdata:master Jun 23, 2020
danielnelson pushed a commit that referenced this pull request Jun 23, 2020
rhajek pushed a commit to bonitoo-io/telegraf that referenced this pull request Jul 13, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants