From c4a77efb421722e07b16e3b4f854cb8a483416a1 Mon Sep 17 00:00:00 2001 From: Einar Lanfranco Date: Sat, 26 Nov 2022 13:05:15 -0300 Subject: [PATCH] Update example_bots noop collector --- .../bots/collectors/noop/collector.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 example_bots/bots/collectors/noop/collector.py diff --git a/example_bots/bots/collectors/noop/collector.py b/example_bots/bots/collectors/noop/collector.py new file mode 100644 index 0000000..2aa6a35 --- /dev/null +++ b/example_bots/bots/collectors/noop/collector.py @@ -0,0 +1,33 @@ +""" +SPDX-FileCopyrightText: 2022 Einar Lanfranco +SPDX-License-Identifier: AGPL-3.0-or-later + +Example Collector Bot for Demo purpose only. + +Document possible necessary configurations. +""" +import sys +import time +# imports for additional libraries and intelmq +from intelmq.lib.bot import CollectorBot + + +class NoOpCollectorBot(CollectorBot): + """Este bot no hace nada util""" + paso: str = "step" + cantidad: int = 5 + rate_limit: int = 3600 + + def process(self): + self.logger.info("Comenzando NOOP Collector") + time.sleep(self.cantidad) + for i in range(self.cantidad): + time.sleep(i) + self.logger.info(f'{self.paso}{i}') + report = self.new_report() + report.add("raw","bGEgbmFkYSBtaXNtYQ==") + report.add("feed.url", "http://noop.url") + self.send_message(report) + + +BOT = NoOpCollectorBot \ No newline at end of file