Skip to content

Commit

Permalink
Revert of Werk 10627
Browse files Browse the repository at this point in the history
Reason: Issue can not be resolved at the moment.
The VMWare API does not provide the required values.

CMK-676

Change-Id: I103125a473007c79e039236b92608e0689405791
  • Loading branch information
Jonas Kluger committed Aug 18, 2020
1 parent aac251a commit 84d9b67
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 216 deletions.
12 changes: 0 additions & 12 deletions .werks/10627

This file was deleted.

12 changes: 0 additions & 12 deletions checkman/esx_vsphere_counters_cpu

This file was deleted.

70 changes: 0 additions & 70 deletions checks/esx_vsphere_counters
Expand Up @@ -30,76 +30,6 @@
# ...
# sys.uptime||630664|second

#.
# .--cpu-----------------------------------------------------------------.
# | |
# | ___ _ __ _ _ |
# | / __| '_ \| | | | |
# | | (__| |_) | |_| | |
# | \___| .__/ \__,_| |
# | |_| |
# +----------------------------------------------------------------------+

factory_settings['if_default_levels'] = IF_CHECK_DEFAULT_PARAMETERS

factory_settings['esx_vsphere_counters_cpu_default_levels'] = {
'cpu_costop': (5.0, 10.0),
'cpu_ready': (5.0, 10.0)
}


def _parse_esx_vsphere_counters_cpu(parsed):
CPU = collections.namedtuple('CPU', ['ready', 'costop'])
cpu_values = []
for key in ('cpu.ready', 'cpu.costop'):
try:
cpu_values.append(float(parsed[key][''][0][0][0]))
except (KeyError, IndexError, TypeError, ValueError):
cpu_values.append(None)
return CPU(*cpu_values)


def inventory_esx_vsphere_counters_cpu(parsed):
CPU = _parse_esx_vsphere_counters_cpu(parsed)
if CPU.ready is not None or CPU.costop is not None:
return [(None, {})]


def check_esx_vsphere_counters_cpu(item, params, parsed):
# Official formula from vmware for calculating the CPU ready/Co-Stop percentage
# https://kb.vmware.com/s/article/2002181
# by default the 20sec interval (so called 'realtime') is used
# CPU summation value in milliseconds / 200
CPU = _parse_esx_vsphere_counters_cpu(parsed)

if CPU.ready is not None:
yield check_levels(
CPU.ready / 200,
'cpu_ready_percent',
params.get('cpu_ready', None),
human_readable_func=get_percent_human_readable,
infoname='CPU ready',
)

if CPU.costop is not None:
yield check_levels(
CPU.costop / 200,
'cpu_costop_percent',
params.get('cpu_costop', None),
human_readable_func=get_percent_human_readable,
infoname='Co-Stop',
)


check_info['esx_vsphere_counters.cpu'] = {
'inventory_function': inventory_esx_vsphere_counters_cpu,
'check_function': check_esx_vsphere_counters_cpu,
'service_description': 'CPU usage',
'has_perfdata': True,
'default_levels_variable': 'esx_vsphere_counters_cpu_default_levels',
'group': 'esx_host_cpu',
}

# .--Disk IO-------------------------------------------------------------.
# | ____ _ _ ___ ___ |
# | | _ \(_)___| | __ |_ _/ _ \ |
Expand Down
12 changes: 0 additions & 12 deletions cmk/gui/plugins/metrics/cpu.py
Expand Up @@ -311,18 +311,6 @@
"color": "#94b65a",
}

metric_info["cpu_ready_percent"] = {
"title": _("CPU ready"),
"unit": "%",
"color": "15/a",
}

metric_info["cpu_costop_percent"] = {
"title": _("Co-Stop"),
"unit": "%",
"color": "11/a",
}

metric_info["system_time"] = {
"title": _("CPU time in system space"),
"unit": "s",
Expand Down
48 changes: 0 additions & 48 deletions cmk/gui/plugins/wato/check_parameters/esx_host_cpu.py

This file was deleted.

2 changes: 0 additions & 2 deletions cmk/special_agents/agent_vsphere.py
Expand Up @@ -38,8 +38,6 @@
AGENT_TMP_PATH = Path(cmk.utils.paths.tmp_dir, "agents/agent_vsphere")

REQUESTED_COUNTERS_KEYS = (
'cpu.ready',
'cpu.costop',
'disk.numberRead',
'disk.numberWrite',
'disk.read',
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions tests/unit/checks/test_generic_legacy_conversion.py
Expand Up @@ -522,7 +522,6 @@ def test_all_check_variables_present(_load_all_checks, config_check_variables):
'enviromux_default_levels',
'epson_beamer_lamp_default_levels',
'esx_host_mem_default_levels',
'esx_vsphere_counters_cpu_default_levels',
'esx_vsphere_counters_ramdisk_sizes',
'esx_vsphere_objects_default_levels',
'etherbox2_temp_default_levels',
Expand Down Expand Up @@ -1792,7 +1791,6 @@ def test_no_new_or_vanished_legacy_checks(config_check_info):
'enviromux_sems.voltage',
'enviromux_sems.humidity',
'epson_beamer_lamp',
'esx_vsphere_counters.cpu',
'esx_vsphere_counters.diskio',
'esx_vsphere_counters',
'esx_vsphere_counters.if',
Expand Down

0 comments on commit 84d9b67

Please sign in to comment.