Esempio n. 1
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('monitors.worker', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Startup ZeroMQ client
context = zmq.Context()
zrecv = context.socket(zmq.PULL)
connectline = "tcp://%s:%d" % (config['broker_ip'],
                               config['broker_worker_port'])
logger.info("Connecting to Broker at %s" % connectline)
zrecv.connect(connectline)

# Startup ZeroMQ push client
context2 = zmq.Context()
zsend = context2.socket(zmq.PUSH)
connectline = "tcp://%s:%d" % (config['sink_ip'], config['sink_port'])
Esempio n. 2
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('monitors.broker', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Start ZeroMQ listener for control
context = zmq.Context()
zrecv = context.socket(zmq.PULL)
bindaddress_pull = "tcp://%s:%d" % (
    config['broker_ip'], config['broker_control_port'])
zrecv.bind(bindaddress_pull)
logger.info("Attempting to bind to %s for pulling" % bindaddress_pull)

# Start ZeroMQ listener for workers
context2 = zmq.Context()
zsend = context2.socket(zmq.PUSH)
bindaddress_push = "tcp://%s:%d" % (
Esempio n. 3
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('monitors.control', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(
        host=config['redis_host'], port=config['redis_port'],
        db=config['redis_db'], password=config['redis_password'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# Start ZeroMQ listener
context = zmq.Context()
zsend = context.socket(zmq.PUSH)
Esempio n. 4
0
if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()

# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('crbridge.broker', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Start ZeroMQ listener for control
context = zmq.Context()
zrecv = context.socket(zmq.PULL)
bindaddress_pull = "tcp://%s:%d" % (config['sink_ip'], config['sink_port'])
zrecv.bind(bindaddress_pull)
logger.info("Attempting to bind to %s for pulling" % bindaddress_pull)

# Start ZeroMQ listener for workers
context2 = zmq.Context()
zsend = context2.socket(zmq.PUSH)
bindaddress_push = "tcp://%s:%d" % (config['sink_ip'],
                                    config['sink_worker_port'])
Esempio n. 5
0
if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()

# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('cram.control', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(host=config['redis_host'],
                           port=config['redis_port'],
                           db=config['redis_db'],
                           password=config['redis_password'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# Start ZeroMQ listener
context = zmq.Context()
Esempio n. 6
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Open External Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('actions.actioner', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(
        host=config['redis_host'], port=config['redis_port'],
        db=config['redis_db'], password=config['redis_password'])
    logger.info("Connected to Redis on port %s" % config['redis_port'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# RethinkDB Server
try:
Esempio n. 7
0
if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()

# Open External Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('actions.actioner', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(host=config['redis_host'],
                           port=config['redis_port'],
                           db=config['redis_db'],
                           password=config['redis_password'])
    logger.info("Connected to Redis on port %s" % config['redis_port'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# RethinkDB Server
Esempio n. 8
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('crbridge.broker', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Start ZeroMQ listener for control
context = zmq.Context()
zrecv = context.socket(zmq.PULL)
bindaddress_pull = "tcp://%s:%d" % (config['sink_ip'], config['sink_port'])
zrecv.bind(bindaddress_pull)
logger.info("Attempting to bind to %s for pulling" % bindaddress_pull)

# Start ZeroMQ listener for workers
context2 = zmq.Context()
zsend = context2.socket(zmq.PUSH)
bindaddress_push = "tcp://%s:%d" % (
    config['sink_ip'], config['sink_worker_port'])
Esempio n. 9
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('cram.broker', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Start ZeroMQ listener for control
context = zmq.Context()
zrecv = context.socket(zmq.PULL)
bindaddress_pull = "tcp://%s:%d" % (config['broker_ip'],
                               config['broker_control_port'])
zrecv.bind(bindaddress_pull)
logger.info("Attempting to bind to %s for pulling" % bindaddress_pull)

# Start ZeroMQ listener for workers
context2 = zmq.Context()
zsend = context2.socket(zmq.PUSH)
bindaddress_push = "tcp://%s:%d" % (config['broker_ip'],
Esempio n. 10
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Open External Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('bridge.bridge', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(
        host=config['redis_host'], port=config['redis_port'],
        db=config['redis_db'], password=config['redis_password'])
    logger.info("Connecting to redis")
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# RethinkDB Server
Esempio n. 11
0
if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()

# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('monitors.control', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(host=config['redis_host'],
                           port=config['redis_port'],
                           db=config['redis_db'],
                           password=config['redis_password'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# Start ZeroMQ listener
context = zmq.Context()
Esempio n. 12
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('cram.control', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(
        host=config['redis_host'], port=config['redis_port'],
        db=config['redis_db'], password=config['redis_password'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# Start ZeroMQ listener
context = zmq.Context()
zsend = context.socket(zmq.PUSH)
Esempio n. 13
0
if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()

# Open External Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('crbridge.actioner', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(host=config['redis_host'],
                           port=config['redis_port'],
                           db=config['redis_db'],
                           password=config['redis_password'])
    logger.info("Connected to Redis on port %s" % config['redis_port'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# RethinkDB Server
Esempio n. 14
0
if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()

# Open External Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('bridge.bridge', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(host=config['redis_host'],
                           port=config['redis_port'],
                           db=config['redis_db'],
                           password=config['redis_password'])
    logger.info("Connecting to redis")
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# RethinkDB Server
Esempio n. 15
0
if len(sys.argv) != 2:
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()

# Make Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('cram.broker', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Start ZeroMQ listener for control
context = zmq.Context()
zrecv = context.socket(zmq.PULL)
bindaddress_pull = "tcp://%s:%d" % (config['broker_ip'],
                                    config['broker_control_port'])
zrecv.bind(bindaddress_pull)
logger.info("Attempting to bind to %s for pulling" % bindaddress_pull)

# Start ZeroMQ listener for workers
context2 = zmq.Context()
zsend = context2.socket(zmq.PUSH)
bindaddress_push = "tcp://%s:%d" % (config['broker_ip'],
Esempio n. 16
0
    print("Hey, thats not how you launch this...")
    print("%s <config file>") % sys.argv[0]
    sys.exit(1)

# Open Config File and Parse Config Data
configfile = sys.argv[1]
cfh = open(configfile, "r")
config = yaml.safe_load(cfh)
cfh.close()


# Open External Connections
# ------------------------------------------------------------------

# Init logger
logger = logconfig.getLogger('crbridge.actioner', config['use_syslog'])

logger.info("Using config %s" % configfile)

# Redis Server
try:
    r_server = redis.Redis(
        host=config['redis_host'], port=config['redis_port'],
        db=config['redis_db'], password=config['redis_password'])
    logger.info("Connected to Redis on port %s" % config['redis_port'])
except:
    logger.error("Cannot connect to redis, shutting down")
    sys.exit(1)

# RethinkDB Server
try: