Exemple #1
0
 def finish(self):
     for vof_site in sites.getSites():
         obj = self.siteByName(vof_site)
         if obj:
             obj.calculate()
             self.addEntryFromSite(obj)
         else:
             self.addEntry(vof_site, "white", -1.0)
 def finish(self):
     for vof_site in sites.getSites():
         obj = self.siteByName(vof_site)
         if obj:
             obj.calculate()
             self.addEntryFromSite(obj)   
         else:
             self.addEntry(vof_site,"white",-1.0)
Exemple #3
0
    # talk about it!)
    if not siteName in hammerCloud.getSites():
        return False

    # if site has at least one green slot in the given time range
    # (please check the hammerCloud link given as a parameter to see
    # the time range), return False
    slots = hammerCloud.getSiteEntries(siteName).values()
    for slot in slots:
        if slot.color == dashboard.green: return False
    return True

# merge sites that are not in the vo-feed (sites.getSites)
# --look at the loop, we are getting some sites from the manual changes 
# metric. reason: some sites are not listed in the sites.getSites
siteList = sites.getSites()
for site in usableSitesMC.getSites():
    if not site in siteList:
        siteList[site] = {}

for i in siteList:
    badSiteFlag = False
    ## detect bad sites!
    # site has bad hammercloud history
    if sites.getTier(i) == 2 and hasBadHistory(i):
        print i + " hasBadHistory"
        badSiteFlag = True
    # site is in the morgue
    elif morgue.hasSite(i) and morgue.getSiteEntry(i).value == 'Morgue':
        print i + " is in the Morgue"
        badSiteFlag = True
    # if the site is not in the hc metric, return False

    # (you don't have any idea about the site, you cannot
    # talk about it!)
    if not siteName in hammerCloud.getSites():
        return False

    # if site has at least one green slot in the given time range
    # (please check the hammerCloud link given as a parameter to see
    # the time range), return False
    slots = hammerCloud.getSiteEntries(siteName).values()
    for slot in slots:
        if slot.color == dashboard.green: return False
    return True

for i in sites.getSites():
    badSiteFlag = False
    ## detect bad sites!
    # site has bad hammercloud history
    if sites.getTier(i) == 2 and hasBadHistory(i):
        badSiteFlag = True
    # site is in the morgue
    elif morgue.hasSite(i) and morgue.getSiteEntry(i).color == dashboard.red:
        badSiteFlag = True
    # site has been blocked
    elif usableSitesMC.hasSite(i) and usableSitesMC.getSiteEntry(i).color == dashboard.red:
        badSiteFlag = True

    if badSiteFlag:
        metric.append(dashboard.entry(None, i, 'not_usable', dashboard.red, urlStamp))
    else:
Exemple #5
0
    parsed[cmsSite][id] = subject

# generate output for twiki meeting page
ticketURL = "https://ggus.eu/?mode=ticket_info&ticket_id="
twikiTable = "\n| *CMS Site* | *Number of Tickets* | * Tickets* |\n"
sum = 0
for site in parsed:
    url = ""
    sum = sum + len(parsed[site])
    for id in parsed[site]:
        url = url + "[[%s][%s]] " % (ticketURL + id, id)
    twikiTable = twikiTable + "| %s | %d | %s |\n" % (site, len(
        parsed[site]), url)
dateStamp = time.strftime("%d/%b/%Y %H:%M:%S (GMT)", time.gmtime())
twikiTable = twikiTable + "| *<i>generated on %s</i>, Total number of tickets: %s* |||" % (
    dateStamp, sum)
fileOps.write(sys.argv[2], twikiTable)

# generate text file for the dashboard metric
metric = dashboard.metric()
allSites = sites.getSites().keys()
url = "https://ggus.eu/?mode=ticket_search&cms_site=%s&timeframe=any&status=open&search_submit=GO%%21"
for site in parsed:
    value = len(parsed[site])
    metric.append(dashboard.entry(None, site, value, dashboard.red,
                                  url % site))
for site in allSites:
    if site in parsed.keys(): continue
    metric.append(dashboard.entry(None, site, 0, dashboard.green, url % site))
fileOps.write(sys.argv[3], str(metric))
Exemple #6
0
    if not cmsSite: continue
    if not parsed.has_key(cmsSite):
        parsed[cmsSite] = {}
    parsed[cmsSite][id] = subject

# generate output for twiki meeting page 
ticketURL  = "https://ggus.eu/?mode=ticket_info&ticket_id="
twikiTable = "\n| *CMS Site* | *Number of Tickets* | * Tickets* |\n"
sum        = 0
for site in parsed:
    url = ""
    sum = sum + len(parsed[site])
    for id in parsed[site]:
        url = url + "[[%s][%s]] " % (ticketURL + id, id)
    twikiTable = twikiTable + "| %s | %d | %s |\n" % (site, len(parsed[site]), url)
dateStamp = time.strftime("%d/%b/%Y %H:%M:%S (GMT)", time.gmtime())
twikiTable = twikiTable + "| *<i>generated on %s</i>, Total number of tickets: %s* |||" % (dateStamp, sum)
fileOps.write(sys.argv[2], twikiTable)

# generate text file for the dashboard metric
metric    = dashboard.metric()
allSites  = sites.getSites().keys()
url       = "https://ggus.eu/?mode=ticket_search&cms_site=%s&timeframe=any&status=open&search_submit=GO%%21"
for site in parsed:
    value = len(parsed[site])
    metric.append(dashboard.entry(None, site, value, dashboard.red, url % site))
for site in allSites:
    if site in parsed.keys(): continue
    metric.append(dashboard.entry(None, site, 0, dashboard.green, url % site))
fileOps.write(sys.argv[3], str(metric))
Exemple #7
0
    # (you don't have any idea about the site, you cannot
    # talk about it!)
    if not siteName in hammerCloud.getSites():
        return False

    # if site has at least one green slot in the given time range
    # (please check the hammerCloud link given as a parameter to see
    # the time range), return False
    slots = hammerCloud.getSiteEntries(siteName).values()
    for slot in slots:
        if slot.color == dashboard.green: return False
    return True


for i in sites.getSites():
    badSiteFlag = False
    ## detect bad sites!
    # site has bad hammercloud history
    if sites.getTier(i) == 2 and hasBadHistory(i):
        badSiteFlag = True
    # site is in the morgue
    elif morgue.hasSite(i) and morgue.getSiteEntry(i).color == dashboard.red:
        badSiteFlag = True
    # site has been blocked
    elif usableSitesMC.hasSite(i) and usableSitesMC.getSiteEntry(
            i).color == dashboard.red:
        badSiteFlag = True

    if badSiteFlag:
        metric.append(
new_state_sites = []
for site in lifeStatus_metric_today.getSites():
	if lifeStatus_metric_today.getLatestEntry(site).value != lifeStatus_metric_yesterday.getLatestEntry(site).value:
		problems=[]
		if hc.getLatestEntry(site):
			if hc.getLatestEntry(site).color == 'red': problems.append("HammerCloud")
		if sam.getLatestEntry(site):
			if sam.getLatestEntry(site).color == 'red': problems.append("SAM")
		if T2_T1_links.getLatestEntry(site):
			if T2_T1_links.getLatestEntry(site).color == 'red': problems.append("T2_T1_links")
		if T1_T2_links.getLatestEntry(site): 
			if T1_T2_links.getLatestEntry(site).color == 'red': problems.append("T1_T2_links")
		item = {
			"cms_name": site,
			"name": sites.getSites()[site]['name'],
			"new_status": lifeStatus_metric_today.getLatestEntry(site).value,
			"old_status": lifeStatus_metric_yesterday.getLatestEntry(site).value,
			"problems": ', '.join(problems)
		}
		new_state_sites.append(item)

for site in new_state_sites:
	if site['new_status'] == "waiting_room":
		subject = waiting_room_subject %(site['cms_name'])
		description = waiting_room_description %(site['cms_name'], site['problems'], site['cms_name'])
		if 'HammerCloud' in site['problems']:
			description = description + hc_results % site['cms_name']
		if 'SAM' in site['problems']:
			description = description + sam_results % site['cms_name']
		if "T2_T1_links" in site['problems']: 
Exemple #9
0
                site).value:
        problems = []
        if hc.getLatestEntry(site):
            if hc.getLatestEntry(site).color == 'red':
                problems.append("HammerCloud")
        if sam.getLatestEntry(site):
            if sam.getLatestEntry(site).color == 'red': problems.append("SAM")
        if T2_T1_links.getLatestEntry(site):
            if T2_T1_links.getLatestEntry(site).color == 'red':
                problems.append("T2_T1_links")
        if T1_T2_links.getLatestEntry(site):
            if T1_T2_links.getLatestEntry(site).color == 'red':
                problems.append("T1_T2_links")
        item = {
            "cms_name": site,
            "name": sites.getSites()[site]['name'],
            "new_status": lifeStatus_metric_today.getLatestEntry(site).value,
            "old_status":
            lifeStatus_metric_yesterday.getLatestEntry(site).value,
            "problems": ', '.join(problems)
        }
        new_state_sites.append(item)

for site in new_state_sites:
    if site['new_status'] == "waiting_room":
        subject = waiting_room_subject % (site['cms_name'])
        description = waiting_room_description % (
            site['cms_name'], site['problems'], site['cms_name'])
        if 'HammerCloud' in site['problems']:
            description = description + hc_results % site['cms_name']
        if 'SAM' in site['problems']: