'Capture io stats.
@rtype dict
@return {"device": {"metric": value, "metric": value}, ...}'

def check(self, agentConfig):

    io = {}
    try:
        if Platform.is_linux():
            (stdout, _, _) = get_subprocess_output(['iostat', '-d', '1', '2', '-x', '-k'], self.logger)
            io.update(self._parse_linux2(stdout))
        elif (sys.platform == 'sunos5'):
            (output, _, _) = get_subprocess_output(['iostat', '-x', '-d', '1', '2'], self.logger)
            iostat = output.splitlines()
            lines = [l for l in iostat if (len(l) > 0)]
            lines = lines[(len(lines) / 2):]
            assert ('extended    device    statistics' in lines[0])
            headers = lines[1].split()
            assert ('device' in headers)
            for l in lines[2:]:
                cols = l.split()
                io[cols[0]] = {}
                for i in range(1, len(cols)):
                    io[cols[0]][self.xlate(headers[i], 'sunos')] = cols[i]
        elif sys.platform.startswith('freebsd'):
            (output, _, _) = get_subprocess_output(['iostat', '-x', '-d', '1', '2'], self.logger)
            iostat = output.splitlines()
            lines = [l for l in iostat if (len(l) > 0)]
            lines = lines[(len(lines) / 2):]
            assert ('extended    device    statistics' in lines[0])
            headers = lines[1].split()
            assert ('device' in headers)
            for l in lines[2:]:
                cols = l.split()
                io[cols[0]] = {}
                for i in range(1, len(cols)):
                    io[cols[0]][self.xlate(headers[i], 'freebsd')] = cols[i]
        elif (sys.platform == 'darwin'):
            (iostat, _, _) = get_subprocess_output(['iostat', '-d', '-c', '2', '-w', '1'], self.logger)
            io = self._parse_darwin(iostat)
        else:
            return False
        device_blacklist_re = agentConfig.get('device_blacklist_re', None)
        if device_blacklist_re:
            filtered_io = {}
            for (device, stats) in io.iteritems():
                if (not device_blacklist_re.match(device)):
                    filtered_io[device] = stats
        else:
            filtered_io = io
        return filtered_io
    except Exception:
        self.logger.exception('Cannot    extract    IO    statistics')
        return False
