from flask import Flask from alerta.common import config from alerta.common import log as logging Version = "2.1.0" LOG = logging.getLogger(__name__) CONF = config.CONF config.parse_args(version=Version) logging.setup("alerta") app = Flask(__name__) app.config.from_object(__name__) import views
from flask import Flask from alerta.common import config from alerta.common import log as logging from alerta.common.amqp import Messaging from alerta.app.database import Mongo __version__ = '3.0.3' LOG = logging.getLogger(__name__) CONF = config.CONF config.parse_args(version=__version__) logging.setup('alerta') app = Flask(__name__) app.config.from_object(__name__) db = Mongo() mq = Messaging() import views import management.views
import sys from flask import Flask from alerta.common import config from alerta.common import log as logging from alerta.common.mq import Messaging from alerta.server.database import Mongo Version = '2.1.0' LOG = logging.getLogger(__name__) CONF = config.CONF config.parse_args(version=Version) logging.setup('alerta') app = Flask(__name__) app.config.from_object(__name__) db = Mongo() mq = Messaging() mq.connect() import views import management.views
def __init__(self): config.register_opts(Messaging.mq_opts) logging.setup('stomp.py')
def __init__(self): logging.setup('stomp.py')
import os import sys from logging import getLogger, basicConfig # If ../nova/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir)) if os.path.exists(os.path.join(possible_topdir, 'alerta', '__init__.py')): sys.path.insert(0, possible_topdir) from alerta.common import log as logging from alerta.common import config from alerta.common.daemon import Daemon __program__ = 'test-daemon' if __name__ == '__main__': config.parse_args(sys.argv, version='1.1') logging.setup('alert-syslog') LOG = logging.getLogger('alert-syslog') daemon = Daemon(__program__, pidfile='/tmp/pidfile') daemon.start() daemon.stop()
def main(): config.parse_args(version=__version__) logging.setup('alerta') pinger = PingerDaemon('alert-pinger') pinger.start()