Esempio n. 1
0
 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())
Esempio n. 2
0
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),
        })
Esempio n. 3
0
def refresh_disk_host():
    if 'logged_in' in session:
        return jsonify(lwp.host_disk_usage(partition=config.get('overview', 'partition')))
Esempio n. 4
0
def refresh_info():
    return jsonify({'cpu': lwp.host_cpu_percent(),
                    'uptime': lwp.host_uptime(),
                    'disk': lwp.host_disk_usage()})
Esempio n. 5
0
def refresh_disk_host():
    return jsonify(lwp.host_disk_usage(partition=config.get('overview', 'partition')))
Esempio n. 6
0
def refresh_info():
    return jsonify({'cpu': lwp.host_cpu_percent(),
            'uptime': lwp.host_uptime(),
            'disk': lwp.host_disk_usage(partition=config.get('overview', 'partition'))})
Esempio n. 7
0
def refresh_disk_host():
    return jsonify(lwp.host_disk_usage())
Esempio n. 8
0
def refresh_disk_host():
    if 'logged_in' in session:
        return jsonify(
            lwp.host_disk_usage(partition=config.get('overview', 'partition')))
Esempio n. 9
0
def refresh_info():
    return jsonify({"cpu": lwp.host_cpu_percent(), "uptime": lwp.host_uptime(), "disk": lwp.host_disk_usage()})
Esempio n. 10
0
def refresh_info():
    return jsonify({
        'cpu': lwp.host_cpu_percent(),
        'uptime': lwp.host_uptime(),
        'disk': lwp.host_disk_usage()
    })