def test_9_livesynthesis(self): print "" print "get live synthesis" # Force authentication ... connection = frontend.login("admin", "admin", force=True) assert_true(frontend.authenticated) assert_true(frontend.token) connection = frontend.connect(username="******") assert_true(frontend.authenticated) assert_true(frontend.connected) print "get live synthesis" synthesis = frontend.get_livesynthesis() print synthesis assert_true("hosts_synthesis" in synthesis) assert_true("nb_elts" in synthesis["hosts_synthesis"]) assert_true("business_impact" in synthesis["hosts_synthesis"]) assert_true("nb_up" in synthesis["hosts_synthesis"]) assert_true("nb_down" in synthesis["hosts_synthesis"]) assert_true("nb_unreachable" in synthesis["hosts_synthesis"]) assert_true("nb_acknowledged" in synthesis["hosts_synthesis"]) assert_true("nb_in_downtime" in synthesis["hosts_synthesis"]) assert_true("nb_flapping" in synthesis["hosts_synthesis"]) assert_true("nb_problems" in synthesis["hosts_synthesis"]) assert_true("pct_up" in synthesis["hosts_synthesis"]) assert_true("pct_down" in synthesis["hosts_synthesis"]) assert_true("pct_unreachable" in synthesis["hosts_synthesis"]) assert_true("pct_acknowledged" in synthesis["hosts_synthesis"]) assert_true("pct_in_downtime" in synthesis["hosts_synthesis"]) assert_true("pct_flapping" in synthesis["hosts_synthesis"]) assert_true("pct_problems" in synthesis["hosts_synthesis"]) assert_true("services_synthesis" in synthesis) assert_true("nb_elts" in synthesis["services_synthesis"]) assert_true("business_impact" in synthesis["services_synthesis"]) assert_true("nb_ok" in synthesis["services_synthesis"]) assert_true("nb_warning" in synthesis["services_synthesis"]) assert_true("nb_critical" in synthesis["services_synthesis"]) assert_true("nb_unknown" in synthesis["services_synthesis"]) assert_true("nb_acknowledged" in synthesis["services_synthesis"]) assert_true("nb_in_downtime" in synthesis["services_synthesis"]) assert_true("nb_flapping" in synthesis["services_synthesis"]) assert_true("nb_problems" in synthesis["services_synthesis"]) assert_true("pct_ok" in synthesis["services_synthesis"]) assert_true("pct_warning" in synthesis["services_synthesis"]) assert_true("pct_critical" in synthesis["services_synthesis"]) assert_true("pct_unknown" in synthesis["services_synthesis"]) assert_true("pct_acknowledged" in synthesis["services_synthesis"]) assert_true("pct_in_downtime" in synthesis["services_synthesis"]) assert_true("pct_flapping" in synthesis["services_synthesis"]) assert_true("pct_problems" in synthesis["services_synthesis"]) # Backend disconnection frontend.disconnect()
def get_livesynthesis(self): """Get live synthesis from backend""" return frontend.get_livesynthesis()