Skip to content

Commit

Permalink
Merge pull request #57 from plesk/HOTFIX-detect-win-11
Browse files Browse the repository at this point in the history
[HOTFIX] Fix Windows 11 version detection
  • Loading branch information
ktak-007 authored May 11, 2023
2 parents ad65cdb + af9f0ba commit 6f16254
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion agent360/plugins/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def run(self, *unused):
cpu['brand'] = str(systemCommand('sysctl hw.model', False)[0]).split(': ')[1]
cpu['count'] = systemCommand('sysctl hw.ncpu')
elif sys.platform == "win32":
systeminfo['os'] = "{} {}".format(platform.uname()[0], platform.uname()[2])
# https://learn.microsoft.com/en-us/windows/release-health/windows11-release-information
if sys.getwindowsversion().build >= 22000:
systeminfo['os'] = "{} {}".format(platform.uname()[0], 11)
else:
systeminfo['os'] = "{} {}".format(platform.uname()[0], platform.uname()[2])
systeminfo['cpu'] = cpu['brand']
systeminfo['cores'] = cpu['count']
systeminfo['memory'] = mem.total
Expand Down

0 comments on commit 6f16254

Please sign in to comment.