CMS 3D CMS Logo

Functions
getRunAppsInfo Namespace Reference

Functions

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

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

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
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def getAppLogFileName(srv, pid)
def getRunAppsInfo.getAppPID (   srv,
  port 
)

Definition at line 18 of file getRunAppsInfo.py.

References edm.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
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def getAppPID(srv, port)
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)