1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-22 04:24:15 +00:00

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

This commit is contained in:
Hidden Z 2010-10-30 18:46:35 +00:00
parent 1acd9f8e78
commit 610245adcf
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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)