def stats(): if 'key' not in request.form: return(jsonify(status='error', message='API Key required')), 401 if request.form['key'] == warboard_stats_key: nr_results = get_newrelic_results() pd_results = get_pingdom_results() sp_results = get_sirportly_results() return(jsonify(status='ok', pingdom_count=pd_results['total_checks'], newrelic_count=nr_results['total_checks'], resolved_tickets=sp_results['resolved_tickets'], unassigned_tickets=sp_results['unassigned_tickets'], pingdom_up=pd_results['pingdom_up'], pingdom_down=pd_results['pingdom_down'], pingdom_paused=pd_results['pingdom_paused'], pingdom_accounts=pd_results['total_pingdom_accounts'], pingdom_failed=pd_results['failed_pingdom'], pingdom_working=pd_results['working_pingdom'], newrelic_accounts=nr_results['total_newrelic_accounts'], newrelic_working=nr_results['working_newrelic'], newrelic_failed=nr_results['failed_newrelic'])) else: return(jsonify(status='error', message='Invalid Key')), 401
def warboard(): return(render_template('warboard.html', title=warboard_title, refresh_time=refresh_time(), pingdom_results=get_pingdom_results(), newrelic_results=get_newrelic_results(), sirportly_results=get_sirportly_results(), sirportly_users=sirportly_users, sirportly_user_order=sirportly_user_order, calendar_items=get_calendar_items()))