#!/usr/bin/env python from subprocess import PIPE,Popen def getDmi(): p = Popen(['dmidecode'],stdout=PIPE) data = p.stdout.read() return data def parseDmi(data): lines = [] line_in = False dmi_list = [i for i in data.split('\n') if i] for line in dmi…
#!/usr/bin/env python from subprocess import Popen, PIPE p = Popen(['dmidecode'], stdout=PIPE) data = p.stdout lines = [] dmi = {} a = True while a: line = data.readline() if line.startswith('System Information'): while True: …
#!/usr/bin/env python from subprocess import PIPE,Popen import re def getIfconfig(): p = Popen(['ifconfig'],stdout=PIPE) data = p.stdout.read().split('\n\n') return [i for i in data if i and not i.startswith('lo')] def parseIfconfig(data): re_devname…
#!/usr/bin/env python import os from subprocess import PIPE,Popen def getPids(): p = Popen(['pidof','httpd'],stdout=PIPE,stderr=PIPE) pids = p.stdout.read().split() return pids def parsePidFile(pids): http_sum = 0 for i in pids: fn = os.path.join('/p…