0
0
Fork 0
mirror of https://github.com/alerta/alerta.git synced 2025-01-29 03:11:34 +00:00
alerta_alerta/bin/alert-pinger
2013-10-20 13:00:29 +01:00

28 lines
825 B
Python
Executable file

#!/usr/bin/env python
########################################
#
# alert-pinger - Alert Ping script
#
########################################
import os
import sys
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 config
from alerta.common import log as logging
from alerta.pinger.daemon import PingerDaemon, Version
LOG = logging.getLogger('alerta.pinger')
CONF = config.CONF
if __name__ == '__main__':
config.parse_args(version=Version)
logging.setup('alerta')
pinger = PingerDaemon('alert-pinger')
pinger.start()