|
|
|
@ -15,7 +15,7 @@ bind_ip = ""
|
|
|
|
|
port = 8081
|
|
|
|
|
|
|
|
|
|
def generate_stats(get_processes):
|
|
|
|
|
listed_filesystems = ["ext2", "ext3", "ext4", "reiserfs", "removable", "fixed", "simfs"]
|
|
|
|
|
listed_filesystems = ["ext2", "ext3", "ext4", "reiserfs", "removable", "fixed", "simfs", "xfs"]
|
|
|
|
|
|
|
|
|
|
mem = psutil.virtual_memory()
|
|
|
|
|
swap = psutil.swap_memory()
|
|
|
|
@ -33,8 +33,10 @@ def generate_stats(get_processes):
|
|
|
|
|
"free": usage.free
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uptime = (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME))
|
|
|
|
|
|
|
|
|
|
return_data = {
|
|
|
|
|
"uptime": (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)).total_seconds(),
|
|
|
|
|
"uptime": (uptime.microseconds + (uptime.seconds + uptime.days * 24 * 3600) * 10**6) / 10**6,
|
|
|
|
|
"memory": {
|
|
|
|
|
"total": mem.total,
|
|
|
|
|
"available": mem.available,
|
|
|
|
@ -49,7 +51,8 @@ def generate_stats(get_processes):
|
|
|
|
|
"out": swap.sout
|
|
|
|
|
},
|
|
|
|
|
"disk": disks,
|
|
|
|
|
"cpu": psutil.cpu_percent(percpu=True)
|
|
|
|
|
"cpu": psutil.cpu_percent(percpu=True),
|
|
|
|
|
"load": list(os.getloadavg())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if get_processes:
|
|
|
|
|