Merge branch '2007-Monitorizacion-de-cluster-fase-2-API-CLI' into 'develop'

Change API and flags in cluster manager - #2007

See merge request artica/pandorafms!1456
This commit is contained in:
nramon 2018-04-27 11:37:56 +02:00
commit d44b079785
3 changed files with 8 additions and 8 deletions

View File

@ -680,7 +680,7 @@ if ($agents !== false) {
echo ' onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo ' onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
} }
else{ else{
echo ' onClick="if (!confirm(\' '.__('You are going to delete a cluster agent. Are you sure?').'\')) return false;">'; echo ' onClick="if (!confirm(\' '.__('WARNING! - You are going to delete a cluster agent. Are you sure?').'\')) return false;">';
} }
echo html_print_image('images/cross.png', true, array("border" => '0')) . "</a>"; echo html_print_image('images/cross.png', true, array("border" => '0')) . "</a>";

View File

@ -10271,7 +10271,7 @@ function api_set_new_cluster($thrash1, $thrash2, $other, $thrash3) {
$id_parent_modulo = db_process_sql('select id_agente_modulo from tagente_modulo where id_agente = '.$id_agent[0]['id_agent'].' and nombre = "Cluster status"'); $id_parent_modulo = db_process_sql('select id_agente_modulo from tagente_modulo where id_agente = '.$id_agent[0]['id_agent'].' and nombre = "Cluster status"');
$get_module_type = db_process_sql('select id_tipo_modulo,descripcion,min_warning,min_critical,module_interval from tagente_modulo where nombre = "'.$element["name"].'" limit 1'); $get_module_type = db_process_sql('select id_tipo_modulo,descripcion,min_warning,min_critical,module_interval from tagente_modulo where nombre = "'.io_safe_input($element["name"]).'" limit 1');
$get_module_type_value = $get_module_type[0]['id_tipo_modulo']; $get_module_type_value = $get_module_type[0]['id_tipo_modulo'];
@ -10302,6 +10302,8 @@ function api_set_new_cluster($thrash1, $thrash2, $other, $thrash3) {
$id_module = modules_create_agent_module($values_module['id_agente'],$values_module['nombre'],$values_module); $id_module = modules_create_agent_module($values_module['id_agente'],$values_module['nombre'],$values_module);
$launch_cluster = db_process_sql('update tagente_modulo set flag = 1 where custom_integer_1 = '.$element["id_cluster"].' and nombre = "Cluster status"');
if ($tcluster_module !== false){ if ($tcluster_module !== false){
db_pandora_audit("Report management", "Module #".$element["name"]." assigned to cluster #".$element["id_cluster"]); db_pandora_audit("Report management", "Module #".$element["name"]." assigned to cluster #".$element["id_cluster"]);
} }
@ -10319,7 +10321,7 @@ function api_set_new_cluster($thrash1, $thrash2, $other, $thrash3) {
$tcluster_balanced_module = db_process_sql_insert('tcluster_item',array('name'=>$element["name"],'id_cluster'=>$element["id_cluster"],'item_type'=>"AP",'is_critical'=>$element["is_critical"])); $tcluster_balanced_module = db_process_sql_insert('tcluster_item',array('name'=>$element["name"],'id_cluster'=>$element["id_cluster"],'item_type'=>"AP",'is_critical'=>$element["is_critical"]));
$get_module_type = db_process_sql('select id_tipo_modulo,descripcion,min_warning,min_critical,module_interval from tagente_modulo where nombre = "'.$element["name"].'" limit 1'); $get_module_type = db_process_sql('select id_tipo_modulo,descripcion,min_warning,min_critical,module_interval from tagente_modulo where nombre = "'.io_safe_input($element["name"]).'" limit 1');
$get_module_type_value = $get_module_type[0]['id_tipo_modulo']; $get_module_type_value = $get_module_type[0]['id_tipo_modulo'];
@ -10369,6 +10371,8 @@ function api_set_new_cluster($thrash1, $thrash2, $other, $thrash3) {
); );
$id_module = modules_create_agent_module($values_module['id_agente'],$values_module['nombre'],$values_module); $id_module = modules_create_agent_module($values_module['id_agente'],$values_module['nombre'],$values_module);
$launch_cluster = db_process_sql('update tagente_modulo set flag = 1 where custom_integer_1 = '.$element["id_cluster"].' and nombre = "Cluster status"');
if ($tcluster_balanced_module !== false){ if ($tcluster_balanced_module !== false){
db_pandora_audit("Report management", "Module #".$element["name"]." assigned to cluster #".$element["id_cluster"]); db_pandora_audit("Report management", "Module #".$element["name"]." assigned to cluster #".$element["id_cluster"]);

View File

@ -3048,9 +3048,7 @@ create table IF NOT EXISTS `tcluster`(
`description` text not null default '', `description` text not null default '',
`group` int(10) unsigned NOT NULL default '0', `group` int(10) unsigned NOT NULL default '0',
`id_agent` int(10) unsigned NOT NULL, `id_agent` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`)
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8; ) engine=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -3078,8 +3076,6 @@ create table IF NOT EXISTS `tcluster_agent`(
`id_cluster` int unsigned not null, `id_cluster` int unsigned not null,
`id_agent` int(10) unsigned not null, `id_agent` int(10) unsigned not null,
PRIMARY KEY (`id_cluster`,`id_agent`), PRIMARY KEY (`id_cluster`,`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
ON UPDATE CASCADE,
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`) FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
ON UPDATE CASCADE ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8; ) engine=InnoDB DEFAULT CHARSET=utf8;