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 33 of file getRunAppsInfo.py.

Referenced by getRunningAppsInfo().

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

Definition at line 17 of file getRunAppsInfo.py.

Referenced by getRunningAppsInfo().

17 def getAppPID(srv,port):
18  try:
19  print "Connecting to server: "+srv+" and fetching PID for application running on port: "+port
20  cf=os.popen('ssh '+srv+' ps -eo pid,cmd | grep '+port)
21  l=cf.readline();
22  if l=="":
23  cf.close()
24  return "App Not Running"
25  else:
26  pidv=l.split()
27  cf.close();
28  return pidv[0]
29  except:
30  sys.stderr.write( "Something went really bad\n" )
31  return -1
def getAppPID(srv, port)
def getRunAppsInfo.getRunningAppsInfo (   filename)

Definition at line 53 of file getRunAppsInfo.py.

References getAppLogFileName(), and getAppPID().

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