Пример #1
0
def run():

    config.read()
    config.LOG_DIRECTORY = "stdout"
    log.startLogging(sys.stdout)

    db = Db()
    db.startService().addCallback(convert)

    reactor.run()
Пример #2
0
def run():

    config.read()
    logs.checker_master()

    top_service = TopService()

    db = Db()
    datalib.db = db
    db.setServiceParent(top_service)

    sub_service = MasterService(db)
    sub_service.setServiceParent(top_service)

    top_service.startService()

    reactor.addSystemEventTrigger('before', 'shutdown', top_service.stopService)

    reactor.run()
Пример #3
0
def run():

    config.read()
    logs.api()

    top_service = service.MultiService()

    db = Db()
    datalib.db = db
    db.setServiceParent(top_service)

    http_service = internet.TCPServer(config.HTTP_PORT, Site(db), interface=config.HTTP_ADDR)
    http_service.setServiceParent(top_service)

    top_service.startService()

    reactor.addSystemEventTrigger('before', 'shutdown', top_service.stopService)

    reactor.run()
Пример #4
0
def run():

    config.read()
    logs.checker_master()

    top_service = TopService()

    db = Db()
    datalib.db = db
    db.setServiceParent(top_service)

    sub_service = MasterService(db)
    sub_service.setServiceParent(top_service)

    top_service.startService()

    reactor.addSystemEventTrigger('before', 'shutdown',
                                  top_service.stopService)

    reactor.run()
Пример #5
0
def run():

    config.read()
    logs.api()

    top_service = service.MultiService()

    db = Db()
    datalib.db = db
    db.setServiceParent(top_service)

    http_service = internet.TCPServer(config.HTTP_PORT,
                                      Site(db),
                                      interface=config.HTTP_ADDR)
    http_service.setServiceParent(top_service)

    top_service.startService()

    reactor.addSystemEventTrigger('before', 'shutdown',
                                  top_service.stopService)

    reactor.run()
Пример #6
0
                ("checker.triggers.%s.%s" % (config.HOSTNAME, number),
                 spy.TRIGGER_CHECK.get_metrics()["count"]),
                ("checker.errors.%s.%s" % (config.HOSTNAME, number),
                 spy.TRIGGER_CHECK_ERRORS.get_metrics()["count"])]

    graphite.sending(get_metrics)

    def start(db):
        checker = TriggersCheck(db)
        checker.start()
        reactor.addSystemEventTrigger('before', 'shutdown', checker.stop)

    run(start)


def check(trigger_id):
    @defer.inlineCallbacks
    def start(db):
        trigger = Trigger(trigger_id, db)
        yield trigger.check()
        reactor.stop()

    run(start)


if __name__ == '__main__':

    config.read()
    logs.checker_worker()
    main(config.ARGS.n)
Пример #7
0
             (config.HOSTNAME,
              number),
                spy.TRIGGER_CHECK_ERRORS.get_metrics()["count"])]

    graphite.sending(get_metrics)

    def start(db):
        checker = TriggersCheck(db)
        checker.start()
        reactor.addSystemEventTrigger('before', 'shutdown', checker.stop)

    run(start)


def check(trigger_id):

    @defer.inlineCallbacks
    def start(db):
        trigger = Trigger(trigger_id, db)
        yield trigger.check()
        reactor.stop()

    run(start)


if __name__ == '__main__':

    config.read()
    logs.checker_worker()
    main(config.ARGS.n)