def get(self): os = platform.dist() os_str = ' '.join(os) host_cpu_infos = lwp.host_cpu_infos() return dict(uptime=lwp.host_uptime(), hostname=socket.gethostname(), dist=os_str, disk_usage=lwp.host_disk_usage(), cpu=dict( usage=lwp.host_cpu_percent(), model=host_cpu_infos['name'], cores=host_cpu_infos['cores'] ), memory=lwp.host_memory_usage(), kernel=lwp.host_kernel_verion())
def refresh_disk_containers(name=None): if 'logged_in' in session: if name == 'containers': containers_running = lxc.running() containers = [] for container in containers_running: container = container.replace(' (auto)', '') containers.append({ 'name': container, 'diskusg': lwp.get_filesystem_usage(container), }) return jsonify(data=containers) elif name == 'host': return jsonify(lwp.host_disk_usage()) return jsonify({ 'diskusg': lwp.get_filesystem_usage(name), })
def refresh_disk_host(): if 'logged_in' in session: return jsonify(lwp.host_disk_usage(partition=config.get('overview', 'partition')))
def refresh_info(): return jsonify({'cpu': lwp.host_cpu_percent(), 'uptime': lwp.host_uptime(), 'disk': lwp.host_disk_usage()})
def refresh_disk_host(): return jsonify(lwp.host_disk_usage(partition=config.get('overview', 'partition')))
def refresh_info(): return jsonify({'cpu': lwp.host_cpu_percent(), 'uptime': lwp.host_uptime(), 'disk': lwp.host_disk_usage(partition=config.get('overview', 'partition'))})
def refresh_disk_host(): return jsonify(lwp.host_disk_usage())
def refresh_disk_host(): if 'logged_in' in session: return jsonify( lwp.host_disk_usage(partition=config.get('overview', 'partition')))
def refresh_info(): return jsonify({"cpu": lwp.host_cpu_percent(), "uptime": lwp.host_uptime(), "disk": lwp.host_disk_usage()})
def refresh_info(): return jsonify({ 'cpu': lwp.host_cpu_percent(), 'uptime': lwp.host_uptime(), 'disk': lwp.host_disk_usage() })