From 9c45d8611ebe2e12477dd222abdaf5724b3bc3e8 Mon Sep 17 00:00:00 2001 From: SherlockNL <48120795+SherlockNL@users.noreply.github.com> Date: Tue, 26 May 2020 15:36:45 +0200 Subject: [PATCH] Send cpu utilisation data to hashtopolis Use psutil.cpu_percent() and round to one decimal place. --- htpclient/hashcat_cracker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htpclient/hashcat_cracker.py b/htpclient/hashcat_cracker.py index e501be4..efc65f5 100644 --- a/htpclient/hashcat_cracker.py +++ b/htpclient/hashcat_cracker.py @@ -1,6 +1,7 @@ import string import logging import subprocess +import psutil from time import sleep from queue import Queue, Empty from threading import Thread, Lock @@ -313,6 +314,7 @@ def run_loop(self, proc, chunk, task): query['gpuTemp'] = status.get_temps() if status.get_all_util(): query['gpuUtil'] = status.get_all_util() + query['cpuUtil'] = [round(psutil.cpu_percent(), 1)] req = JsonRequest(query) logging.debug("Sending " + str(len(self.cracks)) + " cracks...")