diff --git a/brian_polling_manager/configuration.py b/brian_polling_manager/configuration.py index 0d67e471e7724806650a7e3050a07677280e8551..699633a04bf94e468488f8eeaea150b47a8a44e6 100644 --- a/brian_polling_manager/configuration.py +++ b/brian_polling_manager/configuration.py @@ -29,7 +29,7 @@ _DEFAULT_CONFIG = { 'interface-check': { 'script': '/home/brian_checks/venv/get-interface-stats', 'config': '/var/lib/sensu/conf/get-interface-stats.config.json', - 'command': '{script} --config {config} --juniper {hostname} --all', + 'command': '{script} --config {config} {args}', }, 'gws-direct-interface-check': { 'script': '/var/lib/sensu/bin/poll-gws-direct.sh', diff --git a/brian_polling_manager/interfaces.py b/brian_polling_manager/interfaces.py index 0c64f0b002d7894a7f76cb45aebbe1d723b8bdc4..a665d641911f37bbe7e775d2bdfb0212850b89c9 100644 --- a/brian_polling_manager/interfaces.py +++ b/brian_polling_manager/interfaces.py @@ -53,6 +53,7 @@ class NetconfRouterCheck(sensu.AbstractCheck): hostname=self.router, config=self.ifc_check_params["config"], script=self.ifc_check_params["script"], + args=f'--juniper {self.router} --all' ) @sensu.AbstractCheck.proxy_entity_name.getter diff --git a/test/conftest.py b/test/conftest.py index 2e4782183b488debfb8b33429a68a3cc1ed51bdb..f70af73fa6b8debce59ef3a3e1527a7ae4965b10 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -42,7 +42,7 @@ def config(): "interface-check": { "script": "/home/brian_checks/venv/get-interface-stats", "config": "/var/lib/sensu/conf/get-interface-stats.config.json", - "command": "{script} --config {config} --juniper {hostname}", + "command": "{script} --config {config} {args}", }, "gws-direct-interface-check": { "script": "/var/lib/sensu/bin/poll-gws-direct.sh", diff --git a/test/test_sensu_checks.py b/test/test_sensu_checks.py index 24e6695ac6ea571a4aeb1b413daebb8b9b079851..31e0998c46033005c141e5ffd577dd2f906ae774 100644 --- a/test/test_sensu_checks.py +++ b/test/test_sensu_checks.py @@ -44,7 +44,8 @@ def test_router_check(config): ).to_dict() assert check["command"] == ( "/home/brian_checks/venv/get-interface-stats " - "--config /var/lib/sensu/conf/get-interface-stats.config.json --juniper xyz" + "--config /var/lib/sensu/conf/get-interface-stats.config.json " + "--juniper xyz --all" ) assert check["proxy_entity_name"] == "xyz" assert check["metadata"]["name"] == "rtr-xyz"