본문 바로가기

automation

(4)
파이썬 자동화 -7- import paramiko, time, socks, re, os from getpass import getpass import pandas as pd import openpyxl from tqdm import tqdm from concurrent.futures import as_completed from openpyxl.utils.dataframe import dataframe_to_rows from concurrent.futures import ThreadPoolExecutor, as_completed import threading def juniper_parse_fixed(df, up_t): df.loc[0, "uptime"] = up_t[0] return df def parse_fix(df1): ..
network automation -5- import paramiko, time from getpass import getpass import re import openpyxl from openpyxl.utils.dataframe import dataframe_to_rows import pandas as pd def juniper_parse_fixed(df): fpc_rows = df[df["item"].astype(str).str.startswith("FPC")].reset_index(drop=True) ps_rows = df[df["item"].astype(str).str.startswith("Power Supply")].reset_index(drop=True) paired_rows = [] ps_idx = 0 for _, fpc_rows ..
Network automation -2- import time import paramiko, time import socks from getpass import getpass def juniper_parse(ip_a, u_id, u_pas,find_words): try: #socks config sock=socks.socksocket() sock.set_proxy( proxy_type=socks.SOCKS5, addr="Socks Server IP", port=Socks Server Port, username="Socks Server ID", password="Socks Server Password") #sock ssh connect sock.connect((ip_a,22)) ssh = paramiko.SSHClient() ssh.set_mis..
Network automation import time import paramiko, time import socks from getpass import getpass def juniper_parse(ip_a, u_id, u_pas, command): #socks config sock=socks.socksocket() sock.set_proxy( proxy_type=socks.SOCKS5, addr="Socks Server IP", port=Socks Server Port, username="Socks Server ID", password="Socks Server Password") #sock ssh connect sock.connect(("SSH 연결 IP",22)) ssh = paramiko.SSHClient() ssh.set_mis..