This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import subprocess | |
def ping(host): | |
""" Ping the address/hostname and return True if packet loss is less than | |
60%. All other results return False or print and error.""" | |
exp = re.compile(r"\s(\d{1,3})\%\s") | |
try: | |
test = subprocess.Popen(["ping", "-c 5", "-W 2", host], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import logging | |
import time | |
from datetime import datetime | |
from multiprocessing import Pool, cpu_count, current_process | |
from netmiko import ConnectHandler | |
from netmiko.ssh_exception import NetMikoTimeoutException, NetMikoAuthenticationException |
NewerOlder