Merge remote-tracking branch 'origin/develop' into ent-2441-despliegue-de-agentes-desde-pandora

This commit is contained in:
fbsanchez 2019-07-17 17:19:58 +02:00
commit 17dc0b82ac
82 changed files with 2457 additions and 1137 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.736-190711
Version: 7.0NG.736-190717
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.736-190711"
pandora_version="7.0NG.736-190717"
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

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.736"
PI_BUILD="190711"
PI_BUILD="190717"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190711}
{190717}
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.736(Build 190711)")
#define PANDORA_VERSION ("7.0NG.736(Build 190717)")
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.736(Build 190711))"
VALUE "ProductVersion", "(7.0NG.736(Build 190717))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.736-190711
Version: 7.0NG.736-190717
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.736-190711"
pandora_version="7.0NG.736-190717"
package_pear=0
package_pandora=1

View File

@ -0,0 +1 @@
operation/servers/recon_view.php

View File

@ -10,6 +10,8 @@ ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEF
ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
ALTER TABLE `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
CREATE TABLE `ttask_credentials` (
`id_rt` int(10) unsigned NOT NULL,
`identifier` varchar(100) NOT NULL,
@ -39,4 +41,4 @@ CREATE TABLE `tdeployment_hosts` (
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;
COMMIT;

View File

@ -724,7 +724,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`type` varchar(30) default 'simple_graph',
`period` int(11) NOT NULL default 0,
`order` int (11) NOT NULL default 0,
`description` mediumtext,
`description` mediumtext,
`text_agent` text,
`text` TEXT,
`external_source` Text,
@ -1446,6 +1446,7 @@ ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`

View File

@ -376,6 +376,9 @@ if (isset($correct_reset_pass_process)) {
}
if (isset($login_failed)) {
$nick = get_parameter_post('nick');
$fails = db_get_value('failed_attempt', 'tusuario', 'id_user', $nick);
$attemps = ($config['number_attempts'] - $fails);
echo '<div id="login_failed" title="'.__('Login failed').'">';
echo '<div class="content_alert">';
echo '<div class="icon_message_alert">';
@ -386,6 +389,9 @@ if (isset($login_failed)) {
echo '<h1>'.__('ERROR').'</h1>';
echo '<p>'.$config['auth_error'].'</p>';
echo '</div>';
echo '<div class="text_message_alert">';
echo '<p><strong>Remaining attempts: '.$attemps.'</strong></p>';
echo '</div>';
echo '<div class="button_message_alert">';
html_print_submit_button('Ok', 'hide-login-error', false);
echo '</div>';
@ -680,5 +686,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
$("#final_process_correct").dialog('close');
});
});
/* ]]> */
</script>

View File

@ -77,6 +77,7 @@ if (is_ajax()) {
}
$get_modules_json_for_multiple_snmp = (bool) get_parameter('get_modules_json_for_multiple_snmp', 0);
$get_common_modules = (bool) get_parameter('get_common_modules', 1);
if ($get_modules_json_for_multiple_snmp) {
include_once 'include/graphs/functions_utils.php';
@ -100,7 +101,16 @@ if (is_ajax()) {
if ($out === false) {
$out = $oid_snmp;
} else {
$out = array_intersect($out, $oid_snmp);
$commons = array_intersect($out, $oid_snmp);
if ($get_common_modules) {
// Common modules is selected (default)
$out = $commons;
} else {
// All modules is selected
$array1 = array_diff($out, $oid_snmp);
$array2 = array_diff($oid_snmp, $out);
$out = array_merge($commons, $array1, $array2);
}
}
$oid_snmp = [];
@ -201,7 +211,7 @@ if (!$new_agent && $alias != '') {
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name" style="width: 40%;">';
if ($id_agente) {
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" disabled="true" value="'.$id_agente.'" />';
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" readonly value="'.$id_agente.'" />';
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
$table_agent_name .= html_print_image(
'images/zoom.png',
@ -372,13 +382,13 @@ $table_server = '<div class="label_select"><p class="input_label">'.__('Server')
$table_server .= '<div class="label_select_parent">';
if ($new_agent) {
// Set first server by default.
$servers_get_names = servers_get_names();
$servers_get_names = $servers;
$array_keys_servers_get_names = array_keys($servers_get_names);
$server_name = reset($array_keys_servers_get_names);
}
$table_server .= html_print_select(
servers_get_names(),
$servers,
'server_name',
$server_name,
'',
@ -1164,6 +1174,19 @@ ui_require_jquery_file('bgiframe');
}
$(document).ready (function() {
var previous_primary_group_select;
$("#grupo").on('focus', function () {
previous_primary_group_select = this.value;
}).change(function() {
if ($("#secondary_groups_selected option[value="+$("#grupo").val()+"]").length) {
alert("<?php echo __('Secondary group cannot be primary too.'); ?>");
$("#grupo").val(previous_primary_group_select);
} else {
previous_primary_group_select = this.value;
}
});
$("select#id_os").pandoraSelectOS ();
var checked = $("#checkbox-cascade_protection").is(":checked");
@ -1212,7 +1235,7 @@ ui_require_jquery_file('bgiframe');
128,
128
);
$("#text-agente").prop('disabled', true);
$("#text-agente").prop('readonly', true);
});
</script>

View File

@ -1,16 +1,32 @@
<?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category SNMP interfaces.
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
require_once $config['homedir'].'/include/functions_agents.php';
require_once 'include/functions_modules.php';
@ -36,10 +52,10 @@ $snmp3_privacy_method = get_parameter('snmp3_privacy_method');
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass'));
$tcp_port = (string) get_parameter('tcp_port');
// See if id_agente is set (either POST or GET, otherwise -1
// See if id_agente is set (either POST or GET, otherwise -1.
$id_agent = $idAgent;
// Get passed variables
// Get passed variables.
$snmpwalk = (int) get_parameter('snmpwalk', 0);
$create_modules = (int) get_parameter('create_modules', 0);
@ -47,7 +63,7 @@ $interfaces = [];
$interfaces_ip = [];
if ($snmpwalk) {
// OID Used is for SNMP MIB-2 Interfaces
// OID Used is for SNMP MIB-2 Interfaces.
$snmpis = get_snmpwalk(
$ip_target,
$snmp_version,
@ -63,7 +79,7 @@ if ($snmpwalk) {
$tcp_port,
$server_to_exec
);
// ifXTable is also used
// IfXTable is also used.
$ifxitems = get_snmpwalk(
$ip_target,
$snmp_version,
@ -80,7 +96,7 @@ if ($snmpwalk) {
$server_to_exec
);
// Get the interfaces IPV4/IPV6
// Get the interfaces IPV4/IPV6.
$snmp_int_ip = get_snmpwalk(
$ip_target,
$snmp_version,
@ -97,12 +113,12 @@ if ($snmpwalk) {
$server_to_exec
);
// Build a [<interface id>] => [<interface ip>] array
// Build a [<interface id>] => [<interface ip>] array.
if (!empty($snmp_int_ip)) {
foreach ($snmp_int_ip as $key => $value) {
// The key is something like IP-MIB::ipAddressIfIndex.ipv4."<ip>"
// or IP-MIB::ipAddressIfIndex.ipv6."<ip>"
// The value is something like INTEGER: <interface id>
// The key is something like IP-MIB::ipAddressIfIndex.ipv4."<ip>".
// or IP-MIB::ipAddressIfIndex.ipv6."<ip>".
// The value is something like INTEGER: <interface id>.
$data = explode(': ', $value);
$interface_id = !empty($data) && isset($data[1]) ? $data[1] : false;
@ -110,7 +126,7 @@ if ($snmpwalk) {
$interface_ip = $matches[1];
}
// Get the first ip
// Get the first ip.
if ($interface_id !== false && !empty($interface_ip) && !isset($interfaces_ip[$interface_id])) {
$interfaces_ip[$interface_id] = $interface_ip;
}
@ -119,17 +135,17 @@ if ($snmpwalk) {
unset($snmp_int_ip);
}
$snmpis = array_merge(($snmpis === false ? [] : $snmpis), ($ifxitems === false ? [] : $ifxitems));
$snmpis = array_merge((($snmpis === false) ? [] : $snmpis), (($ifxitems === false) ? [] : $ifxitems));
$interfaces = [];
// We get here only the interface part of the MIB, not full mib
// We get here only the interface part of the MIB, not full mib.
foreach ($snmpis as $key => $snmp) {
$data = explode(': ', $snmp, 2);
$keydata = explode('::', $key);
$keydata2 = explode('.', $keydata[1]);
// Avoid results without index and interfaces without name
// Avoid results without index and interfaces without name.
if (!isset($keydata2[1]) || !isset($data[1])) {
continue;
}
@ -239,24 +255,22 @@ if ($create_modules) {
$oid_array[(count($oid_array) - 1)] = $id;
$oid = implode('.', $oid_array);
// Get the name
// Get the name.
$name_array = explode('::', $oid_array[0]);
$name = $ifname.'_'.$name_array[1];
// Clean the name
// Clean the name.
$name = str_replace('"', '', $name);
// Proc moduletypes
// Proc moduletypes.
if (preg_match('/Status/', $name_array[1])) {
$module_type = 18;
} else if (preg_match('/Present/', $name_array[1])) {
$module_type = 18;
} else if (preg_match('/PromiscuousMode/', $name_array[1])) {
$module_type = 18;
}
// String moduletypes
else if (preg_match('/Alias/', $name_array[1])) {
} else if (preg_match('/Alias/', $name_array[1])) {
// String moduletypes.
$module_type = 17;
} else if (preg_match('/Address/', $name_array[1])) {
$module_type = 17;
@ -266,15 +280,11 @@ if ($create_modules) {
$module_type = 17;
} else if (preg_match('/Descr/', $name_array[1])) {
$module_type = 17;
}
// Specific counters (ends in s)
else if (preg_match('/s$/', $name_array[1])) {
} else if (preg_match('/s$/', $name_array[1])) {
// Specific counters (ends in s).
$module_type = 16;
}
// Otherwise, numeric
else {
} else {
// Otherwise, numeric.
$module_type = 15;
}
@ -330,7 +340,7 @@ if ($create_modules) {
$output_oid = '';
exec('ssh pandora_exec_proxy@'.$row['ip_address'].' snmptranslate -On '.$oid, $output_oid, $rc);
exec('snmptranslate -On '.$oid, $output_oid, $rc);
$conf_oid = $output_oid[0];
$oid = $conf_oid;
@ -397,7 +407,9 @@ if ($create_modules) {
}
if ($done > 0) {
ui_print_success_message(__('Successfully modules created')." ($done)");
ui_print_success_message(
__('Successfully modules created').' ('.$done.')'
);
}
if (!empty($errors)) {
@ -407,17 +419,17 @@ if ($create_modules) {
foreach ($errors as $code => $number) {
switch ($code) {
case ERR_EXIST:
$msg .= '<br>'.__('Another module already exists with the same name')." ($number)";
$msg .= '<br>'.__('Another module already exists with the same name').' ('.$number.')';
break;
case ERR_INCOMPLETE:
$msg .= '<br>'.__('Some required fields are missed').': ('.__('name').') '." ($number)";
$msg .= '<br>'.__('Some required fields are missed').': ('.__('name').') ('.$number.')';
break;
case ERR_DB:
case ERR_GENERIC:
default:
$msg .= '<br>'.__('Processing error')." ($number)";
$msg .= '<br>'.__('Processing error').' ('.$number.')';
break;
}
}
@ -426,10 +438,10 @@ if ($create_modules) {
}
}
// Create the interface list for the interface
// Create the interface list for the interface.
$interfaces_list = [];
foreach ($interfaces as $interface) {
// Get the interface name, removing " " characters and avoid "blank" interfaces
// Get the interface name, removing " " characters and avoid "blank" interfaces.
if (isset($interface['ifDescr']) && $interface['ifDescr']['value'] != '') {
$ifname = $interface['ifDescr']['value'];
} else if (isset($interface['ifName']) && $interface['ifName']['value'] != '') {
@ -442,7 +454,7 @@ foreach ($interfaces as $interface) {
}
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo "<form method='post' id='walk_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=$id_agent'>";
echo "<form method='post' id='walk_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=".$id_agent."'>";
$table->width = '100%';
$table->cellpadding = 0;
@ -464,12 +476,14 @@ if (enterprise_installed()) {
enterprise_include_once('include/functions_satellite.php');
$rows = get_proxy_servers();
// Check if satellite server has remote configuration enabled.
$satellite_remote = config_agents_has_remote_configuration($id_agent);
foreach ($rows as $row) {
if ($row['server_type'] != 13) {
$s_type = ' (Standard)';
} else {
// Check if satellite server has remote configuration enabled
$satellite_remote = config_agents_has_remote_configuration($id_agent);
$id_satellite = $row['id_server'];
$s_type = ' (Satellite)';
}
@ -484,8 +498,7 @@ $table->data[1][4] = html_print_select(
$servers_to_exec,
'server_to_exec',
$server_to_exec,
'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')
',
'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')',
'',
'',
true
@ -509,7 +522,7 @@ html_print_table($table);
unset($table);
// SNMP3 OPTIONS
// SNMP3 OPTIONS.
$table->width = '100%';
$table->data[2][1] = '<b>'.__('Auth user').'</b>';
@ -564,7 +577,7 @@ echo '</form>';
if (!empty($interfaces_list)) {
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=$id_agent'>";
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente=".$id_agent."'>";
echo '<span id="form_interfaces">';
$id_snmp_serialize = serialize_in_temp($interfaces, $config['id_user'].'_snmp');
@ -589,13 +602,30 @@ if (!empty($interfaces_list)) {
$table->width = '100%';
// Agent selector
// Agent selector.
$table->data[0][0] = '<b>'.__('Interfaces').'</b>';
$table->data[0][1] = '';
$table->data[0][2] = '<b>'.__('Modules').'</b>';
$table->data[1][0] = html_print_select($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px; overflow: auto;');
$table->data[1][1] = html_print_image('images/darrowright.png', true);
$table->data[1][1] = __('When selecting interfaces');
$table->data[1][1] .= '<br>';
$table->data[1][1] .= html_print_select(
[
1 => __('Show common modules'),
0 => __('Show all modules'),
],
'modules_selection_mode',
1,
false,
'',
'',
true,
false,
false
);
$table->data[1][2] = html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;');
$table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true);
@ -619,12 +649,10 @@ ui_require_jquery_file('bgiframe');
/* <![CDATA[ */
$(document).ready (function () {
var inputActive = true;
$('#server_to_exec option').trigger('change');
$(document).data('text_for_module', $("#none_text").html());
$("#id_snmp").change(snmp_changed_by_multiple_snmp);
@ -645,10 +673,16 @@ $(document).ready (function () {
$("#form_interfaces").hide ();
});
// When select interfaces changes
$("#modules_selection_mode").change (function() {
$("#id_snmp").trigger('change');
});
});
function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
var idSNMP = Array();
var get_common_modules = $("#modules_selection_mode option:selected").val();
jQuery.each ($("#id_snmp option:selected"), function (i, val) {
idSNMP.push($(val).val());
@ -660,6 +694,7 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
jQuery.post ('ajax.php',
{"page" : "godmode/agentes/agent_manager",
"get_modules_json_for_multiple_snmp": 1,
"get_common_modules" : get_common_modules,
"id_snmp[]": idSNMP,
"id_snmp_serialize": $("#hidden-id_snmp_serialize").val()
},

View File

@ -141,7 +141,9 @@ $largeClassDisabledBecauseInPolicy = '';
$page = get_parameter('page', '');
if (strstr($page, 'policy_modules') === false && $id_agent_module) {
$in_policies_page = strstr($page, 'policy_modules');
if ($in_policies_page === false && $id_agent_module) {
if ($config['enterprise_installed']) {
if (policies_is_module_linked($id_agent_module) == 1) {
$disabledBecauseInPolicy = 1;
@ -250,6 +252,12 @@ $table_simple->data[0][3] .= html_print_select_from_sql(
$disabledBecauseInPolicy
);
if ((isset($id_agent_module) && $id_agent_module) || $id_policy_module != 0) {
$edit = false;
} else {
$edit = true;
}
$in_policy = strstr($page, 'policy_modules');
if (!$in_policy) {
// Cannot select the current module to be itself parent
@ -280,17 +288,6 @@ if (!$in_policy) {
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
$table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
if (isset($id_agent_module)) {
if ($id_agent_module) {
$edit = false;
} else {
$edit = true;
}
} else {
// Run into a policy
$edit = true;
}
if (!$edit) {
$sql = sprintf(
'SELECT id_tipo, nombre

View File

@ -84,7 +84,9 @@ if ($create_profiles) {
);
}
html_print_table($table);
if ($table !== null) {
html_print_table($table);
}
unset($table);

View File

@ -273,6 +273,9 @@ $table->data[1][1] = html_print_select(
true
);
$table->data['form_agents_filter'][0] = __('Filter Agents');
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
$table->data[2][0] = __('Agent');
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true);
@ -354,6 +357,11 @@ $(document).ready (function () {
/* Hide source agent */
var selected_agent = $("#source_id_agent").val();
$("#destiny_id_agent option[value='" + selected_agent + "']").remove();
},
callbackAfter:function() {
//Filter agents. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
filterByText($('#destiny_id_agent'), $("#text-filter_agents"), textNoData);
}
});
@ -455,13 +463,14 @@ $(document).ready (function () {
$("#fieldset_destiny").hide ();
$("span.without_modules, span.without_alerts").show ();
$("span.with_modules, span.with_alerts, #target_table-operations").hide ();
$("span.with_modules, span.with_alerts, #target_table-operations, #target_table-form_modules_filter").hide ();
}
else {
if (no_modules) {
$("span.without_modules").show ();
$("span.with_modules").hide ();
$("#checkbox-copy_modules").uncheck ();
$("#target_table-form_modules_filter").hide ();
}
else {
$("span.without_modules").hide ();
@ -479,7 +488,7 @@ $(document).ready (function () {
$("span.with_alerts").show ();
$("#checkbox-copy_alerts").check ();
}
$("#fieldset_destiny, #target_table-operations").show ();
$("#fieldset_destiny, #target_table-operations, #target_table-form_modules_filter").show ();
}
$("#fieldset_targets").show ();
$("#target_modules, #target_alerts").enable ();

View File

@ -501,6 +501,11 @@ $table->data['form_agents_4'][1] = html_print_select(
true
);
$table->rowstyle['form_agents_filter'] = 'vertical-align: top;';
$table->rowclass['form_agents_filter'] = 'select_agents_row select_agents_row_2';
$table->data['form_agents_filter'][0] = __('Filter Agents');
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
$table->data['form_agents_3'][0] = __('Agents');
@ -763,6 +768,9 @@ $(document).ready (function () {
.html (value["alias"]);
$("#id_agents").append (option);
});
//Filter agents. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
filterByText($('#id_agents'), $("#text-filter_agents"), textNoData);
},
"json"
);

View File

@ -92,7 +92,9 @@ if ($delete_profiles) {
);
}
html_print_table($table);
if ($table !== null) {
html_print_table($table);
}
unset($table);

View File

@ -170,6 +170,8 @@ if ($update_agents) {
$n_edited = 0;
$result = false;
foreach ($id_agents as $id_agent) {
$old_interval_value = db_get_value_filter('intervalo', 'tagente', ['id_agente' => $id_agent]);
if (!empty($values)) {
$group_old = false;
$disabled_old = false;
@ -196,6 +198,18 @@ if ($update_agents) {
$result_metaconsole = agent_update_from_cache($id_agent, $values, $server_name);
}
// Update the configuration files.
if ($result && ($old_interval_value != $values['intervalo'])) {
enterprise_hook(
'config_agents_update_config_token',
[
$id_agent,
'interval',
$values['intervalo'],
]
);
}
if ($disabled_old !== false && $disabled_old != $values['disabled']) {
enterprise_hook(
'config_agents_update_config_token',

View File

@ -473,6 +473,11 @@ $table->data['form_agents_4'][1] = html_print_select(
true
);
$table->rowstyle['form_agents_filter'] = 'vertical-align: top;';
$table->rowclass['form_agents_filter'] = 'select_agents_row select_agents_row_2';
$table->data['form_agents_filter'][0] = __('Filter agents');
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
$table->data['form_agents_3'][0] = __('Agents');
@ -1638,6 +1643,9 @@ $(document).ready (function () {
.html(value["alias"]);
$("#id_agents").append (option);
});
//Filter agents. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
filterByText($('#id_agents'), $("#text-filter_agents"), textNoData);
},
"json"
);

View File

@ -853,7 +853,10 @@ $class = 'databox filters';
}
?>
<?php
$text = __('This type of report brings a lot of data loading, it is recommended to use it for scheduled reports and not for real-time view.');
if (!isset($text)) {
$text = __('This type of report brings a lot of data loading, it is recommended to use it for scheduled reports and not for real-time view.');
}
echo '<a id="log_help_tip" style="visibility: hidden;" href="javascript:" class="tip" >'.html_print_image('images/tip.png', true, ['title' => $text]).'</a>';
?>
</td>
@ -865,7 +868,18 @@ $class = 'databox filters';
</td>
<td style="">
<?php
html_print_input_text('name', $name, '', 80, 100);
html_print_input_text(
'name',
$name,
'',
80,
100,
false,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>
@ -923,7 +937,18 @@ $class = 'databox filters';
</td>
<td style="">
<?php
echo html_print_input_text('label', $label, '', 50, 255, true);
echo html_print_input_text(
'label',
$label,
'',
50,
255,
true,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>

View File

@ -774,14 +774,14 @@ switch ($action) {
$table->head[1] = __('Description');
$table->head[2] = __('HTML');
$table->head[3] = __('XML');
$table->size[0] = '60%';
$table->size[0] = '50%';
$table->size[1] = '20%';
$table->size[2] = '2%';
$table->headstyle[2] = 'min-width: 35px;text-align: center;';
$table->headstyle[2] = 'min-width: 35px;text-align: left;';
$table->size[3] = '2%';
$table->headstyle[3] = 'min-width: 35px;text-align: center;';
$table->headstyle[3] = 'min-width: 35px;text-align: left;';
$table->size[4] = '2%';
$table->headstyle[4] = 'min-width: 35px;text-align: center;';
$table->headstyle[4] = 'min-width: 35px;text-align: left;';
$next = 4;
// Calculate dinamically the number of the column.
@ -790,15 +790,16 @@ switch ($action) {
}
$table->size[$next] = '2%';
$table->style[$next] = 'text-align: center;';
$table->style[$next] = 'text-align: left;';
$table->headstyle[($next + 2)] = 'min-width: 100px;';
$table->style[($next + 2)] = 'text-align: center;';
$table->headstyle[($next + 2)] = 'min-width: 130px; text-align:right;';
$table->style[($next + 2)] = 'text-align: right;';
// Admin options only for RM flag.
if (check_acl($config['id_user'], 0, 'RM')) {
$table->head[$next] = __('Private');
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
if (defined('METACONSOLE')) {
$table->align[$next] = '';
@ -808,7 +809,9 @@ switch ($action) {
$next++;
$table->head[$next] = __('Group');
$table->size[$next] = '15%';
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
$table->align[$next] = 'left';
$next++;
$op_column = false;
@ -826,7 +829,7 @@ switch ($action) {
// $table->size = array ();
$table->size[$next] = '10%';
$table->align[$next] = 'left';
$table->align[$next] = 'right';
}
$columnview = false;
@ -1341,6 +1344,16 @@ switch ($action) {
switch ($action) {
case 'update':
$values = [];
$server_name = get_parameter('server_id');
if (is_metaconsole() && $server_name != '') {
$id_meta = metaconsole_get_id_server($server_name);
$connection = metaconsole_get_connection_by_id(
$id_meta
);
metaconsole_connect($connection);
$values['server_name'] = $connection['server_name'];
}
$values['id_report'] = $idReport;
$values['description'] = get_parameter('description');
$values['type'] = get_parameter('type', null);
@ -1349,14 +1362,36 @@ switch ($action) {
$label = get_parameter('label', '');
$id_agent = get_parameter('id_agent');
$id_agent_module = get_parameter('id_agent_module');
// Add macros name.
$items_label = [];
$items_label['type'] = get_parameter('type');
$items_label['id_agent'] = get_parameter('id_agent');
$items_label['id_agent_module'] = get_parameter(
'id_agent_module'
);
$name_it = (string) get_parameter('name');
$agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent);
$agent_alias = agents_get_alias($id_agent);
$module_name = modules_get_agentmodule_name(
$id_agent_module
);
$module_description = modules_get_agentmodule_descripcion(
$id_agent_module
);
$items_label = [
'type' => get_parameter('type'),
'id_agent' => $id_agent,
'id_agent_module' => $id_agent_module,
'agent_description' => $agent_description,
'agent_group' => $agent_group,
'agent_address' => $agent_address,
'agent_alias' => $agent_alias,
'module_name' => $module_name,
'module_description' => $module_description,
];
$values['name'] = reporting_label_macro(
$items_label,
$name_it
@ -1712,13 +1747,6 @@ switch ($action) {
);
$values['id_group'] = get_parameter('combo_group');
$values['server_name'] = get_parameter('server_name');
$server_id = (int) get_parameter('server_id');
if ($server_id != 0) {
$connection = metaconsole_get_connection_by_id(
$server_id
);
$values['server_name'] = $connection['server_name'];
}
if ($values['server_name'] == '') {
$values['server_name'] = get_parameter(
@ -1975,22 +2003,11 @@ switch ($action) {
$values['style'] = io_safe_input(json_encode($style));
if (is_metaconsole()) {
metaconsole_restore_db();
}
if ($good_format) {
switch ($config['dbtype']) {
case 'oracle':
if (isset($values['type'])) {
$values[db_escape_key_identifier(
'type'
)] = $values['type'];
unset($values['type']);
}
break;
default:
// Default.
break;
}
$resultOperationDB = db_process_sql_update(
'treport_content',
$values,
@ -2003,21 +2020,62 @@ switch ($action) {
case 'save':
$values = [];
$values['server_name'] = get_parameter('server_name');
$server_id = (int) get_parameter('server_id');
if ($server_id != 0) {
$connection = metaconsole_get_connection_by_id(
$server_id
);
metaconsole_connect($connection);
$values['server_name'] = $connection['server_name'];
}
$values['id_report'] = $idReport;
$values['type'] = get_parameter('type', null);
$values['description'] = get_parameter('description');
$label = get_parameter('label', '');
// Add macros name.
$items_label = [];
$items_label['type'] = get_parameter('type');
$items_label['id_agent'] = get_parameter('id_agent');
$items_label['id_agent_module'] = get_parameter(
'id_agent_module'
);
$name_it = (string) get_parameter('name');
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter('include_extended_events', null);
$values['show_extended_events'] = get_parameter(
'include_extended_events',
null
);
$id_agent = get_parameter('id_agent');
$id_agent_module = get_parameter('id_agent_module');
// Add macros name.
$name_it = (string) get_parameter('name');
$agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent);
$agent_alias = agents_get_alias($id_agent);
$module_name = modules_get_agentmodule_name(
$id_agent_module
);
$module_description = modules_get_agentmodule_descripcion(
$id_agent_module
);
if (is_metaconsole()) {
metaconsole_restore_db();
}
$items_label = [
'type' => get_parameter('type'),
'id_agent' => $id_agent,
'id_agent_module' => $id_agent_module,
'agent_description' => $agent_description,
'agent_group' => $agent_group,
'agent_address' => $agent_address,
'agent_alias' => $agent_alias,
'module_name' => $module_name,
'module_description' => $module_description,
];
$values['name'] = reporting_label_macro(
$items_label,
$name_it
@ -2222,18 +2280,6 @@ switch ($action) {
break;
}
$values['server_name'] = get_parameter('server_name');
$server_id = (int) get_parameter('server_id');
if ($server_id != 0) {
$connection = metaconsole_get_connection_by_id(
$server_id
);
$values['server_name'] = $connection['server_name'];
}
if ($values['server_name'] == '') {
$values['server_name'] = get_parameter(
'combo_server'

View File

@ -171,7 +171,7 @@ foreach ($layoutDatas as $layoutData) {
$table->data[($i + 1)]['icon'] = html_print_image(
'images/camera.png',
true,
['title' => __('Static Graph')]
['title' => __('Static Image')]
);
break;

View File

@ -70,7 +70,7 @@ if (is_ajax()) {
$table->head[0] = __('Agent');
$table->head[1] = __('Module');
foreach ($modules as $mod) {
$agent_name = '<a href="'.$config['homeurl'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$mod['id_agente'].'">'.modules_get_agentmodule_agent_name(
$agent_name = '<a href="'.ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$mod['id_agente']).'">'.modules_get_agentmodule_agent_alias(
$mod['id_agente_modulo']
).'</a>';
@ -1215,4 +1215,3 @@ ui_require_javascript_file('pandora_modules');
</script>

View File

@ -152,12 +152,12 @@ foreach ($servers as $server) {
$data[8] = '';
if ($server['type'] == 'recon') {
$data[8] .= '<a href="index.php?sec=gservers&sec2=operation/servers/recon_view">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
$data[8] .= html_print_image(
'images/firts_task/icono_grande_reconserver.png',
true,
[
'title' => __('Manage recon tasks'),
'title' => __('Manage Discovery tasks'),
'style' => 'width:21px;height:21px;',
]
);
@ -165,7 +165,7 @@ foreach ($servers as $server) {
}
if ($server['type'] == 'data') {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server'].'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/target.png',
true,
@ -173,7 +173,7 @@ foreach ($servers as $server) {
);
$data[8] .= '</a>';
} else if ($server['type'] == 'enterprise snmp') {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server'].'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/target.png',
true,
@ -182,7 +182,7 @@ foreach ($servers as $server) {
$data[8] .= '</a>';
}
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server'].'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/config.png',
true,
@ -191,7 +191,7 @@ foreach ($servers as $server) {
$data[8] .= '</a>';
if (($names_servers[$safe_server_name] === true) && ($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
$data[8] .= html_print_image(
'images/remote_configuration.png',
true,
@ -201,7 +201,7 @@ foreach ($servers as $server) {
$names_servers[$safe_server_name] = false;
}
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1').'">';
$data[8] .= html_print_image(
'images/cross.png',
true,

View File

@ -86,7 +86,7 @@ $buttons = [];
// Draws header.
$buttons['general'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general">'.html_print_image('images/gm_setup.png', true, ['title' => __('General')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general').'">'.html_print_image('images/gm_setup.png', true, ['title' => __('General')]).'</a>',
];
if (enterprise_installed()) {
@ -95,37 +95,37 @@ if (enterprise_installed()) {
$buttons['auth'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=auth">'.html_print_image('images/key.png', true, ['title' => __('Authentication')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=auth').'">'.html_print_image('images/key.png', true, ['title' => __('Authentication')]).'</a>',
];
$buttons['perf'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=perf">'.html_print_image('images/performance.png', true, ['title' => __('Performance')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=perf').'">'.html_print_image('images/performance.png', true, ['title' => __('Performance')]).'</a>',
];
$buttons['vis'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=vis">'.html_print_image('images/chart.png', true, ['title' => __('Visual styles')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=vis').'">'.html_print_image('images/chart.png', true, ['title' => __('Visual styles')]).'</a>',
];
if (check_acl($config['id_user'], 0, 'AW')) {
if ($config['activate_netflow']) {
$buttons['net'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=net">'.html_print_image('images/op_netflow.png', true, ['title' => __('Netflow')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=net').'">'.html_print_image('images/op_netflow.png', true, ['title' => __('Netflow')]).'</a>',
];
}
}
$buttons['ehorus'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=ehorus">'.html_print_image('images/ehorus/ehorus.png', true, ['title' => __('eHorus')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=ehorus').'">'.html_print_image('images/ehorus/ehorus.png', true, ['title' => __('eHorus')]).'</a>',
];
// FIXME: Not definitive icon
$buttons['notifications'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications').'">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
];
$help_header = '';

View File

@ -1,5 +1,13 @@
<?php
/**
* General setup.
*
* @category Setup
* @package Pandora FMS
* @subpackage Opensource
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
@ -18,8 +26,36 @@
* ============================================================================
*/
// File begin.
/**
* Return sounds path.
*
* @return string Path.
*/
function get_sounds()
{
global $config;
$return = [];
$files = scandir($config['homedir'].'/include/sounds');
foreach ($files as $file) {
if (strstr($file, 'wav') !== false) {
$return['include/sounds/'.$file] = $file;
}
}
return $return;
}
// Begin.
global $config;
check_login();
$table = new StdClass();
@ -33,35 +69,18 @@ $table->style[0] = 'font-weight:bold';
$table->size[1] = '70%';
// Current config["language"] could be set by user, not taken from global setup !
switch ($config['dbtype']) {
case 'mysql':
$current_system_lang = db_get_sql(
'SELECT `value`
FROM tconfig WHERE `token` = "language"'
);
break;
case 'postgresql':
$current_system_lang = db_get_sql(
'SELECT "value"
FROM tconfig WHERE "token" = \'language\''
);
break;
case 'oracle':
$current_system_lang = db_get_sql(
'SELECT value
FROM tconfig WHERE token = \'language\''
);
break;
}
$current_system_lang = db_get_sql(
'SELECT `value` FROM tconfig WHERE `token` = "language"'
);
if ($current_system_lang == '') {
$current_system_lang = 'en';
}
$table->data[0][0] = __('Language code');
$table->data[0][1] = html_print_select_from_sql(
$i = 0;
$table->data[$i][0] = __('Language code');
$table->data[$i++][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'language',
$current_system_lang,
@ -71,68 +90,67 @@ $table->data[0][1] = html_print_select_from_sql(
true
);
$table->data[1][0] = __('Remote config directory').ui_print_help_tip(__('Directory where agent remote configuration is stored.'), true);
$table->data[$i][0] = __('Remote config directory').ui_print_help_tip(__('Directory where agent remote configuration is stored.'), true);
$table->data[$i++][1] = html_print_input_text('remote_config', io_safe_output($config['remote_config']), '', 30, 100, true);
$table->data[1][1] = html_print_input_text('remote_config', io_safe_output($config['remote_config']), '', 30, 100, true);
$table->data[$i][0] = __('Phantomjs bin directory').ui_print_help_tip(__('Directory where phantomjs binary file exists and has execution grants.'), true);
$table->data[$i++][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true);
$table->data[2][0] = __('Phantomjs bin directory').ui_print_help_tip(__('Directory where phantomjs binary file exists and has execution grants.'), true);
$table->data[$i][0] = __('Auto login (hash) password');
$table->data[$i++][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
$table->data[2][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true);
$table->data[6][0] = __('Auto login (hash) password');
$table->data[6][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
$table->data[9][0] = __('Time source');
$table->data[$i][0] = __('Time source');
$sources['system'] = __('System');
$sources['sql'] = __('Database');
$table->data[9][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true);
$table->data[$i++][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true);
$table->data[10][0] = __('Automatic check for updates');
$table->data[10][1] = html_print_checkbox_switch('autoupdate', 1, $config['autoupdate'], true);
$table->data[$i][0] = __('Automatic check for updates');
$table->data[$i++][1] = html_print_checkbox_switch('autoupdate', 1, $config['autoupdate'], true);
echo "<div id='dialog' title='".__('Enforce https Information')."' style='display:none;'>";
echo "<p style='text-align: center;'>".__('If SSL is not properly configured you will lose access to ').get_product_name().__(' Console').'</p>';
echo '</div>';
$table->data[11][0] = __('Enforce https');
$table->data[11][1] = html_print_checkbox_switch_extended('https', 1, $config['https'], false, '', '', true);
$table->data[$i][0] = __('Enforce https');
$table->data[$i++][1] = html_print_checkbox_switch_extended('https', 1, $config['https'], false, '', '', true);
$table->data[12][0] = __('Use cert of SSL');
$table->data[12][1] = html_print_checkbox_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true);
$table->data[$i][0] = __('Use cert of SSL');
$table->data[$i++][1] = html_print_checkbox_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true);
$table->rowstyle[13] = 'display: none;';
$table->data[13][0] = __('Path of SSL Cert.').ui_print_help_tip(__('Path where you put your cert and name of this cert. Remember your cert only in .pem extension.'), true);
$table->data[13][1] = html_print_input_text('cert_path', io_safe_output($config['cert_path']), '', 50, 255, true);
$table->rowstyle[$i] = 'display: none;';
$table->rowid[$i] = 'ssl-path-tr';
$table->data[$i][0] = __('Path of SSL Cert.').ui_print_help_tip(__('Path where you put your cert and name of this cert. Remember your cert only in .pem extension.'), true);
$table->data[$i++][1] = html_print_input_text('cert_path', io_safe_output($config['cert_path']), '', 50, 255, true);
$table->data[14][0] = __('Attachment store').ui_print_help_tip(__('Directory where temporary data is stored.'), true);
$table->data[14][1] = html_print_input_text('attachment_store', io_safe_output($config['attachment_store']), '', 50, 255, true);
$table->data[$i][0] = __('Attachment store').ui_print_help_tip(__('Directory where temporary data is stored.'), true);
$table->data[$i++][1] = html_print_input_text('attachment_store', io_safe_output($config['attachment_store']), '', 50, 255, true);
$table->data[15][0] = __('IP list with API access');
$table->data[$i][0] = __('IP list with API access');
if (isset($_POST['list_ACL_IPs_for_API'])) {
$list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API');
} else {
$list_ACL_IPs_for_API = get_parameter_get('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API']));
}
$table->data[15][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
$table->data[$i++][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
$table->data[16][0] = __('API password').ui_print_help_tip(__('Please be careful if you put a password put https access.'), true);
$table->data[16][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
$table->data[$i][0] = __('API password').ui_print_help_tip(__('Please be careful if you put a password put https access.'), true);
$table->data[$i++][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
$table->data[17][0] = __('Enable GIS features');
$table->data[17][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true);
$table->data[$i][0] = __('Enable GIS features');
$table->data[$i++][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true);
$table->data[19][0] = __('Enable Netflow');
$table->data[$i][0] = __('Enable Netflow');
$rbt_disabled = false;
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
$rbt_disabled = true;
$table->data[19][0] .= ui_print_help_tip(__('Not supported in Windows systems'), true);
$table->data[$i][0] .= ui_print_help_tip(__('Not supported in Windows systems'), true);
}
$table->data[19][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true);
$table->data[$i++][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true);
$table->data[21][0] = __('Enable Network Traffic Analyzer');
$table->data[21][1] = html_print_switch(
$table->data[$i][0] = __('Enable Network Traffic Analyzer');
$table->data[$i++][1] = html_print_switch(
[
'name' => 'activate_nta',
'value' => $config['activate_nta'],
@ -171,11 +189,11 @@ foreach ($timezones as $timezone) {
}
}
$table->data[23][0] = __('Timezone setup').' '.ui_print_help_tip(
$table->data[$i][0] = __('Timezone setup').' '.ui_print_help_tip(
__('Must have the same time zone as the system or database to avoid mismatches of time.'),
true
);
$table->data[23][1] = html_print_input_text_extended(
$table->data[$i][1] = html_print_input_text_extended(
'timezone_text',
$config['timezone'],
'text-timezone_text',
@ -187,47 +205,63 @@ $table->data[23][1] = html_print_input_text_extended(
'readonly',
true
);
$table->data[23][1] .= '<a id="change_timezone">'.html_print_image('images/pencil.png', true, ['title' => __('Change timezone')]).'</a>';
$table->data[23][1] .= '&nbsp;&nbsp;'.html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
$table->data[23][1] .= '&nbsp;&nbsp;'.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
$table->data[$i][1] .= '<a id="change_timezone">'.html_print_image('images/pencil.png', true, ['title' => __('Change timezone')]).'</a>';
$table->data[$i][1] .= '&nbsp;&nbsp;'.html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
$table->data[$i++][1] .= '&nbsp;&nbsp;'.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
$sounds = get_sounds();
$table->data[24][0] = __('Sound for Alert fired');
$table->data[24][1] = html_print_select($sounds, 'sound_alert', $config['sound_alert'], 'replaySound(\'alert\');', '', '', true);
$table->data[24][1] .= ' <a href="javascript: toggleButton(\'alert\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_alert', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[24][1] .= '<div id="layer_sound_alert"></div>';
$table->data[$i][0] = __('Sound for Alert fired');
$table->data[$i][1] = html_print_select($sounds, 'sound_alert', $config['sound_alert'], 'replaySound(\'alert\');', '', '', true);
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'alert\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_alert', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[$i++][1] .= '<div id="layer_sound_alert"></div>';
$table->data[25][0] = __('Sound for Monitor critical');
$table->data[25][1] = html_print_select($sounds, 'sound_critical', $config['sound_critical'], 'replaySound(\'critical\');', '', '', true);
$table->data[25][1] .= ' <a href="javascript: toggleButton(\'critical\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_critical', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[25][1] .= '<div id="layer_sound_critical"></div>';
$table->data[$i][0] = __('Sound for Monitor critical');
$table->data[$i][1] = html_print_select($sounds, 'sound_critical', $config['sound_critical'], 'replaySound(\'critical\');', '', '', true);
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'critical\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_critical', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[$i++][1] .= '<div id="layer_sound_critical"></div>';
$table->data[26][0] = __('Sound for Monitor warning');
$table->data[26][1] = html_print_select($sounds, 'sound_warning', $config['sound_warning'], 'replaySound(\'warning\');', '', '', true);
$table->data[26][1] .= ' <a href="javascript: toggleButton(\'warning\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_warning', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[26][1] .= '<div id="layer_sound_warning"></div>';
$table->data[$i][0] = __('Sound for Monitor warning');
$table->data[$i][1] = html_print_select($sounds, 'sound_warning', $config['sound_warning'], 'replaySound(\'warning\');', '', '', true);
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'warning\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_warning', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[$i++][1] .= '<div id="layer_sound_warning"></div>';
$table->data[28][0] = __('Public URL');
$table->data[28][0] .= ui_print_help_tip(
$table->data[$i][0] = __('Public URL');
$table->data[$i][0] .= ui_print_help_tip(
__('Set this value when your %s across inverse proxy or for example with mod_proxy of Apache.', get_product_name()).' '.__('Without the index.php such as http://domain/console_url/'),
true
);
$table->data[28][1] = html_print_input_text('public_url', $config['public_url'], '', 40, 255, true);
$table->data[$i++][1] = html_print_input_text('public_url', $config['public_url'], '', 40, 255, true);
$table->data[29][0] = __('Referer security');
$table->data[29][0] .= ui_print_help_tip(__("If enabled, actively checks if the user comes from %s's URL", get_product_name()), true);
$table->data[29][1] = html_print_checkbox_switch('referer_security', 1, $config['referer_security'], true);
$table->data[$i][0] = __('Force use Public URL');
$table->data[$i][0] .= ui_print_help_tip(__('Force using defined public URL).', get_product_name()), true);
$table->data[$i++][1] = html_print_switch(
[
'name' => 'force_public_url',
'value' => $config['force_public_url'],
]
);
$table->data[30][0] = __('Event storm protection');
$table->data[30][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true);
$table->data[30][1] = html_print_checkbox_switch('event_storm_protection', 1, $config['event_storm_protection'], true);
echo "<div id='force_public_url_dialog' title='".__('Enforce public URL usage information')."' style='display:none;'>";
echo "<p style='text-align: center;'>".__('If public URL is not properly configured you will lose access to ').get_product_name().__(' Console').'</p>';
echo '</div>';
$table->data[$i][0] = __('Public URL host exclusions');
$table->data[$i++][1] = html_print_textarea('public_url_exclusions', 2, 25, $config['public_url_exclusions'], 'style="height: 50px; width: 300px"', true);
$table->data[$i][0] = __('Referer security');
$table->data[$i][0] .= ui_print_help_tip(__("If enabled, actively checks if the user comes from %s's URL", get_product_name()), true);
$table->data[$i++][1] = html_print_checkbox_switch('referer_security', 1, $config['referer_security'], true);
$table->data[$i][0] = __('Event storm protection');
$table->data[$i][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true);
$table->data[$i++][1] = html_print_checkbox_switch('event_storm_protection', 1, $config['event_storm_protection'], true);
$table->data[31][0] = __('Command Snapshot').ui_print_help_tip(__('The string modules with several lines show as command output'), true);
$table->data[31][1] = html_print_checkbox_switch('command_snapshot', 1, $config['command_snapshot'], true);
$table->data[$i][0] = __('Command Snapshot').ui_print_help_tip(__('The string modules with several lines show as command output'), true);
$table->data[$i++][1] = html_print_checkbox_switch('command_snapshot', 1, $config['command_snapshot'], true);
$table->data[32][0] = __('Server logs directory').ui_print_help_tip(__('Directory where the server logs are stored.'), true);
$table->data[32][1] = html_print_input_text(
$table->data[$i][0] = __('Server logs directory').ui_print_help_tip(__('Directory where the server logs are stored.'), true);
$table->data[$i++][1] = html_print_input_text(
'server_log_dir',
$config['server_log_dir'],
'',
@ -236,8 +270,8 @@ $table->data[32][1] = html_print_input_text(
true
);
$table->data[33][0] = __('Log size limit in system logs viewer extension').ui_print_help_tip(__('Max size (in bytes) for the logs to be shown.'), true);
$table->data[33][1] = html_print_input_text(
$table->data[$i][0] = __('Log size limit in system logs viewer extension').ui_print_help_tip(__('Max size (in bytes) for the logs to be shown.'), true);
$table->data[$i++][1] = html_print_input_text(
'max_log_size',
$config['max_log_size'],
'',
@ -251,8 +285,8 @@ $modes_tutorial = [
'on_demand' => __('On demand'),
'expert' => __('Expert'),
];
$table->data['tutorial_mode'][0] = __('Tutorial mode').ui_print_help_tip(__("Configuration of our clippy, 'full mode' show the icon in the header and the contextual helps and it is noise, 'on demand' it is equal to full but it is not noise and 'expert' the icons in the header and the context is not."), true);
$table->data['tutorial_mode'][1] = html_print_select(
$table->data[$i][0] = __('Tutorial mode').ui_print_help_tip(__("Configuration of our clippy, 'full mode' show the icon in the header and the contextual helps and it is noise, 'on demand' it is equal to full but it is not noise and 'expert' the icons in the header and the context is not."), true);
$table->data[$i++][1] = html_print_select(
$modes_tutorial,
'tutorial_mode',
$config['tutorial_mode'],
@ -263,11 +297,11 @@ $table->data['tutorial_mode'][1] = html_print_select(
);
$config['past_planned_downtimes'] = isset($config['past_planned_downtimes']) ? $config['past_planned_downtimes'] : 1;
$table->data[34][0] = __('Allow create planned downtimes in the past').ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
$table->data[34][1] = html_print_checkbox_switch('past_planned_downtimes', 1, $config['past_planned_downtimes'], true);
$table->data[$i][0] = __('Allow create planned downtimes in the past').ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
$table->data[$i++][1] = html_print_checkbox_switch('past_planned_downtimes', 1, $config['past_planned_downtimes'], true);
$table->data[35][0] = __('Limit for bulk operations').ui_print_help_tip(__('Your PHP environment is set to 1000 max_input_vars. This parameter should have the same value or lower.', ini_get('max_input_vars')), true);
$table->data[35][1] = html_print_input_text(
$table->data[$i][0] = __('Limit for bulk operations').ui_print_help_tip(__('Your PHP environment is set to 1000 max_input_vars. This parameter should have the same value or lower.', ini_get('max_input_vars')), true);
$table->data[$i++][1] = html_print_input_text(
'limit_parameters_massive',
$config['limit_parameters_massive'],
'',
@ -276,17 +310,17 @@ $table->data[35][1] = html_print_input_text(
true
);
$table->data[36][0] = __('Include agents manually disabled');
$table->data[36][1] = html_print_checkbox_switch('include_agents', 1, $config['include_agents'], true);
$table->data[$i][0] = __('Include agents manually disabled');
$table->data[$i++][1] = html_print_checkbox_switch('include_agents', 1, $config['include_agents'], true);
$table->data[37][0] = __('Audit log directory').ui_print_help_tip(__('Directory where audit log is stored.'), true);
$table->data[37][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true);
$table->data[$i][0] = __('Audit log directory').ui_print_help_tip(__('Directory where audit log is stored.'), true);
$table->data[$i++][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true);
$table->data[38][0] = __('Set alias as name by default in agent creation');
$table->data[38][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
$table->data[$i][0] = __('Set alias as name by default in agent creation');
$table->data[$i++][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
$table->data[39][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
$table->data[39][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true);
$table->data[$i][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
$table->data[$i++][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
@ -352,44 +386,50 @@ $(document).ready (function () {
});
if ($("input[name=use_cert]").is(':checked')) {
$('#setup_general-13').show();
$('#ssl-path-tr').show();
}
$("input[name=use_cert]").change(function () {
if( $(this).is(":checked") )
$('#setup_general-13').show();
$('#ssl-path-tr').show();
else
$('#setup_general-13').hide();
$('#ssl-path-tr').hide();
});
$("input[name=https]").change(function (){
if($("input[name=https]").prop('checked')) {
$("#dialog").css({'display': 'inline', 'font-weight': 'bold'}).dialog({
$("#dialog").dialog({
modal: true,
buttons:{
"<?php echo __('Close'); ?>": function(){
$(this).dialog("close");
width: 500,
buttons:[
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next',
text: "<?php echo __('OK'); ?>",
click: function(){
$(this).dialog("close");
}
}
}
]
});
}
})
$("input[name=force_public_url]").change(function (){
if($("input[name=force_public_url]").prop('checked')) {
$("#force_public_url_dialog").dialog({
modal: true,
width: 500,
buttons: [
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next',
text: "<?php echo __('OK'); ?>",
click: function(){
$(this).dialog("close");
}
}
]
});
}
})
});
</script>
<?php
function get_sounds()
{
global $config;
$return = [];
$files = scandir($config['homedir'].'/include/sounds');
foreach ($files as $file) {
if (strstr($file, 'wav') !== false) {
$return['include/sounds/'.$file] = $file;
}
}
return $return;
}

View File

@ -1505,7 +1505,7 @@ $(document).ready (function () {
.prop('checked');
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id'));
});
$(".databox.filters").css('margin-bottom','-10px');
$(".databox.filters").css('margin-bottom','0px');
});
// Change the favicon preview when is changed

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 926 B

View File

@ -83,6 +83,7 @@ $validate_event = get_parameter('validate_event', 0);
$delete_event = get_parameter('delete_event', 0);
$get_event_filters = get_parameter('get_event_filters', 0);
$get_comments = get_parameter('get_comments', 0);
$get_events_fired = (bool) get_parameter('get_events_fired');
if ($get_comments) {
$event = get_parameter('event', false);
@ -1695,3 +1696,118 @@ if ($get_table_response_command) {
return;
}
if ($get_events_fired) {
$id = get_parameter('id_row');
$idGroup = get_parameter('id_group');
$agents = get_parameter('agents', null);
$query = ' AND id_evento > '.$id;
$type = [];
$alert = get_parameter('alert_fired');
if ($alert == 'true') {
$resultAlert = alerts_get_event_status_group(
$idGroup,
[
'alert_fired',
'alert_ceased',
],
$query,
$agents
);
}
$critical = get_parameter('critical');
if ($critical == 'true') {
$resultCritical = alerts_get_event_status_group(
$idGroup,
'going_up_critical',
$query,
$agents
);
}
$warning = get_parameter('warning');
if ($warning == 'true') {
$resultWarning = alerts_get_event_status_group(
$idGroup,
'going_up_warning',
$query,
$agents
);
}
$unknown = get_parameter('unknown');
if ($unknown == 'true') {
$resultUnknown = alerts_get_event_status_group(
$idGroup,
'going_unknown',
$query,
$agents
);
}
if ($resultAlert) {
$return = [
'fired' => $resultAlert,
'sound' => $config['sound_alert'],
];
$event = events_get_event($resultAlert);
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
$agent_name = agents_get_alias($event['id_agente']);
$return['message'] = io_safe_output($agent_name).' - ';
$return['message'] .= __('Alert fired in module ');
$return['message'] .= io_safe_output($module_name).' - ';
$return['message'] .= $event['timestamp'];
} else if ($resultCritical) {
$return = [
'fired' => $resultCritical,
'sound' => $config['sound_critical'],
];
$event = events_get_event($resultCritical);
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
$agent_name = agents_get_alias($event['id_agente']);
$return['message'] = io_safe_output($agent_name).' - ';
$return['message'] .= __('Module ').io_safe_output($module_name);
$return['message'] .= __(' is going to critical').' - ';
$return['message'] .= $event['timestamp'];
} else if ($resultWarning) {
$return = [
'fired' => $resultWarning,
'sound' => $config['sound_warning'],
];
$event = events_get_event($resultWarning);
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
$agent_name = agents_get_alias($event['id_agente']);
$return['message'] = io_safe_output($agent_name).' - ';
$return['message'] .= __('Module ').io_safe_output($module_name);
$return['message'] .= __(' is going to warning').' - ';
$return['message'] .= $event['timestamp'];
} else if ($resultUnknown) {
$return = [
'fired' => $resultUnknown,
'sound' => $config['sound_alert'],
];
$event = events_get_event($resultUnknown);
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
$agent_name = agents_get_alias($event['id_agente']);
$return['message'] = io_safe_output($agent_name).' - ';
$return['message'] .= __('Module ').io_safe_output($module_name);
$return['message'] .= __(' is going to unknown').' - ';
$return['message'] .= $event['timestamp'];
} else {
$return = ['fired' => 0];
}
echo io_json_mb_encode($return);
}

View File

@ -1263,6 +1263,7 @@ class ConsoleSupervisor
$PHPdisable_functions = ini_get('disable_functions');
$PHPupload_max_filesize_min = config_return_in_bytes('800M');
$PHPmemory_limit_min = config_return_in_bytes('500M');
$PHPSerialize_precision = ini_get('serialize_precision');
// PhantomJS status.
$result_ejecution = exec($config['phantomjs_bin'].'/phantomjs --version');
@ -1438,6 +1439,30 @@ class ConsoleSupervisor
} else {
$this->cleanNotifications('NOTIF.PHP.VERSION');
}
if ($PHPSerialize_precision != -1) {
$url = 'https://www.php.net/manual/en/ini.core.php#ini.serialize-precision';
if ($config['language'] == 'es') {
$url = 'https://www.php.net/manual/es/ini.core.php#ini.serialize-precision';
}
$this->notify(
[
'type' => 'NOTIF.PHP.SERIALIZE_PRECISION',
'title' => sprintf(
__("Not recommended '%s' value in PHP configuration"),
'serialze_precision'
), 'message' => sprintf(
__('Recommended value is: %s'),
sprintf('-1')
).'<br><br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator'),
'url' => $url,
]
);
} else {
$this->cleanNotifications('NOTIF.PHP.SERIALIZE_PRECISION');
}
}

View File

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

View File

@ -1513,29 +1513,30 @@ function agents_get_name($id_agent, $case='none')
* Get alias of an agent (cached function).
*
* @param integer $id_agent Agent id.
* @param string $case Case (upper, lower, none)
* @param string $case Case (upper, lower, none).
*
* @return string Alias of the given agent.
*/
function agents_get_alias($id_agent, $case='none')
{
global $config;
// Prepare cache
// Prepare cache.
static $cache = [];
if (empty($case)) {
$case = 'none';
}
// Check cache
// Check cache.
if (isset($cache[$case][$id_agent])) {
return $cache[$case][$id_agent];
}
if (is_metaconsole()) {
$alias = (string) db_get_value('alias', 'tmetaconsole_agent', 'id_tagente', (int) $id_agent);
} else {
$alias = (string) db_get_value('alias', 'tagente', 'id_agente', (int) $id_agent);
}
$alias = (string) db_get_value(
'alias',
'tagente',
'id_agente',
(int) $id_agent
);
switch ($case) {
case 'upper':
@ -1545,6 +1546,10 @@ function agents_get_alias($id_agent, $case='none')
case 'lower':
$alias = mb_strtolower($alias, 'UTF-8');
break;
default:
// Not posible.
break;
}
$cache[$case][$id_agent] = $alias;

View File

@ -266,6 +266,14 @@ function config_update_config()
$error_update[] = __('Public URL');
}
if (!config_update_value('force_public_url', get_parameter_switch('force_public_url'))) {
$error_update[] = __('Force use Public URL');
}
if (!config_update_value('public_url_exclusions', get_parameter('public_url_exclusions'))) {
$error_update[] = __('Public URL host exclusions');
}
if (!config_update_value('referer_security', get_parameter('referer_security'))) {
$error_update[] = __('Referer security');
}

View File

@ -25,13 +25,17 @@
* GNU General Public License for more details.
* ============================================================================
*/
global $config;
require_once $config['homedir'].'/include/functions_ui.php';
require_once $config['homedir'].'/include/functions_tags.php';
require_once $config['homedir'].'/include/functions.php';
require_once $config['homedir'].'/include/functions_reporting.php';
enterprise_include_once('include/functions_metaconsole.php');
enterprise_include_once('meta/include/functions_events_meta.php');
enterprise_include_once('meta/include/functions_agents_meta.php');
enterprise_include_once('meta/include/functions_modules_meta.php');
enterprise_include_once('meta/include/functions_events_meta.php');
/**
@ -4852,10 +4856,6 @@ function events_get_count_events_by_agent(
$tagente = 'tagente';
$tevento = 'tevento';
if ($dbmeta) {
$tagente = 'tmetaconsole_agent';
$tevento = 'tmetaconsole_event';
}
$sql = sprintf(
'SELECT id_agente,
@ -4865,7 +4865,7 @@ function events_get_count_events_by_agent(
COUNT(*) AS count
FROM %s t3
WHERE utimestamp > %d AND utimestamp <= %d
AND id_grupo IN (%s) %s
AND id_grupo IN (%s)
GROUP BY id_agente',
$tagente,
$tevento,
@ -5032,9 +5032,6 @@ function events_get_count_events_validated_by_user(
}
$tevento = 'tevento';
if ($dbmeta) {
$tevento = 'tmetaconsole_event';
}
$sql = sprintf(
'SELECT id_usuario,
@ -5210,9 +5207,6 @@ function events_get_count_events_by_criticity(
}
$tevento = 'tevento';
if ($dbmeta) {
$tevento = 'tmetaconsole_event';
}
$sql = sprintf(
'SELECT criticity,
@ -5418,9 +5412,6 @@ function events_get_count_events_validated(
}
$tevento = 'tevento';
if ($dbmeta) {
$tevento = 'tmetaconsole_event';
}
$sql = sprintf('SELECT estado, COUNT(*) AS count FROM %s WHERE %s %s GROUP BY estado', $tevento, $sql_filter, $sql_where);

View File

@ -1277,12 +1277,34 @@ function graphic_combined_module(
array_push($modules, $source['id_agent_module']);
array_push($weights, $source['weight']);
if ($source['label'] != '' || $params_combined['labels']) {
$item['type'] = 'custom_graph';
$item['id_agent'] = agents_get_module_id(
$id_agent = agents_get_module_id(
$source['id_agent_module']
);
$item['id_agent_module'] = $source['id_agent_module'];
$labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($item, $source['label']) : reporting_label_macro($item, $params_combined['labels']);
$agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent);
$agent_alias = agents_get_alias($id_agent);
$module_name = modules_get_agentmodule_name(
$source['id_agent_module']
);
$module_description = modules_get_agentmodule_descripcion(
$source['id_agent_module']
);
$items_label = [
'type' => 'custom_graph',
'id_agent' => $id_agent,
'id_agent_module' => $source['id_agent_module'],
'agent_description' => $agent_description,
'agent_group' => $agent_group,
'agent_address' => $agent_address,
'agent_alias' => $agent_alias,
'module_name' => $module_name,
'module_description' => $module_description,
];
$labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($items_label, $source['label']) : reporting_label_macro($item, $params_combined['labels']);
}
}
}
@ -2161,7 +2183,7 @@ function graphic_combined_module(
$graph_values = $temp;
if (!$params['vconsole']) {
$width = 1024;
$width = $width;
$height = 500;
}

View File

@ -77,8 +77,7 @@ function html_debug_print($var, $file='', $oneline=false)
fprintf($f, '%s', $output);
fclose($f);
} else {
echo '<pre>'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info.'</pre>';
echo '<pre>';
echo '<pre style="z-index: 10000; background: #fff; padding: 1em;">'.date('Y/m/d H:i:s').' ('.gettype($var).') '.$more_info."\n";
print_r($var);
echo '</pre>';
}

View File

@ -566,11 +566,11 @@ function modules_update_agent_module(
/**
* Creates a module in an agent.
*
* @param int Agent id.
* @param int Module name id.
* @param array Extra values for the module.
* @param bool Disable the ACL checking, for default false.
* @param mixed Array with tag's ids or false.
* @param integer $id_agent Agent id.
* @param integer $name Module name id.
* @param array $values Extra values for the module.
* @param boolean $disableACL Disable the ACL checking, for default false.
* @param mixed $tags Array with tag's ids or false.
*
* @return New module id if the module was created. False if not.
*/
@ -584,7 +584,9 @@ function modules_create_agent_module(
global $config;
if (!$disableACL) {
if (!users_is_admin() && (empty($id_agent) || ! users_access_to_agent($id_agent, 'AW'))) {
if (!users_is_admin() && (empty($id_agent)
|| !users_access_to_agent($id_agent, 'AW'))
) {
return false;
}
}
@ -593,7 +595,7 @@ function modules_create_agent_module(
return ERR_INCOMPLETE;
}
// Check for non valid characters in module name
// Check for non valid characters in module name.
if (mb_ereg_match('[\xc2\xa1\xc2\xbf\xc3\xb7\xc2\xba\xc2\xaa]', io_safe_output($name)) !== false) {
return ERR_GENERIC;
}
@ -605,23 +607,33 @@ function modules_create_agent_module(
$values['nombre'] = $name;
$values['id_agente'] = (int) $id_agent;
$exists = (bool) db_get_value_filter('id_agente_modulo', 'tagente_modulo', ['nombre' => $name, 'id_agente' => (int) $id_agent]);
$exists = (bool) db_get_value_filter(
'id_agente_modulo',
'tagente_modulo',
[
'nombre' => $name,
'id_agente' => (int) $id_agent,
]
);
if ($exists) {
return ERR_EXIST;
}
// Encrypt passwords
// Encrypt passwords.
if (isset($values['plugin_pass'])) {
$values['plugin_pass'] = io_input_password($values['plugin_pass']);
}
// Encrypt SNMPv3 passwords
if (isset($values['id_tipo_modulo']) && ($values['id_tipo_modulo'] >= 15 && $values['id_tipo_modulo'] <= 18)
// Encrypt SNMPv3 passwords.
if (isset($values['id_tipo_modulo']) && ($values['id_tipo_modulo'] >= 15
&& $values['id_tipo_modulo'] <= 18)
&& isset($values['tcp_send']) && ($values['tcp_send'] == 3)
&& isset($values['custom_string_2'])
) {
$values['custom_string_2'] = io_input_password($values['custom_string_2']);
$values['custom_string_2'] = io_input_password(
$values['custom_string_2']
);
}
$id_agent_module = db_process_sql_insert('tagente_modulo', $values);
@ -645,25 +657,33 @@ function modules_create_agent_module(
}
if (isset($values['id_tipo_modulo'])
&& ($values['id_tipo_modulo'] == 21 || $values['id_tipo_modulo'] == 22 || $values['id_tipo_modulo'] == 23)
&& ($values['id_tipo_modulo'] == 21
|| $values['id_tipo_modulo'] == 22
|| $values['id_tipo_modulo'] == 23)
) {
// Async modules start in normal status
// Async modules start in normal status.
$status = AGENT_MODULE_STATUS_NORMAL;
} else {
// Sync modules start in unknown status
// Sync modules start in unknown status.
$status = AGENT_MODULE_STATUS_NO_DATA;
}
// Condition for cron modules. Don't touch.
$time = 0;
if (empty($values['interval']) === false) {
$time = (time() - (int) $values['interval']);
}
$result = db_process_sql_insert(
'tagente_estado',
[
'id_agente_modulo' => $id_agent_module,
'datos' => 0,
'datos' => '',
'timestamp' => '01-01-1970 00:00:00',
'estado' => $status,
'known_status' => $status,
'id_agente' => (int) $id_agent,
'utimestamp' => (time() - (int) $values['interval']),
'utimestamp' => $time,
'status_changes' => 0,
'last_status' => $status,
'last_known_status' => $status,
@ -680,12 +700,20 @@ function modules_create_agent_module(
return ERR_DB;
}
// Update module status count if the module is not created disabled
// Update module status count if the module is not created disabled.
if (!isset($values['disabled']) || $values['disabled'] == 0) {
if ($status == 0) {
db_process_sql('UPDATE tagente SET total_count=total_count+1, normal_count=normal_count+1 WHERE id_agente='.(int) $id_agent);
db_process_sql(
'UPDATE tagente
SET total_count=total_count+1, normal_count=normal_count+1
WHERE id_agente='.(int) $id_agent
);
} else {
db_process_sql('UPDATE tagente SET total_count=total_count+1, notinit_count=notinit_count+1 WHERE id_agente='.(int) $id_agent);
db_process_sql(
'UPDATE tagente
SET total_count=total_count+1, notinit_count=notinit_count+1
WHERE id_agente='.(int) $id_agent
);
}
}

View File

@ -35,8 +35,8 @@ define('NETFLOW_RES_LOWD', 6);
define('NETFLOW_RES_MEDD', 12);
define('NETFLOW_RES_HID', 24);
define('NETFLOW_RES_ULTRAD', 30);
define('NETFLOW_RES_HOURLY', 'hourly');
define('NETFLOW_RES_DAILY', 'daily');
define('NETFLOW_RES_HOURLY', -1);
define('NETFLOW_RES_DAILY', -2);
define('NETFLOW_MAX_DATA_CIRCULAR_MESH', 10000);
@ -473,7 +473,7 @@ function netflow_get_data(
// Put all points into an array.
$intervals = [($start_date - $multiplier_time)];
while ((end($intervals) < $end_date) === true) {
while (($next = (end($intervals) + $multiplier_time) < $end_date) === true) {
$intervals[] = (end($intervals) + $multiplier_time);
}

File diff suppressed because it is too large Load Diff

View File

@ -141,6 +141,15 @@ function html_do_report_info($report)
}
/**
* Print html report.
*
* @param array $report Info.
* @param boolean $mini Type.
* @param integer $report_info Show info.
*
* @return array
*/
function reporting_html_print_report($report, $mini=false, $report_info=1)
{
if ($report_info == 1) {
@ -161,7 +170,38 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
$table->rowstyle = [];
if (isset($item['label']) && $item['label'] != '') {
$label = reporting_label_macro($item, $item['label']);
$id_agent = $item['id_agent'];
$id_agent_module = $item['id_agent_module'];
// Add macros name.
$agent_description = agents_get_description($id_agent);
$agent_group = agents_get_agent_group($id_agent);
$agent_address = agents_get_address($id_agent);
$agent_alias = agents_get_alias($id_agent);
$module_name = modules_get_agentmodule_name(
$id_agent_module
);
$module_description = modules_get_agentmodule_descripcion(
$id_agent_module
);
$items_label = [
'type' => $item['type'],
'id_agent' => $id_agent,
'id_agent_module' => $id_agent_module,
'agent_description' => $agent_description,
'agent_group' => $agent_group,
'agent_address' => $agent_address,
'agent_alias' => $agent_alias,
'module_name' => $module_name,
'module_description' => $module_description,
];
$label = reporting_label_macro(
$items_label,
$item['label']
);
} else {
$label = '';
}
@ -180,7 +220,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
$table->data['description_row']['description'] = $item['description'];
if ($item['type'] == 'event_report_agent' || $item['type'] == 'event_report_group' || $item['type'] == 'event_report_module') {
if ($item['type'] == 'event_report_agent'
|| $item['type'] == 'event_report_group'
|| $item['type'] == 'event_report_module'
) {
$table->data['count_row']['count'] = 'Total events: '.$item['total_events'];
}
@ -759,7 +802,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
$table1->size[10] = '2%';
$table1->data[0][10] = '<img src ="'.$src.'images/square_light_gray.png">';
$table1->size[11] = '15%';
$table1->data[0][11] = '<span>'.__('Ignore time').'</span>';
$table1->data[0][11] = '<span>'.__('Planned Downtime').'</span>';
if ($pdf === 0) {
$table->colspan['legend']['cell'] = 2;
@ -3399,7 +3442,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$table2->size[10] = '2%';
$table2->data[0][10] = '<img src ="'.$src.$hack_metaconsole.'images/square_light_gray.png">';
$table2->size[11] = '15%';
$table2->data[0][11] = '<span>'.__('Ignore time').'</span>';
$table2->data[0][11] = '<span>'.__('Planned Downtime').'</span>';
}
if ($pdf !== 0) {

File diff suppressed because it is too large Load Diff

View File

@ -2055,7 +2055,7 @@ function ui_pagination(
$actual_page = floor($offset / $pagination);
$ini_page = (floor($actual_page / $block_limit) * $block_limit);
$end_page = ($ini_page + $block_limit - 1);
if ($end_page > $number_of_pages) {
if ($end_page >= $number_of_pages) {
$end_page = ($number_of_pages - 1);
}
@ -3699,6 +3699,24 @@ function ui_get_url_refresh($params=false, $relative=true, $add_post=true)
}
/**
* Checks if public_url usage is being forced to target 'visitor'.
*
* @return boolean
*/
function ui_forced_public_url()
{
global $config;
$exclusions = preg_split("/[\n\s,]+/", io_safe_output($config['public_url_exclusions']));
if (in_array($_SERVER['REMOTE_ADDR'], $exclusions)) {
return false;
}
return (bool) $config['force_public_url'];
}
/**
* Returns a full URL in Pandora. (with the port and https in some systems)
*
@ -3745,12 +3763,18 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
}
if (!$no_proxy) {
// Check if the PandoraFMS runs across the proxy like as
// mod_proxy of Apache
// and check if public_url is set.
if (!empty($config['public_url'])
// Check proxy.
$proxy = false;
if (ui_forced_public_url()) {
$proxy = true;
$fullurl = $config['public_url'];
if ($url == 'index.php' && is_metaconsole()) {
$fullurl .= '/'.ENTERPRISE_DIR.'/meta';
}
} else if (!empty($config['public_url'])
&& (!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
) {
// Forced to use public url when being forwarder by a reverse proxy.
$fullurl = $config['public_url'];
$proxy = true;
} else {
@ -3782,7 +3806,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
$url = $config['homeurl_static'].'/';
}
if (defined('METACONSOLE') && $metaconsole_root) {
if (is_metaconsole() && $metaconsole_root) {
$url .= 'enterprise/meta/';
}
} else if (!strstr($url, '.php')) {
@ -3792,7 +3816,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
$fullurl .= $config['homeurl_static'].'/';
}
if (defined('METACONSOLE') && $metaconsole_root) {
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
} else {
@ -3804,7 +3828,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
} else {
$fullurl .= $config['homeurl_static'].'/';
if (defined('METACONSOLE') && $metaconsole_root) {
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
}

View File

@ -4271,7 +4271,7 @@ function visual_map_create_internal_name_item($label=null, $type, $image, $agent
case 'static_graph':
case STATIC_GRAPH:
$text = __('Static graph').' - '.$image;
$text = __('Static Image').' - '.$image;
break;
case 'simple_value':

View File

@ -1294,7 +1294,7 @@ function visual_map_editor_print_toolbox()
}
echo '<div id="toolbox">';
visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true);
visual_map_print_button_editor('static_graph', __('Static Image'), 'left', false, 'camera_min', true);
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
visual_map_print_button_editor('donut_graph', __('Serialized pie graph'), 'left', false, 'donut_graph_min', true);

View File

@ -2791,14 +2791,16 @@ function pandoraFlotArea(
if (short_data) {
formatted = number_format(v, force_integer, "", short_data);
} else {
// It is an integer
// It is an integer.
if (v - Math.floor(v) == 0) {
formatted = number_format(v, force_integer, "", 2);
}
}
// Get only two decimals
formatted = round_with_decimals(formatted, 100);
// Get only two decimals.
if (typeof formatted != "string") {
formatted = Math.round(formatted * 100) / 100;
}
return formatted;
}

View File

@ -2,19 +2,23 @@
#cluetip-close img {
border: 0;
}
#cluetip-title {
overflow: hidden;
}
#cluetip-title #cluetip-close {
float: right;
position: relative;
}
#cluetip-waitimage {
width: 43px;
height: 11px;
position: absolute;
background-image: url(../../../images/wait.gif);
}
.cluetip-arrows {
display: none;
position: absolute;
@ -25,9 +29,11 @@
background-repeat: no-repeat;
background-position: 0 0;
}
#cluetip-extra {
display: none;
}
/***************************************
=cluetipClass: 'default'
-------------------------------------- */
@ -36,11 +42,13 @@
background-color: #fff;
text-align: left;
}
.cluetip-default #cluetip-outer {
position: relative;
margin: 0;
background-color: #fff;
}
.cluetip-default h3 {
margin: 0 0 5px;
padding: 8px 10px 4px;
@ -49,6 +57,7 @@
background-color: #b1b1b1;
color: #fff;
}
.cluetip-default h3#cluetip-title {
display: none;
height: 0px;
@ -56,41 +65,49 @@
padding: 0;
color: #fff;
}
.cluetip-default #cluetip-title a {
color: #fff;
font-size: 0.95em;
}
.cluetip-default #cluetip-inner {
padding: 10px;
}
.cluetip-default div#cluetip-close {
text-align: right;
margin: 0 5px 5px;
color: #900;
}
.cluetip-default ul {
text-align: left;
}
/* default arrows */
.clue-right-default .cluetip-arrows {
background-image: url(../../images/darrowleft.png);
background-image: url(../../../images/darrowleft.png);
}
.clue-left-default .cluetip-arrows {
background-image: url(../../images/darrowright.png);
background-image: url(../../../images/darrowright.png);
left: 100%;
margin-right: -11px;
}
.clue-top-default .cluetip-arrows {
background-image: url(../../images/darrowdown.png);
background-image: url(../../../images/darrowdown.png);
top: 100%;
left: 50%;
margin-left: -11px;
height: 11px;
width: 22px;
}
.clue-bottom-default .cluetip-arrows {
background-image: url(../../images/darrowup.png);
background-image: url(../../../images/darrowup.png);
top: -11px;
left: 50%;
margin-left: -11px;

View File

@ -235,11 +235,12 @@ pre {
font-family: courier, serif;
}
fieldset {
background-color: #f9faf9;
background-color: #fff;
border: 1px solid #e2e2e2;
padding: 0.5em;
margin-bottom: 20px;
position: relative;
border-radius: 5px;
}
fieldset legend {
font-size: 1.1em;
@ -5328,6 +5329,10 @@ table.info_table.policy_sub_table {
margin-bottom: 4px;
}
.agent_options input[readonly] {
color: #848484;
}
/*
* ---------------------------------------------------------------------
* - CLASSES FOR THE NEW TOGGLES -
@ -5866,3 +5871,7 @@ table.table_modal_alternate tr td:first-child {
padding-left: 20px;
}
/* END - Table for show more info in events and config menu in modules graphs */
.fullwidth {
width: 100%;
}

View File

@ -237,19 +237,12 @@ table.table_modal_alternate tr:nth-child(even) td {
background-color: #555 !important;
}
.info_table .datos3,
.datos3,
.info_table .datos4,
.datos4 {
background-color: #666;
color: #fff;
}
.info_table .datos3,
.datos3,
.info_table .datos4,
.datos4 {
background-color: #444;
color: #fff;
}
.action_buttons a[href] img,
@ -394,3 +387,8 @@ ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
div#box_online * {
color: #000;
}
/* discovery.css */
#text_wizard {
color: #555;
}

View File

@ -262,11 +262,16 @@ a.pandora_pagination {
padding: 5px;
color: #000;
border: 1px solid #cacaca;
border-left: none;
min-width: 12px;
margin-right: -1px;
text-decoration: none;
cursor: pointer;
}
.dataTables_paginate > span > span.ellipsis + a.pandora_pagination:last-child,
.dataTables_paginate a.pandora_pagination.previous {
border-left: 1px solid #cacaca;
}
a.pandora_pagination.disabled {
color: #cacaca;
}

View File

@ -1,17 +1,32 @@
<?php
/**
* Index.
*
* @category Main entrypoint.
* @package Pandora FMS
* @subpackage Opensource.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2012 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Enable profiler for testing
// Begin.
if (!defined('__PAN_XHPROF__')) {
define('__PAN_XHPROF__', 0);
}
@ -24,17 +39,18 @@ if (__PAN_XHPROF__ === 1) {
}
}
// Set character encoding to UTF-8 - fixes a lot of multibyte character headaches
// Set character encoding to UTF-8
// fixes a lot of multibyte character issues.
if (function_exists('mb_internal_encoding')) {
mb_internal_encoding('UTF-8');
}
// Set to 1 to do not check for installer or config file (for development!).
// Activate gives more error information, not useful for production sites
// Activate gives more error information, not useful for production sites.
$develop_bypass = 0;
if ($develop_bypass != 1) {
// If no config file, automatically try to install
// If no config file, automatically try to install.
if (! file_exists('include/config.php')) {
if (! file_exists('install.php')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
@ -74,14 +90,14 @@ if ($develop_bypass != 1) {
}
}
// Check for installer presence
// Check installer presence.
if (file_exists('install.php')) {
$login_screen = 'error_install';
include 'general/error_screen.php';
exit;
}
// Check perms for config.php
// Check perms for config.php.
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
if ((substr(sprintf('%o', fileperms('include/config.php')), -4) != '0600')
&& (substr(sprintf('%o', fileperms('include/config.php')), -4) != '0660')
@ -110,15 +126,18 @@ if ($develop_bypass != 1) {
}
}
if ((! file_exists('include/config.php')) || (! is_readable('include/config.php'))) {
if ((! file_exists('include/config.php'))
|| (! is_readable('include/config.php'))
) {
$login_screen = 'error_noconfig';
include 'general/error_screen.php';
exit;
}
//
// PLEASE DO NOT CHANGE ORDER //////
//
/*
* DO NOT CHANGE ORDER OF FOLLOWING REQUIRES.
*/
require_once 'include/config.php';
require_once 'include/functions_config.php';
@ -128,11 +147,11 @@ if (isset($config['error'])) {
exit;
}
// If metaconsole activated, redirect to it
if ($config['metaconsole'] == 1 && $config['enterprise_installed'] == 1) {
header('Location: '.$config['homeurl'].'enterprise/meta');
// If metaconsole activated, redirect to it.
if (is_metaconsole()) {
header('Location: '.ui_get_full_url('index.php'));
// Always exit after sending location headers.
exit;
// Always exit after sending location headers
}
if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
@ -141,12 +160,12 @@ if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
if (!empty($config['https']) && empty($_SERVER['HTTPS'])) {
$query = '';
if (sizeof($_REQUEST)) {
// Some (old) browsers don't like the ?&key=var
if (count($_REQUEST)) {
// Some (old) browsers don't like the ?&key=var.
$query .= '?1=1';
}
// We don't clean these variables up as they're only being passed along
// We don't clean these variables up as they're only being passed along.
foreach ($_GET as $key => $value) {
if ($key == 1) {
continue;
@ -162,12 +181,12 @@ if (!empty($config['https']) && empty($_SERVER['HTTPS'])) {
$url = ui_get_full_url($query);
// Prevent HTTP response splitting attacks
// http://en.wikipedia.org/wiki/HTTP_response_splitting
// http://en.wikipedia.org/wiki/HTTP_response_splitting.
$url = str_replace("\n", '', $url);
header('Location: '.$url);
// Always exit after sending location headers.
exit;
// Always exit after sending location headers
}
// Pure mode (without menu, header and footer).
@ -188,20 +207,21 @@ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www
echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
echo '<head>'."\n";
// This starts the page head. In the call back function, things from $page['head'] array will be processed into the head
// This starts the page head. In the callback function,
// $page['head'] array content will be processed into the head.
ob_start('ui_process_page_head');
// Enterprise main
// Enterprise main.
enterprise_include('index.php');
echo '<script type="text/javascript">';
echo 'var dispositivo = navigator.userAgent.toLowerCase();';
echo 'if( dispositivo.search(/iphone|ipod|ipad|android/) > -1 ){';
echo 'document.location = "'.$config['homeurl'].'mobile"; }';
echo 'document.location = "'.ui_get_full_url('/mobile').'"; }';
echo '</script>';
// This tag is included in the buffer passed to ui_process_page_head so
// technically it can be stripped
// technically it can be stripped.
echo '</head>'."\n";
require_once 'include/functions_themes.php';
@ -212,13 +232,13 @@ $config['remote_addr'] = $_SERVER['REMOTE_ADDR'];
$sec2 = get_parameter_get('sec2');
$sec2 = safe_url_extraclean($sec2);
$page = $sec2;
// Reference variable for old time sake
// Reference variable for old time sake.
$sec = get_parameter_get('sec');
$sec = safe_url_extraclean($sec);
$process_login = false;
// Update user password
// Update user password.
$change_pass = get_parameter_post('renew_password', 0);
if ($change_pass == 1) {
@ -235,14 +255,14 @@ $searchPage = false;
$search = get_parameter_get('head_search_keywords');
if (strlen($search) > 0) {
$config['search_keywords'] = io_safe_input(trim(io_safe_output(get_parameter('keywords'))));
// If not search category providad, we'll use an agent search
// If not search category providad, we'll use an agent search.
$config['search_category'] = get_parameter('search_category', 'all');
if (($config['search_keywords'] != 'Enter keywords to search') && (strlen($config['search_keywords']) > 0)) {
$searchPage = true;
}
}
// Login process
// Login process.
if (! isset($config['id_user'])) {
// Clear error messages.
unset($_COOKIE['errormsg']);
@ -250,50 +270,53 @@ if (! isset($config['id_user'])) {
if (isset($_GET['login'])) {
include_once 'include/functions_db.php';
// Include it to use escape_string_sql function
// Include it to use escape_string_sql function.
$config['auth_error'] = '';
// Set this to the error message from the authorization mechanism
// Set this to the error message from the authorization mechanism.
$nick = get_parameter_post('nick');
// This is the variable with the login
// This is the variable with the login.
$pass = get_parameter_post('pass');
// This is the variable with the password
// This is the variable with the password.
$nick = db_escape_string_sql($nick);
$pass = db_escape_string_sql($pass);
// Since now, only the $pass variable are needed
// Since now, only the $pass variable are needed.
unset($_GET['pass'], $_POST['pass'], $_REQUEST['pass']);
// If the auth_code exists, we assume the user has come through the double auth page
// If the auth_code exists, we assume the user has come from
// double authorization page.
if (isset($_POST['auth_code'])) {
$double_auth_success = false;
// The double authentication is activated and the user has surpassed the first step (the login).
// The double authentication is activated and the user has
// surpassed the first step (the login).
// Now the authentication code provided will be checked.
if (isset($_SESSION['prepared_login_da'])) {
if (isset($_SESSION['prepared_login_da']['id_user'])
&& isset($_SESSION['prepared_login_da']['timestamp'])
) {
// The user has a maximum of 5 minutes to introduce the double auth code
// The user has a maximum of 5 minutes to introduce
// the double auth code.
$dauth_period = SECONDS_2MINUTES;
$now = time();
$dauth_time = $_SESSION['prepared_login_da']['timestamp'];
if (($now - $dauth_period) < $dauth_time) {
// Nick
// Nick.
$nick = $_SESSION['prepared_login_da']['id_user'];
// Code
// Code.
$code = (string) get_parameter_post('auth_code');
if (!empty($code)) {
$result = validate_double_auth_code($nick, $code);
if ($result === true) {
// Double auth success
// Double auth success.
$double_auth_success = true;
} else {
// Screen
// Screen.
$login_screen = 'double_auth';
// Error message
// Error message.
$config['auth_error'] = __('Invalid code');
if (!isset($_SESSION['prepared_login_da']['attempts'])) {
@ -303,9 +326,9 @@ if (! isset($config['id_user'])) {
$_SESSION['prepared_login_da']['attempts']++;
}
} else {
// Screen
// Screen.
$login_screen = 'double_auth';
// Error message
// Error message.
$config['auth_error'] = __("The code shouldn't be empty");
if (!isset($_SESSION['prepared_login_da']['attempts'])) {
@ -315,27 +338,27 @@ if (! isset($config['id_user'])) {
$_SESSION['prepared_login_da']['attempts']++;
}
} else {
// Expired login
// Expired login.
unset($_SESSION['prepared_login_da']);
// Error message
// Error message.
$config['auth_error'] = __('Expired login');
}
} else {
// If the code doesn't exist, remove the prepared login
// If the code doesn't exist, remove the prepared login.
unset($_SESSION['prepared_login_da']);
// Error message
// Error message.
$config['auth_error'] = __('Login error');
}
}
// If $_SESSION['prepared_login_da'] doesn't exist, the user have to do the login again
else {
// Error message
} else {
// If $_SESSION['prepared_login_da'] doesn't exist, the user
// must login again.
// Error message.
$config['auth_error'] = __('Login error');
}
// Remove the authenticator code
// Remove the authenticator code.
unset($_POST['auth_code'], $code);
if (!$double_auth_success) {
@ -347,6 +370,8 @@ if (! isset($config['id_user'])) {
$_SERVER['REMOTE_ADDR']
);
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
@ -355,7 +380,8 @@ if (! isset($config['id_user'])) {
$login_button_saml = get_parameter('login_button_saml', false);
if (isset($double_auth_success) && $double_auth_success) {
// This values are true cause there are checked before complete the 2nd auth step
// This values are true cause there are checked before complete
// the 2nd auth step.
$nick_in_db = $_SESSION['prepared_login_da']['id_user'];
$expired_pass = false;
} else if (($config['auth'] == 'saml') && ($login_button_saml)) {
@ -400,28 +426,34 @@ if (! isset($config['id_user'])) {
include_once 'general/login_page.php';
db_pandora_audit('Password expired', 'Password expired: '.$nick, $nick);
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
}
// Checks if password has expired
// Checks if password has expired.
$check_status = check_pass_status($nick, $pass);
switch ($check_status) {
case PASSSWORD_POLICIES_FIRST_CHANGE:
// first change
// First change.
case PASSSWORD_POLICIES_EXPIRED:
// pass expired
// Pass expired.
$expired_pass = true;
login_change_password($nick, '', $check_status);
break;
default:
// Ignore.
break;
}
}
}
if (($nick_in_db !== false) && $expired_pass) {
// login ok and password has expired
// Login ok and password has expired.
include_once 'general/login_page.php';
db_pandora_audit(
'Password expired',
@ -429,30 +461,38 @@ if (! isset($config['id_user'])) {
$nick
);
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
} else if (($nick_in_db !== false) && (!$expired_pass)) {
// login ok and password has not expired
// Double auth check
if ((!isset($double_auth_success) || !$double_auth_success) && is_double_auth_enabled($nick_in_db)) {
// Store this values in the session to know if the user login was correct
// Login ok and password has not expired.
// Double auth check.
if ((!isset($double_auth_success)
|| !$double_auth_success)
&& is_double_auth_enabled($nick_in_db)
) {
// Store this values in the session to know if the user login
// was correct.
$_SESSION['prepared_login_da'] = [
'id_user' => $nick_in_db,
'timestamp' => time(),
'attempts' => 0,
];
// Load the page to introduce the double auth code
// Load the page to introduce the double auth code.
$login_screen = 'double_auth';
include_once 'general/login_page.php';
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
}
// login ok and password has not expired
// Login ok and password has not expired.
$process_login = true;
if (is_user_admin($nick)) {
@ -464,7 +504,7 @@ if (! isset($config['id_user'])) {
if (!isset($_GET['sec2']) && !isset($_GET['sec'])) {
// Avoid the show homepage when the user go to
// a specific section of pandora
// for example when timeout the sesion
// for example when timeout the sesion.
unset($_GET['sec2']);
$_GET['sec'] = 'general/logon_ok';
$home_page = '';
@ -495,6 +535,7 @@ if (! isset($config['id_user'])) {
break;
case 'Default':
default:
$_GET['sec'] = 'general/logon_ok';
break;
@ -530,11 +571,14 @@ if (! isset($config['id_user'])) {
$_SESSION['id_usuario'] = $nick_in_db;
$config['id_user'] = $nick_in_db;
// Check if connection goes through F5 balancer. If it does, then don't call config_prepare_session() or user will be back to login all the time
// Check if connection goes through F5 balancer. If it does, then
// don't call config_prepare_session() or user will be back to login
// all the time.
$prepare_session = true;
foreach ($_COOKIE as $key => $value) {
if (preg_match('/BIGipServer*/', $key)) {
$prepare_session = false;
break;
}
}
@ -543,9 +587,13 @@ if (! isset($config['id_user'])) {
}
if (is_user_admin($config['id_user'])) {
// PHP configuration values
$PHPupload_max_filesize = config_return_in_bytes(ini_get('upload_max_filesize'));
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
// PHP configuration values.
$PHPupload_max_filesize = config_return_in_bytes(
ini_get('upload_max_filesize')
);
$PHPmemory_limit = config_return_in_bytes(
ini_get('memory_limit')
);
$PHPmax_execution_time = ini_get('max_execution_time');
if ($PHPmax_execution_time !== '0') {
@ -580,43 +628,60 @@ if (! isset($config['id_user'])) {
$l10n = null;
if (file_exists('./include/languages/'.$user_language.'.mo')) {
$l10n = new gettext_reader(new CachedFileReader('./include/languages/'.$user_language.'.mo'));
$cacheFileReader = new CachedFileReader(
'./include/languages/'.$user_language.'.mo'
);
$l10n = new gettext_reader($cacheFileReader);
$l10n->load_tables();
}
} else {
// login wrong
// Login wrong.
$blocked = false;
if ((!is_user_admin($nick) || $config['enable_pass_policy_admin']) && file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ((!is_user_admin($nick) || $config['enable_pass_policy_admin'])
&& file_exists(ENTERPRISE_DIR.'/load_enterprise.php')
) {
$blocked = login_check_blocked($nick);
}
if (!$blocked) {
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
// Checks failed attempts.
login_check_failed($nick);
// Checks failed attempts
}
$login_failed = true;
include_once 'general/login_page.php';
db_pandora_audit('Logon Failed', 'Invalid login: '.$nick, $nick);
db_pandora_audit(
'Logon Failed',
'Invalid login: '.$nick,
$nick
);
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
} else {
include_once 'general/login_page.php';
db_pandora_audit('Logon Failed', 'Invalid login: '.$nick, $nick);
db_pandora_audit(
'Logon Failed',
'Invalid login: '.$nick,
$nick
);
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
}
}
// Form the url
// Form the url.
$query_params_redirect = $_GET;
// Visual console do not want sec2
// Visual console do not want sec2.
if ($home_page == 'Visual console') {
unset($query_params_redirect['sec2']);
}
@ -630,15 +695,19 @@ if (! isset($config['id_user'])) {
$redirect_url .= '&'.safe_url_extraclean($key).'='.safe_url_extraclean($value);
}
header('Location: '.$config['homeurl'].'index.php'.$redirect_url);
header('Location: '.ui_get_full_url('index.php'.$redirect_url));
exit;
// Always exit after sending location headers.
} else if (isset($_GET['loginhash'])) {
// Hash login process
// Hash login process.
$loginhash_data = get_parameter('loginhash_data', '');
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
if ($config['loginhash_pwd'] != '' && $loginhash_data == md5($loginhash_user.io_output_password($config['loginhash_pwd']))) {
if ($config['loginhash_pwd'] != ''
&& $loginhash_data == md5(
$loginhash_user.io_output_password($config['loginhash_pwd'])
)
) {
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
$_SESSION['id_usuario'] = $loginhash_user;
$config['id_user'] = $loginhash_user;
@ -646,6 +715,8 @@ if (! isset($config['id_user'])) {
include_once 'general/login_page.php';
db_pandora_audit('Logon Failed (loginhash', '', 'system');
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
@ -767,7 +838,7 @@ if (! isset($config['id_user'])) {
$body .= '<p />';
$body .= __('Please click the link below to reset your password');
$body .= '<p />';
$body .= '<a href="'.$config['homeurl'].'index.php?reset_hash='.$cod_hash.'">'.__('Reset your password').'</a>';
$body .= '<a href="'.ui_get_full_url('index.php?reset_hash='.$cod_hash).'">'.__('Reset your password').'</a>';
$body .= '<p />';
$body .= get_product_name();
$body .= '<p />';
@ -790,6 +861,8 @@ if (! isset($config['id_user'])) {
}
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
@ -799,11 +872,20 @@ if (! isset($config['id_user'])) {
$loginhash_data = get_parameter('loginhash_data', '');
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
$iduser = $_SESSION['id_usuario'];
// logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]); check why is not available
/*
* Check why is not available.
* logoff_db ($iduser, $_SERVER["REMOTE_ADDR"]);
*/
unset($_SESSION['id_usuario']);
unset($iduser);
if ($config['loginhash_pwd'] != '' && $loginhash_data == md5($loginhash_user.io_output_password($config['loginhash_pwd']))) {
if ($config['loginhash_pwd'] != ''
&& $loginhash_data == md5(
$loginhash_user.io_output_password($config['loginhash_pwd'])
)
) {
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
$_SESSION['id_usuario'] = $loginhash_user;
$config['id_user'] = $loginhash_user;
@ -811,6 +893,8 @@ if (! isset($config['id_user'])) {
include_once 'general/login_page.php';
db_pandora_audit('Logon Failed (loginhash', '', 'system');
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
@ -823,7 +907,7 @@ if (! isset($config['id_user'])) {
'*'
);
if ($user_in_db == false) {
// logout
// Logout.
$_REQUEST = [];
$_GET = [];
$_POST = [];
@ -834,6 +918,8 @@ if (! isset($config['id_user'])) {
unset($iduser);
include_once 'general/login_page.php';
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
@ -841,7 +927,7 @@ if (! isset($config['id_user'])) {
if (((bool) $user_in_db['is_admin'] === false)
&& ((bool) $user_in_db['not_login'] === true)
) {
// logout
// Logout.
$_REQUEST = [];
$_GET = [];
$_POST = [];
@ -852,6 +938,8 @@ if (! isset($config['id_user'])) {
unset($iduser);
include_once 'general/login_page.php';
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
@ -859,12 +947,12 @@ if (! isset($config['id_user'])) {
}
}
// Enterprise support
// Enterprise support.
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
include_once ENTERPRISE_DIR.'/load_enterprise.php';
}
// Log off
// Log off.
if (isset($_GET['bye'])) {
include 'general/logoff.php';
$iduser = $_SESSION['id_usuario'];
@ -877,11 +965,13 @@ if (isset($_GET['bye'])) {
if ($config['auth'] == 'saml') {
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
$as = new SimpleSAML_Auth_Simple($config['saml_source']);
$as = new SimpleSAML_Auth_Simple('PandoraFMS');
$as->logout();
}
while (@ob_end_flush()) {
// Dumping...
continue;
}
exit('</html>');
@ -889,10 +979,11 @@ if (isset($_GET['bye'])) {
clear_pandora_error_for_header();
// ----------------------------------------------------------------------
// EXTENSIONS
// ----------------------------------------------------------------------
/*
* ----------------------------------------------------------------------
* EXTENSIONS
* ----------------------------------------------------------------------
*
* Load the basic configurations of extension and add extensions into menu.
* Load here, because if not, some extensions not load well, I don't why.
*/
@ -901,7 +992,7 @@ $config['logged'] = false;
extensions_load_extensions($process_login);
if ($process_login) {
// Call all extensions login function
// Call all extensions login function.
extensions_call_login_function();
unset($_SESSION['new_update']);
@ -992,7 +1083,7 @@ if (get_parameter('login', 0) !== 0) {
}
}
// Header
// Header.
if ($config['pure'] == 0) {
echo '<div id="container"><div id="head">';
include 'general/header.php';
@ -1008,24 +1099,27 @@ if ($config['pure'] == 0) {
echo '<button onclick="topFunction()" id="top_btn" title="Go to top"></button>';
} else {
echo '<div id="main_pure">';
// Require menu only to build structure to use it in ACLs
// Require menu only to build structure to use it in ACLs.
include 'operation/menu.php';
include 'godmode/menu.php';
}
// http://es2.php.net/manual/en/ref.session.php#64525
// Session locking concurrency speedup!
/*
* Session locking concurrency speedup!
* http://es2.php.net/manual/en/ref.session.php#64525
*/
session_write_close();
// Main block of content
// Main block of content.
if ($config['pure'] == 0) {
echo '<div id="main">';
}
// Page loader / selector
// Page loader / selector.
if ($searchPage) {
include 'operation/search_results.php';
} else {
@ -1049,7 +1143,7 @@ if ($searchPage) {
$page .= '.php';
// Enterprise ACL check
// Enterprise ACL check.
if (enterprise_hook(
'enterprise_acl',
[
@ -1079,7 +1173,7 @@ if ($searchPage) {
}
}
} else {
// home screen chosen by the user
// Home screen chosen by the user.
$home_page = '';
if (isset($config['id_user'])) {
$user_info = users_get_user_by_id($config['id_user']);
@ -1110,6 +1204,7 @@ if ($searchPage) {
break;
case 'Default':
default:
$_GET['sec2'] = 'general/logon_ok';
break;
@ -1148,12 +1243,11 @@ if ($searchPage) {
if (isset($_GET['sec2'])) {
$file = $_GET['sec2'].'.php';
// Translate some secs
// Translate some secs.
$main_sec = get_sec($_GET['sec']);
$_GET['sec'] = $main_sec == false ? $_GET['sec'] : $main_sec;
$_GET['sec'] = ($main_sec == false) ? $_GET['sec'] : $main_sec;
if (!file_exists($file)
|| ( $_GET['sec2'] != 'general/logon_ok'
&& enterprise_hook(
|| ($_GET['sec2'] != 'general/logon_ok' && enterprise_hook(
'enterprise_acl',
[
$config['id_user'],
@ -1162,7 +1256,7 @@ if ($searchPage) {
true,
isset($_GET['sec3']) ? $_GET['sec3'] : '',
]
) == false )
) == false)
) {
unset($_GET['sec2']);
include 'general/noaccess.php';
@ -1181,13 +1275,13 @@ if ($searchPage) {
if ($config['pure'] == 0) {
echo '<div style="clear:both"></div>';
echo '</div>';
// main
// Main.
echo '<div style="clear:both">&nbsp;</div>';
echo '</div>';
// page (id = page)
// Page (id = page).
} else {
echo '</div>';
// main_pure
// Main pure.
}
echo '<div id="wiz_container">';
@ -1211,31 +1305,31 @@ require_once 'include/functions_clippy.php';
clippy_start($sec2);
while (@ob_end_flush()) {
// Dump.
// Dumping...
continue;
}
db_print_database_debug();
echo '</html>';
$run_time = format_numeric((microtime(true) - $config['start_time']), 3);
echo "\n<!-- Page generated in $run_time seconds -->\n";
echo "\n<!-- Page generated in ".$run_time." seconds -->\n";
// Values from PHP to be recovered from JAVASCRIPT
// Values from PHP to be recovered from JAVASCRIPT.
require 'include/php_to_js_values.php';
?>
<script type="text/javascript" language="javascript">
// When there are less than 5 rows, all rows must be white
var theme = "<?php echo $config['style']; ?>";
if(theme === 'pandora'){
if($('table.info_table tr').length < 5){
$('table.info_table tbody > tr').css('background-color', '#fff');
}
// When there are less than 5 rows, all rows must be white.
if($('table.info_table tr').length < 5){
$('table.info_table tbody > tr').css('background-color', '#fff');
}
// When the user scrolls down 400px from the top of the document, show the button.
// When the user scrolls down 400px from the top of the document, show the
// button.
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
@ -1248,18 +1342,24 @@ require 'include/php_to_js_values.php';
// When the user clicks on the button, scroll to the top of the document.
function topFunction() {
//document.body.scrollTop = 0; // For Safari.
//document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera.
/*
* Safari.
* document.body.scrollTop = 0;
* For Chrome, Firefox, IE and Opera.
* document.documentElement.scrollTop = 0;
*/
$("HTML, BODY").animate({ scrollTop: 0 }, 500);
}
//Initial load of page
// Initial load of page.
$(document).ready(adjustFooter);
//Every resize of window
// Every resize of window.
$(window).resize(adjustFooter);
//Every show/hide call may need footer re-layout
// Every show/hide call may need footer re-layout.
(function() {
var oShow = jQuery.fn.show;
var oHide = jQuery.fn.hide;

View File

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

View File

@ -461,26 +461,25 @@ if ($fields === false) {
$custom_fields = [];
foreach ($fields as $field) {
$data = [];
$data[0] = '<b>'.$field['name'].ui_print_help_tip(__('Custom field'), true).'</b>';
$custom_value = db_get_all_rows_sql(
'select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = '.$field['id_field'].' and tagent_custom_data.id_agent = '.$id_agente
);
$custom_value = db_get_all_rows_sql(
'select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = '.$field['id_field'].' and tagent_custom_data.id_agent = '.$id_agente
);
if ($custom_value[0]['description'] === false || $custom_value[0]['description'] == '') {
$custom_value[0]['description'] = '<i>-'.__('empty').'-</i>';
} else {
if ($custom_value[0]['description'] !== false && $custom_value[0]['description'] != '') {
$data = [];
$data[0] = '<b>'.$field['name'].ui_print_help_tip(__('Custom field'), true).'</b>';
$custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
}
if ($custom_value[0]['is_password_type']) {
$data[1] = '&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;';
} else {
$data[1] = $custom_value[0]['description'];
}
if ($custom_value[0]['is_password_type']) {
$data[1] = '&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;';
} else {
$data[1] = $custom_value[0]['description'];
}
$custom_fields[] = $data;
$custom_fields[] = $data;
}
}
$custom_fields_count = count($custom_fields);

View File

@ -243,9 +243,10 @@ if (empty($export_btn) || $show_form) {
false
);
// Agent selector
// Agent selector.
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
$filter = [];
if ($group > 0) {
$filter['id_grupo'] = (array) $group;
} else {

View File

@ -383,14 +383,14 @@ if ($not_found) {
html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right;'>";
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
if ($new_networkmap) {
html_print_input_hidden('save_networkmap', 1);
html_print_submit_button(
__('Save networkmap'),
'crt',
false,
'class="sub"'
'class="sub next"'
);
}
@ -401,7 +401,7 @@ if ($not_found) {
__('Update networkmap'),
'crt',
false,
'class="sub"'
'class="sub upd"'
);
}

View File

@ -59,7 +59,7 @@ echo '</head>';
echo "<body style='background-color: #494949; max-width: 550px; max-height: 400px; margin-top:40px;'>";
echo "<h1 class='modalheaderh1'>".__('Sound console').'</h1>';
$table = null;
$table = new StdClass;
$table->width = '100%';
$table->styleTable = 'padding-left:16px; padding-right:16px; padding-top:16px;';
$table->class = ' ';
@ -82,7 +82,7 @@ $table->data[1][3] = html_print_textarea('events_fired', 200, 20, '', 'readonly=
html_print_table($table);
$table = null;
$table = new StdClass;
$table->width = '100%';
$table->rowstyle[0] = 'text-align:center;';
$table->styleTable = 'padding-top:16px;padding-bottom:16px;';
@ -196,15 +196,15 @@ function forgetPreviousEvents() {
var agents = $("#id_agents").val();
jQuery.post ("../../ajax.php",
{"page" : "operation/events/events",
{"page" : "include/ajax/events",
"get_events_fired": 1,
"id_group": group,
"agents[]" : agents,
"alert_fired": alert_fired,
"critical": critical,
"warning": warning,
"unknown": unknown,
"id_row": id_row
"id_row": id_row,
"agents[]" : agents
},
function (data) {
firedId = parseInt(data['fired']);
@ -219,18 +219,17 @@ function forgetPreviousEvents() {
function check_event() {
var agents = $("#id_agents").val();
if (running) {
jQuery.post ("../../ajax.php",
{"page" : "operation/events/events",
{"page" : "include/ajax/events",
"get_events_fired": 1,
"id_group": group,
"agents[]" : agents,
"alert_fired": alert_fired,
"critical": critical,
"warning": warning,
"unknown": unknown,
"id_row": id_row
"id_row": id_row,
"agents[]" : agents,
},
function (data) {
firedId = parseInt(data['fired']);
@ -247,7 +246,6 @@ function check_event() {
$('audio').remove();
$('body').append("<audio src='../../" + data['sound'] + "' autoplay='true' hidden='true' loop='true'>");
}
},
"json"
);

View File

@ -26,6 +26,7 @@ if ($searchGraphs) {
$usergraphs_id = array_keys($usergraphs);
if (empty($usergraphs_id)) {
$totalGraphs = 0;
return;
}
@ -37,6 +38,7 @@ if ($searchGraphs) {
'id_graph',
'name',
'description',
];
$totalGraphs = (int) db_get_value_filter('COUNT(id_graph) AS count', 'tgraph', $filter);
@ -45,5 +47,7 @@ if ($searchGraphs) {
$filter['limit'] = $config['block_size'];
$filter['offset'] = (int) get_parameter('offset');
$graphs = db_get_all_rows_filter('tgraph', $filter, $columns);
} else {
$totalGraphs = 0;
}
}

View File

@ -20,6 +20,7 @@ $searchGraphs = check_acl($config['id_user'], 0, 'RR');
$searchMaps = check_acl($config['id_user'], 0, 'RR');
$searchReports = check_acl($config['id_user'], 0, 'RR');
$searchUsers = check_acl($config['id_user'], 0, 'UM');
$searchPolicies = check_acl($config['id_user'], 0, 'AW');
$searchHelps = true;
echo '<br><div style="margin:auto; width:90%; padding: 10px;">';
@ -44,8 +45,12 @@ $table->style[9] = 'font-weight: bold; text-align: center;';
$table->style[10] = 'font-weight: bold; text-align: center;';
$table->style[11] = 'font-weight: bold; text-align: center;';
$table->style[13] = 'font-weight: bold; text-align: center;';
$table->style[14] = 'font-weight: bold; text-align: center;';
$table->style[15] = 'font-weight: bold; text-align: center;';
$table->data[0][0] = html_print_image('images/agent.png', true, ['title' => __('Agents found')]);
$table->data[0][1] = "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalAgents).'</a>';
$table->data[0][2] = html_print_image('images/module.png', true, ['title' => __('Modules found')]);
@ -64,8 +69,10 @@ $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' =>
$table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
$table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
$table->data[0][14] = html_print_image('images/help.png', true, ['title' => __('Helps found')]);
$table->data[0][15] = "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalHelps).'</a>';
if (enterprise_installed()) {
$table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
$table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
}
html_print_table($table);
@ -79,4 +86,5 @@ if ($searchAgents && $totalAgents > 0) {
).'</a>';
}
echo '</div>';

View File

@ -0,0 +1,200 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
enterprise_include_once('include/functions_policies.php');
$searchpolicies = check_acl($config['id'], 0, 'AW');
$selectpolicieIDUp = '';
$selectpolicieIDDown = '';
$selectNameUp = '';
$selectNameDown = '';
$selectDescriptionUp = '';
$selectDescriptionDown = '';
$selectId_groupUp = '';
$selectId_groupDown = '';
$selectStatusUp = '';
$selectStatusDown = '';
switch ($sortField) {
case 'id':
switch ($sort) {
case 'up':
$selectpolicieIDUp = $selected;
$order = [
'field' => 'id',
'order' => 'ASC',
];
break;
case 'down':
$selectpolicieIDDown = $selected;
$order = [
'field' => 'id',
'order' => 'DESC',
];
break;
}
break;
case 'name':
switch ($sort) {
case 'up':
$selectNameUp = $selected;
$order = [
'field' => 'name',
'order' => 'ASC',
];
break;
case 'down':
$selectNameDown = $selected;
$order = [
'field' => 'name',
'order' => 'DESC',
];
break;
}
break;
case 'description':
switch ($sort) {
case 'up':
$selectId_groupUp = $selected;
$order = [
'field' => 'description',
'order' => 'ASC',
];
break;
case 'down':
$selectDescriptionDown = $selected;
$order = [
'field' => 'description',
'order' => 'DESC',
];
break;
}
break;
case 'last_contact':
switch ($sort) {
case 'up':
$selectId_groupUp = $selected;
$order = [
'field' => 'last_connect',
'order' => 'ASC',
];
break;
case 'down':
$selectId_groupDown = $selected;
$order = [
'field' => 'last_connect',
'order' => 'DESC',
];
break;
}
break;
case 'id_group':
switch ($sort) {
case 'up':
$selectId_groupUp = $selected;
$order = [
'field' => 'last_connect',
'order' => 'ASC',
];
break;
case 'down':
$selectId_groupDown = $selected;
$order = [
'field' => 'last_connect',
'order' => 'DESC',
];
break;
}
break;
case 'status':
switch ($sort) {
case 'up':
$selectStatusUp = $selected;
$order = [
'field' => 'is_admin',
'order' => 'ASC',
];
break;
case 'down':
$selectStatusDown = $selected;
$order = [
'field' => 'is_admin',
'order' => 'DESC',
];
break;
}
break;
default:
$selectpolicieIDUp = $selected;
$selectpolicieIDDown = '';
$selectNameUp = '';
$selectNameDown = '';
$selectDescriptionUp = '';
$selectDescriptionDown = '';
$selectId_groupUp = '';
$selectId_groupDown = '';
$selectStatusUp = '';
$selectStatusDown = '';
$order = [
'field' => 'id',
'order' => 'ASC',
];
break;
}
if ($searchpolicies == 0) {
/*
We take the user groups to get policies that meet the requirements of the search
and which the user have permission on this groups
*/
$user_groups = users_get_groups($config['id_user'], 'AR', false);
$id_user_groups = array_keys($user_groups);
$id_user_groups_str = implode(',', $id_user_groups);
$sql = "SELECT id, name, description, id_group, status
FROM tpolicies
WHERE name LIKE '$stringSearchSQL'
AND id_group IN ($id_user_groups_str)";
}
$sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
$policies = db_process_sql($sql);
if ($policies !== false) {
$totalPolicies = count($policies);
if ($only_count) {
unset($policies);
}
} else {
$totalPolicies = 0;
}

View File

@ -0,0 +1,90 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
enterprise_include_once('include/functions_policies.php');
require_once $config['homedir'].'/enterprise/include/functions_groups.php';
$searchpolicies = check_acl($config['id_user'], 0, 'AW');
if (!$policies || !$searchpolicies) {
echo "<br><div class='nf'>".__('Zero results found')."</div>\n";
} else {
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->width = '98%';
$table->class = 'databox';
$table->align = [];
$table->align[4] = 'center';
$table->head = [];
// $table->head[0] = __('ID').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectpolicieIDUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectpolicieIDDown]).'</a>';
$table->head[0] = __('Name').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
$table->head[1] = __('Description').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectDescriptionUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectDescriptionDown]).'</a>';
$table->head[2] = __('Id_group').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectId_groupUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectId_groupDown]).'</a>';
$table->head[3] = __('Status').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectstatusDown]).'</a>';
$table->data = [];
foreach ($policies as $policie) {
$policieIDCell = "<a href='?sec=gmodules&sec2=enterprise/godmode/policies/policies&id=".$policies['id']."'>".$policies['id'].'</a>';
switch ($policie['status']) {
case POLICY_UPDATED:
$status = html_print_image(
'images/policies_ok.png',
true,
['title' => __('Policy updated')]
);
break;
case POLICY_PENDING_DATABASE:
$status = html_print_image(
'images/policies_error_db.png',
true,
['title' => __('Pending update policy only database')]
);
break;
case POLICY_PENDING_ALL:
$status = html_print_image(
'images/policies_error.png',
true,
['title' => __('Pending update policy')]
);
break;
}
$url = $config['homeurl'].'/index.php?'.'sec=gmodules&'.'sec2=enterprise/godmode/policies/policies&id='.$policie['id'].'';
array_push(
$table->data,
[
// $policie['id'],
'<a href= '.$url.'>'.$policie['name'].'',
$policie['description'],
ui_print_group_icon($policie['id_group'], true),
$status,
]
);
}
$totalPolicies = count($policies);
echo '<br />';
html_print_table($table);
unset($table);
ui_pagination($totalPolicies);
}

View File

@ -18,7 +18,7 @@ require_once $config['homedir'].'/include/functions_reporting.php';
enterprise_include('operation/reporting/custom_reporting.php');
$searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR');
$searchUsers = check_acl($config['id_user'], 0, 'UM');
$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AW');
$searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR');
$searchMain = true;
$searchHelps = true;
@ -43,6 +43,7 @@ if ($config['search_category'] == 'all') {
// INI SECURITY ACL
if ((!$searchAgents && !$searchUsers && !$searchMaps)
|| (!$searchUsers && $searchTab == 'users')
|| (!$searchPolicies && $searchTab == 'policies')
|| (!$searchAgents && ($searchTab == 'agents' || $searchTab == 'alerts'))
|| (!$searchGraphs && ($searchTab == 'graphs' || $searchTab == 'maps' || $searchTab == 'reports'))
) {
@ -161,29 +162,29 @@ if ($searchModules) {
$modules_tab = '';
}
if ($searchHelps) {
$helps_tab = [
'text' => "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/help_w.png',
if ($searchPolicies) {
$policies_tab = [
'text' => "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
'images/policies.png',
true,
['title' => __('Helps')]
['title' => __('Policies')]
).'</a>',
'active' => $searchTab == 'helps',
'active' => $searchTab == 'policies',
];
} else {
$helps_tab = '';
$policies_tab = '';
}
$onheader = [
'main' => $main_tab,
'agents' => $agents_tab,
'modules' => $modules_tab,
'alerts' => $alerts_tab,
'users' => $users_tab,
'graphs' => $graphs_tab,
'reports' => $reports_tab,
'maps' => $maps_tab,
'helps' => $helps_tab,
'main' => $main_tab,
'agents' => $agents_tab,
'modules' => $modules_tab,
'alerts' => $alerts_tab,
'users' => $users_tab,
'graphs' => $graphs_tab,
'reports' => $reports_tab,
'maps' => $maps_tab,
'policies' => $policies_tab,
];
ui_print_page_header(
@ -212,6 +213,7 @@ switch ($searchTab) {
include_once 'search_maps.getdata.php';
include_once 'search_modules.getdata.php';
include_once 'search_helps.getdata.php';
include_once 'search_policies.getdata.php';
include_once 'search_main.php';
break;
@ -251,8 +253,9 @@ switch ($searchTab) {
include_once 'search_modules.php';
break;
case 'helps':
include_once 'search_helps.getdata.php';
include_once 'search_helps.php';
case 'policies':
include_once 'search_policies.getdata.php';
include_once 'search_policies.php';
break;
}

View File

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

View File

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

View File

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

View File

@ -1437,8 +1437,8 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`type` varchar(30) default 'simple_graph',
`period` int(11) NOT NULL default 0,
`order` int (11) NOT NULL default 0,
`name` varchar(150) NULL,
`description` mediumtext,
`name` varchar(300) NULL,
`description` mediumtext,
`id_agent` int(10) unsigned NOT NULL default 0,
`text` TEXT,
`external_source` Text,

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.736-190711
Version: 7.0NG.736-190717
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.736-190711"
pandora_version="7.0NG.736-190717"
package_cpan=0
package_pandora=1

View File

@ -601,6 +601,9 @@ syslog_threads 2
# Maximum number of lines queued by the Syslog Server's producer on each run (PANDORA FMS ENTERPRISE ONLY).
syslog_max 65535
# Sync Server
#syncserver
# Port tentacle server
#sync_port 41121
@ -619,7 +622,7 @@ syslog_max 65535
# Sync timeout
#sync_timeout 10
# Address
# Address
# sync_address
# Target LogStash server, to allow Dataserver and SyslogServer store log information in ElasticSearch

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.736";
my $pandora_build = "190711";
my $pandora_build = "190717";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.736 PS190711";
my $version = "7.0NG.736 PS190717";
# 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.736 PS190711";
my $version = "7.0NG.736 PS190717";
# save program name for logging
my $progname = basename($0);