From 475d24322457846b51b7353c16cf2c3c77950fac Mon Sep 17 00:00:00 2001 From: danielmaya Date: Mon, 7 May 2018 13:21:06 +0200 Subject: [PATCH 1/8] Added master creation in ha_cluster --- .../general/firts_task/HA_cluster_builder.php | 86 +++++++++++++++++++ pandora_console/godmode/menu.php | 3 + 2 files changed, 89 insertions(+) create mode 100644 pandora_console/general/firts_task/HA_cluster_builder.php diff --git a/pandora_console/general/firts_task/HA_cluster_builder.php b/pandora_console/general/firts_task/HA_cluster_builder.php new file mode 100644 index 0000000000..08dca65b06 --- /dev/null +++ b/pandora_console/general/firts_task/HA_cluster_builder.php @@ -0,0 +1,86 @@ + +true, 'message'=> __('There are no HA clusters defined yet.') ) ); +?> + +
+
+ __('Clusters')));?> +
+
+

+


'; + + echo __('Depending on how they provide that service, we can find two types:').'

'; + + echo __('Clusters to balance the service load: 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.').'

'; + + echo __('Clusters to guarantee service: 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.'); + + ?>

+ +
"; + ?> + + +
+ + diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 11f510349a..921466a160 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -209,6 +209,9 @@ if (check_acl ($config['id_user'], 0, "AW") || check_acl ($config['id_user'], 0, } //This subtabs are only for Pandora Admin if (check_acl ($config['id_user'], 0, "PM")) { + + enterprise_hook('ha_cluster'); + $sub["godmode/servers/manage_recontask"]["text"] = __('Recon task'); $sub["godmode/servers/manage_recontask"]["id"] = 'Recon task'; From e9b2514b33c081c7f10953bfb84e7dd6fe5526a3 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 16 May 2018 15:26:28 +0200 Subject: [PATCH 2/8] Update HA, pandoradb --- pandora_console/pandoradb.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 7c78e72903..cb04931433 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2235,6 +2235,23 @@ CREATE TABLE IF NOT EXISTS `tdashboard` ( PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tdatabase` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tdatabase` ( + `id` int(10) unsigned NOT NULL auto_increment, + `host` varchar(100) default '', + `os_port` int(4) unsigned default '22', + `os_user` varchar(100) default '', + `db_port` int(4) unsigned default '3306', + `status` tinyint(1) unsigned default '0', + `action` tinyint(1) unsigned default '0', + `master` tinyint(1) unsigned default '0', + `deployment_percent` float unsigned default 0, + `last_error` varchar(255) default '', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8 ; + -- ----------------------------------------------------- -- Table `twidget` -- ----------------------------------------------------- From d48aeb05bb5ce133de19f0d36a9af1723739518b Mon Sep 17 00:00:00 2001 From: danielmaya Date: Tue, 22 May 2018 08:39:38 +0200 Subject: [PATCH 3/8] Update HA. change of icon and text --- .../general/firts_task/HA_cluster_builder.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pandora_console/general/firts_task/HA_cluster_builder.php b/pandora_console/general/firts_task/HA_cluster_builder.php index 08dca65b06..a2ba8fcb80 100644 --- a/pandora_console/general/firts_task/HA_cluster_builder.php +++ b/pandora_console/general/firts_task/HA_cluster_builder.php @@ -26,19 +26,15 @@ ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no HA
- __('Clusters')));?> + __('Clusters')));?>


'; + echo __('With Pandora FMS Enterprise you can add high availability to your Pandora FMS installation by adding redundant MySQL servers').'

'; - echo __('Depending on how they provide that service, we can find two types:').'

'; - - echo __('Clusters to balance the service load: 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.').'

'; - - echo __('Clusters to guarantee service: 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.'); + echo __('Click on "add new node" to start transforming your Pandora FMS DB Cluster into a Pandora FMS DB Cluster.').'

'; ?>

@@ -46,7 +42,7 @@ ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no HA if(check_acl ($config['id_user'], 0, "AW")) { echo "
"; ?> - + @@ -64,7 +60,7 @@ ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no HA url: "ajax.php", success: function (data) { $("#create_master_window").dialog ({ - title: 'Agregar nodo maestro', + title: '', resizable: true, draggable: true, modal: true, From ad7e8229ed3d4496a445122164f81044f8e18fec Mon Sep 17 00:00:00 2001 From: danielmaya Date: Thu, 24 May 2018 09:02:06 +0200 Subject: [PATCH 4/8] Added check_login --- .../general/firts_task/HA_cluster_builder.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/general/firts_task/HA_cluster_builder.php b/pandora_console/general/firts_task/HA_cluster_builder.php index a2ba8fcb80..18978db402 100644 --- a/pandora_console/general/firts_task/HA_cluster_builder.php +++ b/pandora_console/general/firts_task/HA_cluster_builder.php @@ -15,7 +15,14 @@ global $config; -check_login(); +check_login (); + +if (! check_acl ($config['id_user'], 0, "PM")) { + db_pandora_audit("ACL Violation", + "Trying to access HA cluster"); + require ("general/noaccess.php"); + exit; +} ui_require_css_file ('firts_task'); ?> From 6711ff3e9c8b97930f8b10fcb13fc78da41f39bc Mon Sep 17 00:00:00 2001 From: danielmaya Date: Thu, 31 May 2018 10:30:21 +0200 Subject: [PATCH 5/8] Added ha_cluster images --- pandora_console/images/database-master.png | Bin 0 -> 573 bytes pandora_console/images/firts_task/slave-mode.png | Bin 0 -> 3035 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_console/images/database-master.png create mode 100644 pandora_console/images/firts_task/slave-mode.png diff --git a/pandora_console/images/database-master.png b/pandora_console/images/database-master.png new file mode 100644 index 0000000000000000000000000000000000000000..97de3ed99464316f5e014e3cc0546bf1e181a863 GIT binary patch literal 573 zcmV-D0>b@?P){y&IjLY4st zAXEfY(tuSNKmakq7)?9%-UBHCAP%f^zqEk`rfqK=iySY6LVv_${`go1z;CcrEP;`2~;1BS1G9xPC@{n4*z`<>y>4~Q@e$A6IH z7!Dph2o_*LGWf#1!yJu3jBcSkjDeyUi1UG10f-HtVh4cu0XD@BKpcQ(DoE@D5GR5- z00Bf=kVAd!01WN}KpJE{C=>*tQSgBQJt~po2nIlLg%S(UBm`FU{t?9aKRz;n!~@Vh z1P((i0OXVn$OOpZ2i!G821sVWKb@zeT5$gQ?Xh95edLT4YZvKrr6{ zBlN?!x6BuyhMh-GF3`xm52Y6nbSbEK0eO>y{~v>({2zudFPRxW12H<_75~csQuF#2 zD~Q_&%$W_?@(>I>fThdlm)LNI+h00000 LNkvXXu0mjf>l@l( literal 0 HcmV?d00001 diff --git a/pandora_console/images/firts_task/slave-mode.png b/pandora_console/images/firts_task/slave-mode.png new file mode 100644 index 0000000000000000000000000000000000000000..4f6ea7473da2334c9b2e9c428ceae7bd51044782 GIT binary patch literal 3035 zcmV<13ncW3P)In?NUXx9oqG3ylmd)j z=Y9#SmjxzZZ*Tt}zY*^lj!xxgP_q5baBT}W$iV*~Ls&?0u66cDFfFO~3ogb)j=vA~ z31Ef+$O}rgKNu8&PQ(W8ALc}ngM|Sj@nHb9{op~AfM=p=G=f4FpJJG^u^KQqyg4G9>BWqS9pjMHpX&WGb zhDOFB6<{f29f7I(0A9<1iFG}Y3LwWqLHR%MyoU!o06IbuS853$*SF{vgX(cm9gdci z6)@5{H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Lk46vGd$Drl!HqP$sz!>u;F7EtSMn$K zI$W;Bn{pX&v`Le^_~?oK z-1z(3Zj2z=(%cFMJ59f?=d;%#tgA*_|ILzz*V~1(R%34>c0%G+>r>Itdez;%iAw_O zv`Z;TJ2!ipFZ7X1{m@%8!q&&(23i+hnmn&<3Z8i{-S>QIPG{av^?MUhZw4MvuDF9K zgFK8rYC@IfKZS`IHdpG>&#H)_TMC`))Jy3PS!_0>)n{Bqa3d&lP>gPmyyX*|-g4Xk zJ?}cr+LO5~D-nzgYV9oPxRN=?tKf>Urp!3hN?6r8N9;NB7g=cd}if?wPQ&~?eo z#A@*5$7S_InF{*5Rin+yWZG>`2RDPQuJ`MytA&KEZoH`C2_|tm?6%#=9k*owe~Pl?VNr1tk#I8xvGHHZ;h_&?~a&kCJsfykY$ro<#r^Ia}8T<~p2Ea6-We1t%1oP;gR=;BXJRVDlM) zQ>J}azKl(ad^isJ+pN?$sAnL8NSRYrHA)F*XreSQU>yfS d2qA=&!9Rwyug(@0a;X3S002ovPDHLkV1i3>gr@)i literal 0 HcmV?d00001 From 7dfd3fcfa128271d9d98e106d5155511944b1058 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Fri, 8 Jun 2018 13:21:33 +0200 Subject: [PATCH 6/8] changes in tdatabase --- pandora_console/pandoradb.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index cb04931433..0a79019630 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2246,8 +2246,6 @@ CREATE TABLE IF NOT EXISTS `tdatabase` ( `db_port` int(4) unsigned default '3306', `status` tinyint(1) unsigned default '0', `action` tinyint(1) unsigned default '0', - `master` tinyint(1) unsigned default '0', - `deployment_percent` float unsigned default 0, `last_error` varchar(255) default '', PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8 ; From f9be72b34a3dde9528b82dc965a4537493e88e6b Mon Sep 17 00:00:00 2001 From: danielmaya Date: Tue, 12 Jun 2018 10:14:59 +0200 Subject: [PATCH 7/8] added image --- pandora_console/images/clean.disabled.png | Bin 0 -> 411 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pandora_console/images/clean.disabled.png diff --git a/pandora_console/images/clean.disabled.png b/pandora_console/images/clean.disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..c0d1d8e4d31f79795cbcda6282be8f2bdc456b51 GIT binary patch literal 411 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIY)RhkEAmObgxv%2P3ouFv$u$@~4wg?2N>}}lmVT!={ zm`AC)MjLc|4D;_-8}HU$)%E_y1No#{hk&c{**85NztHMk92lq@y7rt(?_z-+40*Mu zN;z8`ZgYD`xqqGGx_suBd9{X_PpfZxmp|1x*N|uYvbT0?0k;IRtbVc4i8;4oBRg0d zM9#K${E4bDyS~9~S^7GSCRhJ=U!zuX1#oTRYS^jJd}ig^eES)5ea|e3=Uj5(#~IsN z^|MR*-^_K`(7Ny5!+ZSG&Guap7MGd4x97s~Y!#aWvubnR@*4Yu{hznvmgY?Zhxh00 zRV{X{RJ(qC&J;;|-K+DTW<@A(Zrx+MKlETq?mid!hHqW3KK$zA0EMxqtDnm{r-UW| DO+Bl$ literal 0 HcmV?d00001 From 6f689f0d0ec59c516bb9bbfa28a00381a408807b Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 13 Jun 2018 15:39:31 +0200 Subject: [PATCH 8/8] Added mr 17 and update migrate --- pandora_console/extras/mr/17.sql | 15 +++++++++++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 pandora_console/extras/mr/17.sql diff --git a/pandora_console/extras/mr/17.sql b/pandora_console/extras/mr/17.sql new file mode 100644 index 0000000000..2b531f9eac --- /dev/null +++ b/pandora_console/extras/mr/17.sql @@ -0,0 +1,15 @@ +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `tdatabase` ( + `id` int(10) unsigned NOT NULL auto_increment, + `host` varchar(100) default '', + `os_port` int(4) unsigned default '22', + `os_user` varchar(100) default '', + `db_port` int(4) unsigned default '3306', + `status` tinyint(1) unsigned default '0', + `action` tinyint(1) unsigned default '0', + `last_error` varchar(255) default '', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8 ; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index e3572edb04..60eae1bbfe 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -208,6 +208,21 @@ CREATE TABLE IF NOT EXISTS `tdashboard` ( PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tdatabase` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tdatabase` ( + `id` int(10) unsigned NOT NULL auto_increment, + `host` varchar(100) default '', + `os_port` int(4) unsigned default '22', + `os_user` varchar(100) default '', + `db_port` int(4) unsigned default '3306', + `status` tinyint(1) unsigned default '0', + `action` tinyint(1) unsigned default '0', + `last_error` varchar(255) default '', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8 ; + -- ----------------------------------------------------- -- Table `twidget` -- -----------------------------------------------------