2013-03-07 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.php, godmode/reporting/reporting_builder.item_editor.php: fixed the get modules from items events for reports in metaconsole. Fixes: #3606284 * include/functions_agents.php, operation/tree.php, operation/agentes/ver_agente.php: some fixes for avoid PHP warnings. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7806 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
267de90653
commit
5978f9babf
|
@ -1,3 +1,15 @@
|
|||
2013-03-07 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/reporting/reporting_builder.php,
|
||||
godmode/reporting/reporting_builder.item_editor.php: fixed the get
|
||||
modules from items events for reports in metaconsole.
|
||||
|
||||
Fixes: #3606284
|
||||
|
||||
* include/functions_agents.php, operation/tree.php,
|
||||
operation/agentes/ver_agente.php: some fixes for avoid PHP
|
||||
warnings.
|
||||
|
||||
2013-03-07 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_events.php
|
||||
|
|
|
@ -107,6 +107,7 @@ switch ($action) {
|
|||
$show_in_two_columns = 0;
|
||||
$show_in_landscape = 0;
|
||||
$server_name = '';
|
||||
$server_id = 0;
|
||||
break;
|
||||
case 'save':
|
||||
default:
|
||||
|
@ -131,6 +132,7 @@ switch ($action) {
|
|||
$show_in_two_columns = 0;
|
||||
$show_in_landscape = 0;
|
||||
$server_name = '';
|
||||
$server_id = 0;
|
||||
$get_data_editor = false;
|
||||
break;
|
||||
}
|
||||
|
@ -626,9 +628,33 @@ html_print_input_hidden('id_item', $idItem);
|
|||
|
||||
html_print_input_hidden('id_agent', $idAgent);
|
||||
html_print_input_hidden ('server_name', $server_name);
|
||||
html_print_input_hidden ('server_id', $server_name);
|
||||
html_print_input_hidden ('id_server', '');
|
||||
|
||||
|
||||
//////////////////
|
||||
$params = array();
|
||||
$params['show_helptip'] = false;
|
||||
$params['input_name'] = 'agent';
|
||||
$params['value'] = $agent_name;
|
||||
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['selectbox_id'] = 'id_agent_module';
|
||||
$params['add_none_module'] = false;
|
||||
$params['use_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_id'] = 'hidden-id_agent';
|
||||
if ($meta) {
|
||||
//$params['input_id'] = 'agent_autocomplete';
|
||||
$params['use_input_id_server'] = true;
|
||||
$params['input_id_server_id'] = 'hidden-server_id';
|
||||
$params['metaconsole_enabled'] = true;
|
||||
$params['input_id'] = 'agent_autocomplete_events';
|
||||
$params['javascript_page'] = 'include/ajax/agent'; //'enterprise/meta/include/ajax/events.ajax';
|
||||
$params['input_name'] = 'agent_text';
|
||||
}
|
||||
ui_print_agent_autocomplete_input($params);
|
||||
//////////////////
|
||||
/*
|
||||
$params = array();
|
||||
$params['show_helptip'] = false;
|
||||
$params['input_name'] = 'agent';
|
||||
|
@ -650,12 +676,12 @@ html_print_input_hidden('id_item', $idItem);
|
|||
$params['metaconsole_enabled'] = true;
|
||||
}
|
||||
|
||||
ui_print_agent_autocomplete_input($params);
|
||||
//ui_print_agent_autocomplete_input($params);
|
||||
|
||||
// Print a specific control to metaconsole events
|
||||
if ($meta) {
|
||||
$params['input_id'] = 'agent_autocomplete_events';
|
||||
$params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax';
|
||||
$params['javascript_page'] = 'include/ajax/agent'; //'enterprise/meta/include/ajax/events.ajax';
|
||||
$params['javascript_is_function_select'] = false;
|
||||
//$params['use_hidden_input_idagent'] = false;
|
||||
$params['use_input_server'] = false;
|
||||
|
@ -663,7 +689,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||
|
||||
ui_print_agent_autocomplete_input($params);
|
||||
}
|
||||
|
||||
*/
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -709,6 +709,11 @@ switch ($action) {
|
|||
$values['id_module_group'] = get_parameter('combo_modulegroup');
|
||||
$values['id_group'] = get_parameter ('combo_group');
|
||||
$values['server_name'] = get_parameter ('server_name');
|
||||
$server_id = (int)get_parameter('server_id');
|
||||
if ($server_id != 0) {
|
||||
$connection = metaconsole_get_connection_by_id($server_id);
|
||||
$values['server_name'] = $connection['server_name'];
|
||||
}
|
||||
if ($values['server_name'] == '')
|
||||
$values['server_name'] = get_parameter ('combo_server');
|
||||
|
||||
|
@ -929,6 +934,12 @@ switch ($action) {
|
|||
$values['id_module_group'] = get_parameter('combo_modulegroup');
|
||||
$values['id_group'] = get_parameter ('combo_group');
|
||||
$values['server_name'] = get_parameter ('server_name');
|
||||
$server_id = (int)get_parameter('server_id');
|
||||
if ($server_id != 0) {
|
||||
$connection = metaconsole_get_connection_by_id($server_id);
|
||||
|
||||
$values['server_name'] = $connection['server_name'];
|
||||
}
|
||||
if ($values['server_name'] == '')
|
||||
$values['server_name'] = get_parameter ('combo_server');
|
||||
|
||||
|
|
|
@ -283,33 +283,27 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
|||
$status_sql = ' 1 = 1';
|
||||
if (isset($filter['status'])) {
|
||||
switch ($filter['status']) {
|
||||
// Normal
|
||||
case 0:
|
||||
case AGENT_MODULE_STATUS_NORMAL:
|
||||
$status_sql =
|
||||
"normal_count = total_count";
|
||||
break;
|
||||
// Warning
|
||||
case 2:
|
||||
case AGENT_MODULE_STATUS_WARNING:
|
||||
$status_sql =
|
||||
"critical_count = 0 AND warning_count > 0";
|
||||
break;
|
||||
// Critical
|
||||
case 1:
|
||||
case AGENT_MODULE_STATUS_CRITICAL_BAD:
|
||||
$status_sql =
|
||||
"critical_count > 0";
|
||||
break;
|
||||
// Unknown
|
||||
case 3:
|
||||
case AGENT_MODULE_STATUS_UNKNOW:
|
||||
$status_sql =
|
||||
"critical_count = 0 AND warning_count = 0
|
||||
AND unknown_count > 0";
|
||||
break;
|
||||
// Not normal
|
||||
case 4:
|
||||
case AGENT_MODULE_STATUS_NO_DATA:
|
||||
$status_sql = "normal_count <> total_count";
|
||||
break;
|
||||
// Not init
|
||||
case 5:
|
||||
case AGENT_MODULE_STATUS_NOT_INIT:
|
||||
$status_sql = "notinit_count = total_count";
|
||||
break;
|
||||
}
|
||||
|
@ -408,6 +402,7 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
|||
$limit_sql = " LIMIT $offset, $limit ";
|
||||
}
|
||||
$sql = sprintf("%s %s", $sql, $limit_sql);
|
||||
|
||||
if ($return)
|
||||
return $sql;
|
||||
else
|
||||
|
|
|
@ -334,6 +334,7 @@ if (is_ajax ()) {
|
|||
if (enterprise_include_once ('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
|
||||
|
||||
if ($server_id > 0) {
|
||||
$connection = metaconsole_get_connection_by_id($server_id);
|
||||
}
|
||||
|
|
|
@ -273,6 +273,9 @@ if (is_ajax ())
|
|||
|
||||
$sql = treeview_getSecondBranchSQL ($fatherType, $id, $id_father);
|
||||
$rows = db_get_all_rows_sql($sql);
|
||||
if (empty($rows)) {
|
||||
$rows = array();
|
||||
}
|
||||
$countRows = count ($rows);
|
||||
|
||||
if ($countRows === 0) {
|
||||
|
|
Loading…
Reference in New Issue