|
|
@ -15,7 +15,7 @@ bind_ip = ""
|
|
|
|
port = 8081
|
|
|
|
port = 8081
|
|
|
|
|
|
|
|
|
|
|
|
def generate_stats(get_processes):
|
|
|
|
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()
|
|
|
|
mem = psutil.virtual_memory()
|
|
|
|
swap = psutil.swap_memory()
|
|
|
|
swap = psutil.swap_memory()
|
|
|
@ -33,8 +33,10 @@ def generate_stats(get_processes):
|
|
|
|
"free": usage.free
|
|
|
|
"free": usage.free
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uptime = (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME))
|
|
|
|
|
|
|
|
|
|
|
|
return_data = {
|
|
|
|
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": {
|
|
|
|
"memory": {
|
|
|
|
"total": mem.total,
|
|
|
|
"total": mem.total,
|
|
|
|
"available": mem.available,
|
|
|
|
"available": mem.available,
|
|
|
@ -49,7 +51,8 @@ def generate_stats(get_processes):
|
|
|
|
"out": swap.sout
|
|
|
|
"out": swap.sout
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"disk": disks,
|
|
|
|
"disk": disks,
|
|
|
|
"cpu": psutil.cpu_percent(percpu=True)
|
|
|
|
"cpu": psutil.cpu_percent(percpu=True),
|
|
|
|
|
|
|
|
"load": list(os.getloadavg())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if get_processes:
|
|
|
|
if get_processes:
|
|
|
|