Fixed some php notices
This commit is contained in:
parent
5d0bc28dc8
commit
468f402761
pandora_console
|
@ -1890,6 +1890,23 @@ function group_get_data ($id_user = false, $user_strict = false, $acltags, $retu
|
|||
$i = 1;
|
||||
$list[0]['_id_'] = 0;
|
||||
$list[0]['_name_'] = __('All');
|
||||
|
||||
$list[0]['_agents_unknown_'] = 0;
|
||||
$list[0]['_monitors_alerts_fired_'] = 0;
|
||||
$list[0]['_total_agents_'] = 0;
|
||||
$list[0]['_monitors_ok_'] = 0;
|
||||
$list[0]['_monitors_critical_'] = 0;
|
||||
$list[0]['_monitors_warning_'] = 0;
|
||||
$list[0]['_monitors_unknown_'] = 0;
|
||||
$list[0]['_monitors_not_init_'] = 0;
|
||||
$list[0]['_agents_not_init_'] = 0;
|
||||
|
||||
if ($mode == 'tactical') {
|
||||
$list[0]['_agents_ok_'] = 0;
|
||||
$list[0]['_agents_warning_'] = 0;
|
||||
$list[0]['_agents_critical_'] = 0;
|
||||
$list[0]['_monitors_alerts_'] = 0;
|
||||
}
|
||||
} else {
|
||||
$i = 0;
|
||||
}
|
||||
|
@ -1983,7 +2000,7 @@ function group_get_data ($id_user = false, $user_strict = false, $acltags, $retu
|
|||
$list[0]['_monitors_warning_'] += $list[$i]['_monitors_warning_'];
|
||||
$list[0]['_monitors_unknown_'] += $list[$i]['_monitors_unknown_'];
|
||||
$list[0]['_monitors_not_init_'] += $list[$i]['_monitors_not_init_'];
|
||||
$list[0]['_agents_not_init'] += $list[$i]['_agents_not_init'];
|
||||
$list[0]['_agents_not_init_'] += $list[$i]['_agents_not_init_'];
|
||||
|
||||
if ($mode == 'tactical') {
|
||||
$list[0]['_agents_ok_'] += $group_stat[0]["normal"];
|
||||
|
@ -2026,6 +2043,7 @@ function group_get_data ($id_user = false, $user_strict = false, $acltags, $retu
|
|||
$list[$i]['_agents_critical_'] = groups_agent_critical ($id, $user_strict, $id);
|
||||
$list[$i]['_monitors_alerts_'] = groups_monitor_alerts ($id, $user_strict, $id);
|
||||
|
||||
// TODO
|
||||
//~ $list[$i]["_total_checks_"]
|
||||
//~ $list[$i]["_total_alerts_"]
|
||||
|
||||
|
@ -2083,7 +2101,7 @@ function group_get_data ($id_user = false, $user_strict = false, $acltags, $retu
|
|||
$list[0]['_monitors_warning_'] += $list[$i]['_monitors_warning_'];
|
||||
$list[0]['_monitors_unknown_'] += $list[$i]['_monitors_unknown_'];
|
||||
$list[0]['_monitors_not_init_'] = $list[$i]['_monitors_not_init_'];
|
||||
$list[0]['_agents_not_init_'] += $list[$i]['_agents_not_init'];
|
||||
$list[0]['_agents_not_init_'] += $list[$i]['_agents_not_init_'];
|
||||
|
||||
if ($mode == 'tactical') {
|
||||
$list[0]['_agents_ok_'] += $list[$i]['_agents_ok_'];
|
||||
|
@ -2252,4 +2270,4 @@ function groups_get_group_deep ($id_group) {
|
|||
|
||||
return $deep;
|
||||
}
|
||||
?>
|
||||
?>
|
|
@ -52,8 +52,17 @@ if (isset ($_GET["update_netgroup"])) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($config["realtimestats"] == 0) {
|
||||
$updated_time ="<a href='index.php?sec=estado&sec2=operation/agentes/tactical&force_refresh=1'>";
|
||||
$updated_time .= __('Last update'). " : ". ui_print_timestamp (db_get_sql ("SELECT min(utimestamp) FROM tgroup_stat"), true);
|
||||
$updated_time .= "</a>";
|
||||
}
|
||||
else {
|
||||
$updated_time = __("Updated at realtime");
|
||||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__("Group view"), "images/group.png", false, "", false, $updated_time );
|
||||
ui_print_page_header (__("Group view"), "images/group.png", false, "", false, $updated_time);
|
||||
|
||||
|
||||
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
@ -117,7 +126,7 @@ if (!empty($result_groups)) {
|
|||
|
||||
// Force
|
||||
echo "<td class='group_view_data' style='text-align: center; vertica-align: middle;'>";
|
||||
if (check_acl ($config['id_user'], $id_group, "AW")) {
|
||||
if (!isset($data['_is_tag_']) && check_acl ($config['id_user'], $data['_id_'], "AW")) {
|
||||
echo '<a href="index.php?sec=estado&sec2=operation/agentes/group_view&update_netgroup='.$data['_id_'].'">' .
|
||||
html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'))) . '</a>';
|
||||
}
|
||||
|
@ -142,7 +151,11 @@ if (!empty($result_groups)) {
|
|||
|
||||
$group_name = "<b><span style='font-size: 7.5pt'>" . ui_print_truncate_text($data['_name_'], 50) . "</span></b>";
|
||||
|
||||
echo $link . $deep . $data['_iconImg_'] ." " . $group_name . "</a>";
|
||||
$item_icon = '';
|
||||
if (isset($data['_iconImg_']) && !empty($data['_iconImg_']))
|
||||
$item_icon = $data['_iconImg_'];
|
||||
|
||||
echo $link . $deep . $item_icon ." " . $group_name . "</a>";
|
||||
|
||||
echo "</td>";
|
||||
|
||||
|
@ -276,4 +289,4 @@ if (!empty($result_groups)) {
|
|||
echo "<div class='nf'>" . __('There are no defined agents') .
|
||||
"</div>";
|
||||
}
|
||||
?>
|
||||
?>
|
|
@ -54,6 +54,32 @@ ui_print_page_header (__("Tactical view"), "images/op_monitoring.png", false, ""
|
|||
$all_data = group_get_groups_list($config['id_user'], $user_strict, 'AR', true, false, 'tactical');
|
||||
|
||||
$data = array();
|
||||
$data['monitor_checks'] = 0;
|
||||
$data['monitor_not_init'] = 0;
|
||||
$data['monitor_unknown'] = 0;
|
||||
$data['monitor_ok'] = 0;
|
||||
$data['monitor_bad'] = 0;
|
||||
$data['monitor_warning'] = 0;
|
||||
$data['monitor_critical'] = 0;
|
||||
$data['monitor_not_normal'] = 0;
|
||||
$data['monitor_alerts'] = 0;
|
||||
$data['monitor_alerts_fired'] = 0;
|
||||
$data['monitor_alerts_fire_count'] = 0;
|
||||
$data['total_agents'] = 0;
|
||||
$data['total_alerts'] = 0;
|
||||
$data['total_checks'] = 0;
|
||||
$data['alerts'] = 0;
|
||||
$data['agents_unknown'] = 0;
|
||||
$data['monitor_health'] = 0;
|
||||
$data['alert_level'] = 0;
|
||||
$data['module_sanity'] = 0;
|
||||
$data['server_sanity'] = 0;
|
||||
$data['agent_ok'] = 0;
|
||||
$data['agent_warning'] = 0;
|
||||
$data['agent_critical'] = 0;
|
||||
$data['agent_unknown'] = 0;
|
||||
$data['agent_not_init'] = 0;
|
||||
$data['global_health'] = 0;
|
||||
foreach ($all_data as $item) {
|
||||
$data['monitor_checks'] += $item['_monitor_checks_'];
|
||||
$data['monitor_not_init'] += $item['_monitors_not_init_'];
|
||||
|
@ -65,10 +91,16 @@ foreach ($all_data as $item) {
|
|||
$data['monitor_not_normal'] += $item['_monitor_not_normal_'];
|
||||
$data['monitor_alerts'] += $item['_monitors_alerts_'];
|
||||
$data['monitor_alerts_fired'] += $item['_monitors_alerts_fired_'];
|
||||
$data['monitor_alerts_fire_count'] += $item['_monitor_alerts_fire_count_'];
|
||||
$data['total_agents'] += $item['_total_agents_'];
|
||||
$data['total_alerts'] += $item['_total_alerts_'];
|
||||
$data['total_checks'] += $item['_total_checks_'];
|
||||
|
||||
if (isset($item['_total_agents_']))
|
||||
$data['total_agents'] += $item['_total_agents_'];
|
||||
|
||||
if (isset($item['_total_alerts_']))
|
||||
$data['total_alerts'] += $item['_total_alerts_'];
|
||||
|
||||
if (isset($item['_total_checks_']))
|
||||
$data['total_checks'] += $item['_total_checks_'];
|
||||
|
||||
$data['alerts'] += $item['_alerts_'];
|
||||
$data['agents_unknown'] += $item['_agents_unknown_'];
|
||||
$data['monitor_health'] += $item['_monitor_health_'];
|
||||
|
@ -81,7 +113,6 @@ foreach ($all_data as $item) {
|
|||
$data['agent_unknown'] += $item['_agents_unknown_'];
|
||||
$data['agent_not_init'] += $item['_agents_not_init_'];
|
||||
$data['global_health'] += $item['_global_health_'];
|
||||
|
||||
}
|
||||
|
||||
echo '<table border=0 style="width:100%;"><tr>';
|
||||
|
@ -169,4 +200,4 @@ if ($is_admin) {
|
|||
|
||||
echo '</td>';
|
||||
echo '</tr></table>';
|
||||
?>
|
||||
?>
|
Loading…
Reference in New Issue