Merge remote-tracking branch 'origin/develop' into ent-6196-error-htaccess

This commit is contained in:
rafael 2020-08-10 14:55:28 +02:00
commit 9cbf3d1306
78 changed files with 60822 additions and 58536 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, AIX version
# Version 7.0NG.748, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, FreeBSD Version
# Version 7.0NG.748, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, HP-UX Version
# Version 7.0NG.748, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, GNU/Linux
# Version 7.0NG.748, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, GNU/Linux
# Version 7.0NG.748, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, Solaris Version
# Version 7.0NG.748, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.747
# Version 7.0NG.748
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.747, AIX version
# Version 7.0NG.748, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.747
# Version 7.0NG.748
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.747, HPUX Version
# Version 7.0NG.748, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747
# Version 7.0NG.748
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747
# Version 7.0NG.748
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747
# Version 7.0NG.748
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.747, Solaris version
# Version 7.0NG.748, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, AIX version
# Version 7.0NG.748, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.747-200727
Version: 7.0NG.748-200810
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.747-200727"
pandora_version="7.0NG.748-200810"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, GNU/Linux
# Version 7.0NG.748, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, FreeBSD Version
# Version 7.0NG.748, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, HP-UX Version
# Version 7.0NG.748, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, GNU/Linux
# Version 7.0NG.748, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, GNU/Linux
# Version 7.0NG.748, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, NetBSD Version
# Version 7.0NG.748, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.747, Solaris Version
# Version 7.0NG.748, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -54,8 +54,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.747';
use constant AGENT_BUILD => '200727';
use constant AGENT_VERSION => '7.0NG.748';
use constant AGENT_BUILD => '200810';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.747
%define release 200727
%define version 7.0NG.748
%define release 200810
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.747
%define release 200727
%define version 7.0NG.748
%define release 200810
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.747"
PI_BUILD="200727"
PI_VERSION="7.0NG.748"
PI_BUILD="200810"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.747
# Version 7.0NG.748
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.747}
{Pandora FMS Windows Agent v7.0NG.748}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{200727}
{200810}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.747(Build 200727)")
#define PANDORA_VERSION ("7.0NG.748(Build 200810)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.747(Build 200727))"
VALUE "ProductVersion", "(7.0NG.748(Build 200810))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.747-200727
Version: 7.0NG.748-200810
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.747-200727"
pandora_version="7.0NG.748-200810"
package_pear=0
package_pandora=1

View File

@ -4,6 +4,7 @@ UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FM
ALTER TABLE `tservice_element` ADD COLUMN `rules` text;
ALTER TABLE `tservice` ADD COLUMN `unknown_as_critical` tinyint(1) NOT NULL default 0 AFTER `warning`;
ALTER TABLE `tserver` MODIFY COLUMN `version` varchar(25) NOT NULL DEFAULT '';
UPDATE `tservice` SET `auto_calculate`=0;

View File

@ -1271,6 +1271,7 @@ ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT "";
-- ----------------------------------------------------------------------
ALTER TABLE tserver ADD COLUMN `server_keepalive` int(11) DEFAULT 0;
ALTER TABLE `tserver` MODIFY COLUMN `server_keepalive` int(11) NOT NULL DEFAULT '0';
ALTER TABLE `tserver` MODIFY COLUMN `version` varchar(25) NOT NULL DEFAULT '';
-- ----------------------------------------------------------------------
-- Table `tagente_estado`

View File

@ -165,7 +165,12 @@ if (check_login()) {
break;
case 'monitorcheckmodal':
echo __('This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 40 modules per agent. This configuration has B/A modules per agent. Checkout the Enterprise Version for a professional supported system.');
// Get agent/module average.
$agentCount = db_get_value_sql('SELECT count(*) FROM tagente');
$modulesCount = db_get_value_sql('SELECT count(*) FROM tagente_modulo');
$average = ($modulesCount / $agentCount);
echo __('This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 100 modules per agent. This configuration has %d modules per agent. Checkout the Enterprise Version for a professional supported system.', $average);
break;
case 'remotemodulesmodal':

View File

@ -24,7 +24,16 @@ require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/include/functions_servers.php';
$search_string = io_safe_output(urldecode(trim(get_parameter('search_string', ''))));
$search_string = io_safe_output(
urldecode(
trim(
get_parameter(
'search_string',
''
)
)
)
);
global $policy_page;
@ -32,17 +41,27 @@ if (!isset($policy_page)) {
$policy_page = false;
}
// Search string filter form
echo '<form id="create_module_type" method="post" action="'.$url.'">';
echo '<table width="100%" cellpadding="2" cellspacing="2" class="databox filters" >';
echo "<tr><td class='datos' style='width:20%; font-weight: bold;'>";
echo __('Search').' '.html_print_input_text(
'search_string',
$search_string,
'',
15,
255,
true
);
html_print_input_hidden('search', 1);
// Search string filter form.
if (($policy_page) || (isset($agent))) {
echo '<form id="" method="post" action="">';
} else {
echo '<form id="create_module_type" method="post" action="'.$url.'">';
}
echo '<table width="100%" cellpadding="2" cellspacing="2" class="databox filters" >';
echo "<tr><td class='datos' style='width:20%; font-weight: bold;'>";
echo __('Search').' '.html_print_input_text('search_string', $search_string, '', 15, 255, true);
html_print_input_hidden('search', 1);
echo '</td>';
echo "<td class='datos' style='width:10%'>";
html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"');
@ -50,38 +69,38 @@ echo '</td>';
echo "<td class='datos' style='width:10%'></td>";
echo '</form>';
// Check if there is at least one server of each type available to assign that
// kind of modules. If not, do not show server type in combo
// kind of modules. If not, do not show server type in combo.
$network_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 1'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// POSTGRESQL AND ORACLE COMPATIBLE.
$wmi_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 6'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// POSTGRESQL AND ORACLE COMPATIBLE.
$plugin_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 4'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// POSTGRESQL AND ORACLE COMPATIBLE.
$prediction_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = 5'
);
// POSTGRESQL AND ORACLE COMPATIBLE
// Development mode to use all servers
// POSTGRESQL AND ORACLE COMPATIBLE.
// Development mode to use all servers.
if ($develop_bypass || is_metaconsole()) {
$network_available = 1;
$wmi_available = 1;
$plugin_available = 1;
// FIXME when prediction predictions server modules can be configured
// on metaconsole
// FIXME when prediction predictions server modules can be configured.
// on metaconsole.
$prediction_available = is_metaconsole() ? 0 : 1;
}
@ -140,7 +159,7 @@ if (($policy_page) || (isset($agent))) {
}
if ($show_creation) {
// Create module/type combo
// Create module/type combo.
echo '<form id="create_module_type" method="post" action="'.$url.'">';
if (!$policy_page) {
echo '<td class="datos" style="font-weight: bold; width:20%;">';
@ -151,13 +170,33 @@ if (($policy_page) || (isset($agent))) {
$checked = false;
}
html_print_checkbox('status_hierachy_mode', '', $checked, false, false, 'onChange=change_mod_filter();');
html_print_checkbox(
'status_hierachy_mode',
'',
$checked,
false,
false,
'onChange=change_mod_filter();'
);
echo '</td>';
}
echo '<td class="datos" style="font-weight: bold; width:20%;">';
echo __('<p>Type</p>');
html_print_select($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;');
html_print_select(
$modules,
'moduletype',
'',
'',
'',
'',
false,
false,
false,
'',
false,
'max-width:300px;'
);
html_print_input_hidden('edit_module', 1);
echo '</td>';
echo '<td class="datos" style="width:10%;">';
@ -212,7 +251,13 @@ if ($multiple_delete) {
}
enterprise_include_once('include/functions_config_agents.php');
enterprise_hook('config_agents_delete_module_in_conf', [modules_get_agentmodule_agent($id_agent_module_del), modules_get_agentmodule_name($id_agent_module_del)]);
enterprise_hook(
'config_agents_delete_module_in_conf',
[
modules_get_agentmodule_agent($id_agent_module_del),
modules_get_agentmodule_name($id_agent_module_del),
]
);
$error = 0;
@ -220,7 +265,12 @@ if ($multiple_delete) {
// error. NOTICE that we don't delete all data here, just marking for deletion
// and delete some simple data.
$status = '';
$agent_id_of_module = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', (int) $id_agent_module_del);
$agent_id_of_module = db_get_value(
'id_agente',
'tagente_modulo',
'id_agente_modulo',
(int) $id_agent_module_del
);
if (db_process_sql(
"UPDATE tagente_modulo
@ -235,7 +285,7 @@ if ($multiple_delete) {
) {
$error++;
} else {
// Set flag to update module status count
// Set flag to update module status count.
if ($agent_id_of_module !== false) {
db_process_sql(
'UPDATE tagente
@ -286,32 +336,48 @@ if ($multiple_delete) {
break;
}
// Trick to detect if we are deleting a synthetic module (avg or arithmetic)
// If result is empty then module doesn't have this type of submodules
$ops_json = enterprise_hook('modules_get_synthetic_operations', [$id_agent_module_del]);
// Trick to detect if we are deleting a synthetic module (avg or arithmetic).
// If result is empty then module doesn't have this type of submodules.
$ops_json = enterprise_hook(
'modules_get_synthetic_operations',
[$id_agent_module_del]
);
$result_ops_synthetic = json_decode($ops_json);
if (!empty($result_ops_synthetic)) {
$result = enterprise_hook('modules_delete_synthetic_operations', [$id_agent_module_del]);
$result = enterprise_hook(
'modules_delete_synthetic_operations',
[$id_agent_module_del]
);
if ($result === false) {
$error++;
}
} //end if
else {
$result_components = enterprise_hook('modules_get_synthetic_components', [$id_agent_module_del]);
} else {
$result_components = enterprise_hook(
'modules_get_synthetic_components',
[$id_agent_module_del]
);
$count_components = 1;
if (!empty($result_components)) {
// Get number of components pending to delete to know when it's needed to update orders
// Get number of components pending to delete to know when it's needed to update orders.
$num_components = count($result_components);
$last_target_module = 0;
foreach ($result_components as $id_target_module) {
// Detects change of component or last component to update orders
if (($count_components == $num_components) or ($last_target_module != $id_target_module)) {
// Detects change of component or last component to update orders.
if (($count_components == $num_components) || ($last_target_module != $id_target_module)
) {
$update_orders = true;
} else {
$update_orders = false;
}
$result = enterprise_hook('modules_delete_synthetic_operations', [$id_target_module, $id_agent_module_del, $update_orders]);
$result = enterprise_hook(
'modules_delete_synthetic_operations',
[
$id_target_module,
$id_agent_module_del,
$update_orders,
]
);
if ($result === false) {
$error++;
}
@ -323,7 +389,7 @@ if ($multiple_delete) {
}
// Check for errors
// Check for errors.
if ($error != 0) {
} else {
$count_correct_delete_modules++;
@ -509,7 +575,7 @@ switch ($sortField) {
}
// Build the order sql
// Build the order sql.
if (!empty($order)) {
$order_sql = ' ORDER BY ';
}
@ -525,7 +591,7 @@ foreach ($order as $ord) {
$order_sql .= $ord['field'].' '.$ord['order'];
}
// Get limit and offset parameters
// Get limit and offset parameters.
$limit = (int) $config['block_size'];
$offset = (int) get_parameter('offset');
@ -559,9 +625,15 @@ $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente);
$search_string_entities = io_safe_input($search_string);
$basic_where = sprintf("(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", $search_string, $search_string_entities, $search_string, $search_string_entities);
$basic_where = sprintf(
"(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND",
$search_string,
$search_string_entities,
$search_string,
$search_string_entities
);
// Tags acl
// Tags acl.
$agent_tags = tags_get_user_applied_agent_tags($id_agente);
if ($agent_tags !== true) {
$where_tags = ' AND ttag_module.id_tag IN ('.implode(',', $agent_tags).')';
@ -619,7 +691,7 @@ if ($modules === false) {
return;
}
// Prepare pagination
// Prepare pagination.
$url = '?'.'sec=gagente&'.'tab=module&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$id_agente.'&'.'sort_field='.$sortField.'&'.'&sort='.$sort.'&'.'search_string='.urlencode($search_string);
if ($paginate_module) {
@ -635,17 +707,48 @@ $table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
$table->head = [];
$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[0] = __('Name').ui_get_sorting_arrows($url_name.'up', $url_name.'down', $selectNameUp, $selectNameDown);
$table->head['checkbox'] = html_print_checkbox(
'all_delete',
0,
false,
true,
false
);
$table->head[0] = __('Name').ui_get_sorting_arrows(
$url_name.'up',
$url_name.'down',
$selectNameUp,
$selectNameDown
);
// The access to the policy is granted only with AW permission
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
// The access to the policy is granted only with AW permission.
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl(
$config['id_user'],
$agent['id_grupo'],
'AW'
)
) {
$table->head[1] = "<span title='".__('Policy')."'>".__('P.').'</span>';
}
$table->head[2] = "<span title='".__('Server')."'>".__('S.').'</span>'.ui_get_sorting_arrows($url_server.'up', $url_server.'down', $selectServerUp, $selectServerDown);
$table->head[3] = __('Type').ui_get_sorting_arrows($url_type.'up', $url_type.'down', $selectTypeUp, $selectTypeDown);
$table->head[4] = __('Interval').ui_get_sorting_arrows($url_interval.'up', $url_interval.'down', $selectIntervalUp, $selectIntervalDown);
$table->head[2] = "<span title='".__('Server')."'>".__('S.').'</span>'.ui_get_sorting_arrows(
$url_server.'up',
$url_server.'down',
$selectServerUp,
$selectServerDown
);
$table->head[3] = __('Type').ui_get_sorting_arrows(
$url_type.'up',
$url_type.'down',
$selectTypeUp,
$selectTypeDown
);
$table->head[4] = __('Interval').ui_get_sorting_arrows(
$url_interval.'up',
$url_interval.'down',
$selectIntervalUp,
$selectIntervalDown
);
$table->head[5] = __('Description');
$table->head[6] = __('Status');
$table->head[7] = __('Warn');
@ -690,7 +793,16 @@ if ($checked) {
}
foreach ($modules as $module) {
if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && ! check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) {
if (! check_acl_one_of_groups(
$config['id_user'],
$all_groups,
'AW'
) && ! check_acl_one_of_groups(
$config['id_user'],
$all_groups,
'AD'
)
) {
continue;
}
@ -712,7 +824,9 @@ foreach ($modules as $module) {
if (!$checked) {
if ($module['id_module_group'] != $last_modulegroup) {
$last_modulegroup = $module['id_module_group'];
$data[0] = '<strong>'.modules_get_modulegroup_name($last_modulegroup).'</strong>';
$data[0] = '<strong>'.modules_get_modulegroup_name(
$last_modulegroup
).'</strong>';
$i = array_push($table->data, $data);
$table->rowstyle[($i - 1)] = 'text-align: center';
$table->rowclass[($i - 1)] = 'datos3';
@ -727,14 +841,23 @@ foreach ($modules as $module) {
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
$data['checkbox'] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true);
$data['checkbox'] = html_print_checkbox(
'id_delete[]',
$module['id_agente_modulo'],
false,
true
);
}
$data[0] = '';
if (isset($module['deep']) && ($module['deep'] != 0)) {
$data[0] .= str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $module['deep']);
$data[0] .= html_print_image('images/icono_escuadra.png', true, ['style' => 'padding-bottom: inherit;']).'&nbsp;&nbsp;';
$data[0] .= html_print_image(
'images/icono_escuadra.png',
true,
['style' => 'padding-bottom: inherit;']
).'&nbsp;&nbsp;';
}
if ($module['quiet']) {
@ -754,17 +877,38 @@ foreach ($modules as $module) {
}
if ($module['disabled']) {
$data[0] .= '<em class="disabled_module">'.ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[&hellip;]', 'font-size: 7.2pt').'</em>';
$data[0] .= '<em class="disabled_module">'.ui_print_truncate_text(
$module['nombre'],
'module_medium',
false,
true,
true,
'[&hellip;]',
'font-size: 7.2pt'
).'</em>';
} else {
$data[0] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[&hellip;]', 'font-size: 7.2pt');
$data[0] .= ui_print_truncate_text(
$module['nombre'],
'module_medium',
false,
true,
true,
'[&hellip;]',
'font-size: 7.2pt'
);
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
$data[0] .= '</a>';
}
// The access to the policy is granted only with AW permission
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
// The access to the policy is granted only with AW permission.
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl(
$config['id_user'],
$agent['id_grupo'],
'AW'
)
) {
$policyInfo = policies_info_module_policy($module['id_agente_modulo']);
if ($policyInfo === false) {
$data[1] = '';
@ -798,17 +942,27 @@ foreach ($modules as $module) {
}
}
// Module type (by server type )
// Module type (by server type ).
$data[2] = '';
if ($module['id_modulo'] > 0) {
$data[2] = servers_show_type($module['id_modulo']);
}
$module_status = db_get_row('tagente_estado', 'id_agente_modulo', $module['id_agente_modulo']);
$module_status = db_get_row(
'tagente_estado',
'id_agente_modulo',
$module['id_agente_modulo']
);
modules_get_status($module['id_agente_modulo'], $module_status['estado'], $module_status['datos'], $status, $title);
modules_get_status(
$module['id_agente_modulo'],
$module_status['estado'],
$module_status['datos'],
$status,
$title
);
// This module is initialized ? (has real data)
// This module is initialized ? (has real data).
if ($status == STATUS_MODULE_NO_DATA) {
$data[2] .= html_print_image(
'images/error.png',
@ -817,13 +971,13 @@ foreach ($modules as $module) {
);
}
// Module type (by data type)
// Module type (by data type).
$data[3] = '';
if ($type) {
$data[3] = ui_print_moduletype_icon($type, true);
}
// Module interval
// Module interval.
if ($module['module_interval']) {
$data[4] = human_time_description_raw($module['module_interval']);
} else {
@ -831,12 +985,23 @@ foreach ($modules as $module) {
}
if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) {
$data[4] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true);
$data[4] .= ui_print_help_tip(
__('The policy modules of data type will only update their intervals when policy is applied.'),
true
);
}
$data[5] = ui_print_truncate_text($module['descripcion'], 'description', false);
$data[5] = ui_print_truncate_text(
$module['descripcion'],
'description',
false
);
$data[6] = ui_print_status_image($status, htmlspecialchars($title), true);
$data[6] = ui_print_status_image(
$status,
htmlspecialchars($title),
true
);
// MAX / MIN values.
if ($module['id_tipo_modulo'] != 25) {
@ -884,7 +1049,7 @@ foreach ($modules as $module) {
);
$data[8] .= '</a> ';
// Make a data normalization
// Make a data normalization.
if (isset($numericModules[$type])) {
if ($numericModules[$type] === true) {
$data[8] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&fix_module='.$module['id_agente_modulo'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
@ -904,7 +1069,7 @@ foreach ($modules as $module) {
$data[8] .= '&nbsp;&nbsp;';
}
// create network component action
// Create network component action.
if ((is_user_admin($config['id_user']))
&& ($module['id_modulo'] == MODULE_NETWORK)
) {
@ -927,7 +1092,7 @@ foreach ($modules as $module) {
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
// Delete module
// Delete module.
$data[9] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo'].'"
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[9] .= html_print_image(
@ -959,7 +1124,12 @@ html_print_table($table);
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('multiple_delete', 1);
html_print_submit_button(__('Delete'), 'multiple_delete', false, 'class="sub delete"');
html_print_submit_button(
__('Delete'),
'multiple_delete',
false,
'class="sub delete"'
);
echo '</div>';
echo '</form>';
}

View File

@ -464,6 +464,8 @@ $data[1] = html_print_select(
$disabledBecauseInPolicy
);
$data[1] .= '<br> <br><a class="info_cell" href="'.ui_get_full_url('index.php?sec=gagente&sec2=godmode/groups/group_list&tab=credbox').'">'.__('Manage credentials').'</a>';
$array_os = [
'inherited' => __('Inherited'),
'linux' => __('SSH'),

View File

@ -60,7 +60,7 @@ if ($al_action !== false) {
__('Alerts').' &raquo; '.__('Configure alert action'),
'images/gm_alerts.png',
false,
'',
'alert_config',
true
);
}
@ -73,7 +73,7 @@ if ($al_action !== false) {
__('Alerts').' &raquo; '.__('Configure alert action'),
'images/gm_alerts.png',
false,
'',
'alert_config',
true
);
}
@ -283,12 +283,12 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
// Store the value in a hidden to keep it on first execution
$table->data['field'.$i][1] .= html_print_input_hidden(
'field'.$i.'_value',
!empty($action['field'.$i]) ? $action['field'.$i] : '',
(!empty($action['field'.$i]) || $action['field'.$i] == 0) ? $action['field'.$i] : '',
true
);
$table->data['field'.$i][2] .= html_print_input_hidden(
'field'.$i.'_recovery_value',
!empty($action['field'.$i.'_recovery']) ? $action['field'.$i.'_recovery'] : '',
(!empty($action['field'.$i.'_recovery']) || $action['field'.$i] == 0) ? $action['field'.$i.'_recovery'] : '',
true
);
}

View File

@ -35,12 +35,15 @@ global $config;
check_login();
enterprise_hook('open_meta_frame');
require_once $config['homedir'].'/include/functions_groups.php';
require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/include/functions_users.php';
enterprise_include_once('meta/include/functions_agents_meta.php');
if (is_metaconsole()) {
enterprise_include_once('include/functions_metaconsole.php');
enterprise_include_once('meta/include/functions_agents_meta.php');
enterprise_hook('open_meta_frame');
}
if (is_ajax()) {
if (! check_acl($config['id_user'], 0, 'AR')) {
@ -714,7 +717,12 @@ if ($tab == 'tree') {
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'];
if (is_metaconsole()) {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups';
} else {
$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] = '<a href="'.$url.'">'.$group['nombre'].'</a>';
if ($group['icon'] != '') {

View File

@ -164,9 +164,9 @@ echo '</div></td></tr>';
echo "<tr><td class='datos2'><b>".__('Percentil').'</b></td>';
echo "<td class='datos2'>".html_print_checkbox('percentil', 1, $percentil, true).'</td>';
echo "<td class='datos2'><div id='thresholdDiv' name='thresholdDiv'><b>".__('Equalize maximum thresholds').'</b>';
html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, false, false, '', false);
echo '</div></td></tr>';
echo "<td class='datos2 thresholdDiv'><b>".__('Equalize maximum thresholds').'</b></td>';
echo "<td class='datos2 thresholdDiv'>".html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, true, false, '', false);
echo '</td></tr>';
echo "<tr><td class='datos2'><b>".__('Add summatory series').'</b></td>';
echo "<td class='datos2'>".html_print_checkbox('summatory_series', 1, $summatory_series, true)."</td>
<td class='datos2'><b>".__('Add average series').'</b></td>';
@ -175,6 +175,7 @@ echo "<tr><td class='datos2'><b>".__('Modules and series').'</b></td>';
echo "<td class='datos2'>".html_print_checkbox('modules_series', 1, $modules_series, true).'</td>';
echo "<td class='datos2'><b>".__('Show full scale graph (TIP)').'</td>';
echo "<td class='datos2'>".html_print_checkbox('fullscale', 1, $fullscale, true).'</td>';
echo '</tr>';
echo '</table>';
@ -190,9 +191,9 @@ echo '</form>';
echo '<script type="text/javascript">
$(document).ready(function() {
if ($("#stacked").val() == '.CUSTOM_GRAPH_BULLET_CHART.') {
$("#thresholdDiv").show();
$(".thresholdDiv").show();
}else{
$("#thresholdDiv").hide();
$(".thresholdDiv").hide();
}
if(!$("#checkbox-summatory_series").is(":checked") && !$("#checkbox-average_series").is(":checked")){
@ -207,16 +208,16 @@ echo '<script type="text/javascript">
$("[name=threshold]").prop("checked", false);
$(".stacked").hide();
$("input[name=\'width\']").hide();
$("#thresholdDiv").hide();
$(".thresholdDiv").hide();
} else if ($(this).val() == '.CUSTOM_GRAPH_BULLET_CHART.') {
$("#thresholdDiv").show();
$(".thresholdDiv").show();
$(".stacked").show();
$("input[name=\'width\']").show();
} else {
$("[name=threshold]").prop("checked", false);
$(".stacked").show();
$("input[name=\'width\']").show();
$("#thresholdDiv").hide();
$(".thresholdDiv").hide();
}
});

View File

@ -170,6 +170,7 @@ if ($schedule_report != '') {
$parameters[4] = get_parameter('report_type', '');
$parameters['first_execution'] = strtotime($date.' '.$time);
$values = [
'id_usuario' => $config['id_user'],
'id_user_task' => $id_user_task,
@ -180,9 +181,11 @@ if ($schedule_report != '') {
$result = db_process_sql_insert('tuser_task_scheduled', $values);
$report_type = $parameters[4];
ui_print_result_message(
$result,
__('Your report has been planned, and the system will email you a PDF with the report as soon as its finished'),
__('Your report has been planned, and the system will email you a '.$report_type.' file with the report as soon as its finished'),
__('An error has ocurred')
);
echo '<br>';

View File

@ -25,7 +25,7 @@ if (is_ajax()) {
$method = (string) get_parameter('method', '');
$action = (string) get_parameter('action', '');
$target_ip = (string) get_parameter('target_ip', '');
$community = (string) get_parameter('community', '');
$community = (string) io_safe_output((get_parameter('community', '')));
$snmp_version = (string) get_parameter('snmp_browser_version', '');
$snmp3_auth_user = io_safe_output(get_parameter('snmp3_browser_auth_user'));
$snmp3_security_level = get_parameter('snmp3_browser_security_level');

View File

@ -20,8 +20,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC200727';
$pandora_version = 'v7.0NG.747';
$build_version = 'PC200810';
$pandora_version = 'v7.0NG.748';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -3209,7 +3209,7 @@ function get_refresh_time_array()
}
function date2strftime_format($date_format)
function date2strftime_format($date_format, $timestamp=null)
{
$replaces_list = [
'D' => '%a',
@ -3232,11 +3232,14 @@ function date2strftime_format($date_format)
'A' => '%p',
'i' => '%M',
's' => '%S',
'u' => '%s',
'O' => '%z',
'T' => '%Z',
'%' => '%%',
'G' => '%k',
'z' => '%j',
'U' => '%s',
'c' => '%FT%T%z',
'r' => '%d %b %Y %H:%M:%S %z',
];
$return = '';
@ -3249,7 +3252,30 @@ function date2strftime_format($date_format)
if (isset($replaces_list[$c])) {
$return .= $replaces_list[$c];
} else {
$return .= $c;
// Check extra formats.
switch ($date_format) {
default: $return .= date($date_format, $timestamp);
break;
case 'n':
if (stristr(PHP_OS, 'win')) {
$return .= '%#m';
} else {
$return .= '%-m';
}
case 'u':
if (preg_match('/^[0-9]*\\.([0-9]+)$/', $timestamp, $reg)) {
$decimal = substr(str_pad($reg[1], 6, '0'), 0, 6);
} else {
$decimal = '000000';
}
$return .= $decimal;
break;
break;
}
}
}

View File

@ -728,7 +728,7 @@ function notifications_print_source_select_box(
"
<div class='global-config-notification-single-selector'>
<div>
<h4>%s</h4>
<h5>%s</h5>
%s
</div>
<div class='global-notifications-icons'>

View File

@ -273,7 +273,7 @@ function snmp_browser_get_tree(
break;
case '2':
$snmp_version = SNMP::VERSION_2c;
$snmp_version = SNMP::VERSION_2C;
break;
case '2c':
@ -286,7 +286,7 @@ function snmp_browser_get_tree(
break;
default:
$snmp_version = SNMP::VERSION_2c;
$snmp_version = SNMP::VERSION_2C;
break;
}
@ -421,6 +421,10 @@ function snmp_browser_get_oid(
return;
}
if ($version == '2') {
$version = '2c';
}
$output = get_snmpwalk(
$target_ip,
$version,

View File

@ -541,8 +541,9 @@ function ui_print_timestamp($unixtime, $return=false, $option=[])
pandora_setlocale();
$title = human_time_comparation($unixtime);
$strf_format = date2strftime_format($config['date_format'], $unixtime);
$data = strftime(
date2strftime_format($config['date_format']),
$strf_format,
$unixtime
);
} else if ($prominent == 'compact') {

View File

@ -53,6 +53,23 @@ function update_manager_verify_registration()
return false;
}
/**
* Check if a trial license is in use.
*
* @return boolean true if a trial license is in use, false otherwise.
*/
function update_manager_verify_trial()
{
global $config;
if (isset($config['license_licensed_to'])
&& strstr($config['license_licensed_to'], 'info@pandorafms.com') !== FALSE
) {
return true;
}
return false;
}
/**
* Parses responses from configuration wizard.
@ -440,6 +457,11 @@ function registration_wiz_modal(
global $config;
$output = '';
// Do not show the wizard for trial licenses.
if (update_manager_verify_trial()) {
return '';
}
$product_name = get_product_name();
$output .= '<div id="registration_wizard" title="';

View File

@ -1952,7 +1952,15 @@ function isReachable(url) {
* Gets server origin url
*/
function getServerUrl() {
return $("#php_to_js_value_absolute_homeurl").val() || window.location.origin;
var server_url;
try {
server_url = get_php_value("homeurl");
} catch (SyntaxError) {
console.warn("Pandora homeurl cannot be found.");
server_url = window.location.origin + "/pandora_console";
}
return server_url;
}
/**

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -183,7 +183,9 @@ class SystemGroupStatusWidget extends Widget
$values = parent::decoders($decoder);
if (isset($decoder['status']) === true) {
if (is_array($decoder['status']) === true) {
if (is_array($decoder['status']) === true
&& count($decoder['status']) > 1
) {
$compatibilityStatus = [];
foreach ($decoder['status'] as $key => $value) {
switch ((int) $value) {

View File

@ -128,8 +128,8 @@
</div>
<div style='height: 10px'>
<?php
$version = '7.0NG.747';
$build = '200727';
$version = '7.0NG.748';
$build = '200810';
$banner = "v$version Build $build";
error_reporting(0);
@ -965,9 +965,12 @@ function install_step4()
$step5 = mysqli_query(
$connection,
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host
IDENTIFIED BY '".$random_password."'"
"CREATE USER pandora@$host IDENTIFIED BY '".$random_password."'"
);
$step5 |= mysqli_query(
$connection,
"GRANT ALL PRIVILEGES ON `$dbname`.* to pandora@$host"
);
mysqli_query($connection, 'FLUSH PRIVILEGES');
check_generic($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>");

View File

@ -150,7 +150,7 @@ $sort = get_parameter('sort', 'up');
$modules_not_init = agents_monitor_notinit($id_agente);
if (empty($modules_not_init) === false) {
$help_not_init = ui_print_warning_message(
__('No initialized modules found.')
__('Non-initialized modules found.')
);
} else {
$help_not_init = '';

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.747
%define release 200727
%define version 7.0NG.748
%define release 200810
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.747
%define release 200727
%define version 7.0NG.748
%define release 200810
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.747
%define release 200727
%define version 7.0NG.748
%define release 200810
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.747"
PI_VERSION="7.0NG.748"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -1073,7 +1073,7 @@ CREATE TABLE IF NOT EXISTS `tserver` (
`checksum` tinyint(3) unsigned NOT NULL default '0',
`description` varchar(255) default NULL,
`recon_server` tinyint(3) unsigned NOT NULL default '0',
`version` varchar(20) NOT NULL default '',
`version` varchar(25) NOT NULL default '',
`plugin_server` tinyint(3) unsigned NOT NULL default '0',
`prediction_server` tinyint(3) unsigned NOT NULL default '0',
`wmi_server` tinyint(3) unsigned NOT NULL default '0',

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.747-200727
Version: 7.0NG.748-200810
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.747-200727"
pandora_version="7.0NG.748-200810"
package_cpan=0
package_pandora=1

View File

@ -1,7 +1,7 @@
#############################################################################
# Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.747
# Version 7.0NG.748
# Licensed under GPL license v2,
# (c) 2003-2017 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -44,8 +44,8 @@ our @EXPORT = qw(
);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.747";
my $pandora_build = "200727";
my $pandora_version = "7.0NG.748";
my $pandora_build = "200810";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -1190,7 +1190,7 @@ sub pandora_execute_action ($$$$$$$$$;$) {
_server_name_ => (defined ($agent)) ? $agent->{'server_name'} : '',
_target_ip_ => (defined ($module)) ? $module->{'ip_target'} : '',
_target_port_ => (defined ($module)) ? $module->{'tcp_port'} : '',
_policy_ => undef,
_policy_ => (defined ($module)) ? get_db_value ($dbh, "SELECT name FROM tpolicies WHERE id = ?", get_db_value ($dbh, "SELECT id_policy FROM tpolicy_modules WHERE id = ?", $module->{'id_policy_module'})) : '',
_plugin_parameters_ => (defined ($module)) ? $module->{'plugin_parameter'} : '',
_email_tag_ => undef,
_phone_tag_ => undef,
@ -4346,6 +4346,12 @@ sub check_min_max ($$$$) {
# Out of bounds
if (($module->{'max'} != $module->{'min'}) && ($data > $module->{'max'} || $data < $module->{'min'})) {
if($module->{'max'} < $module->{'min'}) {
# Compare if there is only setted min or max.
return 1 unless (($module->{'max'} == 0 && $data < $module->{'min'}) || ($module->{'min'} == 0 && $data > $module->{'max'}));
}
logger($pa_config, "Received invalid data '" . $data . "' from agent '" . $agent->{'nombre'} . "' module '" . $module->{'nombre'} . "' agent " . (defined ($agent) ? "'" . $agent->{'nombre'} . "'" : 'ID ' . $module->{'id_agente'}) . ".", 3);
return 0;
}

View File

@ -32,8 +32,8 @@ use base 'Exporter';
our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.747";
my $pandora_build = "200727";
my $pandora_version = "7.0NG.748";
my $pandora_build = "200810";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -434,8 +434,11 @@ sub sendmail {
socket_write("STARTTLS$CRLF") || return fail("send STARTTLS error");
socket_read()
|| return fail('STARTTLS error');
IO::Socket::SSL->start_SSL($S, SSL_hostname => $server, SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE())
|| return fail("start_SSL failed");
{
local $SIG{__DIE__};
IO::Socket::SSL->start_SSL($S, SSL_hostname => $server, SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE())
|| return fail("start_SSL failed");
};
# The client SHOULD send an EHLO command as the
# first command after a successful TLS negotiation.

View File

@ -203,11 +203,30 @@ sub data_consumer ($$) {
my @row = split(/\|/, $output[2]);
# Get the specified column
$module_data = $row[$module->{'tcp_port'}] if (defined ($module->{'tcp_port'}) && defined ($row[$module->{'tcp_port'}]));
if ($module_data =~ m/^ERROR/) {
pandora_update_module_on_error ($pa_config, $module, $dbh);
return;
}
if (defined ($module->{'tcp_port'})) {
$wmi_query =~ m/SELECT\s(.+)\sFROM/ig;
my @wmi_columns = split /\s*,\s*/, $1;
my $selected_col = $wmi_columns[$module->{'tcp_port'}];
# Get result col number
my @output_col = split(/\|/, $output[1]);
# Find column number
my $col_number;
for(my $i = 0; $i < @output_col; $i++ ) {
if( $output_col[$i] =~ /$selected_col/ ) {
$col_number = $i;
last;
}
}
$module_data = $row[$col_number] if (defined ($col_number) && defined ($row[$col_number]));
if ($module_data =~ m/^ERROR/) {
pandora_update_module_on_error ($pa_config, $module, $dbh);
return;
}
}
# Regexp
if ($module->{'snmp_community'} ne ''){

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.747
%define release 200727
%define version 7.0NG.748
%define release 200810
Summary: Pandora FMS Server
Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.747
%define release 200727
%define version 7.0NG.748
%define release 200810
Summary: Pandora FMS Server
Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.747"
PI_BUILD="200727"
PI_VERSION="7.0NG.748"
PI_BUILD="200810"
MODE=$1
if [ $# -gt 1 ]; then
@ -229,21 +229,15 @@ install () {
echo " "
echo "For FreeBSD do : "
echo " "
echo " Install perl5.8 or later from ports with thread enabled."
echo " (perl-5.8.x.pkg can not be used.)"
echo " # cd /usr/ports/lang/perl5.8"
echo " # make config"
echo " -> Enable THREADS."
echo " # make"
echo " # make install"
echo " "
echo " Install following tools from ports. Don't use packages."
echo " Install following tools from ports or packages."
echo " Recommended: p5-DBI p5-NetAddr-IP p5-XML-Simple p5-XML-Twig p5-HTML-Parser p5-DBD-mysql p5-Socket6 p5-IO-Socket-INET6 p5-JSON"
echo " Optional: nmap xprobe"
echo " "
echo "To get it from source through CPAN do"
echo " And install Geo::IP manually."
echo " "
echo " $ cpan Time::Local DBI Socket6 XML::Simple XML::Twig IO::Socket Time::HiRes NetAddr::IP HTML::Entities IO::Socket::INET6 JSON"
echo "To get them from source through CPAN do"
echo " "
echo " $ cpan Time::Local DBI Socket6 XML::Simple XML::Twig IO::Socket Time::HiRes NetAddr::IP HTML::Entities IO::Socket::INET6 JSON Geo::IP"
echo " "
rm output
exit 1
@ -392,6 +386,23 @@ install () {
mkdir -p $DESTDIR$PANDORA_HOME 2> /dev/null
cp -R util $DESTDIR$PANDORA_HOME
find $DESTDIR$PANDORA_HOME -type l -delete
case $DISTRO in
FreeBSD)
# adjust shebang
for pl_script in `find $DESTDIR$PANDORA_HOME/util -name "*.pl"`
do
cat $pl_script | sed 's/^#!\/usr\/bin\/perl/#!\/usr\/local\/bin\/perl/g' > ${pl_script}.new
mv ${pl_script}.new $pl_script
chmod a+x $pl_script
done
for sh_script in `find $DESTDIR$PANDORA_HOME/util -name "*.sh"`
do
cat $sh_script | sed 's/^#!\/bin\/bash/#!\/usr\/local\/bin\/bash/g' > ${sh_script}.new
mv ${sh_script}.new $sh_script
chmod a+x $sh_script
done
;;
esac
# install cron job
if [ -d /etc/cron.hourly ]

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.747 PS200727";
my $version = "7.0NG.748 PS200810";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.747 PS200727";
my $version = "7.0NG.748 PS200810";
# save program name for logging
my $progname = basename($0);
@ -1129,8 +1129,13 @@ sub cli_create_agent() {
exist_check($id_group,'operating system',$group_name);
my $agent_exists = get_agent_id($dbh,$agent_name);
non_exist_check($agent_exists, 'agent name', $agent_name);
pandora_create_agent ($conf, $server_name, $agent_name, $address, $id_group, 0, $os_id, $description, $interval, $dbh,
my $agent_id = pandora_create_agent ($conf, $server_name, $agent_name, $address, $id_group, 0, $os_id, $description, $interval, $dbh,
undef, undef, undef, undef, undef, undef, undef, undef, $agent_alias);
# Create address for this agent in taddress.
if (defined($address)) {
pandora_add_agent_address($conf, $agent_id, $agent_name, $address, $dbh);
}
}
##############################################################################