Merge remote-tracking branch 'origin' into ent-7662-rebranding-meta

This commit is contained in:
Jose Gonzalez 2021-09-29 14:21:23 +02:00
commit 0a0d055252
51 changed files with 680 additions and 100 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.757-210927 Version: 7.0NG.757-210929
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.757'; use constant AGENT_VERSION => '7.0NG.757';
use constant AGENT_BUILD => '210927'; use constant AGENT_BUILD => '210929';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.757 %define version 7.0NG.757
%define release 210927 %define release 210929
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.757 %define version 7.0NG.757
%define release 210927 %define release 210929
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.757" PI_VERSION="7.0NG.757"
PI_BUILD="210927" PI_BUILD="210929"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210927} {210929}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.757 Build 210927") #define PANDORA_VERSION ("7.0NG.757 Build 210929")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.757-210927 Version: 7.0NG.757-210929
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -1,8 +1,14 @@
START TRANSACTION; START TRANSACTION;
ALTER TABLE `treport_content` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_conditions` int(10) unsigned NOT NULL default 0; ALTER TABLE `tevent_alert` ADD COLUMN `id_template_conditions` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_fields` int(10) unsigned NOT NULL default 0; ALTER TABLE `tevent_alert` ADD COLUMN `id_template_fields` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_filter` ADD COLUMN `time_from` TIME NULL; ALTER TABLE `tevent_filter` ADD COLUMN `time_from` TIME NULL;
ALTER TABLE `tevent_filter` ADD COLUMN `time_to` TIME NULL; ALTER TABLE `tevent_filter` ADD COLUMN `time_to` TIME NULL;
COMMIT; COMMIT;

View File

@ -898,6 +898,9 @@ ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNE
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content_template` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content_template` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
-- Table `tnews` -- Table `tnews`
@ -1776,6 +1779,9 @@ ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NUL
ALTER TABLE `treport_content` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content` ADD COLUMN `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content` ADD COLUMN `graph_render` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` MODIFY `external_source` MEDIUMTEXT; ALTER TABLE `treport_content` MODIFY `external_source` MEDIUMTEXT;
ALTER TABLE `treport_content` ADD COLUMN `ipam_network_filter` int(10) UNSIGNED DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `treport_content` ADD COLUMN `ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tmodule_relationship` -- Table `tmodule_relationship`

View File

@ -861,10 +861,16 @@ foreach ($simple_alerts as $alert) {
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$policyInfo = policies_is_alert_in_policy2($alert['id'], false); $policyInfo = policies_is_alert_in_policy2($alert['id'], false);
if ($policyInfo === false) { $module_linked = policies_is_module_linked($alert['id_agent_module']);
$data[1] .= ''; if (is_array($policyInfo) === false && $module_linked === false) {
$data[$index['policy']] = '';
} else { } else {
$img = 'images/policies_mc.png'; $module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$img = 'images/policies_mc.png';
}
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>'; $data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
} }
@ -886,7 +892,7 @@ foreach ($simple_alerts as $alert) {
] ]
); );
} else { } else {
if ((int) $alert['id_policy_alerts'] === 0) { if ((int) $alert['id_policy_alerts'] === 0 || $module_linked === '0') {
$data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">'; $data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">';
$data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']); $data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']);
$data[4] .= '</a>'; $data[4] .= '</a>';

View File

@ -399,6 +399,12 @@ switch ($action) {
$sla_sorted_by = $item['top_n']; $sla_sorted_by = $item['top_n'];
break; break;
case 'IPAM_network':
$network_filter = $item['ipam_network_filter'];
$alive_ip = $item['ipam_alive_ips'];
$agent_not_assigned_to_ip = $item['ipam_ip_not_assigned_to_agent'];
break;
case 'monitor_report': case 'monitor_report':
$description = $item['description']; $description = $item['description'];
$idAgentModule = $item['id_agent_module']; $idAgentModule = $item['id_agent_module'];
@ -1068,6 +1074,51 @@ $class = 'databox filters';
</td> </td>
</tr> </tr>
<tr id="row_network_filter" class="datos">
<td class="bolder"><?php echo __('Filter by network'); ?></td>
<td>
<?php
$sql = 'SELECT id, CONCAT(name_network, " (", network, ")")
FROM tipam_network';
html_print_select_from_sql(
$sql,
'network_filter',
$network_filter,
'',
'',
'0'
);
?>
</td>
</tr>
<tr id="row_alive_ip" class="datos">
<td class="bolder"><?php echo __('Show alive IPs only'); ?></td>
<td>
<?php
html_print_checkbox_switch(
'alive_ip',
1,
$alive_ip
);
?>
</td>
</tr>
<tr id="row_agent_not_assigned_to_ip" class="datos">
<td class="bolder"><?php echo __('Show IPs not assigned to an agent'); ?></td>
<td>
<?php
html_print_checkbox_switch(
'agent_not_assigned_to_ip',
1,
$agent_not_assigned_to_ip
);
?>
</td>
</tr>
<tr id="row_period" class="datos"> <tr id="row_period" class="datos">
<td class="bolder"> <td class="bolder">
<?php <?php
@ -5514,7 +5565,9 @@ function chooseType() {
$("#row_agent_version").hide(); $("#row_agent_version").hide();
$("#row_agent_remote_conf").hide(); $("#row_agent_remote_conf").hide();
$("#row_module_free_search").hide(); $("#row_module_free_search").hide();
$("#row_network_filter").hide();
$("#row_alive_ip").hide();
$("#row_agent_not_assigned_to_ip").hide();
// SLA list default state. // SLA list default state.
$("#sla_list").hide(); $("#sla_list").hide();
@ -6231,6 +6284,13 @@ function chooseType() {
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
case 'IPAM_network':
$("#row_network_filter").show();
$("#row_alive_ip").show();
$("#row_agent_not_assigned_to_ip").show();
$("#row_historical_db_check").hide();
break;
case 'permissions_report': case 'permissions_report':
$("#row_description").show(); $("#row_description").show();
$("#row_users").show(); $("#row_users").show();

View File

@ -1832,6 +1832,13 @@ switch ($action) {
$good_format = true; $good_format = true;
break; break;
case 'IPAM_network':
$values['ipam_network_filter'] = get_parameter('network_filter');
$values['ipam_alive_ips'] = get_parameter('alive_ip');
$values['ipam_ip_not_assigned_to_agent'] = get_parameter('agent_not_assigned_to_ip');
$good_format = true;
break;
default: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter( $values['top_n'] = get_parameter(
@ -2229,6 +2236,14 @@ switch ($action) {
$values['external_source'] = json_encode($es); $values['external_source'] = json_encode($es);
break; break;
case 'IPAM_network':
$es['network_filter'] = get_parameter('network_filter');
$es['alive_ip'] = get_parameter('alive_ip');
$es['agent_not_assigned_to_ip'] = get_parameter('agent_not_assigned_to_ip');
// $values['external_source'] = json_encode($es);
break;
default: default:
// Default. // Default.
break; break;
@ -2536,6 +2551,10 @@ switch ($action) {
); );
} }
$values['ipam_network_filter'] = get_parameter('network_filter', 0);
$values['ipam_alive_ips'] = get_parameter('alive_ip', 0);
$values['ipam_ip_not_assigned_to_agent'] = get_parameter('agent_not_assigned_to_ip', 0);
$values['only_display_wrong'] = (int) get_parameter( $values['only_display_wrong'] = (int) get_parameter(
'checkbox_only_display_wrong', 'checkbox_only_display_wrong',
0 0
@ -2869,6 +2888,12 @@ switch ($action) {
$values['external_source'] = json_encode($es); $values['external_source'] = json_encode($es);
break; break;
case 'IPAM_network':
$es['network_filter'] = get_parameter('network_filter');
$es['alive_ip'] = get_parameter('alive_ip');
$es['agent_not_assigned_to_ip'] = get_parameter('agent_not_assigned_to_ip');
break;
default: default:
// Default. // Default.
break; break;

View File

@ -40,6 +40,7 @@ if (is_ajax() === true) {
include_once $config['homedir'].'/include/class/TreeGroup.class.php'; include_once $config['homedir'].'/include/class/TreeGroup.class.php';
include_once $config['homedir'].'/include/class/TreeService.class.php'; include_once $config['homedir'].'/include/class/TreeService.class.php';
include_once $config['homedir'].'/include/class/TreeGroupEdition.class.php'; include_once $config['homedir'].'/include/class/TreeGroupEdition.class.php';
enterprise_include_once('include/class/TreeIPAMSupernet.class.php');
enterprise_include_once('include/class/TreePolicies.class.php'); enterprise_include_once('include/class/TreePolicies.class.php');
enterprise_include_once('include/class/TreeGroupMeta.class.php'); enterprise_include_once('include/class/TreeGroupMeta.class.php');
include_once $config['homedir'].'/include/functions_reporting.php'; include_once $config['homedir'].'/include/functions_reporting.php';
@ -190,6 +191,18 @@ if (is_ajax() === true) {
); );
break; break;
case 'IPAM_supernets':
$tree = new TreeIPAMSupernet(
$type,
$rootType,
$id,
$rootID,
$serverID,
$childrenMethod,
$access
);
break;
default: default:
// No error handler. // No error handler.
return; return;

View File

@ -3205,6 +3205,16 @@ class NetworkMap
-1, -1,
true true
); );
$table->data[0][2] = html_print_checkbox(
'group_recursion',
0,
false,
true,
false,
'choose_group_for_show_agents()'
).__('Recursion');
$table->data[1][0] = __('Agents'); $table->data[1][0] = __('Agents');
$table->data[1][1] = html_print_select( $table->data[1][1] = html_print_select(
[-1 => __('None')], [-1 => __('None')],

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC210927'; $build_version = 'PC210929';
$pandora_version = 'v7.0NG.757'; $pandora_version = 'v7.0NG.757';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -3072,7 +3072,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
$ni_by_agents = []; $ni_by_agents = [];
foreach ($agents as $agent) { foreach ($agents as $agent) {
$agent_id = $agent['id_agente']; $agent_id = (isset($agent['id_agente'])) ? $agent['id_agente'] : $agent;
$agent_group_id = $agent['id_grupo']; $agent_group_id = $agent['id_grupo'];
$agent_name = $agent['alias']; $agent_name = $agent['alias'];
$agent_interfaces = []; $agent_interfaces = [];

View File

@ -4062,7 +4062,7 @@ function networkmap_get_new_nodes_and_links($networkmap, $x, $y)
true true
); );
} else { } else {
if ($map_filter['dont_show_subgroups'] == 'true') { if ($map_filter['dont_show_subgroups'] == 'true' && $map_filter['dont_show_subgroups'] !== 0) {
// Show only current selected group. // Show only current selected group.
$filter['id_grupo'] = $networkmap['id_group']; $filter['id_grupo'] = $networkmap['id_group'];
} else { } else {

View File

@ -757,6 +757,13 @@ function reporting_make_reporting_data(
); );
break; break;
case 'IPAM_network':
$report['contents'][] = reporting_ipam(
$report,
$content
);
break;
case 'agent_detailed_event': case 'agent_detailed_event':
case 'event_report_agent': case 'event_report_agent':
$report_control = io_safe_output( $report_control = io_safe_output(

View File

@ -389,6 +389,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
reporting_html_inventory_changes($table, $item); reporting_html_inventory_changes($table, $item);
break; break;
case 'IPAM_network':
reporting_enterprise_html_ipam($table, $item, $mini);
break;
case 'agent_detailed_event': case 'agent_detailed_event':
case 'event_report_agent': case 'event_report_agent':
reporting_html_event_report_agent($table, $item); reporting_html_event_report_agent($table, $item);

View File

@ -686,6 +686,13 @@ function reports_get_report_types($template=false, $not_editor=false)
'name' => __('Module Histogram graph'), 'name' => __('Module Histogram graph'),
]; ];
if ($config['enterprise_installed'] && is_metaconsole() === false) {
$types['IPAM_network'] = [
'optgroup' => __('IPAM'),
'name' => __('IPAM networks'),
];
}
$types['SLA'] = [ $types['SLA'] = [
'optgroup' => __('SLA'), 'optgroup' => __('SLA'),
'name' => __('S.L.A.'), 'name' => __('S.L.A.'),

View File

@ -1117,10 +1117,17 @@ function ui_format_alert_row(
} }
$policyInfo = policies_is_alert_in_policy2($alert['id'], false); $policyInfo = policies_is_alert_in_policy2($alert['id'], false);
if ($policyInfo === false) { $module_linked = policies_is_module_linked($alert['id_agent_module']);
if (is_array($policyInfo) === false && $module_linked === false) {
$data[$index['policy']] = ''; $data[$index['policy']] = '';
} else { } else {
$img = 'images/policies_mc.png'; $module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
$img = 'images/unlinkpolicy.png';
} else {
$img = 'images/policies_mc.png';
}
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
$data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>'; $data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
} else { } else {

View File

@ -3891,6 +3891,8 @@ function get_node_name_ov(data) {
function choose_group_for_show_agents() { function choose_group_for_show_agents() {
var group = $("#group_for_show_agents option:selected").val(); var group = $("#group_for_show_agents option:selected").val();
var group_recursion =
$("#checkbox-group_recursion").prop("checked") === true ? 1 : 0;
$("#agents_filter_group").attr("disabled", true); $("#agents_filter_group").attr("disabled", true);
$("#spinner_group").css("display", ""); $("#spinner_group").css("display", "");
@ -3906,6 +3908,7 @@ function choose_group_for_show_agents() {
params.push("get_agents_in_group=1"); params.push("get_agents_in_group=1");
params.push("id=" + networkmap_id); params.push("id=" + networkmap_id);
params.push("group=" + group); params.push("group=" + group);
params.push("group_recursion=" + group_recursion);
params.push("page=operation/agentes/pandora_networkmap.view"); params.push("page=operation/agentes/pandora_networkmap.view");
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),

View File

@ -1327,12 +1327,23 @@ function filterByText(selectbox, textbox, textNoData) {
function manageComponentFields(action, type) { function manageComponentFields(action, type) {
var fieldLines = $("tr[id*=network_component-" + type + "]").length; var fieldLines = $("tr[id*=network_component-" + type + "]").length;
var protocol = $("#module_protocol").val(); var protocol = $("#module_protocol").val();
let textForAdd = "";
if (action === "add") { if (action === "add") {
let lineNumber = fieldLines + 1; let lineNumber = fieldLines + 1;
let textForAdd =
type === "oid-list-pluginRow-snmpRow" switch (type) {
? "_oid_" + lineNumber + "_" case "oid-list-pluginRow-snmpRow":
: lineNumber; textForAdd = "_oid_" + lineNumber + "_";
break;
case "oid-list-wmiRow":
textForAdd = "_field_wmi_" + lineNumber + "_";
break;
default:
textForAdd = lineNumber;
}
$("#network_component-manage-" + type).before( $("#network_component-manage-" + type).before(
$("#network_component-" + type + "-row-1") $("#network_component-" + type + "-row-1")

View File

@ -159,6 +159,21 @@ var TreeController = {
} }
}; };
var IPAMSupernetCounterTitles = {
total_networks: {
totals: "Networks"
}
};
var IPAMNetworkCounterTitles = {
alive_ips: {
totals: "Alive IPs"
},
total_ips: {
totals: "Total IPs"
}
};
try { try {
var title = ""; var title = "";
@ -192,6 +207,12 @@ var TreeController = {
case "services": case "services":
title = serviceCounterTitles[counterType].totals; title = serviceCounterTitles[counterType].totals;
break; break;
case "IPAM_supernets":
title = IPAMSupernetCounterTitles[counterType].totals;
break;
case "IPAM_networks":
title = IPAMNetworkCounterTitles[counterType].totals;
break;
default: default:
if ( if (
typeof controller.counterTitles != "undefined" && typeof controller.counterTitles != "undefined" &&
@ -333,6 +354,113 @@ var TreeController = {
hasCounters = true; hasCounters = true;
} }
} else if (type == "IPAM_supernets") {
var $counters = $("<div></div>");
$counters.addClass("tree-node-counters");
if (counters.total_networks > 0) {
// Open the parentheses
$counters.append(" (");
if (
typeof counters.total_networks !== "undefined" &&
counters.total_networks >= 0
) {
var $networksCounter = $("<div></div>");
$networksCounter
.addClass("tree-node-counter")
.addClass("total")
.html(counters.total_networks);
_processNodeCounterTitle(
$networksCounter,
type,
"total_networks"
);
$counters.append($networksCounter);
} else {
var $networksCounter = $("<div></div>");
$networksCounter
.addClass("tree-node-counter")
.addClass("total")
.html("0");
_processNodeCounterTitle(
$networksCounter,
type,
"total_networks"
);
$counters.append($networksCounter);
}
// Close the parentheses
$counters.append(")");
hasCounters = true;
}
} else if (type == "IPAM_networks") {
var $counters = $("<div></div>");
$counters.addClass("tree-node-counters");
// Open the parentheses
$counters.append(" (");
if (
typeof counters.alive_ips !== "undefined" &&
counters.alive_ips >= 0
) {
var $aliveCounter = $("<div></div>");
$aliveCounter
.addClass("tree-node-counter")
.addClass("total")
.html(counters.alive_ips);
_processNodeCounterTitle($aliveCounter, type, "alive_ips");
$counters.append($aliveCounter);
} else {
var $aliveCounter = $("<div></div>");
$aliveCounter
.addClass("tree-node-counter")
.addClass("total")
.html("0");
_processNodeCounterTitle($aliveCounter, type, "alive_ips");
$counters.append($aliveCounter);
}
if (
typeof counters.total_ips !== "undefined" &&
counters.total_ips >= 0
) {
var $totalCounter = $("<div></div>");
$totalCounter
.addClass("tree-node-counter")
.addClass("total")
.html(counters.total_ips);
_processNodeCounterTitle($totalCounter, type, "total_ips");
$counters.append(" : ").append($totalCounter);
} else {
var $totalCounter = $("<div></div>");
$totalCounter
.addClass("tree-node-counter")
.addClass("total")
.html("0");
_processNodeCounterTitle($totalCounter, type, "total_ips");
$counters.append(" : ").append($totalCounter);
}
// Close the parentheses
$counters.append(")");
hasCounters = true;
} else { } else {
var $counters = $("<div></div>"); var $counters = $("<div></div>");
$counters.addClass("tree-node-counters"); $counters.addClass("tree-node-counters");
@ -637,6 +765,87 @@ var TreeController = {
} }
$content.append(" " + element.alias); $content.append(" " + element.alias);
break;
case "IPAM_supernets":
var IPAMSupernetDetailImage = $(
'<img class="invert_filter" src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") +
'images/transactional_map.png" /> '
);
if (typeof element.id !== "undefined") {
IPAMSupernetDetailImage.click(function(e) {
e.preventDefault();
var postData = {
page: "enterprise/include/ajax/ipam.ajax",
show_networkmap_statistics: 1,
"node_data[id_net]": element.id,
"node_data[type_net]": "supernet"
};
$.ajax({
url: controller.ajaxURL,
type: "POST",
dataType: "html",
data: postData,
success: function(data, textStatus, xhr) {
controller.detailRecipient
.render("IPAMsupernets", data)
.open();
}
});
}).css("cursor", "pointer");
$content.append(IPAMSupernetDetailImage);
}
if (element.name !== null) {
$content.append("&nbsp;&nbsp;&nbsp;" + element.name);
}
break;
case "IPAM_networks":
$content.addClass("ipam-network");
var IPAMNetworkDetailImage = $(
'<img class="invert_filter" src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") +
'images/list.png" /> '
);
if (typeof element.id !== "undefined") {
IPAMNetworkDetailImage.click(function(e) {
e.preventDefault();
//window.location.href = element.IPAMNetworkDetail;
var postData = {
page: "enterprise/include/ajax/ipam.ajax",
show_networkmap_statistics: 1,
"node_data[id_net]": element.id,
"node_data[type_net]": "network"
};
$.ajax({
url: controller.ajaxURL,
type: "POST",
dataType: "html",
data: postData,
success: function(data, textStatus, xhr) {
controller.detailRecipient
.render("IPAMnetwork", data)
.open();
}
});
}).css("cursor", "pointer");
$content.append(IPAMNetworkDetailImage);
}
if (element.name !== null) {
$content.append("&nbsp;&nbsp;&nbsp;" + element.name);
}
break; break;
case "services": case "services":
if ( if (
@ -960,7 +1169,7 @@ var TreeController = {
return; return;
} }
} }
// If exist the detail container, show the data // If detail container exists, show the data.
if ( if (
typeof controller.detailRecipient !== "undefined" || typeof controller.detailRecipient !== "undefined" ||
disabled == false disabled == false

View File

@ -153,6 +153,17 @@ abstract class Entity
/** /**
* Dynamically call methods in this object. * Dynamically call methods in this object.
* *
* To dynamically switch between community methods and prioritize
* enterprise ones, define method visibility as 'protected' in both
* classes.
*
* For instance, in following situation:
* protected PandoraFMS\Agent::test()
* protected PandoraFMS\Enterprise\Agent::test()
*
* If enterprise is available, then PandoraFMS\Enterprise\Agent::test()
* will be executed, community method otherwise.
*
* @param string $methodName Name of target method or attribute. * @param string $methodName Name of target method or attribute.
* @param array $params Arguments for target method. * @param array $params Arguments for target method.
* *
@ -161,41 +172,38 @@ abstract class Entity
*/ */
public function __call(string $methodName, ?array $params=null) public function __call(string $methodName, ?array $params=null)
{ {
// Prioritize written methods over dynamic ones.
if (method_exists($this, $methodName) === true) {
return call_user_func_array(
$this->{$methodName},
$params
);
}
// Enterprise capabilities. // Enterprise capabilities.
// Prioritize enterprise written methods over dynamic fields.
if (\enterprise_installed() === true if (\enterprise_installed() === true
&& $this->enterprise !== null && $this->enterprise !== null
&& method_exists($this->enterprise, $methodName) === true && method_exists($this->enterprise, $methodName) === true
) { ) {
return call_user_func_array( return $this->enterprise->$methodName(...$params);
[ }
$this->enterprise,
$methodName, if (method_exists($this, $methodName) === false) {
], if (array_key_exists($methodName, $this->fields) === true) {
$params if (empty($params) === true) {
return $this->fields[$methodName];
} else {
$this->fields[$methodName] = $params[0];
}
return null;
}
throw new \Exception(
get_class($this).' error, method '.$methodName.' does not exist'
); );
} }
if (array_key_exists($methodName, $this->fields) === true) { // Do not return nor throw exceptions after this point, allow php
if (empty($params) === true) { // default __call behaviour to continue working with object method
return $this->fields[$methodName]; // defined.
} else { // If you're receiving NULL as result of the method invocation, ensure
$this->fields[$methodName] = $params[0]; // it is not private, take in mind this method will mask any access
} // level error or notification since it is public and has limited access
// to the object (public|protected).
return null;
}
throw new \Exception(
get_class($this).' error, method '.$methodName.' does not exist'
);
} }

View File

@ -189,3 +189,7 @@ div#tree-controller-recipient {
.tree-node .disabled { .tree-node .disabled {
filter: opacity(0.3); filter: opacity(0.3);
} }
.ipam-network {
font-size: 9pt;
}

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.757'; $version = '7.0NG.757';
$build = '210927'; $build = '210929';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -55,6 +55,7 @@ if (is_ajax()) {
$process_migration = (bool) get_parameter('process_migration', false); $process_migration = (bool) get_parameter('process_migration', false);
$get_agent_info = (bool) get_parameter('get_agent_info', false); $get_agent_info = (bool) get_parameter('get_agent_info', false);
$update_node = (bool) get_parameter('update_node', false); $update_node = (bool) get_parameter('update_node', false);
$get_agents_in_group = (bool) get_parameter('get_agents_in_group', false);
if ($update_node) { if ($update_node) {
$node_json = io_safe_output(get_parameter('node', '')); $node_json = io_safe_output(get_parameter('node', ''));
@ -80,6 +81,65 @@ if (is_ajax()) {
return; return;
} }
if ($get_agents_in_group) {
$id = (int) get_parameter('id', 0);
$group = (int) get_parameter('group', -1);
$group_recursion = (int) get_parameter('group_recursion', 0);
$return = [];
$return['correct'] = false;
if ($group != -1) {
$where_id_agente = ' 1=1 ';
$agents_in_networkmap = db_get_all_rows_filter(
'titem',
[
'id_map' => $id,
'deleted' => 0,
]
);
if ($agents_in_networkmap !== false) {
$ids = [];
foreach ($agents_in_networkmap as $agent) {
if ($agent['type'] == 0) {
$ids[] = $agent['source_data'];
}
}
if (empty($ids) === false) {
$where_id_agente = 'id_agente NOT IN ('.implode(',', $ids).')';
}
}
if ($group_recursion !== 0) {
$group_tree = groups_get_children_ids($group);
$group = implode(',', $group_tree);
}
$sql = 'SELECT id_agente, alias
FROM tagente
WHERE id_grupo IN ('.$group.') AND '.$where_id_agente.'
ORDER BY alias ASC';
$agents = db_get_all_rows_sql($sql);
if ($agents !== false) {
$return['agents'] = [];
foreach ($agents as $agent) {
$return['agents'][$agent['id_agente']] = $agent['alias'];
}
$return['correct'] = true;
}
}
echo json_encode($return);
return;
}
if ($module_get_status) { if ($module_get_status) {
$id = (int) get_parameter('id', 0); $id = (int) get_parameter('id', 0);

View File

@ -445,30 +445,29 @@ if (check_acl($config['id_user'], 0, 'ER')) {
$autorefresh_list_out = []; $autorefresh_list_out = [];
if (is_metaconsole()) { if (is_metaconsole() === false || is_centrallised() === true) {
$autorefresh_list_out['monitoring/tactical'] = 'Tactical view'; $autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail';
$autorefresh_list_out['monitoring/group_view'] = 'Group view'; $autorefresh_list_out['operation/agentes/alerts_status'] = 'Alert detail';
} else { $autorefresh_list_out['enterprise/operation/cluster/cluster'] = 'Cluster view';
$autorefresh_list_out['operation/agentes/tactical'] = 'Tactical view'; $autorefresh_list_out['operation/gis_maps/render_view'] = 'Gis Map';
$autorefresh_list_out['operation/agentes/group_view'] = 'Group view'; $autorefresh_list_out['operation/reporting/graph_viewer'] = 'Graph Viewer';
$autorefresh_list_out['operation/snmpconsole/snmp_view'] = 'SNMP console';
if (enterprise_installed()) {
$autorefresh_list_out['general/sap_view'] = 'SAP view';
}
} }
$autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail'; $autorefresh_list_out['operation/agentes/tactical'] = 'Tactical view';
$autorefresh_list_out['operation/agentes/alerts_status'] = 'Alert detail'; $autorefresh_list_out['operation/agentes/group_view'] = 'Group view';
$autorefresh_list_out['operation/agentes/status_monitor'] = 'Monitor detail'; $autorefresh_list_out['operation/agentes/status_monitor'] = 'Monitor detail';
$autorefresh_list_out['operation/operation/services/services'] = 'Services'; $autorefresh_list_out['enterprise/operation/services/services'] = 'Services';
$autorefresh_list_out['operation/dashboard/dashboard'] = 'Dashboard'; $autorefresh_list_out['operation/dashboard/dashboard'] = 'Dashboard';
$autorefresh_list_out['operation/reporting/graph_viewer'] = 'Graph Viewer';
$autorefresh_list_out['operation/gis_maps/render_view'] = 'Gis Map';
$autorefresh_list_out['operation/snmpconsole/snmp_view'] = 'SNMP console';
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map'; $autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map';
$autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console'; $autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console';
$autorefresh_list_out['operation/events/events'] = 'Events'; $autorefresh_list_out['operation/events/events'] = 'Events';
$autorefresh_list_out['enterprise/operation/cluster/cluster'] = 'Cluster view';
if (enterprise_installed()) {
$autorefresh_list_out['general/sap_view'] = 'SAP view';
}
if (!isset($autorefresh_list)) { if (!isset($autorefresh_list)) {
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '".$config['id_user']."'"); $select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '".$config['id_user']."'");

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.757 %define version 7.0NG.757
%define release 210927 %define release 210929
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.757 %define version 7.0NG.757
%define release 210927 %define release 210929
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.757 %define version 7.0NG.757
%define release 210927 %define release 210929
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1580,6 +1580,9 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`pagebreak` tinyint(1) UNSIGNED NOT NULL default 0, `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0,
`compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0, `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0,
`graph_render` tinyint(1) UNSIGNED NOT NULL default 0, `graph_render` tinyint(1) UNSIGNED NOT NULL default 0,
`ipam_network_filter` int(10) UNSIGNED DEFAULT 0,
`ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
`ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY(`id_rc`), PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`) FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE ON UPDATE CASCADE ON DELETE CASCADE
@ -3195,6 +3198,9 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`pagebreak` tinyint(1) UNSIGNED NOT NULL default 0, `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0,
`compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0, `compare_work_time` tinyint(1) UNSIGNED NOT NULL default 0,
`graph_render` tinyint(1) UNSIGNED NOT NULL default 0, `graph_render` tinyint(1) UNSIGNED NOT NULL default 0,
`ipam_network_filter` int(10) UNSIGNED DEFAULT 0,
`ipam_alive_ips` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
`ipam_ip_not_assigned_to_agent` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY(`id_rc`) PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8; ) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -0,0 +1,62 @@
<?php
require_once __DIR__.'/../include/config.php';
require_once __DIR__.'/../vendor/autoload.php';
if (file_exists(__DIR__.'/../'.ENTERPRISE_DIR.'/load_enterprise.php') === true) {
include_once __DIR__.'/../'.ENTERPRISE_DIR.'/load_enterprise.php';
}
if (isset($_SERVER['argc']) === false) {
exit(1);
}
global $config;
use PandoraFMS\Agent;
$ids = \db_get_all_rows_filter('tagente', [], ['id_agente']);
if ($ids === false) {
echo "Unable to find agents\n";
$ids = [];
}
$policies = \db_get_all_rows_filter('tpolicies', [], 'id,name');
$policies = array_reduce(
$policies,
function ($carry, $item) {
$carry[$item['name']] = $item['id'];
return $carry;
},
[]
);
foreach ($ids as $a) {
try {
$agent = new Agent($a['id_agente']);
if ($agent->hasRemoteCapabilities() === true) {
$agent_policies = $agent->getConfPolicies();
$oldIds = [];
$newIds = [];
foreach ($agent_policies as $oldId => $name) {
$oldIds[] = $oldId;
$newIds[] = $policies[io_safe_input($name)];
}
$res_update_con_policy = $agent->updatePolicyIds(
$oldIds,
$newIds
);
if ($res_update_con_policy === false) {
echo 'Failed ['.$agent->name()."]\n";
} else {
echo 'Agent '.io_safe_output($agent->alias())." updated successfully\n";
}
} else {
echo 'Agent '.io_safe_output($agent->alias())." skipped\n";
}
} catch (Exception $e) {
echo $e->getMessage()."\n";
}
}

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.757-210927 Version: 7.0NG.757-210929
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -702,3 +702,15 @@ alertserver_threads 4
# Generate an hourly warning event if alert execution is being delayed more than alertserver_warn seconds. # Generate an hourly warning event if alert execution is being delayed more than alertserver_warn seconds.
alertserver_warn 180 alertserver_warn 180
# Pandora FMS HA MySQL cluster splitbrain auto-recovery (PANDORA FMS ENTERPRISE ONLY)
# IMPORTANT! Please understand and configure all settings from pandora_console/index.php?sec=gservers&sec2=enterprise/godmode/servers/HA_cluster&tab=setup
# before enable this feature.
#splitbrain_autofix 0
# Pandora FMS HA MySQL cluster splitbrain auto-recovery settings (PANDORA FMS ENTERPRISE ONLY)
# Maximum number of retries
#ha_max_splitbrain_retries 2
# Maximum number of retries to verify resync status.
#ha_max_resync_wait_retries 3
# Maximum number of seconds waiting while verifying resync status.
#ha_resync_sleep 10

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.757"; my $pandora_version = "7.0NG.757";
my $pandora_build = "210927"; my $pandora_build = "210929";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash
@ -1289,6 +1289,18 @@ sub pandora_load_config {
elsif ($parametro =~ m/^pandora_service_cmd\s(.*)/i) { elsif ($parametro =~ m/^pandora_service_cmd\s(.*)/i) {
$pa_config->{'pandora_service_cmd'} = clean_blank($1); $pa_config->{'pandora_service_cmd'} = clean_blank($1);
} }
elsif ($parametro =~ m/^splitbrain_autofix\s+([0-9]*)/i) {
$pa_config->{'splitbrain_autofix'} = clean_blank($1);
}
elsif ($parametro =~ m/^ha_max_resync_wait_retries\s+([0-9]*)/i) {
$pa_config->{'ha_max_resync_wait_retries'} = clean_blank($1);
}
elsif ($parametro =~ m/^ha_resync_sleep\s+([0-9]*)/i) {
$pa_config->{'ha_resync_sleep'} = clean_blank($1);
}
elsif ($parametro =~ m/^ha_max_splitbrain_retries\s+([0-9]*)/i) {
$pa_config->{'ha_max_splitbrain_retries'} = clean_blank($1);
}
} # end of loop for parameter # } # end of loop for parameter #

View File

@ -29,6 +29,8 @@ use POSIX qw(strftime ceil);
use JSON; use JSON;
use Encode qw(encode_utf8); use Encode qw(encode_utf8);
use MIME::Base64; use MIME::Base64;
use File::Basename qw(dirname);
use File::Copy;
# Default lib dir for RPM and DEB packages # Default lib dir for RPM and DEB packages
use lib '/usr/lib/perl5'; use lib '/usr/lib/perl5';
@ -378,7 +380,8 @@ sub exec_recon_script ($$$) {
} }
if (-x $command) { if (-x $command) {
my $exec_output = `$command $args`; my $exec_output = `$command $args 2>&1`;
log_execution($pa_config, $task->{'id_rt'}, "$command $args", $exec_output);
logger($pa_config, "Execution output: \n". $exec_output, 10); logger($pa_config, "Execution output: \n". $exec_output, 10);
} else { } else {
logger($pa_config, "Cannot execute recon task command $command.", 10); logger($pa_config, "Cannot execute recon task command $command.", 10);
@ -1778,5 +1781,54 @@ sub PandoraFMS::Recon::Base::update_progress ($$) {
} }
} }
################################################################################
# Store a log with execution details.
################################################################################
sub log_execution($$$$) {
my ($pa_config, $task_id, $cmd, $output) = @_;
return unless $pa_config->{'verbosity'} eq 10;
my $discovery_log_path = dirname($pa_config->{'log_file'}).'/discovery/';
mkdir($discovery_log_path) unless -d $discovery_log_path;
eval {
local $SIG{__DIE__};
open (my $f, ">", $discovery_log_path.'task.'.$task_id.'.cmd');
print $f $cmd;
close ($f);
open ($f, ">", $discovery_log_path.'task.'.$task_id.'.out');
print $f $output;
close ($f);
};
}
################################################################################
# Store configuration files.
################################################################################
sub log_conf_files($$@) {
my $pa_config = shift;
my $task_id = shift;
my @files = @_;
return unless $pa_config->{'verbosity'} eq 10;
my $discovery_log_path = dirname($pa_config->{'log_file'}).'/discovery/';
mkdir($discovery_log_path) unless -d $discovery_log_path;
eval {
local $SIG{__DIE__};
foreach my $f (@files) {
copy($f, $discovery_log_path);
}
};
}
1; 1;
__END__ __END__

View File

@ -9,6 +9,7 @@ use strict;
use warnings; use warnings;
use File::Copy; use File::Copy;
use File::Basename qw(dirname basename);
use Scalar::Util qw(looks_like_number); use Scalar::Util qw(looks_like_number);
use lib '/usr/lib/perl5'; use lib '/usr/lib/perl5';
use PandoraFMS::PluginTools qw/init read_configuration read_file empty trim/; use PandoraFMS::PluginTools qw/init read_configuration read_file empty trim/;

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.757"; my $pandora_version = "7.0NG.757";
my $pandora_build = "210927"; my $pandora_build = "210929";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.757 %define version 7.0NG.757
%define release 210927 %define release 210929
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.757 %define version 7.0NG.757
%define release 210927 %define release 210929
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.757" PI_VERSION="7.0NG.757"
PI_BUILD="210927" PI_BUILD="210929"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.757 Build 210927"; my $version = "7.0NG.757 Build 210929";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -49,11 +49,14 @@ my $Running = 0;
######################################################################## ########################################################################
# Print the given message with a preceding timestamp. # Print the given message with a preceding timestamp.
######################################################################## ########################################################################
sub log_message($$$) { sub log_message($$$;$) {
my ($conf, $source, $message) = @_; my ($conf, $source, $message, $verbosity_level) = @_;
my $level = $verbosity_level;
$level = 5 unless defined($level);
if (ref($conf) eq "HASH") { if (ref($conf) eq "HASH") {
logger($conf, 'HA (' . $source . ') ' . "$message", 5); logger($conf, 'HA (' . $source . ') ' . "$message", $level);
} }
if ($source eq '') { if ($source eq '') {
@ -403,19 +406,6 @@ END {
stop(); stop();
} }
###############################################################################
# Aux. get module id
###############################################################################
my %module_id;
sub __get_module_id {
my ($dbh, $module_type) = @_;
if (!defined($module_id{$module_type})) {
$module_id{$module_type} = get_module_id($dbh, $module_type);
}
return $module_id{$module_type}
}
$SIG{INT} = \&stop; $SIG{INT} = \&stop;
$SIG{TERM} = \&stop; $SIG{TERM} = \&stop;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.757 Build 210927"; my $version = "7.0NG.757 Build 210929";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);