Skip to content
Snippets Groups Projects
Commit 96025b93 authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Changes for LVAlert overseer.

parent 8a9fc71a
No related branches found
No related tags found
No related merge requests found
...@@ -8,10 +8,10 @@ from django.conf import settings ...@@ -8,10 +8,10 @@ from django.conf import settings
import json import json
import logging import logging
#from hashlib import sha1
#from ligo.overseer.client import send_to_overseer from hashlib import sha1
#from multiprocessing import Process, Manager from ligo.overseer.client import send_to_overseer
from multiprocessing import Process, Manager
log = logging.getLogger('gracedb.alert') log = logging.getLogger('gracedb.alert')
...@@ -150,23 +150,24 @@ def issueXMPPAlert(event, location, alert_type="new", description="", serialized ...@@ -150,23 +150,24 @@ def issueXMPPAlert(event, location, alert_type="new", description="", serialized
msg = json.dumps(lva_data) msg = json.dumps(lva_data)
log.debug("issueXMPPAlert: writing message %s" % msg) log.debug("issueXMPPAlert: writing message %s" % msg)
# manager = Manager() manager = Manager()
for server in settings.ALERT_XMPP_SERVERS: for server in settings.ALERT_XMPP_SERVERS:
port = settings.LVALERT_OVERSEER_PORTS[server]
for nodename in nodenames: for nodename in nodenames:
# # Calculate unique message_id and log # Calculate unique message_id and log
# message_id = sha1(nodename + msg).hexdigest() message_id = sha1(nodename + msg).hexdigest()
# log.info("issueXMPPAlert: sending %s to node %s" % (message_id, nodename)) log.info("issueXMPPAlert: sending %s to node %s on %s" % (message_id, nodename, server))
#
# rdict = manager.dict() rdict = manager.dict()
# msg_dict = {'node_name': nodename, 'message': msg, 'action': 'push'} msg_dict = {'node_name': nodename, 'message': msg, 'action': 'push'}
# p = Process(target=send_to_overseer, args=(msg_dict, rdict, log, True)) p = Process(target=send_to_overseer, args=(msg_dict, rdict, log, True, port))
# p.start() p.start()
# p.join() p.join()
#
# if rdict.get('success', None): if rdict.get('success', None):
# continue continue
# If not success, we need to do this the old way. # If not success, we need to do this the old way.
log.info("issueXMPPAlert: failover to lvalert_send") log.info("issueXMPPAlert: failover to lvalert_send")
......
...@@ -37,9 +37,14 @@ ALERT_TEST_EMAIL_FROM = "Dev Test Alert <root@moe.phys.uwm.edu>" ...@@ -37,9 +37,14 @@ ALERT_TEST_EMAIL_FROM = "Dev Test Alert <root@moe.phys.uwm.edu>"
ALERT_TEST_EMAIL_TO = [ ALERT_TEST_EMAIL_TO = [
"Branson Stephens <branson@gravity.phys.uwm.edu>", "Branson Stephens <branson@gravity.phys.uwm.edu>",
] ]
ALERT_XMPP_SERVER = "jabber.phys.uwm.edu", ALERT_XMPP_SERVERS = ["lvalert-test.cgca.uwm.edu",]
ALERT_XMPP_SERVERS = ["jabber.phys.uwm.edu",] LVALERT_SEND_EXECUTABLE = '/usr/bin/lvalert_send'
LVALERT_SEND_EXECUTABLE = '/home/branson/djangoenv/bin/lvalert_send'
# For each lvalert server, a separate instance of the lvalert_overseer
# must be running and listening on a distinct port.
LVALERT_OVERSEER_PORTS = {
'lvalert-test.cgca.uwm.edu': 8001,
}
EMBB_MAIL_ADDRESS = 'branson@moe.phys.uwm.edu' EMBB_MAIL_ADDRESS = 'branson@moe.phys.uwm.edu'
EMBB_SMTP_SERVER = 'localhost' EMBB_SMTP_SERVER = 'localhost'
......
...@@ -30,6 +30,12 @@ ALERT_TEST_EMAIL_TO = [ ...@@ -30,6 +30,12 @@ ALERT_TEST_EMAIL_TO = [
ALERT_XMPP_SERVERS = ["lvalert.cgca.uwm.edu"] ALERT_XMPP_SERVERS = ["lvalert.cgca.uwm.edu"]
LVALERT_SEND_EXECUTABLE = '/usr/bin/lvalert_send' LVALERT_SEND_EXECUTABLE = '/usr/bin/lvalert_send'
# For each lvalert server, a separate instance of the lvalert_overseer
# must be running and listening on a distinct port.
LVALERT_OVERSEER_PORTS = {
'lvalert.cgca.uwm.edu': 8000,
}
EMBB_MAIL_ADDRESS = 'embb@gracedb.ligo.org' EMBB_MAIL_ADDRESS = 'embb@gracedb.ligo.org'
EMBB_SMTP_SERVER = 'localhost' EMBB_SMTP_SERVER = 'localhost'
EMBB_MAIL_ADMINS = ['branson@gravity.phys.uwm.edu','roy.williams@ligo.org',] EMBB_MAIL_ADMINS = ['branson@gravity.phys.uwm.edu','roy.williams@ligo.org',]
......
...@@ -41,10 +41,15 @@ ALERT_TEST_EMAIL_TO = [ ...@@ -41,10 +41,15 @@ ALERT_TEST_EMAIL_TO = [
"Roy Williams <roy@caltech.edu>", "Roy Williams <roy@caltech.edu>",
] ]
ALERT_XMPP_SERVER = 'jabber.phys.uwm.edu' ALERT_XMPP_SERVERS = ['lvalert-test.cgca.uwm.edu',]
ALERT_XMPP_SERVERS = ['jabber.phys.uwm.edu',]
LVALERT_SEND_EXECUTABLE = '/usr/bin/lvalert_send' LVALERT_SEND_EXECUTABLE = '/usr/bin/lvalert_send'
# For each lvalert server, a separate instance of the lvalert_overseer
# must be running and listening on a distinct port.
LVALERT_OVERSEER_PORTS = {
'lvalert-test.cgca.uwm.edu': 8001,
}
EMBB_MAIL_ADDRESS = 'embb@embb-dev.ligo.caltech.edu' EMBB_MAIL_ADDRESS = 'embb@embb-dev.ligo.caltech.edu'
EMBB_SMTP_SERVER = 'acrux.ligo.caltech.edu' EMBB_SMTP_SERVER = 'acrux.ligo.caltech.edu'
EMBB_MAIL_ADMINS = ['roy.williams@ligo.org',] EMBB_MAIL_ADMINS = ['roy.williams@ligo.org',]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment