diff --git a/Check_NSX-1.5.mkp b/Check_NSX-1.5.mkp new file mode 100644 index 0000000..d235d4e Binary files /dev/null and b/Check_NSX-1.5.mkp differ diff --git a/local/share/check_mk/checks/check_nsx b/local/share/check_mk/checks/check_nsx index e7a155c..790ce77 100644 --- a/local/share/check_mk/checks/check_nsx +++ b/local/share/check_mk/checks/check_nsx @@ -169,12 +169,19 @@ check_info['nsx_components'] = { # +----------------------------------------------------------------------+ # | | # '----------------------------------------------------------------------' +factory_settings["nsx_backups_default_levels"] = { + "levels" : ( 7, 14 ), + +} + +nsx_backups_default_levels = ( 7, 14 ) + def inventory_nsx_backups(info): return [(None, {})] def check_nsx_backup(item, params, info): - warn, crit = params + warn, crit = params["levels"] if info: last_backup = sorted(info, key=lambda tup: tup[2])[-1] last_backup_size = last_backup[1] @@ -197,6 +204,7 @@ check_info['nsx_backup'] = { 'service_description' : 'NSX Backups', 'has_perfdata' : False, 'group' : "backups", + 'default_levels_variable': "nsx_backups_default_levels", } #. @@ -208,7 +216,10 @@ check_info['nsx_backup'] = { # | |_| |_|\___|_| |_| |_|\___/|_| \__, | | # | |___/ | # +----------------------------------------------------------------------+ -nsx_memory_default_levels = ( 80.0, 90.0 ) +factory_settings["nsx_mem_default_levels"] = { + "levels" : ( 80.0, 90.0 ), + +} def nsx_convert(info): data = {} @@ -222,7 +233,7 @@ def inventory_nsx_mem(info): def check_nsx_mem(item, params, info): data = nsx_convert(info) - warn, crit = params + warn,crit = params["levels"] memory_usage = savefloat(data['UsedMemory'][0]) * 1024 * 1024 memory_size = savefloat(data['TotalMem'][0]) * 1024 * 1024 level = savefloat(data['UsedPercentage'][0]) @@ -360,14 +371,17 @@ check_info['nsx_vcenter_connection'] = { # +----------------------------------------------------------------------+ # | | # '----------------------------------------------------------------------' -nsx_storage_default_levels = ( 70.0, 80.0 ) +factory_settings["nsx_storage_default_levels"] = { + "levels" : ( 80.0, 90.0 ), + +} def inventory_nsx_storage(info): data = nsx_convert(info) return [(None, 'nsx_storage_default_levels')] def check_nsx_storage(item, params, info): - warn,crit = params + warn,crit = params["levels"] data = nsx_convert(info) used_storage = float(re.sub('G','', data['UsedStorage'][0],count =1)) total_storage = float(re.sub('G','', data['TotalStorage'][0],count =1)) diff --git a/local/share/check_mk/web/plugins/wato/check_parameters.py b/local/share/check_mk/web/plugins/wato/check_parameters.py new file mode 100644 index 0000000..c87b671 --- /dev/null +++ b/local/share/check_mk/web/plugins/wato/check_parameters.py @@ -0,0 +1,77 @@ +register_check_parameters( + subgroup_applications, + "backups", + _("Time since last backup"), + Dictionary( + elements = [ + ("levels", + Tuple( + title = _("Time since of last backup"), + elements = [ + Integer( + title = _("Warning Level for time since last backup"), + help = _("Warning Level for time since last backup."), + unit = _("days"), + default_value = 7, + ), + Integer( + title = _("Critical Level for time since last backup"), + help = _("Critical Level for time since last backup."), + unit = _("days"), + default_value = 14, + ), + ] + ) + )] + ), + None, + "dict" +) + +register_check_parameters( + subgroup_os, + "nsx_memory", + _("Main memory usage of VMWare NSX system"), + Dictionary( + elements = [ + ("levels", + Tuple( + title = _("Specify levels in percentage of total RAM"), + elements = [ + Percentage( + title = _("Warning at a RAM usage of"), + help = _("Warning level if memory usage is above"), + default_value = 80.0 + ), + Percentage( + title = _("Critical at a RAM usage of"), + help= _("Critical level if memory usage is above"), + default_value = 90.0 + ), + ] + ) + )] + ), + None, + match_type = "dict", +) + +register_check_parameters( + subgroup_os, + "nsx_storage", + _("Storage usage of VMWare NSX system"), + Dictionary( + elements = [ + ("levels", + Tuple( + title = _("Specify levels in percentage of total RAM"), + elements = [ + Percentage(title = _("Warning at a storage usage of"), default_value = 80.0), + Percentage(title = _("Critical at a storage usage of"), default_value = 90.0), + ] + ) + )] + ), + None, + match_type = "dict", +) diff --git a/local/share/check_mk/web/plugins/wato/datasource_programs.py b/local/share/check_mk/web/plugins/wato/datasource_programs.py new file mode 100644 index 0000000..434c747 --- /dev/null +++ b/local/share/check_mk/web/plugins/wato/datasource_programs.py @@ -0,0 +1,33 @@ +group = 'datasource_programs' +register_rule( + group, + "special_agents:nsx", + Dictionary( + optional_keys = [ "cert", "nsx_resource" ], + elements = [ + ("user", TextAscii(title = _("Username"), allow_empty = False)), + ("password", Password(title = _("Password"), allow_empty = False)), + ("cert", DropdownChoice( + title = _("SSL certificate verification"), + choices = [ + (True, _("Activate")), + (False, _("Deactivate")), + ] )), + ("nsx_resource", ListOfStrings( + title = _("Resource"), + orientation = "horizontal", + help = _("Enter the full list of resources for Cluster" + "Compute Resource that needs to be monitored." + "If no value is entered, No Computer Resource" + "will be monitored."), + allow_empty = True)), + ], + ), + title = _("Check VMWare NSX"), + help = _("This rule set selects the special agent for VMWare NSX " + "instead of the normal Check_MK agent and allows monitoring via Web API. " + "Resource value is optional and used for monitoring the NSX host " + "preparation status"), + match = "first", +) + diff --git a/local/share/check_mk/web/plugins/wato/srm.py b/local/share/check_mk/web/plugins/wato/srm.py new file mode 100644 index 0000000..ee2ddfc --- /dev/null +++ b/local/share/check_mk/web/plugins/wato/srm.py @@ -0,0 +1,22 @@ +group = 'datasource_programs' +register_rule( + group, + "special_agents:srm", + Dictionary( + optional_keys = [ "cert" ], + elements = [ + ("cert", DropdownChoice( + title = _("SSL certificate verification"), + choices = [ + (True, _("Activate")), + (False, _("Deactivate")), + ] )), + ], + ), + title = _("Check VMWare SRM"), + help = _("This rule set selects the special agent for VMWare SRM " + "instead of the normal Check_MK agent and allows monitoring via Web API. " + "Connection is made on NSX appliance on port 9086."), + match = "first", +) +