Merge branch 'ent-6532-servicios-en-meta-no-cambian-de-estado-cuando-lo-creas-con-el-prediction-server-bajado' into 'develop'

Orphan service modules + control require argument select from sql

See merge request artica/pandorafms!3571
This commit is contained in:
Daniel Rodriguez 2020-12-01 12:11:33 +01:00
commit 1425b09683
2 changed files with 25 additions and 5 deletions

View File

@ -1394,6 +1394,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
* @param mixed $size Max elements showed in select or default (size=10)
* @param integer $truncante_size Truncate size of the element, by default is set to GENERIC_SIZE_TEXT constant
* @param integer $class Class to apply.
* @param boolean $required Select is required or not.
*
* @return string HTML code if return parameter is true.
*/
@ -1411,7 +1412,8 @@ function html_print_select_from_sql(
$style=false,
$size=false,
$trucate_size=GENERIC_SIZE_TEXT,
$class=''
$class='',
$required=false
) {
global $config;
@ -1447,7 +1449,17 @@ function html_print_select_from_sql(
$disabled,
$style,
'',
$size
$size,
// Modal.
false,
// Message.
'',
// Select_all.
false,
// Simple_multiple_options.
false,
// Required.
$required
);
}
@ -4471,7 +4483,8 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['style']) === true) ? $data['style'] : false),
((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['trucate_size']) === true) ? $data['trucate_size'] : GENERIC_SIZE_TEXT),
((isset($data['class']) === true) ? $data['class'] : '')
((isset($data['class']) === true) ? $data['class'] : ''),
((isset($data['required']) === true) ? $data['required'] : false)
);
break;

View File

@ -108,13 +108,16 @@ sub data_producer ($) {
ORDER BY last_execution_try ASC ', safe_input($pa_config->{'servername'}));
}
else {
# If is metaconsole server, will evaluate orphan modules also.
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo),
tagente_modulo.flag, last_execution_try
FROM tagente, tagente_modulo, tagente_estado
WHERE ((server_name = ?)
OR (server_name = ANY(SELECT name
FROM tserver
WHERE status = 0 AND server_type = ?)))
WHERE status = 0 AND server_type = ?))
OR ((server_name = 0 OR server_name IS NULL) AND 1=?)
)
AND tagente_modulo.id_agente = tagente.id_agente
AND tagente.disabled = 0
AND tagente_modulo.disabled = 0
@ -123,7 +126,11 @@ sub data_producer ($) {
AND tagente_modulo.id_modulo = 5
AND (tagente_modulo.flag = 1
OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
ORDER BY last_execution_try ASC', safe_input($pa_config->{'servername'}), PREDICTIONSERVER);
ORDER BY last_execution_try ASC',
safe_input($pa_config->{'servername'}),
PREDICTIONSERVER,
is_metaconsole($pa_config)
);
}
foreach my $row (@rows) {