deniszh / collectd-iostat-python

Collectd-iostat-python is an iostat plugin for collectd that allows you to graph Linux iostat metrics in graphite or other output formats that are supported by collectd.
MIT License
47 stars 28 forks source link

ParseError #21

Open akrzos opened 7 years ago

akrzos commented 7 years ago

I have now seen this occur "randomly". If I find any further details on how this occurs I'll post back to this issue.

[2017-06-27 17:13:39] [error] Unhandled python exception in read callback: ParseError: Unknown input format: ''
[2017-06-27 17:13:39] [error] Traceback (most recent call last):
[2017-06-27 17:13:39] [error]   File "/usr/local/bin/collectd_iostat_python.py", line 328, in read_callback
    ds = iostat.get_diskstats()
[2017-06-27 17:13:39] [error]   File "/usr/local/bin/collectd_iostat_python.py", line 184, in get_diskstats
    eds = self.parse_diskstats(edd)
[2017-06-27 17:13:39] [error]   File "/usr/local/bin/collectd_iostat_python.py", line 101, in parse_diskstats
    raise ParseError('Unknown input format: %r' % input)
[2017-06-27 17:13:39] [error] ParseError: Unknown input format: ''

Also this one:

[2017-06-26 19:11:41] [error]   File "/usr/local/bin/collectd_iostat_python.py", line 328, in read_callback
    ds = iostat.get_diskstats()
[2017-06-26 19:11:41] [error]   File "/usr/local/bin/collectd_iostat_python.py", line 181, in get_diskstats
    dsd = self._get_childs_data(dstats)
[2017-06-26 19:11:41] [error]   File "/usr/local/bin/collectd_iostat_python.py", line 157, in _get_childs_data
    (stdout, stderr) = child.communicate()
[2017-06-26 19:11:41] [error]   File "/usr/lib64/python2.7/subprocess.py", line 793, in communicate
    self.stdout.close()
[2017-06-26 19:11:41] [error] IOError: [Errno 9] Bad file descriptor
deniszh commented 7 years ago

Looks like sometimes running of 'iostat' command on your machine returns error or some garbage. What's your OS and Interval / Count parameters?

akrzos commented 7 years ago

What's your OS and Interval / Count parameters?

RHEL 7.3

Collectd interval (global and plugin) of 10s with iostat interval of 2s

Example of my configuration for the iostat plugin:

<Plugin python>
  ModulePath "/usr/local/bin/"
  Import "collectd_iostat_python"

  <Module collectd_iostat_python>
    Path "/usr/bin/iostat"
    Interval 10
    IostatInterval 2
    Count 2
    Verbose false
    NiceNames false
    PluginName collectd_iostat_python
  </Module>
</Plugin>