added info and finalzed switch to dictionary based params
This commit is contained in:
parent
f1e209d778
commit
53d27dc532
@ -11,19 +11,19 @@ factory_settings["exchange_user_mbx_size_default_values"] = {
|
|||||||
"levels" : (1500, 2000),
|
"levels" : (1500, 2000),
|
||||||
}
|
}
|
||||||
|
|
||||||
exchange_user_mbx_size_default_values = (1500, 2000)
|
|
||||||
|
|
||||||
def inventory_exchange_user_mbx_size(info):
|
def inventory_exchange_user_mbx_size(info):
|
||||||
inventory = []
|
inventory = []
|
||||||
for line in info:
|
for line in info:
|
||||||
useremail = line[0]
|
useremail = line[0]
|
||||||
mailboxsize = line[1]
|
mailboxsize = line[1]
|
||||||
inventory.append((useremail, "exchange_user_mbx_size_default_values"))
|
inventory.append((useremail, {} ))
|
||||||
return inventory
|
return inventory
|
||||||
|
|
||||||
def check_exchange_user_mbx_size(item, params, info):
|
def check_exchange_user_mbx_size(item, params, info):
|
||||||
|
if type(params) != dict:
|
||||||
|
params = { "levels" : params }
|
||||||
#unpack check params
|
#unpack check params
|
||||||
warn, crit = params
|
warn, crit = params["levels"]
|
||||||
for line in info:
|
for line in info:
|
||||||
if line[0] == item:
|
if line[0] == item:
|
||||||
mailboxsize = int(line[1])
|
mailboxsize = int(line[1])
|
||||||
@ -40,7 +40,7 @@ check_info["exchange_user_mbx_size"] = {
|
|||||||
'check_function': check_exchange_user_mbx_size,
|
'check_function': check_exchange_user_mbx_size,
|
||||||
'inventory_function': inventory_exchange_user_mbx_size,
|
'inventory_function': inventory_exchange_user_mbx_size,
|
||||||
'service_description': '%s Mailbox size',
|
'service_description': '%s Mailbox size',
|
||||||
#'default_levels_variable': 'exchange_user_mbx_size_default_values',
|
'default_levels_variable': 'exchange_user_mbx_size_default_values',
|
||||||
'has_perfdata': True,
|
'has_perfdata': True,
|
||||||
'group': 'exchange_user_mbx_size',
|
'group': 'exchange_user_mbx_size',
|
||||||
}
|
}
|
||||||
|
17
info
Normal file
17
info
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{'author': 'Marius Pana',
|
||||||
|
'description': 'Check_mk check for individual exchange mailbox sizes.',
|
||||||
|
'download_url': 'https://github.com/spearheadsys/check_mk-exch-mbox',
|
||||||
|
'files': {'agents': ['plugins/SPH-Exchange-MailboxSize.ps1'],
|
||||||
|
'checkman': ['exchange_user_mbx_size'],
|
||||||
|
'checks': ['exchange_user_mbx_size'],
|
||||||
|
'doc': [],
|
||||||
|
'inventory': [],
|
||||||
|
'notifications': [],
|
||||||
|
'pnp-templates': ['check_mk-exchange_user_mbx_size.php'],
|
||||||
|
'web': ['plugins/perfometer/exchange_mbx_size_perfometer.py',
|
||||||
|
'plugins/wato/exchange_mbx_size_check_parameters.py']},
|
||||||
|
'name': 'exchange_usr_mbox_size',
|
||||||
|
'title': 'exchange_usr_mbox_size',
|
||||||
|
'version': '1.0',
|
||||||
|
'version.min_required': '1.2.6b1',
|
||||||
|
'version.packaged': '1.2.6b1'}
|
@ -6,13 +6,22 @@ register_check_parameters(
|
|||||||
subgroup_applications,
|
subgroup_applications,
|
||||||
"exchange_user_mbx_size",
|
"exchange_user_mbx_size",
|
||||||
_("MS Exchange User Mailbox Size"),
|
_("MS Exchange User Mailbox Size"),
|
||||||
Tuple(
|
Dictionary(
|
||||||
title = _('Maximum Mailbox Size'),
|
|
||||||
elements = [
|
elements = [
|
||||||
Integer(title = _("Warning if above"), default_value = 1500 ),
|
("Maximum Mailbox Size",
|
||||||
Integer(title = _("Critical if above"), default_value = 2000 ),
|
Integer(
|
||||||
|
title = _("Warning if above"),
|
||||||
|
unit = _("MB"),
|
||||||
|
default_value = 1500
|
||||||
|
),
|
||||||
|
Integer(
|
||||||
|
title = _("Critical if above"),
|
||||||
|
unit = _("MB"),
|
||||||
|
default_value = 2000
|
||||||
|
),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
None,
|
None,
|
||||||
None,
|
"dict"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user