diff --git a/brian_polling_manager/interfaces.py b/brian_polling_manager/interfaces.py index 3d2d47dc06a5766405b97c4c2cde9792918c4298..ab6a15e2f8f03984d7c0c4c58a2f0fc8c8c3eb3a 100644 --- a/brian_polling_manager/interfaces.py +++ b/brian_polling_manager/interfaces.py @@ -33,7 +33,9 @@ class InterfaceCheck(sensu.AbstractCheck): return self.ifc_check_params['command'].format( script=self.ifc_check_params['script'], measurement=self.ifc_check_params['measurement'], - community='0pBiFbD', # TODO: add this to /poller/interfaces response + # TODO: add community string to /poller/interfaces response + # (cf. POL1-339) + community='0pBiFbD', hostname=self.interface['router'], interface=self.interface['name'], ifIndex=self.interface['snmp-index']) diff --git a/test/conftest.py b/test/conftest.py index da76a08afe7ed2c9685d3427cf5f2203a122d5e2..fc4dd7766d6622b9d1154397113b1517fd22ca1e 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -43,7 +43,8 @@ def config(): 'gws-direct-interface-check': { 'script': '/var/lib/sensu/bin/poll-gws-direct.sh', 'measurement': 'gwsd_counters', - 'command': '{script} {measurement} {nren} {isp} {hostname} {tag}' + 'command': ('{script} {measurement} ' + '{nren} {isp} {hostname} {tag}') } }, 'statedir': state_dir_name, diff --git a/test/test_sensu_checks.py b/test/test_sensu_checks.py index 50e500bc567daecc67031a29e8dcb23046dc2a64..b72dd0578a020747bf5a648f1933a5c2a5cf6148 100644 --- a/test/test_sensu_checks.py +++ b/test/test_sensu_checks.py @@ -120,4 +120,3 @@ def test_checks_differ(): b = DummyCheck(name='x', command='x', proxy_entity_name='x') a.namespace = a.namespace + 'x' assert not sensu.checks_match(a.to_dict(), b.to_dict()) -