diff --git a/conf/checker.conf b/conf/checker.conf index 2d1c620..6e30963 100644 --- a/conf/checker.conf +++ b/conf/checker.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 diff --git a/py-i2phosts-checker b/py-i2phosts-checker index 434c72c..dc98c5d 100755 --- a/py-i2phosts-checker +++ b/py-i2phosts-checker @@ -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)