Skip to content

Commit

Permalink
Merge pull request #75 from vrdel/devel
Browse files Browse the repository at this point in the history
 ARGO-2929 Let systemd handle runtime directory
  • Loading branch information
vrdel authored Jan 29, 2021
2 parents e3c6e82 + ef2385e commit 9ed148d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pymod/alarmtoqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import pytz
import sys

conf = '/etc/argo-nagios-ams-publisher/ams-publisher.conf'
logfile = '/var/log/argo-nagios-ams-publisher/ams-publisher.log'

CONF = '/etc/argo-nagios-ams-publisher/ams-publisher.conf'


def seteuser(user):
Expand Down Expand Up @@ -46,7 +46,7 @@ def build_msg(args, *headers):

def main():
parser = argparse.ArgumentParser()
lobj = log.Logger(sys.argv[0], logfile)
lobj = log.Logger(sys.argv[0])
logger = lobj.get()
confopts = config.parse_config(logger)
nagioshost = confopts['general']['host']
Expand Down
5 changes: 2 additions & 3 deletions pymod/metrictoqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import datetime
import pytz

conf = '/etc/argo-nagios-ams-publisher/ams-publisher.conf'
logfile = '/var/log/argo-nagios-ams-publisher/ams-publisher.log'
CONF = '/etc/argo-nagios-ams-publisher/ams-publisher.conf'


def seteuser(user):
Expand Down Expand Up @@ -47,7 +46,7 @@ def build_msg(args, *headers):

def main():
parser = argparse.ArgumentParser()
lobj = log.Logger(sys.argv[0], logfile)
lobj = log.Logger(sys.argv[0])
logger = lobj.get()
confopts = config.parse_config(logger)
nagioshost = confopts['general']['host']
Expand Down
7 changes: 4 additions & 3 deletions pymod/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def init_dirq_consume(workers, daemonized, sockstat):
consumers[-1].daemon = False
consumers[-1].start()

shared = Shared()
workers_name = ', '.join(consumer.name for consumer in consumers)
shared.log.info('Started {} workers'.format(workers_name))

if worker:
localevents.update({'lck-stats': Lock()})
localevents.update({'usr1-stats': Event()})
Expand All @@ -93,9 +97,6 @@ def init_dirq_consume(workers, daemonized, sockstat):
statsp.start()

prevstattime = int(time.time())
shared = Shared()
workers_name = ', '.join(consumer.name for consumer in consumers)
shared.log.info('Started {} workers'.format(workers_name))
while True:
if int(time.time()) - prevstattime >= shared.general['statseveryhour'] * 3600:
shared.log.info('Periodic report (every %sh)' % shared.general['statseveryhour'])
Expand Down

0 comments on commit 9ed148d

Please sign in to comment.