From 550427fbc779985505b7748ae57eabee0a16b66b Mon Sep 17 00:00:00 2001 From: lucacopa Date: Fri, 11 Apr 2014 11:20:45 -0500 Subject: [PATCH] Fix voboxes script counting --- WFM_Input_DashBoard/Readme.rtf | 2 +- WFM_Input_DashBoard/WFMonDBShort.py | 206 ++++++---- WFM_Input_DashBoard/WFMperVOBox/Readme.txt | 9 - .../WFMperVOBox/SSBCERN_voBoxInfo.json | 1 - .../WFMperVOBox/SSBFNAL_voBoxInfo.json | 1 - .../WFMperVOBox/WFMonDBcron.log | 103 ----- .../WFMperVOBox/WFMvoBoxDBShort_voboxes.py | 379 ------------------ .../WFMperVOBox/emailmessage.txt | 0 WFM_Input_DashBoard/WFMperVOBox/fakedatabase | 0 .../WFMperVOBox/get_voBoxStatus.sh | 37 -- .../WFMperVOBox/runWFMonDBShort_voboxes.sh | 55 --- .../WFMperVOBox/scriptRunning.run | 0 .../WFMperVOBox/update_voBoxlist.sh | 36 -- WFM_Input_DashBoard/WFMperVOBox/voboxCERN.txt | 20 - .../WFMperVOBox/voboxCERN_prev.txt | 20 - WFM_Input_DashBoard/WFMperVOBox/voboxFNAL.txt | 0 .../WFMperVOBox/voboxFNAL_prev.txt | 0 .../WFMperVOBox/voboxFNAL_prev_old.txt | 7 - WFM_Input_DashBoard/WFMperVOBox/voboxlist.txt | 35 -- .../WFMperVOBox/voboxlist_prev.txt | 35 -- WFM_Input_DashBoard/runWFMonDBShort.sh | 2 +- 21 files changed, 141 insertions(+), 807 deletions(-) delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/Readme.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/SSBCERN_voBoxInfo.json delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/SSBFNAL_voBoxInfo.json delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/WFMonDBcron.log delete mode 100755 WFM_Input_DashBoard/WFMperVOBox/WFMvoBoxDBShort_voboxes.py delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/emailmessage.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/fakedatabase delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/get_voBoxStatus.sh delete mode 100755 WFM_Input_DashBoard/WFMperVOBox/runWFMonDBShort_voboxes.sh delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/scriptRunning.run delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/update_voBoxlist.sh delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/voboxCERN.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/voboxCERN_prev.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/voboxFNAL.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/voboxFNAL_prev.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/voboxFNAL_prev_old.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/voboxlist.txt delete mode 100644 WFM_Input_DashBoard/WFMperVOBox/voboxlist_prev.txt diff --git a/WFM_Input_DashBoard/Readme.rtf b/WFM_Input_DashBoard/Readme.rtf index 61eb474..3dc3f26 100644 --- a/WFM_Input_DashBoard/Readme.rtf +++ b/WFM_Input_DashBoard/Readme.rtf @@ -8,6 +8,6 @@ # 5,20,35,50 * * * * lxplus ssh vocms202 /afs/cern.ch/user/c/cmst1/scratch0/WFM_Input_DashBoard/runWFMonDBShort.sh &> /dev/null\ # json files are fetched by Dashboardteam, via a special way. Cant be changed by myself\ # Script for Dashboard metric (part of) 137, 138: Running/Pending jobs . This metric is shared with that of the # on voboxes instead of only on per sites\ -# outputfile SB_siteInfo.json \ +# outputfile SB_siteInfo.json SSB_voBoxInfo.json Running*.txt Pending*.txt per Type of job \ # outputdir /afs/cern.ch/user/c/cmst1/www/WFMon/\ } \ No newline at end of file diff --git a/WFM_Input_DashBoard/WFMonDBShort.py b/WFM_Input_DashBoard/WFMonDBShort.py index a26ab02..20bd8d2 100755 --- a/WFM_Input_DashBoard/WFMonDBShort.py +++ b/WFM_Input_DashBoard/WFMonDBShort.py @@ -1,8 +1,8 @@ #!/usr/bin/env python """ -This scripts creates the overall jobs report for monitoring in SSB -Should be set as a cron job @15 min -Creates a json file +This scripts creates the overall job reports for monitoring in SSB +Should be set as a cronjob @15 min +Creates the following files: SSB_siteInfo.json, SSB_voBoxInfo.json, Running*.txt and Pending*.txt ( * in types ) """ import sys,os,re,urllib,urllib2,subprocess,time @@ -12,10 +12,14 @@ except ImportError: import simplejson as json +## Job Collectors collectors = ['vocms97.cern.ch', 'vocms165.cern.ch'] -relvalAgents = ['vocms142.cern.ch', 'cmssrv113.fnal.gov'] +##The following groups should be updated according to https://twiki.cern.ch/twiki/bin/view/CMSPublic/CompOpsWorkflowTeamWmAgentRealeases +relvalAgents = ['vocms142.cern.ch', 'vocms174.cern.ch', 'cmssrv113.fnal.gov'] +testAgents = ['cmssrv94.fnal.gov', 'cmssrv101.fnal.gov', 'vocms230.cern.ch', 'vocms231.cern.ch'] +## Counting by site baseSiteList = {} # Site list baseSitePledges = {} # Site pledges list overview_running = {} # Running per site/task @@ -23,11 +27,18 @@ overview_pending = {} # Pending per site/task totalRunningSite = {} # Total running per site jobs_failedTypeLogic = {} # Jobs that failed the type logic assignment -json_name = "SSB_siteInfo.json" # Output json file name -site_link = "http://dashb-ssb.cern.ch/dashboard/templates/sitePendingRunningJobs.html?site=" -overalls_link = "http://dashb-ssb-dev.cern.ch/dashboard/templates/sitePendingRunningJobs.html?site=All%20T3210" +json_name_sites = "SSB_siteInfo.json" # Output json file name + +##Counting by vobox +overview_running_vobox = {}# Running per vobox +overview_pending_vobox = {}# Pending per vobox +json_name_vobox = "SSB_voBoxInfo.json" # Output json file name +##SSB plot links +site_link = "http://dashb-ssb.cern.ch/dashboard/templates/sitePendingRunningJobs.html?site=" +overalls_link = "http://dashb-ssb-dev.cern.ch/dashboard/templates/sitePendingRunningJobs.html?site=All%20" +## Job expected types jobTypes = ['Processing', 'Production', 'Skim', 'Harvest', 'Merge', 'LogCollect', 'Cleanup', 'RelVal', 'T0'] t0Types = ['Repack', 'Express', 'Reco'] @@ -110,7 +121,19 @@ def addSite(site): if site not in baseSiteList.keys(): baseSiteList[site] = 'on' + +def addVoBox(VoBox): + """ + Add a VoBox to all the VoBox dictionaries + """ + print "INFO: Adding VoBox %s" % VoBox + overview_running_vobox[VoBox] = dict() + for type in jobTypes: + overview_running_vobox[VoBox][type] = 0 + overview_pending_vobox[VoBox] = dict() + for type in jobTypes: + overview_pending_vobox[VoBox][type] = 0 def increaseRunning(site,type): """ @@ -134,6 +157,20 @@ def increasePending(site,type,num): addSite(site) overview_pending[site][type] += num +def increaseRunningVoBox(sched,type): + """ + Increase the number of running jobs for the given sched and type + This always increase job count by 1 + """ + overview_running_vobox[sched][type] += 1 + +def increasePendingVoBox(sched,type): + """ + Increase the number of pending jobs for the given sched and type + This always increase job count by 1 + """ + overview_pending_vobox[sched][type] += 1 + def findTask(id,sched,typeToExtract): """ This deduces job type from given info about scheduler and taskName @@ -159,6 +196,8 @@ def findTask(id,sched,typeToExtract): type = 'Merge' elif any([x in typeToExtract for x in t0Types]): type = 'T0' + elif sched.strip() in testAgents: + type = 'Processing' else: type = 'Processing' jobs_failedTypeLogic[id]=dict(scheduler = sched, BaseType = typeToExtract) @@ -203,7 +242,6 @@ def relativePending(siteToExtract): return relative, total - def fixOverviews(): """ Add the sites that has pending but not running to overview_running, @@ -226,7 +264,7 @@ def fixOverviews(): for type in jobTypes: overview_running[site][type] = 0.0 -def handleDict(dict, description, date, hour): +def handleDict(dict, description, date, hour, server): """ 1. Prints a report for the given dictionary 2. Dashboard cannot read from the json file created for the site plots... @@ -235,15 +273,27 @@ def handleDict(dict, description, date, hour): sorted = dict.keys() sorted.sort() + # Assign plot names + if server: + endpoint_entry = "&server" + entry_overall = "Servers" + endpoint_overall = "Servers" + else: + endpoint_entry = "" + entry_overall = "Sites" + endpoint_overall = "T3210" + overall_type = {} # Init overalls per type for type in jobTypes: overall_type[type] = 0.0 # Init text output files - file = open('./'+description+type+'.txt', 'w+') + if not server: + file = open('./'+description+type+'.txt', 'w+') + file.close() + if not server: + file = open('./'+description+"Total"+'.txt', 'w+') file.close() - file = open('./'+description+"Total"+'.txt', 'w+') - file.close() # print Titles line1 = "| %25s |" % description @@ -255,24 +305,24 @@ def handleDict(dict, description, date, hour): line2 += " %10s |" % ('-'*10) print line2, '\n', line1, '\n', line2 - # Print jobs per site - for site in sorted: + # Print jobs per site/scheduler + for entry in sorted: sum = 0.0 - lineSite = "| %25s |" % site + lineSite = "| %25s |" % entry for type in jobTypes: - lineSite += " %10s |" % int(dict[site][type]) - sum += dict[site][type] - overall_type[type] += dict[site][type] + lineSite += " %10s |" % int(dict[entry][type]) + sum += dict[entry][type] + overall_type[type] += dict[entry][type] - # add site jobs per type to 'description''type' file + # add site/scheduler jobs per type to 'description''type' file file = open('./'+description+type+'.txt', 'a') - file.write( "%s %s\t%s\t%s\t%s\t%s%s\n" % (date, hour, site, str(int(dict[site][type])), 'green', site_link, site )) + file.write( "%s %s\t%s\t%s\t%s\t%s%s%s\n" % (date, hour, entry, str(int(dict[entry][type])), 'green', site_link, entry.replace(".","_").strip(), endpoint_entry )) lineSite += " %10s |" % int(sum) - # add site total jobs to 'description'Total file + # add site/scheduler total jobs to 'description'Total file file = open('./'+description+"Total"+'.txt', 'a') - file.write( "%s %s\t%s\t%s\t%s\t%s%s\n" % (date, hour, site, str(int(sum)), 'green', site_link, site )) + file.write( "%s %s\t%s\t%s\t%s\t%s%s%s\n" % (date, hour, entry, str(int(sum)), 'green', site_link, entry.replace(".","_").strip(), endpoint_entry )) print lineSite @@ -285,61 +335,71 @@ def handleDict(dict, description, date, hour): # add overalls to 'description''type' file file = open('./'+description+type+'.txt', 'a') - file.write( "%s %s\t%s\t%s\t%s\t%s\n" % (date, hour, 'Overall', str(int(overall_type[type])), 'green' , overalls_link )) + file.write( "%s %s\t%s%s\t%s\t%s\t%s%s\n" % (date, hour, 'Overall', entry_overall, str(int(overall_type[type])), 'green' , overalls_link, endpoint_overall )) overalls += " %10s |" % int(total) file = open('./'+description+"Total"+'.txt', 'a') - file.write( "%s %s\t%s\t%s\t%s\t%s\n" % (date, hour, 'Overall', str(int(total)), 'green', overalls_link )) + file.write( "%s %s\t%s%s\t%s\t%s\t%s%s\n" % (date, hour, 'Overall', entry_overall, str(int(total)), 'green', overalls_link, endpoint_overall )) print line2, '\n', overalls, '\n', line2, '\n' -def jsonDict(json_name,currTime,date,hour): +def jsonDict(json_name,currTime,date,hour,key): """ This creates a json form text and writes it into the json_name output file """ - sorted_run = overview_running.keys() # Running and pending keys must be the same after fixOverviews() + if key == 'site': + location = "Sites" + running = overview_running + pending = overview_pending + elif key == 'VOBox': + location = "CERN" + running = overview_running_vobox + pending = overview_pending_vobox + + sorted_run = running.keys() # Running and pending keys must be the same after fixOverviews() sorted_run.sort() jsonfile = open(json_name,'w+') - update = {"UPDATE" : {"Date" : date, "Time" : hour}, "Sites" : []} + update = {"UPDATE" : {"Date" : date, "Time" : hour}, location : []} - for site in sorted_run: - # Get site status - s_status = 'on' # Default for sites that has been added (not in baseSiteList) - if site in baseSiteList.keys(): - s_status = baseSiteList[site] + for entry in sorted_run: + # Get site/scheduler status + s_status = 'on' # Default for sites/schedulers + # TODO: How to get scheduler status, don't use default + if entry in baseSiteList.keys() and key == 'site': # only when key is "site" + s_status = baseSiteList[entry] sumPending = 0.0 sumRunning = 0 for type in jobTypes: - sumPending += overview_pending[site][type] - sumRunning += overview_running[site][type] + sumPending += pending[entry][type] + sumRunning += running[entry][type] - json_site = dict() - json_site["site"] = str(site) - json_site["Pending"] = str(int(sumPending)) - json_site["TimeDate"] = str(currTime.strip()) - json_site["Running"] = str(int(sumRunning)) - json_site["RunProc"] = str(int(overview_running[site]['Processing'])) - json_site["RunProd"] = str(int(overview_running[site]['Production'])) - json_site["RunSkim"] = str(int(overview_running[site]['Skim'])) - json_site["RunHarvest"] = str(int(overview_running[site]['Harvest'])) - json_site["RunMerge"] = str(int(overview_running[site]['Merge'])) - json_site["RunClean"] = str(int(overview_running[site]['Cleanup'])) - json_site["RunLog"] = str(int(overview_running[site]['LogCollect'])) - json_site["RunRelval"] = str(int(overview_running[site]['RelVal'])) - json_site["RunT0"] = str(int(overview_running[site]['T0'])) - json_site["PenProc"] = str(int(overview_pending[site]['Processing'])) - json_site["PenProd"] = str(int(overview_pending[site]['Production'])) - json_site["PenSkim"] = str(int(overview_pending[site]['Skim'])) - json_site["PenHarvest"] = str(int(overview_pending[site]['Harvest'])) - json_site["PenMerge"] = str(int(overview_pending[site]['Merge'])) - json_site["PenClean"] = str(int(overview_pending[site]['Cleanup'])) - json_site["PenLog"] = str(int(overview_pending[site]['LogCollect'])) - json_site["PenRelval"] = str(int(overview_pending[site]['RelVal'])) - json_site["PenT0"] = str(int(overview_pending[site]['T0'])) - json_site["Status"] = str(s_status) + json_entry = dict() + json_entry[key] = str(entry) + json_entry["Pending"] = str(int(sumPending)) + json_entry["TimeDate"] = str(currTime.strip()) + json_entry["Running"] = str(int(sumRunning)) + json_entry["RunProc"] = str(int(running[entry]['Processing'])) + json_entry["RunProd"] = str(int(running[entry]['Production'])) + json_entry["RunSkim"] = str(int(running[entry]['Skim'])) + json_entry["RunHarvest"] = str(int(running[entry]['Harvest'])) + json_entry["RunMerge"] = str(int(running[entry]['Merge'])) + json_entry["RunClean"] = str(int(running[entry]['Cleanup'])) + json_entry["RunLog"] = str(int(running[entry]['LogCollect'])) + json_entry["RunRelval"] = str(int(running[entry]['RelVal'])) + json_entry["RunT0"] = str(int(running[entry]['T0'])) + json_entry["PenProc"] = str(int(pending[entry]['Processing'])) + json_entry["PenProd"] = str(int(pending[entry]['Production'])) + json_entry["PenSkim"] = str(int(pending[entry]['Skim'])) + json_entry["PenHarvest"] = str(int(pending[entry]['Harvest'])) + json_entry["PenMerge"] = str(int(pending[entry]['Merge'])) + json_entry["PenClean"] = str(int(pending[entry]['Cleanup'])) + json_entry["PenLog"] = str(int(pending[entry]['LogCollect'])) + json_entry["PenRelval"] = str(int(pending[entry]['RelVal'])) + json_entry["PenT0"] = str(int(pending[entry]['T0'])) + json_entry["Status"] = str(s_status) - update["Sites"].append(json_site) + update[location].append(json_entry) jsonfile.write(json.dumps(update,sort_keys=True, indent=3)) jsonfile.close() @@ -377,8 +437,8 @@ def main(): #print out2, '\n', "Error: ", '\n', err2 break for line in out.split('\n') : - if ('cern' in line) or ('fnal' in line): - listschedds.append(line) + if ('cern' in line) or ('fnal' in line): + listschedds.append(line) print "INFO: Condor status on collector %s has been started" % col # Get the running/pending jobs from condor for the given scheduler @@ -389,6 +449,9 @@ def main(): out, err = proc.communicate() print "INFO: Handling condor_q on collector: %s scheduler: %s" % (col, sched) + if not sched in overview_running_vobox.keys(): + addVoBox(sched) + for line in out.split('\n') : if line == "" : continue # remove empty lines @@ -429,8 +492,10 @@ def main(): if status == "2": increaseRunning(siteToExtract[0],type) # I assume one job can only run at one site + increaseRunningVoBox(sched,type) elif status == "1": temp_pending.append([type,siteToExtract]) + increasePendingVoBox(sched,type) else: # We do not care about jobs in another status (condor job status: https://htcondor-wiki.cs.wisc.edu/index.cgi/wiki?p=MagicNumbers) continue print "INFO: Full condor status pooling is done" @@ -469,15 +534,22 @@ def main(): print 'INFO: Creating reports...' - # Prints a report and creates Dashboard feeder files (SSB can't take info from json for runnnig/pending views...) - handleDict( overview_running, "Running", date, hour) - handleDict( overview_pending, "Pending", date, hour) + # Prints a report and fills Dashboard feeder files (SSB can't take info from json for runnnig/pending views...) + # This handles jobs per site. This must run before handleDict for servers (this creates *.txt files) + handleDict( overview_running, "Running", date, hour, False) + handleDict( overview_pending, "Pending", date, hour, False) + + # Prints a report for jobs per vobox and fills Dashboard feeder files (for schedulers) + handleDict( overview_running_vobox, "Running", date, hour, True) + handleDict( overview_pending_vobox, "Pending", date, hour, True) + + # Creates json file for jobs per vobox + jsonDict( json_name_vobox, currTime, date, hour, 'VOBox') # Creates json file (This is needed for plots per site) - jsonDict( json_name, currTime, date, hour) + jsonDict( json_name_sites, currTime, date, hour, 'site') print 'INFO: The script has finished after: ', datetime.now()-starttime if __name__ == "__main__": - main() - + main() \ No newline at end of file diff --git a/WFM_Input_DashBoard/WFMperVOBox/Readme.txt b/WFM_Input_DashBoard/WFMperVOBox/Readme.txt deleted file mode 100644 index e7e15ef..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/Readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Sten Luyckx -# Script in acrontab t1 -# 5,20,35,50 * * * * lxplus ssh vocms202 /afs/cern.ch/user/c/cmst1/scratch0/WFM_Input_DashBoard/WFMperVOBox/runWFMonDBShort_voboxes.sh &> /dev/null -# json files are fetched by Dashboardteam, via a special way. Cant be changed by myself -# Script for Dashboard metric (part of) 137, 138: Running/Pending jobs . This metric is shared with that of the # on site instead of on p -er schedular/vobox -# outputfile SSBCERN_voBoxInfo.json -# outputdir /afs/cern.ch/user/c/cmst1/www/WFMon/ - diff --git a/WFM_Input_DashBoard/WFMperVOBox/SSBCERN_voBoxInfo.json b/WFM_Input_DashBoard/WFMperVOBox/SSBCERN_voBoxInfo.json deleted file mode 100644 index 10fef7a..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/SSBCERN_voBoxInfo.json +++ /dev/null @@ -1 +0,0 @@ -{"UPDATE":{"Date":"2013-09-04","Time":"08:20:24 "},"CERN":[{"VOBox":"_condor@vocms228_cern_ch","Pending":"626","TimeDate":"2013-09-04h08:20:24","Running":"844","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"626","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"844"},{"VOBox":"cmssrv101_fnal_gov","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"cmssrv112_fnal_gov","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"UP","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"cmssrv113_fnal_gov","Pending":"1500","TimeDate":"2013-09-04h08:20:24","Running":"260","Status":"UP","RunProc":"260","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"878","PenProd":"549","PenMerge":"73","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"cmssrv94_fnal_gov","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"cmssrv98_fnal_gov","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"UP","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"cmst1@vocms227_cern_ch","Pending":"3899","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"3881","PenProd":"0","PenMerge":"14","PenClean":"3","PenLog":"1","PenTestJobs":"0"},{"VOBox":"schedd_jobs2@vocms142_cern_ch","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"schedd_jobs3@vocms142_cern_ch","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"schedd_jobs4@vocms142_cern_ch","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"schedd_jobs5@vocms142_cern_ch","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"vocms142_cern_ch","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"up","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"vocms201_cern_ch","Pending":"56855","TimeDate":"2013-09-04h08:20:24","Running":"10039","Status":"UP","RunProc":"10039","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"56848","PenMerge":"3","PenClean":"1","PenLog":"3","PenTestJobs":"0"},{"VOBox":"vocms202_cern_ch","Pending":"602","TimeDate":"2013-09-04h08:20:24","Running":"684","Status":"DRAIN","RunProc":"684","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"380","PenProd":"0","PenMerge":"222","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"vocms216_cern_ch","Pending":"109576","TimeDate":"2013-09-04h08:20:24","Running":"2783","Status":"UP","RunProc":"2783","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"4","PenProd":"108192","PenMerge":"1225","PenClean":"18","PenLog":"137","PenTestJobs":"0"},{"VOBox":"vocms230_cern_ch","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"UP","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"vocms234_cern_ch","Pending":"129","TimeDate":"2013-09-04h08:20:24","Running":"980","Status":"UP","RunProc":"980","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"21","PenProd":"0","PenMerge":"105","PenClean":"2","PenLog":"1","PenTestJobs":"0"},{"VOBox":"vocms235_cern_ch","Pending":"55255","TimeDate":"2013-09-04h08:20:24","Running":"4859","Status":"up","RunProc":"4859","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"270","PenProd":"54979","PenMerge":"5","PenClean":"1","PenLog":"0","PenTestJobs":"0"},{"VOBox":"vocms237_cern_ch","Pending":"3","TimeDate":"2013-09-04h08:20:24","Running":"1234","Status":"up","RunProc":"1234","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"3","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"},{"VOBox":"vocms85_cern_ch","Pending":"0","TimeDate":"2013-09-04h08:20:24","Running":"0","Status":"UP","RunProc":"0","RunProd":"0","RunMerge":"0","RunClean":"0","RunLog":"0","RunTestJobs":"0","PenProc":"0","PenProd":"0","PenMerge":"0","PenClean":"0","PenLog":"0","PenTestJobs":"0"}]} \ No newline at end of file diff --git a/WFM_Input_DashBoard/WFMperVOBox/SSBFNAL_voBoxInfo.json b/WFM_Input_DashBoard/WFMperVOBox/SSBFNAL_voBoxInfo.json deleted file mode 100644 index 2ee600d..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/SSBFNAL_voBoxInfo.json +++ /dev/null @@ -1 +0,0 @@ -{"UPDATE":{"Date":"2013-09-04","Time":"08:20:24 "},"FNAL":[]} \ No newline at end of file diff --git a/WFM_Input_DashBoard/WFMperVOBox/WFMonDBcron.log b/WFM_Input_DashBoard/WFMperVOBox/WFMonDBcron.log deleted file mode 100644 index 51a58f3..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/WFMonDBcron.log +++ /dev/null @@ -1,103 +0,0 @@ -2013-09-04h08:35:46 - -condor_status -pool vocms97.cern.ch -schedd -format "%s -" Name -condor_status -pool vocms165.cern.ch -schedd -format "%s -" Name -Passed first condor_status pool -listscheddsCERN -['_condor@vocms228_cern_ch ', 'cmssrv101_fnal_gov ', 'cmssrv112_fnal_gov ', 'cmssrv113_fnal_gov ', 'cmssrv94_fnal_gov ', 'cmssrv98_fnal_gov ', 'vocms201_cern_ch ', 'vocms202_cern_ch ', 'vocms216_cern_ch ', 'vocms230_cern_ch ', 'vocms234_cern_ch ', 'vocms235_cern_ch ', 'vocms237_cern_ch ', 'vocms85_cern_ch '] ----------------------- -listscheddsCERN2 -['cmst1@vocms227_cern_ch ', 'schedd_jobs2@vocms142_cern_ch ', 'schedd_jobs3@vocms142_cern_ch ', 'schedd_jobs4@vocms142_cern_ch ', 'schedd_jobs5@vocms142_cern_ch ', 'vocms142_cern_ch '] ----------------------- -update collector list -bash update_voBoxlist.sh voboxCERN_prev.txt voboxCERN.txt; bash update_voBoxlist.sh voboxFNAL_prev.txt voboxFNAL.txt -running update_voBoxlist.sh with site_list_prev: voboxCERN_prev.txt and site_list: voboxCERN.txt -previous sitelist: -_condor@vocms228_cern_ch -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch -cmst1@vocms227_cern_ch -schedd_jobs2@vocms142_cern_ch -schedd_jobs3@vocms142_cern_ch -schedd_jobs4@vocms142_cern_ch -schedd_jobs5@vocms142_cern_ch -vocms142_cern_ch -=========================================== -sitelist before changes: -_condor@vocms228_cern_ch -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch -cmst1@vocms227_cern_ch -schedd_jobs2@vocms142_cern_ch -schedd_jobs3@vocms142_cern_ch -schedd_jobs4@vocms142_cern_ch -schedd_jobs5@vocms142_cern_ch -vocms142_cern_ch -=========================================== -debating: _condor@vocms228_cern_ch -_condor@vocms228_cern_ch already inside -========================================== -sistelist after changes: -_condor@vocms228_cern_ch -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch -cmst1@vocms227_cern_ch -schedd_jobs2@vocms142_cern_ch -schedd_jobs3@vocms142_cern_ch -schedd_jobs4@vocms142_cern_ch -schedd_jobs5@vocms142_cern_ch -vocms142_cern_ch -========================================== -running update_voBoxlist.sh with site_list_prev: voboxFNAL_prev.txt and site_list: voboxFNAL.txt -previous sitelist: -=========================================== -sitelist before changes: -=========================================== -========================================== -sistelist after changes: -========================================== - - -collector list update complete -condor_q -pool vocms97.cern.ch -name _condor@vocms228.cern.ch -format "%i." ClusterID -format "%s||" ProcId -format "%i||" JobStatus -format "%s||" UserLog -format "%s||" DESIRED_Sites -format "\%s||" WMAgent_SubTaskType -format "%s||" MATCH_EXP_JOBGLIDEIN_CMSSite -format " -" Owner -condor_q -pool vocms97.cern.ch -name cmssrv101.fnal.gov -format "%i." ClusterID -format "%s||" ProcId -format "%i||" JobStatus -format "%s||" UserLog -format "%s||" DESIRED_Sites -format "\%s||" WMAgent_SubTaskType -format "%s||" MATCH_EXP_JOBGLIDEIN_CMSSite -format " -" Owner -condor_q -pool vocms97.cern.ch -name cmssrv112.fnal.gov -format "%i." ClusterID -format "%s||" ProcId -format "%i||" JobStatus -format "%s||" UserLog -format "%s||" DESIRED_Sites -format "\%s||" WMAgent_SubTaskType -format "%s||" MATCH_EXP_JOBGLIDEIN_CMSSite -format " -" Owner -condor_q -pool vocms97.cern.ch -name cmssrv113.fnal.gov -format "%i." ClusterID -format "%s||" ProcId -format "%i||" JobStatus -format "%s||" UserLog -format "%s||" DESIRED_Sites -format "\%s||" WMAgent_SubTaskType -format "%s||" MATCH_EXP_JOBGLIDEIN_CMSSite - \ No newline at end of file diff --git a/WFM_Input_DashBoard/WFMperVOBox/WFMvoBoxDBShort_voboxes.py b/WFM_Input_DashBoard/WFMperVOBox/WFMvoBoxDBShort_voboxes.py deleted file mode 100755 index 402095c..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/WFMvoBoxDBShort_voboxes.py +++ /dev/null @@ -1,379 +0,0 @@ -#!/usr/bin/env python - -# script that fills the WM database. It is called every 15 min and the database itself is 1time created with create_WMdatabase.db -# script calls a bash function to write the database because only sqlite 1.1.7 is available in python ( <--> sqlite3 in bash ) - -import sys,os -import subprocess -from datetime import datetime -import urllib2 -collectors = ['vocms97.cern.ch', 'vocms165.cern.ch', 'cmssrv119.fnal.gov'] -#collectors = ['vocms97.cern.ch', 'vocms165.cern.ch'] - -schedd_status_url = r'https://cmst1.web.cern.ch/CMST1/wmaconfig/AgentStatus.txt' - -#previous list: -schedd_file_prev = "voboxlist_prev.txt" - -#write list of schedulers to vobox file -schedd_file = "voboxlist.txt" - -currTime = None -jobs_failedTypeLogic = {} - -relvalAgents = ['vocms142.cern.ch', 'cmssrv113.fnal.gov'] -jobTypes = ['Processing', 'Production', 'Skim', 'Harvest', 'Merge', 'LogCollect', 'Cleanup', 'RelVal', 'T0'] -t0Types = ['Repack', 'Express', 'Reco'] -countedJobIds = set() - -def findTask(id,sched,typeToExtract): - """ - This deduces job type from given info about scheduler and taskName - """ - type = '' - if any([x in sched for x in relvalAgents]): - type = 'RelVal' - elif 'Cleanup' in typeToExtract: - type = 'Cleanup' - elif 'Merge' in typeToExtract: - type = 'Merge' - elif 'LogCollect' in typeToExtract: - type = 'LogCollect' - elif 'skim' in typeToExtract.lower(): - type = 'Skim' - elif 'harvest' in typeToExtract.lower(): - type = 'Harvest' - elif 'Production' in typeToExtract or 'MonteCarloFromGEN' in typeToExtract: - type = 'Production' - elif 'Processing' in typeToExtract or 'StepOneProc' in typeToExtract or 'StepTwoProc' in typeToExtract: - type = 'Processing' - elif 'StoreResults' in typeToExtract: - type = 'Merge' - elif any([x in typeToExtract for x in t0Types]): - type = 'T0' - else: - type = 'Processing' - l = sched+' '+typeToExtract - if l not in jobs_failedTypeLogic: - jobs_failedTypeLogic[l] = 1 - else: - jobs_failedTypeLogic[l] += 1 - return type - -def increaseCounterInDict(dictionary, schedd, jobType, jobId): - """ - Filling the dictionaries - """ - #skip if job is already counted - if jobId in countedJobIds: - return - else: - countedJobIds.add(jobId) - #add to dictionary - if schedd in dictionary: - dictionary[schedd][jobType] += 1 - else: - tmp = dict((jobType, 0) for jobType in jobTypes) - dictionary[schedd] = tmp - dictionary[schedd][jobType] += 1 - -def fillBrokenSchedds(schedd_list, dictionary): - """ - Fill the sites/vobox that have no information atm, but are in the database, with 0's - """ - #print dict.keys() - for schedd in schedd_list: - stripped_site = schedd.strip() - if not stripped_site in dictionary: - tmp = dict((jobType, 0) for jobType in jobTypes) - dictionary[stripped_site] = tmp - -#Printing function for debugging -def printDict(dictionary, description): - sortedKeys = dictionary.keys() - sortedKeys.sort() - print '-'*114 - print '| %24s | Proces. | Produc. | Merge | Cleanup | LogCol. | RelVal/Sk/Hrv | T0 | Total |' % description - print '-'*114 - #['Processing', 'Production', 'Skim', 'Harvest', 'Merge', 'LogCollect', 'Cleanup', 'RelVal', 'T0'] - for site in sortedKeys: - print '| %24s | %7d | %7d | %7d | %7d | %7d | %13d | %7d | %7d |' % (site, dictionary[site]['Processing'], - dictionary[site]['Production'], dictionary[site]['Merge'], - dictionary[site]['Cleanup'], dictionary[site]['LogCollect'], - dictionary[site]['RelVal'] + dictionary[site]['Skim'] + dictionary[site]['Harvest'], - dictionary[site]['T0'], - sum(dictionary[site].values())) - print '-'*114 - -def getScheddStatus(): - """ - retrieves the collector announced time - and creates a dictionary - """ - out = urllib2.urlopen(schedd_status_url).read() - schedd_status = {} - - for line in out.split('\n'): - #ignore empty lines - if not line.strip(): - continue - print line - arr = line.split() - schedd = line[0] - status = line[1] - schedd_status[schedd] = status - return schedd_status - - -def jsonDict(dict_run, dict_pen, json_name, date, hour, location): - """ - Writing json file - """ - #sort scheddulers - schedd_list = dict_run.keys() - schedd_list.sort() - #get the shceduler status - schedd_status = getScheddStatus() - - #header - json_part = '{\"UPDATE\":{\"Date\":\"'+date+'\",\"Time\":\"'+hour+'\"},\"'+location+'\":[' - - #site is here a voBox - first = True - for schedd in schedd_list: - #get the schedd status if available, 'up' otherwise - if schedd in schedd_status: - s_status = schedd_status[schedd] - else: - s_status = 'up' - #only first comma - if first: - startingComma = "" - first = False - else: - startingComma = "," - - #adapt schedd to format - schedd_fix = schedd.replace('.',"_") - schedd_fix = schedd_fix.strip(' ') - sumRunning = sum(dict_run[schedd].values()) - sumPending = sum(dict_pen[schedd].values()) - #schedd data - json_schedd_part= startingComma+"{\"VOBox\":\""+str(schedd_fix)+"\"" \ - +",\"Pending\":\""+str(int(sumPending))+"\"" \ - +",\"TimeDate\":\""+str(currTime.strip())+"\"" \ - +",\"Running\":\""+str(sumRunning)+"\"" \ - +",\"RunProc\":\""+str(dict_run[schedd]['Processing'])+"\"" \ - +",\"RunProd\":\""+str(dict_run[schedd]['Production'])+"\"" \ - +",\"RunSkim\":\""+str(dict_run[schedd]['Skim'])+"\"" \ - +",\"RunHarvest\":\""+str(dict_run[schedd]['Harvest'])+"\"" \ - +",\"RunMerge\":\""+str(dict_run[schedd]['Merge'])+"\"" \ - +",\"RunClean\":\""+str(dict_run[schedd]['Cleanup'])+"\"" \ - +",\"RunLog\":\""+str(dict_run[schedd]['LogCollect'])+"\"" \ - +",\"RunRelVal\":\""+str(dict_run[schedd]['RelVal'])+"\"" \ - +",\"RunT0\":\""+str(dict_run[schedd]['T0'])+"\"" \ - +",\"PenProc\":\""+str(int(dict_pen[schedd]['Processing']))+"\"" \ - +",\"PenProd\":\""+str(int(dict_pen[schedd]['Production']))+"\"" \ - +",\"PenSkim\":\""+str(int(dict_pen[schedd]['Skim']))+"\"" \ - +",\"PenHarvest\":\""+str(int(dict_pen[schedd]['Harvest']))+"\"" \ - +",\"PenMerge\":\""+str(int(dict_pen[schedd]['Merge']))+"\"" \ - +",\"PenClean\":\""+str(int(dict_pen[schedd]['Cleanup']))+"\"" \ - +",\"PenLog\":\""+str(int(dict_pen[schedd]['LogCollect']))+"\"" \ - +",\"PenRelVal\":\""+str(int(dict_pen[schedd]['RelVal']))+"\"" \ - +",\"PenT0\":\""+str(int(dict_pen[schedd]['T0']))+"\"" \ - +",\"Status\":\""+str(s_status)+"\"" \ - +"}" - #remove parenthesis - json_schedd_part = str(json_schedd_part).replace("('","").replace("')","") - - #print json_schedd_part_str - json_part += json_schedd_part - - json_part += ']}' - #remove spaces - json_part.replace(" ", "") - - print '-'*114 - #print json_part - #overwrite file - json_file = open(json_name,"w") - json_file.write(json_part) - json_file.close() - -def getSchedulersFromCollector(collector): - """ - Gets a scheduler lists from a collector - """ - result = [] - #Extracting the schedulars list from all collectors - dict_col_with_schedd={} - - #run condor command to check schedulers - listcommand="condor_status -pool "+collector+" -schedd -format \"%s \n\" Name" - print listcommand - proc = subprocess.Popen(listcommand, stderr = subprocess.PIPE,stdout = subprocess.PIPE, shell = True) - out, err = proc.communicate() - - # we don't have to send an email when there is an error (collector not reachable), since it is already done in the script per schedd - for line in err.split('\n') : - if 'Error' in line: - print "Called: "+listcommand - print "Col: "+collector+" is offline" - break - #append server names - for line in out.split('\n') : - if ('cern' in line) or ('fnal' in line): - result.append(line.strip()) - return result - -def updateScheddList(schedd_list): - """ - Updates schedulers lists - """ - #read from file previous list - try: - schedd_list_prev = [l.strip() for l in open(schedd_file, 'r') if l.strip()] - except: - #if errors list is empty - schedd_list_prev = [] - print "update collector list " - #merge both lists: - for schedd in schedd_list: - #if not in previous list, add it - if schedd not in schedd_list_prev: - schedd_list_prev.append(schedd) - - schedd_list = schedd_list_prev - - #write resulting list to file - sched_file_w = open(schedd_file,'w') - for schedd in schedd_list: - sched_file_w.write(schedd+'\n') - sched_file_w.close() - - #return the merged list - return schedd_list - - -def countJobsForSchedd(coll, schedd, dict_running, dict_pending): - """ - Traverse all jobs for a given scheduler on a given collector. - """ - command = 'condor_q -pool ' + coll + ' -name ' + schedd - command += (' -format "%i." ClusterID -format "%s||" ProcId -format "%i||" JobStatus'+ - ' -format "%s||" WMAgent_SubTaskName -format "%s||" UserLog'+ - r' -format "\n" ProcId') - - print command - #command line - proc = subprocess.Popen(command, stderr = subprocess.PIPE,stdout = subprocess.PIPE, shell = True) - out, err = proc.communicate() - - #process output - for line in out.split('\n') : - if line == "" : - continue - # skip sleep.log problem lines - if 'sleep.log' in line: - continue - - - array = line.split("||") - - # array[0] ClusterID.ProcId - # array[1] JobStatus - # only when its the new software - # array[2] WMAgent_SubTaskName - # array[3] UserLog - - procId = array[0] - jobStatus = int(array[1]) - #get - task = array[2].split('/')[-1] - typeToExtract = task - jobType = findTask(procId,schedd,typeToExtract) - - # skip production jobs with JobCache, or HC/TestJobs with condor - if 'JobCache' not in line and 'vocms228' not in schedd: - continue - - # Increase/append the dictionarry - #running - if jobStatus == 2: - increaseCounterInDict(dict_running, schedd, jobType, procId) - #pending - elif jobStatus == 1: - increaseCounterInDict(dict_pending, schedd, jobType, procId) - #else : - #increaseCounterInDict(overview_other,schedd_fix,type) - - -def main(): - global currTime - #Timing the script - starttime = datetime.now() - #split utc time - currTime = datetime.utcnow().strftime("%Y-%m-%dh%H:%M:%S ") - - - jsonCERN_name="SSBCERN_voBoxInfo.json" - - #Start of the program: Creating 3 empty dictionaries - overview_running = {} - overview_pending = {} - #overview_other = {} - - date, hour = currTime.split('h') - - #map - collector - schedulers - coll_schedd = {} - - listschedds = [] - #get a list if schedulers and the reference to each collector - for col in collectors: - schedds = getSchedulersFromCollector(col) - coll_schedd[col] = schedds - listschedds += schedds - - print "Passed condor_status pool of all collectors." - print "Dict of dict['col']= [schedds]:" - print coll_schedd - - #saves a schedduler lists to keep in file - listschedds = updateScheddList(listschedds) - - for coll in coll_schedd.keys(): - for schedd in coll_schedd[coll]: - #count jobs for each schedduler and fill running and pending jobs. - countJobsForSchedd(coll, schedd, overview_running, overview_pending) - - - #Adding the voboxes to the 2 dicts that are not in the overview list. At the moment they are added with 0's - fillBrokenSchedds(listschedds, overview_running) - fillBrokenSchedds(listschedds, overview_pending) - - #print overview_running - printDict(overview_running,'Running') - print "" - #print overview_pending - printDict(overview_pending,'Pending') - - #Writing the json file - jsonDict(overview_running, overview_pending, jsonCERN_name, date, hour, "CERN") - # Handling jobs that failed task extraction logic - if jobs_failedTypeLogic: - #command="bash failedLogic_email.sh \"%s\"" % str(jobs_failedTypeLogic) - #proc = subprocess.Popen(command, stderr = subprocess.PIPE,stdout = subprocess.PIPE, shell = True) - #out, err = proc.communicate() - print 'ERROR: I find jobs that failed the type assignment logic, I will send an email' - for (l,n) in jobs_failedTypeLogic.items(): - print l,n - #print out, '\n', "Error: ", '\n', err - - - - print '__________________-' - print 'THE PROGRAM IS FINISHED AFTER', datetime.now()-starttime - -if __name__ == '__main__': - main() diff --git a/WFM_Input_DashBoard/WFMperVOBox/emailmessage.txt b/WFM_Input_DashBoard/WFMperVOBox/emailmessage.txt deleted file mode 100644 index e69de29..0000000 diff --git a/WFM_Input_DashBoard/WFMperVOBox/fakedatabase b/WFM_Input_DashBoard/WFMperVOBox/fakedatabase deleted file mode 100644 index e69de29..0000000 diff --git a/WFM_Input_DashBoard/WFMperVOBox/get_voBoxStatus.sh b/WFM_Input_DashBoard/WFMperVOBox/get_voBoxStatus.sh deleted file mode 100644 index 72dc689..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/get_voBoxStatus.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# by Luyckx S. - - -args=("$@") - -filename=${args[0]} -voBox=${args[1]} - -# check number of arguments -EXPECTED_ARGS=2 -if [ $# -ne $EXPECTED_ARGS ]; -then - echo "Wrong number of arguments. Expecting $EXPECTED_ARGS arguments." - exit 65 -fi - -voBox_in_file=$(cat $filename | grep "$voBox" | awk '{print $1}' ) - -#changing _ to . in filename -voBoxDots=$(echo $voBox|sed 's/_/./g') -uptimeArray=$( grep "$voBoxDots" $filename ) #array of [voBox uptimestatus] - if [ "$uptimeArray" == "" ]; - then - uptime='up' - else - echo $uptimeArray > upAr.tmp - uptime=$( awk '{print $2}' upAr.tmp ) - rm upAr.tmp - fi - -# will be picked up by python script -echo "output $uptime" - - - diff --git a/WFM_Input_DashBoard/WFMperVOBox/runWFMonDBShort_voboxes.sh b/WFM_Input_DashBoard/WFMperVOBox/runWFMonDBShort_voboxes.sh deleted file mode 100755 index 98f58b2..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/runWFMonDBShort_voboxes.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# Sten Luyckx -# Script in acrontab t1 -# 5,20,35,50 * * * * lxplus ssh vocms202 /afs/cern.ch/user/c/cmst1/scratch0/WFM_Input_DashBoard/WFMperVOBox/runWFMonDBShort_voboxes.sh &> /dev/null -# json files are fetched by Dashboardteam, via a special way. Cant be changed by myself -# Script for Dashboard metric (part of) 137, 138: Running/Pending jobs . This metric is shared with that of the # on site instead of on per schedular/vobox -# outputfile SSBCERN_voBoxInfo.json -# outputfile SSBFNAL_voBoxInfo.json / empty at the moment -# outputdir /afs/cern.ch/user/c/cmst1/www/WFMon/ - - -#Initialize -source ~cmst1/.bashrc -agentenv -source /data/srv/wmagent/current/apps/wmagent/etc/profile.d/init.sh -cd /afs/cern.ch/user/c/cmst1/scratch0/WFM_Input_DashBoard/WFMperVOBox - -# Email if things are running slowly -if [ -f scriptRunning.run ]; -then - echo "bash runWFMonDB.sh is already running. Will send an email to the admin." - # script to send simple email - # email subject - SUBJECT="[Monitoring] Condor History load" - # Email To ? - EMAIL="sten.luyckx@cern.ch" - # Email text/message - if [ -f emailmessage.txt ]; - then - rm emailmessage.txt - fi - touch emailmessage.txt - EMAILMESSAGE="/tmp/emailmessage.txt" - echo "Condor history is running to slowly. See: /afs/cern.ch/user/c/cmst1/scratch0/WFM_Input_DashBoard/WFMperVOBox"> $EMAILMESSAGE - echo "https://cmst1.web.cern.ch/CMST1/WFMon/" >>$EMAILMESSAGE - # send an email using /bin/mail - /bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE - -else - echo "bash runWFMonDB.sh started succesfully" - touch scriptRunning.run -fi - -#Run the script -python WFMvoBoxDBShort_voboxes.py &> /afs/cern.ch/user/c/cmst1/scratch0/WFM_Input_DashBoard/WFMperVOBox/WFMonDBcron.log - -problem="$?" -echo "problem: $problem" - -cp SSBCERN_voBoxInfo.json /afs/cern.ch/user/c/cmst1/www/WFMon/ -cp SSBFNAL_voBoxInfo.json /afs/cern.ch/user/c/cmst1/www/WFMon/ - -rm scriptRunning.run - diff --git a/WFM_Input_DashBoard/WFMperVOBox/scriptRunning.run b/WFM_Input_DashBoard/WFMperVOBox/scriptRunning.run deleted file mode 100644 index e69de29..0000000 diff --git a/WFM_Input_DashBoard/WFMperVOBox/update_voBoxlist.sh b/WFM_Input_DashBoard/WFMperVOBox/update_voBoxlist.sh deleted file mode 100644 index c6203ce..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/update_voBoxlist.sh +++ /dev/null @@ -1,36 +0,0 @@ - -# by Luyckx S. - -# This code is called by the python script. Do not call this function yourself. -# this code will add sites to the database when they are not yet included. This will be checked every time the python script is runned. - -site_list_prev=$1 -site_list=$2 - -echo "running update_voBoxlist.sh with site_list_prev: $site_list_prev and site_list: $site_list" -echo "previous sitelist:" -cat $site_list_prev -echo "===========================================" -echo "sitelist before changes:" -cat $site_list -echo "===========================================" - -# Looping the previous voBox list and checking if all these sites are already in the site_list. If not add them -cat ${site_list_prev} | while read oldsite -do - echo "debating: $oldsite" - - if `cat ${site_list} | grep "${oldsite}" 1>/dev/null 2>&1` - then - echo "${oldsite} already inside" - else - echo "will keep the old site ${oldsite} in the list" - echo $oldsite >> $site_list - fi -done -echo "==========================================" -echo "sitelist after changes:" -cat $site_list -echo "==========================================" -# copy the new voBox_list to the previous voBox_list for the next iteration -cp $site_list $site_list_prev diff --git a/WFM_Input_DashBoard/WFMperVOBox/voboxCERN.txt b/WFM_Input_DashBoard/WFMperVOBox/voboxCERN.txt deleted file mode 100644 index c4fe906..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/voboxCERN.txt +++ /dev/null @@ -1,20 +0,0 @@ -_condor@vocms228_cern_ch -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch -cmst1@vocms227_cern_ch -schedd_jobs2@vocms142_cern_ch -schedd_jobs3@vocms142_cern_ch -schedd_jobs4@vocms142_cern_ch -schedd_jobs5@vocms142_cern_ch -vocms142_cern_ch diff --git a/WFM_Input_DashBoard/WFMperVOBox/voboxCERN_prev.txt b/WFM_Input_DashBoard/WFMperVOBox/voboxCERN_prev.txt deleted file mode 100644 index c4fe906..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/voboxCERN_prev.txt +++ /dev/null @@ -1,20 +0,0 @@ -_condor@vocms228_cern_ch -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch -cmst1@vocms227_cern_ch -schedd_jobs2@vocms142_cern_ch -schedd_jobs3@vocms142_cern_ch -schedd_jobs4@vocms142_cern_ch -schedd_jobs5@vocms142_cern_ch -vocms142_cern_ch diff --git a/WFM_Input_DashBoard/WFMperVOBox/voboxFNAL.txt b/WFM_Input_DashBoard/WFMperVOBox/voboxFNAL.txt deleted file mode 100644 index e69de29..0000000 diff --git a/WFM_Input_DashBoard/WFMperVOBox/voboxFNAL_prev.txt b/WFM_Input_DashBoard/WFMperVOBox/voboxFNAL_prev.txt deleted file mode 100644 index e69de29..0000000 diff --git a/WFM_Input_DashBoard/WFMperVOBox/voboxFNAL_prev_old.txt b/WFM_Input_DashBoard/WFMperVOBox/voboxFNAL_prev_old.txt deleted file mode 100644 index 3bd150e..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/voboxFNAL_prev_old.txt +++ /dev/null @@ -1,7 +0,0 @@ -cms-xen39_fnal_gov -cmssrv112_fnal_gov -vocms234_cern_ch -cmssrv113_fnal_gov -vocms202_cern_ch -cmssrv98_fnal_gov -cmssrv101_fnal_gov diff --git a/WFM_Input_DashBoard/WFMperVOBox/voboxlist.txt b/WFM_Input_DashBoard/WFMperVOBox/voboxlist.txt deleted file mode 100644 index 03453a4..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/voboxlist.txt +++ /dev/null @@ -1,35 +0,0 @@ -_condor@vocms228_cern_ch -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch -cmst1@vocms227_cern_ch -schedd_jobs2@vocms142_cern_ch -schedd_jobs3@vocms142_cern_ch -schedd_jobs4@vocms142_cern_ch -schedd_jobs5@vocms142_cern_ch -vocms142_cern_ch -_condor@vocms228_cern_ch -cms-xen39_fnal_gov -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch diff --git a/WFM_Input_DashBoard/WFMperVOBox/voboxlist_prev.txt b/WFM_Input_DashBoard/WFMperVOBox/voboxlist_prev.txt deleted file mode 100644 index 03453a4..0000000 --- a/WFM_Input_DashBoard/WFMperVOBox/voboxlist_prev.txt +++ /dev/null @@ -1,35 +0,0 @@ -_condor@vocms228_cern_ch -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch -cmst1@vocms227_cern_ch -schedd_jobs2@vocms142_cern_ch -schedd_jobs3@vocms142_cern_ch -schedd_jobs4@vocms142_cern_ch -schedd_jobs5@vocms142_cern_ch -vocms142_cern_ch -_condor@vocms228_cern_ch -cms-xen39_fnal_gov -cmssrv101_fnal_gov -cmssrv112_fnal_gov -cmssrv113_fnal_gov -cmssrv94_fnal_gov -cmssrv98_fnal_gov -vocms201_cern_ch -vocms202_cern_ch -vocms216_cern_ch -vocms230_cern_ch -vocms234_cern_ch -vocms235_cern_ch -vocms237_cern_ch -vocms85_cern_ch diff --git a/WFM_Input_DashBoard/runWFMonDBShort.sh b/WFM_Input_DashBoard/runWFMonDBShort.sh index 353bb24..f701bb1 100755 --- a/WFM_Input_DashBoard/runWFMonDBShort.sh +++ b/WFM_Input_DashBoard/runWFMonDBShort.sh @@ -46,7 +46,7 @@ python WFMonDBShort.py &> WFMonDBcron.log problem="$?" echo "problem: $problem" -cp SSB_siteInfo.json /afs/cern.ch/user/c/cmst1/www/WFMon/ +cp SSB*.json /afs/cern.ch/user/c/cmst1/www/WFMon/ cp *.txt /afs/cern.ch/user/c/cmst1/www/WFMon/ cp WFMonDBcron_prevlog.log WFMonDBcron_prevlog2.log cp WFMonDBcron.log WFMonDBcron_prevlog.log