Fixed in the report item of sql query in metaconsole. TICKET: #2319

This commit is contained in:
mdtrooper 2015-08-17 14:54:48 +02:00
parent 6658104e84
commit c062bd6a6f
2 changed files with 29 additions and 11 deletions

View File

@ -440,7 +440,9 @@ switch ($action) {
case 'event_report_module':
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
$idAgent = db_get_value_filter('id_agente',
'tagente_modulo',
array('id_agente_modulo' => $idAgentModule));
$period = $item['period'];
break;
case 'general':

View File

@ -1199,8 +1199,32 @@ switch ($action) {
$values['text'] = get_parameter('text');
$values['show_graph'] = get_parameter('combo_graph_options');
$good_format = true;
break;
}
$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');
if (is_metaconsole()) {
// For SQL Query check if it is setted in the meta
if ($values['type'] == "sql") {
if (empty($values['server_name'])) {
$good_format = false;
}
}
}
$values['id_agent'] = get_parameter('id_agent');
$values['id_gs'] = get_parameter('id_custom_graph');
if (($values['type'] == 'alert_report_agent') or ($values['type'] == 'event_report_agent') or ($values['type'] == 'agent_configuration') or ($values['type'] == 'group_configuration'))
@ -1247,15 +1271,7 @@ switch ($action) {
$values['exception_condition_value'] = get_parameter('exception_condition_value');
$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');
if ((($values['type'] == 'custom_graph') or ($values['type'] == 'automatic_custom_graph')) && ($values['id_gs'] == 0 || $values['id_gs'] == '')) {
$resultOperationDB = false;