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

[core] new iostat output fails to parse #3731

Closed
bflyblue opened this issue May 7, 2018 · 1 comment · Fixed by #3733
Closed

[core] new iostat output fails to parse #3731

bflyblue opened this issue May 7, 2018 · 1 comment · Fixed by #3733
Assignees

Comments

@bflyblue
Copy link

bflyblue commented May 7, 2018

Issue description

May 07 12:04:45 toolkit1 dd-agent[1791]: 2018-05-07 12:04:45,443 | ERROR | dd.collector | checks.collector(unix.py:220) | Cannot extract IO statistics
May 07 12:04:45 toolkit1 dd-agent[1791]: Traceback (most recent call last):
May 07 12:04:45 toolkit1 dd-agent[1791]:   File "/nix/store/raw9gp68al3nj6gg5mcqk32s8lm8ws2m-dd-agent-5.11.2/agent/checks/system/unix.py", line 139, in check
May 07 12:04:45 toolkit1 dd-agent[1791]:     io.update(self._parse_linux2(stdout))
May 07 12:04:45 toolkit1 dd-agent[1791]:   File "/nix/store/raw9gp68al3nj6gg5mcqk32s8lm8ws2m-dd-agent-5.11.2/agent/checks/system/unix.py", line 42, in _parse_linux2
May 07 12:04:45 toolkit1 dd-agent[1791]:     recentStats = output.split('Device:')[2].split('\n')
May 07 12:04:45 toolkit1 dd-agent[1791]: IndexError: list index out of range
May 07 12:04:45 toolkit1 dd.collector[1791]: ERROR (unix.py:220): Cannot extract IO statistics
                                             Traceback (most recent call last):
                                               File "/nix/store/raw9gp68al3nj6gg5mcqk32s8lm8ws2m-dd-agent-5.11.2/agent/checks/system/unix.py", line 139, in check
                                                 io.update(self._parse_linux2(stdout))
                                               File "/nix/store/raw9gp68al3nj6gg5mcqk32s8lm8ws2m-dd-agent-5.11.2/agent/checks/system/unix.py", line 42, in _parse_linux2
                                                 recentStats = output.split('Device:')[2].split('\n')
                                             IndexError: list index out of range

Technical details

Newer versions of iostat have changed their output slightly and no longer include the colon after Device:

Device            r/s     w/s     rkB/s     wkB/s   rrqm/s   wrqm/s  %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util
sda              0.86    5.66      9.41   1119.06     0.01     4.17   0.86  42.40    0.23    1.27   0.01    10.96   197.57   0.43   0.28

I'm using dd-agent on NixOS and can confirm adding the following line to the dd-agent buildCommand does work around this issue:

sed -i 's/Device:/Device/' $out/agent/checks/system/unix.py
@olivielpeau
Copy link
Member

Thanks for reporting this @bflyblue, I was able to reproduce the issue, taking a look at the code to see if there's an easy fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants