2012-07-23 Miguel de Dios <miguel.dedios@artica.es>

* godmode/agentes/module_manager_editor_prediction.php,
	include/functions_modules.php,
	include/functions_agents.php, operation/tree.php,
	operation/agentes/estado_agente.php: fixed typo bug in the name of
	"agetns_tree_view_status_img" for "agents_tree_view_status_img".




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6797 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-07-23 14:58:33 +00:00
parent f9cd9a04d1
commit 9892515199
6 changed files with 106 additions and 90 deletions

View File

@ -1,3 +1,11 @@
2012-07-23 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_prediction.php,
include/functions_modules.php,
include/functions_agents.php, operation/tree.php,
operation/agentes/estado_agente.php: fixed typo bug in the name of
"agetns_tree_view_status_img" for "agents_tree_view_status_img".
2012-07-20 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/db/mysql.php

View File

@ -109,8 +109,9 @@ $data[1] .= html_print_label(__("Module"),'prediction_module',true);
if($id_agente) {
$sql = "SELECT id_agente_modulo, nombre
FROM tagente_modulo
WHERE delete_pending = 0 AND history_data = 1 AND id_agente = ".$id_agente;
$data[1] .= html_print_select_from_sql($sql, 'prediction_module', $prediction_module, false, __('Select Module'), 0, true);
WHERE delete_pending = 0
AND history_data = 1 AND id_agente = ".$id_agente;
$data[1] .= html_print_select_from_sql($sql, 'prediction_module', $prediction_module, false, __('Select Module'), 0, true);
}
else {
$data[1] .= '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';

View File

@ -1630,11 +1630,12 @@ function agents_get_status($id_agent = 0, $noACLs = false) {
$filter_modules['disabled'] = 0;
$filter_modules['delete_pending'] = 0;
// Get all non disabled modules of the agent
$all_modules = db_get_all_rows_filter('tagente_modulo', $filter_modules, 'id_agente_modulo');
$all_modules = db_get_all_rows_filter('tagente_modulo',
$filter_modules, 'id_agente_modulo');
$result_modules = array();
// Skip non init modules
foreach ($all_modules as $module){
foreach ($all_modules as $module) {
if (modules_get_agentmodule_is_init($module['id_agente_modulo'])){
$modules[] = $module['id_agente_modulo'];
}
@ -1647,7 +1648,8 @@ function agents_get_status($id_agent = 0, $noACLs = false) {
$modules_status[] = modules_get_agentmodule_status($module);
$module_type = modules_get_agentmodule_type($module);
if(($module_type >= 21 && $module_type <= 23) || $module_type == 100) {
if (($module_type >= 21 && $module_type <= 23) ||
$module_type == 100) {
$modules_async++;
}
}
@ -1700,7 +1702,6 @@ function agents_get_status($id_agent = 0, $noACLs = false) {
else {
return AGENT_MODULE_STATUS_NORMAL;
}
}
/**
@ -1989,8 +1990,7 @@ function agents_tree_view_alert_img ($alert_fired) {
//Returns the status image to display tree view
function agetns_tree_view_status_img ($critical, $warning, $unknown) {
function agents_tree_view_status_img ($critical, $warning, $unknown) {
if ($critical > 0) {
return ui_print_status_image (STATUS_AGENT_CRITICAL, __('At least one module in CRITICAL status'), true);
}

View File

@ -42,7 +42,7 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent
if ($module === false)
return false;
if($forced_name !== false)
if ($forced_name !== false)
$module['nombre'] = $forced_name;
$modules = agents_get_modules ($id_destiny_agent, false,
@ -195,7 +195,7 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent
* @return True if the module was deleted. False if not.
*/
function modules_delete_agent_module ($id_agent_module) {
if(!$id_agent_module)
if (!$id_agent_module)
return false;
$where = array ('id_agent_module' => $id_agent_module);
@ -251,7 +251,7 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false
}
if ($return_tag === false){
return ERR_DB;
return ERR_DB;
}
$where = array();
@ -422,7 +422,8 @@ function modules_format_data($data)
{
if (is_numeric ($data)) {
$data = format_numeric($data, 2);
} else {
}
else {
$data = io_safe_input ($data);
}
return $data;
@ -526,7 +527,7 @@ function modules_format_delete_log4x($id)
function modules_get_agentmodule ($id_agentmodule) {
global $config;
switch ($config['dbtype']){
switch ($config['dbtype']) {
case "mysql":
case "postgresql":
return db_get_row ('tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule);
@ -768,27 +769,30 @@ function modules_get_last_down_timestamp_in_period ($id_agent_module, $period, $
switch ($config["dbtype"]) {
case "mysql":
$sql = sprintf ("SELECT MAX(`timestamp`) FROM `tevento` WHERE
event_type = 'monitor_down'
AND `id_agentmodule` = %d
AND `utimestamp` > %d
AND `utimestamp` <= %d",
$sql = sprintf ("SELECT MAX(`timestamp`)
FROM `tevento`
WHERE event_type = 'monitor_down'
AND `id_agentmodule` = %d
AND `utimestamp` > %d
AND `utimestamp` <= %d",
$id_agent_module, $datelimit, $date);
break;
case "postgresql":
$sql = sprintf ("SELECT MAX(\"timestamp\") FROM \"tevento\" WHERE
event_type = 'monitor_down'
AND \"id_agentmodule\" = %d
AND \"utimestamp\" > %d
AND \"utimestamp\" <= %d",
$sql = sprintf ("SELECT MAX(\"timestamp\")
FROM \"tevento\"
WHERE event_type = 'monitor_down'
AND \"id_agentmodule\" = %d
AND \"utimestamp\" > %d
AND \"utimestamp\" <= %d",
$id_agent_module, $datelimit, $date);
break;
case "oracle":
$sql = sprintf ("SELECT MAX(timestamp) FROM tevento WHERE
event_type = 'monitor_down'
AND id_agentmodule = %d
AND utimestamp > %d
AND utimestamp <= %d",
$sql = sprintf ("SELECT MAX(timestamp)
FROM tevento
WHERE event_type = 'monitor_down'
AND id_agentmodule = %d
AND utimestamp > %d
AND utimestamp <= %d",
$id_agent_module, $datelimit, $date);
break;
}
@ -818,19 +822,23 @@ function modules_get_monitors_in_group ($id_group) {
switch ($config["dbtype"]) {
case "mysql":
$sql = sprintf ("SELECT `tagente_modulo`.* FROM `tagente_modulo`, `ttipo_modulo`, `tagente` WHERE
`id_tipo_modulo` = `id_tipo`
$sql = sprintf ("SELECT `tagente_modulo`.*
FROM `tagente_modulo`, `ttipo_modulo`, `tagente`
WHERE `id_tipo_modulo` = `id_tipo`
AND `tagente`.`id_agente` = `tagente_modulo`.`id_agente`
AND `ttipo_modulo`.`nombre` LIKE '%%_proc'
AND `tagente`.`id_grupo` IN (%s) ORDER BY `tagente`.`nombre`", $id_group);
AND `tagente`.`id_grupo` IN (%s)
ORDER BY `tagente`.`nombre`", $id_group);
break;
case "postgresql":
case "oracle":
$sql = sprintf ("SELECT tagente_modulo.* FROM tagente_modulo, ttipo_modulo, tagente WHERE
id_tipo_modulo = id_tipo
$sql = sprintf ("SELECT tagente_modulo.*
FROM tagente_modulo, ttipo_modulo, tagente
WHERE id_tipo_modulo = id_tipo
AND tagente.id_agente = tagente_modulo.id_agente
AND ttipo_modulo.nombre LIKE '%%_proc'
AND tagente.id_grupo IN (%s) ORDER BY tagente.nombre", $id_group);
AND tagente.id_grupo IN (%s)
ORDER BY tagente.nombre", $id_group);
break;
}

View File

@ -155,8 +155,8 @@ if (check_acl ($config['id_user'], 0, "AW")) {
/* Setup tab */
$setuptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente">'
. html_print_image ("images/setup.png", true, array ("title" =>__('Setup')))
. '</a>';
. html_print_image ("images/setup.png", true, array ("title" =>__('Setup')))
. '</a>';
if($tab == 'setup')
$setuptab['active'] = true;
@ -447,9 +447,8 @@ foreach ($agents as $agent) {
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
$agent_info["status_img"] = agetns_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"]);
//Count all modules
$agent_info["modules"] = $agent_info["monitor_critical"] + $agent_info["monitor_warning"] + $agent_info["monitor_unknown"] + $agent_info["monitor_normal"];

View File

@ -425,7 +425,7 @@ if (is_ajax ())
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
$agent_info["status_img"] = agetns_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["monitor_warning"],
$agent_info["monitor_unknown"]);
@ -451,7 +451,7 @@ if (is_ajax ())
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
$agent_info["status_img"] = agetns_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["monitor_warning"],
$agent_info["monitor_unknown"]);
@ -468,7 +468,7 @@ if (is_ajax ())
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
$agent_info["status_img"] = agetns_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["monitor_warning"],
$agent_info["monitor_unknown"]);
@ -487,7 +487,7 @@ if (is_ajax ())
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
$agent_info["status_img"] = agetns_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["monitor_warning"],
$agent_info["monitor_unknown"]);
@ -506,7 +506,7 @@ if (is_ajax ())
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
$agent_info["status_img"] = agetns_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"],
$agent_info["monitor_warning"],
$agent_info["monitor_unknown"]);