Browse Source

py-i2phosts-checker: add config option for SAM address

pull/1/head
Hidden Z 14 years ago
parent
commit
610245adcf
  1. 2
      conf/checker.conf
  2. 9
      py-i2phosts-checker

2
conf/checker.conf

@ -2,3 +2,5 @@ include = /etc/py-i2phosts/common.conf @@ -2,3 +2,5 @@ include = /etc/py-i2phosts/common.conf
log_level = info # debug, info, warning, error, critical
log_file = /var/log/py-i2phosts/checker.log
sam_addr = 127.0.0.1:7656

9
py-i2phosts-checker

@ -50,7 +50,14 @@ log = get_logger(log_level=log_level) @@ -50,7 +50,14 @@ log = get_logger(log_level=log_level)
all_hosts = i2phost.objects.all()
S = samclasses.BaseSession('127.0.0.1:7656')
# determine SAM interface address
if sam_addr in config:
sam_addr = config['sam_addr']
else:
log.warning('SAM address isn\'t specified in config, falling back to localhost')
sam_addr = '127.0.0.1:7656'
S = samclasses.BaseSession(sam_addr)
log.info('starting check')
for host in all_hosts:
log.debug('testing %s', host.name)

Loading…
Cancel
Save