removed all Solr modules
This commit is contained in:
parent
3ae427459a
commit
358f84307c
@ -32,13 +32,6 @@ def check_mailcow_info(params, section):
|
|||||||
levels_num_domains = params["levels_num_domains"]
|
levels_num_domains = params["levels_num_domains"]
|
||||||
levels_num_mailboxes = params["levels_num_mailboxes"]
|
levels_num_mailboxes = params["levels_num_mailboxes"]
|
||||||
levels_num_global_messages = params["levels_num_global_messages"]
|
levels_num_global_messages = params["levels_num_global_messages"]
|
||||||
levels_solr_size_kb = params["levels_solr_size"]
|
|
||||||
# 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"]
|
|
||||||
|
|
||||||
version = section[key]["version"]
|
version = section[key]["version"]
|
||||||
git_version = section[key]["git_version"]
|
git_version = section[key]["git_version"]
|
||||||
check_version_enabled = section[key]["check_version_enabled"]
|
check_version_enabled = section[key]["check_version_enabled"]
|
||||||
@ -46,19 +39,19 @@ def check_mailcow_info(params, section):
|
|||||||
num_domains = section[key]["num_domains"]
|
num_domains = section[key]["num_domains"]
|
||||||
num_mailboxes = section[key]["num_mailboxes"]
|
num_mailboxes = section[key]["num_mailboxes"]
|
||||||
num_global_messages = section[key]["num_global_messages"]
|
num_global_messages = section[key]["num_global_messages"]
|
||||||
solr_enabled = section[key]["solr_enabled"]
|
|
||||||
solr_size = section[key]["solr_size"]
|
|
||||||
solr_documents = section[key]["solr_documents"]
|
|
||||||
|
|
||||||
# create graphs for number of domains, mailboxes and messages
|
# create graphs for number of domains, mailboxes and messages
|
||||||
yield (Metric("mc_num_domains", num_domains, levels=levels_num_domains))
|
yield (Metric("mc_num_domains", num_domains, levels=levels_num_domains))
|
||||||
yield(Metric("mc_num_mailboxes", num_mailboxes, levels=levels_num_mailboxes))
|
yield (
|
||||||
yield(Metric("mc_num_global_messages", num_global_messages, levels=levels_num_global_messages))
|
Metric("mc_num_mailboxes", num_mailboxes, levels=levels_num_mailboxes)
|
||||||
|
)
|
||||||
# create graphs for solr size and number of solr documents
|
yield (
|
||||||
if solr_enabled:
|
Metric(
|
||||||
yield(Metric("mc_solr_size", solr_size, levels=levels_solr_size))
|
"mc_num_global_messages",
|
||||||
yield(Metric("mc_solr_documents", solr_documents, levels=levels_solr_documents))
|
num_global_messages,
|
||||||
|
levels=levels_num_global_messages,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# create overall result
|
# create overall result
|
||||||
if check_version_enabled:
|
if check_version_enabled:
|
||||||
@ -71,7 +64,7 @@ def check_mailcow_info(params, section):
|
|||||||
else:
|
else:
|
||||||
summary = f"Version is {version}, Update check is disabled"
|
summary = f"Version is {version}, Update check is disabled"
|
||||||
state = State.OK
|
state = State.OK
|
||||||
details = f"Mailcow version: {version}\nNumber of domains: {num_domains}\nNumber of mailboxes: {num_mailboxes}\nNumber of messages: {num_global_messages}\n\nSolr size: {render.bytes(solr_size)}\nNumber of Solr documents: {solr_documents}"
|
details = f"Mailcow version: {version}\nNumber of domains: {num_domains}\nNumber of mailboxes: {num_mailboxes}\nNumber of messages: {num_global_messages}"
|
||||||
yield Result(state=state, summary=summary, details=details)
|
yield Result(state=state, summary=summary, details=details)
|
||||||
|
|
||||||
# Create result for number of domains
|
# Create result for number of domains
|
||||||
@ -95,24 +88,6 @@ def check_mailcow_info(params, section):
|
|||||||
if state != State.OK:
|
if state != State.OK:
|
||||||
yield (Result(state=state, notice=notice))
|
yield (Result(state=state, notice=notice))
|
||||||
|
|
||||||
# Create result for solr size and solr number of documents
|
|
||||||
if solr_enabled:
|
|
||||||
warn, crit = levels_solr_size
|
|
||||||
state = getStateUpper((warn, crit), solr_size)
|
|
||||||
notice = f"Solr size: {render.bytes(solr_size)}"
|
|
||||||
if state != State.OK:
|
|
||||||
yield(Result(state=state, notice=notice))
|
|
||||||
|
|
||||||
warn, crit = levels_solr_documents
|
|
||||||
state = getStateUpper((warn, crit), solr_documents)
|
|
||||||
notice = f"Number of Solr documents: {solr_documents}"
|
|
||||||
if state != State.OK:
|
|
||||||
yield(Result(state=state, notice=notice))
|
|
||||||
else:
|
|
||||||
state = State.WARN
|
|
||||||
notice = f"Solr is disabled"
|
|
||||||
yield(Result(state=state, notice=notice))
|
|
||||||
|
|
||||||
|
|
||||||
def parse_mailcow_info_section(string_table):
|
def parse_mailcow_info_section(string_table):
|
||||||
# pprint(string_table)
|
# pprint(string_table)
|
||||||
@ -125,26 +100,13 @@ def parse_mailcow_info_section(string_table):
|
|||||||
num_domains = int(line[1])
|
num_domains = int(line[1])
|
||||||
num_mailboxes = int(line[2])
|
num_mailboxes = int(line[2])
|
||||||
num_global_messages = int(line[3])
|
num_global_messages = int(line[3])
|
||||||
solr_enabled = bool(line[4])
|
git_version = line[4]
|
||||||
# solr size comes with value and unit, unfortunately
|
update_available = line[5]
|
||||||
solr_size_str = line[5]
|
|
||||||
solr_size_list = solr_size_str.split()
|
|
||||||
solr_size_unit = solr_size_list[1]
|
|
||||||
solr_size = float(solr_size_list[0])
|
|
||||||
if solr_size_unit == "KB":
|
|
||||||
solr_size = solr_size * 1024.0
|
|
||||||
elif solr_size_unit == "MB":
|
|
||||||
solr_size = solr_size * 1024.0 * 1024.0
|
|
||||||
elif solr_size_unit == "GB":
|
|
||||||
solr_size = solr_size * 1024.0 * 1024.0 * 1024.0
|
|
||||||
solr_documents = int(line[6])
|
|
||||||
git_version = line[7]
|
|
||||||
update_available = line[8]
|
|
||||||
if update_available == "True":
|
if update_available == "True":
|
||||||
update_available = True
|
update_available = True
|
||||||
else:
|
else:
|
||||||
update_available = False
|
update_available = False
|
||||||
check_version_enabled = line[9]
|
check_version_enabled = line[6]
|
||||||
if check_version_enabled == "True":
|
if check_version_enabled == "True":
|
||||||
check_version_enabled = True
|
check_version_enabled = True
|
||||||
else:
|
else:
|
||||||
@ -153,9 +115,6 @@ def parse_mailcow_info_section(string_table):
|
|||||||
parsed_data["mailcow"]["num_domains"] = num_domains
|
parsed_data["mailcow"]["num_domains"] = num_domains
|
||||||
parsed_data["mailcow"]["num_mailboxes"] = num_mailboxes
|
parsed_data["mailcow"]["num_mailboxes"] = num_mailboxes
|
||||||
parsed_data["mailcow"]["num_global_messages"] = num_global_messages
|
parsed_data["mailcow"]["num_global_messages"] = num_global_messages
|
||||||
parsed_data["mailcow"]["solr_enabled"] = solr_enabled
|
|
||||||
parsed_data["mailcow"]["solr_size"] = solr_size
|
|
||||||
parsed_data["mailcow"]["solr_documents"] = solr_documents
|
|
||||||
parsed_data["mailcow"]["git_version"] = git_version
|
parsed_data["mailcow"]["git_version"] = git_version
|
||||||
parsed_data["mailcow"]["update_available"] = update_available
|
parsed_data["mailcow"]["update_available"] = update_available
|
||||||
parsed_data["mailcow"]["check_version_enabled"] = check_version_enabled
|
parsed_data["mailcow"]["check_version_enabled"] = check_version_enabled
|
||||||
@ -178,8 +137,6 @@ register.check_plugin(
|
|||||||
"levels_num_domains": (100, 200),
|
"levels_num_domains": (100, 200),
|
||||||
"levels_num_mailboxes": (500, 1000),
|
"levels_num_mailboxes": (500, 1000),
|
||||||
"levels_num_global_messages": (100000, 250000),
|
"levels_num_global_messages": (100000, 250000),
|
||||||
"levels_solr_size": (4096.0, 8192.0),
|
|
||||||
"levels_solr_documents": (20000, 40000)
|
|
||||||
},
|
},
|
||||||
check_ruleset_name="mailcow_info",
|
check_ruleset_name="mailcow_info",
|
||||||
)
|
)
|
@ -11,11 +11,15 @@ from pprint import pprint
|
|||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
from time import (
|
from time import (
|
||||||
time, localtime, strftime,
|
time,
|
||||||
|
localtime,
|
||||||
|
strftime,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def showUsage() -> None:
|
def showUsage() -> None:
|
||||||
sys.stderr.write("""CheckMK Mailcow Special Agent
|
sys.stderr.write(
|
||||||
|
"""CheckMK Mailcow Special Agent
|
||||||
|
|
||||||
USAGE: agent_nextcloud -H [hostname] -k [apikey]
|
USAGE: agent_nextcloud -H [hostname] -k [apikey]
|
||||||
agent_nextcloud -h
|
agent_nextcloud -h
|
||||||
@ -28,7 +32,9 @@ OPTIONS:
|
|||||||
--no-https True|False If "True": Disable HTTPS, use HTTP (not recommended!)
|
--no-https True|False If "True": Disable HTTPS, use HTTP (not recommended!)
|
||||||
--no-cert-check True|False If "True": Disable TLS certificate check (not recommended!)
|
--no-cert-check True|False If "True": Disable TLS certificate check (not recommended!)
|
||||||
-h, --help Show this help message and exit
|
-h, --help Show this help message and exit
|
||||||
""")
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# set this to True to produce debug output (this clutters the agent output)
|
# set this to True to produce debug output (this clutters the agent output)
|
||||||
# be aware: activating this logs very sensitive information to debug files in ~/tmp
|
# be aware: activating this logs very sensitive information to debug files in ~/tmp
|
||||||
@ -45,9 +51,15 @@ opt_check_version = False
|
|||||||
opt_no_https = False
|
opt_no_https = False
|
||||||
opt_no_cert_check = False
|
opt_no_cert_check = False
|
||||||
|
|
||||||
short_options = 'hH:k:P:'
|
short_options = "hH:k:P:"
|
||||||
long_options = [
|
long_options = [
|
||||||
'hostname=', 'apikey=', 'port=', 'check-version=', 'no-https=', 'no-cert-check=', 'help'
|
"hostname=",
|
||||||
|
"apikey=",
|
||||||
|
"port=",
|
||||||
|
"check-version=",
|
||||||
|
"no-https=",
|
||||||
|
"no-cert-check=",
|
||||||
|
"help",
|
||||||
]
|
]
|
||||||
|
|
||||||
domain_data = {}
|
domain_data = {}
|
||||||
@ -59,7 +71,7 @@ SEP = "|"
|
|||||||
TIMEFMT = "%Y-%m-%d %H:%M:%S"
|
TIMEFMT = "%Y-%m-%d %H:%M:%S"
|
||||||
FLOATFMT = "{:.4f}"
|
FLOATFMT = "{:.4f}"
|
||||||
|
|
||||||
'''
|
"""
|
||||||
Decorator function for debugging purposes
|
Decorator function for debugging purposes
|
||||||
creates a file with many information regarding the function call, like:
|
creates a file with many information regarding the function call, like:
|
||||||
timestamp
|
timestamp
|
||||||
@ -70,7 +82,9 @@ Decorator function for debugging purposes
|
|||||||
return value of function call
|
return value of function call
|
||||||
type of return value
|
type of return value
|
||||||
all parameters given to function
|
all parameters given to function
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
def debugLog(function):
|
def debugLog(function):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
# execute function and measure runtime
|
# execute function and measure runtime
|
||||||
@ -103,12 +117,15 @@ def debugLog(function):
|
|||||||
with open(debugLogFilename, "a+") as f:
|
with open(debugLogFilename, "a+") as f:
|
||||||
f.write(f"{out1}{out2}{out3}\n")
|
f.write(f"{out1}{out2}{out3}\n")
|
||||||
except:
|
except:
|
||||||
sys.stderr.write(f"Something went wrong when writing to file {debugLogFilename}\n")
|
sys.stderr.write(
|
||||||
|
f"Something went wrong when writing to file {debugLogFilename}\n"
|
||||||
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(f"Debug activated, but no debug filename given.\n")
|
sys.stderr.write(f"Debug activated, but no debug filename given.\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
@ -129,28 +146,28 @@ def getOptions() -> None:
|
|||||||
|
|
||||||
opts, args = getopt.getopt(sys.argv[1:], short_options, long_options)
|
opts, args = getopt.getopt(sys.argv[1:], short_options, long_options)
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if opt in ['-H', '--hostname']:
|
if opt in ["-H", "--hostname"]:
|
||||||
opt_hostname = arg
|
opt_hostname = arg
|
||||||
elif opt in ['-k', '--apikey']:
|
elif opt in ["-k", "--apikey"]:
|
||||||
opt_apikey = arg
|
opt_apikey = arg
|
||||||
elif opt in ['-P', '--port']:
|
elif opt in ["-P", "--port"]:
|
||||||
opt_port = arg
|
opt_port = arg
|
||||||
elif opt in ['--check-version']:
|
elif opt in ["--check-version"]:
|
||||||
if arg == 'True':
|
if arg == "True":
|
||||||
opt_check_version = True
|
opt_check_version = True
|
||||||
else:
|
else:
|
||||||
opt_check_version = False
|
opt_check_version = False
|
||||||
elif opt in ['--no-https']:
|
elif opt in ["--no-https"]:
|
||||||
if arg == 'True':
|
if arg == "True":
|
||||||
opt_no_https = True
|
opt_no_https = True
|
||||||
else:
|
else:
|
||||||
opt_no_https = False
|
opt_no_https = False
|
||||||
elif opt in ['--no-cert-check']:
|
elif opt in ["--no-cert-check"]:
|
||||||
if arg == 'True':
|
if arg == "True":
|
||||||
opt_no_cert_check = True
|
opt_no_cert_check = True
|
||||||
else:
|
else:
|
||||||
opt_no_cert_check = False
|
opt_no_cert_check = False
|
||||||
elif opt in ['-h', '--help']:
|
elif opt in ["-h", "--help"]:
|
||||||
showUsage()
|
showUsage()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
@ -158,7 +175,9 @@ def getOptions() -> None:
|
|||||||
tmp_path = f"{home_path}/tmp"
|
tmp_path = f"{home_path}/tmp"
|
||||||
help_file = f"{tmp_path}/mailcow_{opt_hostname}_debug.txt"
|
help_file = f"{tmp_path}/mailcow_{opt_hostname}_debug.txt"
|
||||||
with open(help_file, "a") as file:
|
with open(help_file, "a") as file:
|
||||||
file.write(f"Number of Arguments: {len(sys.argv)}, Argument List: {str(sys.argv)}\n")
|
file.write(
|
||||||
|
f"Number of Arguments: {len(sys.argv)}, Argument List: {str(sys.argv)}\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# @debugLog
|
# @debugLog
|
||||||
@ -173,13 +192,16 @@ def showOptions() -> None:
|
|||||||
tmp_path = f"{home_path}/tmp"
|
tmp_path = f"{home_path}/tmp"
|
||||||
help_file = f"{tmp_path}/mailcow_{opt_hostname}_debug.txt"
|
help_file = f"{tmp_path}/mailcow_{opt_hostname}_debug.txt"
|
||||||
with open(help_file, "a") as file:
|
with open(help_file, "a") as file:
|
||||||
file.write(f"Hostname: {opt_hostname}, Port: {opt_port}, No HTTPS: {opt_no_https}, No Cert Check: {opt_no_cert_check}\n")
|
file.write(
|
||||||
|
f"Hostname: {opt_hostname}, Port: {opt_port}, No HTTPS: {opt_no_https}, No Cert Check: {opt_no_cert_check}\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# @debugLog
|
# @debugLog
|
||||||
def getDomainInfo(headers: str, verify: bool, base_url: str) -> int:
|
def getDomainInfo(headers: str, verify: bool, base_url: str) -> int:
|
||||||
url = f"{base_url}/domain/all"
|
url = f"{base_url}/domain/all"
|
||||||
response = requests.get(url, headers=headers, verify=verify)
|
response = requests.get(url, headers=headers, verify=verify)
|
||||||
if (response.status_code == 200):
|
if response.status_code == 200:
|
||||||
jsdata = response.text
|
jsdata = response.text
|
||||||
data = json.loads(jsdata) # returns a list of dictionaries
|
data = json.loads(jsdata) # returns a list of dictionaries
|
||||||
i = 0
|
i = 0
|
||||||
@ -214,7 +236,7 @@ def getDomainInfo(headers: str, verify: bool, base_url: str) -> int:
|
|||||||
"aliases_in_domain": aliases_in_domain,
|
"aliases_in_domain": aliases_in_domain,
|
||||||
"msgs_total": msgs_total,
|
"msgs_total": msgs_total,
|
||||||
"bytes_total": bytes_total,
|
"bytes_total": bytes_total,
|
||||||
"max_quota_for_domain": max_quota_for_domain
|
"max_quota_for_domain": max_quota_for_domain,
|
||||||
}
|
}
|
||||||
domain_data[domain_name] = {}
|
domain_data[domain_name] = {}
|
||||||
domain_data[domain_name] = dom
|
domain_data[domain_name] = dom
|
||||||
@ -222,14 +244,17 @@ def getDomainInfo(headers: str, verify: bool, base_url: str) -> int:
|
|||||||
# return number of email domains
|
# return number of email domains
|
||||||
return i
|
return i
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(f"Request response code is {response.status_code} with URL {url}\n")
|
sys.stderr.write(
|
||||||
|
f"Request response code is {response.status_code} with URL {url}\n"
|
||||||
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
# @debugLog
|
# @debugLog
|
||||||
def getMailboxInfo(headers: str, verify: bool, base_url: str) -> tuple:
|
def getMailboxInfo(headers: str, verify: bool, base_url: str) -> tuple:
|
||||||
url = f"{base_url}/mailbox/all"
|
url = f"{base_url}/mailbox/all"
|
||||||
response = requests.get(url, headers=headers, verify=verify)
|
response = requests.get(url, headers=headers, verify=verify)
|
||||||
if (response.status_code == 200):
|
if response.status_code == 200:
|
||||||
jsdata = response.text
|
jsdata = response.text
|
||||||
data = json.loads(jsdata) # returns a list of dictionaries
|
data = json.loads(jsdata) # returns a list of dictionaries
|
||||||
i = 0
|
i = 0
|
||||||
@ -269,7 +294,7 @@ def getMailboxInfo(headers: str, verify: bool, base_url: str) -> tuple:
|
|||||||
"messages": messages,
|
"messages": messages,
|
||||||
"last_imap_login": last_imap_login,
|
"last_imap_login": last_imap_login,
|
||||||
"last_pop3_login": last_pop3_login,
|
"last_pop3_login": last_pop3_login,
|
||||||
"last_smtp_login": last_smtp_login
|
"last_smtp_login": last_smtp_login,
|
||||||
}
|
}
|
||||||
mailbox_data[username] = {}
|
mailbox_data[username] = {}
|
||||||
mailbox_data[username] = mb
|
mailbox_data[username] = mb
|
||||||
@ -278,23 +303,29 @@ def getMailboxInfo(headers: str, verify: bool, base_url: str) -> tuple:
|
|||||||
# return number of mailboxes and global number of messages
|
# return number of mailboxes and global number of messages
|
||||||
return i, global_num_messages
|
return i, global_num_messages
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(f"Request response code is {response.status_code} with URL {url}\n")
|
sys.stderr.write(
|
||||||
|
f"Request response code is {response.status_code} with URL {url}\n"
|
||||||
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def getGitVersion() -> str:
|
def getGitVersion() -> str:
|
||||||
url = "https://api.github.com/repos/mailcow/mailcow-dockerized/releases/latest"
|
url = "https://api.github.com/repos/mailcow/mailcow-dockerized/releases/latest"
|
||||||
git_version = ""
|
git_version = ""
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
if (response.status_code == 200):
|
if response.status_code == 200:
|
||||||
jsdata = response.text
|
jsdata = response.text
|
||||||
data = json.loads(jsdata) # returns a dictionary
|
data = json.loads(jsdata) # returns a dictionary
|
||||||
git_version = data["tag_name"]
|
git_version = data["tag_name"]
|
||||||
# print(git_version)
|
# print(git_version)
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(f"Request response code is {response.status_code} with URL {url}\n")
|
sys.stderr.write(
|
||||||
|
f"Request response code is {response.status_code} with URL {url}\n"
|
||||||
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return git_version
|
return git_version
|
||||||
|
|
||||||
|
|
||||||
def compareVersions(mc_ver: str, git_ver: str) -> bool:
|
def compareVersions(mc_ver: str, git_ver: str) -> bool:
|
||||||
update_available = False
|
update_available = False
|
||||||
try:
|
try:
|
||||||
@ -332,12 +363,13 @@ def compareVersions(mc_ver: str, git_ver: str) -> bool:
|
|||||||
pass
|
pass
|
||||||
return update_available
|
return update_available
|
||||||
|
|
||||||
|
|
||||||
# @debugLog
|
# @debugLog
|
||||||
def getMailcowInfo(headers: str, verify: bool, base_url: str) -> dict:
|
def getMailcowInfo(headers: str, verify: bool, base_url: str) -> dict:
|
||||||
info_data = {}
|
info_data = {}
|
||||||
url = f"{base_url}/status/version"
|
url = f"{base_url}/status/version"
|
||||||
response = requests.get(url, headers=headers, verify=verify)
|
response = requests.get(url, headers=headers, verify=verify)
|
||||||
if (response.status_code == 200):
|
if response.status_code == 200:
|
||||||
jsdata = response.text
|
jsdata = response.text
|
||||||
data = json.loads(jsdata) # returns a dictionary
|
data = json.loads(jsdata) # returns a dictionary
|
||||||
# pprint(data)
|
# pprint(data)
|
||||||
@ -358,28 +390,13 @@ def getMailcowInfo(headers: str, verify: bool, base_url: str) -> dict:
|
|||||||
info_data["check_version_enabled"] = opt_check_version
|
info_data["check_version_enabled"] = opt_check_version
|
||||||
return info_data
|
return info_data
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(f"Request response code is {response.status_code} with URL {url}\n")
|
sys.stderr.write(
|
||||||
sys.exit(1)
|
f"Request response code is {response.status_code} with URL {url}\n"
|
||||||
|
)
|
||||||
#@debugLog
|
|
||||||
def getSolrInfo(headers: str, verify: bool, base_url: str) -> tuple:
|
|
||||||
url = f"{base_url}/status/solr"
|
|
||||||
response = requests.get(url, headers=headers, verify=verify)
|
|
||||||
if (response.status_code == 200):
|
|
||||||
jsdata = response.text
|
|
||||||
data = json.loads(jsdata) # returns a dictionary
|
|
||||||
#pprint(data)
|
|
||||||
# get Solr infos
|
|
||||||
solr_enabled = data["solr_enabled"]
|
|
||||||
solr_size = data["solr_size"]
|
|
||||||
solr_documents = data["solr_documents"]
|
|
||||||
return solr_enabled, solr_size, solr_documents
|
|
||||||
else:
|
|
||||||
sys.stderr.write(f"Request response code is {response.status_code} with URL {url}\n")
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
'''
|
"""
|
||||||
Output is as follows:
|
Output is as follows:
|
||||||
0 mailbox name email address used for login
|
0 mailbox name email address used for login
|
||||||
1 active 1 --> active, 0 --> not active
|
1 active 1 --> active, 0 --> not active
|
||||||
@ -398,7 +415,8 @@ Example:
|
|||||||
user1@dom1.de;1;2022-04-29 14:29:34;2022-04-29 14:29:34;Sarah;2433;2;21474836480;495481374;1692520168;0;1692281537
|
user1@dom1.de;1;2022-04-29 14:29:34;2022-04-29 14:29:34;Sarah;2433;2;21474836480;495481374;1692520168;0;1692281537
|
||||||
user2@dom1.de;1;2022-04-29 14:38:33;2022-04-29 14:38:33;Tom;271;0;21474836480;25895752;1657394782;1692519758;1681065713
|
user2@dom1.de;1;2022-04-29 14:38:33;2022-04-29 14:38:33;Tom;271;0;21474836480;25895752;1657394782;1692519758;1681065713
|
||||||
user1@dom2.de;1;2022-04-30 09:55:37;2022-04-30 09:55:37;Melissa;53460;33;19964887040;6677677548;1692520066;0;1692510822
|
user1@dom2.de;1;2022-04-30 09:55:37;2022-04-30 09:55:37;Melissa;53460;33;19964887040;6677677548;1692520066;0;1692510822
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
# @debugLog
|
# @debugLog
|
||||||
def doCmkOutputMailboxes() -> None:
|
def doCmkOutputMailboxes() -> None:
|
||||||
@ -417,21 +435,30 @@ def doCmkOutputMailboxes() -> None:
|
|||||||
last_imap_login = mailbox_data[mb]["last_imap_login"]
|
last_imap_login = mailbox_data[mb]["last_imap_login"]
|
||||||
last_pop3_login = mailbox_data[mb]["last_pop3_login"]
|
last_pop3_login = mailbox_data[mb]["last_pop3_login"]
|
||||||
last_smtp_login = mailbox_data[mb]["last_smtp_login"]
|
last_smtp_login = mailbox_data[mb]["last_smtp_login"]
|
||||||
print(f"{mb};{active};{created};{modified};{name};{num_messages};{percent_in_use};{quota};{quota_used};{last_imap_login};{last_pop3_login};{last_smtp_login}")
|
print(
|
||||||
|
f"{mb};{active};{created};{modified};{name};{num_messages};{percent_in_use};{quota};{quota_used};{last_imap_login};{last_pop3_login};{last_smtp_login}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# @debugLog
|
# @debugLog
|
||||||
def doCmkOutputMailcow(version: str,
|
def doCmkOutputMailcow(
|
||||||
num_domains: int, num_mailboxes: int, num_global_messages: int,
|
version: str,
|
||||||
solr_enabled: bool, solr_size: float, solr_documents: int,
|
num_domains: int,
|
||||||
git_version: str, update_available: bool, check_version_enabled: bool
|
num_mailboxes: int,
|
||||||
|
num_global_messages: int,
|
||||||
|
git_version: str,
|
||||||
|
update_available: bool,
|
||||||
|
check_version_enabled: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
print("<<<mailcow_info:sep(59)>>>")
|
print("<<<mailcow_info:sep(59)>>>")
|
||||||
# strip semicolons, if present, since we use it as delimiter
|
# strip semicolons, if present, since we use it as delimiter
|
||||||
version = version.replace(";", "")
|
version = version.replace(";", "")
|
||||||
print(f"{version};{num_domains};{num_mailboxes};{num_global_messages};{solr_enabled};{solr_size};{solr_documents};{git_version};{update_available};{check_version_enabled}")
|
print(
|
||||||
|
f"{version};{num_domains};{num_mailboxes};{num_global_messages};{git_version};{update_available};{check_version_enabled}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
'''
|
"""
|
||||||
Output is as follows:
|
Output is as follows:
|
||||||
0 domain_name
|
0 domain_name
|
||||||
1 active 1 --> active, 0 --> not active
|
1 active 1 --> active, 0 --> not active
|
||||||
@ -449,7 +476,8 @@ Example:
|
|||||||
dom1.de;1;2022-04-23 22:54:57;None;10;0;400;6;0;0;10737418240
|
dom1.de;1;2022-04-23 22:54:57;None;10;0;400;6;0;0;10737418240
|
||||||
dom2.de;1;2022-04-29 13:38:42;2023-08-19 17:21:04;10;0;400;2;0;0;10737418240
|
dom2.de;1;2022-04-29 13:38:42;2023-08-19 17:21:04;10;0;400;2;0;0;10737418240
|
||||||
dom3.de;1;2022-04-29 13:36:08;2022-04-29 21:26:19;10;1;100;3;28132;12852485367;21474836480
|
dom3.de;1;2022-04-29 13:36:08;2022-04-29 21:26:19;10;1;100;3;28132;12852485367;21474836480
|
||||||
'''
|
"""
|
||||||
|
|
||||||
|
|
||||||
# @debugLog
|
# @debugLog
|
||||||
def doCmkOutputDomains() -> None:
|
def doCmkOutputDomains() -> None:
|
||||||
@ -465,7 +493,9 @@ def doCmkOutputDomains() -> None:
|
|||||||
msgs_total = domain_data[dom]["msgs_total"]
|
msgs_total = domain_data[dom]["msgs_total"]
|
||||||
bytes_total = domain_data[dom]["bytes_total"]
|
bytes_total = domain_data[dom]["bytes_total"]
|
||||||
max_quota_for_domain = domain_data[dom]["max_quota_for_domain"]
|
max_quota_for_domain = domain_data[dom]["max_quota_for_domain"]
|
||||||
print(f"{dom};{active};{created};{modified};{max_num_mboxes_for_domain};{mboxes_in_domain};{max_num_aliases_for_domain};{aliases_in_domain};{msgs_total};{bytes_total};{max_quota_for_domain}")
|
print(
|
||||||
|
f"{dom};{active};{created};{modified};{max_num_mboxes_for_domain};{mboxes_in_domain};{max_num_aliases_for_domain};{aliases_in_domain};{msgs_total};{bytes_total};{max_quota_for_domain}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -473,39 +503,39 @@ def main():
|
|||||||
cmk.utils.password_store.replace_passwords()
|
cmk.utils.password_store.replace_passwords()
|
||||||
getOptions()
|
getOptions()
|
||||||
# do some parameter checks
|
# do some parameter checks
|
||||||
if (opt_hostname == ""):
|
if opt_hostname == "":
|
||||||
sys.stderr.write(f"No hostname given.\n")
|
sys.stderr.write(f"No hostname given.\n")
|
||||||
showUsage()
|
showUsage()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
hostname = opt_hostname
|
hostname = opt_hostname
|
||||||
if (opt_apikey == ""):
|
if opt_apikey == "":
|
||||||
sys.stderr.write(f"No API key given.\n")
|
sys.stderr.write(f"No API key given.\n")
|
||||||
showUsage()
|
showUsage()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if (opt_no_cert_check):
|
if opt_no_cert_check:
|
||||||
# disable certificate warnings
|
# disable certificate warnings
|
||||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||||
verify = False
|
verify = False
|
||||||
else:
|
else:
|
||||||
verify = True
|
verify = True
|
||||||
if (opt_port == ""):
|
if opt_port == "":
|
||||||
if (opt_no_https):
|
if opt_no_https:
|
||||||
protocol = "http"
|
protocol = "http"
|
||||||
port = "80"
|
port = "80"
|
||||||
else:
|
else:
|
||||||
protocol = "https"
|
protocol = "https"
|
||||||
port = "443"
|
port = "443"
|
||||||
else:
|
else:
|
||||||
if (opt_no_https):
|
if opt_no_https:
|
||||||
protocol = "http"
|
protocol = "http"
|
||||||
else:
|
else:
|
||||||
protocol = "https"
|
protocol = "https"
|
||||||
port = opt_port
|
port = opt_port
|
||||||
if (protocol == "http" and port == "443"):
|
if protocol == "http" and port == "443":
|
||||||
sys.stderr.write(f"Combining HTTP with port 443 is not supported.\n")
|
sys.stderr.write(f"Combining HTTP with port 443 is not supported.\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
if (protocol == "https" and port == "80"):
|
if protocol == "https" and port == "80":
|
||||||
sys.stderr.write(f"Combining HTTPS with port 80 is not supported.\n")
|
sys.stderr.write(f"Combining HTTPS with port 80 is not supported.\n")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
headers = CaseInsensitiveDict()
|
headers = CaseInsensitiveDict()
|
||||||
@ -519,14 +549,15 @@ def main():
|
|||||||
debugLogFilename = getDebugFilename(hostname)
|
debugLogFilename = getDebugFilename(hostname)
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
showOptions()
|
showOptions()
|
||||||
print(f"hostname: {hostname}, protocol: {protocol}, port: {port}, verify: {verify}")
|
print(
|
||||||
|
f"hostname: {hostname}, protocol: {protocol}, port: {port}, verify: {verify}"
|
||||||
|
)
|
||||||
base_url = f"{protocol}://{hostname}:{port}/{mc_api_base}"
|
base_url = f"{protocol}://{hostname}:{port}/{mc_api_base}"
|
||||||
# get domain data
|
# get domain data
|
||||||
num_domains = getDomainInfo(headers, verify, base_url)
|
num_domains = getDomainInfo(headers, verify, base_url)
|
||||||
# get mailbox data
|
# get mailbox data
|
||||||
num_mailboxes, num_global_messages = getMailboxInfo(headers, verify, base_url)
|
num_mailboxes, num_global_messages = getMailboxInfo(headers, verify, base_url)
|
||||||
# get global Mailcow info
|
# get global Mailcow info
|
||||||
solr_enabled, solr_size, solr_documents = getSolrInfo(headers, verify, base_url)
|
|
||||||
mailcow_info = getMailcowInfo(headers, verify, base_url)
|
mailcow_info = getMailcowInfo(headers, verify, base_url)
|
||||||
mailcow_version = mailcow_info["mc_version"]
|
mailcow_version = mailcow_info["mc_version"]
|
||||||
github_version = mailcow_info["git_version"]
|
github_version = mailcow_info["git_version"]
|
||||||
@ -535,10 +566,14 @@ def main():
|
|||||||
# create agent output
|
# create agent output
|
||||||
doCmkOutputDomains()
|
doCmkOutputDomains()
|
||||||
doCmkOutputMailboxes()
|
doCmkOutputMailboxes()
|
||||||
doCmkOutputMailcow(mailcow_version,
|
doCmkOutputMailcow(
|
||||||
num_domains, num_mailboxes, num_global_messages,
|
mailcow_version,
|
||||||
solr_enabled, solr_size, solr_documents,
|
num_domains,
|
||||||
github_version, update_available, check_version_enabled
|
num_mailboxes,
|
||||||
|
num_global_messages,
|
||||||
|
github_version,
|
||||||
|
update_available,
|
||||||
|
check_version_enabled,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,5 @@ description:
|
|||||||
The check will raise WARN/CRIT if the number of domains is above the configurable levels.
|
The check will raise WARN/CRIT if the number of domains is above the configurable levels.
|
||||||
The check will raise WARN/CRIT if the number of mailboxes is above the configurable levels.
|
The check will raise WARN/CRIT if the number of mailboxes is above the configurable levels.
|
||||||
The check will raise WARN/CRIT if the number of messages is above the configurable levels.
|
The check will raise WARN/CRIT if the number of messages is above the configurable levels.
|
||||||
The check will raise WARN/CRIT if the solr size is above the configurable levels.
|
|
||||||
The check will raise WARN/CRIT if the number of solr documents is above the configurable levels.
|
|
||||||
inventory:
|
inventory:
|
||||||
one service is created (with several details)
|
one service is created (with several details)
|
@ -1,12 +1,19 @@
|
|||||||
def agent_mailcow_arguments(params, hostname, ipaddress):
|
def agent_mailcow_arguments(params, hostname, ipaddress):
|
||||||
return [
|
return [
|
||||||
"--hostname", params["hostname"],
|
"--hostname",
|
||||||
"--apikey", passwordstore_get_cmdline("%s", params["apikey"]),
|
params["hostname"],
|
||||||
"--port", params["port"],
|
"--apikey",
|
||||||
"--check-version", params["check_version"],
|
passwordstore_get_cmdline("%s", params["apikey"]),
|
||||||
"--no-https", params["no_https"],
|
"--port",
|
||||||
"--no-cert-check", params["no_cert_check"],
|
params["port"],
|
||||||
|
"--check-version",
|
||||||
|
params["check_version"],
|
||||||
|
"--no-https",
|
||||||
|
params["no_https"],
|
||||||
|
"--no-cert-check",
|
||||||
|
params["no_cert_check"],
|
||||||
ipaddress,
|
ipaddress,
|
||||||
]
|
]
|
||||||
|
|
||||||
special_agent_info['mailcow'] = agent_mailcow_arguments
|
|
||||||
|
special_agent_info["mailcow"] = agent_mailcow_arguments
|
||||||
|
@ -70,15 +70,3 @@ metric_info["mailcow_mailboxes_messages"] = {
|
|||||||
"unit": "count",
|
"unit": "count",
|
||||||
"color": "24/b",
|
"color": "24/b",
|
||||||
}
|
}
|
||||||
|
|
||||||
metric_info["mc_solr_size"] = {
|
|
||||||
"title": _("Solr Size"),
|
|
||||||
"unit": "bytes",
|
|
||||||
"color": "24/b",
|
|
||||||
}
|
|
||||||
|
|
||||||
metric_info["mc_solr_documents"] = {
|
|
||||||
"title": _("Number of Solr Documents"),
|
|
||||||
"unit": "count",
|
|
||||||
"color": "24/a",
|
|
||||||
}
|
|
@ -1,17 +1,24 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from cmk.gui.plugins.metrics import perfometer_info
|
from cmk.gui.plugins.metrics import perfometer_info
|
||||||
|
|
||||||
perfometer_info.append({
|
perfometer_info.append(
|
||||||
|
{
|
||||||
"type": "stacked",
|
"type": "stacked",
|
||||||
"perfometers": [
|
"perfometers": [
|
||||||
{
|
{
|
||||||
"type": "linear",
|
"type": "linear",
|
||||||
"segments": ["mc_num_domains","mc_num_mailboxes","mc_num_global_messages"],
|
"segments": [
|
||||||
|
"mc_num_domains",
|
||||||
|
"mc_num_mailboxes",
|
||||||
|
"mc_num_global_messages",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
perfometer_info.append({
|
perfometer_info.append(
|
||||||
|
{
|
||||||
"type": "stacked",
|
"type": "stacked",
|
||||||
"perfometers": [
|
"perfometers": [
|
||||||
{
|
{
|
||||||
@ -20,9 +27,11 @@ perfometer_info.append({
|
|||||||
"total": 100.0,
|
"total": 100.0,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
perfometer_info.append({
|
perfometer_info.append(
|
||||||
|
{
|
||||||
"type": "stacked",
|
"type": "stacked",
|
||||||
"perfometers": [
|
"perfometers": [
|
||||||
{
|
{
|
||||||
@ -31,24 +40,5 @@ perfometer_info.append({
|
|||||||
"total": 100.0,
|
"total": 100.0,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
}
|
||||||
|
)
|
||||||
#perfometer_info.append({
|
|
||||||
# "type": "stacked",
|
|
||||||
# "perfometers": [
|
|
||||||
# {
|
|
||||||
# "type": "linear",
|
|
||||||
# "segments": ["mc_num_mailboxes"],
|
|
||||||
# },
|
|
||||||
# ],
|
|
||||||
#})
|
|
||||||
|
|
||||||
#perfometer_info.append({
|
|
||||||
# "type": "stacked",
|
|
||||||
# "perfometers": [
|
|
||||||
# {
|
|
||||||
# "type": "linear",
|
|
||||||
# "segments": ["mc_num_global_messages"],
|
|
||||||
# },
|
|
||||||
# ],
|
|
||||||
#})
|
|
||||||
|
@ -2,7 +2,7 @@ from cmk.gui.i18n import _
|
|||||||
from cmk.gui.plugins.wato import (
|
from cmk.gui.plugins.wato import (
|
||||||
CheckParameterRulespecWithoutItem,
|
CheckParameterRulespecWithoutItem,
|
||||||
rulespec_registry,
|
rulespec_registry,
|
||||||
RulespecGroupCheckParametersApplications
|
RulespecGroupCheckParametersApplications,
|
||||||
)
|
)
|
||||||
|
|
||||||
from cmk.gui.valuespec import (
|
from cmk.gui.valuespec import (
|
||||||
@ -14,10 +14,13 @@ from cmk.gui.valuespec import (
|
|||||||
Float,
|
Float,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _parameter_spec_mailcow_info():
|
def _parameter_spec_mailcow_info():
|
||||||
return Dictionary(
|
return Dictionary(
|
||||||
elements=[
|
elements=[
|
||||||
("levels_num_domains", Tuple(
|
(
|
||||||
|
"levels_num_domains",
|
||||||
|
Tuple(
|
||||||
title=_("Number of email domains"),
|
title=_("Number of email domains"),
|
||||||
elements=[
|
elements=[
|
||||||
Integer(
|
Integer(
|
||||||
@ -29,10 +32,13 @@ def _parameter_spec_mailcow_info():
|
|||||||
title=_("Critical at"),
|
title=_("Critical at"),
|
||||||
size=32,
|
size=32,
|
||||||
default_value=200,
|
default_value=200,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)),
|
),
|
||||||
("levels_num_mailboxes", Tuple(
|
),
|
||||||
|
(
|
||||||
|
"levels_num_mailboxes",
|
||||||
|
Tuple(
|
||||||
title=_("Number of mailboxes"),
|
title=_("Number of mailboxes"),
|
||||||
elements=[
|
elements=[
|
||||||
Integer(
|
Integer(
|
||||||
@ -44,10 +50,13 @@ def _parameter_spec_mailcow_info():
|
|||||||
title=_("Critical at"),
|
title=_("Critical at"),
|
||||||
size=32,
|
size=32,
|
||||||
default_value=1000,
|
default_value=1000,
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)),
|
),
|
||||||
("levels_num_global_messages", Tuple(
|
),
|
||||||
|
(
|
||||||
|
"levels_num_global_messages",
|
||||||
|
Tuple(
|
||||||
title=_("Number of messages"),
|
title=_("Number of messages"),
|
||||||
elements=[
|
elements=[
|
||||||
Integer(
|
Integer(
|
||||||
@ -59,44 +68,14 @@ def _parameter_spec_mailcow_info():
|
|||||||
title=_("Critical at"),
|
title=_("Critical at"),
|
||||||
size=32,
|
size=32,
|
||||||
default_value=250000,
|
default_value=250000,
|
||||||
)
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
("levels_solr_size", Tuple(
|
|
||||||
title=_("Solr size"),
|
|
||||||
elements=[
|
|
||||||
Float(
|
|
||||||
title=_("Warning at"),
|
|
||||||
size=32,
|
|
||||||
default_value=4096.0,
|
|
||||||
unit="MBytes",
|
|
||||||
),
|
),
|
||||||
Float(
|
|
||||||
title=_("Critical at"),
|
|
||||||
size=32,
|
|
||||||
default_value=8192.0,
|
|
||||||
unit="MBytes",
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
)),
|
|
||||||
("levels_solr_documents", Tuple(
|
|
||||||
title=_("Number of Solr documents"),
|
|
||||||
elements=[
|
|
||||||
Integer(
|
|
||||||
title=_("Warning at"),
|
|
||||||
size=32,
|
|
||||||
default_value=20000,
|
|
||||||
),
|
),
|
||||||
Integer(
|
),
|
||||||
title=_("Critical at"),
|
|
||||||
size=32,
|
|
||||||
default_value=40000,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
rulespec_registry.register(
|
rulespec_registry.register(
|
||||||
CheckParameterRulespecWithoutItem(
|
CheckParameterRulespecWithoutItem(
|
||||||
check_group_name="mailcow_info",
|
check_group_name="mailcow_info",
|
||||||
|
@ -27,32 +27,68 @@ from cmk.gui.valuespec import (
|
|||||||
Integer,
|
Integer,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _valuespec_special_agent_mailcow():
|
def _valuespec_special_agent_mailcow():
|
||||||
return Dictionary(
|
return Dictionary(
|
||||||
title=_("Mailcow Server Information"),
|
title=_("Mailcow Server Information"),
|
||||||
help=_("Checking Mailcow instances via API"),
|
help=_("Checking Mailcow instances via API"),
|
||||||
elements=[
|
elements=[
|
||||||
("hostname", TextAscii(title=_("Hostname"),
|
(
|
||||||
|
"hostname",
|
||||||
|
TextAscii(
|
||||||
|
title=_("Hostname"),
|
||||||
size=32,
|
size=32,
|
||||||
allow_empty=False,
|
allow_empty=False,
|
||||||
help=_("Hostname of Mailcow server (bare FQDN or IP), mandatory"))),
|
help=_("Hostname of Mailcow server (bare FQDN or IP), mandatory"),
|
||||||
("apikey", IndividualOrStoredPassword(title=_("API Key"),
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"apikey",
|
||||||
|
IndividualOrStoredPassword(
|
||||||
|
title=_("API Key"),
|
||||||
size=32,
|
size=32,
|
||||||
allow_empty=False,
|
allow_empty=False,
|
||||||
help=_("API Key, mandatory"))),
|
help=_("API Key, mandatory"),
|
||||||
("port", TextAscii(title=_("Port"),
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"port",
|
||||||
|
TextAscii(
|
||||||
|
title=_("Port"),
|
||||||
allow_empty=True,
|
allow_empty=True,
|
||||||
help=_("Specify port if not listening to HTTPS/HTTP, optional"))),
|
help=_("Specify port if not listening to HTTPS/HTTP, optional"),
|
||||||
("check_version", Checkbox(title=_("Check version"),
|
),
|
||||||
help=_("Checks the running version against the public Github repo"))),
|
),
|
||||||
("no_https", Checkbox(title=_("Disable HTTPS"),
|
(
|
||||||
help=_("Activate to disable TLS encryption (not recommended), optional"))),
|
"check_version",
|
||||||
("no_cert_check", Checkbox(title=_("Disable certificate validation"),
|
Checkbox(
|
||||||
help=_("Activate to disable certificate validation (not recommended), optional"))),
|
title=_("Check version"),
|
||||||
|
help=_("Checks the running version against the public Github repo"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"no_https",
|
||||||
|
Checkbox(
|
||||||
|
title=_("Disable HTTPS"),
|
||||||
|
help=_(
|
||||||
|
"Activate to disable TLS encryption (not recommended), optional"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"no_cert_check",
|
||||||
|
Checkbox(
|
||||||
|
title=_("Disable certificate validation"),
|
||||||
|
help=_(
|
||||||
|
"Activate to disable certificate validation (not recommended), optional"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
optional_keys=[],
|
optional_keys=[],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
rulespec_registry.register(
|
rulespec_registry.register(
|
||||||
HostRulespec(
|
HostRulespec(
|
||||||
group=RulespecGroupDatasourceProgramsApps,
|
group=RulespecGroupDatasourceProgramsApps,
|
||||||
|
BIN
mkp/Mailcow-1.3.0.mkp
Normal file
BIN
mkp/Mailcow-1.3.0.mkp
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user