def host_view_post(hostname): dt_start = post_dt_start(request) dt_end = post_dt_end(request, dt_start) last_update = datetime.datetime.now() hostlist = query.hostlist() ping_table = query.host_mapreduce(hostname, 'ping', 'avg', dt_start, dt_end) iperf_table = query.host_mapreduce(hostname, 'iperf', 'bandwidth', dt_start, dt_end) return template('host_template', title=hostname, hostname=hostname, hostlist=hostlist, last_update=last_update, dt_start=query.dt_to_timestamp(dt_start), dt_end=query.dt_to_timestamp(dt_end), ping_table=ping_table, iperf_table=iperf_table)
def host_view(hostname): last_update = datetime.datetime.now() dt_start = datetime.datetime.now() - config.DT_QUERY dt_end = datetime.datetime.now() hostlist = query.hostlist() ping_table = query.host_mapreduce(hostname, 'ping', 'avg', dt_start, dt_end) iperf_table = query.host_mapreduce(hostname, 'iperf', 'bandwidth', dt_start, dt_end) logging.error(iperf_table) return template('host_template', title=hostname, hostname=hostname, hostlist=hostlist, last_update=last_update, dt_start=query.dt_to_timestamp(dt_start), dt_end=query.dt_to_timestamp(dt_end), ping_table=ping_table, iperf_table=iperf_table)
def index_view(): last_update = datetime.datetime.now() hostlist = query.hostlist() graph = json.dumps(query.graph_force()) logging.error(graph) return template('index_template', title="Overlord Monitoring", graph=graph, hostlist=hostlist, last_update=last_update)
def api_hostlist(): hostlist = query.hostlist() return {"result": hostlist}
def api_hostlist(): hostlist = query.hostlist() return {"result" : hostlist}
def index_view(): last_update = datetime.datetime.now() hostlist = query.hostlist() graph = json.dumps(query.graph_force()) logging.error(graph) return template('index_template', title="Overlord Monitoring" ,graph=graph, hostlist=hostlist, last_update=last_update)