MKP1.1.2, Fix for Solr size thresholds

This commit is contained in:
Ralf Mellis 2023-09-10 16:49:05 +02:00
parent 43b69c2e81
commit d55380d647
3 changed files with 8 additions and 10 deletions

View File

@ -33,9 +33,9 @@ def check_mailcow_info(params, section):
levels_num_mailboxes = params["levels_num_mailboxes"]
levels_num_global_messages = params["levels_num_global_messages"]
levels_solr_size_kb = params["levels_solr_size"]
# Levels for Solr size are given in KBytes, so convert it to bytes
levels_solr_size_warn = levels_solr_size_kb[0] * 1024
levels_solr_size_crit = levels_solr_size_kb[1] * 1024
# Levels for Solr size are given in MBytes, so convert it to bytes
levels_solr_size_warn = levels_solr_size_kb[0] * 1024 * 1024
levels_solr_size_crit = levels_solr_size_kb[1] * 1024 * 1024
levels_solr_size = (levels_solr_size_warn, levels_solr_size_crit)
levels_solr_documents = params["levels_solr_documents"]
@ -86,8 +86,6 @@ def check_mailcow_info(params, section):
# Create result for solr size and solr number of documents
if solr_enabled:
warn, crit = levels_solr_size
# levels are given in KB, so convert the size given Bytes
solr_size = solr_size / 1024
state = getStateUpper((warn, crit), solr_size)
notice = f"Solr size: {render.bytes(solr_size)}"
if state != State.OK:
@ -153,7 +151,7 @@ register.check_plugin(
"levels_num_mailboxes": (500, 1000),
"levels_num_global_messages": (100000, 250000),
"levels_solr_size": (4096.0, 8192.0),
"levels_solr_documents": (2000, 4000)
"levels_solr_documents": (20000, 40000)
},
check_ruleset_name="mailcow_info",
)

View File

@ -62,12 +62,12 @@ def _parameter_spec_mailcow_info():
Float(
title=_("Warning at"),
default_value=4096.0,
unit="KBytes",
unit="MBytes",
),
Float(
title=_("Critical at"),
default_value=8192.0,
unit="KBytes",
unit="MBytes",
)
],
)),
@ -76,11 +76,11 @@ def _parameter_spec_mailcow_info():
elements=[
Integer(
title=_("Warning at"),
default_value=2000,
default_value=20000,
),
Integer(
title=_("Critical at"),
default_value=4000,
default_value=40000,
)
],
)),

BIN
mkp/Mailcow-1.1.2.mkp Executable file

Binary file not shown.