From 27bab031c3f5441d10f3f61e251378b769b966cc Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Fri, 28 Jul 2023 12:02:34 +0200 Subject: [PATCH] Added add_monitoring_data function --- .../extras/pandoraPlugintools/discovery.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pandora_server/extras/pandoraPlugintools/discovery.py b/pandora_server/extras/pandoraPlugintools/discovery.py index 7e8e254033..589c07bf42 100644 --- a/pandora_server/extras/pandoraPlugintools/discovery.py +++ b/pandora_server/extras/pandoraPlugintools/discovery.py @@ -100,6 +100,19 @@ def set_info_value( info = data +#### +# Set fixed value to info +######################################################################################### +def add_monitoring_data( + data: dict = {} + ): + """ + TODO: Add comments + """ + global monitoring_data + + monitoring_data.append(data) + #### # Print JSON output and exit script ######################################################################################### @@ -116,6 +129,7 @@ def print_output(): global error_level global summary global info + global monitoring_data output={} if summary: @@ -123,6 +137,9 @@ def print_output(): if info: output["info"] = info + + if monitoring_data: + output["monitoring_data"] = monitoring_data json_string = json.dumps(output)