diff --git a/agent.py b/agent.py index 7e25a09..c9fef42 100644 --- a/agent.py +++ b/agent.py @@ -217,7 +217,10 @@ class ServerData: if section['DMIType'] == 4: # 4 corresponds to processor core_count = int(section.get('Core Count', '0')) thread_count = int(section.get('Thread Count', '0')) - cpu_count = core_count * thread_count + if thread_count: + cpu_count += thread_count + else: + cpu_count += core_count if cpu_count == 0: with open('/proc/cpuinfo', 'r') as f: cpuinfo = f.read()