Example #1
0
def hello():
    our_response = render_template(
        'show_stats.html', 
        cpu_data=enumerate(get_cpu_stats()),
        mem_data=get_memory_stats(),
        process_list=get_process_list(),
        comments=(Commentage.query.all()),
    )

    return our_response
Example #2
0
def hello():
    our_response = render_template(
        'show_stats.html',
        cpu_data=enumerate(get_cpu_stats()),
        mem_data=get_memory_stats(),
        process_list=get_process_list(),
        comments=(Commentage.query.all()),
    )

    return our_response
def status():
    version = utils.get_package_version() or "Not Installed"
    last_sync = utils.get_appliance_config("last_sync_time") or "None"
    last_discovery = utils.get_appliance_config("last_discovery_time") or "None"
    cpu_load_average = " ".join(map(str, utils.get_cpu_load_average()))
    mem_stats = utils.get_memory_stats()
    used = mem_stats["used"] - mem_stats["buffers"] - mem_stats["cached"]
    memory_usage = "%s MB of %s MB (%s%%)" % (used, mem_stats["total"], used * 100 / mem_stats["total"])
    disc_stats = utils.get_disk_stats()
    disc_usage = "%.1f GB of %.1f GB (%s%%)" % (disc_stats["used"] / 1024.0**2, disc_stats["total"] / 1024.0**2, disc_stats["usage_percent"])
    agent_enabled = utils.is_agent_proxy_enabled()
    if agent_enabled: agent_url = utils.get_agent_proxy_url()
    return render_template('status.html', **locals())
def hello():
    our_response = render_template(
        'show_stats.html', 
        cpu_data=enumerate(get_cpu_stats(
            app.config['CPU_SAMPLER_TIME'])),
        mem_data=get_memory_stats(),
        process_list=get_process_list(),
        comments=(Commentage.query.all()),
        cpu_history=(

            CpuStats.query.order_by(
                CpuStats.created.desc()
            ).limit(50)
            
        ),
    )

    return our_response