Ejemplo n.º 1
0
import api_stashboard_panell_v2

print "SEGUR QUE VOLEU ESBORRAR TOOOTS ELS EVENTS? Escriviu SI"
s=raw_input('Enter your input:')
print s
if s != "SI":
	quit()
else:
	print "hello"
	st = api_stashboard_panell_v2.api_stashboard_panell("https://panell-estats.sint.uib.es:8080");
	for i in range(1,100):
	#	try:
			print str(i)
			st.eliminaIncident(str(i))
	#	except:
	#		pass
Ejemplo n.º 2
0
import treu_events_grup_xml
import api_stashboard_panell_v2  #Stashboard extens
import xml.etree.ElementTree as ET
import ZenossAPI

MIN_SEVERITY = 5

xml_string = treu_events_grup_xml.treu_events_grup_xml(
    '/zport/dmd/Groups/serveis/serveis_critics')

root = ET.fromstring(xml_string)

if PROD == True:
    # Servidors en producció
    st = api_stashboard_panell_v2.api_stashboard_panell(
        "http://panell-estats-cti.sint.uib.es:8080", deve_private_hq_token,
        web_password)
    st2 = api_stashboard_panell_v2.api_stashboard_panell(
        "http://panell-estats.sint.uib.es:8080", deve_public_hq_token,
        web_password)
else:
    # Servidors de prova
    print "PROD fals, empram servidors de prova"
    st = api_stashboard_panell_v2.api_stashboard_panell(
        "http://10.80.87.76", deve_public_hq_token, web_password)
    st2 = api_stashboard_panell_v2.api_stashboard_panell(
        "http://10.80.87.76:9080", deve_private_hq_token, web_password)

zp = ZenossAPI.ZenossAPI()

#DUMPING ET:
import sys
sys.path.append("/home/stashboard/panell_serveis_critics_v2/API/")

import treu_events_grup_xml
import api_stashboard_panell_v2 #Stashboard extens
import xml.etree.ElementTree as ET
import ZenossAPI

MIN_SEVERITY = 5

xml_string = treu_events_grup_xml.treu_events_grup_xml('/zport/dmd/Groups/serveis/serveis_critics')

root = ET.fromstring(xml_string)

st = api_stashboard_panell_v2.api_stashboard_panell("http://panell-estats-cti.sint.uib.es:8080","TGUTJqjJ6GXlTndt27hP");# Exclusiu del CTI 
st2 = api_stashboard_panell_v2.api_stashboard_panell("http://panell-estats.sint.uib.es:8080","HISEU50ehqdi86Imehlw");# Public
zp=ZenossAPI.ZenossAPI()

def actualitza(st, id, nom, perfok, aixeca):
	if aixeca == 1:
        	if perfok == 0:
                	if st.getEstatId(id) != "perf":
                        	st.ReportaServei(nom, "El servei està experimentant problemes de rendiment.")
                else:
                        if st.getEstatId(id) != "up":
                                st.AixecaServei(nom,"El servei funciona correctament.")
        else:
               if st.getEstatId(id) != "down":
			st.TombaServei(nom,"Sembla que el servei està experimentant alguns problemes. Estam treballant perquè torni a estar operatiu el més aviat possible.")
from secrets import prod_public_hq_token,prod_private_hq_token,deve_public_hq_token,deve_private_hq_token,web_password
import treu_events_grup_xml
import api_stashboard_panell_v2 #Stashboard extens
import xml.etree.ElementTree as ET
import ZenossAPI


MIN_SEVERITY = 5

xml_string = treu_events_grup_xml.treu_events_grup_xml('/zport/dmd/Groups/serveis/serveis_critics')

root = ET.fromstring(xml_string)

if PROD == True:
# Servidors en producció
	st = api_stashboard_panell_v2.api_stashboard_panell("http://panell-estats-cti.sint.uib.es:8080",deve_private_hq_token,web_password)
	st2 = api_stashboard_panell_v2.api_stashboard_panell("http://panell-estats.sint.uib.es:8080",deve_public_hq_token,web_password)
else:
# Servidors de prova
	print "PROD fals, empram servidors de prova"
	st = api_stashboard_panell_v2.api_stashboard_panell("http://10.80.87.76",deve_public_hq_token,web_password);
	st2 = api_stashboard_panell_v2.api_stashboard_panell("http://10.80.87.76:9080",deve_private_hq_token,web_password);

zp=ZenossAPI.ZenossAPI()



#DUMPING ET:
#ET.dump(TREE)

#
Ejemplo n.º 5
0
import api_stashboard_panell_v2

print "SEGUR QUE VOLEU ESBORRAR TOOOTS ELS EVENTS? Escriviu SI"
s = raw_input('Enter your input:')
print s
if s != "SI":
    quit()
else:
    print "hello"
    st = api_stashboard_panell_v2.api_stashboard_panell(
        "https://panell-estats.sint.uib.es:8080")
    for i in range(1, 100):
        #	try:
        print str(i)
        st.eliminaIncident(str(i))
    #	except:
    #		pass
import sys
sys.path.append("/home/stashboard/panell_serveis_critics_v2/API/")

import treu_events_grup_xml
import api_stashboard_panell_v2  #Stashboard extens
import xml.etree.ElementTree as ET
import ZenossAPI

MIN_SEVERITY = 5

xml_string = treu_events_grup_xml.treu_events_grup_xml(
    '/zport/dmd/Groups/serveis/serveis_critics')

root = ET.fromstring(xml_string)

st = api_stashboard_panell_v2.api_stashboard_panell(
    "http://panell-estats-cti.sint.uib.es:8080", "TGUTJqjJ6GXlTndt27hP")
# Exclusiu del CTI
st2 = api_stashboard_panell_v2.api_stashboard_panell(
    "http://panell-estats.sint.uib.es:8080", "HISEU50ehqdi86Imehlw")
# Public
zp = ZenossAPI.ZenossAPI()


def actualitza(st, id, nom, perfok, aixeca):
    if aixeca == 1:
        if perfok == 0:
            if st.getEstatId(id) != "perf":
                st.ReportaServei(
                    nom,
                    "El servei està experimentant problemes de rendiment.")
        else: