Change ssh-tunnel
This commit is contained in:
@@ -7,23 +7,23 @@ from multiprocessing import freeze_support
|
||||
import Controller.ssh_tunnel as ssh_tunnel
|
||||
|
||||
def get_cpu_info():
|
||||
if __name__ == '__main__':
|
||||
freeze_support()
|
||||
return cpuinfo.get_cpu_info()['brand_raw']
|
||||
|
||||
def get_cpu_sql():
|
||||
if __name__ == '__main__':
|
||||
freeze_support()
|
||||
query = f"SELECT `Prozessor-Anzahl` FROM `CPU-Liste` WHERE `CPU-Name`='{cpuinfo.get_cpu_info()['brand_raw']}'"
|
||||
print(query)
|
||||
return mysql_connect.get_cpu(query,"Stines-GmbH",cpuinfo.get_cpu_info()['brand_raw'])
|
||||
|
||||
def get_ram_info():
|
||||
freeze_support()
|
||||
ram_info = psutil.virtual_memory()
|
||||
total_ram = ram_info.total / (1024 ** 3) # In Gigabytes
|
||||
return math.ceil(total_ram)
|
||||
|
||||
def get_hdd_info():
|
||||
freeze_support()
|
||||
total_disk_size = 0
|
||||
disk_partitions = psutil.disk_partitions()
|
||||
for partition in disk_partitions:
|
||||
@@ -35,10 +35,11 @@ def get_hdd_info():
|
||||
|
||||
# Informationen über die CPU
|
||||
def set_system_info(ipadress):
|
||||
freeze_support()
|
||||
query = f"UPDATE `Kunden-Server` SET RAM={get_ram_info()}, Prozessor={get_cpu_sql()[0]}, CPU='{get_cpu_info()}' WHERE `IP-Adresse`='{ipadress}'"
|
||||
mysql_connect.update_cpu(query,"Stines-GmbH")
|
||||
return print("Fin")
|
||||
|
||||
ssh_tunnel.server_start()
|
||||
set_system_info("172.19.1.5")
|
||||
ssh_tunnel.server_stop()
|
||||
# ssh_tunnel.server_start()
|
||||
# set_system_info("172.19.1.5")
|
||||
# ssh_tunnel.server_stop()
|
||||
Reference in New Issue
Block a user