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:
parent
1acd9f8e78
commit
610245adcf
@ -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
|
||||
|
@ -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…
x
Reference in New Issue
Block a user