CMS 3D CMS Logo

Functions | Variables
getRunAppsInfo Namespace Reference

Functions

def getAppLogFileName (srv, pid)
 
def getAppPID (srv, port)
 
def getRunningAppsInfo (filename)
 

Variables

 args
 
 filename
 
 fullinfo
 Script operation #. More...
 
 grid
 
 headers
 
 i
 
 newrecord
 

Detailed Description

This module provides the PID and the log file name of the running DQM 
applications (consumers), thus completing the information generated by 
ExtractAppInfoFromXML.

When used as a script the following options are accepted:
-f Show all columns
-h show headers

Function Documentation

◆ getAppLogFileName()

def getRunAppsInfo.getAppLogFileName (   srv,
  pid 
)

Definition at line 34 of file getRunAppsInfo.py.

Referenced by getRunningAppsInfo().

34 def getAppLogFileName(srv,pid):
35 # try:
36  #pid=getAppPID(srv,port)
37  if pid=="App Not Running":
38  return "No active log file"
39  else:
40  print("Connecting to server: "+srv+" and fetching LogFile for application with PID: "+pid)
41  cf=os.popen('ssh '+srv+' ls -l /tmp | grep '+pid)
42  l=cf.readline();
43  if l=="":
44  cf.close()
45  return "App Not Running???"
46  else:
47  logfilev=l.split()
48  cf.close();
49  return logfilev[-1]
50 # except Exception,e:
51 # sys.stderr.write( "Something went really bad\n" + e[0])
52 # return -1
def getAppLogFileName(srv, pid)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ getAppPID()

def getRunAppsInfo.getAppPID (   srv,
  port 
)

Definition at line 18 of file getRunAppsInfo.py.

References print().

Referenced by getRunningAppsInfo().

18 def getAppPID(srv,port):
19  try:
20  print("Connecting to server: "+srv+" and fetching PID for application running on port: "+port)
21  cf=os.popen('ssh '+srv+' ps -eo pid,cmd | grep '+port)
22  l=cf.readline();
23  if l=="":
24  cf.close()
25  return "App Not Running"
26  else:
27  pidv=l.split()
28  cf.close();
29  return pidv[0]
30  except:
31  sys.stderr.write( "Something went really bad\n" )
32  return -1
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def getAppPID(srv, port)

◆ getRunningAppsInfo()

def getRunAppsInfo.getRunningAppsInfo (   filename)

Definition at line 54 of file getRunAppsInfo.py.

References getAppLogFileName(), and getAppPID().

54 def getRunningAppsInfo(filename):
55  (table,grid)=appinf.getAppInfo(filename,2,1,3,4)
56  for apps in grid:
57  apps.insert(3,getAppPID(apps[1],apps[2]))
58  apps.insert(4,getAppLogFileName(apps[1],apps[3]))
59  return grid
def getAppLogFileName(srv, pid)
def getAppPID(srv, port)
def getRunningAppsInfo(filename)

Variable Documentation

◆ args

getRunAppsInfo.args

Definition at line 67 of file getRunAppsInfo.py.

◆ filename

getRunAppsInfo.filename

Definition at line 67 of file getRunAppsInfo.py.

◆ fullinfo

getRunAppsInfo.fullinfo

Script operation #.

Definition at line 64 of file getRunAppsInfo.py.

◆ grid

getRunAppsInfo.grid

◆ headers

getRunAppsInfo.headers

◆ i

getRunAppsInfo.i

Definition at line 98 of file getRunAppsInfo.py.

◆ newrecord

getRunAppsInfo.newrecord

Definition at line 100 of file getRunAppsInfo.py.