У меня лично так сделано
import subprocess, platform
def check_ping(host):
param = '-n' if platform.system().lower() == 'windows' else '-c'
command = ['ping', param, '3', host]
return subprocess.call(command, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) == 0