diff --git a/metricq_source_snmp/main.py b/metricq_source_snmp/main.py index 9a5c35e..d5383d4 100644 --- a/metricq_source_snmp/main.py +++ b/metricq_source_snmp/main.py @@ -18,6 +18,7 @@ import click_log # type: ignore import metricq from metricq.logging import get_logger +from metricq.cli import metricq_command from pysnmp.hlapi.asyncio import CommunityData # type: ignore from pysnmp.hlapi.asyncio import ( ContextData, @@ -362,10 +363,7 @@ def on_signal(self, signal: str) -> None: super().on_signal(signal) -@click.command() -@click.option("--server", default="amqp://localhost/") -@click.option("--token", default="source-py-snmp") -@click_log.simple_verbosity_option(logger) # type: ignore +@metricq_command(default_token="snmp-source") def run(server: str, token: str) -> None: src = SnmpSource(token=token, management_url=server) src.run() diff --git a/setup.py b/setup.py index f7b8ca7..08a4233 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ "aiomonitor", "click", "click_log", - "metricq ~= 5.3", + "metricq[cli] ~= 5.4", "pysnmp-lextudio", "uvloop", ],