2012-03-27 14:27:40 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
########################################
|
|
|
|
#
|
2013-04-25 13:32:32 +00:00
|
|
|
# alert-ganglia - Alert Ganglia
|
2012-03-27 14:27:40 +00:00
|
|
|
#
|
|
|
|
########################################
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2013-03-02 17:49:06 +00:00
|
|
|
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)
|
2012-03-27 14:27:40 +00:00
|
|
|
|
2013-03-02 17:49:06 +00:00
|
|
|
from alerta.common import config
|
|
|
|
from alerta.common import log as logging
|
2013-03-03 10:48:32 +00:00
|
|
|
from alerta.ganglia.daemon import GangliaDaemon, Version
|
2012-03-27 14:27:40 +00:00
|
|
|
|
2013-03-02 17:49:06 +00:00
|
|
|
LOG = logging.getLogger('alerta.ganglia')
|
|
|
|
CONF = config.CONF
|
2012-03-27 14:27:40 +00:00
|
|
|
|
2013-03-02 17:49:06 +00:00
|
|
|
if __name__ == '__main__':
|
2013-03-03 10:48:32 +00:00
|
|
|
config.parse_args(sys.argv[1:], version=Version)
|
2013-03-02 17:49:06 +00:00
|
|
|
logging.setup('alerta')
|
2013-04-25 13:32:32 +00:00
|
|
|
ganglia = GangliaDaemon('alert-ganglia')
|
2013-03-02 17:49:06 +00:00
|
|
|
ganglia.start()
|
2012-03-27 14:27:40 +00:00
|
|
|
|