diff --git a/CHANGELOG.md b/CHANGELOG.md index ba89bf21..a8ed8810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ Monitoring Plugins: * All plugins: Consistently reporting errors using cu() instead of oao() * about-me: Show systemd timers with next runtime +* cpu-usage: On Windows, exclude "System Idle Process" from the Top3 list * disk-smart: Skip unsupported disks (fix #672) * fail2ban: Improve output, add unit-test * grafana-version: Add Grafana v9.5 diff --git a/check-plugins/cpu-usage/cpu-usage b/check-plugins/cpu-usage/cpu-usage index 727e28c7..1e123767 100755 --- a/check-plugins/cpu-usage/cpu-usage +++ b/check-plugins/cpu-usage/cpu-usage @@ -29,7 +29,7 @@ except ImportError: __author__ = 'Linuxfabrik GmbH, Zurich/Switzerland' -__version__ = '2023071301' +__version__ = '2023092101' DESCRIPTION = """Mainly provides utilization percentages for each specific CPU time. Takes a time period into account: the cpu usage within a certain amount of time has to be equal @@ -217,12 +217,18 @@ def main(): if lib.version.version(psutil.__version__) >= lib.version.version('5.3.0'): try: for p in psutil.process_iter(attrs=['name', 'cpu_times']): + if lib.base.WINDOWS and p.info['name'] == 'System Idle Process': + # yes, the System Idle Process on Windows consumes CPU time + continue cnt[p.info['name']] += sum(p.info['cpu_times'][:2]) except psutil.NoSuchProcess: pass else: try: for p in [x.as_dict(attrs=['name', 'cpu_times']) for x in psutil.process_iter()]: + if lib.base.WINDOWS and p['name'] == 'System Idle Process': + # yes, the System Idle Process on Windows consumes CPU time + continue cnt[p['name']] += sum(p['cpu_times'][:2]) except psutil.NoSuchProcess: pass