|
|
@ -74,6 +74,7 @@ def read(**args) :
|
|
|
|
|
|
|
|
|
|
|
|
d = datetime.datetime.now().strftime('%m-%d-%Y')
|
|
|
|
d = datetime.datetime.now().strftime('%m-%d-%Y')
|
|
|
|
t = datetime.datetime.now().strftime('%H:%M:%S')
|
|
|
|
t = datetime.datetime.now().strftime('%H:%M:%S')
|
|
|
|
|
|
|
|
n = os.uname()[1]
|
|
|
|
m = [item for item in m if len(item) != len (m[0])]
|
|
|
|
m = [item for item in m if len(item) != len (m[0])]
|
|
|
|
m = "\n".join(m[1:])
|
|
|
|
m = "\n".join(m[1:])
|
|
|
|
df = pd.read_csv(StringIO(m),sep=xchar)
|
|
|
|
df = pd.read_csv(StringIO(m),sep=xchar)
|
|
|
@ -93,14 +94,16 @@ def read(**args) :
|
|
|
|
r = pd.DataFrame()
|
|
|
|
r = pd.DataFrame()
|
|
|
|
for name in names :
|
|
|
|
for name in names :
|
|
|
|
tmp = df[df.name == name.strip()]
|
|
|
|
tmp = df[df.name == name.strip()]
|
|
|
|
if tmp.shape[0] :
|
|
|
|
if not tmp.shape[0] :
|
|
|
|
|
|
|
|
tmp = {"pid":None,"user":None,"mem":0,"cpu":0,"status":"-100","started":None,"name":name,"cmd":None,"args":None,"date":d,"time":t,"node":n}
|
|
|
|
r = r.append(tmp)
|
|
|
|
r = r.append(tmp)
|
|
|
|
|
|
|
|
|
|
|
|
df = r
|
|
|
|
df = r
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# For security reasons lets has the args columns with an MD5 or sha256
|
|
|
|
# For security reasons lets has the args columns with an MD5 or sha256
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'args' in df :
|
|
|
|
df.args = [hashlib.md5(str(value).encode('utf-8')).hexdigest() for value in df.args.tolist()]
|
|
|
|
df.args = [hashlib.md5(str(value).encode('utf-8')).hexdigest() for value in df.args.tolist()]
|
|
|
|
STATUS = {'R':'RUNNING','Z':'DEAD','D':'STASIS','S':'SLEEP','Sl':'SLEEP','Ss':'SLEEP','W':'PAGING','T':'DEAD'}
|
|
|
|
STATUS = {'R':'RUNNING','Z':'DEAD','D':'STASIS','S':'SLEEP','Sl':'SLEEP','Ss':'SLEEP','W':'PAGING','T':'DEAD'}
|
|
|
|
df.status = df.status.apply(lambda value: STATUS.get(value,'UNKNOWN'))
|
|
|
|
df.status = df.status.apply(lambda value: STATUS.get(value,'UNKNOWN'))
|
|
|
|