From 610245adcfe98ad7098e499e85c52d21f622caae Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Sat, 30 Oct 2010 18:46:35 +0000 Subject: [PATCH] py-i2phosts-checker: add config option for SAM address --- conf/checker.conf | 2 ++ py-i2phosts-checker | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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)