2013-05-28 Sergio Martin <sergio.martin@artica.es>

* include/functions_ui.php
	include/functions.php
	include/functions_treeview.php
	operation/tree.php: Some aesthetic improvements on
	treeview, fixed some bugs and added control of the 
	access to the agents/modules/alerts details by the
	user configuration flag

	* images/page_white_text.png
	images/page_white.png
	images/pdf.png: Some icon changes

	* godmode/alerts/alert_list.list.php
	operation/agentes/alerts_status.php
	operation/agentes/alerts_status.functions.php: Prepared the 
	alerts view to be added to metaconsole



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8222 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-05-28 15:18:41 +00:00
parent a7c1f916f6
commit 84cc57d157
11 changed files with 264 additions and 137 deletions

View File

@ -1,3 +1,22 @@
2013-05-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_ui.php
include/functions.php
include/functions_treeview.php
operation/tree.php: Some aesthetic improvements on
treeview, fixed some bugs and added control of the
access to the agents/modules/alerts details by the
user configuration flag
* images/page_white_text.png
images/page_white.png
images/pdf.png: Some icon changes
* godmode/alerts/alert_list.list.php
operation/agentes/alerts_status.php
operation/agentes/alerts_status.functions.php: Prepared the
alerts view to be added to metaconsole
2013-05-28 Ramon Novoa <rnovoa@artica.es> 2013-05-28 Ramon Novoa <rnovoa@artica.es>
* godmode/setup/performance.php: Added a new help it. * godmode/setup/performance.php: Added a new help it.

View File

@ -314,7 +314,7 @@ else {
$url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente; $url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente;
} }
$table->class = 'alert_list'; $table->class = 'alert_list databox';
$table->width = '98%'; $table->width = '98%';
$table->size = array (); $table->size = array ();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1794,4 +1794,18 @@ function is_array_empty($InputVariable)
return $Result; return $Result;
} }
// Return 0 if the user hasnt access to node/detail 1 otherwise
function can_user_access_node () {
global $config;
$userinfo = get_user_info ($config['id_user']);
if (defined('METACONSOLE')) {
return $userinfo["is_admin"] == 1 ? 1 : $userinfo["metaconsole_access_node"];
}
else {
return $userinfo["is_admin"];
}
}
?> ?>

View File

@ -95,23 +95,23 @@ function treeview_printModuleTable($id_module, $server_data = false) {
$group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group); $group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
$agent_name = db_get_value('nombre', 'tagente', 'id_agente', $module['id_agente']); $agent_name = db_get_value('nombre', 'tagente', 'id_agente', $module['id_agente']);
// Actions table if (can_user_access_node ()) {
/* // Actions table
echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:100%; text-align: center;">'; echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:100%; text-align: center;">';
echo '<tr>'; echo '<tr>';
echo '<td><form id="module_detail" method="post" action="' . $console_url . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $module['id_agente'] . '&tab=data' . $url_hash . '">'; echo '<td><form id="module_detail" method="post" action="' . $console_url . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $module['id_agente'] . '&tab=data' . $url_hash . '">';
html_print_submit_button (__('Go to modules detail'), 'upd_button', false, 'class="sub search"'); html_print_submit_button (__('Go to modules detail'), 'upd_button', false, 'class="sub search"');
echo '</form></td></tr>'; echo '</form></td></tr>';
echo '</table>'; echo '</table>';
*/ }
//id_module and id_agent hidden //id_module and id_agent hidden
echo '<div id="ids" style="display:none;">'; echo '<div id="ids" style="display:none;">';
html_print_input_text('id_module', $id_module); html_print_input_text('id_module', $id_module);
html_print_input_text('id_agent', $module['id_agente']); html_print_input_text('id_agent', $module['id_agente']);
html_print_input_text('server_name', $server_name); html_print_input_text('server_name', $server_name);
echo '</div>'; echo '</div>';
return; return;
} }
@ -142,8 +142,8 @@ function treeview_printAlertsTable($id_module, $server_data = array()) {
} }
echo '<div id="id_div3" width="450px">'; echo '<div id="id_div3" width="450px">';
echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:70%">'; echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:90%">';
echo '<tr><td colspan=3 class="datos"><center><img src="images/bell.png"> '.$module_name.'</center></td></tr>'; echo '<tr><td colspan=3 class="datos"><center>' . html_print_image('images/bell.png', true) . ' ' . $module_name . '</center></td></tr>';
echo '<tr><th class="datos"><b>'.__('Template').'</b></th>'; echo '<tr><th class="datos"><b>'.__('Template').'</b></th>';
echo '<th class="datos"><b>'.__('Actions').'</b></th>'; echo '<th class="datos"><b>'.__('Actions').'</b></th>';
@ -171,13 +171,15 @@ function treeview_printAlertsTable($id_module, $server_data = array()) {
} }
echo '</table>'; echo '</table>';
// Actions table if(can_user_access_node ()) {
echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:100%; text-align: center;">'; // Actions table
echo '<tr>'; echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:90%; text-align: center;">';
echo '<td><form id="agent_detail" method="post" action="' . $console_url . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $agent_id . $url_hash . '&tab=alert" target="_blank">'; echo '<tr>';
html_print_submit_button (__('Go to alerts detail'), 'upd_button', false, 'class="sub search"'); echo '<td><form id="agent_detail" method="post" action="' . $console_url . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $agent_id . $url_hash . '&tab=alert" target="_blank">';
echo '</form></td></tr>'; html_print_submit_button (__('Go to alerts detail'), 'upd_button', false, 'class="sub search"');
echo '</table>'; echo '</form></td></tr>';
echo '</table>';
}
} }
function treeview_printTable($id_agente, $server_data = array()) { function treeview_printTable($id_agente, $server_data = array()) {
@ -223,7 +225,7 @@ function treeview_printTable($id_agente, $server_data = array()) {
} }
echo '<div id="id_div3" width="450px">'; echo '<div id="id_div3" width="450px">';
echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:70%">'; echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:90%">';
//Agent name //Agent name
echo '<tr><td class="datos"><b>'.__('Agent name').'</b></td>'; echo '<tr><td class="datos"><b>'.__('Agent name').'</b></td>';
if ($agent['disabled']) { if ($agent['disabled']) {
@ -357,17 +359,14 @@ function treeview_printTable($id_agente, $server_data = array()) {
echo '</div>'; echo '</div>';
echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:100%; text-align: center;">'; if (can_user_access_node ()) {
echo '<table cellspacing="4" cellpadding="4" border="0" class="databox" style="width:100%; text-align: center;">';
// If user has access to normal console echo '<tr>';
/* echo '<td><form id="agent_detail" method="post" action="' . $console_url . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.$url_hash.'">';
echo '<tr>'; html_print_submit_button (__('Go to agent detail'), 'upd_button', false, 'class="sub search"');
echo '<td><form id="agent_detail" method="post" action="' . $console_url . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.$url_hash.'">'; echo '</form></td></tr>';
html_print_submit_button (__('Go to agent detail'), 'upd_button', false, 'class="sub search"'); echo '</table>';
echo '</form></td></tr>'; }
*/
echo '</table>';
return; return;
} }

View File

@ -663,7 +663,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
global $config; global $config;
$actionText = ""; $actionText = "";
require_once ("include/functions_alerts.php"); require_once ($config['homedir'] . "/include/functions_alerts.php");
$isFunctionPolicies = enterprise_include_once ('include/functions_policies.php'); $isFunctionPolicies = enterprise_include_once ('include/functions_policies.php');
$id_group = (int) get_parameter ("ag_group", 0); //0 is the All group (selects all groups) $id_group = (int) get_parameter ("ag_group", 0); //0 is the All group (selects all groups)
@ -718,16 +718,18 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
$data = array (); $data = array ();
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if (!defined('METACONSOLE')) {
$policyInfo = policies_is_alert_in_policy2($alert['id'], false); if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
if ($policyInfo === false) $policyInfo = policies_is_alert_in_policy2($alert['id'], false);
$data[$index['policy']] = ''; if ($policyInfo === false)
else { $data[$index['policy']] = '';
$img = 'images/policies.png'; else {
$img = 'images/policies.png';
$data[$index['policy']] = '<a href="?sec=gpolicies&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id'] . '">' .
html_print_image($img,true, array('title' => $policyInfo['name'])) . $data[$index['policy']] = '<a href="?sec=gpolicies&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id'] . '">' .
'</a>'; html_print_image($img,true, array('title' => $policyInfo['name'])) .
'</a>';
}
} }
} }
@ -737,37 +739,50 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
$data[$index['standby']] = html_print_image ('images/bell_pause.png', true, array('title' => __('Standby on'))); $data[$index['standby']] = html_print_image ('images/bell_pause.png', true, array('title' => __('Standby on')));
} }
// Force alert execution if (!defined('METACONSOLE')) {
$data[$index['force_execution']] = ''; // Force alert execution
if ($alert["force_execution"] == 0) { $data[$index['force_execution']] = '';
$data[$index['force_execution']] = if ($alert["force_execution"] == 0) {
'<a href="'.$url.'&amp;id_alert='.$alert["id"].'&amp;force_execution=1&refr=60">' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'))) . '</a>'; $data[$index['force_execution']] =
} '<a href="'.$url.'&amp;id_alert='.$alert["id"].'&amp;force_execution=1&refr=60">' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'))) . '</a>';
else { }
$data[$index['force_execution']] = else {
'<a href="'.$url.'&amp;id_alert='.$alert["id"].'&amp;refr=60">' . html_print_image("images/refresh.png", true) . '</a>'; $data[$index['force_execution']] =
'<a href="'.$url.'&amp;id_alert='.$alert["id"].'&amp;refr=60">' . html_print_image("images/refresh.png", true) . '</a>';
}
} }
$data[$index['agent_name']] = $disabledHtmlStart; $data[$index['agent_name']] = $disabledHtmlStart;
if ($agent == 0) { if ($agent == 0) {
$data[$index['module_name']] .= $data[$index['module_name']] .=
ui_print_truncate_text(modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[&hellip;]', 'font-size: 7.2pt'); ui_print_truncate_text(isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[&hellip;]', 'font-size: 7.2pt');
} }
else { else {
if ($agent_style !== false) { if (defined('METACONSOLE')) {
$data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled . " $agent_style"); $data[$index['agent_name']] .= $alert['agent_name'];
} }
else { else {
$data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled); if ($agent_style !== false) {
$data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled . " $agent_style");
}
else {
$data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled);
}
} }
$data[$index['module_name']] = $data[$index['module_name']] =
ui_print_truncate_text (modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[&hellip;]', 'font-size: 7.2pt'); ui_print_truncate_text (isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[&hellip;]', 'font-size: 7.2pt');
} }
$data[$index['agent_name']] .= $disabledHtmlEnd; $data[$index['agent_name']] .= $disabledHtmlEnd;
$data[$index['description']] = ''; $data[$index['description']] = '';
$data[$index['template']] .= '<a class="template_details" href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$template['id'].'">'; if (defined('METACONSOLE')) {
$data[$index['template']] .= '<a class="template_details" href="' . ui_get_full_url('/', false, false, false) . '/ajax.php?page=enterprise/meta/include/ajax/tree_view.ajax&action=get_template_tooltip&id_template=' . $template['id'] . '&server_name=' . $alert['server_name'] . '">';
}
else {
$data[$index['template']] .= '<a class="template_details" href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template=' . $template['id'] . '">';
}
$data[$index['template']] .= html_print_image ('images/zoom.png', true); $data[$index['template']] .= html_print_image ('images/zoom.png', true);
$data[$index['template']] .= '</a> '; $data[$index['template']] .= '</a> ';
$actionDefault = db_get_value_sql("SELECT id_alert_action $actionDefault = db_get_value_sql("SELECT id_alert_action
@ -818,11 +833,13 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
$data[$index['status']] = ui_print_status_image($status, $title, true); $data[$index['status']] = ui_print_status_image($status, $title, true);
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (!defined('METACONSOLE')) {
$data[$index['validate']] = ''; if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$data[$index['validate']] = '';
$data[$index['validate']] .= html_print_checkbox ("validate[]", $alert["id"], false, true);
$data[$index['validate']] .= html_print_checkbox ("validate[]", $alert["id"], false, true);
}
} }
return $data; return $data;

View File

@ -35,7 +35,7 @@ function validateAlert() {
} }
function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby = false, $return = false) { function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby = false, $return = false) {
$table->width = '90%'; $table->width = '100%';
$table->data = array (); $table->data = array ();
$table->style = array (); $table->style = array ();
@ -64,7 +64,7 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st
$table->data[1][1] = html_print_input_text('free_search', $free_search, '', 20, 40, true); $table->data[1][1] = html_print_input_text('free_search', $free_search, '', 20, 40, true);
$table->data[1][2] = __('Standby'); $table->data[1][2] = __('Standby');
$table->data[1][3] = html_print_select ($alert_standby, "filter_standby", $filter_standby, '', '', '', true); $table->data[1][3] = html_print_select ($alert_standby, "filter_standby", $filter_standby, '', '', '', true);
$table->data[1][4] = html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub search"', true); $table->data[1][4] = html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub filter"', true);
$data = '<form method="post" action="'.$url.'">'; $data = '<form method="post" action="'.$url.'">';
$data .= html_print_table ($table, true); $data .= html_print_table ($table, true);

View File

@ -32,9 +32,9 @@ if (is_ajax()) {
return; return;
} }
require_once ("include/functions_agents.php"); require_once ($config['homedir'] . "/include/functions_agents.php");
require_once ('operation/agentes/alerts_status.functions.php'); require_once ($config['homedir'] . '/operation/agentes/alerts_status.functions.php');
require_once ('include/functions_users.php'); require_once ($config['homedir'] . '/include/functions_users.php');
$isFunctionPolicies = enterprise_include_once ('include/functions_policies.php'); $isFunctionPolicies = enterprise_include_once ('include/functions_policies.php');
@ -64,6 +64,7 @@ if ($flag_alert == 1 && check_acl($config['id_user'], $id_group, "AW")) {
forceExecution($id_group); forceExecution($id_group);
} }
$idAgent = get_parameter_get('id_agente', 0); $idAgent = get_parameter_get('id_agente', 0);
// Show alerts for specific agent // Show alerts for specific agent
@ -103,7 +104,12 @@ else {
$print_agent = true; $print_agent = true;
ui_print_page_header (__('Alert detail'), "images/op_alerts.png", false, "alert_validation"); if (!defined('METACONSOLE')) {
ui_print_page_header (__('Alert detail'), "images/op_alerts.png", false, "alert_validation");
}
else {
ui_meta_print_header(__("Alerts view"));
}
} }
if ($alert_validate) { if ($alert_validate) {
@ -115,6 +121,8 @@ if ($alert_validate) {
} }
} }
enterprise_hook('open_meta_frame');
if ($free_search != '') { if ($free_search != '') {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
@ -256,8 +264,16 @@ else {
$filter_alert['disabled'] = $filter; $filter_alert['disabled'] = $filter;
} }
$alerts['alerts_simple'] = agents_get_alerts_simple ($agents, if (defined('METACONSOLE')) {
$filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup); require_once ($config['homedir'] . '/enterprise/meta/include/functions_alerts_meta.php');
$alerts['alerts_simple'] = alerts_meta_get_alerts ($agents,
$filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup);
}
else {
$alerts['alerts_simple'] = agents_get_alerts_simple ($agents,
$filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup);
}
$countAlertsSimple = agents_get_alerts_simple ($agents, $filter_alert, $countAlertsSimple = agents_get_alerts_simple ($agents, $filter_alert,
false, $whereAlertSimple, false, false, $idGroup, true); false, $whereAlertSimple, false, false, $idGroup, true);
@ -268,6 +284,7 @@ if ($tab != null) {
// Filter form // Filter form
if ($print_agent) { if ($print_agent) {
echo '<br>';
ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, true),__('Alert control filter'), __('Toggle filter(s)')); ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, true),__('Alert control filter'), __('Toggle filter(s)'));
} }
@ -280,89 +297,140 @@ $table->align = array ();
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
if ($print_agent) { if ($print_agent) {
$table->head[0] = "<span title='" . __('Policy') . "'>" . __('P.') . "</span>"; if (!defined('METACONSOLE')) {
$table->head[0] = "<span title='" . __('Policy') . "'>" . __('P.') . "</span>";
}
$table->head[1] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>"; $table->head[1] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
$table->head[2] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
$table->head[3] = __('Agent') . ' ' . if (!defined('METACONSOLE')) {
'<a href="' . $url . '&sort_field=agent&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' . $table->head[2] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
'<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>'; }
$table->head[4] = __('Module') . ' ' .
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" =>$selectModuleUp)) . '</a>' . $table->head[3] = __('Agent');
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>'; $table->head[4] = __('Module');
$table->head[5] = __('Template') . ' ' . $table->head[5] = __('Template');
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" =>$selectTemplateUp)) . '</a>' .
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
$table->head[6] = __('Action'); $table->head[6] = __('Action');
$table->head[7] = __('Last fired'); $table->head[7] = __('Last fired');
$table->head[8] = __('Status'); $table->head[8] = __('Status');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (!defined('METACONSOLE')) {
$table->head[9] = __('Validate'); if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[9] = __('Validate');
$table->align[9] = 'center';
}
} }
$table->align[8] = 'center'; $table->align[8] = 'center';
$table->align[9] = 'center';
// Sort buttons are only for normal console
if (!defined('METACONSOLE')) {
$table->head[3] .= ' ' .
'<a href="' . $url . '&sort_field=agent&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' .
'<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>';
$table->head[4] .= ' ' .
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" =>$selectModuleUp)) . '</a>' .
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
$table->head[5] .= ' ' .
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" =>$selectTemplateUp)) . '</a>' .
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
}
} }
else { else {
if (!defined('METACONSOLE')) {
$table->head[0] = "<span title='" . __('Policy') . "'>" . __('P.') . "</span>";
}
$table->head[0] = "<span title='" . __('Policy') . "'>" . __('P.') . "</span>";
$table->head[1] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>"; $table->head[1] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
$table->head[2] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
$table->head[3] = __('Module') . ' ' . if (!defined('METACONSOLE')) {
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' . $table->head[2] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>'; }
$table->head[4] = __('Template') . ' ' .
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' . $table->head[3] = __('Module');
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>'; $table->head[4] = __('Template');
$table->head[5] = __('Action'); $table->head[5] = __('Action');
$table->head[6] = __('Last fired'); $table->head[6] = __('Last fired');
$table->head[7] = __('Status'); $table->head[7] = __('Status');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (!defined('METACONSOLE')) {
$table->head[8] = __('Validate'); if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[8] = __('Validate');
$table->align[8] = 'center';
}
} }
$table->align[7] = 'center'; $table->align[7] = 'center';
$table->align[8] = 'center';
// Sort buttons are only for normal console
if (!defined('METACONSOLE')) {
$table->head[3] .= ' ' .
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
$table->head[4] .= ' ' .
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
}
} }
} }
else else
{ {
if ($print_agent) { if ($print_agent) {
$table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>"; $table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
$table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>"; if (!defined('METACONSOLE')) {
$table->head[2] = __('Agent') . ' ' . $table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
'<a href="' . $url . '&sort_field=agent&sort=up">'. html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' . }
'<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>'; $table->head[2] = __('Agent');
$table->head[3] = __('Module') . ' ' . $table->head[3] = __('Module');
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' . $table->head[4] = __('Template');
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
$table->head[4] = __('Template') . ' ' .
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
$table->head[5] = __('Action'); $table->head[5] = __('Action');
$table->head[6] = __('Last fired'); $table->head[6] = __('Last fired');
$table->head[7] = __('Status'); $table->head[7] = __('Status');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (!defined('METACONSOLE')) {
$table->head[8] = __('Validate'); if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[8] = __('Validate');
$table->align[8] = 'center';
}
} }
$table->align[7] = 'center'; $table->align[7] = 'center';
$table->align[8] = 'center';
// Sort buttons are only for normal console
if (!defined('METACONSOLE')) {
$table->head[2] .= ' ' .
'<a href="' . $url . '&sort_field=agent&sort=up">'. html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' .
'<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>';
$table->head[3] .= ' ' .
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
$table->head[4] .= ' ' .
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
}
} }
else { else {
$table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>"; $table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
$table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>"; if (!defined('METACONSOLE')) {
$table->head[2] = __('Module') . ' ' . $table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' . }
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>'; $table->head[2] = __('Module');
$table->head[3] = __('Template') . ' ' . $table->head[3] = __('Template');
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
$table->head[4] = __('Action'); $table->head[4] = __('Action');
$table->head[5] = __('Last fired'); $table->head[5] = __('Last fired');
$table->head[6] = __('Status'); $table->head[6] = __('Status');
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (!defined('METACONSOLE')) {
$table->head[7] = __('Validate'); if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[7] = __('Validate');
$table->align[7] = 'center';
}
} }
$table->align[6] = 'center'; $table->align[6] = 'center';
$table->align[7] = 'center';
// Sort buttons are only for normal console
if (!defined('METACONSOLE')) {
$table->head[2] .= ' ' .
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
$table->head[3] .= ' ' .
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
}
} }
} }
@ -386,11 +454,13 @@ if (!empty ($table->data)) {
ui_pagination ($countAlertsSimple, $url, $offset_simple, 0, false, 'offset_simple'); ui_pagination ($countAlertsSimple, $url, $offset_simple, 0, false, 'offset_simple');
html_print_table ($table); html_print_table ($table);
if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "AM")) { if (!defined('METACONSOLE')) {
if (count($alerts['alerts_simple']) > 0) { if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "AM")) {
echo '<div class="action-buttons" style="width: '.$table->width.';">'; if (count($alerts['alerts_simple']) > 0) {
html_print_submit_button (__('Validate'), 'alert_validate', false, 'class="sub ok"', false); echo '<div class="action-buttons" style="width: '.$table->width.';">';
echo '</div>'; html_print_submit_button (__('Validate'), 'alert_validate', false, 'class="sub ok"', false);
echo '</div>';
}
} }
} }
@ -400,6 +470,9 @@ else {
echo '<div class="nf">'.__('No alerts found').'</div>'; echo '<div class="nf">'.__('No alerts found').'</div>';
} }
enterprise_hook('close_meta_frame');
ui_require_css_file('cluetip'); ui_require_css_file('cluetip');
ui_require_jquery_file('cluetip'); ui_require_jquery_file('cluetip');
?> ?>

View File

@ -183,10 +183,12 @@ if (is_ajax ())
$agent_info["monitor_warning"] = $row["warning_count"]; $agent_info["monitor_warning"] = $row["warning_count"];
$agent_info["monitor_unknown"] = $row["unknown_count"]; $agent_info["monitor_unknown"] = $row["unknown_count"];
$agent_info["monitor_normal"] = $row["normal_count"]; $agent_info["monitor_normal"] = $row["normal_count"];
$agent_info["monitor_notinit"] = $row["notinit_count"];
$agent_info["modules"] = $row["total_count"]; $agent_info["modules"] = $row["total_count"];
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]); $agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
$agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"], $agent_info["monitor_warning"], $agent_info["monitor_unknown"]); $agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"], $agent_info["monitor_warning"], $agent_info["monitor_unknown"].
$agent_info["modules"], $agent_info["monitor_notinit"]);
// Filter by status (only in policy view) // Filter by status (only in policy view)
if ($type == 'policies') { if ($type == 'policies') {
@ -459,15 +461,15 @@ if (is_ajax ())
$data = "<span title='".$row['datos']."' style='white-space: nowrap;'>".substr(io_safe_output($row["datos"]),0,12)."</span>"; $data = "<span title='".$row['datos']."' style='white-space: nowrap;'>".substr(io_safe_output($row["datos"]),0,12)."</span>";
echo "</span><span style='margin-left: 20px;'>"; echo "</span><span style='margin-left: 20px;'>";
if ($row['utimestamp'] != '') {
ui_print_help_tip ($row["timestamp"], '', 'images/clock2.png');
echo "&nbsp;";
}
echo $data; echo $data;
if ($row['unit'] != '') { if ($row['unit'] != '') {
echo "&nbsp;"; echo "&nbsp;";
echo '('.$row['unit'].')'; echo '('.$row['unit'].')';
} }
if ($row['utimestamp'] != '') {
echo "&nbsp;";
ui_print_help_tip ($row["timestamp"], '', 'images/clock2.png');
}
echo "</span></li>"; echo "</span></li>";
} }
echo "</ul>\n"; echo "</ul>\n";
@ -776,6 +778,7 @@ enterprise_hook('close_meta_frame');
data: "page=<?php echo $_GET['sec2']; ?>&printTable=1&id_agente=" + id_agent + "&server_name=" + server_name, data: "page=<?php echo $_GET['sec2']; ?>&printTable=1&id_agente=" + id_agent + "&server_name=" + server_name,
success: function(data) { success: function(data) {
$('#cont').html(data); $('#cont').html(data);
forced_title_callback();
} }
}); });
@ -789,6 +792,7 @@ enterprise_hook('close_meta_frame');
data: "page=<?php echo $_GET['sec2']; ?>&printAlertsTable=1&id_module=" + id_module + "&server_name=" + server_name, data: "page=<?php echo $_GET['sec2']; ?>&printAlertsTable=1&id_module=" + id_module + "&server_name=" + server_name,
success: function(data) { success: function(data) {
$('#cont').html(data); $('#cont').html(data);
forced_title_callback();
} }
}); });
} }
@ -800,6 +804,7 @@ enterprise_hook('close_meta_frame');
data: "page=<?php echo $_GET['sec2']; ?>&printModuleTable=1&id_module=" + id_module + "&server_name=" + server_name, data: "page=<?php echo $_GET['sec2']; ?>&printModuleTable=1&id_module=" + id_module + "&server_name=" + server_name,
success: function(data) { success: function(data) {
$('#cont').html(data); $('#cont').html(data);
forced_title_callback();
} }
}); });
} }
@ -831,7 +836,7 @@ enterprise_hook('close_meta_frame');
}) })
.show (); .show ();
refresh_pagination_callback (module_id, id_agent, server_name); refresh_pagination_callback (module_id, id_agent, server_name);
forced_title_callback();
} }
}); });
} }