mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Added add_monitoring_data function
This commit is contained in:
parent
df36ea608a
commit
27bab031c3
@ -100,6 +100,19 @@ def set_info_value(
|
|||||||
|
|
||||||
info = data
|
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
|
# Print JSON output and exit script
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
@ -116,6 +129,7 @@ def print_output():
|
|||||||
global error_level
|
global error_level
|
||||||
global summary
|
global summary
|
||||||
global info
|
global info
|
||||||
|
global monitoring_data
|
||||||
|
|
||||||
output={}
|
output={}
|
||||||
if summary:
|
if summary:
|
||||||
@ -123,6 +137,9 @@ def print_output():
|
|||||||
|
|
||||||
if info:
|
if info:
|
||||||
output["info"] = info
|
output["info"] = info
|
||||||
|
|
||||||
|
if monitoring_data:
|
||||||
|
output["monitoring_data"] = monitoring_data
|
||||||
|
|
||||||
json_string = json.dumps(output)
|
json_string = json.dumps(output)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user