Merge branch '1748-Sistema-de-gestión-de-Clusters' into 'develop'
1748 sistema de gestión de clusters See merge request artica/pandorafms!1279
This commit is contained in:
commit
9531984eac
|
@ -1486,3 +1486,50 @@ ALTER TABLE `tdashboard` ADD COLUMN `cells_slideshow` TINYINT(1) NOT NULL defaul
|
|||
-- ---------------------------------------------------------------------
|
||||
SELECT max(unified_filters_id) INTO @max FROM tsnmp_filter;
|
||||
UPDATE tsnmp_filter tsf,(SELECT @max:= @max) m SET tsf.unified_filters_id = @max:= @max + 1 where tsf.unified_filters_id=0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`cluster_type` enum('AA','AP') not null default 'AA',
|
||||
`description` text not null default '',
|
||||
`group` int(10) unsigned NOT NULL default '0',
|
||||
`id_agent` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_item`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_item`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`item_type` enum('AA','AP') not null default 'AA',
|
||||
`critical_limit` int unsigned NOT NULL default '0',
|
||||
`warning_limit` int unsigned NOT NULL default '0',
|
||||
`is_critical` tinyint(2) unsigned NOT NULL default '0',
|
||||
`id_cluster` int unsigned,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_agent`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_agent`(
|
||||
`id_cluster` int unsigned not null,
|
||||
`id_agent` int(10) unsigned not null,
|
||||
PRIMARY KEY (`id_cluster`,`id_agent`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Inventory");
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
}
|
||||
|
||||
ui_require_css_file ('firts_task');
|
||||
?>
|
||||
<?php
|
||||
|
||||
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no clusters defined yet.') ) );
|
||||
?>
|
||||
|
||||
<div class="new_task_cluster">
|
||||
<div class="image_task_cluster">
|
||||
<?php echo html_print_image('images/firts_task/icono-cluster-activo.png', true, array("title" => __('Clusters')));?>
|
||||
</div>
|
||||
<div class="text_task_cluster">
|
||||
<h3> <?php echo __('Create Cluster'); ?></h3>
|
||||
<p id="description_task"> <?php
|
||||
|
||||
echo __('A cluster is a group of devices that provide the same service in high availability.').'<br><br>';
|
||||
|
||||
echo __('Depending on how they provide that service, we can find two types:').'<br><br>';
|
||||
|
||||
echo __('<b>Clusters to balance the service load</b>: these are active - active (A/A) mode clusters. It means that all the nodes (or machines that compose it) are working. They must be working because if one stops working, it will overload the others.').'<br><br>';
|
||||
|
||||
echo __('<b>Clusters to guarantee service</b>: these are active - passive (A/P) mode clusters. It means that one of the nodes (or machines that make up the cluster) will be running (primary) and another won\'t (secondary). When the primary goes down, the secondary must take over and give the service instead. Although many of the elements of this cluster are active-passive, it will also have active elements in both of them that indicate that the passive node is "online", so that in the case of a service failure in the master, the active node collects this information.');
|
||||
|
||||
?></p>
|
||||
<form action="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_builder&step=1" method="post">
|
||||
<input style="margin-bottom:20px;" type="submit" class="button_task" value="<?php echo __('Create Cluster'); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 850 B |
Binary file not shown.
After Width: | Height: | Size: 659 B |
|
@ -472,6 +472,7 @@ if ($list_modules) {
|
|||
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
|
||||
|
||||
$id_agente = $id_agent = (int)get_parameter('id_agente', 0);
|
||||
$show_notinit = (int)get_parameter('show_notinit', 0);
|
||||
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agent;
|
||||
$selectTypeUp = '';
|
||||
$selectTypeDown = '';
|
||||
|
@ -592,6 +593,13 @@ if ($list_modules) {
|
|||
if (!empty($status_text_monitor)) {
|
||||
$status_text_monitor_sql .= $status_text_monitor . '%';
|
||||
}
|
||||
|
||||
if(!$show_notinit){
|
||||
$monitor_filter = AGENT_MODULE_STATUS_NO_DATA;
|
||||
}
|
||||
else{
|
||||
$monitor_filter = -15;
|
||||
}
|
||||
|
||||
//Count monitors/modules
|
||||
switch ($config["dbtype"]) {
|
||||
|
@ -610,7 +618,7 @@ if ($list_modules) {
|
|||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tagente_modulo.id_module_group , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
break;
|
||||
case "postgresql":
|
||||
|
@ -632,7 +640,7 @@ if ($list_modules) {
|
|||
tagente_modulo.nombre
|
||||
ORDER BY tagente_modulo.id_module_group , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql,
|
||||
$tags_sql, AGENT_MODULE_STATUS_NO_DATA,$status_module_group_filter,$order['field'],
|
||||
$tags_sql, $monitor_filter,$status_module_group_filter,$order['field'],
|
||||
$order['order']);
|
||||
break;
|
||||
case "oracle":
|
||||
|
@ -650,7 +658,7 @@ if ($list_modules) {
|
|||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tagente_modulo.id_module_group , %s %s
|
||||
", $id_agente, $status_text_monitor_sql, $status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
", $id_agente, $status_text_monitor_sql, $status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter,$order['field'], $order['order']);
|
||||
break;
|
||||
}
|
||||
|
@ -679,7 +687,7 @@ if ($list_modules) {
|
|||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tmodule_group.name , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
|
||||
break;
|
||||
|
@ -698,7 +706,7 @@ if ($list_modules) {
|
|||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tmodule_group.name , %s %s",
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
break;
|
||||
// If Dbms is Oracle then field_list in sql statement has to be recoded. See oracle_list_all_field_table()
|
||||
|
@ -721,7 +729,7 @@ if ($list_modules) {
|
|||
AND tagente_estado.estado != %d
|
||||
AND tagente_modulo.%s
|
||||
ORDER BY tmodule_group.name , %s %s
|
||||
", $id_agente, $status_text_monitor_sql, $tags_sql, $status_filter_sql, AGENT_MODULE_STATUS_NO_DATA,
|
||||
", $id_agente, $status_text_monitor_sql, $tags_sql, $status_filter_sql, $monitor_filter,
|
||||
$status_module_group_filter, $order['field'], $order['order']);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -315,12 +315,15 @@ define ('MODULE_PLUGIN', 4);
|
|||
define ('MODULE_PREDICTION', 5);
|
||||
define ('MODULE_WMI', 6);
|
||||
define ('MODULE_WEB', 7);
|
||||
define ('MODULE_WUX', 8);
|
||||
define ('MODULE_WUX', 8);
|
||||
|
||||
/* Type of Modules of Prediction */
|
||||
define ('MODULE_PREDICTION_SERVICE', 2);
|
||||
define ('MODULE_PREDICTION_SYNTHETIC', 3);
|
||||
define ('MODULE_PREDICTION_NETFLOW', 4);
|
||||
define ('MODULE_PREDICTION_CLUSTER', 5);
|
||||
define ('MODULE_PREDICTION_CLUSTER_AA', 6);
|
||||
define ('MODULE_PREDICTION_CLUSTER_AP', 7);
|
||||
|
||||
/* SNMP CONSTANTS */
|
||||
define('SNMP_DIR_MIBS', "attachment/mibs");
|
||||
|
|
|
@ -1649,6 +1649,11 @@ function modules_is_unit_macro($macro) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function modules_get_last_contact ($id_agentmodule) {
|
||||
return db_get_value ('utimestamp', 'tagente_estado',
|
||||
'id_agente_modulo', $id_agentmodule);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current value of an agent module.
|
||||
*
|
||||
|
|
|
@ -74,4 +74,8 @@ function os_get_os() {
|
|||
|
||||
return $op_systems;
|
||||
}
|
||||
|
||||
function os_get_icon($id_os) {
|
||||
return db_get_value ('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -7,6 +7,18 @@
|
|||
background-color: #ececec;
|
||||
border-radius: 3px 3px 3px 3px;
|
||||
}
|
||||
div.new_task_cluster
|
||||
{
|
||||
margin-top: 30px;
|
||||
left: 20px;
|
||||
width: 60%;
|
||||
border-radius: 3px 3px 3px 3px;
|
||||
}
|
||||
|
||||
div.new_task_cluster, div.new_task_cluster > div
|
||||
{
|
||||
background-color: #ececec;
|
||||
}
|
||||
|
||||
.title_task
|
||||
{
|
||||
|
@ -24,6 +36,14 @@
|
|||
height:100%;
|
||||
float:left;
|
||||
}
|
||||
.image_task_cluster
|
||||
{
|
||||
width:20%;
|
||||
height:100%;
|
||||
float:left;
|
||||
margin-left: 50px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
.image_task>img {
|
||||
margin-top: 35%;
|
||||
margin-left: 15%;
|
||||
|
@ -36,6 +56,14 @@
|
|||
height: 100%;
|
||||
padding-right: 25px;
|
||||
}
|
||||
.text_task_cluster
|
||||
{
|
||||
width: 70%;
|
||||
height: 100%;
|
||||
padding-right: 25px;
|
||||
margin-left:270px;
|
||||
padding-top:10px;
|
||||
}
|
||||
.text_task>p
|
||||
{
|
||||
margin-top: 4%;
|
||||
|
|
|
@ -4455,3 +4455,11 @@ form ul.form_flex li ul li{
|
|||
height: 50px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#modal_module_popup_close:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal_module_list:hover{
|
||||
cursor: pointer;
|
||||
}
|
|
@ -105,6 +105,8 @@ if (!empty($sub2)) {
|
|||
$sub["snmpconsole"]["subtype"] = "nolink";
|
||||
}
|
||||
|
||||
enterprise_hook ('cluster_menu');
|
||||
|
||||
if (!empty($sub)) {
|
||||
$menu_operation["estado"]["text"] = __('Monitoring');
|
||||
$menu_operation["estado"]["sec2"] = "operation/agentes/tactical";
|
||||
|
|
|
@ -382,6 +382,7 @@ $autorefresh_list_out['operation/snmpconsole/snmp_view'] = "snmp_view";
|
|||
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = "networkmap";
|
||||
$autorefresh_list_out['operation/visual_console/render_view'] = "render_view";
|
||||
$autorefresh_list_out['operation/events/events'] = "events";
|
||||
$autorefresh_list_out['enterprise/godmode/reporting/cluster_view'] = "cluster_view";
|
||||
|
||||
if(!isset($autorefresh_list)){
|
||||
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
|
||||
|
|
|
@ -3033,3 +3033,51 @@ CREATE TABLE IF NOT EXISTS `treset_pass` (
|
|||
`reset_time` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`cluster_type` enum('AA','AP') not null default 'AA',
|
||||
`description` text not null default '',
|
||||
`group` int(10) unsigned NOT NULL default '0',
|
||||
`id_agent` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_item`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_item`(
|
||||
`id` int unsigned not null auto_increment,
|
||||
`name` tinytext not null default '',
|
||||
`item_type` enum('AA','AP') not null default 'AA',
|
||||
`critical_limit` int unsigned NOT NULL default '0',
|
||||
`warning_limit` int unsigned NOT NULL default '0',
|
||||
`is_critical` tinyint(2) unsigned NOT NULL default '0',
|
||||
`id_cluster` int unsigned,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcluster_agent`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
create table IF NOT EXISTS `tcluster_agent`(
|
||||
`id_cluster` int unsigned not null,
|
||||
`id_agent` int(10) unsigned not null,
|
||||
PRIMARY KEY (`id_cluster`,`id_agent`),
|
||||
FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
|
||||
ON UPDATE CASCADE,
|
||||
FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
|
||||
ON UPDATE CASCADE
|
||||
) engine=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
|
@ -141,7 +141,8 @@ INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES
|
|||
(17, 'Router', 'Generic router', 'so_router.png'),
|
||||
(18, 'Switch', 'Generic switch', 'so_switch.png'),
|
||||
(19, 'Satellite', 'Satellite agent', 'satellite.png'),
|
||||
(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png');
|
||||
(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png'),
|
||||
(21, 'Cluster', 'Cluster agent', 'so_cluster.png');
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
|
|
|
@ -196,6 +196,27 @@ sub exec_prediction_module ($$$$) {
|
|||
return;
|
||||
}
|
||||
|
||||
# Cluster status module.
|
||||
if ($agent_module->{'prediction_module'} == 5) {
|
||||
logger ($pa_config, "Executing cluster status module " . $agent_module->{'nombre'}, 10);
|
||||
enterprise_hook ('exec_cluster_status_module', [$pa_config, $agent_module, $server_id, $dbh]);
|
||||
return;
|
||||
}
|
||||
|
||||
# Cluster active-active module.
|
||||
if ($agent_module->{'prediction_module'} == 6) {
|
||||
logger ($pa_config, "Executing cluster active-active module " . $agent_module->{'nombre'}, 10);
|
||||
enterprise_hook ('exec_cluster_aa_module', [$pa_config, $agent_module, $server_id, $dbh]);
|
||||
return;
|
||||
}
|
||||
|
||||
# Cluster active-passive module.
|
||||
if ($agent_module->{'prediction_module'} == 7) {
|
||||
logger ($pa_config, "Executing cluster active-passive module " . $agent_module->{'nombre'}, 10);
|
||||
enterprise_hook ('exec_cluster_ap_module', [$pa_config, $agent_module, $server_id, $dbh]);
|
||||
return;
|
||||
}
|
||||
|
||||
# Get a full hash for target agent_module record reference ($target_module)
|
||||
my $target_module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $agent_module->{'custom_integer_1'});
|
||||
return unless defined $target_module;
|
||||
|
|
Loading…
Reference in New Issue