2012-05-22 Sergio Martin <sergio.martin@artica.es>
* include/functions_reporting.php include/ajax/agent.php include/functions_io.php include/constants.php operation/agentes/ver_agente.php godmode/groups/group_list.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.item_editor.php: Change the metaconsole error controls to adapt the calls to last changes Clean code git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6334 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3cdf47e5b6
commit
d777cd8f94
|
@ -1,3 +1,17 @@
|
|||
2012-05-22 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_reporting.php
|
||||
include/ajax/agent.php
|
||||
include/functions_io.php
|
||||
include/constants.php
|
||||
operation/agentes/ver_agente.php
|
||||
godmode/groups/group_list.php
|
||||
godmode/reporting/reporting_builder.list_items.php
|
||||
godmode/reporting/graph_builder.graph_editor.php
|
||||
godmode/reporting/reporting_builder.item_editor.php: Change the
|
||||
metaconsole error controls to adapt the calls to last changes
|
||||
Clean code
|
||||
|
||||
2012-05-22 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* include/functions_ui.php: Added definition for module unknown.
|
||||
|
|
|
@ -100,7 +100,7 @@ if (is_ajax ()) {
|
|||
|
||||
$connection_result = enterprise_hook('metaconsole_load_external_db', array($connection_data));
|
||||
|
||||
if ($connection_result) {
|
||||
if ($connection_result == NOERR) {
|
||||
$agents_tmp = agents_get_group_agents ($id_group, $filter, "none", false, $recursion);
|
||||
|
||||
if ($agents_tmp === false)
|
||||
|
|
|
@ -144,7 +144,7 @@ echo "</tr><tr>";
|
|||
|
||||
$connection_result = enterprise_hook('metaconsole_load_external_db', array($connection_data));
|
||||
|
||||
if ($connection_result) {
|
||||
if ($connection_result == NOERR) {
|
||||
$agents_tmp = agents_get_group_agents ();
|
||||
|
||||
if ($agents_tmp === false)
|
||||
|
|
|
@ -97,7 +97,7 @@ switch ($action) {
|
|||
// Metaconsole db connection
|
||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
}
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||
$connection = metaconsole_get_connection($server_name);
|
||||
$agent_name = '';
|
||||
|
||||
if (metaconsole_load_external_db($connection))
|
||||
if (metaconsole_load_external_db($connection) == NOERR)
|
||||
$agent_name = db_get_value_filter('nombre', 'tagente', array('id_agente' => $idAgent));
|
||||
|
||||
//Restore db connection
|
||||
|
@ -509,7 +509,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||
if ($config['metaconsole'] == 1) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
|
||||
if (metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) == NOERR) {
|
||||
$agent_name_temp = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($agent_name_temp === false)
|
||||
|
@ -811,7 +811,7 @@ function print_SLA_list($width, $action, $idItem = null) {
|
|||
// Metaconsole db connection
|
||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -906,7 +906,7 @@ function print_General_list($width, $action, $idItem = null) {
|
|||
// Metaconsole db connection
|
||||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ foreach ($items as $item) {
|
|||
if (($config ['metaconsole'] == 1) && ($server_name != '')) {
|
||||
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
// Don't skip SLA or top N or general report items
|
||||
if (($item['type'] != 'SLA') and ($item['type'] != 'top_n') and ($item['type'] != 'general')
|
||||
|
|
|
@ -94,7 +94,7 @@ elseif ($search_agents && ($config['metaconsole'] == 1)) {
|
|||
}
|
||||
|
||||
foreach ($servers as $server) {
|
||||
if (!metaconsole_load_external_db ($server)) {
|
||||
if (metaconsole_load_external_db ($server) != NOERR) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ elseif ($search_agents_2 && ($config['metaconsole'] == 1)) {
|
|||
}
|
||||
|
||||
foreach ($servers as $server) {
|
||||
if (!metaconsole_load_external_db ($server)) {
|
||||
if (metaconsole_load_external_db ($server) != NOERR) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,10 +31,13 @@ define ('AGENT_ENABLED',0);
|
|||
define ('AGENT_DISABLED',1);
|
||||
|
||||
/* Error report codes */
|
||||
define ('NOERR',11111);
|
||||
define ('ERR_GENERIC',-10000);
|
||||
define ('ERR_EXIST',-20000);
|
||||
define ('ERR_INCOMPLETE', -30000);
|
||||
define ('ERR_DB', -40000);
|
||||
define ('ERR_DB_HOST', -40001);
|
||||
define ('ERR_DB_DB', -40002);
|
||||
define ('ERR_FILE', -50000);
|
||||
define ('ERR_NOCHANGES', -60000);
|
||||
define ('ERR_NODATA', -70000);
|
||||
|
|
|
@ -327,17 +327,17 @@ function __ ($string /*, variable arguments */) {
|
|||
|
||||
global $config;
|
||||
|
||||
if ($config['enterprise_installed']) {
|
||||
if (isset($config['translate_string_extension_installed']) && $config['translate_string_extension_installed'] == 1) {
|
||||
if (array_key_exists('translate_string.php', $extensions)) {
|
||||
enterprise_include_once('extensions/translate_string/functions.php');
|
||||
if ($config['enterprise_installed'] &&
|
||||
isset($config['translate_string_extension_installed']) &&
|
||||
$config['translate_string_extension_installed'] == 1 &&
|
||||
array_key_exists('translate_string.php', $extensions)) {
|
||||
|
||||
enterprise_include_once('extensions/translate_string/functions.php');
|
||||
|
||||
$tranlateString = get_defined_translation($string);
|
||||
$tranlateString = get_defined_translation($string);
|
||||
|
||||
if ($tranlateString !== false) {
|
||||
return $tranlateString;
|
||||
}
|
||||
}
|
||||
if ($tranlateString !== false) {
|
||||
return $tranlateString;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2226,7 +2226,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $content ['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
}
|
||||
}
|
||||
|
@ -2504,7 +2504,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
//Metaconsole connection
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -3324,7 +3324,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $row ['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -3453,7 +3453,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $general ['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -3500,7 +3500,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $g ['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -3565,7 +3565,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $generals[$i]['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -3605,7 +3605,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $g['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -3723,7 +3723,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $row['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -3990,7 +3990,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $exceptions[$i]['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -4013,7 +4013,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
|
|||
$server_name = $exc['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ if (is_ajax ()) {
|
|||
|
||||
//Metaconsole db connection
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (!metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
//ui_print_error_message ("Error connecting to ".$server_name);
|
||||
continue;
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ if (is_ajax ()) {
|
|||
if ($config ['metaconsole'] == 1) {
|
||||
if (enterprise_include_once ('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection)) {
|
||||
if (metaconsole_load_external_db($connection) == NOERR) {
|
||||
/* Get all agents if no agent was given */
|
||||
if ($id_agent == 0)
|
||||
$id_agent = array_keys (agents_get_group_agents (array_keys (users_get_groups ()), $search, "none"));
|
||||
|
|
Loading…
Reference in New Issue