From 816b9697412cfc6a64605448166d2d7a68915fe9 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Thu, 6 Sep 2018 16:48:18 +0200 Subject: [PATCH 01/28] Added table tlog_graph_models --- pandora_console/extras/mr/20.sql | 9 +++++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 12 ++++++++++++ pandora_console/pandoradb.sql | 12 ++++++++++++ 3 files changed, 33 insertions(+) diff --git a/pandora_console/extras/mr/20.sql b/pandora_console/extras/mr/20.sql index 94e55dcf83..8b903e45ba 100644 --- a/pandora_console/extras/mr/20.sql +++ b/pandora_console/extras/mr/20.sql @@ -16,4 +16,13 @@ ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_status_type` ENUM ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0; ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0; +CREATE TABLE IF NOT EXISTS `tlog_graph_models` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `title` TEXT NOT NULL, + `regexp` TEXT NOT NULL, + `fields` TEXT NOT NULL, + `average` tinyint(1) NOT NULL default '0', + 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 88478f5c9b..5a9f16b870 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 @@ -1768,3 +1768,15 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( PRIMARY KEY(`id`), FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tlog_graph_models` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlog_graph_models` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `title` TEXT NOT NULL, + `regexp` TEXT NOT NULL, + `fields` TEXT NOT NULL, + `average` tinyint(1) NOT NULL default '0', + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index f8eaf58854..0a0227b4ac 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3327,3 +3327,15 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( PRIMARY KEY(`id`), FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tlog_graph_models` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlog_graph_models` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `title` TEXT NOT NULL, + `regexp` TEXT NOT NULL, + `fields` TEXT NOT NULL, + `average` tinyint(1) NOT NULL default '0', + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; From 39673ed93ab684eefcfbf59e1ac0db9e8b960f36 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Fri, 7 Sep 2018 14:15:21 +0200 Subject: [PATCH 02/28] Added class modaldeletebutton in pandora.css --- pandora_console/include/styles/pandora.css | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 7ffd0d59a4..8cdfa3a9e7 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3709,6 +3709,57 @@ div.simple_value > a > span.text p color:white; } +.modaldeletebutton{ + transition-property: background-color, color; + transition-duration: 1s; + transition-timing-function: ease-out; + -webkit-transition-property: background-color, color; + -webkit-transition-duration: 1s; + -o-transition-property: background-color, color; + -o-transition-duration: 1s; + cursor:pointer; + text-align:center; + margin-left:45px; + float:left; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + margin-bottom:30px; + border-radius: 3px;width:90px;height:30px;background-color:white;border: 1px solid #FA5858; +} + +.modaldeletebuttontext{ + transition-property: background-color, color; + transition-duration: 1s; + transition-timing-function: ease-out; + -webkit-transition-property: background-color, color; + -webkit-transition-duration: 1s; + -o-transition-property: background-color, color; + -o-transition-duration: 1s; + color:#FA5858;font-family:Nunito;font-size:10pt;position:relative;top:6px; +} + +.modaldeletebutton:hover .modaldeletebuttontext { + transition-property: background-color, color; + transition-duration: 1s; + transition-timing-function: ease-out; + -webkit-transition-property: background-color, color; + -webkit-transition-duration: 1s; + -o-transition-property: background-color, color; + -o-transition-duration: 1s; + color:white; +} + +.modaldeletebutton:hover { + transition-property: background-color, color; + transition-duration: 1s; + transition-timing-function: ease-out; + -webkit-transition-property: background-color, color; + -webkit-transition-duration: 1s; + -o-transition-property: background-color, color; + -o-transition-duration: 1s; + background-color:#FA5858; +} + .modalgobutton{ transition-property: background-color, color; transition-duration: 1s; From 98b29078574261d637f70395e7a603cd7e3ccd0a Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 12 Sep 2018 16:16:04 +0200 Subject: [PATCH 03/28] Bug fixes --- .../godmode/reporting/visual_console_builder.editor.js | 9 +++++++-- .../include/ajax/visual_console_builder.ajax.php | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 7d3021bfd2..26e34f80aa 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1543,8 +1543,13 @@ function loadFieldsFromDB(item) { $("select[name=parent]").val(val); if (key == 'linked_layout_status_type') $("select[name=linked_map_status_calculation_type]").val(val).change(); - if (key == 'id_layout_linked') - $("select[name=map_linked]").val(val).change(); + if (key == 'id_layout_linked') { + if (data['linked_layout_node_id'] == null) + $("select[name=map_linked]").val(val).change(); + else + $("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]") + .prop("selected", true).change(); + } if (key == 'linked_layout_node_id') $("input[name=linked_map_node_id]").val(val); if (key == 'id_layout_linked_weight') diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index d472542390..690aa437b8 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -615,8 +615,8 @@ switch ($action) { $values['id_agent'] = $id_agent; } - if ($linked_map_node_id) { - $values['linked_layout_node_id'] = $linked_map_node_id; + if ($linked_map_node_id !== null) { + $values['linked_layout_node_id'] = (int) $linked_map_node_id; } } else if ($id_agent == 0) { From 7930f22dd0bb03c9bee916dc3e100dd7231aaba2 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 12 Sep 2018 16:54:18 +0200 Subject: [PATCH 04/28] WIP: Improved the linked visual console status help --- .../include/functions_visual_map_editor.php | 8 ++--- .../help/en/help_linked_map_status_calc.php | 36 +++++++++++++++++++ .../help/es/help_linked_map_status_calc.php | 36 +++++++++++++++++++ 3 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 pandora_console/include/help/en/help_linked_map_status_calc.php create mode 100644 pandora_console/include/help/es/help_linked_map_status_calc.php diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index abbc179c61..675272a7f8 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -700,7 +700,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $visual_maps = db_get_all_rows_filter("tlayout", "id != " . (int) $visualConsole_id, array("id", "name")); $form_items_advance['map_linked_row']['html'] = '' - . __('Linked map') + . __('Linked visual console') . '' . ''; @@ -790,7 +790,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'percentile_item', 'module_graph', 'simple_value', 'icon', 'label', 'datos', 'donut_graph'); $form_items_advance['linked_map_status_calculation_row']['html'] = ''. - __('Type of the status calculation of the linked map') . '' + __('Type of the status calculation of the linked visual console') . '' . '' . html_print_select( $status_type_select_items, @@ -803,6 +803,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { false, false ) + . ui_print_help_icon("linked_map_status_calc", true) . ''; $form_items_advance['map_linked_weight'] = array(); @@ -811,13 +812,12 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'percentile_item', 'module_graph', 'simple_value', 'icon', 'label', 'datos', 'donut_graph'); $form_items_advance['map_linked_weight']['html'] = '' - . __('Linked map weight') . '' + . __('Linked visual console weight') . '' . '' . html_print_input_text( 'map_linked_weight', 80, '', 5, 5, true, false, false, "", "type_number percentage" ) . '%' - . ui_print_help_icon("linked_map_weight", true) . ''; $form_items_advance['linked_map_status_service_critical_row'] = array(); diff --git a/pandora_console/include/help/en/help_linked_map_status_calc.php b/pandora_console/include/help/en/help_linked_map_status_calc.php new file mode 100644 index 0000000000..40c5682d7a --- /dev/null +++ b/pandora_console/include/help/en/help_linked_map_status_calc.php @@ -0,0 +1,36 @@ + +

Formas de calcular el estado de la consola visual enlazada

+ +

Por defecto

+

+ Calcula el estado a partir del estado de todos los elementos, como lo haría un agente. +

+ +

Por peso

+

+ Calcula el estado de los elementos que tienen asignados una consola visual, un módulo o un agente en relación a un porcentaje de elementos configurado por el usuario. Este porcentaje es el que tiene que superar el número de elementos de un estado no normal respecto al número de elementos tenidos en cuenta en el cálculo para que el ese estado cambie. +

+ +

+ Por ejemplo, dado un elemento con un porcentaje del 50% y una consola visual enlazada con 5 elementos: +

+
    +
  • 1 critical, 1 warning y 3 normal -> Estado normal.
  • +
  • 2 critical, 2 warning y 1 normal -> Estado normal.
  • +
  • 1 critical, 3 warning y 1 normal -> Estado warning.
  • +
  • 3 critical, 1 warning y 1 normal -> Estado critical.
  • +
  • 1 critical, 1 warning y 3 unknown -> Estado unknown.
  • +
+ +

+ Si varios estados superan el peso, la prioridad es igual que en el resto de cálculo de estados (critical > warning > unknown). Si no hay elementos para realizar el cálculo, el estado pasa a ser unknown. +

+ +

Por elementos críticos

+

+ Calcula el estado usando los elementos en estado critical y los porcentajes de los umbrales definidos por el usuario. Si el número de los elementos en estado critical respecto al número de elementos tenidos en cuenta en el cálculo supera el porcentaje asignado como warning, el estado pasa a ser warning. Lo mismo para el porcentaje asignado como critical, que además tiene preferencia. +

diff --git a/pandora_console/include/help/es/help_linked_map_status_calc.php b/pandora_console/include/help/es/help_linked_map_status_calc.php new file mode 100644 index 0000000000..40c5682d7a --- /dev/null +++ b/pandora_console/include/help/es/help_linked_map_status_calc.php @@ -0,0 +1,36 @@ + +

Formas de calcular el estado de la consola visual enlazada

+ +

Por defecto

+

+ Calcula el estado a partir del estado de todos los elementos, como lo haría un agente. +

+ +

Por peso

+

+ Calcula el estado de los elementos que tienen asignados una consola visual, un módulo o un agente en relación a un porcentaje de elementos configurado por el usuario. Este porcentaje es el que tiene que superar el número de elementos de un estado no normal respecto al número de elementos tenidos en cuenta en el cálculo para que el ese estado cambie. +

+ +

+ Por ejemplo, dado un elemento con un porcentaje del 50% y una consola visual enlazada con 5 elementos: +

+
    +
  • 1 critical, 1 warning y 3 normal -> Estado normal.
  • +
  • 2 critical, 2 warning y 1 normal -> Estado normal.
  • +
  • 1 critical, 3 warning y 1 normal -> Estado warning.
  • +
  • 3 critical, 1 warning y 1 normal -> Estado critical.
  • +
  • 1 critical, 1 warning y 3 unknown -> Estado unknown.
  • +
+ +

+ Si varios estados superan el peso, la prioridad es igual que en el resto de cálculo de estados (critical > warning > unknown). Si no hay elementos para realizar el cálculo, el estado pasa a ser unknown. +

+ +

Por elementos críticos

+

+ Calcula el estado usando los elementos en estado critical y los porcentajes de los umbrales definidos por el usuario. Si el número de los elementos en estado critical respecto al número de elementos tenidos en cuenta en el cálculo supera el porcentaje asignado como warning, el estado pasa a ser warning. Lo mismo para el porcentaje asignado como critical, que además tiene preferencia. +

From e9752e790edcbbceeb2310a64338d65fab109bd1 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 13 Sep 2018 16:57:13 +0200 Subject: [PATCH 05/28] Added columns for a policy feature --- pandora_console/extras/mr/20.sql | 2 ++ pandora_console/pandoradb.sql | 1 + 2 files changed, 3 insertions(+) diff --git a/pandora_console/extras/mr/20.sql b/pandora_console/extras/mr/20.sql index 58aa5bf708..dbc1661241 100644 --- a/pandora_console/extras/mr/20.sql +++ b/pandora_console/extras/mr/20.sql @@ -24,4 +24,6 @@ ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_node_id` INT(10) N ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0; +ALTER TABLE `tpolicy_modules_inventory` ADD COLUMN `custom_fields` MEDIUMBLOB NOT NULL; + COMMIT; \ No newline at end of file diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index b6b1511bec..b17d2098ca 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2365,6 +2365,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules_inventory` ( `username` varchar(100) default '', `password` varchar(100) default '', `pending_delete` tinyint(1) default '0', + `custom_fields` MEDIUMBLOB NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`id_policy`) REFERENCES tpolicies(`id`) ON UPDATE CASCADE ON DELETE CASCADE, From 19645f055053a8287a1db90431505dba21dfdb2e Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Thu, 13 Sep 2018 18:17:28 +0200 Subject: [PATCH 06/28] Modified trecon_task table --- pandora_console/extras/mr/20.sql | 10 ++++++++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 9 +++++++++ pandora_console/pandoradb.sql | 8 ++++++++ 3 files changed, 27 insertions(+) diff --git a/pandora_console/extras/mr/20.sql b/pandora_console/extras/mr/20.sql index 58aa5bf708..eae836b611 100644 --- a/pandora_console/extras/mr/20.sql +++ b/pandora_console/extras/mr/20.sql @@ -18,10 +18,20 @@ ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_status_as_service_ ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0; ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_node_id` INT(10) NOT NULL default 0; +<<<<<<< Updated upstream -- ----------------------------------------------------- -- Add column in table `treport` -- ----------------------------------------------------- ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0; +======= +ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1'; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_pass` varchar(255) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_method` varchar(25) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_method` varchar(25) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_pass` varchar(255) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_security_level` varchar(25) NOT NULL default ''; +>>>>>>> Stashed changes 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 dd39b6159f..93533705bc 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 @@ -1774,3 +1774,12 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( -- ----------------------------------------------------- ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0; + + +ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1'; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_pass` varchar(255) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_method` varchar(25) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_method` varchar(25) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_pass` varchar(255) NOT NULL default ''; +ALTER TABLE `trecon_task` ADD COLUMN `snmp_security_level` varchar(25) NOT NULL default ''; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index b6b1511bec..e7ff8cdc59 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -775,6 +775,13 @@ CREATE TABLE IF NOT EXISTS `trecon_task` ( `alias_as_name` tinyint(2) NOT NULL default '0', `snmp_enabled` tinyint(1) unsigned default '0', `vlan_enabled` tinyint(1) unsigned default '0', + `snmp_version` varchar(5) NOT NULL default '1', + `snmp_auth_user` varchar(255) NOT NULL default '', + `snmp_auth_pass` varchar(255) NOT NULL default '', + `snmp_auth_method` varchar(25) NOT NULL default '', + `snmp_privacy_method` varchar(25) NOT NULL default '', + `snmp_privacy_pass` varchar(255) NOT NULL default '', + `snmp_security_level` varchar(25) NOT NULL default '', PRIMARY KEY (`id_rt`), KEY `recon_task_daemon` (`id_recon_server`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -3330,3 +3337,4 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( PRIMARY KEY(`id`), FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; + From 1ac837a1b224b01ac377f0a2c91cb1bec2aae7b0 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Fri, 14 Sep 2018 11:40:23 +0200 Subject: [PATCH 07/28] Improved the linked visual console status help --- .../help/en/help_linked_map_status_calc.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/help/en/help_linked_map_status_calc.php b/pandora_console/include/help/en/help_linked_map_status_calc.php index 40c5682d7a..96602eb262 100644 --- a/pandora_console/include/help/en/help_linked_map_status_calc.php +++ b/pandora_console/include/help/en/help_linked_map_status_calc.php @@ -3,34 +3,34 @@ * @package Include/help/es */ ?> -

Formas de calcular el estado de la consola visual enlazada

+

Ways to calculate the status of the linked visual console

-

Por defecto

+

By Default

- Calcula el estado a partir del estado de todos los elementos, como lo haría un agente. + It calculates the status based on the status of all elements, as an agent would do.

-

Por peso

+

By weight

- Calcula el estado de los elementos que tienen asignados una consola visual, un módulo o un agente en relación a un porcentaje de elementos configurado por el usuario. Este porcentaje es el que tiene que superar el número de elementos de un estado no normal respecto al número de elementos tenidos en cuenta en el cálculo para que el ese estado cambie. + It calculates the status of the elements that have a visual console, a module or an agent assigned in relation to a percentage of elements configured by the user. This percentage is the one that has to exceed the number of elements of a non-normal status with respect to the number of elements taken into account in the calculation for that status to change.

- Por ejemplo, dado un elemento con un porcentaje del 50% y una consola visual enlazada con 5 elementos: + For example, given an element with a percentage of 50% and a visual console linked with 5 elements:

    -
  • 1 critical, 1 warning y 3 normal -> Estado normal.
  • -
  • 2 critical, 2 warning y 1 normal -> Estado normal.
  • -
  • 1 critical, 3 warning y 1 normal -> Estado warning.
  • -
  • 3 critical, 1 warning y 1 normal -> Estado critical.
  • -
  • 1 critical, 1 warning y 3 unknown -> Estado unknown.
  • +
  • 1 critical, 1 warning y 3 normal -> Status normal.
  • +
  • 2 critical, 2 warning y 1 normal -> Status normal.
  • +
  • 1 critical, 3 warning y 1 normal -> Status warning.
  • +
  • 3 critical, 1 warning y 1 normal -> Status critical.
  • +
  • 1 critical, 1 warning y 3 unknown -> Status unknown.

- Si varios estados superan el peso, la prioridad es igual que en el resto de cálculo de estados (critical > warning > unknown). Si no hay elementos para realizar el cálculo, el estado pasa a ser unknown. + If several statuses exceed the weight, the priority is the same as in the rest of the status calculation (critical > warning > unknown). If there are no elements to perform the calculation, the status becomes unknown.

-

Por elementos críticos

+

By critical elements

- Calcula el estado usando los elementos en estado critical y los porcentajes de los umbrales definidos por el usuario. Si el número de los elementos en estado critical respecto al número de elementos tenidos en cuenta en el cálculo supera el porcentaje asignado como warning, el estado pasa a ser warning. Lo mismo para el porcentaje asignado como critical, que además tiene preferencia. + It calculates the status using the elements in critical status and the percentages of the thresholds defined by the user. If the number of elements in critical status with respect to the number of elements taken into account in the calculation exceeds the percentage assigned as warning, the status becomes warning. The same applies to the percentage assigned as critical, which also has preference.

From 591db5001f43e733c764e5624ba3962c7ed53617 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 15 Sep 2018 00:01:24 +0200 Subject: [PATCH 08/28] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 11086fd10a..9a6f513b98 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727-180914 +Version: 7.0NG.727-180915 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 26798994ee..891fa387b6 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180914" +pandora_version="7.0NG.727-180915" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1a0eaa286a..fdca1272f3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.727'; -use constant AGENT_BUILD => '180914'; +use constant AGENT_BUILD => '180915'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 50ac70262e..da657ba2cc 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180914 +%define release 180915 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 85944920eb..a659f4a087 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180914 +%define release 180915 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 240daaa3c1..0a5803ef32 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180914" +PI_BUILD="180915" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8f85e5681e..e8f622abce 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180914} +{180915} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7b212db795..d1a8f31f2a 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.727(Build 180914)") +#define PANDORA_VERSION ("7.0NG.727(Build 180915)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 8dbea3ac31..341a13ad1b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.727(Build 180914))" + VALUE "ProductVersion", "(7.0NG.727(Build 180915))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8682c9364e..7b9184ad1c 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727-180914 +Version: 7.0NG.727-180915 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 86ebacd6d3..1df27d5876 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180914" +pandora_version="7.0NG.727-180915" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 719bd692ef..8d6d9d5692 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC180914'; +$build_version = 'PC180915'; $pandora_version = 'v7.0NG.727'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 804d49167d..aba0194441 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 6d7a090fcf..c3e58402d9 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180914 +%define release 180915 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8bb7b022a7..2ef6475cae 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180914 +%define release 180915 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6c0f126f3d..357db2a4a1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180914" +PI_BUILD="180915" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 879bd81208..84d9f915e9 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.727 PS180914"; +my $version = "7.0NG.727 PS180915"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 06fcc3f6d7..1f159c42c5 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.727 PS180914"; +my $version = "7.0NG.727 PS180915"; # save program name for logging my $progname = basename($0); From 4f6aff52c7573fb6cbdffa4497d26502e20b687a Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 16 Sep 2018 00:01:23 +0200 Subject: [PATCH 09/28] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9a6f513b98..066388014a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727-180915 +Version: 7.0NG.727-180916 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 891fa387b6..f823499e66 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180915" +pandora_version="7.0NG.727-180916" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index fdca1272f3..4d3bdaf70e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.727'; -use constant AGENT_BUILD => '180915'; +use constant AGENT_BUILD => '180916'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index da657ba2cc..82c9f67fe5 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180915 +%define release 180916 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a659f4a087..f5118b9174 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180915 +%define release 180916 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 0a5803ef32..58448ec01f 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180915" +PI_BUILD="180916" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index e8f622abce..3fbdb3e81c 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180915} +{180916} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d1a8f31f2a..8cd1633b81 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.727(Build 180915)") +#define PANDORA_VERSION ("7.0NG.727(Build 180916)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 341a13ad1b..6882b6705a 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.727(Build 180915))" + VALUE "ProductVersion", "(7.0NG.727(Build 180916))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7b9184ad1c..2132d92e94 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727-180915 +Version: 7.0NG.727-180916 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 1df27d5876..57113699d6 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180915" +pandora_version="7.0NG.727-180916" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 8d6d9d5692..4283626e76 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC180915'; +$build_version = 'PC180916'; $pandora_version = 'v7.0NG.727'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index aba0194441..76a127dda0 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index c3e58402d9..18884022fb 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180915 +%define release 180916 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 2ef6475cae..6a8d40a64c 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180915 +%define release 180916 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 357db2a4a1..4d1de71d80 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180915" +PI_BUILD="180916" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 84d9f915e9..2bc1888c56 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.727 PS180915"; +my $version = "7.0NG.727 PS180916"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1f159c42c5..356e9d7150 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.727 PS180915"; +my $version = "7.0NG.727 PS180916"; # save program name for logging my $progname = basename($0); From 921a025262299870bf1cfa8e464c6f7e66359aeb Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 17 Sep 2018 00:01:24 +0200 Subject: [PATCH 10/28] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 066388014a..f58cd8abe8 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727-180916 +Version: 7.0NG.727-180917 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index f823499e66..6753cb61f4 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180916" +pandora_version="7.0NG.727-180917" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 4d3bdaf70e..c6cde1a372 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.727'; -use constant AGENT_BUILD => '180916'; +use constant AGENT_BUILD => '180917'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 82c9f67fe5..a073624344 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180916 +%define release 180917 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index f5118b9174..be6bffdbf4 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180916 +%define release 180917 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 58448ec01f..238885abb6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180916" +PI_BUILD="180917" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3fbdb3e81c..9dedc9be98 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180916} +{180917} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8cd1633b81..e24300f10a 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.727(Build 180916)") +#define PANDORA_VERSION ("7.0NG.727(Build 180917)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 6882b6705a..7f8ae30032 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.727(Build 180916))" + VALUE "ProductVersion", "(7.0NG.727(Build 180917))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2132d92e94..945f33d5b1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727-180916 +Version: 7.0NG.727-180917 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 57113699d6..981f6013b3 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180916" +pandora_version="7.0NG.727-180917" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4283626e76..3fda24d3fb 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC180916'; +$build_version = 'PC180917'; $pandora_version = 'v7.0NG.727'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 76a127dda0..d70cc355fc 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 18884022fb..143c57bf27 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180916 +%define release 180917 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6a8d40a64c..31f9abd260 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180916 +%define release 180917 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 4d1de71d80..1b766a7217 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180916" +PI_BUILD="180917" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 2bc1888c56..2e1a13f5f8 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.727 PS180916"; +my $version = "7.0NG.727 PS180917"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 356e9d7150..42732f4763 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.727 PS180916"; +my $version = "7.0NG.727 PS180917"; # save program name for logging my $progname = basename($0); From c9af020d91973f1e682b69225c1f21164d30f92e Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 17 Sep 2018 10:16:12 +0200 Subject: [PATCH 11/28] Remove unwanted git traces on 20.sql --- pandora_console/extras/mr/20.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandora_console/extras/mr/20.sql b/pandora_console/extras/mr/20.sql index eae836b611..db5de3e8e2 100644 --- a/pandora_console/extras/mr/20.sql +++ b/pandora_console/extras/mr/20.sql @@ -18,13 +18,12 @@ ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_status_as_service_ ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0; ALTER TABLE `tlayout_template_data` ADD COLUMN `linked_layout_node_id` INT(10) NOT NULL default 0; -<<<<<<< Updated upstream -- ----------------------------------------------------- -- Add column in table `treport` -- ----------------------------------------------------- ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0; -======= + ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1'; ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default ''; ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_pass` varchar(255) NOT NULL default ''; @@ -32,6 +31,5 @@ ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_method` varchar(25) NOT NULL def ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_method` varchar(25) NOT NULL default ''; ALTER TABLE `trecon_task` ADD COLUMN `snmp_privacy_pass` varchar(255) NOT NULL default ''; ALTER TABLE `trecon_task` ADD COLUMN `snmp_security_level` varchar(25) NOT NULL default ''; ->>>>>>> Stashed changes COMMIT; \ No newline at end of file From 50a3e43bd42b70e9e69d429a1d9c106f9d8f37b5 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Mon, 17 Sep 2018 12:43:51 +0200 Subject: [PATCH 12/28] Insert apache log model in tlog_graph_models --- pandora_console/extras/mr/20.sql | 4 ++++ .../extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 4 ++++ pandora_console/pandoradb_data.sql | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/pandora_console/extras/mr/20.sql b/pandora_console/extras/mr/20.sql index 8b903e45ba..6452a3c052 100644 --- a/pandora_console/extras/mr/20.sql +++ b/pandora_console/extras/mr/20.sql @@ -25,4 +25,8 @@ CREATE TABLE IF NOT EXISTS `tlog_graph_models` ( PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +INSERT INTO tlog_graph_models VALUES (1, 'Apache log model', + '^.*?\s+.*".*?\s(\/.*?)\?.*1.1"\s+(.*?)\s+(.*?)\s+', + 'pagina, html_err_code, _tiempo_', 1); + 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 5a9f16b870..d38833539f 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 @@ -1780,3 +1780,7 @@ CREATE TABLE IF NOT EXISTS `tlog_graph_models` ( `average` tinyint(1) NOT NULL default '0', PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO tlog_graph_models VALUES (1, 'Apache log model', + '^.*?\s+.*".*?\s(\/.*?)\?.*1.1"\s+(.*?)\s+(.*?)\s+', + 'pagina, html_err_code, _tiempo_', 1); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 58f35ab553..7ab1986d09 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1260,3 +1260,10 @@ INSERT INTO `tprofile_view` (`id_profile`, `sec`, `sec2`, `sec3`) VALUES (5, '*' -- Dumping data for table `tcontainer` -- INSERT INTO `tcontainer` SET `name` = 'Default graph container'; + +-- +-- Dumping data for table `tlog_graph_models` +-- +INSERT INTO tlog_graph_models VALUES (1, 'Apache log model', + '^.*?\s+.*".*?\s(\/.*?)\?.*1.1"\s+(.*?)\s+(.*?)\s+', + 'pagina, html_err_code, _tiempo_', 1); From cfec231107595b6d3c0f289e2bbc22936c62293c Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Mon, 17 Sep 2018 12:44:47 +0200 Subject: [PATCH 13/28] Especified SNMP version in recon task --- .../godmode/servers/manage_recontask.php | 105 +++++++++++++++--- .../godmode/servers/manage_recontask_form.php | 66 ++++++++++- 2 files changed, 151 insertions(+), 20 deletions(-) diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index 2b9527704d..25f9e048dd 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -97,7 +97,15 @@ if ((isset ($_GET["update"])) OR ((isset ($_GET["create"])))) { $field2 = get_parameter ("_field2_", ""); $field3 = get_parameter ("_field3_", ""); $field4 = get_parameter ("_field4_", ""); - + $snmp_version = get_parameter_post ("snmp_version"); + $snmp3_auth_user = get_parameter_post ("snmp_auth_user"); + $snmp3_auth_pass = get_parameter_post ("snmp_auth_pass"); + $snmp3_privacy_method = get_parameter_post ("snmp_privacy_method"); + $snmp3_privacy_pass = get_parameter_post ("snmp_privacy_pass"); + $snmp3_auth_method = get_parameter_post ("snmp_auth_method"); + $snmp3_security_level = get_parameter_post ("snmp_security_level"); + + if ($mode == "network_sweep") $id_recon_script = 0; else @@ -154,8 +162,30 @@ if (isset($_GET["update"])) { 'macros' => $macros, 'alias_as_name' => $alias_as_name, 'snmp_enabled' => $snmp_enabled, - 'vlan_enabled' => $vlan_enabled + 'vlan_enabled' => $vlan_enabled, + 'snmp_version' => $snmp_version ); + + $values_v3 = array( + 'snmp_auth_user' => $snmp3_auth_user, + 'snmp_auth_pass' => $snmp3_auth_pass, + 'snmp_privacy_method' => $snmp3_privacy_method, + 'snmp_privacy_pass' => $snmp3_privacy_pass, + 'snmp_auth_method' => $snmp3_auth_method, + 'snmp_security_level' => $snmp3_security_level + ); + if($values['snmp_version'] == '1' || $values['snmp_version'] == '2' || $values['snmp_version'] == '2c'){ + $values_v3 = array( + 'snmp_auth_user' => '', + 'snmp_auth_pass' => '', + 'snmp_privacy_method' => '', + 'snmp_privacy_pass' => '', + 'snmp_auth_method' => '', + 'snmp_security_level' => '' + ); + } + + $values = array_merge($values, $values_v3); $where = array('id_rt' => $id); @@ -217,13 +247,35 @@ if (isset($_GET["create"])) { 'macros' => $macros, 'alias_as_name' => $alias_as_name, 'snmp_enabled' => $snmp_enabled, - 'vlan_enabled' => $vlan_enabled + 'vlan_enabled' => $vlan_enabled, + 'snmp_version' => $snmp_version ); + $values_v3 = array( + 'snmp_auth_user' => $snmp3_auth_user, + 'snmp_auth_pass' => $snmp3_auth_pass, + 'snmp_privacy_method' => $snmp3_privacy_method, + 'snmp_privacy_pass' => $snmp3_privacy_pass, + 'snmp_auth_method' => $snmp3_auth_method, + 'snmp_security_level' => $snmp3_security_level + ); + if($values['snmp_version'] == '1' || $values['snmp_version'] == '2' || $values['snmp_version'] == '2c'){ + $values_v3 = array( + 'snmp_auth_user' => '', + 'snmp_auth_pass' => '', + 'snmp_privacy_method' => '', + 'snmp_privacy_pass' => '', + 'snmp_auth_method' => '', + 'snmp_security_level' => '' + ); + } + + $values = array_merge($values, $values_v3); + $name = io_safe_output($name); $name = trim($name, ' '); $name = io_safe_input($name); - + html_debug($values, true); $reason = ""; if ($name != "") { @@ -245,6 +297,7 @@ if (isset($_GET["create"])) { } else{ $result = db_process_sql_insert('trecon_task', $values); + html_debug("entra", true); } } else { @@ -293,7 +346,7 @@ else { $color=1; if ($result !== false) { $table = new StdClass(); - $table->head = array (__('Name'), __('Network'), __('Mode'), __('Group'), __('Incident'), __('OS'), __('Interval'), __('Ports'), __('Action')); + $table->head = array (__('Name'), __('Network'), __('Mode'), __('Group'), __('SNMP Version'), __('Incident'), __('OS'), __('Interval'), __('Ports'), __('Action')); $table->align = array ("left","left","left","left","left","left","left","left"); $table->width = "100%"; $table->cellpadding = 4; @@ -336,48 +389,64 @@ if ($result !== false) { $data[3] = "-"; } + //SNMP VERSION + if ($row["snmp_version"] == '1'){ + $data[4] = "v. 1"; + } + elseif($row["snmp_version"] == '2'){ + $data[4] = "v. 2"; + } + elseif($row["snmp_version"] == '2c'){ + $data[4] = "v. 2c"; + } + elseif($row["snmp_version"] == '3'){ + $data[4] = "v. 3"; + } + + + // INCIDENT - $data[4] = (($row["create_incident"] == 1) ? __('Yes') : __('No')); + $data[5] = (($row["create_incident"] == 1) ? __('Yes') : __('No')); // OS if ($row["id_recon_script"] == 0) { - $data[5] =(($row["id_os"] > 0) ? ui_print_os_icon ($row["id_os"], false, true) : __('Any')); + $data[6] =(($row["id_os"] > 0) ? ui_print_os_icon ($row["id_os"], false, true) : __('Any')); } else { - $data[5] = "-"; + $data[6] = "-"; } // INTERVAL if ($row["interval_sweep"]==0) - $data[6] = __("Manual"); + $data[7] = __("Manual"); else - $data[6] =human_time_description_raw($row["interval_sweep"]); + $data[7] =human_time_description_raw($row["interval_sweep"]); // PORTS if ($row["id_recon_script"] == 0) { - $data[7] = substr($row["recon_ports"],0,15); + $data[8] = substr($row["recon_ports"],0,15); } else { - $data[7] = "-"; + $data[8] = "-"; } // ACTION $task_group = $row["id_group"]; if (in_array($task_group, $user_groups_w)){ - $data[8] = '' . html_print_image("images/eye.png", true) . ''; - $data[8] .= '' . html_print_image("images/cross.png", true, array("border" => '0')) . ''; + $data[9] = '' . html_print_image("images/eye.png", true) . ''; + $data[9] .= '' . html_print_image("images/cross.png", true, array("border" => '0')) . ''; if($mode_name != 'IPAM Recon'){ - $data[8] .= '' .html_print_image("images/config.png", true) . ''; + $data[9] .= '' .html_print_image("images/config.png", true) . ''; } else { $sql_ipam = 'select id from tipam_network where id_recon_task =' . $row["id_rt"]; $id_recon_ipam = db_get_sql($sql_ipam); - $data[8] .= '' . html_print_image("images/config.png", true) . ''; + $data[9] .= '' . html_print_image("images/config.png", true) . ''; } if($row["disabled"] == 0) { - $data[8] .= '' .html_print_image("images/lightbulb.png", true) . ''; + $data[9] .= '' .html_print_image("images/lightbulb.png", true) . ''; } else { - $data[8] .= '' .html_print_image("images/lightbulb_off.png", true) . ''; + $data[9] .= '' .html_print_image("images/lightbulb_off.png", true) . ''; } } diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index d33e0ee19c..eacc850dd4 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -108,6 +108,13 @@ if (isset($_GET["update"]) || (isset($_GET["upd"]))) { $id_os = $row["id_os"]; $recon_ports = $row["recon_ports"]; $snmp_community = $row["snmp_community"]; + $snmp_version = $row["snmp_version"]; + $snmp3_auth_user = $row["snmp_auth_user"]; + $snmp3_auth_pass = $row["snmp_auth_pass"]; + $snmp3_privacy_method = $row["snmp_privacy_method"]; + $snmp3_privacy_pass = $row["snmp_privacy_pass"]; + $snmp3_auth_method = $row["snmp_auth_method"]; + $snmp3_security_level = $row["snmp_security_level"]; $id_recon_script = $row["id_recon_script"]; $field1 = $row["field1"]; $field2 = $row["field2"]; @@ -156,6 +163,13 @@ elseif (isset($_GET["create"]) || isset($_GET["crt"])) { $id_group = 0; $create_incident = 1; $snmp_community = "public"; + $snmp3_auth_user = ''; + $snmp3_auth_pass = ''; + $snmp_version = 1; + $snmp3_privacy_method = ''; + $snmp3_privacy_pass = ''; + $snmp3_auth_method = ''; + $snmp3_security_level = ''; $id_network_profile = 0; $id_os = -1; // Any $recon_ports = ""; // Any @@ -212,6 +226,13 @@ $table->rowclass[20] = "network_sweep"; $table->rowclass[21] = "network_sweep"; $table->rowclass[22] = "network_sweep"; $table->rowclass[23] = "network_sweep"; +$table->rowclass[24] = "network_sweep"; +$table->rowclass[25] = "network_sweep recon_v3"; +$table->rowclass[26] = "network_sweep recon_v3"; +$table->rowclass[27] = "network_sweep recon_v3"; +$table->rowclass[28] = "network_sweep recon_v3"; +$table->rowclass[29] = "network_sweep recon_v3"; +$table->rowclass[30] = "network_sweep recon_v3"; $table->rowclass[6] = "recon_script"; $table->rowclass[13] = "recon_script"; @@ -327,6 +348,34 @@ $table->data[12][0] = "".__('SNMP Default community'); $table->data[12][0] .= ui_print_help_tip (__('You can specify several values, separated by commas, for example: public,mysecret,1234'), true); $table->data[12][1] = html_print_input_text ('snmp_community', $snmp_community, '', 35, 0, true); +//SNMP version + +$snmp_versions['1'] = 'v. 1'; +$snmp_versions['2'] = 'v. 2'; +$snmp_versions['2c'] = 'v. 2c'; +$snmp_versions['3'] = 'v. 3'; +$table->data[24][0] ="". _('SNMP version'); +$table->data[24][1] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, '', '', 0, true); + +$table->data[25][0] ="".__('Auth user'); +$table->data[25][1] = html_print_input_text ('snmp_auth_user', $snmp3_auth_user, '', 15, 60, true, '', + false, '', ''); +$table->data[26][0] ="". __('Auth password') . ui_print_help_tip(__("The pass length must be eight character minimum."), true); +$table->data[26][1] = html_print_input_password ('snmp_auth_pass', $snmp3_auth_pass, '', 15, 60, true, '', + false, ''); +$table->data[26][1] .= html_print_input_hidden_extended('active_snmp_v3', 0, 'active_snmp_v3_mmen', true); + +$table->data[27][0] ="". __('Privacy method'); +$table->data[27][1] = html_print_select(array('DES' => __('DES'), 'AES' => __('AES')), 'snmp_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', ''); +$table->data[28][0] ="". __('Privacy pass') . ui_print_help_tip(__("The pass length must be eight character minimum."), true); +$table->data[28][1] = html_print_input_password ('snmp_privacy_pass', $snmp3_privacy_pass, '', 15, 60, true, '', + false, ''); +$table->data[29][0] ="". __('Auth method'); +$table->data[29][1] = html_print_select(array('MD5' => __('MD5'), 'SHA' => __('SHA')), 'snmp_auth_method', $snmp3_auth_method, '', '', '', true, false, false, '', ''); +$table->data[30][0] ="". __('Security level'); +$table->data[30][1] = html_print_select(array('noAuthNoPriv' => __('Not auth and not privacy method'), + 'authNoPriv' => __('Auth and not privacy method'), 'authPriv' => __('Auth and privacy method')), 'snmp_security_level', $snmp3_security_level, '', '', '', true, false, false, '', ''); + // Explanation $explanation = db_get_value('description', 'trecon_script', 'id_recon_script', $id_recon_script); @@ -461,9 +510,21 @@ $('select#id_recon_script').change(function() { get_explanation_recon_script($(this).val()); }); +$('select#snmp_version').change(function () { + if (this.value == "3") { + $(".recon_v3").show(); + $("input[name=active_snmp_v3]").val(1); + $("input[name=snmp_community]").attr("disabled", true); + } + else { + $(".recon_v3").hide(); + $("input[name=active_snmp_v3]").val(0); + $("input[name=snmp_community]").removeAttr('disabled'); + } +}); + $('select#mode').change(function() { var type = $(this).val(); - if (type == 'recon_script') { $(".recon_script").show(); $(".network_sweep").hide(); @@ -474,6 +535,7 @@ $('select#mode').change(function() { $(".recon_script").hide(); $(".network_sweep").show(); $('.macro_field').remove(); + $('select#snmp_version').trigger('change'); } }).change(); @@ -543,5 +605,5 @@ function get_explanation_recon_script (id) { }); taskManager.addTask(xhr); } -/* ]]> */ + From 146dab5caa460d265133982c725a70122d2cfc7d Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 17 Sep 2018 14:36:52 +0200 Subject: [PATCH 14/28] Added SNMP v1, v2, v2c and v3 to Network Sweep recon --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 180 +++++++++++++++++-- pandora_server/lib/PandoraFMS/ReconServer.pm | 100 ++++++++++- 2 files changed, 258 insertions(+), 22 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index e0d6ae8fe1..e64e273a1d 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -96,6 +96,9 @@ sub new { # Working SNMP community for each device. community_cache => {}, + # Cache of deviced discovered. + dicovered_cache => {}, + # Connections between devices. connections => {}, @@ -147,8 +150,15 @@ sub new { recon_timing_template => 3, recon_ports => '', resolve_names => 0, + snmp_auth_user => '', + snmp_auth_pass => '', + snmp_auth_method => '', snmp_checks => 2, + snmp_privacy_method => '', + snmp_privacy_pass => '', + snmp_security_level => '', snmp_timeout => 2, + snmp_version => 1, subnets => [], @_, @@ -157,8 +167,66 @@ sub new { # Perform some sanity checks. die("No subnet was specified.") unless defined($self->{'subnets'}); - # Disable SNMP scans if no community was given. - $self->{'snmp_enabled'} = 0 if (scalar(@{$self->{'communities'}}) == 0); + # Check SNMP params id SNMP is enabled + if ($self->{'snmp_enabled'}) { + # Check SNMP version + if ($self->{'snmp_version'} ne '1' && $self->{'snmp_version'} ne '2' + && $self->{'snmp_version'} ne '2c' && $self->{'snmp_version'} ne '3' + ) { + $self->{'snmp_enabled'} = 0; + $self->call('message', "SNMP version " . $self->{'snmp_version'} . " not supported (only 1, 2, 2c and 3).", 5); + } + + # Check the version 3 parameters + if ($self->{'snmp_version'} eq '3') { + # Fixed some vars + $self->{'communities'} = []; + + # SNMP v3 checks + if ( + $self->{'snmp_security_level'} ne 'noAuthNoPriv' && + $self->{'snmp_security_level'} ne 'authNoPriv' && + $self->{'snmp_security_level'} ne 'authPriv' + ) { + $self->{'snmp_enabled'} = 0; + $self->call('message', "Invalid SNMP security level " . $self->{'snmp_security_level'} . ".", 5); + } + if ($self->{'snmp_privacy_method'} ne 'DES' && $self->{'snmp_privacy_method'} ne 'AES') { + $self->{'snmp_enabled'} = 0; + $self->call('message', "Invalid SNMP privacy method " . $self->{'snmp_privacy_method'} . ".", 5); + } + if ($self->{'snmp_auth_method'} ne 'MD5' && $self->{'snmp_auth_method'} ne 'SHA') { + $self->{'snmp_enabled'} = 0; + $self->call('message', "Invalid SNMP authentication method " . $self->{'snmp_auth_method'} . ".", 5); + } + } else { + # Fixed some vars + $self->{'snmp_auth_user'} = ''; + $self->{'snmp_auth_pass'} = ''; + $self->{'snmp_auth_method'} = ''; + $self->{'snmp_privacy_method'} = ''; + $self->{'snmp_privacy_pass'} = ''; + $self->{'snmp_security_level'} = ''; + + # Disable SNMP scans if no community was given. + if (scalar(@{$self->{'communities'}}) == 0) { + $self->{'snmp_enabled'} = 0; + $self->call('message', "There is not any SNMP community configured.", 5); + + } + } + } + + # Remove all snmp related values if disabled + if (!$self->{'snmp_enabled'}) { + $self->{'communities'} = []; + $self->{'snmp_auth_user'} = ''; + $self->{'snmp_auth_pass'} = ''; + $self->{'snmp_auth_method'} = ''; + $self->{'snmp_privacy_method'} = ''; + $self->{'snmp_privacy_pass'} = ''; + $self->{'snmp_security_level'} = ''; + } return bless($self, $class); } @@ -199,7 +267,7 @@ sub aft_connectivity($$) { my ($self, $switch) = @_; my (%mac_temp, @aft_temp); - return unless defined($self->get_community($switch)); + return unless ($self->is_snmp_discovered($switch)); $self->enable_vlan_cache(); @@ -397,8 +465,7 @@ sub find_ifaces($$) { my ($self, $device) = @_; # Does it respond to SNMP? - my $community = $self->get_community($device); - return unless defined($community); + return unless ($self->is_snmp_discovered($device)); my @output = $self->snmp_get_value_array($device, $PandoraFMS::Recon::Base::IFINDEX); foreach my $if_index (@output) { @@ -476,11 +543,13 @@ sub get_device($$) { sub get_community($$) { my ($self, $device) = @_; + return '' if ($self->{'snmp_version'} eq "3"); + if (defined($self->{'community_cache'}->{$device})) { return $self->{'community_cache'}->{$device}; } - return undef; + return ''; } ######################################################################################## @@ -787,6 +856,9 @@ sub get_visited_devices($) { sub get_vlans($$) { my ($self, $device) = @_; + # Disabled in verison 3 + return () if ($self->{'snmp_version'} eq "3"); + # Is the VLAN cache disabled? return () unless ($self->{'__vlan_cache_enabled__'} == 1); @@ -945,6 +1017,17 @@ sub is_visited($$) { return 0; } +######################################################################################## +# Returns 1 if the given device has responded successfully to a snmp request +# Returns 0 otherwise. +######################################################################################## +sub is_snmp_discovered($$) { + my ($self, $device) = @_; + + # Check if device is into discovered cache + return (defined($self->{'discovered_cache'}->{$device})) ? 1 : 0; +} + ######################################################################################## # Mark the given devices as connected to each other on the given interfaces. ######################################################################################## @@ -999,23 +1082,46 @@ sub mark_visited($$) { } ######################################################################################## -# Looks for a working SNMP community for the given device. Returns 1 if one is -# found, 0 otherwise. Updates the SNMP community cache. +# Mark the given device as snmp discovered. +######################################################################################## +sub mark_discovered($$) { + my ($self, $device) = @_; + + $self->{'discovered_cache'}->{$device} = 1; +} + +######################################################################################## +# Validate the configuration for the given device. +# Returns 1 if successfull snmp contact, 0 otherwise. +# Updates the SNMP community cache on v1, v2 and v2c. ######################################################################################## sub snmp_responds($$) { my ($self, $device) = @_; - # We already have a working SNMP community for this device. - return 1 if (defined($self->get_community($device))); + return 1 if($self->is_snmp_discovered($device)); + + return ($self->{'snmp_version'} eq "3") + ? $self->snmp_responds_v3($device) + : $self->snmp_responds_v122c($device); +} + +######################################################################################## +# Looks for a working SNMP community for the given device. Returns 1 if one is +# found, 0 otherwise. Updates the SNMP community cache. +######################################################################################## +sub snmp_responds_v122c($$) { + my ($self, $device) = @_; foreach my $community (@{$self->{'communities'}}) { # Clean blanks. $community =~ s/\s+//g; - `snmpwalk -M/dev/null -r$self->{'snmp_checks'} -t$self->{'snmp_timeout'} -v1 -On -Oe -c $community $device .0 2>/dev/null`; + my $command = $self->snmp_get_command($device, ".0", $community); + `$command`; if ($? == 0) { $self->set_community($device, $community); + $self->mark_discovered($device); return 1; } } @@ -1023,6 +1129,25 @@ sub snmp_responds($$) { return 0; } + +######################################################################################## +# Validate the SNMP v3 configuration for a device. +# Returns 1 if successfull snmp contact, 0 otherwise. +######################################################################################## +sub snmp_responds_v3($$) { + my ($self, $device) = @_; + + my $command = $self->snmp_get_command($device, ".0"); + `$command`; + + if ($? == 0) { + $self->mark_discovered($device); + return 1; + } + + return 0; +} + ############################################################################## # Parse the local ARP cache. ############################################################################## @@ -1309,8 +1434,8 @@ sub snmp_get($$$) { my ($self, $device, $oid) = @_; my @output; + return () unless defined $self->is_snmp_discovered($device); my $community = $self->get_community($device); - return () unless defined ($community); # Check the SNMP query cache first. if (defined($self->{'snmp_cache'}->{"${device}_${oid}"})) { @@ -1320,13 +1445,15 @@ sub snmp_get($$$) { # Check VLANS. my @vlans = $self->get_vlans($device); if (scalar(@vlans) == 0) { - @output = `snmpwalk -M/dev/null -r$self->{'snmp_checks'} -t$self->{'snmp_timeout'} -v1 -On -Oe -c $community $device $oid 2>/dev/null`; + my $command = $self->snmp_get_command($device, $oid, $community); + @output = `$command`; } else { # Handle duplicate lines. my %output_hash; foreach my $vlan (@vlans) { - foreach my $line (`snmpwalk -M/dev/null -r$self->{'snmp_checks'} -t$self->{'snmp_timeout'} -v1 -On -Oe -c $community\@$vlan $device $oid 2>/dev/null`) { + my $command = $self->snmp_get_command($device, $oid, $community, $vlan); + foreach my $line (`$vlan`) { $output_hash{$line} = 1; } } @@ -1339,6 +1466,31 @@ sub snmp_get($$$) { return @output; } +######################################################################################## +# Get the snmpwalk command seing version 1, 2, 2c or 3. +######################################################################################## +sub snmp_get_command { + my ($self, $device, $oid, $community, $vlan) = @_; + $vlan = defined($vlan) ? "\@" . $vlan : ''; + + my $command = "snmpwalk -M/dev/null -r$self->{'snmp_checks'} -t$self->{'snmp_timeout'} -v$self->{'snmp_version'} -On -Oe "; + if ($self->{'snmp_version'} eq "3") { + $command .= " -l$self->{'snmp_security_level'} "; + print $self->{'snmp_security_level'} . "\n"; + if ($self->{'snmp_security_level'} ne "noAuthNoPriv") { + $command .= " -u$self->{'snmp_auth_user'} -a$self->{'snmp_auth_method'} -A$self->{'snmp_auth_pass'} "; + } + if ($self->{'snmp_security_level'} eq "authPriv") { + $command .= " -x$self->{'snmp_privacy_method'} -X$self->{'snmp_privacy_pass'} "; + } + } else { + $command .= " -c$community$vlan "; + } + + return "$command $device $oid 2>/dev/null"; + +} + ######################################################################################## # Performs an SNMP WALK and returns the value of the given OID. Returns undef # on error. diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index f0c272b3c7..13d563cd8e 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -173,7 +173,16 @@ sub data_consumer ($$) { pa_config => $pa_config, recon_ports => $task->{'recon_ports'}, resolve_names => $task->{'resolve_names'}, + snmp_auth_user => $task->{'snmp_auth_user'}, + snmp_auth_pass => $task->{'snmp_auth_pass'}, + snmp_auth_method => $task->{'snmp_auth_method'}, + snmp_checks => $task->{'snmp_checks'}, snmp_enabled => $task->{'snmp_enabled'}, + snmp_privacy_method => $task->{'snmp_privacy_method'}, + snmp_privacy_pass => $task->{'snmp_privacy_pass'}, + snmp_security_level => $task->{'snmp_security_level'}, + snmp_timeout => $task->{'snmp_timeout'}, + snmp_version => $task->{'snmp_version'}, subnets => \@subnets, task_id => $task->{'id_rt'}, vlan_cache_enabled => $task->{'vlan_enabled'}, @@ -310,10 +319,17 @@ sub PandoraFMS::Recon::Base::create_network_profile_modules($$$) { $self->call('message', "Network component ID " . $np_component->{'id_nc'} . " not found.", 5); next; } - + # Use snmp_community from network task instead the component snmp_community $component->{'snmp_community'} = safe_output($self->get_community($device)); - + $component->{'tcp_send'} = $self->{'snmp_version'}; + $component->{'custom_string_1'} = $self->{'snmp_privacy_method'}; + $component->{'custom_string_2'} = $self->{'snmp_privacy_pass'}; + $component->{'custom_string_3'} = $self->{'snmp_security_level'}; + $component->{'plugin_parameter'} = $self->{'snmp_auth_method'}; + $component->{'plugin_user'} = $self->{'snmp_auth_user'}; + $component->{'plugin_pass'} = $self->{'snmp_auth_pass'}; + pandora_create_module_from_network_component($self->{'pa_config'}, $component, $agent_id, $self->{'dbh'}); } } @@ -466,8 +482,8 @@ sub PandoraFMS::Recon::Base::create_agent($$) { } # Add interfaces to the agent if it responds to SNMP. + return $agent_id unless ($self->is_snmp_discovered($device)); my $community = $self->get_community($device); - return $agent_id unless defined($community); my @output = $self->snmp_get_value_array($device, $PandoraFMS::Recon::Base::IFINDEX); foreach my $if_index (@output) { @@ -506,7 +522,13 @@ sub PandoraFMS::Recon::Base::create_agent($$) { 'descripcion' => $if_desc, 'id_agente' => $agent_id, 'ip_target' => $device, - 'tcp_send' => 1, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, 'snmp_community' => $community, 'snmp_oid' => "$PandoraFMS::Recon::Base::IFOPERSTATUS.$if_index" ); @@ -516,6 +538,14 @@ sub PandoraFMS::Recon::Base::create_agent($$) { 'descripcion' => $if_desc, 'ip_target' => $device, 'snmp_community' => $community, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, + 'tcp_send' => $self->{'snmp_version'}, ); pandora_update_module_from_hash ($self->{'pa_config'}, \%module, 'id_agente_modulo', $module_id, $self->{'dbh'}); } @@ -531,7 +561,13 @@ sub PandoraFMS::Recon::Base::create_agent($$) { 'descripcion' => 'The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifInOctets.', 'id_agente' => $agent_id, 'ip_target' => $device, - 'tcp_send' => 1, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, 'snmp_community' => $community, 'snmp_oid' => "$PandoraFMS::Recon::Base::IFHCINOCTECTS.$if_index"); pandora_create_module_from_hash ($self->{'pa_config'}, \%module, $self->{'dbh'}); @@ -539,6 +575,13 @@ sub PandoraFMS::Recon::Base::create_agent($$) { my %module = ( 'ip_target' => $device, 'snmp_community' => $community, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, ); pandora_update_module_from_hash ($self->{'pa_config'}, \%module, 'id_agente_modulo', $module_id, $self->{'dbh'}); } @@ -553,7 +596,13 @@ sub PandoraFMS::Recon::Base::create_agent($$) { 'descripcion' => 'The total number of octets received on the interface, including framing characters.', 'id_agente' => $agent_id, 'ip_target' => $device, - 'tcp_send' => 1, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, 'snmp_community' => $community, 'snmp_oid' => "$PandoraFMS::Recon::Base::IFINOCTECTS.$if_index"); pandora_create_module_from_hash ($self->{'pa_config'}, \%module, $self->{'dbh'}); @@ -561,6 +610,13 @@ sub PandoraFMS::Recon::Base::create_agent($$) { my %module = ( 'ip_target' => $device, 'snmp_community' => $community, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, ); pandora_update_module_from_hash ($self->{'pa_config'}, \%module, 'id_agente_modulo', $module_id, $self->{'dbh'}); } @@ -577,7 +633,13 @@ sub PandoraFMS::Recon::Base::create_agent($$) { 'descripcion' => 'The total number of octets received on the interface, including framing characters. This object is a 64-bit version of ifOutOctets.', 'id_agente' => $agent_id, 'ip_target' => $device, - 'tcp_send' => 1, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, 'snmp_community' => $community, 'snmp_oid' => "$PandoraFMS::Recon::Base::IFHCOUTOCTECTS.$if_index"); pandora_create_module_from_hash ($self->{'pa_config'}, \%module, $self->{'dbh'}); @@ -585,6 +647,14 @@ sub PandoraFMS::Recon::Base::create_agent($$) { my %module = ( 'ip_target' => $device, 'snmp_community' => $community, + 'tcp_send' => $self->{'snmp_version'}, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, ); pandora_update_module_from_hash ($self->{'pa_config'}, \%module, 'id_agente_modulo', $module_id, $self->{'dbh'}); } @@ -599,7 +669,13 @@ sub PandoraFMS::Recon::Base::create_agent($$) { 'descripcion' => 'The total number of octets received on the interface, including framing characters.', 'id_agente' => $agent_id, 'ip_target' => $device, - 'tcp_send' => 1, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, 'snmp_community' => $community, 'snmp_oid' => "$PandoraFMS::Recon::Base::IFOUTOCTECTS.$if_index"); pandora_create_module_from_hash ($self->{'pa_config'}, \%module, $self->{'dbh'}); @@ -607,6 +683,14 @@ sub PandoraFMS::Recon::Base::create_agent($$) { my %module = ( 'ip_target' => $device, 'snmp_community' => $community, + 'tcp_send' => $self->{'snmp_version'}, + 'tcp_send' => $self->{'snmp_version'}, + 'custom_string_1' => $self->{'snmp_privacy_method'}, + 'custom_string_2' => $self->{'snmp_privacy_pass'}, + 'custom_string_3' => $self->{'snmp_security_level'}, + 'plugin_parameter' => $self->{'snmp_auth_method'}, + 'plugin_user' => $self->{'snmp_auth_user'}, + 'plugin_pass' => $self->{'snmp_auth_pass'}, ); pandora_update_module_from_hash ($self->{'pa_config'}, \%module, 'id_agente_modulo', $module_id, $self->{'dbh'}); } From 0d164fc3e00306542b25e03e66118f2df0f27536 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 17 Sep 2018 16:38:02 +0200 Subject: [PATCH 15/28] Removed unwanted trace --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index e64e273a1d..902a1d86d9 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1476,7 +1476,6 @@ sub snmp_get_command { my $command = "snmpwalk -M/dev/null -r$self->{'snmp_checks'} -t$self->{'snmp_timeout'} -v$self->{'snmp_version'} -On -Oe "; if ($self->{'snmp_version'} eq "3") { $command .= " -l$self->{'snmp_security_level'} "; - print $self->{'snmp_security_level'} . "\n"; if ($self->{'snmp_security_level'} ne "noAuthNoPriv") { $command .= " -u$self->{'snmp_auth_user'} -a$self->{'snmp_auth_method'} -A$self->{'snmp_auth_pass'} "; } From 0fef339a13045538eda2efdc92482d281ea160c3 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 17 Sep 2018 16:54:47 +0200 Subject: [PATCH 16/28] Bugfix --- pandora_console/include/functions_visual_map_editor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 675272a7f8..7994dd2f19 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -727,7 +727,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { return $arr; }, array()); - $form_items_advance['map_linked_row']['html'] .= html_print_select_from_sql( + $form_items_advance['map_linked_row']['html'] .= html_print_select( array(), 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true ); $form_items_advance['map_linked_row']['html'] .= html_print_input_hidden( @@ -773,7 +773,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items_advance['map_linked_row']['html'] .= ob_get_clean(); } else { - $form_items_advance['map_linked_row']['html'] .= html_print_select_from_sql( + $form_items_advance['map_linked_row']['html'] .= html_print_select( $visual_maps, 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true ); } From 8daca7d220f16c0f58ca161799d92be3274dccaa Mon Sep 17 00:00:00 2001 From: samucarc Date: Mon, 17 Sep 2018 18:57:29 +0200 Subject: [PATCH 17/28] Fixed module/agent/group alert report --- pandora_console/include/functions_alerts.php | 18 ++--- .../include/functions_reporting.php | 72 ++++++++++++++----- .../include/functions_reporting_html.php | 6 ++ 3 files changed, 63 insertions(+), 33 deletions(-) diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 4d89dca614..2a9557ad57 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -1633,23 +1633,13 @@ function get_agent_alert_fired ($id_agent, $id_alert, $period, $date = 0) { * * @return array An array with all the events happened. */ -function get_module_alert_fired ($id_agent_module, $id_alert, $period, $date = 0) { +function get_module_alert_fired ($id_agent_module, $id_alert) { - if (!is_numeric ($date)) { - $date = time_w_fixed_tz($date); - } - if (empty ($date)) { - $date = get_system_time(); - } - - $datelimit = $date - $period; - - $sql = sprintf ('SELECT timestamp + $sql = sprintf ('SELECT * FROM tevento - WHERE id_agentmodule = %d AND utimestamp > %d - AND utimestamp <= %d + WHERE id_agentmodule = %d AND id_alert_am = %d - ORDER BY timestamp DESC', $id_agent_module, $datelimit, $date, $id_alert); + ORDER BY timestamp DESC', $id_agent_module, $id_alert); return db_get_all_rows_sql ($sql); } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index c5e8e53725..a65c49cfd8 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2866,14 +2866,28 @@ function reporting_alert_get_fired($id_agent_module, $id_alert_template_module, $id_alert_template_module, $period, $datetime); + + if (!is_numeric ($datetime)) { + $datetime = time_w_fixed_tz($datetime); + } + if (empty ($datetime)) { + $datetime = get_system_time(); + } + + $datelimit = $datetime - $period; + $empty = '----------------------------'; if (empty($firedTimes)) { $firedTimes = array(); - $firedTimes[0]['timestamp'] = null; + $empty = _('There are no alerts defined'); + $firedTimes[0]['timestamp'] = ''; } foreach ($firedTimes as $fireTime) { + if($fireTime['utimestamp'] > $datelimit && $fireTime['utimestamp'] <= $datetime) $fired[] = $fireTime['timestamp']; + else + $fired[] = $empty; } return $fired; @@ -2956,6 +2970,16 @@ function reporting_alert_report_group($report, $content) { foreach ($alerts as $template => $actions) { + $datetime = (int) $report["datetime"]; + if (!is_numeric ($datetime)) { + $datetime = time_w_fixed_tz($datetime); + } + if (empty ($datetime)) { + $datetime = get_system_time(); + } + $period = (int) $content["period"]; + $datelimit = $datetime - $period; + $data_action = array(); $data_action['actions'] = array(); @@ -2964,7 +2988,7 @@ function reporting_alert_report_group($report, $content) { foreach ($actions["custom"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -2977,7 +3001,7 @@ function reporting_alert_report_group($report, $content) { foreach ($actions["default"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -2990,7 +3014,7 @@ function reporting_alert_report_group($report, $content) { foreach ($actions["unavailable"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -3010,10 +3034,7 @@ function reporting_alert_report_group($report, $content) { (int) $report["datetime"]); $module_actions["actions"] = $data_action; - if ($module_actions["template_fired"][0] !== null) $data_row['alerts'][$ntemplates] = $module_actions; - else - $data_row = null; $ntemplates++; } @@ -3076,6 +3097,16 @@ function reporting_alert_report_agent($report, $content) { foreach ($alerts as $template => $actions) { + $datetime = (int) $report["datetime"]; + if (!is_numeric ($datetime)) { + $datetime = time_w_fixed_tz($datetime); + } + if (empty ($datetime)) { + $datetime = get_system_time(); + } + $period = (int) $content["period"]; + $datelimit = $datetime - $period; + $data_action = array(); $data_action['actions'] = array(); @@ -3084,7 +3115,7 @@ function reporting_alert_report_agent($report, $content) { foreach ($actions["custom"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -3097,7 +3128,7 @@ function reporting_alert_report_agent($report, $content) { foreach ($actions["default"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -3110,7 +3141,7 @@ function reporting_alert_report_agent($report, $content) { foreach ($actions["unavailable"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -3130,10 +3161,7 @@ function reporting_alert_report_agent($report, $content) { (int) $report["datetime"]); $module_actions["actions"] = $data_action; - if ($module_actions["template_fired"][0] !== null) $data_row['alerts'][$ntemplates] = $module_actions; - else - $data_row = null; $ntemplates++; } @@ -3199,6 +3227,15 @@ function reporting_alert_report_module($report, $content) { $ntemplates = 0; foreach ($alerts as $template => $actions) { + $datetime = (int) $report["datetime"]; + if (!is_numeric ($datetime)) { + $datetime = time_w_fixed_tz($datetime); + } + if (empty ($datetime)) { + $datetime = get_system_time(); + } + $period = (int) $content["period"]; + $datelimit = $datetime - $period; $data_action = array(); $data_action['actions'] = array(); @@ -3208,7 +3245,7 @@ function reporting_alert_report_module($report, $content) { foreach ($actions["custom"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -3221,7 +3258,7 @@ function reporting_alert_report_module($report, $content) { foreach ($actions["default"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -3234,7 +3271,7 @@ function reporting_alert_report_module($report, $content) { foreach ($actions["unavailable"] as $action) { $data_action[$naction]["name"] = $action["name"]; $fired = $action["fired"]; - if ($fired == 0){ + if ($fired == 0 || ($fired <= $datelimit || $fired > $datetime)){ $data_action[$naction]['fired'] = '----------------------------'; } else { @@ -3254,10 +3291,7 @@ function reporting_alert_report_module($report, $content) { (int) $report["datetime"]); $module_actions["actions"] = $data_action; - if ($module_actions["template_fired"][0] !== null) $data_row['alerts'][$ntemplates] = $module_actions; - else - $data_row = null; $ntemplates++; } diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 9ed6ab16e1..fd4d0a2c76 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1960,6 +1960,12 @@ function reporting_html_alert_report($table, $item, $pdf = 0) { $table1->data = array (); $table1->rowspan = array(); $table1->valign = array(); + + if ($item['data'] == null) { + $table->data['alerts']['cell'] = ui_print_empty_data ( __('No alerts defined') , '', true) ; + return true; + } + $table1->head['agent'] = __('Agent'); $table1->head['module'] = __('Module'); $table1->head['template'] = __('Template'); From abc7e2cb3cb8ee976b1b9e6fc9f1bb2d136eabbc Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 18 Sep 2018 00:01:27 +0200 Subject: [PATCH 18/28] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index f58cd8abe8..9a4a63356f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727-180917 +Version: 7.0NG.727-180918 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 6753cb61f4..090702f0ff 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180917" +pandora_version="7.0NG.727-180918" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index c6cde1a372..492b7bbd3f 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.727'; -use constant AGENT_BUILD => '180917'; +use constant AGENT_BUILD => '180918'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index a073624344..20926174de 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180917 +%define release 180918 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index be6bffdbf4..0f4f2e2d45 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180917 +%define release 180918 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 238885abb6..f52e708fa6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180917" +PI_BUILD="180918" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9dedc9be98..3f33fbca69 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180917} +{180918} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index e24300f10a..88e358508a 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.727(Build 180917)") +#define PANDORA_VERSION ("7.0NG.727(Build 180918)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 7f8ae30032..fa2574b879 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.727(Build 180917))" + VALUE "ProductVersion", "(7.0NG.727(Build 180918))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 945f33d5b1..e4f98f7884 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727-180917 +Version: 7.0NG.727-180918 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 981f6013b3..d8d13c3037 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180917" +pandora_version="7.0NG.727-180918" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3fda24d3fb..eee0eda964 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC180917'; +$build_version = 'PC180918'; $pandora_version = 'v7.0NG.727'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d70cc355fc..7c57b2b569 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 143c57bf27..94df2173d4 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180917 +%define release 180918 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 31f9abd260..4ab5cf468b 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180917 +%define release 180918 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 1b766a7217..2b5a205cb4 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180917" +PI_BUILD="180918" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 2e1a13f5f8..216a456c25 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.727 PS180917"; +my $version = "7.0NG.727 PS180918"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 42732f4763..457544d958 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.727 PS180917"; +my $version = "7.0NG.727 PS180918"; # save program name for logging my $progname = basename($0); From 0c853a83d15123bd868b3cc20e4c6c6bbd9f2c77 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 18 Sep 2018 09:28:22 +0200 Subject: [PATCH 19/28] add new tree view edition group --- pandora_console/godmode/groups/group_list.php | 391 ++++++++++++------ pandora_console/include/ajax/tree.ajax.php | 4 + .../include/class/TreeGroupEdition.class.php | 108 +++++ pandora_console/include/javascript/pandora.js | 9 +- .../include/javascript/tree/TreeController.js | 217 +++++----- 5 files changed, 509 insertions(+), 220 deletions(-) create mode 100644 pandora_console/include/class/TreeGroupEdition.class.php diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index d6efbc2d5f..0efe11ad31 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -215,20 +215,57 @@ if (! check_acl($config['id_user'], 0, "PM")) { return; } +$sec = defined('METACONSOLE') ? 'advanced' : 'gagente'; +$url_tree = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=tree"; +$url_groups = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=groups"; +$buttons['tree'] = array( + 'active' => false, + 'text' => "" . + html_print_image( + "images/gm_massive_operations.png", + true, + array ( + "title" => __('Tree Group view') + ) + ) . "" +); + +$buttons['groups'] = array( + 'active' => false, + 'text' => "" . + html_print_image( + "images/group.png", + true, + array( + "title" => __('Group view') + ) + ) . "" +); + +$tab = (string)get_parameter('tab', 'groups'); + +// Marks correct tab +switch ($tab) { + case 'tree': + $buttons['tree']['active'] = true; + break; + case 'groups': + default: + $buttons['groups']['active'] = true; + break; +} + // Header if (defined('METACONSOLE')) { agents_meta_print_header(); - $sec = 'advanced'; echo '
'; echo __("Edit or delete groups can cause problems with synchronization"); echo '
'; -} -else { +} else { ui_print_page_header ( __("Groups defined in %s", get_product_name()), - "images/group.png", false, "", true, "" + "images/group.png", false, "", true, $buttons ); - $sec = 'gagente'; } $create_group = (bool) get_parameter ('create_group'); @@ -365,148 +402,158 @@ if (($delete_group) && (check_acl($config['id_user'], 0, "PM"))) { } } -$acl=''; -$search_name = ''; -$offset = (int)get_parameter('offset', 0); -$search = (string)get_parameter('search', ''); -$block_size = $config['block_size']; +if($tab == 'tree'){ + echo html_print_image('images/spinner.gif', true, + array('class' => "loading_tree", + 'style' => 'display: none;')); + echo "
"; -if(!empty($search)){ - $search_name = "AND t.nombre LIKE '%$search%'"; } +else{ + $acl=''; + $search_name = ''; + $offset = (int)get_parameter('offset', 0); + $search = (string)get_parameter('search', ''); + $block_size = $config['block_size']; -if (!users_can_manage_group_all("AR")){ - $user_groups_acl = users_get_groups(false, "AR"); - $groups_acl = implode(",", $user_groups_ACL); - if(empty($groups_acl)) return ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) ); + if(!empty($search)){ + $search_name = "AND t.nombre LIKE '%$search%'"; + } - $acl = "AND t.id_grupo IN ($groups_acl)"; -} + if (!users_can_manage_group_all("AR")){ + $user_groups_acl = users_get_groups(false, "AR"); + $groups_acl = implode(",", $user_groups_ACL); + if(empty($groups_acl)) return ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) ); -$form = "
"; - $form .= ""; - $form .= ""; - $form .= "
" . __('Search') . ' '; - $form .= html_print_input_text ("search", $search, '', 100, 100, true); - $form .= ""; - $form .= ""; - $form .= "
"; -$form .= "
"; + $acl = "AND t.id_grupo IN ($groups_acl)"; + } -echo $form; + $form = "
"; + $form .= ""; + $form .= ""; + $form .= "
" . __('Search') . ' '; + $form .= html_print_input_text ("search", $search, '', 100, 100, true); + $form .= ""; + $form .= ""; + $form .= "
"; + $form .= "
"; -$groups_sql = - "SELECT t.*, - p.nombre AS parent_name, - IF(t.parent=p.id_grupo, 1, 0) AS has_child - FROM tgrupo t - LEFT JOIN tgrupo p - ON t.parent=p.id_grupo - WHERE 1=1 - $acl - $search_name - ORDER BY nombre - LIMIT $offset, $block_size -"; + echo $form; -$groups = db_get_all_rows_sql($groups_sql); - -if (!empty($groups)) { - //Count all groups for pagination only saw user and filters - $groups_sql_count = "SELECT count(*) + $groups_sql = + "SELECT t.*, + p.nombre AS parent_name, + IF(t.parent=p.id_grupo, 1, 0) AS has_child FROM tgrupo t + LEFT JOIN tgrupo p + ON t.parent=p.id_grupo WHERE 1=1 $acl $search_name + ORDER BY nombre + LIMIT $offset, $block_size "; - $groups_count = db_get_value_sql($groups_sql_count); - $table = new StdClass(); - $table->width = '100%'; - $table->class = "databox data"; - $table->head = array (); - $table->head[0] = __('ID'); - $table->head[1] = __('Name'); - $table->head[2] = __('Icon'); - $table->head[3] = __('Alerts'); - $table->head[4] = __('Parent'); - $table->head[5] = __('Description'); - $table->head[6] = __('Actions'); - $table->align = array (); - $table->align[0] = 'right'; - $table->align[2] = 'left'; - $table->align[6] = 'left'; - $table->size[5] = '30%'; - $table->size[6] = '10%'; - $table->data = array (); + $groups = db_get_all_rows_sql($groups_sql); - foreach ($groups as $key => $group) { - $url = "index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group=".$group['id_grupo']; - $url_delete = "index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group=" . $group['id_grupo']; - $table->data[$key][0] = $group['id_grupo']; - $table->data[$key][1] = "" . $group['nombre'] . ""; - $table->data[$key][2] = html_print_image( - "images/groups_small/" . $group['icon'] . ".png", - true, - array( - "style" => '', - "class" => "bot", - "alt" => $group['nombre'], - "title" => $group['nombre'], - false, false, false, true - ) - ); + if (!empty($groups)) { + //Count all groups for pagination only saw user and filters + $groups_sql_count = "SELECT count(*) + FROM tgrupo t + WHERE 1=1 + $acl + $search_name + "; + $groups_count = db_get_value_sql($groups_sql_count); - //reporting_get_group_stats - $table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled'); - $table->data[$key][4] = $group['parent_name']; - $table->data[$key][5] = $group['description']; - $table->data[$key][6] = "" . - html_print_image( - "images/config.png", + $table = new StdClass(); + $table->width = '100%'; + $table->class = "databox data"; + $table->head = array (); + $table->head[0] = __('ID'); + $table->head[1] = __('Name'); + $table->head[2] = __('Icon'); + $table->head[3] = __('Alerts'); + $table->head[4] = __('Parent'); + $table->head[5] = __('Description'); + $table->head[6] = __('Actions'); + $table->align = array (); + $table->align[0] = 'left'; + $table->align[2] = 'left'; + $table->align[6] = 'left'; + $table->size[0] = '3%'; + $table->size[5] = '30%'; + $table->size[6] = '5%'; + $table->data = array (); + + foreach ($groups as $key => $group) { + $url = "index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group=".$group['id_grupo']; + $url_delete = "index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group=" . $group['id_grupo']; + $table->data[$key][0] = $group['id_grupo']; + $table->data[$key][1] = "" . $group['nombre'] . ""; + $table->data[$key][2] = html_print_image( + "images/groups_small/" . $group['icon'] . ".png", true, array( - "alt" => __('Edit'), - "title" => __('Edit'), - "border" => '0' + "style" => '', + "class" => "bot", + "alt" => $group['nombre'], + "title" => $group['nombre'], + false, false, false, true ) - ) . - ""; + ); + + //reporting_get_group_stats + $table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled'); + $table->data[$key][4] = $group['parent_name']; + $table->data[$key][5] = $group['description']; + $table->data[$key][6] = "" . + html_print_image( + "images/config.png", + true, + array( + "alt" => __('Edit'), + "title" => __('Edit'), + "border" => '0' + ) + ) . + ""; + + $confirm_message = __('Are you sure?'); + if ($group['has_child']) { + $confirm_message = __('The child groups will be updated to use the parent id of the deleted group') . ". " . $confirm_message; + } + + $table->data[$key][6] .= '  ' . + '' . + html_print_image( + "images/cross.png", + true, + array( + "alt" => __('Delete'), + "title" => __('Delete'), + "border" => '0' + ) + ) . + ""; - $confirm_message = __('Are you sure?'); - if ($group['has_child']) { - $confirm_message = __('The child groups will be updated to use the parent id of the deleted group') . ". " . $confirm_message; } - $table->data[$key][6] .= '  ' . - '' . - html_print_image( - "images/cross.png", - true, - array( - "alt" => __('Delete'), - "title" => __('Delete'), - "border" => '0' - ) - ) . - ""; - + echo ui_pagination( + $groups_count, false, + $offset, $block_size, + true, 'offset', false + ); + html_print_table ($table); + echo ui_pagination( + $groups_count, false, + $offset, $block_size, + true, 'offset', true + ); + } + else { + ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) ); } - - echo ui_pagination( - $groups_count, false, - $offset, $block_size, - true, 'offset', false - ); - html_print_table ($table); - echo ui_pagination( - $groups_count, false, - $offset, $block_size, - true, 'offset', true - ); -} -else { - ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined groups') ) ); } if (check_acl($config['id_user'], 0, "PM")) { @@ -517,5 +564,101 @@ if (check_acl($config['id_user'], 0, "PM")) { echo ''; } +ui_require_javascript_file("TreeController", "include/javascript/tree/"); + enterprise_hook('close_meta_frame'); +$tab = "group_edition"; + ?> + + + + + + + + diff --git a/pandora_console/include/ajax/tree.ajax.php b/pandora_console/include/ajax/tree.ajax.php index c2e051c3f4..07435d9109 100644 --- a/pandora_console/include/ajax/tree.ajax.php +++ b/pandora_console/include/ajax/tree.ajax.php @@ -43,6 +43,7 @@ if (is_ajax ()) { require_once($config['homedir'] . "/include/class/TreeModule.class.php"); require_once($config['homedir'] . "/include/class/TreeTag.class.php"); require_once($config['homedir'] . "/include/class/TreeGroup.class.php"); + require_once($config['homedir'] . "/include/class/TreeGroupEdition.class.php"); enterprise_include_once("include/class/TreePolicies.class.php"); enterprise_include_once("include/class/TreeGroupMeta.class.php"); require_once($config['homedir'] . "/include/functions_reporting.php"); @@ -104,6 +105,9 @@ if (is_ajax ()) { if (!class_exists('TreePolicies')) break; $tree = new TreePolicies($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access); break; + case 'group_edition': + $tree = new TreeGroupEdition($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access); + break; default: // FIXME. No error handler return; diff --git a/pandora_console/include/class/TreeGroupEdition.class.php b/pandora_console/include/class/TreeGroupEdition.class.php new file mode 100644 index 0000000000..dea62da238 --- /dev/null +++ b/pandora_console/include/class/TreeGroupEdition.class.php @@ -0,0 +1,108 @@ +id == -1) { + $this->getFirstLevel(); + } + } + + protected function getProcessedGroups () { + $processed_groups = array(); + // Index and process the groups + $groups = $this->getGroupCounters(); + + // If user have not permissions in parent, set parent node to 0 (all) + // Avoid to do foreach for admins + if (!users_can_manage_group_all("AR")) { + foreach ($groups as $id => $group) { + if (!isset($this->userGroups[$groups[$id]['parent']])) { + $groups[$id]['parent'] = 0; + } + } + } + // Build the group hierarchy + foreach ($groups as $id => $group) { + if (isset($groups[$id]['parent']) && ($groups[$id]['parent'] != 0)) { + $parent = $groups[$id]['parent']; + // Parent exists + if (!isset($groups[$parent]['children'])) { + $groups[$parent]['children'] = array(); + } + // Store a reference to the group into the parent + $groups[$parent]['children'][] = &$groups[$id]; + // This group was introduced into a parent + $groups[$id]['have_parent'] = true; + } + } + + // Sort the children groups + foreach ($groups as $id => $group) { + if (isset($groups[$id]['children'])) { + usort($groups[$id]['children'], array("Tree", "cmpSortNames")); + } + } + //Filter groups and eliminates the reference to children groups out of her parent + $groups = array_filter($groups, function ($group) { + return !$group['have_parent']; + }); + + usort($groups, array("Tree", "cmpSortNames")); + return $groups; + } + + + protected function getGroupCounters() { + $messages = array( + 'confirm' => __('Confirm'), + 'cancel' => __('Cancel'), + 'messg' => __('Are you sure?') + ); + $sql = "SELECT id_grupo AS gid, + nombre as name, parent, icon + FROM tgrupo + "; + + $stats = db_get_all_rows_sql($sql); + $group_stats = array(); + foreach ($stats as $group) { + $group_stats[$group['gid']]['name'] = $group['name']; + $group_stats[$group['gid']]['parent'] = $group['parent']; + $group_stats[$group['gid']]['icon'] = $group['icon']; + $group_stats[$group['gid']]['id'] = $group['gid']; + $group_stats[$group['gid']]['type'] = 'group'; + + $group_stats[$group['gid']] = $this->getProcessedItem($group_stats[$group['gid']]); + $group_stats[$group['gid']]['delete']['messages'] = $messages; + $group_stats[$group['gid']]['edit'] = 1; + $group_stats[$group['gid']]['alerts'] = ''; + } + + return $group_stats; + } +} + +?> + diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index bc8432ae48..11157ed3ff 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -1585,6 +1585,10 @@ function display_confirm_dialog (message, ok_text, cancel_text, ok_function) { clean_function(); } + var buttons_obj = {}; + buttons_obj[cancel_text] = clean_function; + buttons_obj[ok_text] = ok_function_clean; + // Display the dialog $("body").append('

' + message + '

'); $("#pandora_confirm_dialog_text").dialog({ @@ -1598,10 +1602,7 @@ function display_confirm_dialog (message, ok_text, cancel_text, ok_function) { }, closeOnEscape: true, modal: true, - buttons: { - Cancel: clean_function, - "Confirm": ok_function_clean - } + buttons: buttons_obj }); } diff --git a/pandora_console/include/javascript/tree/TreeController.js b/pandora_console/include/javascript/tree/TreeController.js index 409fc517d1..13a0b31cd4 100644 --- a/pandora_console/include/javascript/tree/TreeController.js +++ b/pandora_console/include/javascript/tree/TreeController.js @@ -55,7 +55,7 @@ var TreeController = { } container.append($group); - + _.each(elements, function(element) { element.jqObject = _processNode($group, element); }); @@ -279,14 +279,13 @@ var TreeController = { // Load leaf function _processNode (container, element) { - // type, [id], [serverID], callback function _getTreeDetailData (type, id, serverID, callback) { var lastParam = arguments[arguments.length - 1]; var callback; if (typeof lastParam === 'function') callback = lastParam; - + var serverID; if (arguments.length >= 4) serverID = arguments[2]; @@ -296,23 +295,23 @@ var TreeController = { var type; if (arguments.length >= 2) type = arguments[0]; - + if (typeof type === 'undefined') throw new TypeError('Type required'); if (typeof callback === 'undefined') throw new TypeError('Callback required'); - + var postData = { page: controller.ajaxPage, getDetail: 1, type: type } - + if (typeof id !== 'undefined') postData.id = id; if (typeof serverID !== 'undefined') postData.serverID = serverID; - + $.ajax({ url: controller.ajaxURL, type: 'POST', @@ -346,6 +345,36 @@ var TreeController = { $content.append(element.iconHTML + " "); } $content.append(element.name); + + if(typeof element.edit != 'undefined'){ + var url_edit = controller.baseURL + "index.php?sec=gagente&sec2=godmode/groups/configure_group&tab=tree&id_group=" + element.id; + var $updateicon = $('') + var $updatebtn = $('') + .append($updateicon); + $content.append($updatebtn); + } + + if(typeof element.delete != 'undefined'){ + var url_delete = controller.baseURL + "index.php?sec=gagente&sec2=godmode/groups/group_list&tab=tree&delete_group=1&id_group=" + element.id; + var $deleteBtn = $(''); + $deleteBtn.click(function (event){ + var ok_function = function(){ + window.location.replace(url_delete); + }; + display_confirm_dialog( + element.delete.messages.messg, + element.delete.messages.confirm, + element.delete.messages.cancel, + ok_function + ) + }); + $content.append($deleteBtn); + } + + if(typeof element.alerts != 'undefined'){ + $content.append(element.alerts); + } + break; case 'agent': // Is quiet @@ -583,95 +612,99 @@ var TreeController = { if (typeof(public_user) === 'undefined') public_user = 0; if (typeof element.searchChildren != 'undefined' && element.searchChildren) { - $node - .removeClass("leaf-empty") - .addClass("leaf-closed"); + if(element.rootType == "group_edition" + && typeof element.children == 'undefined'){ + $node.addClass("leaf-empty"); + } + else{ + $node + .removeClass("leaf-empty") + .addClass("leaf-closed"); + $leafIcon.click(function (e) { + e.preventDefault(); - $leafIcon.click(function (e) { - e.preventDefault(); - - if (!$node.hasClass("leaf-loading") && !$node.hasClass("children-loaded") && !$node.hasClass("leaf-empty")) { - $node - .removeClass("leaf-closed") - .removeClass("leaf-error") - .addClass("leaf-loading"); - - $.ajax({ - url: controller.ajaxURL, - type: 'POST', - dataType: 'json', - data: { - page: controller.ajaxPage, - getChildren: 1, - id: element.id, - type: element.type, - rootID: element.rootID, - serverID: element.serverID, - rootType: element.rootType, - filter: controller.filter, - hash: public_hash, - id_user: public_user - }, - complete: function(xhr, textStatus) { - $node.removeClass("leaf-loading"); - $node.addClass("children-loaded"); - }, - success: function(data, textStatus, xhr) { - if (data.success) { - var $group = $node.children("ul.tree-group"); - - if ((typeof data.tree != 'undefined' && data.tree.length > 0) || $group.length > 0) { - $node.addClass("leaf-open"); - - if ($group.length <= 0) { - $group = $("
    "); - $group - .addClass("tree-group") - .hide(); - $node.append($group); - } - - _.each(data.tree, function(element) { - element.jqObject = _processNode($group, element); - }); - - $group.slideDown(); - - $node.data('children', $group); - - // Add again the hover event to the 'force_callback' elements - forced_title_callback(); - } - else { - $node.addClass("leaf-empty"); - } - } - else { - $node.addClass("leaf-error"); - } - }, - error: function(xhr, textStatus, errorThrown) { - $node.addClass("leaf-error"); - } - }); - } - else if (! $node.hasClass("leaf-empty")) { - if ($node.hasClass("leaf-open")) { - $node - .removeClass("leaf-open") - .addClass("leaf-closed") - .data('children') - .slideUp(); - } - else { + if (!$node.hasClass("leaf-loading") && !$node.hasClass("children-loaded") && !$node.hasClass("leaf-empty")) { $node .removeClass("leaf-closed") - .addClass("leaf-open") - .data('children') - .slideDown(); + .removeClass("leaf-error") + .addClass("leaf-loading"); + + $.ajax({ + url: controller.ajaxURL, + type: 'POST', + dataType: 'json', + data: { + page: controller.ajaxPage, + getChildren: 1, + id: element.id, + type: element.type, + rootID: element.rootID, + serverID: element.serverID, + rootType: element.rootType, + filter: controller.filter, + hash: public_hash, + id_user: public_user + }, + complete: function(xhr, textStatus) { + $node.removeClass("leaf-loading"); + $node.addClass("children-loaded"); + }, + success: function(data, textStatus, xhr) { + if (data.success) { + var $group = $node.children("ul.tree-group"); + if ((typeof data.tree != 'undefined' && data.tree.length > 0) || $group.length > 0) { + $node.addClass("leaf-open"); + + if ($group.length <= 0) { + $group = $("
      "); + $group + .addClass("tree-group") + .hide(); + $node.append($group); + } + + _.each(data.tree, function(element) { + element.jqObject = _processNode($group, element); + }); + + $group.slideDown(); + + $node.data('children', $group); + + // Add again the hover event to the 'force_callback' elements + forced_title_callback(); + } + else { + $node.addClass("leaf-empty"); + } + } + else { + $node.addClass("leaf-error"); + } + }, + error: function(xhr, textStatus, errorThrown) { + $node.addClass("leaf-error"); + } + }); } - } - }); + else if (! $node.hasClass("leaf-empty")) { + if ($node.hasClass("leaf-open")) { + $node + .removeClass("leaf-open") + .addClass("leaf-closed") + .data('children') + .slideUp(); + } + else { + $node + .removeClass("leaf-closed") + .addClass("leaf-open") + .data('children') + .slideDown(); + } + } + }); + } } return $node; From 7100aed448f506c99bf96a9f287636f8a7f29009 Mon Sep 17 00:00:00 2001 From: samucarc Date: Tue, 18 Sep 2018 10:09:11 +0200 Subject: [PATCH 20/28] Fixed minor error module/agent/group alert report --- pandora_console/include/functions_reporting.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a65c49cfd8..4010b8cebb 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2879,8 +2879,7 @@ function reporting_alert_get_fired($id_agent_module, $id_alert_template_module, $empty = '----------------------------'; if (empty($firedTimes)) { $firedTimes = array(); - $empty = _('There are no alerts defined'); - $firedTimes[0]['timestamp'] = ''; + $firedTimes[0]['timestamp'] = $empty; } foreach ($firedTimes as $fireTime) { From 8f3a602097db79799c09a58e3e788a902eab1e27 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 18 Sep 2018 10:38:42 +0200 Subject: [PATCH 21/28] fixed error in metaconsole reports module events --- .../include/functions_reporting.php | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 0a6d0a5256..16b12d1c08 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1552,7 +1552,7 @@ function reporting_event_report_group($report, $content, function reporting_event_report_module($report, $content, $type = 'dinamic', $force_width_chart = null, $force_height_chart = null, $pdf=0) { - + global $config; if($pdf){ @@ -1563,20 +1563,29 @@ function reporting_event_report_module($report, $content, } $return['type'] = 'event_report_module'; - + if (empty($content['name'])) { $content['name'] = __('Event Report Module'); } - + + $id_server = false; + if(is_metaconsole()){ + $id_server = metaconsole_get_id_server($content["server_name"]); + metaconsole_connect(null, $id_server); + } + $return['title'] = $content['name']; - $return['subtitle'] = agents_get_alias($content['id_agent']) . - " - " . - io_safe_output( - modules_get_agentmodule_name($content['id_agent_module'])); + $return['subtitle'] = agents_get_alias($content['id_agent']) . " - " . + io_safe_output(modules_get_agentmodule_name($content['id_agent_module'])); + + if(is_metaconsole()){ + metaconsole_restore_db(); + } + $return["description"] = $content["description"]; $return["date"] = reporting_get_date_text($report, $content); $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; - + $event_filter = $content['style']; $return['show_summary_group'] = $event_filter['show_summary_group']; //filter @@ -1585,22 +1594,18 @@ function reporting_event_report_module($report, $content, $filter_event_type = json_decode($event_filter['filter_event_type'],true); $filter_event_status = json_decode($event_filter['filter_event_status'],true); $filter_event_filter_search = $event_filter['event_filter_search']; - + //graphs $event_graph_by_user_validator = $event_filter['event_graph_by_user_validator']; $event_graph_by_criticity = $event_filter['event_graph_by_criticity']; $event_graph_validated_vs_unvalidated = $event_filter['event_graph_validated_vs_unvalidated']; - - $id_server = false; - if(is_metaconsole()){ - $id_server = metaconsole_get_id_server($content["server_name"]); - } + //data events $data = reporting_get_module_detailed_event ( - $content['id_agent_module'], $content['period'], $report["datetime"], - $show_summary_group, $filter_event_severity, $filter_event_type, + $content['id_agent_module'], $content['period'], $report["datetime"], + $show_summary_group, $filter_event_severity, $filter_event_type, $filter_event_status, $filter_event_filter_search, $force_width_chart, - $event_graph_by_user_validator, $event_graph_by_criticity, + $event_graph_by_user_validator, $event_graph_by_criticity, $event_graph_validated_vs_unvalidated, $ttl, $id_server); if (empty($data)) { @@ -1608,7 +1613,7 @@ function reporting_event_report_module($report, $content, } else { $return['data'] = array_reverse($data); - } + } if ($config['metaconsole']) { metaconsole_restore_db(); @@ -1621,7 +1626,7 @@ function reporting_event_report_module($report, $content, else{ $return['total_events'] = 0; } - + return reporting_check_structure_content($return); } From 40bf163fedeb80f5ebc775bf365cc944e6cdb4cb Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Tue, 18 Sep 2018 11:03:30 +0200 Subject: [PATCH 22/28] Disabled vlan vhen SNMP version is v3 --- pandora_console/godmode/servers/manage_recontask.php | 5 +++-- pandora_console/godmode/servers/manage_recontask_form.php | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index 25f9e048dd..1d5dc69c89 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -269,13 +269,15 @@ if (isset($_GET["create"])) { 'snmp_security_level' => '' ); } + if ($values['snmp_version'] == '3'){ + $values['vlan_enabled'] = 0; + } $values = array_merge($values, $values_v3); $name = io_safe_output($name); $name = trim($name, ' '); $name = io_safe_input($name); - html_debug($values, true); $reason = ""; if ($name != "") { @@ -297,7 +299,6 @@ if (isset($_GET["create"])) { } else{ $result = db_process_sql_insert('trecon_task', $values); - html_debug("entra", true); } } else { diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index eacc850dd4..f5865d1470 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -515,11 +515,14 @@ $('select#snmp_version').change(function () { $(".recon_v3").show(); $("input[name=active_snmp_v3]").val(1); $("input[name=snmp_community]").attr("disabled", true); + $("input[name=vlan_enabled]").removeAttr("checked"); + $("input[name=vlan_enabled]").attr("disabled", true); } else { $(".recon_v3").hide(); $("input[name=active_snmp_v3]").val(0); $("input[name=snmp_community]").removeAttr('disabled'); + $("input[name=vlan_enabled]").removeAttr('disabled'); } }); From 6cf638a4d8aba3d1843b4ffb274984cc462ae609 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Tue, 18 Sep 2018 12:18:47 +0200 Subject: [PATCH 23/28] Fixed max_value report --- pandora_console/include/functions_graph.php | 2 + .../include/functions_reporting.php | 364 +++++++++--------- 2 files changed, 184 insertions(+), 182 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 33118d39c2..e8fa13df9f 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -513,6 +513,8 @@ function grafico_modulo_sparse_data( } $period_time_interval = $period_time_interval - $params['time_interval']; } + //drag the last value to paint the graph correctly + $acum_array_data[]= array( 0 => $start_period, 1 => $acum_array_data[$i-1][1]); $array_data['sum1']['data'] = $acum_array_data; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 4cc8315b0b..7ab2779763 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3816,114 +3816,114 @@ function reporting_value($report, $content, $type,$pdf) { 'type_graph' => $config['type_module_charts'], 'time_interval' => $content['lapse'], 'server_id' => $id_meta, - 'height' => $config['graph_image_height'] + 'height' => $config['graph_image_height'], + 'fullscale' => true ); switch ($type) { case 'max': - if($content['lapse_calc'] == 0){ - $value = reporting_get_agentmodule_data_max( - $content['id_agent_module'], $content['period'], $report["datetime"]); - if (!$config['simple_module_value']) { - $formated_value = $value; + if($content['lapse_calc'] == 0){ + $value = reporting_get_agentmodule_data_max( + $content['id_agent_module'], $content['period'], $report["datetime"]); + if (!$config['simple_module_value']) { + $formated_value = $value; + } + else { + $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; + } } - else { - $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; - } - } - else{ - $value = ' - - - - - - - - - -
      '; - if($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3){ + else{ + $value = ' + + + + + + +
      '; + if($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3){ + + $value .= ' + + + + + + + + + + +
      + '.__("Agent").' + + '.__("Module").' + + '.__("Maximum").' +
      + '.$agent_name.' + + '.$module_name.' + + '.format_for_graph(reporting_get_agentmodule_data_max( + $content['id_agent_module'], $content['period'], $report["datetime"]), $config['graph_precision']) . ' ' . $unit.' +
      '; + } + + $value .= ' +
      + '; + + if($content['visual_format'] == 2 || $content['visual_format'] == 3){ + $params['force_interval'] = 'max_only'; + $value .= grafico_modulo_sparse($params); + } $value .= ' - + + + + + '; + $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true); + $date_reference = getdate(); + + for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) { + + $value .= ''; + } else { + $value .= 'N/A'; + } + + } + + $value .='
      '; + + if($content['visual_format'] == 1 || $content['visual_format'] == 3){ + + $value .= ' + - - - - - -
      - '.__("Agent").' - - '.__("Module").' + '.__("Lapse").' '.__("Maximum").'
      - '.$agent_name.' - - '.$module_name.' - - '.format_for_graph(reporting_get_agentmodule_data_max( - $content['id_agent_module'], $content['period'], $report["datetime"]), $config['graph_precision']) . ' ' . $unit.' -
      '; +
      '. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; + + if ($i>$time_begin['utimestamp']) { + $value .= format_for_graph(reporting_get_agentmodule_data_max( + $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'
      '; } + $value .= ' +
      '; - $value .= ' -
      - '; + $formated_value = $value; + } - if($content['visual_format'] == 2 || $content['visual_format'] == 3){ - $params['force_interval'] = 'max_only'; - $value .= grafico_modulo_sparse($params); - } - - $value .= ' - -
      '; - - if($content['visual_format'] == 1 || $content['visual_format'] == 3){ - - $value .= ' - - - - - - '; - $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); - $date_reference = getdate(); - - for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) { - - $value .= ''; - } - else{ - $value .= 'N/A'; - } - - } - - $value .='
      - '.__("Lapse").' - - '.__("Maximum").' -
      '. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; - - if($i>$time_begin['utimestamp']){ - $value .= format_for_graph(reporting_get_agentmodule_data_max( - $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'
      '; - } - $value .= ' -
      '; - - $formated_value = $value; - } - - break; + break; case 'min': if($content['lapse_calc'] == 0){ $value = reporting_get_agentmodule_data_min( @@ -4034,111 +4034,111 @@ function reporting_value($report, $content, $type,$pdf) { break; case 'avg': - if($content['lapse_calc'] == 0){ - $value = reporting_get_agentmodule_data_average( - $content['id_agent_module'], $content['period'], $report["datetime"]); - if (!$config['simple_module_value']) { - $formated_value = $value; + if($content['lapse_calc'] == 0){ + $value = reporting_get_agentmodule_data_average( + $content['id_agent_module'], $content['period'], $report["datetime"]); + if (!$config['simple_module_value']) { + $formated_value = $value; + } + else { + $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; + } } - else { - $formated_value = format_for_graph($value, $config['graph_precision']) . " " . $unit; - } - } - else{ - $value = ' - - - - - - - -
      '; + else{ + $value = ' + + + + + - - + +
      '; + + if($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3){ + $value .= ' + + + + + + + + + + +
      + '.__("Agent").' + + '.__("Module").' + + '.__("Average").' +
      + '.$agent_name.' + + '.$module_name.' + + '.format_for_graph(reporting_get_agentmodule_data_average( + $content['id_agent_module'], $content['period'], $report["datetime"]), $config['graph_precision']) . ' ' . $unit.' +
      '; + + } + + $value .= ' +
      + '; + if($content['visual_format'] == 2 || $content['visual_format'] == 3){ + $params['force_interval'] = 'avg_only'; + $value .= grafico_modulo_sparse($params); + } - if($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3){ $value .= ' - + + + + + '; + $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); + $date_reference = getdate(); + + for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) { + + $value .= ''; + } + else{ + $value .= 'N/A'; + } + + } + + $value .='
      '; + + if($content['visual_format'] == 1 || $content['visual_format'] == 3){ + + $value .= ' + - - - - - -
      - '.__("Agent").' - - '.__("Module").' + '.__("Lapse").' '.__("Average").'
      - '.$agent_name.' - - '.$module_name.' - - '.format_for_graph(reporting_get_agentmodule_data_average( - $content['id_agent_module'], $content['period'], $report["datetime"]), $config['graph_precision']) . ' ' . $unit.' -
      '; - +
      '. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; + + if($i>$time_begin['utimestamp']){ + $value .= format_for_graph(reporting_get_agentmodule_data_average( + $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'
      '; } - $value .= ' -
      - '; - if($content['visual_format'] == 2 || $content['visual_format'] == 3){ - $params['force_interval'] = 'avg_only'; - $value .= grafico_modulo_sparse($params); - } + $value .= ' + +
      '; - $value .= ' - -
      '; - - if($content['visual_format'] == 1 || $content['visual_format'] == 3){ - - $value .= ' - - - - - - '; - $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']); - $date_reference = getdate(); - - for ($i=$date_reference[0]; $i > ($date_reference[0]-$content["period"]); $i -= $content["lapse"]) { - - $value .= ''; - } - else{ - $value .= 'N/A'; - } - - } - - $value .='
      - '.__("Lapse").' - - '.__("Average").' -
      '. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; - - if($i>$time_begin['utimestamp']){ - $value .= format_for_graph(reporting_get_agentmodule_data_average( - $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.'
      '; - } - - $value .= ' - -
      '; + $formated_value = $value; - $formated_value = $value; - - } - break; + } + break; case 'sum': $value = reporting_get_agentmodule_data_sum( From 51533ced5ba7a29744fac0044ea8865b2de87150 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 18 Sep 2018 12:20:45 +0200 Subject: [PATCH 24/28] Add local (as opposed to UTC) timestamps to data. Ref pandora_enterprise#2775 --- pandora_agents/win32/modules/pandora_data.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_agents/win32/modules/pandora_data.cc b/pandora_agents/win32/modules/pandora_data.cc index 6b9390f3f7..be891414ba 100644 --- a/pandora_agents/win32/modules/pandora_data.cc +++ b/pandora_agents/win32/modules/pandora_data.cc @@ -32,7 +32,7 @@ using namespace Pandora; */ Pandora_Data::Pandora_Data (string value) { this->value = value; - GetSystemTime (&(this->timestamp)); + GetLocalTime (&(this->timestamp)); this->data_origin = pandora_data_unknown_source; } @@ -68,7 +68,7 @@ Pandora_Data::Pandora_Data (string value, SYSTEMTIME *system_time) { */ Pandora_Data::Pandora_Data (string value, string data_origin) { this->value = value; - GetSystemTime (&(this->timestamp)); + GetLocalTime (&(this->timestamp)); this->data_origin = data_origin; } @@ -99,7 +99,7 @@ Pandora_Data::Pandora_Data (string value, SYSTEMTIME *system_time, string data_o */ Pandora_Data::Pandora_Data () { this->value = ""; - GetSystemTime (&(this->timestamp)); + GetLocalTime (&(this->timestamp)); this->data_origin = ""; } From e5ff2b956c0946c61887d9de7a1233a3f8b8dafe Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Tue, 18 Sep 2018 15:33:14 +0200 Subject: [PATCH 25/28] Bugfixes --- .../reporting/visual_console_builder.editor.js | 11 +++++++---- .../include/functions_visual_map_editor.php | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 26e34f80aa..d32b15e1aa 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1544,11 +1544,14 @@ function loadFieldsFromDB(item) { if (key == 'linked_layout_status_type') $("select[name=linked_map_status_calculation_type]").val(val).change(); if (key == 'id_layout_linked') { - if (data['linked_layout_node_id'] == null) + if (data['linked_layout_node_id'] == null) { $("select[name=map_linked]").val(val).change(); - else - $("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]") - .prop("selected", true).change(); + } + else { + var $option = $("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]"); + if ($option.length === 0) $option = $("select[name=map_linked] > option[value=" + val + "]"); + $option.prop("selected", true).parent().change(); + } } if (key == 'linked_layout_node_id') $("input[name=linked_map_node_id]").val(val); diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 7994dd2f19..a20a8c5e42 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -773,6 +773,10 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items_advance['map_linked_row']['html'] .= ob_get_clean(); } else { + $visual_maps = array_reduce($visual_maps, function ($all, $item) { + $all[$item["id"]] = $item["name"]; + return $all; + }, array()); $form_items_advance['map_linked_row']['html'] .= html_print_select( $visual_maps, 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true ); From 167cd67ece9ecd73d223fdbf7c2cf5d878e2424c Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Tue, 18 Sep 2018 15:44:55 +0200 Subject: [PATCH 26/28] Bugfix --- pandora_console/include/ajax/visual_console_builder.ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 690aa437b8..98be4f174b 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -101,7 +101,7 @@ $height = get_parameter('height', null); $parent = get_parameter('parent', null); $map_linked = get_parameter('map_linked', null); $linked_map_node_id = get_parameter('linked_map_node_id', null); -$linked_map_status_calculation_type = get_parameter('linked_map_status_calculation_type', 'default'); +$linked_map_status_calculation_type = get_parameter('linked_map_status_calculation_type', null); $map_linked_weight = get_parameter('map_linked_weight', null); if ($map_linked_weight !== null) { From bcfda72269c6826f8b26ba2918567b5a60a7cf41 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 18 Sep 2018 16:39:44 +0200 Subject: [PATCH 27/28] Updated version and build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9a4a63356f..55b882a8a0 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727-180918 +Version: 7.0NG.727 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 090702f0ff..de63328356 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180918" +pandora_version="7.0NG.727" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 20926174de..fda93a3acf 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180918 +%define release 1 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 0f4f2e2d45..27c67ebe7b 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 180918 +%define release 1 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3f33fbca69..b056d1931c 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-<%Version%>-Setup<%Ext%>} +{<%AppName%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e4f98f7884..85868c04a3 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727-180918 +Version: 7.0NG.727 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index d8d13c3037..f8d7a26315 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180918" +pandora_version="7.0NG.727" package_pear=0 package_pandora=1 diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 5e1f2e7dfd..5c19c97679 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.727 -%define release 180918 +%define release 1 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index b293741eab..bbe99dbecc 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.727 -%define release 180918 +%define release 1 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index c35c51c92a..528ee801ed 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.727-180918 +Version: 7.0NG.727 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 70e0110594..f45d022c15 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727-180918" +pandora_version="7.0NG.727" package_cpan=0 package_pandora=1 diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 94df2173d4..f3009e9ebb 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180918 +%define release 1 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 4ab5cf468b..462d10c5df 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 180918 +%define release 1 Summary: Pandora FMS Server Name: %{name} From 687a742746f6edbe16154154220706d62edaf97f Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 19 Sep 2018 00:01:28 +0200 Subject: [PATCH 28/28] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 4 ++-- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 55b882a8a0..e31ca86953 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.727 +Version: 7.0NG.727-180919 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index de63328356..5603062522 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727" +pandora_version="7.0NG.727-180919" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 492b7bbd3f..62ab979d8e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.727'; -use constant AGENT_BUILD => '180918'; +use constant AGENT_BUILD => '180919'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index fda93a3acf..57317deecf 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 1 +%define release 180919 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 27c67ebe7b..04574d3e25 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.727 -%define release 1 +%define release 180919 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index f52e708fa6..5cb84bc1fb 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180918" +PI_BUILD="180919" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b056d1931c..a0fb7217ea 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180918} +{180919} ViewReadme {Yes} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-Setup<%Ext%>} +{<%AppName%>-<%Version%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 88e358508a..7965694449 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.727(Build 180918)") +#define PANDORA_VERSION ("7.0NG.727(Build 180919)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index fa2574b879..07d7395a4f 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.727(Build 180918))" + VALUE "ProductVersion", "(7.0NG.727(Build 180919))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 85868c04a3..bc0617d4bd 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.727 +Version: 7.0NG.727-180919 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index f8d7a26315..1b82bd7d9a 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.727" +pandora_version="7.0NG.727-180919" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index eee0eda964..fee4139810 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC180918'; +$build_version = 'PC180919'; $pandora_version = 'v7.0NG.727'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 7c57b2b569..ab15163d24 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
      [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index f3009e9ebb..183b303369 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 1 +%define release 180919 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 462d10c5df..e792d22c55 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.727 -%define release 1 +%define release 180919 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2b5a205cb4..aca178bbd1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.727" -PI_BUILD="180918" +PI_BUILD="180919" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 216a456c25..d6a77c3de1 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.727 PS180918"; +my $version = "7.0NG.727 PS180919"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 457544d958..664a76ba9f 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.727 PS180918"; +my $version = "7.0NG.727 PS180919"; # save program name for logging my $progname = basename($0);