'Send ICMP echo request and return details if success.'

def ping(self):

    pinger = subprocess.Popen(self._ping_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    try:
        out = pinger.communicate()
        _LOGGER.debug('Output    is    %s', str(out))
        if (sys.platform == 'win32'):
            match = WIN32_PING_MATCHER.search(str(out).split('\n')[(-1)])
            (rtt_min, rtt_avg, rtt_max) = match.groups()
            return {'min': rtt_min, 'avg': rtt_avg, 'max': rtt_max, 'mdev': ''}
        if ('max/' not in str(out)):
            match = PING_MATCHER_BUSYBOX.search(str(out).split('\n')[(-1)])
            (rtt_min, rtt_avg, rtt_max) = match.groups()
            return {'min': rtt_min, 'avg': rtt_avg, 'max': rtt_max, 'mdev': ''}
        match = PING_MATCHER.search(str(out).split('\n')[(-1)])
        (rtt_min, rtt_avg, rtt_max, rtt_mdev) = match.groups()
        return {'min': rtt_min, 'avg': rtt_avg, 'max': rtt_max, 'mdev': rtt_mdev}
    except (subprocess.CalledProcessError, AttributeError):
        return False
