mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 03:19:05 +02:00
Merge branch 'develop' into ent-11495-nuevo-tipo-de-informe-service-level-detailed
This commit is contained in:
commit
8e69326e3c
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-agent-unix
|
package: pandorafms-agent-unix
|
||||||
Version: 7.0NG.774-231123
|
Version: 7.0NG.774-231211
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.774-231123"
|
pandora_version="7.0NG.774-231211"
|
||||||
|
|
||||||
echo "Test if you has the tools for to make the packages."
|
echo "Test if you has the tools for to make the packages."
|
||||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
|
@ -1039,7 +1039,7 @@ my $Sem = undef;
|
|||||||
my $ThreadSem = undef;
|
my $ThreadSem = undef;
|
||||||
|
|
||||||
use constant AGENT_VERSION => '7.0NG.774';
|
use constant AGENT_VERSION => '7.0NG.774';
|
||||||
use constant AGENT_BUILD => '231123';
|
use constant AGENT_BUILD => '231211';
|
||||||
|
|
||||||
# Agent log default file size maximum and instances
|
# Agent log default file size maximum and instances
|
||||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 7.0NG.774
|
%define version 7.0NG.774
|
||||||
%define release 231123
|
%define release 231211
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
%define name pandorafms_agent_linux_bin
|
%define name pandorafms_agent_linux_bin
|
||||||
%define source_name pandorafms_agent_linux
|
%define source_name pandorafms_agent_linux
|
||||||
%define version 7.0NG.774
|
%define version 7.0NG.774
|
||||||
%define release 231123
|
%define release 231211
|
||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, binary version
|
Summary: Pandora FMS Linux agent, binary version
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
%define name pandorafms_agent_linux_bin
|
%define name pandorafms_agent_linux_bin
|
||||||
%define source_name pandorafms_agent_linux
|
%define source_name pandorafms_agent_linux
|
||||||
%define version 7.0NG.774
|
%define version 7.0NG.774
|
||||||
%define release 231123
|
%define release 231211
|
||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, binary version
|
Summary: Pandora FMS Linux agent, binary version
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
%define name pandorafms_agent_linux_bin
|
%define name pandorafms_agent_linux_bin
|
||||||
%define source_name pandorafms_agent_linux
|
%define source_name pandorafms_agent_linux
|
||||||
%define version 7.0NG.774
|
%define version 7.0NG.774
|
||||||
%define release 231123
|
%define release 231211
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, binary version
|
Summary: Pandora FMS Linux agent, binary version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 7.0NG.774
|
%define version 7.0NG.774
|
||||||
%define release 231123
|
%define release 231211
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.774"
|
PI_VERSION="7.0NG.774"
|
||||||
PI_BUILD="231123"
|
PI_BUILD="231211"
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
|
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Version
|
Version
|
||||||
{231123}
|
{231211}
|
||||||
|
|
||||||
ViewReadme
|
ViewReadme
|
||||||
{Yes}
|
{Yes}
|
||||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||||||
using namespace Pandora_Strutils;
|
using namespace Pandora_Strutils;
|
||||||
|
|
||||||
#define PATH_SIZE _MAX_PATH+1
|
#define PATH_SIZE _MAX_PATH+1
|
||||||
#define PANDORA_VERSION ("7.0NG.774 Build 231123")
|
#define PANDORA_VERSION ("7.0NG.774 Build 231211")
|
||||||
|
|
||||||
string pandora_path;
|
string pandora_path;
|
||||||
string pandora_dir;
|
string pandora_dir;
|
||||||
|
@ -11,7 +11,7 @@ BEGIN
|
|||||||
VALUE "LegalCopyright", "Pandora FMS"
|
VALUE "LegalCopyright", "Pandora FMS"
|
||||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||||
VALUE "ProductVersion", "(7.0NG.774(Build 231123))"
|
VALUE "ProductVersion", "(7.0NG.774(Build 231211))"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "1.0.0.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-console
|
package: pandorafms-console
|
||||||
Version: 7.0NG.774-231123
|
Version: 7.0NG.774-231211
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.774-231123"
|
pandora_version="7.0NG.774-231211"
|
||||||
|
|
||||||
package_pear=0
|
package_pear=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -183,7 +183,9 @@ if (isset($config['force_instant_logout']) === true
|
|||||||
$_SESSION = [];
|
$_SESSION = [];
|
||||||
session_destroy();
|
session_destroy();
|
||||||
header_remove('Set-Cookie');
|
header_remove('Set-Cookie');
|
||||||
|
if (isset($_COOKIE[session_name()]) === true) {
|
||||||
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
||||||
|
}
|
||||||
|
|
||||||
if ($config['auth'] === 'saml' && empty($public_hash) === true) {
|
if ($config['auth'] === 'saml' && empty($public_hash) === true) {
|
||||||
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
|
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
|
||||||
|
@ -27,17 +27,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
if (true) {
|
if ((bool) $config['metaconsole']) {
|
||||||
include_once '../include/config.php';
|
|
||||||
include_once '../include/functions_agents.php';
|
|
||||||
include_once '../include/functions_reporting.php';
|
|
||||||
include_once '../include/functions_modules.php';
|
|
||||||
include_once '../include/functions_users.php';
|
|
||||||
include_once $config['homedir'].'/include/config.php';
|
include_once $config['homedir'].'/include/config.php';
|
||||||
include_once $config['homedir'].'/include/functions_agents.php';
|
include_once $config['homedir'].'/include/functions_agents.php';
|
||||||
include_once $config['homedir'].'/include/functions_reporting.php';
|
include_once $config['homedir'].'/include/functions_reporting.php';
|
||||||
include_once $config['homedir'].'/include/functions_modules.php';
|
include_once $config['homedir'].'/include/functions_modules.php';
|
||||||
include_once $config['homedir'].'/include/functions_users.php';
|
include_once $config['homedir'].'/include/functions_users.php';
|
||||||
|
} else {
|
||||||
|
include_once '../include/config.php';
|
||||||
|
include_once '../include/functions_agents.php';
|
||||||
|
include_once '../include/functions_reporting.php';
|
||||||
|
include_once '../include/functions_modules.php';
|
||||||
|
include_once '../include/functions_users.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -106,7 +107,25 @@ if ($get_agents_module_csv === '1') {
|
|||||||
|
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
foreach ($result as $key => $value) {
|
foreach ($result as $key => $value) {
|
||||||
$out_csv .= io_safe_output($value).$divider;
|
if (preg_match('/Linux/i', $_SERVER['HTTP_USER_AGENT'])) {
|
||||||
|
$value = preg_replace(
|
||||||
|
'/\s+/',
|
||||||
|
' ',
|
||||||
|
io_safe_output($value)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$value = mb_convert_encoding(
|
||||||
|
preg_replace(
|
||||||
|
'/\s+/',
|
||||||
|
'',
|
||||||
|
io_safe_output($value)
|
||||||
|
),
|
||||||
|
'UTF-16LE',
|
||||||
|
'UTF-8'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$out_csv .= $value.$divider;
|
||||||
}
|
}
|
||||||
|
|
||||||
$out_csv .= "\n";
|
$out_csv .= "\n";
|
||||||
|
@ -99,7 +99,7 @@ function api_execute(
|
|||||||
if (empty($token) === true) {
|
if (empty($token) === true) {
|
||||||
$data['apipass'] = $apipass;
|
$data['apipass'] = $apipass;
|
||||||
$data['user'] = $user;
|
$data['user'] = $user;
|
||||||
$data['password'] = $password;
|
$data['pass'] = $password;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ function dbmgr_extension_main()
|
|||||||
|
|
||||||
// Header.
|
// Header.
|
||||||
ui_print_standard_header(
|
ui_print_standard_header(
|
||||||
__('Database interface'),
|
__('DB interface'),
|
||||||
'images/gm_db.png',
|
'images/gm_db.png',
|
||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
|
@ -1720,3 +1720,4 @@ include/functions_integriaims.php
|
|||||||
include/ajax/integria_incidents.ajax.php
|
include/ajax/integria_incidents.ajax.php
|
||||||
enterprise/operation/log/log_source.php
|
enterprise/operation/log/log_source.php
|
||||||
enterprise/include/class/LogSource.class.php
|
enterprise/include/class/LogSource.class.php
|
||||||
|
include/chart_generator.php
|
50
pandora_console/extras/mr/67.sql
Normal file
50
pandora_console/extras/mr/67.sql
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE `tevento`
|
||||||
|
ADD COLUMN `event_custom_id` TEXT NULL AFTER `module_status`;
|
||||||
|
|
||||||
|
-- Telegram and vonage default alerts
|
||||||
|
UPDATE talert_actions
|
||||||
|
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
|
||||||
|
WHERE id=9;
|
||||||
|
UPDATE talert_actions
|
||||||
|
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
|
||||||
|
WHERE id=11;
|
||||||
|
-- Delete table tagent_access
|
||||||
|
DROP TABLE IF EXISTS tagent_access;
|
||||||
|
|
||||||
|
ALTER TABLE `tevent_rule` DROP COLUMN `user_comment`;
|
||||||
|
ALTER TABLE `tevent_rule` DROP COLUMN `operator_user_comment`;
|
||||||
|
|
||||||
|
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
|
||||||
|
|
||||||
|
ALTER TABLE `tevent_filter`
|
||||||
|
ADD COLUMN `regex` TEXT NULL AFTER `private_filter_user`;
|
||||||
|
-- Update macros for plugin oracle
|
||||||
|
|
||||||
|
UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.oracle';
|
||||||
|
|
||||||
|
SET @id_app := (SELECT `id_app` FROM `tdiscovery_apps` WHERE `short_name` = 'pandorafms.oracle');
|
||||||
|
|
||||||
|
UPDATE `tdiscovery_apps_tasks_macros` SET `value` = 'agents_group_id=__taskGroupID__ interval=__taskInterval__ user=_dbuser_ password=_dbpass_ thick_mode=_thickMode_ client_path=_clientPath_ threads=_threads_ modules_prefix=_prefixModuleName_ execute_custom_queries=_executeCustomQueries_ analyze_connections=_checkConnections_ engine_uptime=_checkUptime_ query_stats=_queryStats_ cache_stats=_checkCache_ fragmentation_ratio=_checkFragmentation_ check_tablescpaces=_checkTablespaces_' WHERE `macro` = '_tempfileConf_' AND `id_task` IN (SELECT `id_rt` FROM `trecon_task` WHERE `id_app` = @id_app);
|
||||||
|
|
||||||
|
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_thickMode_', 'custom', 0, 0 FROM `trecon_task` WHERE `id_app` = @id_app;
|
||||||
|
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_clientPath_', 'custom', '', 0 FROM `trecon_task` WHERE `id_app` = @id_app;
|
||||||
|
UPDATE `trecon_task` SET `setup_complete` = 1 WHERE `id_app` = @id_app;
|
||||||
|
|
||||||
|
-- Update lts updates
|
||||||
|
UPDATE tconfig SET value='1' WHERE token='lts_updates';
|
||||||
|
|
||||||
|
ALTER TABLE `tdashboard`
|
||||||
|
ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`,
|
||||||
|
ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`,
|
||||||
|
ADD COLUMN `date_to` INT NOT NULL DEFAULT 0 AFTER `date_from`;
|
||||||
|
|
||||||
|
SELECT @generic_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_data";
|
||||||
|
SELECT @generic_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_proc";
|
||||||
|
SELECT @async_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_data";
|
||||||
|
SELECT @async_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_proc";
|
||||||
|
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_data WHERE `tagente_modulo`.`id_tipo_modulo` = @async_data;
|
||||||
|
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_proc WHERE `tagente_modulo`.`id_tipo_modulo` = @async_proc;
|
||||||
|
|
||||||
|
COMMIT;
|
@ -418,7 +418,7 @@ switch ($login_screen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($config['enterprise_installed']) {
|
if ($config['enterprise_installed']) {
|
||||||
if ($config['reset_pass_option']) {
|
if ($config['reset_pass_option'] && $config['auth'] === 'mysql') {
|
||||||
$reset_pass_link = 'reset_pass.php';
|
$reset_pass_link = 'reset_pass.php';
|
||||||
// Reset password link.
|
// Reset password link.
|
||||||
echo '<div class="reset_password">';
|
echo '<div class="reset_password">';
|
||||||
|
@ -600,43 +600,176 @@ html_print_div(
|
|||||||
'content' => html_print_table($tableAgent, true).$CodeQRTable,
|
'content' => html_print_table($tableAgent, true).$CodeQRTable,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
/*
|
|
||||||
TODO REVIEW
|
// Basic Options.
|
||||||
$table_satellite = '';
|
$tableBasicAgent = new stdClass();
|
||||||
if ($remote_agent === true) {
|
$tableBasicAgent->class = 'filter-table-adv';
|
||||||
// Satellite server selector.
|
$tableBasicAgent->data = [];
|
||||||
$satellite_servers = db_get_all_rows_filter(
|
$disabledBasic = false;
|
||||||
'tserver',
|
$tableClassDisabled = '';
|
||||||
['server_type' => SERVER_TYPE_ENTERPRISE_SATELLITE],
|
if ($new_agent === true || $remote_agent === false || $has_remote_conf === false) {
|
||||||
|
$disabledBasic = true;
|
||||||
|
$tableClassDisabled = ' basic-options-disabled';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enterprise_installed()) {
|
||||||
|
// Get all plugins (BASIC OPTIONS).
|
||||||
|
$agent_plugin = new PandoraFMS\Agent($id_agente);
|
||||||
|
$plugins = $agent_plugin->getPlugins();
|
||||||
|
// Check if some plugin was enabled/disabled in conf.
|
||||||
|
foreach ($plugins as $key => $row) {
|
||||||
|
if (preg_match('/pandora_hardening/', $row['raw']) === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$security_hardening = 0;
|
||||||
|
} else {
|
||||||
|
$security_hardening = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($id_os === '1' || $id_os === '8') {
|
||||||
|
if (preg_match('/(module_plugin grep_log_module ).*/', $row['raw']) === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$enable_log_collector = 0;
|
||||||
|
} else {
|
||||||
|
$enable_log_collector = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('/(module_plugin inventory).*/', $row['raw']) === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$enable_inventory = 0;
|
||||||
|
} else {
|
||||||
|
$enable_inventory = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (preg_match('/.vbs/', $row['raw']) === 1 && preg_match('/nettraffic.vbs/', $row['raw']) === 0 && preg_match('/software_installed.vbs/', $row['raw']) === 0 && preg_match('/df.vbs/', $row['raw']) === 0 && preg_match('/win_cf.vbs/', $row['raw']) === 0) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$enable_inventory = 0;
|
||||||
|
} else {
|
||||||
|
$enable_inventory = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($id_os === '9') {
|
||||||
|
$modules = $agent_plugin->getModules();
|
||||||
|
foreach ($modules as $key => $row) {
|
||||||
|
if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$enable_log_collector = 0;
|
||||||
|
} else {
|
||||||
|
$enable_log_collector = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($agent_plugin, $plugins);
|
||||||
|
if (($new_agent === true && $config['current_package'] >= 774) || ($agent_version >= 774 && $new_agent === false)) {
|
||||||
|
if ($disabledBasic === true || $has_remote_conf === false) {
|
||||||
|
$message = __('Remote config disabled, please activate to enable agent basic options');
|
||||||
|
$tableBasicAgent->data[] = '<span>'.$message.'</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$tableBasicAgent->data[] = html_print_label_input_block(
|
||||||
|
__('Enable security hardening monitoring'),
|
||||||
|
html_print_input(
|
||||||
[
|
[
|
||||||
'id_server',
|
'type' => 'switch',
|
||||||
'name',
|
'id' => 'security_hardening',
|
||||||
|
'name' => 'security_hardening',
|
||||||
|
'value' => $security_hardening,
|
||||||
|
'disabled' => $disabledBasic,
|
||||||
]
|
]
|
||||||
|
).html_print_input_hidden('options_package', '1', true)
|
||||||
);
|
);
|
||||||
|
|
||||||
$satellite_names = [];
|
$tableBasicAgent->data[] = html_print_label_input_block(
|
||||||
if (empty($satellite_servers) === false) {
|
__('Enable log collection'),
|
||||||
foreach ($satellite_servers as $s_server) {
|
html_print_input(
|
||||||
$satellite_names[$s_server['id_server']] = $s_server['name'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$table_satellite = '<div class="label_select"><p class="input_label">'.__('Satellite').'</p>';
|
|
||||||
$table_satellite .= '<div class="label_select_parent">';
|
|
||||||
|
|
||||||
$table_satellite .= html_print_input(
|
|
||||||
[
|
[
|
||||||
'type' => 'select',
|
'type' => 'switch',
|
||||||
'fields' => $satellite_names,
|
'id' => 'enable_log_collector',
|
||||||
'name' => 'satellite_server',
|
'name' => 'enable_log_collector',
|
||||||
'selected' => $satellite_server,
|
'value' => $enable_log_collector,
|
||||||
'nothing' => __('None'),
|
'disabled' => $disabledBasic,
|
||||||
'nothinf_value' => 0,
|
|
||||||
'return' => true,
|
|
||||||
]
|
]
|
||||||
).'<div class="label_select_child_icons"></div></div></div>';
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tableBasicAgent->data[] = html_print_label_input_block(
|
||||||
|
__('Enable inventory'),
|
||||||
|
html_print_input(
|
||||||
|
[
|
||||||
|
'type' => 'switch',
|
||||||
|
'id' => 'enable_inventory',
|
||||||
|
'name' => 'enable_inventory',
|
||||||
|
'value' => $enable_inventory,
|
||||||
|
'disabled' => $disabledBasic,
|
||||||
|
]
|
||||||
|
).html_print_input_hidden('enable_basic_options', '1', true)
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($config['ehorus_enabled'] === '1') {
|
||||||
|
$pandoraRC_Id = html_print_image(
|
||||||
|
'images/alert_recovered@svg.svg',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'class' => 'invert_filter main_menu_icon',
|
||||||
|
'title' => __('Pandora RC connected with id ').$config['ehorus_custom_field'],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$pandoraRC_Id = html_print_image(
|
||||||
|
'images/alerts.svg',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'class' => 'invert_filter main_menu_icon',
|
||||||
|
'title' => __('This agent do not have a Pandora RC agent installed, install one.'),
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
$tableBasicAgent->data[] = html_print_label_input_block(
|
||||||
|
__('Enable remote control'),
|
||||||
|
$pandoraRC_Id
|
||||||
|
);
|
||||||
|
|
||||||
|
$WarningPackage = '';
|
||||||
|
if (($new_agent === true && $config['current_package'] < 774) || ($agent_version < 774 && $new_agent === false)) {
|
||||||
|
$WarningPackage = html_print_image(
|
||||||
|
'images/alert-yellow@svg.svg',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => __('Only available for agents 774 or higher'),
|
||||||
|
'alt' => __('Only available for agents 774 or higher'),
|
||||||
|
'class' => 'main_menu_icon mrgn_lft_5px',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$tableBasicAgent->data[] = '<span>'.__('Remote config is enabled only in the Enteprise version').'</span>';
|
||||||
|
$tableBasicAgent->data[] .= html_print_input_hidden(
|
||||||
|
'enable_basic_options',
|
||||||
|
'0',
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_toggle(
|
||||||
|
html_print_table($tableBasicAgent, true),
|
||||||
|
'<span class="subsection_header_title">'.__('Basic options').$WarningPackage.'</span>',
|
||||||
|
'',
|
||||||
|
'basic_options',
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
'white_box_content',
|
||||||
|
'no-border white_table_graph'.$tableClassDisabled,
|
||||||
|
'box-flat white_table_graph invisible'
|
||||||
|
);
|
||||||
|
|
||||||
// Advanced options.
|
// Advanced options.
|
||||||
$tableAdvancedAgent = new stdClass();
|
$tableAdvancedAgent = new stdClass();
|
||||||
@ -922,7 +1055,8 @@ $tableAdvancedAgent->data['safe_operation'][] = html_print_label_input_block(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
|
if (enterprise_installed() === true) {
|
||||||
|
$tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
|
||||||
__('Vulnerability scanning'),
|
__('Vulnerability scanning'),
|
||||||
html_print_select(
|
html_print_select(
|
||||||
[
|
[
|
||||||
@ -937,7 +1071,9 @@ $tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
|
|||||||
0,
|
0,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ui_toggle(
|
ui_toggle(
|
||||||
html_print_table($tableAdvancedAgent, true),
|
html_print_table($tableAdvancedAgent, true),
|
||||||
@ -1253,7 +1389,8 @@ ui_require_jquery_file('bgiframe');
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#checkbox-cascade_protection").change(function () {
|
$("#checkbox-cascade_protection").change(function () {
|
||||||
var checked = $("#checkbox-cascade_protection").is(":checked"); if (checked) {
|
var checked = $("#checkbox-cascade_protection").is(":checked");
|
||||||
|
if (checked) {
|
||||||
$("#cascade_protection_module").removeAttr("disabled");
|
$("#cascade_protection_module").removeAttr("disabled");
|
||||||
$("#text-id_parent").attr("required", "required");
|
$("#text-id_parent").attr("required", "required");
|
||||||
}
|
}
|
||||||
@ -1308,5 +1445,17 @@ ui_require_jquery_file('bgiframe');
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
check_basic_options();
|
||||||
|
$('#id_os').on('change', function(){
|
||||||
|
check_basic_options();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function check_basic_options(){
|
||||||
|
if ($('#id_os').val() == 1 || $('#id_os').val() == 8 || $('#id_os').val() == 9) {
|
||||||
|
$('#basic_options').removeClass('invisible');
|
||||||
|
} else {
|
||||||
|
$('#basic_options').addClass('invisible');
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -232,7 +232,7 @@ if ($create_agent) {
|
|||||||
$cps = (int) get_parameter_switch('cps', -1);
|
$cps = (int) get_parameter_switch('cps', -1);
|
||||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||||
|
$agent_version = $config['current_package'];
|
||||||
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
||||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||||
|
|
||||||
@ -300,6 +300,7 @@ if ($create_agent) {
|
|||||||
'cps' => $cps,
|
'cps' => $cps,
|
||||||
'fixed_ip' => $fixed_ip,
|
'fixed_ip' => $fixed_ip,
|
||||||
'vul_scan_enabled' => $vul_scan_enabled,
|
'vul_scan_enabled' => $vul_scan_enabled,
|
||||||
|
'agent_version' => $agent_version,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -1015,6 +1016,13 @@ if ($update_agent) {
|
|||||||
$satellite_server = (int) get_parameter('satellite_server', 0);
|
$satellite_server = (int) get_parameter('satellite_server', 0);
|
||||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||||
|
$security_vunerability = (int) get_parameter_switch('security_vunerability', 0);
|
||||||
|
$security_hardening = (int) get_parameter_switch('security_hardening', 0);
|
||||||
|
$security_monitoring = (int) get_parameter_switch('security_monitoring', 0);
|
||||||
|
$enable_log_collector = (int) get_parameter_switch('enable_log_collector', 0);
|
||||||
|
$enable_inventory = (int) get_parameter_switch('enable_inventory', 0);
|
||||||
|
$enable_basic_options = get_parameter('enable_basic_options');
|
||||||
|
$options_package = get_parameter('options_package', '0');
|
||||||
|
|
||||||
if ($fields === false) {
|
if ($fields === false) {
|
||||||
$fields = [];
|
$fields = [];
|
||||||
@ -1243,6 +1251,81 @@ if ($update_agent) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($enable_basic_options === '1') {
|
||||||
|
// Get all plugins (BASIC OPTIONS).
|
||||||
|
$agent = new PandoraFMS\Agent($id_agente);
|
||||||
|
$plugins = $agent->getPlugins();
|
||||||
|
foreach ($plugins as $key => $row) {
|
||||||
|
// Only check plugins when agent package is bigger than 774.
|
||||||
|
if ($options_package === '1') {
|
||||||
|
if (preg_match('/pandora_hardening/', $row['raw']) === 1) {
|
||||||
|
if ($security_hardening === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$agent->enablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($row['disabled'] !== 1) {
|
||||||
|
$agent->disablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('/(module_plugin grep_log_module ).*/', $row['raw']) === 1) {
|
||||||
|
if ($enable_log_collector === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$agent->enablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($row['disabled'] !== 1) {
|
||||||
|
$agent->disablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inventory switch enable when basic options are enabled.
|
||||||
|
if (preg_match('/(module_plugin inventory).*/', $row['raw']) === 1) {
|
||||||
|
if ($enable_inventory === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$agent->enablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($row['disabled'] !== 1) {
|
||||||
|
$agent->disablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inventory switch enable when basic options are enabled.
|
||||||
|
if (preg_match('/.vbs/', $row['raw']) === 1 && preg_match('/nettraffic.vbs/', $row['raw']) === 0 && preg_match('/software_installed.vbs/', $row['raw']) === 0 && preg_match('/df.vbs/', $row['raw']) === 0 && preg_match('/win_cf.vbs/', $row['raw']) === 0) {
|
||||||
|
if ($enable_inventory === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$agent->enablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($row['disabled'] !== 1) {
|
||||||
|
$agent->disablePlugins($row['raw']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$modules = $agent->getModules();
|
||||||
|
foreach ($modules as $key => $row) {
|
||||||
|
if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) {
|
||||||
|
if ($enable_log_collector === 1) {
|
||||||
|
if ($row['disabled'] === 1) {
|
||||||
|
$agent->enableModule($row['module_name'], $row);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($row['disabled'] !== 1) {
|
||||||
|
$agent->disableModule($row['module_name'], $row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read agent data
|
// Read agent data
|
||||||
@ -1300,6 +1383,19 @@ if ($id_agente) {
|
|||||||
$satellite_server = (int) $agent['satellite_server'];
|
$satellite_server = (int) $agent['satellite_server'];
|
||||||
$fixed_ip = (int) $agent['fixed_ip'];
|
$fixed_ip = (int) $agent['fixed_ip'];
|
||||||
$vul_scan_enabled = (int) $agent['vul_scan_enabled'];
|
$vul_scan_enabled = (int) $agent['vul_scan_enabled'];
|
||||||
|
if (strpos($agent['agent_version'], '(')) {
|
||||||
|
$agent_version = (int) explode('.', explode('(', $agent['agent_version'])[0])[2];
|
||||||
|
} else {
|
||||||
|
if (strpos($agent['agent_version'], 'build') || strpos($agent['agent_version'], 'Build')) {
|
||||||
|
$agent_version = (int) explode('.', explode('build', $agent['agent_version'])[0])[2];
|
||||||
|
} else {
|
||||||
|
if (strpos($agent['agent_version'], '.')) {
|
||||||
|
$agent_version = (int) explode('.', $agent['agent_version'])[2];
|
||||||
|
} else {
|
||||||
|
$agent_version = $agent['agent_version'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$update_module = (bool) get_parameter('update_module');
|
$update_module = (bool) get_parameter('update_module');
|
||||||
|
@ -217,6 +217,7 @@ foreach ($fields as $field) {
|
|||||||
array_push($table->data, $data);
|
array_push($table->data, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tablePagination = '';
|
||||||
if ($fields) {
|
if ($fields) {
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
$tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false);
|
$tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false);
|
||||||
@ -231,6 +232,9 @@ html_print_action_buttons(
|
|||||||
[ 'icon' => 'next' ],
|
[ 'icon' => 'next' ],
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
['type' => 'form_action']
|
[
|
||||||
|
'type' => 'form_action',
|
||||||
|
'right_content' => $tablePagination,
|
||||||
|
],
|
||||||
);
|
);
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
@ -38,6 +38,7 @@ $isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
|
|||||||
require_once $config['homedir'].'/include/functions_modules.php';
|
require_once $config['homedir'].'/include/functions_modules.php';
|
||||||
require_once $config['homedir'].'/include/functions_agents.php';
|
require_once $config['homedir'].'/include/functions_agents.php';
|
||||||
require_once $config['homedir'].'/include/functions_servers.php';
|
require_once $config['homedir'].'/include/functions_servers.php';
|
||||||
|
require_once $config['homedir'].'/include/functions_macros.php';
|
||||||
|
|
||||||
$search_string = get_parameter('search_string');
|
$search_string = get_parameter('search_string');
|
||||||
|
|
||||||
@ -949,8 +950,24 @@ if ($modules !== false) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (strlen($module['ip_target']) !== 0) {
|
if (strlen($module['ip_target']) !== 0) {
|
||||||
|
// Check if value is custom field.
|
||||||
|
if ($module['ip_target'][0] == '_' && $module['ip_target'][(strlen($module['ip_target']) - 1)] == '_') {
|
||||||
|
$custom_field_name = substr($module['ip_target'], 1, -1);
|
||||||
|
$custom_value = agents_get_agent_custom_field($id_agente, $custom_field_name);
|
||||||
|
if (isset($custom_value) && $custom_value !== false) {
|
||||||
|
$title .= '<br/>IP: '.$custom_value;
|
||||||
|
} else {
|
||||||
|
$array_macros = return_agent_macros($id_agente);
|
||||||
|
if (isset($array_macros[$module['ip_target']])) {
|
||||||
|
$title .= '<br/>IP: '.$array_macros[$module['ip_target']];
|
||||||
|
} else {
|
||||||
$title .= '<br/>IP: '.$module['ip_target'];
|
$title .= '<br/>IP: '.$module['ip_target'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$title .= '<br/>IP: '.$module['ip_target'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This module is initialized ? (has real data).
|
// This module is initialized ? (has real data).
|
||||||
if ($status === STATUS_MODULE_NO_DATA) {
|
if ($status === STATUS_MODULE_NO_DATA) {
|
||||||
|
@ -1391,7 +1391,6 @@ $table_advanced->data['made_enabled'][0] = html_print_checkbox_switch(
|
|||||||
false,
|
false,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
'wp100 static'
|
'wp100 static'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -2000,23 +1999,18 @@ ui_require_jquery_file('json');
|
|||||||
$('#' + thisLabel).prop('checked', true);
|
$('#' + thisLabel).prop('checked', true);
|
||||||
$('#' + thisLabel).siblings().prop('checked', false);
|
$('#' + thisLabel).siblings().prop('checked', false);
|
||||||
|
|
||||||
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
|
var type_selected = $("#id_module_type").val();
|
||||||
|
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
|
||||||
|
var type_name_selected = type_names[type_selected];
|
||||||
|
|
||||||
|
if (($('#radius-percentage_warning').prop('checked') === true && $('#radius-percentage_critical').prop('checked') === true) || type_name_selected == 'generic_data_string') {
|
||||||
|
paint_graph_values();
|
||||||
$("#svg_dinamic").hide();
|
$("#svg_dinamic").hide();
|
||||||
} else {
|
} else {
|
||||||
paint_graph_values();
|
paint_graph_values();
|
||||||
$("#svg_dinamic").show();
|
$("#svg_dinamic").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('#radius-percentage_warning').prop('checked') === true) {
|
|
||||||
$('#radius-warning_inverse').hide();
|
|
||||||
$('#label-radius-warning_inverse').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-warning_inverse').prop('checked') === true) {
|
|
||||||
$('#radius-percentage_warning').hide();
|
|
||||||
$('#label-radius-percentage_warning').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-normal_warning').prop('checked') === true) {
|
if ($('#radius-normal_warning').prop('checked') === true) {
|
||||||
$('#radius-warning_inverse').show();
|
$('#radius-warning_inverse').show();
|
||||||
$('#label-radius-warning_inverse').show();
|
$('#label-radius-warning_inverse').show();
|
||||||
@ -2024,17 +2018,6 @@ ui_require_jquery_file('json');
|
|||||||
$('#label-radius-percentage_warning').show();
|
$('#label-radius-percentage_warning').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($('#radius-percentage_critical').prop('checked') === true) {
|
|
||||||
$('#radius-critical_inverse').hide();
|
|
||||||
$('#label-radius-critical_inverse').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-critical_inverse').prop('checked') === true) {
|
|
||||||
$('#radius-percentage_critical').hide();
|
|
||||||
$('#label-radius-percentage_critical').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#radius-normal_critical').prop('checked') === true) {
|
if ($('#radius-normal_critical').prop('checked') === true) {
|
||||||
$('#radius-critical_inverse').show();
|
$('#radius-critical_inverse').show();
|
||||||
$('#label-radius-critical_inverse').show();
|
$('#label-radius-critical_inverse').show();
|
||||||
@ -2351,30 +2334,48 @@ ui_require_jquery_file('json');
|
|||||||
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
||||||
|
|
||||||
//if haven't error
|
//if haven't error
|
||||||
if (max_w == 0 || max_w > min_w) {
|
if (max_w == 0 || max_w > min_w || $('#radius-percentage_warning').is(':checked') === true) {
|
||||||
if (max_c == 0 || max_c > min_c) {
|
if (max_c == 0 || max_c > min_c || $('#radius-percentage_critical').is(':checked') === true) {
|
||||||
|
error_c = 0;
|
||||||
|
error_w = 0;
|
||||||
|
} else {
|
||||||
|
error_c = 1;
|
||||||
|
min_w = 0;
|
||||||
|
max_w = 0;
|
||||||
|
min_c = 0;
|
||||||
|
max_c = 0;
|
||||||
|
inverse_w = 0;
|
||||||
|
inverse_c = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (max_c !== 0 && max_c < min_c && $('#radius-percentage_critical').is(':checked') === false) {
|
||||||
|
error_c = 2;
|
||||||
|
}
|
||||||
|
error_w = 1;
|
||||||
|
min_w = 0;
|
||||||
|
max_w = 0;
|
||||||
|
min_c = 0;
|
||||||
|
max_c = 0;
|
||||||
|
inverse_w = 0;
|
||||||
|
inverse_c = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('#radius-percentage_warning').is(':checked') === true){
|
||||||
|
min_w = 0;
|
||||||
|
max_w = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('#radius-percentage_critical').is(':checked') === true){
|
||||||
|
min_c = 0;
|
||||||
|
max_c = 0;
|
||||||
|
}
|
||||||
|
|
||||||
paint_graph_status(
|
paint_graph_status(
|
||||||
min_w, max_w, min_c, max_c, inverse_w,
|
min_w, max_w, min_c, max_c, inverse_w,
|
||||||
inverse_c, error_w, error_c,
|
inverse_c, error_w, error_c,
|
||||||
legend_normal, legend_warning, legend_critical,
|
legend_normal, legend_warning, legend_critical,
|
||||||
message_error_warning, message_error_critical
|
message_error_warning, message_error_critical
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
error_c = 1;
|
|
||||||
paint_graph_status(
|
|
||||||
0, 0, 0, 0, 0, 0, error_w, error_c,
|
|
||||||
legend_normal, legend_warning, legend_critical,
|
|
||||||
message_error_warning, message_error_critical
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
error_w = 1;
|
|
||||||
paint_graph_status(
|
|
||||||
0, 0, 0, 0, 0, 0, error_w, error_c,
|
|
||||||
legend_normal, legend_warning, legend_critical,
|
|
||||||
message_error_warning, message_error_critical
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
|
@ -171,7 +171,7 @@ foreach ($password_fields as $k => $p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
if ($("#id_plugin").val() === 0) {
|
if ($("#id_plugin").val() !== 0) {
|
||||||
changePluginSelect();
|
changePluginSelect();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -131,9 +131,10 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = __('Agent');
|
|
||||||
$data[1] = __('Module');
|
$data[0] = __('Module');
|
||||||
$data[2] = __('Period');
|
$data[1] = __('Period');
|
||||||
|
|
||||||
$table_simple->cellclass['caption_prediction_module'][0] = 'w33p';
|
$table_simple->cellclass['caption_prediction_module'][0] = 'w33p';
|
||||||
$table_simple->cellclass['caption_prediction_module'][1] = 'w33p';
|
$table_simple->cellclass['caption_prediction_module'][1] = 'w33p';
|
||||||
$table_simple->cellclass['caption_prediction_module'][2] = 'w33p';
|
$table_simple->cellclass['caption_prediction_module'][2] = 'w33p';
|
||||||
@ -163,34 +164,68 @@ $params['none_module_text'] = __('Select Module');
|
|||||||
$params['use_hidden_input_idagent'] = true;
|
$params['use_hidden_input_idagent'] = true;
|
||||||
$params['input_style'] = 'width: 100%;';
|
$params['input_style'] = 'width: 100%;';
|
||||||
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
|
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
|
||||||
$data[0] = ui_print_agent_autocomplete_input($params);
|
|
||||||
|
|
||||||
if ($id_agente > 0) {
|
if (strstr($page, 'policy_modules') === false) {
|
||||||
$predictionModuleInput = html_print_select_from_sql(
|
$modules = agents_get_modules($id_agente);
|
||||||
'SELECT id_agente_modulo, nombre
|
|
||||||
FROM tagente_modulo
|
$predictionModuleInput = html_print_select(
|
||||||
WHERE delete_pending = 0
|
$modules,
|
||||||
AND history_data = 1
|
|
||||||
AND id_agente = '.$id_agente_clean.'
|
|
||||||
AND id_agente_modulo <> '.$id_agente_modulo,
|
|
||||||
'prediction_module',
|
'prediction_module',
|
||||||
$prediction_module,
|
$prediction_module,
|
||||||
'',
|
'',
|
||||||
__('Select Module'),
|
'',
|
||||||
0,
|
0,
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
|
'',
|
||||||
false,
|
false,
|
||||||
'width: 100%;'
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'pm'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$predictionModuleInput = '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';
|
$modules = index_array(policies_get_modules($policy_id, false, ['id', 'name']));
|
||||||
|
|
||||||
|
$predictionModuleInput = html_print_select(
|
||||||
|
$modules,
|
||||||
|
'id_module_policy',
|
||||||
|
$module['custom_integer_1'],
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[1] = $predictionModuleInput;
|
$data[0] = $predictionModuleInput;
|
||||||
$data[2] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
|
$data[1] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
|
||||||
$data[2] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
|
$data[1] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
|
||||||
|
|
||||||
$table_simple->cellclass['prediction_module'][0] = 'w33p';
|
$table_simple->cellclass['prediction_module'][0] = 'w33p';
|
||||||
$table_simple->cellclass['prediction_module'][1] = 'w33p';
|
$table_simple->cellclass['prediction_module'][1] = 'w33p';
|
||||||
$table_simple->cellclass['prediction_module'][2] = 'w33p';
|
$table_simple->cellclass['prediction_module'][2] = 'w33p';
|
||||||
@ -264,7 +299,7 @@ if ($selector_form !== ENTERPRISE_NOT_HOOK) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Synthetic modules are an Enterprise feature.
|
// Synthetic modules are an Enterprise feature.
|
||||||
$synthetic_module_form = enterprise_hook('get_synthetic_module_form');
|
$synthetic_module_form = enterprise_hook('get_synthetic_module_form', [$policy_id]);
|
||||||
if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) {
|
if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) {
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = $synthetic_module_form;
|
$data[0] = $synthetic_module_form;
|
||||||
|
@ -31,13 +31,14 @@ if (is_ajax()) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<h3>'.$template['name'].'</h3>';
|
echo '<h3 style="background-color: #14524f">'.$template['name'].'</h3>';
|
||||||
|
echo html_print_image('images/info.svg', true, ['class' => 'invert_filter']);
|
||||||
|
echo ui_print_alert_template_example($template['id'], true, true, false);
|
||||||
|
echo '<br />';
|
||||||
|
echo '<br />';
|
||||||
echo '<strong>'.__('Type').': </strong>';
|
echo '<strong>'.__('Type').': </strong>';
|
||||||
echo alerts_get_alert_templates_type_name($template['type']);
|
echo alerts_get_alert_templates_type_name($template['type']);
|
||||||
|
|
||||||
echo '<br />';
|
|
||||||
echo ui_print_alert_template_example($template['id'], true);
|
|
||||||
|
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
|
|
||||||
if ($template['description'] != '') {
|
if ($template['description'] != '') {
|
||||||
|
@ -256,7 +256,7 @@ $schedule = io_safe_output(
|
|||||||
|
|
||||||
$data[0] = '';
|
$data[0] = '';
|
||||||
$data[0] .= html_print_input_hidden('schedule', $schedule, true);
|
$data[0] .= html_print_input_hidden('schedule', $schedule, true);
|
||||||
$data[0] .= '<div id="calendar_map"></div>';
|
$data[0] .= '<div id="calendar_map" class="alert_view_calendar"></div>';
|
||||||
|
|
||||||
$data[1] = '';
|
$data[1] = '';
|
||||||
$table_conditions->data[] = $data;
|
$table_conditions->data[] = $data;
|
||||||
|
@ -552,6 +552,9 @@ $(document).ready (function () {
|
|||||||
|
|
||||||
// If the row is empty, hide it
|
// If the row is empty, hide it
|
||||||
if (field_row == '') {
|
if (field_row == '') {
|
||||||
|
// Clear hidden fields.
|
||||||
|
$("[name=field" + i + "_value]").val('');
|
||||||
|
$("[name=field" + i + "_recovery_value]").val('')
|
||||||
$table_macros_field.hide();
|
$table_macros_field.hide();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1240,7 +1240,7 @@ if ($step == 2) {
|
|||||||
'priority',
|
'priority',
|
||||||
$priority,
|
$priority,
|
||||||
'',
|
'',
|
||||||
0,
|
'',
|
||||||
0,
|
0,
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
|
@ -27,7 +27,6 @@ if (! check_acl($config['id_user'], 0, 'DM')) {
|
|||||||
|
|
||||||
// Get some general DB stats (not very heavy)
|
// Get some general DB stats (not very heavy)
|
||||||
// NOTE: this is not realtime monitoring stats, are more focused on DB sanity
|
// NOTE: this is not realtime monitoring stats, are more focused on DB sanity
|
||||||
$stat_access = db_get_sql('SELECT COUNT(*) FROM tagent_access WHERE id_agent != 0');
|
|
||||||
$stat_data = db_get_sql('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo != 0');
|
$stat_data = db_get_sql('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo != 0');
|
||||||
$stat_data_log4x = db_get_sql('SELECT COUNT(*) FROM tagente_datos_log4x WHERE id_agente_modulo != 0');
|
$stat_data_log4x = db_get_sql('SELECT COUNT(*) FROM tagente_datos_log4x WHERE id_agente_modulo != 0');
|
||||||
$stat_data_string = db_get_sql('SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo != 0');
|
$stat_data_string = db_get_sql('SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo != 0');
|
||||||
@ -149,18 +148,6 @@ echo $stat_modules;
|
|||||||
echo '</b></td></tr>';
|
echo '</b></td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '<tr class="rowOdd"><td>';
|
|
||||||
echo __('Total agent access records');
|
|
||||||
echo '<td><b>';
|
|
||||||
if ($stat_access > $max_access) {
|
|
||||||
echo "<font color='#ff0000'>$stat_access</font>";
|
|
||||||
} else {
|
|
||||||
echo $stat_access;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</b></td></tr>';
|
|
||||||
|
|
||||||
// Sanity
|
// Sanity
|
||||||
echo '<tr><th colspan=2><i>';
|
echo '<tr><th colspan=2><i>';
|
||||||
echo __('Database sanity');
|
echo __('Database sanity');
|
||||||
|
@ -115,6 +115,7 @@ $fields_available['module_status'] = __('Module Status');
|
|||||||
$fields_available['mini_severity'] = __('Severity mini');
|
$fields_available['mini_severity'] = __('Severity mini');
|
||||||
$fields_available['module_custom_id'] = __('Module custom ID');
|
$fields_available['module_custom_id'] = __('Module custom ID');
|
||||||
$fields_available['custom_data'] = __('Custom data');
|
$fields_available['custom_data'] = __('Custom data');
|
||||||
|
$fields_available['event_custom_id'] = __('Event Custom ID');
|
||||||
|
|
||||||
|
|
||||||
// Remove fields already selected.
|
// Remove fields already selected.
|
||||||
|
@ -68,7 +68,7 @@ foreach ($layer_ids as $layer_id) {
|
|||||||
$layer_list[] = [
|
$layer_list[] = [
|
||||||
'id' => (strpos($layer_id, 'new_') === false) ? (int) $layer_id : null,
|
'id' => (strpos($layer_id, 'new_') === false) ? (int) $layer_id : null,
|
||||||
'layer_name' => $trimmed_name,
|
'layer_name' => $trimmed_name,
|
||||||
'layer_visible' => ((int) $layers[$layer_id]['visible'] === 1),
|
'layer_visible' => ($layers[$layer_id]['visible'] === 'true'),
|
||||||
'layer_group' => (int) $layers[$layer_id]['agents_from_group'],
|
'layer_group' => (int) $layers[$layer_id]['agents_from_group'],
|
||||||
'layer_agent_list' => $layers[$layer_id]['agents'],
|
'layer_agent_list' => $layers[$layer_id]['agents'],
|
||||||
'layer_group_list' => $layers[$layer_id]['groups'],
|
'layer_group_list' => $layers[$layer_id]['groups'],
|
||||||
@ -243,10 +243,15 @@ switch ($action) {
|
|||||||
$map_default_altitude = get_parameter('map_default_altitude');
|
$map_default_altitude = get_parameter('map_default_altitude');
|
||||||
$map_group_id = get_parameter('map_group_id');
|
$map_group_id = get_parameter('map_group_id');
|
||||||
$map_levels_zoom = get_parameter('map_levels_zoom', 16);
|
$map_levels_zoom = get_parameter('map_levels_zoom', 16);
|
||||||
|
|
||||||
$map_connection_list_temp = explode(',', get_parameter('map_connection_list'));
|
$map_connection_list_temp = explode(',', get_parameter('map_connection_list'));
|
||||||
|
$map_connection_list_temp_string = implode(',', $map_connection_list_temp);
|
||||||
|
if (strlen($map_connection_list_temp_string) > 0) {
|
||||||
|
$where_map_connection = ' WHERE id_tmap_connection IN('.$map_connection_list_temp_string.')';
|
||||||
|
} else {
|
||||||
|
$where_map_connection = '';
|
||||||
|
}
|
||||||
|
|
||||||
$listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection');
|
$listConnectionTemp = db_get_all_rows_sql('SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection'.$where_map_connection);
|
||||||
|
|
||||||
foreach ($map_connection_list_temp as $index => $value) {
|
foreach ($map_connection_list_temp as $index => $value) {
|
||||||
$cleanValue = trim($value);
|
$cleanValue = trim($value);
|
||||||
@ -256,7 +261,6 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$map_connection_default = get_parameter('map_connection_default');
|
$map_connection_default = get_parameter('map_connection_default');
|
||||||
|
|
||||||
$map_connection_list = [];
|
$map_connection_list = [];
|
||||||
foreach ($listConnectionTemp as $idMapConnection) {
|
foreach ($listConnectionTemp as $idMapConnection) {
|
||||||
$default = 0;
|
$default = 0;
|
||||||
@ -485,7 +489,7 @@ foreach ($listConnectionTemp as $connectionTemp) {
|
|||||||
$table->data[1][0] = __('Add Map connection').$iconError;
|
$table->data[1][0] = __('Add Map connection').$iconError;
|
||||||
$table->data[1][1] = "<table class='no-class' border='0' id='map_connection'>
|
$table->data[1][1] = "<table class='no-class' border='0' id='map_connection'>
|
||||||
<tr>
|
<tr>
|
||||||
<td>".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)."
|
<td>".html_print_select($listConnection, 'select-map_connection_list', '', '', '', '0', true)."
|
||||||
</td>
|
</td>
|
||||||
<td >
|
<td >
|
||||||
<a href='javascript: addConnectionMap();'>".html_print_image(
|
<a href='javascript: addConnectionMap();'>".html_print_image(
|
||||||
@ -560,21 +564,23 @@ html_print_table($table);
|
|||||||
|
|
||||||
$user_groups = users_get_groups($config['user'], 'AR', false);
|
$user_groups = users_get_groups($config['user'], 'AR', false);
|
||||||
|
|
||||||
echo '<h3>'.__('Layers').'</h3>';
|
echo '<fieldset class="margin-bottom-10"><legend>'.__('Layers').'</legend>';
|
||||||
|
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->class = 'databox filters';
|
$table->class = 'databox filters';
|
||||||
$table->valign = [];
|
$table->valign = [];
|
||||||
$table->valign[0] = 'top';
|
$table->valign[0] = 'top; width: 50%';
|
||||||
$table->valign[1] = 'top';
|
$table->valign[1] = 'top; width: 50%';
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
|
|
||||||
$table->data[0][0] = '<h4>'.__('List of layers').'</h4>';
|
$table->data[0][0] = '<h4>'.__('List of layers').'</h4>';
|
||||||
$table->data[0][1] = '<div class="right">'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'</div>';
|
$table->data[0][1] = '<div class="right">'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'</div>';
|
||||||
|
|
||||||
$table->data[1][0] = '<table class="databox" border="0" cellpadding="4" cellspacing="4" id="list_layers"></table>';
|
$table->data[1][0] = '<div id="form_layer" class="invisible">
|
||||||
$table->data[1][1] = '<div id="form_layer" class="invisible">
|
|
||||||
<table id="form_layer_table" class="" border="0" cellpadding="4" cellspacing="4">
|
<table id="form_layer_table" class="" border="0" cellpadding="4" cellspacing="4">
|
||||||
|
<tr>
|
||||||
|
<td colspan="4"><hr/></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>'.__('Layer name').':</td>
|
<td>'.__('Layer name').':</td>
|
||||||
<td>'.html_print_input_text('layer_name_form', '', '', 20, 40, true).'</td>
|
<td>'.html_print_input_text('layer_name_form', '', '', 20, 40, true).'</td>
|
||||||
@ -592,10 +598,6 @@ $table->data[1][1] = '<div id="form_layer" class="invisible">
|
|||||||
<td>'.__('Agent').':</td>
|
<td>'.__('Agent').':</td>
|
||||||
<td colspan="3">';
|
<td colspan="3">';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$table->data[1][1] .= html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
|
|
||||||
|
|
||||||
$params = [];
|
$params = [];
|
||||||
$params['return'] = true;
|
$params['return'] = true;
|
||||||
$params['show_helptip'] = true;
|
$params['show_helptip'] = true;
|
||||||
@ -608,11 +610,12 @@ $params['javascript_function_action_after_select'] = 'active_button_add_agent';
|
|||||||
$params['javascript_is_function_select'] = true;
|
$params['javascript_is_function_select'] = true;
|
||||||
$params['disabled_javascript_on_blur_function'] = false;
|
$params['disabled_javascript_on_blur_function'] = false;
|
||||||
|
|
||||||
$table->data[1][1] .= ui_print_agent_autocomplete_input($params);
|
$table->data[1][0] .= ui_print_agent_autocomplete_input($params);
|
||||||
|
$buttonAgent = html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
|
||||||
|
$table->data[1][0] .= '</td>
|
||||||
|
</tr>
|
||||||
$table->data[1][1] .= '</td>
|
<tr>
|
||||||
|
<td colspan="4" align="right">'.$buttonAgent.'</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">
|
<td colspan="4">
|
||||||
@ -641,7 +644,7 @@ $params['disabled_javascript_on_blur_function'] = false;
|
|||||||
$agent_for_group_input = ui_print_agent_autocomplete_input($params);
|
$agent_for_group_input = ui_print_agent_autocomplete_input($params);
|
||||||
$add_group_btn = html_print_button(__('Add'), 'add_group', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
|
$add_group_btn = html_print_button(__('Add'), 'add_group', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
|
||||||
|
|
||||||
$table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
|
$table->data[1][0] .= '<tr><td colspan="4"><hr /></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>'.__('Group').':</td>
|
<td>'.__('Group').':</td>
|
||||||
<td colspan="3">'.$group_select.'</td>
|
<td colspan="3">'.$group_select.'</td>
|
||||||
@ -661,7 +664,7 @@ $table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
|
|||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
$table->data[1][1] .= '<tr>
|
$table->data[1][0] .= '<tr>
|
||||||
<td align="right" colspan="4">'.html_print_button(__('Save Layer'), 'save_layer', false, 'javascript:saveNewLayer();', 'class="sub wand"', true).'
|
<td align="right" colspan="4">'.html_print_button(__('Save Layer'), 'save_layer', false, 'javascript:saveNewLayer();', 'class="sub wand"', true).'
|
||||||
'.html_print_input_hidden('current_edit_layer_id', '', true).'
|
'.html_print_input_hidden('current_edit_layer_id', '', true).'
|
||||||
</td>
|
</td>
|
||||||
@ -669,7 +672,12 @@ $table->data[1][1] .= '<tr>
|
|||||||
</table>
|
</table>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
|
$table->data[1][1] = '<fieldset>
|
||||||
|
<legend>'.__('Layers list').'</legend>
|
||||||
|
<table class="databox invisible" border="0" id="list_layers"></table>
|
||||||
|
</fieldset>';
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
|
echo '</fieldset>';
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'save_new':
|
case 'save_new':
|
||||||
@ -1229,6 +1237,8 @@ function getLayerRow (layerId, layerData) {
|
|||||||
.append($editCol)
|
.append($editCol)
|
||||||
.append($deleteCol);
|
.append($deleteCol);
|
||||||
|
|
||||||
|
$("#list_layers").removeClass('invisible');
|
||||||
|
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +84,9 @@ if (is_ajax() === true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$group = db_get_row('tgrupo', 'id_grupo', $id_group);
|
$group = db_get_row('tgrupo', 'id_grupo', $id_group);
|
||||||
|
if (str_contains($group['icon'], '.png') === true) {
|
||||||
|
$group['folder'] = 'groups_small/';
|
||||||
|
}
|
||||||
|
|
||||||
echo json_encode($group);
|
echo json_encode($group);
|
||||||
return;
|
return;
|
||||||
@ -757,6 +760,125 @@ if ($tab == 'tree') {
|
|||||||
/*
|
/*
|
||||||
* Group tree view.
|
* Group tree view.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$table = new stdClass();
|
||||||
|
$table->width = '100%';
|
||||||
|
$table->class = 'databox filters filter-table-adv';
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$table->cellspacing = 0;
|
||||||
|
$table->cellpadding = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$search_group_string = get_parameter('search_group_string', '');
|
||||||
|
$search_agent_string = get_parameter('search_agent_string', '');
|
||||||
|
$agent_status = get_parameter('agent_status', '');
|
||||||
|
$show_not_init_agents = get_parameter('show_not_init_agents', 1);
|
||||||
|
$show_not_init_modules = get_parameter('show_not_init_modules', 1);
|
||||||
|
$show_full_hirearchy = get_parameter('show_full_hirearchy', 1);
|
||||||
|
|
||||||
|
|
||||||
|
$table->data = [];
|
||||||
|
$table->head = [];
|
||||||
|
$table->style = [];
|
||||||
|
|
||||||
|
$table->style[0] = 'width: 50%;';
|
||||||
|
$table->style[1] = 'width: 50%;';
|
||||||
|
|
||||||
|
$table->data[0][0] = html_print_label_input_block(
|
||||||
|
__('Search group'),
|
||||||
|
html_print_input_text(
|
||||||
|
'search_group_string',
|
||||||
|
$search_group_string,
|
||||||
|
'',
|
||||||
|
25,
|
||||||
|
255,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$agents_status_list = agents_status_list();
|
||||||
|
|
||||||
|
$table->data[0][1] = html_print_label_input_block(
|
||||||
|
__('Search by agent status').ui_print_help_tip(__('Shows the groups that contain an agent with the status that has been searched'), true),
|
||||||
|
html_print_select(
|
||||||
|
$agents_status_list,
|
||||||
|
'agent_status',
|
||||||
|
$agent_status,
|
||||||
|
'',
|
||||||
|
__('All'),
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'w200p',
|
||||||
|
false,
|
||||||
|
'width: 100%;'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$table->data[1][0] = html_print_label_input_block(
|
||||||
|
__('Search by agent').ui_print_help_tip(__('Shows groups that contain an agent matching the search'), true),
|
||||||
|
html_print_input_text(
|
||||||
|
'search_agent_string',
|
||||||
|
$search_agent_string,
|
||||||
|
'',
|
||||||
|
25,
|
||||||
|
255,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$table->data[1][1] = html_print_label_input_block(
|
||||||
|
__('Show full hierarchy'),
|
||||||
|
html_print_checkbox_switch_extended(
|
||||||
|
'show_full_hirearchy',
|
||||||
|
1,
|
||||||
|
$show_full_hirearchy,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$table->data[3][0] = ' ';
|
||||||
|
|
||||||
|
$table->data[3][1] = html_print_submit_button(
|
||||||
|
__('Filter'),
|
||||||
|
'filter',
|
||||||
|
false,
|
||||||
|
[
|
||||||
|
'class' => 'float-right',
|
||||||
|
'icon' => 'search',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$form = "<form method='post' action=''>";
|
||||||
|
$form .= html_print_table($table, true);
|
||||||
|
$form .= '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ui_toggle(
|
||||||
|
$form,
|
||||||
|
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||||
|
'filter_form',
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'white-box-content',
|
||||||
|
'box-flat white_table_graph fixed_filter_bar'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
echo "<div id='tree-controller-recipient'></div>";
|
echo "<div id='tree-controller-recipient'></div>";
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@ -826,6 +948,8 @@ if ($tab == 'tree') {
|
|||||||
);
|
);
|
||||||
$form .= '</form>';
|
$form .= '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ui_toggle(
|
ui_toggle(
|
||||||
$form,
|
$form,
|
||||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||||
@ -1058,6 +1182,34 @@ $tab = 'group_edition';
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
let show_full_hirearchy = "<?php echo $show_full_hirearchy; ?>";
|
||||||
|
let show_not_init_agents = "<?php echo $show_not_init_agents; ?>";
|
||||||
|
let show_not_init_modules = "<?php echo $show_not_init_modules; ?>";
|
||||||
|
|
||||||
|
$('#checkbox-show_full_hirearchy').on("change", function() {
|
||||||
|
if (show_full_hirearchy == 1) {
|
||||||
|
show_full_hirearchy = 0;
|
||||||
|
} else {
|
||||||
|
show_full_hirearchy = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#button-filter').on('click', function(event) {
|
||||||
|
console.log('here');
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('load', function() {
|
||||||
|
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules) {
|
||||||
var treeController = TreeController.getController();
|
var treeController = TreeController.getController();
|
||||||
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
|
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
|
||||||
|
|
||||||
@ -1071,16 +1223,17 @@ $tab = 'group_edition';
|
|||||||
parameters['getChildren'] = 1;
|
parameters['getChildren'] = 1;
|
||||||
parameters['type'] = "<?php echo $tab; ?>";
|
parameters['type'] = "<?php echo $tab; ?>";
|
||||||
parameters['filter'] = {};
|
parameters['filter'] = {};
|
||||||
parameters['filter']['searchGroup'] = '';
|
parameters['filter']['searchGroup'] = $('#text-search_group_string').val();
|
||||||
parameters['filter']['searchAgent'] = '';
|
parameters['filter']['searchAgent'] = $('#text-search_agent_string').val();
|
||||||
parameters['filter']['statusAgent'] = '';
|
parameters['filter']['statusAgent'] = $('#agent_status option:selected').val();
|
||||||
parameters['filter']['searchModule'] = '';
|
parameters['filter']['searchModule'] = '';
|
||||||
parameters['filter']['statusModule'] = '';
|
parameters['filter']['statusModule'] = '';
|
||||||
parameters['filter']['groupID'] = '';
|
parameters['filter']['groupID'] = '';
|
||||||
parameters['filter']['tagID'] = '';
|
parameters['filter']['tagID'] = '';
|
||||||
parameters['filter']['searchHirearchy'] = 1;
|
parameters['filter']['searchHirearchy'] = 1;
|
||||||
parameters['filter']['show_not_init_agents'] = 1;
|
parameters['filter']['show_full_hirearchy'] = show_full_hirearchy;
|
||||||
parameters['filter']['show_not_init_modules'] = 1;
|
parameters['filter']['show_not_init_agents'] = show_not_init_agents;
|
||||||
|
parameters['filter']['show_not_init_modules'] = show_not_init_modules;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@ -1141,4 +1294,7 @@ $tab = 'group_edition';
|
|||||||
},
|
},
|
||||||
dataType: "json"
|
dataType: "json"
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -255,7 +255,18 @@ $table->data[1][1] = html_print_select(
|
|||||||
true,
|
true,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
'width:180px;'
|
'width:180px;',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
$table->data[1][2] = __('When select agents');
|
$table->data[1][2] = __('When select agents');
|
||||||
$table->data[1][2] .= '<br>';
|
$table->data[1][2] .= '<br>';
|
||||||
@ -271,7 +282,31 @@ $table->data[1][2] .= html_print_select(
|
|||||||
'',
|
'',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;');
|
$table->data[1][3] = html_print_select(
|
||||||
|
[],
|
||||||
|
'module[]',
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'width:180px;',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
||||||
$filter_groups = '';
|
$filter_groups = '';
|
||||||
|
@ -367,6 +367,8 @@ if ($access_console_node === true) {
|
|||||||
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
|
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
|
||||||
$sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts';
|
$sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts';
|
||||||
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
|
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
|
||||||
|
$sub['godmode/agentes/planned_downtime.list']['text'] = __('Scheduled downtime');
|
||||||
|
$sub['godmode/agentes/planned_downtime.list']['id'] = 'scheduled_downtime';
|
||||||
|
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||||
$sub['godmode/alerts/alert_templates']['text'] = __('Templates');
|
$sub['godmode/alerts/alert_templates']['text'] = __('Templates');
|
||||||
@ -708,6 +710,17 @@ if ($access_console_node === true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($access_console_node === true) {
|
if ($access_console_node === true) {
|
||||||
|
// Tools
|
||||||
|
$menu_godmode['tools']['text'] = __('Tools');
|
||||||
|
$menu_godmode['tools']['sec2'] = 'operation/extensions';
|
||||||
|
$menu_godmode['tools']['id'] = 'oper-extensions';
|
||||||
|
$sub = [];
|
||||||
|
$sub['operation/agentes/exportdata']['text'] = __('Export data');
|
||||||
|
$sub['operation/agentes/exportdata']['id'] = 'export_data';
|
||||||
|
$sub['extensions/files_repo']['text'] = __('File repository');
|
||||||
|
$sub['extensions/files_repo']['id'] = 'file_repository';
|
||||||
|
$menu_godmode['tools']['sub'] = $sub;
|
||||||
|
|
||||||
// About.
|
// About.
|
||||||
$menu_godmode['about']['text'] = __('About');
|
$menu_godmode['about']['text'] = __('About');
|
||||||
$menu_godmode['about']['id'] = 'about';
|
$menu_godmode['about']['id'] = 'about';
|
||||||
|
@ -95,7 +95,7 @@ $subsection = reporting_enterprise_add_graph_template_subsection('', $buttons);
|
|||||||
$buttons['graph_container'] = [
|
$buttons['graph_container'] = [
|
||||||
'active' => true,
|
'active' => true,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
|
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
|
||||||
'images/graph-container.svg@svg',
|
'images/graph-container@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('Graph container'),
|
'title' => __('Graph container'),
|
||||||
|
@ -519,9 +519,9 @@ if (!$maps && is_metaconsole() === false) {
|
|||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
if (is_metaconsole() === false) {
|
||||||
$data[0] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
$data[0] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$map['id'].'&refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
|
||||||
} else {
|
} else {
|
||||||
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[1] = ui_print_group_icon($map['id_group'], true);
|
$data[1] = ui_print_group_icon($map['id_group'], true);
|
||||||
@ -541,7 +541,7 @@ if (!$maps && is_metaconsole() === false) {
|
|||||||
true,
|
true,
|
||||||
['class' => 'main_menu_icon invert_filter']
|
['class' => 'main_menu_icon invert_filter']
|
||||||
).'</a>';
|
).'</a>';
|
||||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
|
||||||
'images/delete.svg',
|
'images/delete.svg',
|
||||||
true,
|
true,
|
||||||
['class' => 'main_menu_icon invert_filter']
|
['class' => 'main_menu_icon invert_filter']
|
||||||
@ -552,7 +552,7 @@ if (!$maps && is_metaconsole() === false) {
|
|||||||
true,
|
true,
|
||||||
['class' => 'main_menu_icon invert_filter']
|
['class' => 'main_menu_icon invert_filter']
|
||||||
).'</a>';
|
).'</a>';
|
||||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
|
||||||
'images/delete.svg',
|
'images/delete.svg',
|
||||||
true,
|
true,
|
||||||
['class' => 'main_menu_icon invert_filter']
|
['class' => 'main_menu_icon invert_filter']
|
||||||
|
@ -152,6 +152,7 @@ $fullscale = false;
|
|||||||
$percentil = false;
|
$percentil = false;
|
||||||
$image_threshold = false;
|
$image_threshold = false;
|
||||||
$time_compare_overlapped = false;
|
$time_compare_overlapped = false;
|
||||||
|
$unknowns_graph = false;
|
||||||
|
|
||||||
// Added for events items.
|
// Added for events items.
|
||||||
$server_multiple = [0];
|
$server_multiple = [0];
|
||||||
@ -356,6 +357,7 @@ switch ($action) {
|
|||||||
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
|
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
|
||||||
$image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false;
|
$image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false;
|
||||||
$graph_render = $item['graph_render'];
|
$graph_render = $item['graph_render'];
|
||||||
|
$unknowns_graph = $item['check_unknowns_graph'];
|
||||||
// The break hasn't be forgotten.
|
// The break hasn't be forgotten.
|
||||||
case 'simple_baseline_graph':
|
case 'simple_baseline_graph':
|
||||||
case 'projection_graph':
|
case 'projection_graph':
|
||||||
@ -1108,6 +1110,50 @@ switch ($action) {
|
|||||||
$period = $item['period'];
|
$period = $item['period'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_agent':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
$es = json_decode($item['external_source'], true);
|
||||||
|
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
|
||||||
|
$security_hardening_score = $es['security_hardening_score'];
|
||||||
|
$vulnerabilities_status = $es['vulnerabilities_status'];
|
||||||
|
$secmon_status = $es['secmon_status'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_info_agent':
|
||||||
|
$idAgent = $item['id_agent'];
|
||||||
|
$es = json_decode($item['external_source'], true);
|
||||||
|
$vul_package = $es['vul_package'];
|
||||||
|
$vul_severity = $es['vul_severity'];
|
||||||
|
$vul_ac = $es['vul_ac'];
|
||||||
|
$vul_pr = $es['vul_pr'];
|
||||||
|
$vul_ui = $es['vul_ui'];
|
||||||
|
$vul_av = (empty($es['vul_av']) === true) ? 'all' : $es['vul_av'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_agents_vuls':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
$recursion = $item['recursion'];
|
||||||
|
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_vuls_count':
|
||||||
|
$group = $item['id_group'];
|
||||||
|
$recursion = $item['recursion'];
|
||||||
|
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// It's not possible.
|
// It's not possible.
|
||||||
break;
|
break;
|
||||||
@ -3026,6 +3072,23 @@ if (is_metaconsole() === true) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_unknowns_graph" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Show unknowns in graph');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_checkbox_switch(
|
||||||
|
'unknowns_graph',
|
||||||
|
1,
|
||||||
|
$unknowns_graph
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr id="row_time_compare_overlapped" class="datos">
|
<tr id="row_time_compare_overlapped" class="datos">
|
||||||
<td class="bolder">
|
<td class="bolder">
|
||||||
<?php
|
<?php
|
||||||
@ -4018,6 +4081,217 @@ if (is_metaconsole() === true) {
|
|||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_secmon_status" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Secmon status');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'critical' => __('Critical'),
|
||||||
|
'warning' => __('Warning'),
|
||||||
|
],
|
||||||
|
'secmon_status',
|
||||||
|
$secmon_status,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_security_hardening_score" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Security hardening score');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'90' => __('< 90%'),
|
||||||
|
'80' => __('< 80%'),
|
||||||
|
'70' => __('< 70%'),
|
||||||
|
'60' => __('< 60%'),
|
||||||
|
'50' => __('< 50%'),
|
||||||
|
'40' => __('< 40%'),
|
||||||
|
'30' => __('< 30%'),
|
||||||
|
'20' => __('< 20%'),
|
||||||
|
'10' => __('< 10%'),
|
||||||
|
],
|
||||||
|
'security_hardening_score',
|
||||||
|
(empty($security_hardening_score) === false) ? $security_hardening_score : 'all',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_vulnerabilities_status" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Vulnerabilities status');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'crit' => __('Critical'),
|
||||||
|
'warn' => __('Warning'),
|
||||||
|
],
|
||||||
|
'vulnerabilities_status',
|
||||||
|
$vulnerabilities_status,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_vulnerabilities_packages" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Package').ui_print_help_tip(__('Select a agent for load his packages.'), true);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
],
|
||||||
|
'vul_package',
|
||||||
|
$vul_package,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_vulnerabilities_severity" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Severity');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'high' => __('High'),
|
||||||
|
'low' => __('Low'),
|
||||||
|
'none' => __('None'),
|
||||||
|
],
|
||||||
|
'vul_severity',
|
||||||
|
$vul_severity,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_vulnerabilities_ac" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Attack Complexity');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'H' => __('High'),
|
||||||
|
'L' => __('Low'),
|
||||||
|
],
|
||||||
|
'vul_ac',
|
||||||
|
$vul_ac,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_vulnerabilities_pr" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Privileges Required');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'H' => __('High'),
|
||||||
|
'L' => __('Low'),
|
||||||
|
'N' => __('None'),
|
||||||
|
],
|
||||||
|
'vul_pr',
|
||||||
|
$vul_pr,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_vulnerabilities_ui" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('User Interaction');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'R' => __('Required'),
|
||||||
|
'N' => __('None'),
|
||||||
|
],
|
||||||
|
'vul_ui',
|
||||||
|
$vul_ui,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_vulnerabilities_av" class="datos">
|
||||||
|
<td class="bolder">
|
||||||
|
<?php
|
||||||
|
echo __('Attack vector');
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
html_print_select(
|
||||||
|
[
|
||||||
|
'all' => __('All'),
|
||||||
|
'A' => __('Adjacent Network'),
|
||||||
|
'L' => __('Local'),
|
||||||
|
'N' => __('Network'),
|
||||||
|
'P' => __('Physical'),
|
||||||
|
],
|
||||||
|
'vul_av',
|
||||||
|
(empty($vul_av) === true) ? 'all' : $vul_av,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<tr id="row_status_check" class="datos">
|
<tr id="row_status_check" class="datos">
|
||||||
@ -5751,6 +6025,27 @@ $(document).ready (function () {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'vuls_info_agent':
|
||||||
|
if ($("#hidden-id_agent").val() == 0) {
|
||||||
|
dialog_message('#message_no_agent');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_agents_vuls':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_vuls_count':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -5911,7 +6206,24 @@ $(document).ready (function () {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'vuls_info_agent':
|
||||||
|
if ($("#hidden-id_agent").val() == 0) {
|
||||||
|
dialog_message('#message_no_agent');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_agents_vuls':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top_n_vuls_count':
|
||||||
|
if ($("#text-max_items").val() == '') {
|
||||||
|
dialog_message('#message_no_max_item');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -6964,12 +7276,22 @@ function chooseType() {
|
|||||||
$("#row_group_by").hide();
|
$("#row_group_by").hide();
|
||||||
$("#row_type_show").hide();
|
$("#row_type_show").hide();
|
||||||
$("#row_use_prefix_notation").hide();
|
$("#row_use_prefix_notation").hide();
|
||||||
|
$("#row_unknowns_graph").hide();
|
||||||
$("#row_os_selector").hide();
|
$("#row_os_selector").hide();
|
||||||
$("#row_os_version_regexp").hide();
|
$("#row_os_version_regexp").hide();
|
||||||
$("#row_os_end_of_life").hide();
|
$("#row_os_end_of_life").hide();
|
||||||
$("#row_cat_security_hardening").hide();
|
$("#row_cat_security_hardening").hide();
|
||||||
$("#row_ignore_skipped").hide();
|
$("#row_ignore_skipped").hide();
|
||||||
$("#row_status_check").hide();
|
$("#row_status_check").hide();
|
||||||
|
$("#row_secmon_status").hide();
|
||||||
|
$("#row_security_hardening_score").hide();
|
||||||
|
$("#row_vulnerabilities_status").hide();
|
||||||
|
$("#row_vulnerabilities_packages").hide();
|
||||||
|
$("#row_vulnerabilities_severity").hide();
|
||||||
|
$("#row_vulnerabilities_ac").hide();
|
||||||
|
$("#row_vulnerabilities_pr").hide();
|
||||||
|
$("#row_vulnerabilities_ui").hide();
|
||||||
|
$("#row_vulnerabilities_av").hide();
|
||||||
|
|
||||||
// SLA list default state.
|
// SLA list default state.
|
||||||
$("#sla_list").hide();
|
$("#sla_list").hide();
|
||||||
@ -7056,6 +7378,7 @@ function chooseType() {
|
|||||||
$("#row_image_threshold").show();
|
$("#row_image_threshold").show();
|
||||||
$("#row_graph_render").show();
|
$("#row_graph_render").show();
|
||||||
$("#row_percentil").show();
|
$("#row_percentil").show();
|
||||||
|
$("#row_unknowns_graph").show();
|
||||||
|
|
||||||
// Force type.
|
// Force type.
|
||||||
if('<?php echo $action; ?>' === 'new'){
|
if('<?php echo $action; ?>' === 'new'){
|
||||||
@ -7885,6 +8208,50 @@ function chooseType() {
|
|||||||
$("#row_group").show();
|
$("#row_group").show();
|
||||||
$('#row_period').show();
|
$('#row_period').show();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$("#row_group").show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$("#row_group").show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$("#row_group").show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_agent':
|
||||||
|
$("#row_group").show();
|
||||||
|
$("#row_custom_field_filter").show();
|
||||||
|
$("#row_secmon_status").show();
|
||||||
|
$("#row_security_hardening_score").show();
|
||||||
|
$("#row_vulnerabilities_status").show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_info_agent':
|
||||||
|
$("#row_agent").show();
|
||||||
|
$("#row_vulnerabilities_packages").show();
|
||||||
|
$("#row_vulnerabilities_severity").show();
|
||||||
|
$("#row_vulnerabilities_ac").show();
|
||||||
|
$("#row_vulnerabilities_pr").show();
|
||||||
|
$("#row_vulnerabilities_ui").show();
|
||||||
|
$("#row_vulnerabilities_av").show();
|
||||||
|
updatePackages();
|
||||||
|
$('#row_agent input[type=text]').change(function(e) {
|
||||||
|
updatePackages();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_agents_vuls':
|
||||||
|
$("#row_group").show();
|
||||||
|
$("#row_max_items").show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_vuls_count':
|
||||||
|
$("#row_group").show();
|
||||||
|
$("#row_max_items").show();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -8127,6 +8494,46 @@ function control_period_range() {
|
|||||||
}, 800);
|
}, 800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function updateSelect(element, fields, selected) {
|
||||||
|
if (typeof fields === "object") {
|
||||||
|
$(element).find("select").empty();
|
||||||
|
$(element).find(".select2-container .select2-selection__rendered").empty();
|
||||||
|
Object.keys(fields).forEach(function(key) {
|
||||||
|
if (key === selected) {
|
||||||
|
$(element).find(".select2-container .select2-selection__rendered").append(`${fields[key]}`);
|
||||||
|
$(element).find("select").append(`<option value="${key}" selected>${fields[key]}</option>`);
|
||||||
|
} else {
|
||||||
|
$(element).find("select").append(`<option value="${key}">${fields[key]}</option>`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePackages() {
|
||||||
|
let id_agent = $('#hidden-id_agent').val();
|
||||||
|
let server_id = $('#hidden-server_id').val();
|
||||||
|
$.ajax({
|
||||||
|
method: "POST",
|
||||||
|
url: "<?php echo ui_get_full_url('ajax.php'); ?>",
|
||||||
|
data: {
|
||||||
|
page: "<?php echo ENTERPRISE_DIR.'/include/ajax/vulnerabilities.ajax'; ?>",
|
||||||
|
action: "updatePackages",
|
||||||
|
id_agent: id_agent,
|
||||||
|
server_id: server_id,
|
||||||
|
},
|
||||||
|
success: function(data) {
|
||||||
|
const json = JSON.parse(data);
|
||||||
|
if (json.success) {
|
||||||
|
updateSelect("#row_vulnerabilities_packages", json.data, '<?php echo $vul_package; ?>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0);
|
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0);
|
||||||
|
|
||||||
|
@ -777,7 +777,7 @@ $table->data[0][0] = html_print_label_input_block(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$table->data[0][1] = html_print_label_input_block(
|
$table->data[0][1] = html_print_label_input_block(
|
||||||
__('Poisition'),
|
__('Position'),
|
||||||
html_print_input_text_extended(
|
html_print_input_text_extended(
|
||||||
'position_to_delete',
|
'position_to_delete',
|
||||||
1,
|
1,
|
||||||
|
@ -180,8 +180,8 @@ if ($report_id_user == $config['id_user']
|
|||||||
$options['div_class'] = '';
|
$options['div_class'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data[2][1] = html_print_label_input_block(
|
$table->data[3][0] = html_print_label_input_block(
|
||||||
__('Group'),
|
__('Write Access Group'),
|
||||||
html_print_select_groups(
|
html_print_select_groups(
|
||||||
false,
|
false,
|
||||||
'RW',
|
'RW',
|
||||||
@ -216,7 +216,7 @@ if ($enterpriseEnable) {
|
|||||||
|
|
||||||
|
|
||||||
if (enterprise_installed() === true) {
|
if (enterprise_installed() === true) {
|
||||||
$table->data[3][0] = html_print_label_input_block(
|
$table->data[4][0] = html_print_label_input_block(
|
||||||
__('Generate cover page in PDF render'),
|
__('Generate cover page in PDF render'),
|
||||||
html_print_checkbox_switch(
|
html_print_checkbox_switch(
|
||||||
'cover_page_render',
|
'cover_page_render',
|
||||||
@ -226,7 +226,7 @@ if (enterprise_installed() === true) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[3][1] = html_print_label_input_block(
|
$table->data[4][1] = html_print_label_input_block(
|
||||||
__('Generate index in PDF render'),
|
__('Generate index in PDF render'),
|
||||||
html_print_checkbox_switch(
|
html_print_checkbox_switch(
|
||||||
'index_render',
|
'index_render',
|
||||||
|
@ -1943,6 +1943,7 @@ switch ($action) {
|
|||||||
$values['graph_render'] = (int) get_parameter(
|
$values['graph_render'] = (int) get_parameter(
|
||||||
'graph_render'
|
'graph_render'
|
||||||
);
|
);
|
||||||
|
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
|
||||||
case 'simple_baseline_graph':
|
case 'simple_baseline_graph':
|
||||||
// HACK it is saved in show_graph field.
|
// HACK it is saved in show_graph field.
|
||||||
$values['show_graph'] = (int) get_parameter(
|
$values['show_graph'] = (int) get_parameter(
|
||||||
@ -2060,6 +2061,56 @@ switch ($action) {
|
|||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_agent':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||||
|
$es['secmon_status'] = get_parameter('secmon_status');
|
||||||
|
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||||
|
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||||
|
$values['external_source'] = json_encode($es);
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_info_agent':
|
||||||
|
$values['id_agent'] = get_parameter('id_agent');
|
||||||
|
$es['server_id'] = get_parameter('server_id');
|
||||||
|
$es['vul_package'] = get_parameter('vul_package');
|
||||||
|
$es['vul_severity'] = get_parameter('vul_severity');
|
||||||
|
$es['vul_ac'] = get_parameter('vul_ac');
|
||||||
|
$es['vul_pr'] = get_parameter('vul_pr');
|
||||||
|
$es['vul_ui'] = get_parameter('vul_ui');
|
||||||
|
$es['vul_av'] = get_parameter('vul_av');
|
||||||
|
$values['external_source'] = json_encode($es);
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_agents_vuls':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['top_n_value'] = get_parameter('max_items');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_vuls_count':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['top_n_value'] = get_parameter('max_items');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$values['period'] = get_parameter('period');
|
$values['period'] = get_parameter('period');
|
||||||
$values['top_n'] = get_parameter(
|
$values['top_n'] = get_parameter(
|
||||||
@ -2895,6 +2946,7 @@ switch ($action) {
|
|||||||
$values['graph_render'] = (int) get_parameter(
|
$values['graph_render'] = (int) get_parameter(
|
||||||
'graph_render'
|
'graph_render'
|
||||||
);
|
);
|
||||||
|
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
|
||||||
case 'simple_baseline_graph':
|
case 'simple_baseline_graph':
|
||||||
// HACK it is saved in show_graph field.
|
// HACK it is saved in show_graph field.
|
||||||
$values['show_graph'] = (int) get_parameter(
|
$values['show_graph'] = (int) get_parameter(
|
||||||
@ -3005,6 +3057,56 @@ switch ($action) {
|
|||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_agent':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||||
|
$es['secmon_status'] = get_parameter('secmon_status');
|
||||||
|
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||||
|
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||||
|
$values['external_source'] = json_encode($es);
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_info_agent':
|
||||||
|
$values['id_agent'] = get_parameter('id_agent');
|
||||||
|
$es['server_id'] = get_parameter('server_id');
|
||||||
|
$es['vul_package'] = get_parameter('vul_package');
|
||||||
|
$es['vul_severity'] = get_parameter('vul_severity');
|
||||||
|
$es['vul_ac'] = get_parameter('vul_ac');
|
||||||
|
$es['vul_pr'] = get_parameter('vul_pr');
|
||||||
|
$es['vul_ui'] = get_parameter('vul_ui');
|
||||||
|
$es['vul_av'] = get_parameter('vul_av');
|
||||||
|
$values['external_source'] = json_encode($es);
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_agents_vuls':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['top_n_value'] = get_parameter('max_items');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_vuls_count':
|
||||||
|
$values['id_group'] = get_parameter('combo_group');
|
||||||
|
$values['top_n_value'] = get_parameter('max_items');
|
||||||
|
$good_format = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$values['period'] = get_parameter('period');
|
$values['period'] = get_parameter('period');
|
||||||
$values['top_n'] = get_parameter(
|
$values['top_n'] = get_parameter(
|
||||||
|
@ -151,7 +151,7 @@ $table->data[0][] = html_print_label_input_block(
|
|||||||
__('Name'),
|
__('Name'),
|
||||||
html_print_input_text(
|
html_print_input_text(
|
||||||
'name',
|
'name',
|
||||||
$visualConsoleName,
|
io_safe_output($visualConsoleName),
|
||||||
'',
|
'',
|
||||||
80,
|
80,
|
||||||
100,
|
100,
|
||||||
|
@ -164,6 +164,9 @@ switch ($activeTab) {
|
|||||||
$width = (int) get_parameter('width');
|
$width = (int) get_parameter('width');
|
||||||
$height = (int) get_parameter('height');
|
$height = (int) get_parameter('height');
|
||||||
$visualConsoleName = (string) get_parameter('name');
|
$visualConsoleName = (string) get_parameter('name');
|
||||||
|
$visualConsoleName = str_replace('<', '', $visualConsoleName);
|
||||||
|
$visualConsoleName = str_replace('>', '', $visualConsoleName);
|
||||||
|
$visualConsoleName = (string) io_safe_input($visualConsoleName);
|
||||||
$is_favourite = (int) get_parameter('is_favourite_sent');
|
$is_favourite = (int) get_parameter('is_favourite_sent');
|
||||||
$auto_adjust = (int) get_parameter('auto_adjust_sent');
|
$auto_adjust = (int) get_parameter('auto_adjust_sent');
|
||||||
|
|
||||||
@ -239,7 +242,7 @@ switch ($activeTab) {
|
|||||||
if ($uploadOK == 1) {
|
if ($uploadOK == 1) {
|
||||||
if (move_uploaded_file($_FILES['background_image']['tmp_name'], $target_file)) {
|
if (move_uploaded_file($_FILES['background_image']['tmp_name'], $target_file)) {
|
||||||
$background = $nameImage;
|
$background = $nameImage;
|
||||||
$values['background'] = $background;
|
$values['background'] = io_safe_input($background);
|
||||||
$error2 = chmod($target_file, 0644);
|
$error2 = chmod($target_file, 0644);
|
||||||
$uploadOK = $error2;
|
$uploadOK = $error2;
|
||||||
} else {
|
} else {
|
||||||
@ -872,7 +875,7 @@ $buttons[$activeTab]['active'] = true;
|
|||||||
|
|
||||||
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
|
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
|
||||||
ui_print_standard_header(
|
ui_print_standard_header(
|
||||||
($visualConsoleName ?? ''),
|
(io_safe_output($visualConsoleName) ?? ''),
|
||||||
'images/visual_console.png',
|
'images/visual_console.png',
|
||||||
false,
|
false,
|
||||||
$tab_builder,
|
$tab_builder,
|
||||||
|
@ -860,8 +860,10 @@ if (empty($create) === false || empty($view) === false) {
|
|||||||
if ($management_allowed === false) {
|
if ($management_allowed === false) {
|
||||||
ui_print_warning_message(
|
ui_print_warning_message(
|
||||||
__(
|
__(
|
||||||
'This console is not manager of this environment,
|
'This console is not manager of this environment, please manage this feature from feature from %s.',
|
||||||
please manage this feature from centralized manager console (Metaconsole).'
|
'<a target="_blank" href="'.ui_get_meta_url(
|
||||||
|
'index.php?sec=advanced&sec2=godmode/servers/plugin_registration&tab=plugin_registration&pure=0'
|
||||||
|
).'">'.__('metaconsole').'</a>'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -64,32 +64,33 @@ $table->style = [];
|
|||||||
// $table->style[0] = 'font-weight: bold';
|
// $table->style[0] = 'font-weight: bold';
|
||||||
$table->align = [];
|
$table->align = [];
|
||||||
$table->align[1] = 'center';
|
$table->align[1] = 'center';
|
||||||
$table->align[3] = 'center';
|
$table->align[4] = 'center';
|
||||||
$table->align[8] = 'right';
|
$table->align[9] = 'right';
|
||||||
|
|
||||||
$table->headstyle[1] = 'text-align:center';
|
$table->headstyle[1] = 'text-align:center';
|
||||||
$table->headstyle[3] = 'text-align:center';
|
$table->headstyle[4] = 'text-align:center';
|
||||||
$table->headstyle[8] = 'text-align:right;width: 120px;';
|
$table->headstyle[9] = 'text-align:right;width: 120px;';
|
||||||
|
|
||||||
$table->titleclass = 'tabletitle';
|
$table->titleclass = 'tabletitle';
|
||||||
$table->titlestyle = 'text-transform:uppercase;';
|
$table->titlestyle = 'text-transform:uppercase;';
|
||||||
|
|
||||||
$table->style[6] = 'display: flex;align-items: center;';
|
$table->style[7] = 'display: flex;align-items: center;';
|
||||||
|
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
$table->head[0] = __('Name');
|
$table->head[0] = __('Name');
|
||||||
$table->head[1] = __('Status');
|
$table->head[1] = __('Status');
|
||||||
$table->head[2] = __('Type');
|
$table->head[2] = __('Type');
|
||||||
$table->head[3] = __('Version');
|
$table->head[3] = __('Master');
|
||||||
$table->head[4] = __('Modules');
|
$table->head[4] = __('Version');
|
||||||
$table->head[5] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
|
$table->head[5] = __('Modules');
|
||||||
$table->head[6] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
|
$table->head[6] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
|
||||||
|
$table->head[7] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
|
||||||
// This will have a column of data such as "6 hours".
|
// This will have a column of data such as "6 hours".
|
||||||
$table->head[7] = __('Updated');
|
$table->head[8] = __('Updated');
|
||||||
|
|
||||||
// Only Pandora Administrator can delete servers.
|
// Only Pandora Administrator can delete servers.
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||||
$table->head[8] = '<span title="Operations">'.__('Op.').'</span>';
|
$table->head[9] = '<span title="Operations">'.__('Op.').'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
@ -143,9 +144,11 @@ foreach ($servers as $server) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Type.
|
// Type.
|
||||||
$data[2] = '<span class="nowrap">'.$server['img'];
|
$data[2] = '<span class="nowrap">'.$server['img'].' '.$server['name'];
|
||||||
if ($server['master'] == $master) {
|
if ($server['master'] == $master) {
|
||||||
$data[2] .= ui_print_help_tip(__('This is a master server'), true);
|
$data[3] .= __('Yes', true);
|
||||||
|
} else {
|
||||||
|
$data[3] .= __('-');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int) $server['exec_proxy'] === 1) {
|
if ((int) $server['exec_proxy'] === 1) {
|
||||||
@ -157,27 +160,27 @@ foreach ($servers as $server) {
|
|||||||
case 'event':
|
case 'event':
|
||||||
case 'autoprovision':
|
case 'autoprovision':
|
||||||
case 'migration':
|
case 'migration':
|
||||||
$data[3] = $server['version'];
|
$data[4] = $server['version'];
|
||||||
$data[4] = __('N/A');
|
|
||||||
$data[5] = __('N/A');
|
$data[5] = __('N/A');
|
||||||
|
$data[6] = __('N/A');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'export':
|
case 'export':
|
||||||
$data[3] = $server['version'];
|
$data[4] = $server['version'];
|
||||||
$data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
$data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
||||||
$data[5] = __('N/A');
|
$data[6] = __('N/A');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$data[3] = $server['version'];
|
$data[4] = $server['version'];
|
||||||
$data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
$data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
||||||
$data[5] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
|
$data[6] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[6] = '';
|
$data[7] = '';
|
||||||
if ($server['queued_modules'] > 500) {
|
if ($server['queued_modules'] >= $config['number_modules_queue']) {
|
||||||
$data[6] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
$data[7] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
||||||
'images/info-warning.svg',
|
'images/info-warning.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -189,9 +192,9 @@ foreach ($servers as $server) {
|
|||||||
).'</a></div> ';
|
).'</a></div> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[6] .= $server['threads'].' : '.$server['queued_modules'];
|
$data[7] .= $server['threads'].' : '.$server['queued_modules'];
|
||||||
|
|
||||||
$data[7] = ui_print_timestamp($server['keepalive'], true);
|
$data[8] = ui_print_timestamp($server['keepalive'], true);
|
||||||
|
|
||||||
if ($server['type'] === 'data') {
|
if ($server['type'] === 'data') {
|
||||||
$ext = '_server';
|
$ext = '_server';
|
||||||
@ -208,11 +211,11 @@ foreach ($servers as $server) {
|
|||||||
|
|
||||||
// Only Pandora Administrator can delete servers.
|
// Only Pandora Administrator can delete servers.
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||||
$data[8] = '';
|
$data[9] = '';
|
||||||
|
|
||||||
if ($server['type'] === 'recon') {
|
if ($server['type'] === 'recon') {
|
||||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||||
$data[8] .= html_print_image(
|
$data[9] .= html_print_image(
|
||||||
'images/snmp-trap@svg.svg',
|
'images/snmp-trap@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -221,12 +224,12 @@ foreach ($servers as $server) {
|
|||||||
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($server['type'] === 'data') {
|
if ($server['type'] === 'data') {
|
||||||
$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[9] .= '<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(
|
$data[9] .= html_print_image(
|
||||||
'images/force@svg.svg',
|
'images/force@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -234,10 +237,10 @@ foreach ($servers as $server) {
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
} else if ($server['type'] === 'enterprise snmp') {
|
} else if ($server['type'] === 'enterprise snmp') {
|
||||||
$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[9] .= '<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(
|
$data[9] .= html_print_image(
|
||||||
'images/force@svg.svg',
|
'images/force@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -245,12 +248,12 @@ foreach ($servers as $server) {
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($server['type'] === 'event' && (bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
if ($server['type'] === 'event' && (bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||||
$data[8] .= '<a class="open-alerts-list-modal" href="">';
|
$data[9] .= '<a class="open-alerts-list-modal" href="">';
|
||||||
$data[8] .= html_print_image(
|
$data[9] .= html_print_image(
|
||||||
'images/alert@svg.svg',
|
'images/alert@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -258,11 +261,11 @@ foreach ($servers as $server) {
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
||||||
$data[8] .= html_print_image(
|
$data[9] .= html_print_image(
|
||||||
'images/edit.svg',
|
'images/edit.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -270,11 +273,11 @@ foreach ($servers as $server) {
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
|
|
||||||
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
|
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
|
||||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
|
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=advanced_editor').'">';
|
||||||
$data[8] .= html_print_image(
|
$data[9] .= html_print_image(
|
||||||
'images/agents@svg.svg',
|
'images/agents@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -282,10 +285,10 @@ foreach ($servers as $server) {
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
|
|
||||||
$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[9] .= '<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(
|
$data[9] .= html_print_image(
|
||||||
'images/remote-configuration@svg.svg',
|
'images/remote-configuration@svg.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -293,12 +296,12 @@ foreach ($servers as $server) {
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
$names_servers[$safe_server_name] = false;
|
$names_servers[$safe_server_name] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
||||||
$data[8] .= html_print_image(
|
$data[9] .= html_print_image(
|
||||||
'images/delete.svg',
|
'images/delete.svg',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
@ -307,14 +310,14 @@ foreach ($servers as $server) {
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$data[8] .= '</a>';
|
$data[9] .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tiny) {
|
if ($tiny) {
|
||||||
unset($data[4]);
|
unset($data[5]);
|
||||||
unset($data[6]);
|
|
||||||
unset($data[7]);
|
unset($data[7]);
|
||||||
unset($data[8]);
|
unset($data[8]);
|
||||||
|
unset($data[9]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ext = '';
|
$ext = '';
|
||||||
@ -323,10 +326,10 @@ foreach ($servers as $server) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($tiny) {
|
if ($tiny) {
|
||||||
unset($table->head[4]);
|
unset($table->head[5]);
|
||||||
unset($table->head[6]);
|
|
||||||
unset($table->head[7]);
|
unset($table->head[7]);
|
||||||
unset($table->head[8]);
|
unset($table->head[8]);
|
||||||
|
unset($table->head[9]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tiny) {
|
if ($tiny) {
|
||||||
|
@ -71,6 +71,8 @@ if (isset($config['filemanager']['message']) === true) {
|
|||||||
$fallback_directory = 'images';
|
$fallback_directory = 'images';
|
||||||
// Get directory.
|
// Get directory.
|
||||||
$directory = (string) get_parameter('directory');
|
$directory = (string) get_parameter('directory');
|
||||||
|
$directory = str_replace('<', '', $text);
|
||||||
|
$directory = str_replace('>', '', $text);
|
||||||
if (empty($directory) === true) {
|
if (empty($directory) === true) {
|
||||||
$directory = $fallback_directory;
|
$directory = $fallback_directory;
|
||||||
} else {
|
} else {
|
||||||
|
@ -54,8 +54,12 @@ if (isset($_POST['create'])) {
|
|||||||
if (! $result) {
|
if (! $result) {
|
||||||
ui_print_error_message(__('There was a problem creating link'));
|
ui_print_error_message(__('There was a problem creating link'));
|
||||||
} else {
|
} else {
|
||||||
ui_print_success_message(__('Successfully created'));
|
|
||||||
$id_link = $result;
|
$id_link = $result;
|
||||||
|
ui_print_result_message(
|
||||||
|
$id_link,
|
||||||
|
__('Successfully created'),
|
||||||
|
__('Could not be created')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,8 +115,8 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
|||||||
$link = '';
|
$link = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
|
|
||||||
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
|
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
|
||||||
|
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
|
||||||
if ($creation_mode == 1) {
|
if ($creation_mode == 1) {
|
||||||
echo "<input type='hidden' name='create' value='1'>";
|
echo "<input type='hidden' name='create' value='1'>";
|
||||||
} else {
|
} else {
|
||||||
@ -179,10 +183,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
echo '</form></td></tr></table>';
|
echo '</td></tr></table></form>';
|
||||||
} else {
|
} else {
|
||||||
// Main list view for Links editor
|
// Main list view for Links editor.
|
||||||
$rows = db_get_all_rows_in_table('tlink', 'name');
|
$rows = db_get_all_fields_in_table('tlink', '', '', 'name');
|
||||||
if ($rows === false) {
|
if ($rows === false) {
|
||||||
$rows = [];
|
$rows = [];
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ if ($idOS > 0) {
|
|||||||
$description = $os['description'];
|
$description = $os['description'];
|
||||||
$icon = $os['icon_name'];
|
$icon = $os['icon_name'];
|
||||||
} else {
|
} else {
|
||||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
|
||||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||||
$icon = get_parameter('icon', 0);
|
$icon = get_parameter('icon', 0);
|
||||||
}
|
}
|
||||||
@ -87,9 +87,16 @@ if ($is_management_allowed === true) {
|
|||||||
|
|
||||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||||
$message = 9;
|
$message = 9;
|
||||||
|
} else if (exif_imagetype($file_tmp) === false && $file_ext !== 'svg') {
|
||||||
|
$message = 10;
|
||||||
} else {
|
} else {
|
||||||
$message = 8;
|
$message = 8;
|
||||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
|
||||||
|
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||||
|
|
||||||
|
if ($file_uploaded !== true) {
|
||||||
|
$message = 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -108,7 +115,7 @@ if ($is_management_allowed === true) {
|
|||||||
|
|
||||||
if ($resultOrId === false) {
|
if ($resultOrId === false) {
|
||||||
$message = 2;
|
$message = 2;
|
||||||
$tab = 'builder';
|
$tab = 'manage_os';
|
||||||
$actionHidden = 'save';
|
$actionHidden = 'save';
|
||||||
$textButton = __('Create');
|
$textButton = __('Create');
|
||||||
$classButton = ['icon' => 'wand'];
|
$classButton = ['icon' => 'wand'];
|
||||||
@ -144,13 +151,19 @@ if ($is_management_allowed === true) {
|
|||||||
|
|
||||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||||
$message = 9;
|
$message = 9;
|
||||||
|
} else if (exif_imagetype($file_tmp) === false) {
|
||||||
|
$message = 10;
|
||||||
} else {
|
} else {
|
||||||
$message = 8;
|
$message = 8;
|
||||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||||
|
|
||||||
|
if ($file_uploaded !== true) {
|
||||||
|
$message = 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
|
||||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||||
$icon = get_parameter('icon', 0);
|
$icon = get_parameter('icon', 0);
|
||||||
|
|
||||||
@ -254,7 +267,7 @@ $table->class = 'databox filter-table-adv';
|
|||||||
|
|
||||||
$table->data[0][] = html_print_label_input_block(
|
$table->data[0][] = html_print_label_input_block(
|
||||||
__('Name'),
|
__('Name'),
|
||||||
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, false, '', 'w250px')
|
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, true, '', 'w250px')
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->data[0][] = html_print_label_input_block(
|
$table->data[0][] = html_print_label_input_block(
|
||||||
@ -290,6 +303,28 @@ html_print_action_buttons(
|
|||||||
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
|
$id_message = get_parameter('id_message', 0);
|
||||||
|
|
||||||
|
if ($id_message !== 0) {
|
||||||
|
switch ($id_message) {
|
||||||
|
case 8:
|
||||||
|
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 9:
|
||||||
|
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 10:
|
||||||
|
echo ui_print_error_message(__('An error ocurrered to upload icon'), '', true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Nothing to do.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_list_os_icons_dir()
|
function get_list_os_icons_dir()
|
||||||
{
|
{
|
||||||
|
@ -162,11 +162,15 @@ if (empty($id_message) === false) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
|
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=8');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 9:
|
case 9:
|
||||||
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
|
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=9');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 10:
|
||||||
|
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=10');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -154,8 +154,7 @@ if ($update_config == 1 && $config['history_db_enabled'] == 1) {
|
|||||||
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
|
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
|
||||||
|
|
||||||
$total_agents = db_get_value('count(*)', 'tagente');
|
$total_agents = db_get_value('count(*)', 'tagente');
|
||||||
$disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
|
// $disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
|
||||||
|
|
||||||
$table_status = new StdClass();
|
$table_status = new StdClass();
|
||||||
$table_status->width = '100%';
|
$table_status->width = '100%';
|
||||||
$table_status->class = 'databox filters';
|
$table_status->class = 'databox filters';
|
||||||
@ -666,8 +665,8 @@ $table_other->data[2][1] = html_print_label_input_block(
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
/*
|
||||||
$table_other->data[3][0] = html_print_label_input_block(
|
$table_other->data[3][0] = html_print_label_input_block(
|
||||||
__('Use agent access graph'),
|
__('Use agent access graph'),
|
||||||
html_print_checkbox_switch(
|
html_print_checkbox_switch(
|
||||||
'agentaccess',
|
'agentaccess',
|
||||||
@ -676,9 +675,9 @@ $table_other->data[3][0] = html_print_label_input_block(
|
|||||||
true,
|
true,
|
||||||
$disable_agentaccess
|
$disable_agentaccess
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
$table_other->data[3][1] = html_print_label_input_block(
|
$table_other->data[3][0] = html_print_label_input_block(
|
||||||
__('Max. recommended number of files in attachment directory'),
|
__('Max. recommended number of files in attachment directory'),
|
||||||
html_print_input_text(
|
html_print_input_text(
|
||||||
'num_files_attachment',
|
'num_files_attachment',
|
||||||
|
@ -93,7 +93,7 @@ $buttons['general'] = [
|
|||||||
'images/setup.png',
|
'images/setup.png',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'title' => __('General'),
|
'title' => __('General setup'),
|
||||||
'class' => 'invert_filter',
|
'class' => 'invert_filter',
|
||||||
|
|
||||||
]
|
]
|
||||||
@ -265,7 +265,7 @@ if (enterprise_installed()) {
|
|||||||
switch ($section) {
|
switch ($section) {
|
||||||
case 'general':
|
case 'general':
|
||||||
$buttons['general']['active'] = true;
|
$buttons['general']['active'] = true;
|
||||||
$subpage = __('General');
|
$subpage = __('General setup');
|
||||||
$help_header = 'setup_general_tab';
|
$help_header = 'setup_general_tab';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -370,14 +370,14 @@ switch ($section) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$subpage = 'seccion: '.$section;
|
$subpage = 'seccion: ';
|
||||||
// Default.
|
// Default.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header.
|
// Header.
|
||||||
ui_print_standard_header(
|
ui_print_standard_header(
|
||||||
$subpage,
|
__('Setup').' » '.$subpage,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
$help_header,
|
$help_header,
|
||||||
@ -388,6 +388,10 @@ ui_print_standard_header(
|
|||||||
'link' => '',
|
'link' => '',
|
||||||
'label' => __('Setup'),
|
'label' => __('Setup'),
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'link' => '',
|
||||||
|
'label' => $subpage,
|
||||||
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -187,7 +187,8 @@ $button_test .= ' <span id="ITSM-message" class="invisible"></span>';
|
|||||||
|
|
||||||
$row['control'] = html_print_label_input_block(
|
$row['control'] = html_print_label_input_block(
|
||||||
__('Test connection pandora to ITSM'),
|
__('Test connection pandora to ITSM'),
|
||||||
$button_test
|
$button_test,
|
||||||
|
['div_class' => 'ITSM-remote-setup-ITSM_token']
|
||||||
);
|
);
|
||||||
$table_remote->data['ITSM_test'] = $row;
|
$table_remote->data['ITSM_test'] = $row;
|
||||||
|
|
||||||
|
@ -535,16 +535,47 @@ html_print_action_buttons(
|
|||||||
__('Update'),
|
__('Update'),
|
||||||
'update_button',
|
'update_button',
|
||||||
false,
|
false,
|
||||||
[ 'icon' => 'update' ],
|
[
|
||||||
|
'icon' => 'update',
|
||||||
|
'onclick' => 'onFormSubmit()',
|
||||||
|
],
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
echo ui_print_warning_message(
|
||||||
|
[
|
||||||
|
'message' => __('Session timeout must be a number'),
|
||||||
|
'force_class' => 'invisible js_warning_msg',
|
||||||
|
],
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function onFormSubmit() {
|
||||||
|
const isNumber = n => $.isNumeric(n);
|
||||||
|
|
||||||
|
let session_timeout = $('#text-session_timeout').val()
|
||||||
|
if(isNumber(session_timeout)) {
|
||||||
|
if (session_timeout < 0) {
|
||||||
|
|
||||||
|
session_timeout = -1;
|
||||||
|
}
|
||||||
|
if (session_timeout > 604800) {
|
||||||
|
session_timeout = 604800;
|
||||||
|
}
|
||||||
|
$('#text-session_timeout').val(session_timeout);
|
||||||
|
} else {
|
||||||
|
$('.js_warning_msg').removeClass('invisible');
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function showAndHide() {
|
function showAndHide() {
|
||||||
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
|
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
|
||||||
$('#table1-2FA_all_users').removeClass('invisible');
|
$('#table1-2FA_all_users').removeClass('invisible');
|
||||||
|
@ -405,19 +405,6 @@ $table->data[$i++][] = html_print_label_input_block(
|
|||||||
|
|
||||||
|
|
||||||
$table->data[$i][] = html_print_label_input_block(
|
$table->data[$i][] = html_print_label_input_block(
|
||||||
__('Enable Sflow'),
|
|
||||||
html_print_checkbox_switch_extended(
|
|
||||||
'activate_sflow',
|
|
||||||
1,
|
|
||||||
$config['activate_sflow'],
|
|
||||||
$rbt_disabled,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
true
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
$table->data[$i++][] = html_print_label_input_block(
|
|
||||||
__('General network path'),
|
__('General network path'),
|
||||||
html_print_input_text(
|
html_print_input_text(
|
||||||
'general_network_path',
|
'general_network_path',
|
||||||
@ -733,7 +720,7 @@ $table->data[$i++][] = html_print_label_input_block(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$help_tip = ui_print_help_tip(
|
$help_tip = ui_print_help_tip(
|
||||||
__('If there are any "In process" events with a specific Extra ID and a New event with that Extra ID is received, it will be created as "In process" instead.'),
|
__('If there are any "In process" events with a specific Extra ID and a New event with that Extra ID is received, it will be created as "In process" instead. The new events also inherit Event Custom ID'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -766,6 +753,16 @@ $table->data[$i][] = html_print_label_input_block(
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$table->data[$i++][] = html_print_label_input_block(
|
||||||
|
__('Number of modules in queue'),
|
||||||
|
html_print_input_number(
|
||||||
|
[
|
||||||
|
'name' => 'number_modules_queue',
|
||||||
|
'min' => 0,
|
||||||
|
'value' => $config['number_modules_queue'],
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||||
|
@ -83,6 +83,19 @@ $table->data[3][] = html_print_label_input_block(
|
|||||||
html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true)
|
html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->data[4][] = html_print_label_input_block(
|
||||||
|
__('Enable Sflow'),
|
||||||
|
html_print_checkbox_switch_extended(
|
||||||
|
'activate_sflow',
|
||||||
|
1,
|
||||||
|
$config['activate_sflow'],
|
||||||
|
$rbt_disabled,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
echo '<form class="max_floating_element_size" id="netflow_setup" method="post">';
|
echo '<form class="max_floating_element_size" id="netflow_setup" method="post">';
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
html_print_input_hidden('update_config', 1);
|
html_print_input_hidden('update_config', 1);
|
||||||
|
@ -1952,6 +1952,7 @@ if ($create_alert || $update_alert) {
|
|||||||
[
|
[
|
||||||
'border' => '0',
|
'border' => '0',
|
||||||
'alt' => __('Delete'),
|
'alt' => __('Delete'),
|
||||||
|
'class' => 'invert_filter main_menu_icon',
|
||||||
]
|
]
|
||||||
).'</a> </td>';
|
).'</a> </td>';
|
||||||
$data[1] .= '</tr>';
|
$data[1] .= '</tr>';
|
||||||
|
@ -61,7 +61,7 @@ $license = db_get_value(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (isset($config['lts_updates']) === false) {
|
if (isset($config['lts_updates']) === false) {
|
||||||
$config['lts_updates'] = false;
|
$config['lts_updates'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($license) === true) {
|
if (empty($license) === true) {
|
||||||
|
111
pandora_console/godmode/update_manager/modal_lts_update.php
Normal file
111
pandora_console/godmode/update_manager/modal_lts_update.php
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Modal LTS versions update manager.
|
||||||
|
*
|
||||||
|
* @category Update Manager
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage Community
|
||||||
|
* @version 1.0.0
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
|
* ______ ___ _______ _______ ________
|
||||||
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
|
*
|
||||||
|
* ============================================================================
|
||||||
|
* Copyright (c) 2005-2023 Pandora FMS
|
||||||
|
* Please see https://pandorafms.com/community/ 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.
|
||||||
|
* ============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Begin.
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
check_login();
|
||||||
|
// The ajax is in include/ajax/update_manager.php.
|
||||||
|
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_ACL_VIOLATION,
|
||||||
|
'Trying to access Setup Management'
|
||||||
|
);
|
||||||
|
include 'general/noaccess.php';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once $config['homedir'].'/vendor/autoload.php';
|
||||||
|
|
||||||
|
$php_version = phpversion();
|
||||||
|
$php_version_array = explode('.', $php_version);
|
||||||
|
if ($php_version_array[0] < 7) {
|
||||||
|
include_once 'general/php_message.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- Lts Updates. -->
|
||||||
|
<div id="lts-updates" title="
|
||||||
|
<?php echo __('LTS versions'); ?>
|
||||||
|
" class="invisible">
|
||||||
|
<div style="display: flex; justify-content: space-between">
|
||||||
|
<div style="width: 250px; padding: 36px">
|
||||||
|
<?php
|
||||||
|
echo html_print_image(
|
||||||
|
'images/info-warning.svg',
|
||||||
|
true,
|
||||||
|
[ 'style' => 'padding-top: 30px' ]
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div style="padding: 5px 90px 5px 5px;">
|
||||||
|
<p class="lato font_10pt bolder">
|
||||||
|
<?php
|
||||||
|
echo __('There are two types of versions in Pandora FMS: the LTS versions (Long-Term Support), e.g: 772 LTS, and the RRR (Regular Rolling Release) versions, e.g: 771, 773, 774, 775.');
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<p class="lato font_10pt bolder">
|
||||||
|
<?php
|
||||||
|
echo __('LTS versions have frequent, periodic updates (fixes), correcting both security problems and critical bugs detected in the tool. These are the versions we recommend to use in production environments.');
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<p class="lato font_10pt bolder">
|
||||||
|
<?php
|
||||||
|
echo __('RRR versions incorporate new features in each version, as well as bug fixes, but due to their dynamic nature, errors are more likely.');
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Lts Updates.
|
||||||
|
$("#lts-updates").dialog({
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
modal: true,
|
||||||
|
width: 740,
|
||||||
|
overlay: {
|
||||||
|
opacity: 0.5,
|
||||||
|
background: "black"
|
||||||
|
},
|
||||||
|
closeOnEscape: true,
|
||||||
|
buttons: [{
|
||||||
|
text: "OK",
|
||||||
|
click: function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
open: function(event, ui) {
|
||||||
|
$(".ui-dialog-titlebar-close").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
@ -119,11 +119,13 @@ switch ($tab) {
|
|||||||
|
|
||||||
case 'setup':
|
case 'setup':
|
||||||
include $config['homedir'].'/godmode/update_manager/update_manager.setup.php';
|
include $config['homedir'].'/godmode/update_manager/update_manager.setup.php';
|
||||||
|
include $config['homedir'].'/godmode/update_manager/modal_lts_update.php';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'offline':
|
case 'offline':
|
||||||
$mode = \UpdateManager\UI\Manager::MODE_OFFLINE;
|
$mode = \UpdateManager\UI\Manager::MODE_OFFLINE;
|
||||||
include $config['homedir'].'/godmode/um_client/index.php';
|
include $config['homedir'].'/godmode/um_client/index.php';
|
||||||
|
include $config['homedir'].'/godmode/update_manager/modal_lts_update.php';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'online':
|
case 'online':
|
||||||
@ -163,5 +165,6 @@ switch ($tab) {
|
|||||||
|
|
||||||
$mode = \UpdateManager\UI\Manager::MODE_ONLINE;
|
$mode = \UpdateManager\UI\Manager::MODE_ONLINE;
|
||||||
include $config['homedir'].'/godmode/um_client/index.php';
|
include $config['homedir'].'/godmode/um_client/index.php';
|
||||||
|
include $config['homedir'].'/godmode/update_manager/modal_lts_update.php';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,10 @@ if (users_is_admin()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($config['lts_updates']) === false) {
|
||||||
|
config_update_value('lts_updates', 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$action_update_url_update_manager) {
|
if (!$action_update_url_update_manager) {
|
||||||
$url_update_manager = get_parameter(
|
$url_update_manager = get_parameter(
|
||||||
'url_update_manager',
|
'url_update_manager',
|
||||||
|
@ -155,14 +155,92 @@ if (is_ajax() === true) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($delete_profile === true) {
|
||||||
|
// Get parameters.
|
||||||
|
$result = false;
|
||||||
|
$id_user = (string) get_parameter('id_user');
|
||||||
|
$id_up = (int) get_parameter('id_user_profile');
|
||||||
|
$delete_user = (bool) get_parameter('delete_user', false);
|
||||||
|
$user_is_global_admin = users_is_admin($id_user);
|
||||||
|
|
||||||
|
$perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up);
|
||||||
|
$id_perfil = $perfilUser['id_perfil'];
|
||||||
|
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_USER_MANAGEMENT,
|
||||||
|
'Deleted profile for user '.io_safe_output($id_user),
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'The profile with id '.$id_perfil.' in the group '.$perfilUser['id_grupo']
|
||||||
|
);
|
||||||
|
// Delete profile.
|
||||||
|
$profile_deleted = profile_delete_user_profile($id_user, $id_up);
|
||||||
|
// Check if exists more profiles.
|
||||||
|
$has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id_user);
|
||||||
|
if ($profile_deleted === true) {
|
||||||
|
if ($has_profile === false && $user_is_global_admin === false && $delete_user === true) {
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$servers = metaconsole_get_servers();
|
||||||
|
foreach ($servers as $server) {
|
||||||
|
// Connect to the remote console.
|
||||||
|
metaconsole_connect($server);
|
||||||
|
|
||||||
|
// Delete the user.
|
||||||
|
$result = delete_user($id_user);
|
||||||
|
if ($result === true) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_USER_MANAGEMENT,
|
||||||
|
__('Deleted user %s from metaconsole', io_safe_output($id_user))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore the db connection.
|
||||||
|
metaconsole_restore_db();
|
||||||
|
|
||||||
|
// Log to the metaconsole too.
|
||||||
|
if ($result === true) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_USER_MANAGEMENT,
|
||||||
|
__(
|
||||||
|
'Deleted user %s from %s',
|
||||||
|
io_safe_input($id_user),
|
||||||
|
io_safe_input($server['server_name'])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = delete_user((string) $id_user);
|
||||||
|
|
||||||
|
if ($result === true) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_USER_MANAGEMENT,
|
||||||
|
__('Deleted user %s', io_safe_output($id_user))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result = delete_user((string) $id_user);
|
||||||
|
if ($result === true) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_USER_MANAGEMENT,
|
||||||
|
__('Deleted user %s', io_safe_output($id_user))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result = $profile_deleted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tab = get_parameter('tab', 'user');
|
$tab = get_parameter('tab', 'user');
|
||||||
|
|
||||||
// Save autorefresh list.
|
// Save autorefresh list.
|
||||||
$autorefresh_list = (array) get_parameter_post('autorefresh_list');
|
$autorefresh_list = (array) get_parameter_post('autorefresh_list');
|
||||||
$autorefresh_white_list = (($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')) ? '' : json_encode($autorefresh_list);
|
$autorefresh_white_list = (($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')) ? '' : json_encode($autorefresh_list);
|
||||||
|
|
||||||
// Header.
|
// Header.
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
user_meta_print_header();
|
user_meta_print_header();
|
||||||
@ -195,11 +273,11 @@ if (is_metaconsole() === true) {
|
|||||||
).'</a>',
|
).'</a>',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$buttons[$tab]['active'] = true;
|
$buttons[$tab]['active'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$edit_user = get_parameter('edit_user');
|
$edit_user = get_parameter('edit_user');
|
||||||
|
|
||||||
ui_print_standard_header(
|
ui_print_standard_header(
|
||||||
($edit_user) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
|
($edit_user) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
|
||||||
'images/gm_users.png',
|
'images/gm_users.png',
|
||||||
@ -222,11 +300,9 @@ if (is_metaconsole() === true) {
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$sec = 'gusuarios';
|
$sec = 'gusuarios';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((bool) $config['user_can_update_info'] === true) {
|
if ((bool) $config['user_can_update_info'] === true) {
|
||||||
$view_mode = false;
|
$view_mode = false;
|
||||||
} else {
|
} else {
|
||||||
@ -348,8 +424,10 @@ if ($create_user === true) {
|
|||||||
$values['data_section'] = $dashboard;
|
$values['data_section'] = $dashboard;
|
||||||
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
|
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
|
||||||
$values['data_section'] = $visual_console;
|
$values['data_section'] = $visual_console;
|
||||||
} else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
} else if ($values['section'] === HOME_SCREEN_OTHER) {
|
||||||
$values['data_section'] = get_parameter('data_section');
|
$values['data_section'] = get_parameter('data_section_other');
|
||||||
|
} else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
||||||
|
$values['data_section'] = get_parameter('data_section_external');
|
||||||
}
|
}
|
||||||
|
|
||||||
// $values['section'] = $homeScreenValues[$values['section']];
|
// $values['section'] = $homeScreenValues[$values['section']];
|
||||||
@ -596,8 +674,11 @@ if ($update_user) {
|
|||||||
$values['email'] = (string) get_parameter('email');
|
$values['email'] = (string) get_parameter('email');
|
||||||
$values['phone'] = (string) get_parameter('phone');
|
$values['phone'] = (string) get_parameter('phone');
|
||||||
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
|
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
|
||||||
|
if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||||
$values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0);
|
$values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0);
|
||||||
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list'))));
|
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list'))));
|
||||||
|
}
|
||||||
|
|
||||||
$values['is_admin'] = (get_parameter('is_admin', 0) === 0) ? 0 : 1;
|
$values['is_admin'] = (get_parameter('is_admin', 0) === 0) ? 0 : 1;
|
||||||
$values['language'] = (string) get_parameter('language');
|
$values['language'] = (string) get_parameter('language');
|
||||||
$values['timezone'] = (string) get_parameter('timezone');
|
$values['timezone'] = (string) get_parameter('timezone');
|
||||||
@ -643,8 +724,10 @@ if ($update_user) {
|
|||||||
$values['data_section'] = $dashboard;
|
$values['data_section'] = $dashboard;
|
||||||
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
|
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
|
||||||
$values['data_section'] = $visual_console;
|
$values['data_section'] = $visual_console;
|
||||||
} else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
} else if ($values['section'] === HOME_SCREEN_OTHER) {
|
||||||
$values['data_section'] = get_parameter('data_section');
|
$values['data_section'] = get_parameter('data_section_other');
|
||||||
|
} else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
||||||
|
$values['data_section'] = get_parameter('data_section_external');
|
||||||
}
|
}
|
||||||
|
|
||||||
// $values['section'] = $homeScreenValues[$values['section']];
|
// $values['section'] = $homeScreenValues[$values['section']];
|
||||||
@ -686,6 +769,9 @@ if ($update_user) {
|
|||||||
$id_user = (string) get_parameter('id_user', '');
|
$id_user = (string) get_parameter('id_user', '');
|
||||||
|
|
||||||
if ($password_new != '') {
|
if ($password_new != '') {
|
||||||
|
if ($config['auth'] !== 'mysql') {
|
||||||
|
ui_print_error_message(__('It is not possible to change the password because external authentication is being used'));
|
||||||
|
} else {
|
||||||
$correct_password = false;
|
$correct_password = false;
|
||||||
|
|
||||||
$user_credentials_check = process_user_login($id_user, $own_password_confirm, true);
|
$user_credentials_check = process_user_login($id_user, $own_password_confirm, true);
|
||||||
@ -778,6 +864,7 @@ if ($update_user) {
|
|||||||
);
|
);
|
||||||
ui_print_error_message(__('Passwords does not match'));
|
ui_print_error_message(__('Passwords does not match'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$has_skin = false;
|
$has_skin = false;
|
||||||
$has_wizard = false;
|
$has_wizard = false;
|
||||||
@ -862,89 +949,6 @@ if ($update_user) {
|
|||||||
$user_info = $values;
|
$user_info = $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($delete_profile) {
|
|
||||||
$id2 = (string) get_parameter('id_user');
|
|
||||||
$id_up = (int) get_parameter('id_user_profile');
|
|
||||||
$perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up);
|
|
||||||
$id_perfil = $perfilUser['id_perfil'];
|
|
||||||
$perfil = db_get_row('tperfil', 'id_perfil', $id_perfil);
|
|
||||||
|
|
||||||
db_pandora_audit(
|
|
||||||
AUDIT_LOG_USER_MANAGEMENT,
|
|
||||||
'Deleted profile for user '.io_safe_output($id2),
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
'The profile with id '.$id_perfil.' in the group '.$perfilUser['id_grupo']
|
|
||||||
);
|
|
||||||
|
|
||||||
$return = profile_delete_user_profile($id2, $id_up);
|
|
||||||
ui_print_result_message(
|
|
||||||
$return,
|
|
||||||
__('Successfully deleted'),
|
|
||||||
__('Could not be deleted')
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id2);
|
|
||||||
$user_is_global_admin = users_is_admin($id2);
|
|
||||||
|
|
||||||
if ($has_profile === false && $user_is_global_admin === false) {
|
|
||||||
$result = delete_user($id2);
|
|
||||||
|
|
||||||
if ($result === true) {
|
|
||||||
db_pandora_audit(
|
|
||||||
AUDIT_LOG_USER_MANAGEMENT,
|
|
||||||
__('Deleted user %s', io_safe_output($id_user))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui_print_result_message(
|
|
||||||
$result,
|
|
||||||
__('Successfully deleted'),
|
|
||||||
__('There was a problem deleting the user')
|
|
||||||
);
|
|
||||||
|
|
||||||
// Delete the user in all the consoles.
|
|
||||||
if (is_metaconsole() === true) {
|
|
||||||
$servers = metaconsole_get_servers();
|
|
||||||
foreach ($servers as $server) {
|
|
||||||
// Connect to the remote console.
|
|
||||||
metaconsole_connect($server);
|
|
||||||
|
|
||||||
// Delete the user.
|
|
||||||
$result = delete_user($id_user);
|
|
||||||
if ($result === true) {
|
|
||||||
db_pandora_audit(
|
|
||||||
AUDIT_LOG_USER_MANAGEMENT,
|
|
||||||
__('Deleted user %s from metaconsole', io_safe_output($id_user))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restore the db connection.
|
|
||||||
metaconsole_restore_db();
|
|
||||||
|
|
||||||
// Log to the metaconsole too.
|
|
||||||
if ($result === true) {
|
|
||||||
db_pandora_audit(
|
|
||||||
AUDIT_LOG_USER_MANAGEMENT,
|
|
||||||
__(
|
|
||||||
'Deleted user %s from %s',
|
|
||||||
io_safe_input($id_user),
|
|
||||||
io_safe_input($server['server_name'])
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui_print_result_message(
|
|
||||||
$result,
|
|
||||||
__('Successfully deleted from %s', io_safe_input($server['server_name'])),
|
|
||||||
__('There was a problem deleting the user from %s', io_safe_input($server['server_name']))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int) $status !== -1) {
|
if ((int) $status !== -1) {
|
||||||
ui_print_result_message(
|
ui_print_result_message(
|
||||||
$status,
|
$status,
|
||||||
@ -1155,6 +1159,13 @@ if (is_user_admin($id) === true) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html_print_div(
|
||||||
|
[
|
||||||
|
'id' => 'delete_profile_modal',
|
||||||
|
'content' => '',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
$full_name = ' <div class="label_select_simple">'.html_print_input_text_extended(
|
$full_name = ' <div class="label_select_simple">'.html_print_input_text_extended(
|
||||||
'fullname',
|
'fullname',
|
||||||
$user_info['fullname'],
|
$user_info['fullname'],
|
||||||
@ -1929,22 +1940,85 @@ if (is_metaconsole() === false) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('input:image[name="del"]').click(function(e) {
|
$('input:image[name="del"]').click(function(e) {
|
||||||
if ($(json_profile).length > 0) return;
|
|
||||||
if (!confirm('Are you sure?')) return;
|
|
||||||
e.preventDefault();
|
|
||||||
var rows = $("#table_profiles tr").length;
|
|
||||||
if (((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
|
|
||||||
if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
var rows = $("#table_profiles tr").length;
|
||||||
|
let deleteuser = 0;
|
||||||
|
e.preventDefault();
|
||||||
var id_user_profile = $(this).siblings();
|
var id_user_profile = $(this).siblings();
|
||||||
id_user_profile = id_user_profile[1].value;
|
id_user_profile = id_user_profile[1].value;
|
||||||
var row = $(this).closest('tr');
|
var row = $(this).closest('tr');
|
||||||
|
|
||||||
|
if (((is_metaconsole === '1' && rows <= 3) || (is_metaconsole !== '1' && rows <= 3)) && user_is_global_admin !== '1') {
|
||||||
|
$("#delete_profile_modal")
|
||||||
|
.empty()
|
||||||
|
.html("<?php echo __('Deleting this profile will leave your user without a profile or group. You can continue by deleting the user or preserving it.'); ?>");
|
||||||
|
// Set the title.
|
||||||
|
$("#delete_profile_modal").prop("title", "<?php echo __('Are you sure?'); ?>");
|
||||||
|
// Build the dialog for show the mesage.
|
||||||
|
$("#delete_profile_modal").dialog({
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
modal: true,
|
||||||
|
width: 500,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: "Cancel",
|
||||||
|
click: function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Delete",
|
||||||
|
click: function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
deleteuser = 1;
|
||||||
|
delete_user_profile(id_user_profile, row, id_user, deleteuser);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Preserve",
|
||||||
|
click: function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
deleteuser = 0;
|
||||||
|
delete_user_profile(id_user_profile, row, id_user, deleteuser)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
overlay: {
|
||||||
|
opacity: 0.5,
|
||||||
|
background: "black"
|
||||||
|
},
|
||||||
|
closeOnEscape: false,
|
||||||
|
open: function(event, ui) {
|
||||||
|
$(".ui-dialog-titlebar-close").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (((is_metaconsole === '1' && rows <= 3) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
|
||||||
|
if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
delete_user_profile(id_user_profile, row, id_user, deleteuser);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!confirm('Are you sure?')) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
delete_user_profile(id_user_profile, row, id_user, deleteuser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($(json_profile).length > 0) return;
|
||||||
|
});
|
||||||
|
|
||||||
|
function delete_user_profile(id_user_profile, row, id_user, deleteuser){
|
||||||
var params = [];
|
var params = [];
|
||||||
params.push("delete_profile=1");
|
params.push("delete_profile=1");
|
||||||
|
params.push("edit_user=1");
|
||||||
|
params.push("delete_user=" + deleteuser);
|
||||||
params.push("id_user=" + id_user);
|
params.push("id_user=" + id_user);
|
||||||
params.push("id_user_profile=" + id_user_profile);
|
params.push("id_user_profile=" + id_user_profile);
|
||||||
params.push("page=godmode/users/configure_user");
|
params.push("page=godmode/users/configure_user");
|
||||||
@ -1955,15 +2029,14 @@ if (is_metaconsole() === false) {
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
row.remove();
|
row.remove();
|
||||||
var rows = $("#table_profiles tr").length;
|
var rows = $("#table_profiles tr").length;
|
||||||
|
if (is_metaconsole === '' && rows <= 2 && user_is_global_admin !== '1' && deleteuser == '1') {
|
||||||
if (is_metaconsole === '' && rows <= 2 && user_is_global_admin !== '1') {
|
|
||||||
window.location.replace("<?php echo ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0', false, false, false); ?>");
|
window.location.replace("<?php echo ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0', false, false, false); ?>");
|
||||||
} else if (is_metaconsole === '1' && rows <= 3 && user_is_global_admin !== '1') {
|
} else if (is_metaconsole === '1' && rows <= 2 && user_is_global_admin !== '1' && deleteuser == '1') {
|
||||||
window.location.replace("<?php echo ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup', false, false, true); ?>");
|
window.location.replace("<?php echo ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup', false, false, true); ?>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
function checkProfiles(e) {
|
function checkProfiles(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -81,6 +81,11 @@ $customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select(
|
|||||||
false,
|
false,
|
||||||
'width: 100%'
|
'width: 100%'
|
||||||
);
|
);
|
||||||
|
// Home screen. Visual consoles.
|
||||||
|
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
|
||||||
|
// Home screen. External link and Other.
|
||||||
|
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section_external', $user_info['data_section'], '', 60, 255, true);
|
||||||
|
$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section_other', $user_info['data_section'], '', 60, 255, true);
|
||||||
|
|
||||||
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
||||||
$layouts_aux = [];
|
$layouts_aux = [];
|
||||||
@ -327,7 +332,7 @@ $passwordManageTable->data = [];
|
|||||||
|
|
||||||
$passwordManageTable->data['captions_newpassword'][0] = __('New password');
|
$passwordManageTable->data['captions_newpassword'][0] = __('New password');
|
||||||
$passwordManageTable->rowclass['fields_newpassword'] = 'w540px';
|
$passwordManageTable->rowclass['fields_newpassword'] = 'w540px';
|
||||||
$passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_extended(
|
$passwordManageTable->data['fields_newpassword'][0] = '<div class="relative container-div-input-password ">'.html_print_input_text_extended(
|
||||||
'password_new',
|
'password_new',
|
||||||
'',
|
'',
|
||||||
'password_new',
|
'password_new',
|
||||||
@ -337,16 +342,17 @@ $passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_exte
|
|||||||
$view_mode,
|
$view_mode,
|
||||||
'',
|
'',
|
||||||
[
|
[
|
||||||
'class' => 'input w100p',
|
'class' => 'input',
|
||||||
'placeholder' => __('Password'),
|
'placeholder' => __('Password'),
|
||||||
|
'style' => 'width: 540px',
|
||||||
],
|
],
|
||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
);
|
).'</div>';
|
||||||
|
|
||||||
$passwordManageTable->data['captions_repeatpassword'][0] = __('Repeat new password');
|
$passwordManageTable->data['captions_repeatpassword'][0] = __('Repeat new password');
|
||||||
$passwordManageTable->rowclass['fields_repeatpassword'] = 'w540px';
|
$passwordManageTable->rowclass['fields_repeatpassword'] = 'w540px';
|
||||||
$passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_extended(
|
$passwordManageTable->data['fields_repeatpassword'][0] = '<div class="relative container-div-input-password ">'.html_print_input_text_extended(
|
||||||
'password_confirm',
|
'password_confirm',
|
||||||
'',
|
'',
|
||||||
'password_conf',
|
'password_conf',
|
||||||
@ -358,10 +364,11 @@ $passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_e
|
|||||||
[
|
[
|
||||||
'class' => 'input w100p',
|
'class' => 'input w100p',
|
||||||
'placeholder' => __('Password confirmation'),
|
'placeholder' => __('Password confirmation'),
|
||||||
|
'style' => 'width: 540px',
|
||||||
],
|
],
|
||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
);
|
).'</div>';
|
||||||
|
|
||||||
if ($new_user === false && users_is_admin() === false) {
|
if ($new_user === false && users_is_admin() === false) {
|
||||||
$passwordManageTable->data['captions_currentpassword'][0] = __('Current password');
|
$passwordManageTable->data['captions_currentpassword'][0] = __('Current password');
|
||||||
@ -857,10 +864,35 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
|
|||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
$userManagementTable->data['captions_addSettings'][1] = __('Login allowed IP list');
|
if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||||
$userManagementTable->data['fields_addSettings'][1] = html_print_div(
|
$allowAllIpsContent = [];
|
||||||
|
$allowAllIpsContent[] = '<span>'.__('Enable IP allowlist').'</span>';
|
||||||
|
$allowAllIpsContent[] = html_print_div(
|
||||||
[
|
[
|
||||||
'class' => 'edit_user_allowed_ip',
|
'content' => html_print_checkbox_switch(
|
||||||
|
'allowed_ip_active',
|
||||||
|
0,
|
||||||
|
($user_info['allowed_ip_active'] ?? 0),
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
'handleIpAllowlist(this)'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$userManagementTable->data['captions_addSettings'][1] = html_print_div(
|
||||||
|
[
|
||||||
|
'class' => 'margin-top-10',
|
||||||
|
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||||
|
'content' => implode('', $allowAllIpsContent),
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
||||||
|
[
|
||||||
|
'class' => 'edit_user_allowed_ip '.(((int) $user_info['allowed_ip_active'] === 1) ? '' : 'invisible'),
|
||||||
'content' => html_print_textarea(
|
'content' => html_print_textarea(
|
||||||
'allowed_ip_list',
|
'allowed_ip_list',
|
||||||
5,
|
5,
|
||||||
@ -871,36 +903,17 @@ $userManagementTable->data['fields_addSettings'][1] = html_print_div(
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder(
|
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder(
|
||||||
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
||||||
true
|
true,
|
||||||
);
|
|
||||||
|
|
||||||
$allowAllIpsContent = [];
|
|
||||||
$allowAllIpsContent[] = '<span>'.__('Allow all IPs').'</span>';
|
|
||||||
$allowAllIpsContent[] = html_print_div(
|
|
||||||
[
|
[
|
||||||
'content' => html_print_checkbox_switch(
|
'id' => 'info_allowed_ip',
|
||||||
'allowed_ip_active',
|
'class' => ((int) $user_info['allowed_ip_active'] === 1) ? 'input_sub_placeholder' : 'input_sub_placeholder invisible',
|
||||||
0,
|
]
|
||||||
($user_info['allowed_ip_active'] ?? 0),
|
);
|
||||||
true
|
}
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'margin-top-10',
|
|
||||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
|
||||||
'content' => implode('', $allowAllIpsContent),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
if ($config['ITSM_enabled'] && $config['ITSM_user_level_conf']) {
|
if ($config['ITSM_enabled'] && $config['ITSM_user_level_conf']) {
|
||||||
// Pandora ITSM user remote login.
|
// Pandora ITSM user remote login.
|
||||||
@ -1038,4 +1051,14 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function handleIpAllowlist(e){
|
||||||
|
if(e.checked === true) {
|
||||||
|
$('.edit_user_allowed_ip').show();
|
||||||
|
$('#info_allowed_ip').show();
|
||||||
|
} else {
|
||||||
|
$('.edit_user_allowed_ip').hide();
|
||||||
|
$('#info_allowed_ip').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
14
pandora_console/images/desacoplar-ventana.svg
Normal file
14
pandora_console/images/desacoplar-ventana.svg
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Icons/Dark/20/desacoplar-ventana</title>
|
||||||
|
<g id="Icons/Dark/20/desacoplar-ventana" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="Back" transform="translate(3, 1)">
|
||||||
|
<rect id="Rectangle-2" stroke="#3F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x="0" y="0" width="20" height="16" rx="1"></rect>
|
||||||
|
<path d="M3,4 C3.55228475,4 4,3.55228475 4,3 C4,2.44771525 3.55228475,2 3,2 C2.44771525,2 2,2.44771525 2,3 C2,3.55228475 2.44771525,4 3,4 Z M6,4 C6.55228475,4 7,3.55228475 7,3 C7,2.44771525 6.55228475,2 6,2 C5.44771525,2 5,2.44771525 5,3 C5,3.55228475 5.44771525,4 6,4 Z M9,4 C9.55228475,4 10,3.55228475 10,3 C10,2.44771525 9.55228475,2 9,2 C8.44771525,2 8,2.44771525 8,3 C8,3.55228475 8.44771525,4 9,4 Z" id="Oval-2" fill="#3F3F3F"></path>
|
||||||
|
</g>
|
||||||
|
<g id="Front" transform="translate(0, 8)">
|
||||||
|
<rect id="Rectangle-2" fill="#3F3F3F" x="0" y="0" width="20" height="16" rx="1"></rect>
|
||||||
|
<path d="M3,4 C3.55228475,4 4,3.55228475 4,3 C4,2.44771525 3.55228475,2 3,2 C2.44771525,2 2,2.44771525 2,3 C2,3.55228475 2.44771525,4 3,4 Z M6,4 C6.55228475,4 7,3.55228475 7,3 C7,2.44771525 6.55228475,2 6,2 C5.44771525,2 5,2.44771525 5,3 C5,3.55228475 5.44771525,4 6,4 Z M9,4 C9.55228475,4 10,3.55228475 10,3 C10,2.44771525 9.55228475,2 9,2 C8.44771525,2 8,2.44771525 8,3 C8,3.55228475 8.44771525,4 9,4 Z" id="Oval-2" fill="#FFFFFF"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
7
pandora_console/images/minimizar.svg
Normal file
7
pandora_console/images/minimizar.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Icons/Dark/20/minimizar</title>
|
||||||
|
<g id="Icons/Dark/20/minimizar" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<rect id="Rectangle" fill="#3F3F3F" x="2" y="18" width="20" height="4" rx="2"></rect>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 436 B |
@ -435,6 +435,7 @@ if ($get_agent_alerts_datatable === true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$idGroup = $filter_alert['ag_group'];
|
$idGroup = $filter_alert['ag_group'];
|
||||||
|
$search_sg = $filter_alert['search_sg'];
|
||||||
$tag_filter = $filter_alert['tag'];
|
$tag_filter = $filter_alert['tag'];
|
||||||
$action_filter = $filter_alert['action'];
|
$action_filter = $filter_alert['action'];
|
||||||
|
|
||||||
@ -658,10 +659,9 @@ if ($get_agent_alerts_datatable === true) {
|
|||||||
$id_groups = array_keys(
|
$id_groups = array_keys(
|
||||||
users_get_groups($config['id_user'], 'AR', false)
|
users_get_groups($config['id_user'], 'AR', false)
|
||||||
);
|
);
|
||||||
|
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, $search_sg);
|
||||||
|
|
||||||
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
|
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, $search_sg);
|
||||||
|
|
||||||
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($idAgent !== 0) {
|
if ($idAgent !== 0) {
|
||||||
@ -673,9 +673,9 @@ if ($get_agent_alerts_datatable === true) {
|
|||||||
users_get_groups($config['id_user'], $access, false)
|
users_get_groups($config['id_user'], $access, false)
|
||||||
);
|
);
|
||||||
|
|
||||||
$alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, false);
|
$alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, false, $search_sg);
|
||||||
|
|
||||||
$countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, false);
|
$countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, false, $search_sg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,10 +99,26 @@ if ($method === 'draw') {
|
|||||||
|
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
|
|
||||||
|
$where_name = '';
|
||||||
if (strlen($filter['free_search']) > 0) {
|
if (strlen($filter['free_search']) > 0) {
|
||||||
$where = 'WHERE name LIKE "%'.$filter['free_search'].'%"';
|
$where_name = 'name LIKE "%'.$filter['free_search'].'%"';
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
$where_group = '';
|
||||||
|
if (empty($filter['group']) === false && $filter['group'] !== '0') {
|
||||||
|
$where_group = sprintf('id_group = %s', $filter['group']);
|
||||||
|
if (empty($where_name) === false) {
|
||||||
|
$where_group = 'AND '.$where_group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$where = '';
|
$where = '';
|
||||||
|
if (empty($where_name) === false || empty($where_group) === false) {
|
||||||
|
$where = sprintf(
|
||||||
|
'WHERE %s %s',
|
||||||
|
$where_name,
|
||||||
|
$where_group
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM tdashboard '.$where.' ORDER BY id '.$pagination;
|
$sql = 'SELECT * FROM tdashboard '.$where.' ORDER BY id '.$pagination;
|
||||||
|
@ -92,6 +92,9 @@ $get_id_source_event = get_parameter('get_id_source_event');
|
|||||||
$node_id = (int) get_parameter('node_id', 0);
|
$node_id = (int) get_parameter('node_id', 0);
|
||||||
$settings_modal = get_parameter('settings', 0);
|
$settings_modal = get_parameter('settings', 0);
|
||||||
$parameters_modal = get_parameter('parameters', 0);
|
$parameters_modal = get_parameter('parameters', 0);
|
||||||
|
$update_event_custom_id = get_parameter('update_event_custom_id', 0);
|
||||||
|
$draw_events_graph = get_parameter('drawEventsGraph', false);
|
||||||
|
|
||||||
// User private filter.
|
// User private filter.
|
||||||
$current_filter = get_parameter('current_filter', 0);
|
$current_filter = get_parameter('current_filter', 0);
|
||||||
$private_filter_event = get_parameter('private_filter_event', 0);
|
$private_filter_event = get_parameter('private_filter_event', 0);
|
||||||
@ -311,6 +314,7 @@ if ($save_event_filter) {
|
|||||||
$values['severity'] = implode(',', get_parameter('severity', -1));
|
$values['severity'] = implode(',', get_parameter('severity', -1));
|
||||||
$values['status'] = get_parameter('status');
|
$values['status'] = get_parameter('status');
|
||||||
$values['search'] = get_parameter('search');
|
$values['search'] = get_parameter('search');
|
||||||
|
$values['regex'] = get_parameter('regex');
|
||||||
$values['not_search'] = get_parameter('not_search');
|
$values['not_search'] = get_parameter('not_search');
|
||||||
$values['text_agent'] = get_parameter('text_agent');
|
$values['text_agent'] = get_parameter('text_agent');
|
||||||
$values['id_agent'] = get_parameter('id_agent');
|
$values['id_agent'] = get_parameter('id_agent');
|
||||||
@ -379,6 +383,7 @@ if ($update_event_filter) {
|
|||||||
$values['severity'] = implode(',', get_parameter('severity', -1));
|
$values['severity'] = implode(',', get_parameter('severity', -1));
|
||||||
$values['status'] = get_parameter('status');
|
$values['status'] = get_parameter('status');
|
||||||
$values['search'] = get_parameter('search');
|
$values['search'] = get_parameter('search');
|
||||||
|
$values['regex'] = get_parameter('regex');
|
||||||
$values['not_search'] = get_parameter('not_search');
|
$values['not_search'] = get_parameter('not_search');
|
||||||
$values['text_agent'] = get_parameter('text_agent');
|
$values['text_agent'] = get_parameter('text_agent');
|
||||||
$values['id_agent'] = get_parameter('id_agent');
|
$values['id_agent'] = get_parameter('id_agent');
|
||||||
@ -638,6 +643,8 @@ function load_form_filter() {
|
|||||||
$("#status").val(val);
|
$("#status").val(val);
|
||||||
if (i == 'search')
|
if (i == 'search')
|
||||||
$('#text-search').val(val);
|
$('#text-search').val(val);
|
||||||
|
if (i == 'regex')
|
||||||
|
$('#text-regex').val(val);
|
||||||
if (i == 'not_search')
|
if (i == 'not_search')
|
||||||
$('#checkbox-not_search').val(val);
|
$('#checkbox-not_search').val(val);
|
||||||
if (i == 'text_agent')
|
if (i == 'text_agent')
|
||||||
@ -968,6 +975,7 @@ function save_new_filter() {
|
|||||||
"severity" : $("#severity").val(),
|
"severity" : $("#severity").val(),
|
||||||
"status" : $("#status").val(),
|
"status" : $("#status").val(),
|
||||||
"search" : $("#text-search").val(),
|
"search" : $("#text-search").val(),
|
||||||
|
"regex" : $('#text-regex').val(),
|
||||||
"not_search" : $("#checkbox-not_search").val(),
|
"not_search" : $("#checkbox-not_search").val(),
|
||||||
"text_agent" : $("#text_id_agent").val(),
|
"text_agent" : $("#text_id_agent").val(),
|
||||||
"id_agent" : $('input:hidden[name=id_agent]').val(),
|
"id_agent" : $('input:hidden[name=id_agent]').val(),
|
||||||
@ -1048,6 +1056,7 @@ function save_update_filter() {
|
|||||||
"severity" : $("#severity").val(),
|
"severity" : $("#severity").val(),
|
||||||
"status" : $("#status").val(),
|
"status" : $("#status").val(),
|
||||||
"search" : $("#text-search").val(),
|
"search" : $("#text-search").val(),
|
||||||
|
"regex" : $('#text-regex').val(),
|
||||||
"not_search" : $("#checkbox-not_search").val(),
|
"not_search" : $("#checkbox-not_search").val(),
|
||||||
"text_agent" : $("#text_id_agent").val(),
|
"text_agent" : $("#text_id_agent").val(),
|
||||||
"id_agent" : $('input:hidden[name=id_agent]').val(),
|
"id_agent" : $('input:hidden[name=id_agent]').val(),
|
||||||
@ -2642,6 +2651,8 @@ if ($get_events_fired) {
|
|||||||
$filter['date_to'] = date('Y-m-d', $end);
|
$filter['date_to'] = date('Y-m-d', $end);
|
||||||
$filter['time_from'] = date('H:i:s', $start);
|
$filter['time_from'] = date('H:i:s', $start);
|
||||||
$filter['time_to'] = date('H:i:s', $end);
|
$filter['time_to'] = date('H:i:s', $end);
|
||||||
|
$filter['severity'] = explode(',', $filter['severity']);
|
||||||
|
|
||||||
$data = events_get_all(
|
$data = events_get_all(
|
||||||
['te.*'],
|
['te.*'],
|
||||||
$filter
|
$filter
|
||||||
@ -2751,3 +2762,56 @@ if ($draw_row_response_info === true) {
|
|||||||
echo $output;
|
echo $output;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($update_event_custom_id) {
|
||||||
|
$event_custom_id = get_parameter('event_custom_id');
|
||||||
|
$event_id = get_parameter('event_id');
|
||||||
|
$server_id = 0;
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$server_id = (int) get_parameter('server_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Safe custom fields for hacks.
|
||||||
|
if (preg_match('/script/i', io_safe_output($event_custom_id))) {
|
||||||
|
$return = false;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
if (is_metaconsole() === true
|
||||||
|
&& $server_id > 0
|
||||||
|
) {
|
||||||
|
$node = new Node($server_id);
|
||||||
|
$node->connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
$return = events_event_custom_id(
|
||||||
|
$event_id,
|
||||||
|
$event_custom_id
|
||||||
|
);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
// Unexistent agent.
|
||||||
|
if (is_metaconsole() === true
|
||||||
|
&& $server_id > 0
|
||||||
|
) {
|
||||||
|
$node->disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
$return = false;
|
||||||
|
} finally {
|
||||||
|
if (is_metaconsole() === true
|
||||||
|
&& $server_id > 0
|
||||||
|
) {
|
||||||
|
$node->disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo ($return === true) ? 'update_ok' : 'update_error';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((bool) $draw_events_graph === true) {
|
||||||
|
$filter = get_parameter('filter');
|
||||||
|
$output = event_print_graph($filter);
|
||||||
|
echo $output;
|
||||||
|
return;
|
||||||
|
}
|
@ -35,6 +35,7 @@ if (check_login()) {
|
|||||||
include_once $config['homedir'].'/include/functions_agents.php';
|
include_once $config['homedir'].'/include/functions_agents.php';
|
||||||
include_once $config['homedir'].'/include/functions_modules.php';
|
include_once $config['homedir'].'/include/functions_modules.php';
|
||||||
include_once $config['homedir'].'/include/functions_ui.php';
|
include_once $config['homedir'].'/include/functions_ui.php';
|
||||||
|
include_once $config['homedir'].'/include/functions_macros.php';
|
||||||
enterprise_include_once('include/functions_metaconsole.php');
|
enterprise_include_once('include/functions_metaconsole.php');
|
||||||
|
|
||||||
$get_plugin_macros = get_parameter('get_plugin_macros');
|
$get_plugin_macros = get_parameter('get_plugin_macros');
|
||||||
@ -1168,7 +1169,9 @@ if (check_login()) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data[2] .= '<a href ="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&id_agent_module='.$module['id_agente_modulo'].'&edit_module='.$module['id_modulo'].'">';
|
||||||
$data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '…', 'font-size: 9pt;');
|
$data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '…', 'font-size: 9pt;');
|
||||||
|
$data[2] .= '</a>';
|
||||||
if (empty($module['extended_info']) === false) {
|
if (empty($module['extended_info']) === false) {
|
||||||
$data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png');
|
$data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png');
|
||||||
}
|
}
|
||||||
@ -1204,8 +1207,24 @@ if (check_login()) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (strlen($module['ip_target']) !== 0) {
|
if (strlen($module['ip_target']) !== 0) {
|
||||||
|
// Check if value is custom field.
|
||||||
|
if ($module['ip_target'][0] == '_' && $module['ip_target'][(strlen($module['ip_target']) - 1)] == '_') {
|
||||||
|
$custom_field_name = substr($module['ip_target'], 1, -1);
|
||||||
|
$custom_value = agents_get_agent_custom_field($id_agente, $custom_field_name);
|
||||||
|
if (isset($custom_value) && $custom_value !== false) {
|
||||||
|
$title .= '<br/>IP: '.$custom_value;
|
||||||
|
} else {
|
||||||
|
$array_macros = return_agent_macros($id_agente);
|
||||||
|
if (isset($array_macros[$module['ip_target']])) {
|
||||||
|
$title .= '<br/>IP: '.$array_macros[$module['ip_target']];
|
||||||
|
} else {
|
||||||
$title .= '<br/>IP: '.$module['ip_target'];
|
$title .= '<br/>IP: '.$module['ip_target'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$title .= '<br/>IP: '.$module['ip_target'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$last_status_change_text = __('Time elapsed since last status change: ');
|
$last_status_change_text = __('Time elapsed since last status change: ');
|
||||||
$last_status_change_text .= (empty($module['last_status_change']) === false) ? human_time_comparation($module['last_status_change']) : __('N/A');
|
$last_status_change_text .= (empty($module['last_status_change']) === false) ? human_time_comparation($module['last_status_change']) : __('N/A');
|
||||||
@ -1361,10 +1380,12 @@ if (check_login()) {
|
|||||||
$additionalLinkAction = '&flag=1';
|
$additionalLinkAction = '&flag=1';
|
||||||
$linkCaption = __('Force checks');
|
$linkCaption = __('Force checks');
|
||||||
$imgaction = 'images/force@svg.svg';
|
$imgaction = 'images/force@svg.svg';
|
||||||
|
$visibility = '';
|
||||||
} else {
|
} else {
|
||||||
$additionalLinkAction = '';
|
$additionalLinkAction = '';
|
||||||
$linkCaption = __('Refresh');
|
$linkCaption = __('Refresh');
|
||||||
$imgaction = 'images/go-back@svg.svg';
|
$imgaction = 'images/go-back@svg.svg';
|
||||||
|
$visibility = 'visibility: initial;';
|
||||||
}
|
}
|
||||||
|
|
||||||
$moduleActionButtons[] = html_print_anchor(
|
$moduleActionButtons[] = html_print_anchor(
|
||||||
@ -1376,6 +1397,7 @@ if (check_login()) {
|
|||||||
[
|
[
|
||||||
'title' => __('Force remote check'),
|
'title' => __('Force remote check'),
|
||||||
'class' => 'main_menu_icon forced_title',
|
'class' => 'main_menu_icon forced_title',
|
||||||
|
'style' => $visibility,
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -38,6 +38,10 @@ if ($change_label === '1') {
|
|||||||
$source = get_parameter('source', 0);
|
$source = get_parameter('source', 0);
|
||||||
$user = get_parameter('user', '');
|
$user = get_parameter('user', '');
|
||||||
$value = get_parameter('value', 0) ? 1 : 0;
|
$value = get_parameter('value', 0) ? 1 : 0;
|
||||||
|
$user_info = get_user_info($config['id_user']);
|
||||||
|
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Update the label value.
|
// Update the label value.
|
||||||
ob_clean();
|
ob_clean();
|
||||||
|
@ -59,6 +59,7 @@ if (is_ajax() === true) {
|
|||||||
$metaID = (int) get_parameter('metaID', 0);
|
$metaID = (int) get_parameter('metaID', 0);
|
||||||
$childrenMethod = get_parameter('childrenMethod', 'on_demand');
|
$childrenMethod = get_parameter('childrenMethod', 'on_demand');
|
||||||
|
|
||||||
|
|
||||||
$default_filters = [
|
$default_filters = [
|
||||||
'searchAgent' => '',
|
'searchAgent' => '',
|
||||||
'statusAgent' => AGENT_STATUS_ALL,
|
'statusAgent' => AGENT_STATUS_ALL,
|
||||||
@ -69,6 +70,7 @@ if (is_ajax() === true) {
|
|||||||
];
|
];
|
||||||
$filter = get_parameter('filter', $default_filters);
|
$filter = get_parameter('filter', $default_filters);
|
||||||
|
|
||||||
|
|
||||||
$agent_a = check_acl($config['id_user'], 0, 'AR');
|
$agent_a = check_acl($config['id_user'], 0, 'AR');
|
||||||
$agent_w = check_acl($config['id_user'], 0, 'AW');
|
$agent_w = check_acl($config['id_user'], 0, 'AW');
|
||||||
$access = ($agent_a === true) ? 'AR' : (($agent_w === true) ? 'AW' : 'AR');
|
$access = ($agent_a === true) ? 'AR' : (($agent_w === true) ? 'AW' : 'AR');
|
||||||
|
@ -70,8 +70,7 @@ $otherSerialize = get_parameter('other');
|
|||||||
$otherMode = get_parameter('other_mode', 'url_encode');
|
$otherMode = get_parameter('other_mode', 'url_encode');
|
||||||
$returnType = get_parameter('return_type', 'string');
|
$returnType = get_parameter('return_type', 'string');
|
||||||
$info = get_parameter('info', '');
|
$info = get_parameter('info', '');
|
||||||
$raw_decode = (bool) get_parameter('raw_decode', false);
|
$raw_decode = (bool) get_parameter('raw_decode', true);
|
||||||
|
|
||||||
$other = parseOtherParameter($otherSerialize, $otherMode, $raw_decode);
|
$other = parseOtherParameter($otherSerialize, $otherMode, $raw_decode);
|
||||||
$apiPassword = io_output_password(
|
$apiPassword = io_output_password(
|
||||||
db_get_value_filter(
|
db_get_value_filter(
|
||||||
|
@ -1,324 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Generate charts with given parameters.
|
|
||||||
*
|
|
||||||
* @category ChartGenerator.
|
|
||||||
* @package Pandora FMS
|
|
||||||
* @subpackage Opensource.
|
|
||||||
* @version 1.0.0
|
|
||||||
* @license See below
|
|
||||||
*
|
|
||||||
* ______ ___ _______ _______ ________
|
|
||||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
|
||||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
|
||||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
|
||||||
*
|
|
||||||
* ============================================================================
|
|
||||||
* Copyright (c) 2005-2023 Pandora FMS
|
|
||||||
* Please see https://pandorafms.com/community/ 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.
|
|
||||||
* ============================================================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Begin.
|
|
||||||
require_once __DIR__.'/config.php';
|
|
||||||
require_once __DIR__.'/functions.php';
|
|
||||||
require_once __DIR__.'/functions_db.php';
|
|
||||||
require_once __DIR__.'/auth/mysql.php';
|
|
||||||
require_once $config['homedir'].'/include/lib/User.php';
|
|
||||||
require_once $config['homedir'].'/include/functions_reporting.php';
|
|
||||||
require_once $config['homedir'].'/include/functions_graph.php';
|
|
||||||
require_once $config['homedir'].'/include/functions_custom_graphs.php';
|
|
||||||
require_once $config['homedir'].'/include/functions_modules.php';
|
|
||||||
require_once $config['homedir'].'/include/functions_agents.php';
|
|
||||||
require_once $config['homedir'].'/include/functions_tags.php';
|
|
||||||
|
|
||||||
$data_raw = get_parameter('data');
|
|
||||||
$data_decoded = json_decode(io_safe_output($data_raw), true);
|
|
||||||
if (json_last_error() === JSON_ERROR_NONE) {
|
|
||||||
$data = $data_decoded['data'];
|
|
||||||
$session_id = $data_decoded['session_id'];
|
|
||||||
$type_graph_pdf = $data_decoded['type_graph_pdf'];
|
|
||||||
$id_user = $data_decoded['id_user'];
|
|
||||||
$slicebar = $data_decoded['slicebar'];
|
|
||||||
$slicebar_value = $data_decoded['slicebar_value'];
|
|
||||||
|
|
||||||
$data_combined = [];
|
|
||||||
if (isset($data_decoded['data_combined']) === true) {
|
|
||||||
$data_combined = $data_decoded['data_combined'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$data_module_list = [];
|
|
||||||
if (isset($data_decoded['data_module_list']) === true) {
|
|
||||||
$data_module_list = $data_decoded['data_module_list'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize session.
|
|
||||||
global $config;
|
|
||||||
|
|
||||||
// Care whit this!!! check_login not working if you remove this.
|
|
||||||
$config['id_user'] = $id_user;
|
|
||||||
$_SESSION['id_usuario'] = $id_user;
|
|
||||||
|
|
||||||
// Checks for server api req.
|
|
||||||
$bypassLogin = false;
|
|
||||||
if ($data_decoded['apipass'] !== null
|
|
||||||
&& ($config['server_unique_identifier'] === $_SESSION['id_usuario'])
|
|
||||||
) {
|
|
||||||
$apiPassword = io_output_password(
|
|
||||||
db_get_value_filter(
|
|
||||||
'value',
|
|
||||||
'tconfig',
|
|
||||||
['token' => 'api_password']
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
if ($apiPassword === $data_decoded['apipass']) {
|
|
||||||
$bypassLogin = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($config[$slicebar])) {
|
|
||||||
$config[$slicebar] = $slicebar_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to initialize session using existing php session id.
|
|
||||||
$user = new PandoraFMS\User(['phpsessionid' => $session_id]);
|
|
||||||
|
|
||||||
if (check_login(false) === false && $bypassLogin !== true) {
|
|
||||||
// Error handler.
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<title>Access denied</title>
|
|
||||||
<link rel="stylesheet" href="styles/pandora.css?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="styles/pandora_minimal.css?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="styles/js/jquery-ui.min.css?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<script language="javascript" type='text/javascript' src='javascript/pandora.js?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Access is not granted</h1>
|
|
||||||
<div id="container-chart-generator-item" style="display:none; margin:0px;width:100px;height:100px;">
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Access granted.
|
|
||||||
$params = $data;
|
|
||||||
if (isset($params['backgroundColor']) === false) {
|
|
||||||
$params['backgroundColor'] = 'inherit';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Metaconsole connection to the node.
|
|
||||||
$server_id = 0;
|
|
||||||
if (isset($params['server_id']) === true) {
|
|
||||||
$server_id = $params['server_id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_metaconsole() === true && empty($server_id) === false) {
|
|
||||||
$server = metaconsole_get_connection_by_id($server_id);
|
|
||||||
// Error connecting.
|
|
||||||
if (metaconsole_connect($server) !== NOERR) {
|
|
||||||
?>
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<?php
|
|
||||||
ui_print_error_message(
|
|
||||||
__('There was a problem connecting with the node')
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
<?php
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$user_language = get_user_language($config['id_user']);
|
|
||||||
if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|
||||||
$cfr = new CachedFileReader('languages/'.$user_language.'.mo');
|
|
||||||
$l10n = new gettext_reader($cfr);
|
|
||||||
$l10n->load_tables();
|
|
||||||
}
|
|
||||||
|
|
||||||
$hack_metaconsole = (is_metaconsole() === true) ? '../../' : '';
|
|
||||||
?>
|
|
||||||
<!DOCTYPE>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<title>Pandora FMS Graph</title>
|
|
||||||
<link rel="stylesheet" href="<?php echo ui_get_full_url($hack_metaconsole.'include/styles/pandora.css'); ?>?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="<?php echo ui_get_full_url($hack_metaconsole.'include/styles/pandora_minimal.css'); ?>?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="<?php echo ui_get_full_url($hack_metaconsole.'include/styles/js/jquery-ui.min.css'); ?>?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="<?php echo ui_get_full_url($hack_metaconsole.'include/styles/js/jquery-ui_custom.css'); ?>?v=<?php echo $config['current_package']; ?>" type="text/css" />
|
|
||||||
<script language="javascript" type='text/javascript' src='<?php echo ui_get_full_url($hack_metaconsole.'include/javascript/pandora_ui.js'); ?>?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
<script language="javascript" type='text/javascript' src='<?php echo ui_get_full_url($hack_metaconsole.'include/javascript/jquery.current.js'); ?>?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
<script language="javascript" type='text/javascript' src='<?php echo ui_get_full_url($hack_metaconsole.'include/javascript/jquery.pandora.js'); ?>?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
<script language="javascript" type='text/javascript' src='<?php echo ui_get_full_url($hack_metaconsole.'include/javascript/jquery-ui.min.js'); ?>?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
<script language="javascript" type='text/javascript' src='<?php echo ui_get_full_url($hack_metaconsole.'include/javascript/pandora.js'); ?>?v=<?php echo $config['current_package']; ?>'></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.time.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.pie.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.crosshair.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.stack.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.selection.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.resize.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.threshold.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.threshold.multiple.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.symbol.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.exportdata.pandora.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.axislabels.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var phpTimezone = "<?php echo date_default_timezone_get(); ?>";
|
|
||||||
</script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/pandora.flot.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/chartjs/chart.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/chartjs/chartjs-plugin-datalabels.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
|
||||||
</head>
|
|
||||||
<body style='width:794px; margin: 0px; background-color: <?php echo $params['backgroundColor']; ?>;'>
|
|
||||||
<?php
|
|
||||||
$params['only_image'] = false;
|
|
||||||
$params['menu'] = false;
|
|
||||||
|
|
||||||
$params['disable_black'] = true;
|
|
||||||
$params_combined = $data_combined;
|
|
||||||
$module_list = $data_module_list;
|
|
||||||
|
|
||||||
$viewport = [
|
|
||||||
'width' => 0,
|
|
||||||
'height' => 0,
|
|
||||||
];
|
|
||||||
|
|
||||||
$style = 'width:100%;';
|
|
||||||
if (isset($params['options']['viewport']) === true) {
|
|
||||||
$viewport = $params['options']['viewport'];
|
|
||||||
if (empty($viewport['width']) === false) {
|
|
||||||
$style .= 'width:'.$viewport['width'].'px;';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($viewport['height']) === false) {
|
|
||||||
$style .= 'height:'.$viewport['height'].'px;';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<div id="container-chart-generator-item" style="'.$style.' margin:0px;">';
|
|
||||||
switch ($type_graph_pdf) {
|
|
||||||
case 'combined':
|
|
||||||
$params['pdf'] = true;
|
|
||||||
$result = graphic_combined_module(
|
|
||||||
$module_list,
|
|
||||||
$params,
|
|
||||||
$params_combined
|
|
||||||
);
|
|
||||||
|
|
||||||
echo $result;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'sparse':
|
|
||||||
$params['pdf'] = true;
|
|
||||||
echo grafico_modulo_sparse($params);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'pie_graph':
|
|
||||||
$params['pdf'] = true;
|
|
||||||
$chart = get_build_setup_charts(
|
|
||||||
'PIE',
|
|
||||||
$params['options'],
|
|
||||||
$params['chart_data']
|
|
||||||
);
|
|
||||||
|
|
||||||
echo $chart->render(true);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'vbar_graph':
|
|
||||||
$params['pdf'] = true;
|
|
||||||
$chart = get_build_setup_charts(
|
|
||||||
'BAR',
|
|
||||||
$params['options'],
|
|
||||||
$params['chart_data']
|
|
||||||
);
|
|
||||||
|
|
||||||
echo $chart->render(true);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'ring_graph':
|
|
||||||
$params['pdf'] = true;
|
|
||||||
$params['options']['width'] = 500;
|
|
||||||
$params['options']['height'] = 500;
|
|
||||||
|
|
||||||
$chart = get_build_setup_charts(
|
|
||||||
'DOUGHNUT',
|
|
||||||
$params['options'],
|
|
||||||
$params['chart_data']
|
|
||||||
);
|
|
||||||
|
|
||||||
echo $chart->render(true);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'line_graph':
|
|
||||||
$params['pdf'] = true;
|
|
||||||
$params['options']['width'] = '100%';
|
|
||||||
$params['options']['height'] = 200;
|
|
||||||
$chart = get_build_setup_charts(
|
|
||||||
'LINE',
|
|
||||||
$params['options'],
|
|
||||||
$params['chart_data']
|
|
||||||
);
|
|
||||||
echo $chart->render(true);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'slicebar':
|
|
||||||
// TO-DO Cambiar esto para que se pase por POST, NO SE PUEDE PASAR POR GET.
|
|
||||||
$params['graph_data'] = json_decode(io_safe_output($config[$params['tokem_config']]), true);
|
|
||||||
delete_config_token($params['tokem_config']);
|
|
||||||
echo flot_slicesbar_graph(
|
|
||||||
$params['graph_data'],
|
|
||||||
$params['period'],
|
|
||||||
$params['width'],
|
|
||||||
$params['height'],
|
|
||||||
$params['legend'],
|
|
||||||
$params['colors'],
|
|
||||||
$params['fontpath'],
|
|
||||||
$params['round_corner'],
|
|
||||||
$params['homeurl'],
|
|
||||||
$params['watermark'],
|
|
||||||
$params['adapt_key'],
|
|
||||||
$params['stat_winalse'],
|
|
||||||
$params['id_agent'],
|
|
||||||
$params['full_legend_daterray'],
|
|
||||||
$params['not_interactive'],
|
|
||||||
$params['ttl'],
|
|
||||||
$params['sizeForTicks'],
|
|
||||||
$params['show'],
|
|
||||||
$params['date_to'],
|
|
||||||
$params['server_id']
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
// Code...
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</div>';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -829,7 +829,35 @@ class AgentWizard extends HTML
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$create_modules_button = '';
|
||||||
|
if ($this->actionType === 'snmp' && $this->version !== null && $this->message['type'][0] !== 'error') {
|
||||||
|
$create_modules_button = html_print_submit_button(
|
||||||
|
__('Create modules'),
|
||||||
|
'create-modules-action',
|
||||||
|
false,
|
||||||
|
[
|
||||||
|
'icon' => 'next',
|
||||||
|
'onclick' => 'processListModules()',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
} else if ($this->actionType === 'wmi' && $this->protocol === 'wmi' && $this->message['type'][0] !== 'error') {
|
||||||
|
$create_modules_button = html_print_submit_button(
|
||||||
|
__('Create modules'),
|
||||||
|
'create-modules-action',
|
||||||
|
false,
|
||||||
|
[
|
||||||
|
'icon' => 'next',
|
||||||
|
'onclick' => 'processListModules()',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$create_modules_button = '';
|
||||||
|
}
|
||||||
|
|
||||||
html_print_action_buttons(
|
html_print_action_buttons(
|
||||||
|
[
|
||||||
html_print_submit_button(
|
html_print_submit_button(
|
||||||
$this->actionLabel,
|
$this->actionLabel,
|
||||||
'sub-protocol',
|
'sub-protocol',
|
||||||
@ -839,7 +867,9 @@ class AgentWizard extends HTML
|
|||||||
'onclick' => '$("#form-main-wizard").submit();',
|
'onclick' => '$("#form-main-wizard").submit();',
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
)
|
),
|
||||||
|
$create_modules_button,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Prints main form.
|
// Prints main form.
|
||||||
@ -3765,7 +3795,10 @@ class AgentWizard extends HTML
|
|||||||
'label' => __('Create modules'),
|
'label' => __('Create modules'),
|
||||||
'name' => 'create-modules-action',
|
'name' => 'create-modules-action',
|
||||||
'type' => 'button',
|
'type' => 'button',
|
||||||
'attributes' => [ 'icon' => 'next' ],
|
'attributes' => [
|
||||||
|
'icon' => 'next',
|
||||||
|
'style' => 'display: none;',
|
||||||
|
],
|
||||||
'script' => 'processListModules();',
|
'script' => 'processListModules();',
|
||||||
'return' => true,
|
'return' => true,
|
||||||
],
|
],
|
||||||
|
@ -457,9 +457,7 @@ class AgentsAlerts extends HTML
|
|||||||
$template2 = get_parameter('template');
|
$template2 = get_parameter('template');
|
||||||
$module_action_threshold = get_parameter('module_action_threshold');
|
$module_action_threshold = get_parameter('module_action_threshold');
|
||||||
$action_select = get_parameter('action_select', 0);
|
$action_select = get_parameter('action_select', 0);
|
||||||
|
$id_alert = alerts_create_alert_agent_module($this->createAlert, $template2);
|
||||||
$id_alert = alerts_create_alert_agent_module($this->create_alert, $template2);
|
|
||||||
|
|
||||||
if ($id_alert !== false) {
|
if ($id_alert !== false) {
|
||||||
if ($action_select != 0) {
|
if ($action_select != 0) {
|
||||||
$values = [];
|
$values = [];
|
||||||
|
@ -269,13 +269,6 @@ class ConsoleSupervisor
|
|||||||
$this->checkSyncQueueStatus();
|
$this->checkSyncQueueStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check number of agents is equals and more than 200.
|
|
||||||
* NOTIF.ACCESSSTASTICS.PERFORMANCE
|
|
||||||
*/
|
|
||||||
|
|
||||||
$this->checkAccessStatisticsPerformance();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checkc agent missing libraries.
|
* Checkc agent missing libraries.
|
||||||
* NOTIF.AGENT.LIBRARY
|
* NOTIF.AGENT.LIBRARY
|
||||||
@ -573,13 +566,6 @@ class ConsoleSupervisor
|
|||||||
$this->checkSyncQueueStatus();
|
$this->checkSyncQueueStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check number of agents is equals and more than 200.
|
|
||||||
* NOTIF.ACCESSSTASTICS.PERFORMANCE
|
|
||||||
*/
|
|
||||||
|
|
||||||
$this->checkAccessStatisticsPerformance();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checkc agent missing libraries.
|
* Checkc agent missing libraries.
|
||||||
* NOTIF.AGENT.LIBRARY
|
* NOTIF.AGENT.LIBRARY
|
||||||
@ -732,6 +718,8 @@ class ConsoleSupervisor
|
|||||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
|
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
|
||||||
@ -2390,11 +2378,12 @@ class ConsoleSupervisor
|
|||||||
include_once $config['homedir'].'/include/functions_update_manager.php';
|
include_once $config['homedir'].'/include/functions_update_manager.php';
|
||||||
$login = get_parameter('login', false);
|
$login = get_parameter('login', false);
|
||||||
|
|
||||||
|
if ($config['autoupdate'] === '1' || $_GET['sec2'] === 'godmode/update_manager/update_manager') {
|
||||||
if (update_manager_verify_registration() === false) {
|
if (update_manager_verify_registration() === false) {
|
||||||
$this->notify(
|
$this->notify(
|
||||||
[
|
[
|
||||||
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
|
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
|
||||||
'title' => __('This instance is not registered in the Update manager section'),
|
'title' => __('This instance is not registered in the Warp Update section'),
|
||||||
'message' => __('Click here to start the registration process'),
|
'message' => __('Click here to start the registration process'),
|
||||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||||
]
|
]
|
||||||
@ -2403,6 +2392,7 @@ class ConsoleSupervisor
|
|||||||
$this->cleanNotifications('NOTIF.UPDATEMANAGER.REGISTRATION');
|
$this->cleanNotifications('NOTIF.UPDATEMANAGER.REGISTRATION');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2414,13 +2404,17 @@ class ConsoleSupervisor
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
include_once $config['homedir'].'/include/functions_update_manager.php';
|
include_once $config['homedir'].'/include/functions_update_manager.php';
|
||||||
|
$server_name = db_get_value_filter(
|
||||||
|
'name',
|
||||||
|
'tserver',
|
||||||
|
[ 'server_type' => '1' ]
|
||||||
|
);
|
||||||
if (update_manager_verify_api() === false) {
|
if (update_manager_verify_api() === false) {
|
||||||
$this->notify(
|
$this->notify(
|
||||||
[
|
[
|
||||||
'type' => 'NOTIF.API.ACCESS',
|
'type' => 'NOTIF.API.ACCESS',
|
||||||
'title' => __('Cannot access the Pandora FMS API '),
|
'title' => __('Cannot access the Pandora FMS API '),
|
||||||
'message' => __('Please check the configuration, some components may fail due to this misconfiguration.'),
|
'message' => __('Please check the configuration, some components may fail due to this misconfiguration in '.$server_name.' ('.$config['public_url'].')'),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -580,9 +580,6 @@ class Diagnostics extends Wizard
|
|||||||
$countModuleData = db_get_value_sql(
|
$countModuleData = db_get_value_sql(
|
||||||
'SELECT COUNT(*) FROM tagente_datos'
|
'SELECT COUNT(*) FROM tagente_datos'
|
||||||
);
|
);
|
||||||
$countAgentAccess = db_get_value_sql(
|
|
||||||
'SELECT COUNT(*) FROM tagent_access'
|
|
||||||
);
|
|
||||||
$countEvents = db_get_value_sql('SELECT COUNT(*) FROM tevento');
|
$countEvents = db_get_value_sql('SELECT COUNT(*) FROM tevento');
|
||||||
|
|
||||||
if (enterprise_installed() === true) {
|
if (enterprise_installed() === true) {
|
||||||
@ -611,10 +608,6 @@ class Diagnostics extends Wizard
|
|||||||
'name' => __('Total module data records'),
|
'name' => __('Total module data records'),
|
||||||
'value' => $countModuleData,
|
'value' => $countModuleData,
|
||||||
],
|
],
|
||||||
'countAgentAccess' => [
|
|
||||||
'name' => __('Total agent access record'),
|
|
||||||
'value' => $countAgentAccess,
|
|
||||||
],
|
|
||||||
'countEvents' => [
|
'countEvents' => [
|
||||||
'name' => __('Total events'),
|
'name' => __('Total events'),
|
||||||
'value' => $countEvents,
|
'value' => $countEvents,
|
||||||
@ -744,7 +737,7 @@ class Diagnostics extends Wizard
|
|||||||
$cpuModelName = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
|
$cpuModelName = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
|
||||||
$cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l';
|
$cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l';
|
||||||
$ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"';
|
$ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"';
|
||||||
|
$distroInfo = 'cat /etc/os-release | grep "PRETTY_NAME" | cut -f 2 -d "="';
|
||||||
exec(
|
exec(
|
||||||
"ifconfig | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'",
|
"ifconfig | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'",
|
||||||
$output
|
$output
|
||||||
@ -763,6 +756,10 @@ class Diagnostics extends Wizard
|
|||||||
'name' => __('RAM'),
|
'name' => __('RAM'),
|
||||||
'value' => exec($ramMemTotal),
|
'value' => exec($ramMemTotal),
|
||||||
],
|
],
|
||||||
|
'distroInfo' => [
|
||||||
|
'name' => __('Distro'),
|
||||||
|
'value' => str_replace('"', '', exec($distroInfo)),
|
||||||
|
],
|
||||||
'osInfo' => [
|
'osInfo' => [
|
||||||
'name' => __('Os'),
|
'name' => __('Os'),
|
||||||
'value' => exec('uname -a'),
|
'value' => exec('uname -a'),
|
||||||
|
@ -47,6 +47,7 @@ class TipsWindow
|
|||||||
'renderPreview',
|
'renderPreview',
|
||||||
'setShowTipsAtStartup',
|
'setShowTipsAtStartup',
|
||||||
'getTips',
|
'getTips',
|
||||||
|
'getTipById',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -221,8 +222,13 @@ class TipsWindow
|
|||||||
*
|
*
|
||||||
* @return array $tip
|
* @return array $tip
|
||||||
*/
|
*/
|
||||||
public function getTipById($idTip)
|
public function getTipById($idTip=false, $return=false)
|
||||||
{
|
{
|
||||||
|
if ($idTip === false) {
|
||||||
|
$idTip = get_parameter('idTip');
|
||||||
|
}
|
||||||
|
|
||||||
|
$return = get_parameter('return', false);
|
||||||
$tip = db_get_row(
|
$tip = db_get_row(
|
||||||
'twelcome_tip',
|
'twelcome_tip',
|
||||||
'id',
|
'id',
|
||||||
@ -232,10 +238,21 @@ class TipsWindow
|
|||||||
$tip['title'] = io_safe_output($tip['title']);
|
$tip['title'] = io_safe_output($tip['title']);
|
||||||
$tip['text'] = io_safe_output($tip['text']);
|
$tip['text'] = io_safe_output($tip['text']);
|
||||||
$tip['url'] = io_safe_output($tip['url']);
|
$tip['url'] = io_safe_output($tip['url']);
|
||||||
|
$tip['files'] = $this->getFilesFromTip($tip['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($return !== false) {
|
||||||
|
if (empty($tip) === false) {
|
||||||
|
echo json_encode(['success' => true, 'data' => $tip]);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
echo json_encode(['success' => false]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
return $tip;
|
return $tip;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,6 +106,9 @@ class TreeGroupEdition extends TreeGroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build the group hierarchy.
|
// Build the group hierarchy.
|
||||||
|
if (isset($this->filter['show_full_hirearchy']) === false
|
||||||
|
|| (isset($this->filter['show_full_hirearchy']) === true && (bool) $this->filter['show_full_hirearchy'] === true)
|
||||||
|
) {
|
||||||
foreach ($groups as $id => $group) {
|
foreach ($groups as $id => $group) {
|
||||||
if (isset($groups[$id]['parent']) === true
|
if (isset($groups[$id]['parent']) === true
|
||||||
&& ($groups[$id]['parent'] != 0)
|
&& ($groups[$id]['parent'] != 0)
|
||||||
@ -122,6 +125,7 @@ class TreeGroupEdition extends TreeGroup
|
|||||||
$groups[$id]['have_parent'] = true;
|
$groups[$id]['have_parent'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Sort the children groups.
|
// Sort the children groups.
|
||||||
foreach ($groups as $id => $group) {
|
foreach ($groups as $id => $group) {
|
||||||
@ -167,6 +171,92 @@ class TreeGroupEdition extends TreeGroup
|
|||||||
];
|
];
|
||||||
|
|
||||||
$group_acl = '';
|
$group_acl = '';
|
||||||
|
$search_agent = '';
|
||||||
|
$status_agent = '';
|
||||||
|
$inner_agent = '';
|
||||||
|
|
||||||
|
if ((bool) is_metaconsole() === true) {
|
||||||
|
if (users_can_manage_group_all('AR') === false) {
|
||||||
|
$user_groups_str = implode(',', $this->userGroupsArray);
|
||||||
|
$group_acl = sprintf(
|
||||||
|
' AND tgrupo.id_grupo IN (%s) ',
|
||||||
|
$user_groups_str
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->filter['searchAgent']) === true && empty($this->filter['searchAgent']) === false
|
||||||
|
|| isset($this->filter['statusAgent']) === true && strlen($this->filter['statusAgent']) > 0
|
||||||
|
) {
|
||||||
|
$inner_agent = 'INNER JOIN tmetaconsole_agent ON tgrupo.id_grupo = tmetaconsole_agent.id_grupo';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->filter['searchAgent']) === true && empty($this->filter['searchAgent']) === false) {
|
||||||
|
$search_agent = ' AND tmetaconsole_agent.alias LIKE "%'.$this->filter['searchAgent'].'%" ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->filter['statusAgent']) === true && strlen($this->filter['statusAgent']) > 0) {
|
||||||
|
switch ($this->filter['statusAgent']) {
|
||||||
|
case AGENT_STATUS_NORMAL:
|
||||||
|
$status_agent = ' AND (
|
||||||
|
tmetaconsole_agent.critical_count = 0
|
||||||
|
AND tmetaconsole_agent.warning_count = 0
|
||||||
|
AND tmetaconsole_agent.unknown_count = 0
|
||||||
|
AND tmetaconsole_agent.normal_count > 0)';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGENT_STATUS_WARNING:
|
||||||
|
$status_agent = ' AND (
|
||||||
|
tmetaconsole_agent.critical_count = 0
|
||||||
|
AND tmetaconsole_agent.warning_count > 0
|
||||||
|
AND tmetaconsole_agent.total_count > 0)';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGENT_STATUS_CRITICAL:
|
||||||
|
$status_agent = ' AND tmetaconsole_agent.critical_count > 0';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGENT_STATUS_UNKNOWN:
|
||||||
|
$status_agent = ' AND (
|
||||||
|
tmetaconsole_agent.critical_count = 0
|
||||||
|
AND tmetaconsole_agent.warning_count = 0
|
||||||
|
AND tmetaconsole_agent.unknown_count > 0)';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGENT_STATUS_NOT_NORMAL:
|
||||||
|
$status_agent = ' AND (
|
||||||
|
tmetaconsole_agent.normal_count <> total_count
|
||||||
|
OR tmetaconsole_agent.total_count = notinit_count)';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AGENT_STATUS_NOT_INIT:
|
||||||
|
$status_agent = ' AND (
|
||||||
|
tmetaconsole_agent.total_count = 0
|
||||||
|
OR tmetaconsole_agent.total_count = notinit_count)';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Nothing to do.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = sprintf(
|
||||||
|
'SELECT tgrupo.id_grupo AS gid,
|
||||||
|
tgrupo.nombre as name,
|
||||||
|
tgrupo.parent,
|
||||||
|
tgrupo.icon
|
||||||
|
FROM tgrupo
|
||||||
|
%s
|
||||||
|
WHERE 1=1
|
||||||
|
%s
|
||||||
|
%s
|
||||||
|
%s ',
|
||||||
|
$inner_agent,
|
||||||
|
$search_agent,
|
||||||
|
$status_agent,
|
||||||
|
$group_acl
|
||||||
|
);
|
||||||
|
} else {
|
||||||
if (users_can_manage_group_all('AR') === false) {
|
if (users_can_manage_group_all('AR') === false) {
|
||||||
$user_groups_str = implode(',', $this->userGroupsArray);
|
$user_groups_str = implode(',', $this->userGroupsArray);
|
||||||
$group_acl = sprintf(
|
$group_acl = sprintf(
|
||||||
@ -181,9 +271,11 @@ class TreeGroupEdition extends TreeGroup
|
|||||||
parent,
|
parent,
|
||||||
icon
|
icon
|
||||||
FROM tgrupo
|
FROM tgrupo
|
||||||
WHERE 1=1 %s',
|
WHERE 1=1
|
||||||
|
%s ',
|
||||||
$group_acl
|
$group_acl
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$stats = db_get_all_rows_sql($sql);
|
$stats = db_get_all_rows_sql($sql);
|
||||||
$group_stats = [];
|
$group_stats = [];
|
||||||
|
@ -372,7 +372,7 @@ class WelcomeWindow extends Wizard
|
|||||||
$flag_um = true;
|
$flag_um = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($config['welcome_mail_configured']) === false) {
|
if (empty($config['email_username']) === false && empty($config['email_password']) === false) {
|
||||||
$btn_configure_mail_class = '';
|
$btn_configure_mail_class = '';
|
||||||
$li_configure_mail_class = 'row_green';
|
$li_configure_mail_class = 'row_green';
|
||||||
$flag_cm = true;
|
$flag_cm = true;
|
||||||
@ -702,7 +702,7 @@ class WelcomeWindow extends Wizard
|
|||||||
<?php
|
<?php
|
||||||
echo html_print_input_hidden('check_connectivity', 1);
|
echo html_print_input_hidden('check_connectivity', 1);
|
||||||
echo html_print_label_input_block(
|
echo html_print_label_input_block(
|
||||||
__('Ip target'),
|
__('IP address target'),
|
||||||
html_print_input_text(
|
html_print_input_text(
|
||||||
'ip_target',
|
'ip_target',
|
||||||
'',
|
'',
|
||||||
@ -717,7 +717,7 @@ class WelcomeWindow extends Wizard
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
echo html_print_label_input_block(
|
echo html_print_label_input_block(
|
||||||
__('Agent name'),
|
__('Agent alias'),
|
||||||
html_print_input_text(
|
html_print_input_text(
|
||||||
'agent_name',
|
'agent_name',
|
||||||
'',
|
'',
|
||||||
@ -732,7 +732,7 @@ class WelcomeWindow extends Wizard
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
echo html_print_label_input_block(
|
echo html_print_label_input_block(
|
||||||
__('Module group'),
|
__('Agent group'),
|
||||||
html_print_select_from_sql(
|
html_print_select_from_sql(
|
||||||
'SELECT * FROM tgrupo ORDER BY nombre',
|
'SELECT * FROM tgrupo ORDER BY nombre',
|
||||||
'id_group',
|
'id_group',
|
||||||
@ -747,7 +747,6 @@ class WelcomeWindow extends Wizard
|
|||||||
'width: 100%;'
|
'width: 100%;'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
echo html_print_submit_button(__('Create'), 'create_conectivity', false, ['icon' => 'next', 'style' => 'margin-top:15px; float:right;']);
|
echo html_print_submit_button(__('Create'), 'create_conectivity', false, ['icon' => 'next', 'style' => 'margin-top:15px; float:right;']);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -1136,7 +1135,7 @@ class WelcomeWindow extends Wizard
|
|||||||
}
|
}
|
||||||
|
|
||||||
function configureEmail() {
|
function configureEmail() {
|
||||||
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table3'); ?>';
|
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table4'); ?>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function serversUp() {
|
function serversUp() {
|
||||||
@ -1263,14 +1262,18 @@ class WelcomeWindow extends Wizard
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#button-create_conectivity').click(function(){
|
$('#button-create_conectivity').click(function(e){
|
||||||
|
if($("#text-ip_target")[0].checkValidity() == false) {
|
||||||
|
$("#text-ip_target")[0].reportValidity();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
async: false,
|
async: false,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "include/ajax/task_to_perform.php",
|
url: "include/ajax/task_to_perform.php",
|
||||||
data: {
|
data: {
|
||||||
check_connectivity: 1,
|
check_connectivity: 1,
|
||||||
id_group: $('#id_group :selected').val(),
|
id_group: $('#id_group1 option:selected').val(),
|
||||||
ip_target: $('#text-ip_target').val(),
|
ip_target: $('#text-ip_target').val(),
|
||||||
agent_name: $('#text-agent_name').val(),
|
agent_name: $('#text-agent_name').val(),
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pandora build version and version
|
* Pandora build version and version
|
||||||
*/
|
*/
|
||||||
$build_version = 'PC231123';
|
$build_version = 'PC231211';
|
||||||
$pandora_version = 'v7.0NG.774';
|
$pandora_version = 'v7.0NG.774';
|
||||||
|
|
||||||
// Do not overwrite default timezone set if defined.
|
// Do not overwrite default timezone set if defined.
|
||||||
|
@ -45,6 +45,7 @@ define('EVENT_NEW', 0);
|
|||||||
define('EVENT_VALIDATE', 1);
|
define('EVENT_VALIDATE', 1);
|
||||||
define('EVENT_PROCESS', 2);
|
define('EVENT_PROCESS', 2);
|
||||||
define('EVENT_NO_VALIDATED', 3);
|
define('EVENT_NO_VALIDATED', 3);
|
||||||
|
define('EVENT_NO_PROCESS', 4);
|
||||||
|
|
||||||
// Events group by constants.
|
// Events group by constants.
|
||||||
define('EVENT_GROUP_REP_ALL', 0);
|
define('EVENT_GROUP_REP_ALL', 0);
|
||||||
|
@ -1006,6 +1006,70 @@ function get_parameter($name, $default='')
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get_parameter_date($name, $default='', $date_format='Y/m/d')
|
||||||
|
{
|
||||||
|
$date_end = get_parameter('date_end', 0);
|
||||||
|
$time_end = get_parameter('time_end');
|
||||||
|
$datetime_end = strtotime($date_end.' '.$time_end);
|
||||||
|
|
||||||
|
$custom_date = get_parameter('custom_date', 0);
|
||||||
|
$range = get_parameter('range', SECONDS_1DAY);
|
||||||
|
$date_text = get_parameter('range_text', SECONDS_1DAY);
|
||||||
|
$date_init_less = (strtotime(date('Y/m/d')) - SECONDS_1DAY);
|
||||||
|
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
|
||||||
|
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
|
||||||
|
$datetime_init = strtotime($date_init.' '.$time_init);
|
||||||
|
if ($custom_date === '1') {
|
||||||
|
if ($datetime_init >= $datetime_end) {
|
||||||
|
$datetime_init = $date_init_less;
|
||||||
|
}
|
||||||
|
|
||||||
|
$date_init = date('Y/m/d H:i:s', $datetime_init);
|
||||||
|
$date_end = date('Y/m/d H:i:s', $datetime_end);
|
||||||
|
$period = ($datetime_end - $datetime_init);
|
||||||
|
} else if ($custom_date === '2') {
|
||||||
|
$date_units = get_parameter('range_units');
|
||||||
|
$date_end = date('Y/m/d H:i:s');
|
||||||
|
$date_init = date('Y/m/d H:i:s', (strtotime($date_end) - ((int) $date_text * (int) $date_units)));
|
||||||
|
$period = (strtotime($date_end) - strtotime($date_init));
|
||||||
|
} else if (in_array($range, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($range === 'this_week') {
|
||||||
|
$monday = date('Y/m/d', strtotime('last monday'));
|
||||||
|
|
||||||
|
$sunday = date('Y/m/d', strtotime($monday.' +6 days'));
|
||||||
|
$period = (strtotime($sunday) - strtotime($monday));
|
||||||
|
$date_init = $monday;
|
||||||
|
$date_end = $sunday;
|
||||||
|
} else if ($range === 'this_month') {
|
||||||
|
$date_end = date('Y/m/d', strtotime('last day of this month'));
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
|
||||||
|
$date_init = $first_of_month;
|
||||||
|
$period = (strtotime($date_end) - strtotime($first_of_month));
|
||||||
|
} else if ($range === 'past_month') {
|
||||||
|
$date_end = date('Y/m/d', strtotime('last day of previous month'));
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
|
||||||
|
$date_init = $first_of_month;
|
||||||
|
$period = (strtotime($date_end) - strtotime($first_of_month));
|
||||||
|
} else if ($range === 'past_week') {
|
||||||
|
$date_end = date('Y/m/d', strtotime('sunday', strtotime('last week')));
|
||||||
|
$first_of_week = date('Y/m/d', strtotime('monday', strtotime('last week')));
|
||||||
|
$date_init = $first_of_week;
|
||||||
|
$period = (strtotime($date_end) - strtotime($first_of_week));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$date_end = date('Y/m/d H:i:s');
|
||||||
|
$date_init = date('Y/m/d H:i:s', (strtotime($date_end) - $range));
|
||||||
|
$period = (strtotime($date_end) - strtotime($date_init));
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'date_init' => date($date_format, strtotime($date_init)),
|
||||||
|
'date_end' => date($date_format, strtotime($date_end)),
|
||||||
|
'period' => $period,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a parameter from a get request.
|
* Get a parameter from a get request.
|
||||||
*
|
*
|
||||||
@ -4326,48 +4390,22 @@ function generator_chart_to_pdf(
|
|||||||
$module_list=false
|
$module_list=false
|
||||||
) {
|
) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if (is_metaconsole()) {
|
|
||||||
$hack_metaconsole = '../..';
|
|
||||||
} else {
|
|
||||||
$hack_metaconsole = '';
|
$hack_metaconsole = '';
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$hack_metaconsole = '../..';
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = ui_get_full_url(false).$hack_metaconsole.'/include/chart_generator.php';
|
|
||||||
|
|
||||||
if (!$params['return_img_base_64']) {
|
if (!$params['return_img_base_64']) {
|
||||||
$img_file = 'img_'.uniqid().'.png';
|
$img_file = 'img_'.uniqid().'.png';
|
||||||
$img_path = $config['homedir'].'/attachment/'.$img_file;
|
$img_path = $config['homedir'].'/attachment/'.$img_file;
|
||||||
$img_url = ui_get_full_url(false).$hack_metaconsole.'/attachment/'.$img_file;
|
$img_url = ui_get_full_url(false).$hack_metaconsole.'/attachment/'.$img_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
$session_id = session_id();
|
if ($type_graph_pdf !== 'combined') {
|
||||||
if ($type_graph_pdf === 'combined') {
|
$params_combined = [];
|
||||||
$data = [
|
$module_list = [];
|
||||||
'data' => $params,
|
|
||||||
'session_id' => $session_id,
|
|
||||||
'type_graph_pdf' => $type_graph_pdf,
|
|
||||||
'data_module_list' => $module_list,
|
|
||||||
'data_combined' => $params_combined,
|
|
||||||
'id_user' => $config['id_user'],
|
|
||||||
'slicebar' => $_SESSION['slicebar'],
|
|
||||||
'slicebar_value' => $config[$_SESSION['slicebar']],
|
|
||||||
'apipass' => get_parameter('apipass', null),
|
|
||||||
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
$data = [
|
|
||||||
'data' => $params,
|
|
||||||
'session_id' => $session_id,
|
|
||||||
'type_graph_pdf' => $type_graph_pdf,
|
|
||||||
'id_user' => $config['id_user'],
|
|
||||||
'slicebar' => $_SESSION['slicebar'],
|
|
||||||
'slicebar_value' => $config[$_SESSION['slicebar']],
|
|
||||||
'apipass' => get_parameter('apipass', null),
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($data['data']['graph_data']);
|
|
||||||
// If not install chromium avoid 500 convert tu images no data to show.
|
// If not install chromium avoid 500 convert tu images no data to show.
|
||||||
$chromium_dir = io_safe_output($config['chromium_path']);
|
$chromium_dir = io_safe_output($config['chromium_path']);
|
||||||
$result_ejecution = exec($chromium_dir.' --version');
|
$result_ejecution = exec($chromium_dir.' --version');
|
||||||
@ -4387,22 +4425,16 @@ function generator_chart_to_pdf(
|
|||||||
|
|
||||||
// Creates a new page.
|
// Creates a new page.
|
||||||
$page = $browser->createPage();
|
$page = $browser->createPage();
|
||||||
$curl = curl_init();
|
|
||||||
|
|
||||||
curl_setopt($curl, CURLOPT_URL, $url);
|
// Generate Html.
|
||||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
$html = chart_generator(
|
||||||
curl_setopt($curl, CURLOPT_POSTFIELDS, ['data' => json_encode($data)]);
|
$type_graph_pdf,
|
||||||
|
$params,
|
||||||
|
$params_combined,
|
||||||
|
$module_list
|
||||||
|
);
|
||||||
|
|
||||||
$response = curl_exec($curl);
|
$page->setHtml($html);
|
||||||
|
|
||||||
curl_close($curl);
|
|
||||||
|
|
||||||
$page->setHtml($response);
|
|
||||||
/*
|
|
||||||
//For debug url with parameters.
|
|
||||||
$navigation = $page->navigate($url.'?data='.urlencode(json_encode($data)));
|
|
||||||
$navigation->waitForNavigation(Page::DOM_CONTENT_LOADED);
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Dynamic.
|
// Dynamic.
|
||||||
$dynamic_height = $page->evaluate('document.getElementById("container-chart-generator-item").clientHeight')->getReturnValue();
|
$dynamic_height = $page->evaluate('document.getElementById("container-chart-generator-item").clientHeight')->getReturnValue();
|
||||||
@ -4449,6 +4481,211 @@ function generator_chart_to_pdf(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Html print chart for chromium
|
||||||
|
*
|
||||||
|
* @param string $type_graph_pdf Chart mode.
|
||||||
|
* @param array $params Params.
|
||||||
|
* @param array $params_combined Params Combined charts.
|
||||||
|
* @param array $module_list Module list Combined charts.
|
||||||
|
*
|
||||||
|
* @return string Output Html.
|
||||||
|
*/
|
||||||
|
function chart_generator(
|
||||||
|
string $type_graph_pdf,
|
||||||
|
array $params,
|
||||||
|
array $params_combined=[],
|
||||||
|
array $module_list=[]
|
||||||
|
) : string {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
include_once $config['homedir'].'/include/graphs/functions_d3.php';
|
||||||
|
|
||||||
|
if (isset($params['backgroundColor']) === false) {
|
||||||
|
$params['backgroundColor'] = 'inherit';
|
||||||
|
}
|
||||||
|
|
||||||
|
$hack_metaconsole = (is_metaconsole() === true) ? '../../' : '';
|
||||||
|
|
||||||
|
$output = '<!DOCTYPE>';
|
||||||
|
$output .= '<html>';
|
||||||
|
$output .= '<head>';
|
||||||
|
$output .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
|
||||||
|
$output .= '<title>Pandora FMS Graph</title>';
|
||||||
|
$output .= '<script type="text/javascript">';
|
||||||
|
$output .= 'var phpTimezone = "'.date_default_timezone_get().'";';
|
||||||
|
$output .= 'var configHomeurl = "'.((is_metaconsole() === false) ? $config['homeurl'] : '../../').'";';
|
||||||
|
$output .= '</script>';
|
||||||
|
|
||||||
|
$css_files = [
|
||||||
|
'pandora' => 'include/styles/',
|
||||||
|
'pandora_minimal' => 'include/styles/',
|
||||||
|
'jquery-ui.min' => 'include/styles/js/',
|
||||||
|
'jquery-ui_custom' => 'include/styles/js/',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($css_files as $name => $path) {
|
||||||
|
$output .= ui_require_css_file($name, $path, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$js_files = [
|
||||||
|
'pandora_ui' => 'include/javascript/',
|
||||||
|
'jquery.current' => 'include/javascript/',
|
||||||
|
'jquery.pandora' => 'include/javascript/',
|
||||||
|
'jquery-ui.min' => 'include/javascript/',
|
||||||
|
'date' => 'include/javascript/timezone/src/',
|
||||||
|
'pandora' => 'include/javascript/',
|
||||||
|
'jquery.flot' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.min' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.time' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.pie' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.crosshair.min' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.stack.min' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.selection.min' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.resize.min' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.threshold' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.threshold.multiple' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.symbol.min' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.exportdata.pandora' => 'include/graphs/flot/',
|
||||||
|
'jquery.flot.axislabels' => 'include/graphs/flot/',
|
||||||
|
'pandora.flot' => 'include/graphs/flot/',
|
||||||
|
'chart' => 'include/graphs/chartjs/',
|
||||||
|
'chartjs-plugin-datalabels.min' => 'include/graphs/chartjs/',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($js_files as $name => $path) {
|
||||||
|
$output .= ui_require_javascript_file($name, $path, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= include_javascript_d3(true, true);
|
||||||
|
|
||||||
|
$output .= '</head>';
|
||||||
|
$output .= '<body style="width:794px; margin: 0px; background-color:'.$params['backgroundColor'].';">';
|
||||||
|
$params['only_image'] = false;
|
||||||
|
$params['menu'] = false;
|
||||||
|
$params['disable_black'] = true;
|
||||||
|
|
||||||
|
$viewport = [
|
||||||
|
'width' => 0,
|
||||||
|
'height' => 0,
|
||||||
|
];
|
||||||
|
|
||||||
|
$style = 'width:100%;';
|
||||||
|
if (isset($params['options']['viewport']) === true) {
|
||||||
|
$viewport = $params['options']['viewport'];
|
||||||
|
if (empty($viewport['width']) === false) {
|
||||||
|
$style .= 'width:'.$viewport['width'].'px;';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($viewport['height']) === false) {
|
||||||
|
$style .= 'height:'.$viewport['height'].'px;';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= '<div id="container-chart-generator-item" style="'.$style.' margin:0px;">';
|
||||||
|
switch ($type_graph_pdf) {
|
||||||
|
case 'combined':
|
||||||
|
$params['pdf'] = true;
|
||||||
|
$result = graphic_combined_module(
|
||||||
|
$module_list,
|
||||||
|
$params,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
|
|
||||||
|
$output .= $result;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'sparse':
|
||||||
|
$params['pdf'] = true;
|
||||||
|
$output .= grafico_modulo_sparse($params);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'pie_graph':
|
||||||
|
$params['pdf'] = true;
|
||||||
|
$chart = get_build_setup_charts(
|
||||||
|
'PIE',
|
||||||
|
$params['options'],
|
||||||
|
$params['chart_data']
|
||||||
|
);
|
||||||
|
|
||||||
|
$output .= $chart->render(true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vbar_graph':
|
||||||
|
$params['pdf'] = true;
|
||||||
|
$chart = get_build_setup_charts(
|
||||||
|
'BAR',
|
||||||
|
$params['options'],
|
||||||
|
$params['chart_data']
|
||||||
|
);
|
||||||
|
|
||||||
|
$output .= $chart->render(true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'ring_graph':
|
||||||
|
$params['pdf'] = true;
|
||||||
|
$params['options']['width'] = 500;
|
||||||
|
$params['options']['height'] = 500;
|
||||||
|
|
||||||
|
$chart = get_build_setup_charts(
|
||||||
|
'DOUGHNUT',
|
||||||
|
$params['options'],
|
||||||
|
$params['chart_data']
|
||||||
|
);
|
||||||
|
|
||||||
|
$output .= $chart->render(true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'line_graph':
|
||||||
|
$params['pdf'] = true;
|
||||||
|
$params['options']['width'] = '100%';
|
||||||
|
$params['options']['height'] = 200;
|
||||||
|
$chart = get_build_setup_charts(
|
||||||
|
'LINE',
|
||||||
|
$params['options'],
|
||||||
|
$params['chart_data']
|
||||||
|
);
|
||||||
|
$output .= $chart->render(true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'slicebar':
|
||||||
|
$output .= flot_slicesbar_graph(
|
||||||
|
$params['graph_data'],
|
||||||
|
$params['period'],
|
||||||
|
$params['width'],
|
||||||
|
$params['height'],
|
||||||
|
$params['legend'],
|
||||||
|
$params['colors'],
|
||||||
|
$params['fontpath'],
|
||||||
|
$params['round_corner'],
|
||||||
|
$params['homeurl'],
|
||||||
|
$params['watermark'],
|
||||||
|
$params['adapt_key'],
|
||||||
|
$params['stat_winalse'],
|
||||||
|
$params['id_agent'],
|
||||||
|
$params['full_legend_daterray'],
|
||||||
|
$params['not_interactive'],
|
||||||
|
$params['ttl'],
|
||||||
|
$params['sizeForTicks'],
|
||||||
|
$params['show'],
|
||||||
|
$params['date_to'],
|
||||||
|
$params['server_id']
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Code...
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= '</div>';
|
||||||
|
$output .= '</body>';
|
||||||
|
$output .= '</html>';
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the product name.
|
* Get the product name.
|
||||||
*
|
*
|
||||||
|
@ -4752,7 +4752,7 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||||||
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
|
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
|
||||||
$secondaryLinks = [];
|
$secondaryLinks = [];
|
||||||
if (empty($secondary_groups['for_select']) === true) {
|
if (empty($secondary_groups['for_select']) === true) {
|
||||||
$secondaryLinks[] = '<em>'.__('N/A').'</em>';
|
$secondaryLinks = [];
|
||||||
} else {
|
} else {
|
||||||
foreach ($secondary_groups['for_select'] as $id => $name) {
|
foreach ($secondary_groups['for_select'] as $id => $name) {
|
||||||
$secondaryLinks[] = html_print_anchor(
|
$secondaryLinks[] = html_print_anchor(
|
||||||
@ -4811,22 +4811,22 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||||||
'content' => groups_get_name($agent['id_grupo']),
|
'content' => groups_get_name($agent['id_grupo']),
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
).' '.ui_print_group_icon($agent['id_grupo'], true, '', 'margin-left: 2%;', true, false, false, '', true);
|
||||||
$table_contact->data[] = $data;
|
$table_contact->data[] = $data;
|
||||||
|
|
||||||
// Secondary groups.
|
// Secondary groups.
|
||||||
$data = [];
|
$data = [];
|
||||||
|
if (!empty($secondaryLinks) === true) {
|
||||||
$data[0] = '<b>'.__('Secondary groups').'</b>';
|
$data[0] = '<b>'.__('Secondary groups').'</b>';
|
||||||
$data[1] = implode(', ', $secondaryLinks);
|
$data[1] = implode(', ', $secondaryLinks);
|
||||||
$table_contact->data[] = $data;
|
$table_contact->data[] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
// Parent agent line.
|
// Parent agent line.
|
||||||
if (enterprise_installed() === true) {
|
if (enterprise_installed() === true) {
|
||||||
|
if ((int) $agent['id_parent'] !== 0) {
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = '<b>'.__('Parent').'</b>';
|
$data[0] = '<b>'.__('Parent').'</b>';
|
||||||
if ((int) $agent['id_parent'] === 0) {
|
|
||||||
$data[1] = '<em>'.__('N/A').'</em>';
|
|
||||||
} else {
|
|
||||||
$data[1] = html_print_anchor(
|
$data[1] = html_print_anchor(
|
||||||
[
|
[
|
||||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_parent'],
|
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_parent'],
|
||||||
@ -4834,10 +4834,10 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
$table_contact->data[] = $data;
|
$table_contact->data[] = $data;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Last status change line.
|
// Last status change line.
|
||||||
$data = [];
|
$data = [];
|
||||||
@ -4845,6 +4845,123 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||||||
$data[1] = $time_elapsed;
|
$data[1] = $time_elapsed;
|
||||||
$table_contact->data[] = $data;
|
$table_contact->data[] = $data;
|
||||||
|
|
||||||
|
$has_remote_conf = enterprise_hook(
|
||||||
|
'config_agents_has_remote_configuration',
|
||||||
|
[$agent['id_agente']]
|
||||||
|
);
|
||||||
|
|
||||||
|
if ((bool) $has_remote_conf) {
|
||||||
|
$data = [];
|
||||||
|
$data[0] = __('Remote configuration');
|
||||||
|
$data[1] = '<spam style="position: relative;top: -10%; margin-right: 10px;">'.__('Enabled').'</spam>';
|
||||||
|
$data[1] .= html_print_menu_button(
|
||||||
|
[
|
||||||
|
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent['id_agente'].'&disk_conf=1'),
|
||||||
|
'image' => 'images/remote-configuration@svg.svg',
|
||||||
|
'title' => __('Edit remote config'),
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$satellite_server = (int) db_get_value_filter(
|
||||||
|
'satellite_server',
|
||||||
|
'tagente',
|
||||||
|
['id_agente' => $id_agente]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (empty($satellite_server) === false) {
|
||||||
|
$satellite_name = db_get_value_filter(
|
||||||
|
'name',
|
||||||
|
'tserver',
|
||||||
|
['id_server' => $satellite_server]
|
||||||
|
);
|
||||||
|
|
||||||
|
$data[0] = __('Satellite server');
|
||||||
|
$data[1] = $satellite_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table_contact->data[] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enterprise_installed() === true) {
|
||||||
|
// SecurityMon line.
|
||||||
|
$id_module_group = db_get_value('id_mg', 'tmodule_group', 'name', 'Security');
|
||||||
|
$modules = db_get_all_rows_filter(
|
||||||
|
'tagente_modulo',
|
||||||
|
[
|
||||||
|
'id_agente' => $agent['id_agente'],
|
||||||
|
'id_module_group' => $id_module_group,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (is_array($modules) === true && count($modules) > 0) {
|
||||||
|
$secmon_status = secmon_status($agent['id_agente']);
|
||||||
|
$data = [];
|
||||||
|
$data[0] = '<b>'.__('SecurityMon').'</b>';
|
||||||
|
$data[1] = ui_print_status_secmon_div($secmon_status, __('Total security modules: %s', count($modules)));
|
||||||
|
$table_contact->data[] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hardening line.
|
||||||
|
$module_score = modules_get_agentmodule_id(io_safe_input('Hardening - Score'), $agent['id_agente']);
|
||||||
|
$hardening = '';
|
||||||
|
if (is_array($module_score) === true && key_exists('id_agente_modulo', $module_score) == true) {
|
||||||
|
$raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time());
|
||||||
|
$hardening = format_numeric($raw_data_score[0]['datos'], 2);
|
||||||
|
$data = [];
|
||||||
|
$data[0] = '<b>'.__('Hardening').'</b>';
|
||||||
|
$data[1] = $hardening.' %';
|
||||||
|
$table_contact->data[] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vulnerabilities line.
|
||||||
|
$vuls = get_vulnerabilities($agent['id_agente']);
|
||||||
|
if (is_array($vuls) === true && count($vuls) > 0) {
|
||||||
|
$score = get_score($vuls);
|
||||||
|
$data = [];
|
||||||
|
$data[0] = '<b>'.__('Vulnerability').'</b>';
|
||||||
|
$data[1] = ui_print_status_vulnerability_div($score);
|
||||||
|
$table_contact->data[] = $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Optional data
|
||||||
|
// Position Information.
|
||||||
|
if ((bool) $config['activate_gis'] === true) {
|
||||||
|
$data = [];
|
||||||
|
|
||||||
|
$dataPositionAgent = gis_get_data_last_position_agent(
|
||||||
|
$agent['id_agente']
|
||||||
|
);
|
||||||
|
if (is_array($dataPositionAgent) === true && $dataPositionAgent['stored_longitude'] !== '' && $dataPositionAgent['stored_latitude'] !== '') {
|
||||||
|
$data[0] = __('Position (Long, Lat)');
|
||||||
|
|
||||||
|
$dataOptionalOutput = html_print_anchor(
|
||||||
|
[
|
||||||
|
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente='.$id_agente,
|
||||||
|
'content' => $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'],
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
if (empty($dataPositionAgent['description']) === false) {
|
||||||
|
$dataOptionalOutput .= ' ('.$dataPositionAgent['description'].')';
|
||||||
|
}
|
||||||
|
|
||||||
|
$data[1] = $dataOptionalOutput;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table_contact->data[] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Timezone Offset.
|
||||||
|
if ((int) $agent['timezone_offset'] !== 0) {
|
||||||
|
$data = [];
|
||||||
|
$data[0] = __('Timezone Offset');
|
||||||
|
$data[1] = $agent['timezone_offset'];
|
||||||
|
$table_contact->data[] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
$agent_contact = html_print_div(
|
$agent_contact = html_print_div(
|
||||||
[
|
[
|
||||||
'class' => 'agent_details_header',
|
'class' => 'agent_details_header',
|
||||||
@ -4857,3 +4974,24 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||||||
|
|
||||||
return $agent_contact;
|
return $agent_contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an array with a list of status agents
|
||||||
|
*
|
||||||
|
* @return array.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function agents_status_list()
|
||||||
|
{
|
||||||
|
$status_list = [];
|
||||||
|
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||||
|
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||||
|
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
||||||
|
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||||
|
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||||
|
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||||
|
|
||||||
|
return $status_list;
|
||||||
|
}
|
@ -2169,13 +2169,16 @@ function get_group_alerts(
|
|||||||
$strict_user=false,
|
$strict_user=false,
|
||||||
$tag=false,
|
$tag=false,
|
||||||
$action_filter=false,
|
$action_filter=false,
|
||||||
$alert_action=true
|
$alert_action=true,
|
||||||
|
$search_sg=false
|
||||||
) {
|
) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$group_query = '';
|
$group_query = '';
|
||||||
if (!empty($idGroup)) {
|
if (!empty($idGroup)) {
|
||||||
$group_query = ' AND id_grupo = '.$idGroup;
|
$group_query = ' AND id_grupo = '.$idGroup;
|
||||||
|
if ((bool) $search_sg === true) {
|
||||||
|
$group_query .= ' OR tasg.id_group = '.$idGroup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($filter)) {
|
if (is_array($filter)) {
|
||||||
|
@ -82,7 +82,7 @@ function parseOtherParameter($other, $otherType, $rawDecode)
|
|||||||
case 'url_encode':
|
case 'url_encode':
|
||||||
$returnVar = [
|
$returnVar = [
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'data' => urldecode($other),
|
'data' => $rawDecode ? rawurldecode($other) : urldecode($other),
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -12952,7 +12952,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||||||
$values = [];
|
$values = [];
|
||||||
|
|
||||||
if ($other['data'][0] != '') {
|
if ($other['data'][0] != '') {
|
||||||
$values['event'] = $other['data'][0];
|
$values['event'] = io_safe_input(io_safe_output($other['data'][0]));
|
||||||
} else {
|
} else {
|
||||||
returnError('Event text required.');
|
returnError('Event text required.');
|
||||||
return;
|
return;
|
||||||
@ -13132,7 +13132,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||||||
|
|
||||||
if ($other['data'][18] != '') {
|
if ($other['data'][18] != '') {
|
||||||
$values['id_extra'] = $other['data'][18];
|
$values['id_extra'] = $other['data'][18];
|
||||||
$sql_validation = 'SELECT id_evento,estado,ack_utimestamp,id_usuario
|
$sql_validation = 'SELECT id_evento,estado,ack_utimestamp,id_usuario,event_custom_id
|
||||||
FROM tevento
|
FROM tevento
|
||||||
WHERE estado IN (0,2) AND id_extra ="'.$other['data'][18].'";';
|
WHERE estado IN (0,2) AND id_extra ="'.$other['data'][18].'";';
|
||||||
|
|
||||||
@ -13147,6 +13147,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||||||
$values['status'] = 2;
|
$values['status'] = 2;
|
||||||
$ack_utimestamp = $val['ack_utimestamp'];
|
$ack_utimestamp = $val['ack_utimestamp'];
|
||||||
$values['id_usuario'] = $val['id_usuario'];
|
$values['id_usuario'] = $val['id_usuario'];
|
||||||
|
$values['event_custom_id'] = $val['event_custom_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
api_set_validate_event_by_id($val['id_evento']);
|
api_set_validate_event_by_id($val['id_evento']);
|
||||||
@ -13177,7 +13178,8 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||||||
$custom_data,
|
$custom_data,
|
||||||
$values['server_id'],
|
$values['server_id'],
|
||||||
$values['id_extra'],
|
$values['id_extra'],
|
||||||
$ack_utimestamp
|
$ack_utimestamp,
|
||||||
|
$values['event_custom_id'] ?? null
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($other['data'][12] != '') {
|
if ($other['data'][12] != '') {
|
||||||
@ -17787,6 +17789,48 @@ function api_token_check(string $token)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set custom field value in tevento
|
||||||
|
*
|
||||||
|
* @param mixed $id_event Event id.
|
||||||
|
* @param mixed $custom_field Custom field to set.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function api_set_event_custom_id($id, $value)
|
||||||
|
{
|
||||||
|
// Get the event
|
||||||
|
$event = events_get_event($id, false, is_metaconsole());
|
||||||
|
// If event not exists, end the execution.
|
||||||
|
if ($event === false) {
|
||||||
|
returnError(
|
||||||
|
'event_not_exists',
|
||||||
|
'Event not exists'
|
||||||
|
);
|
||||||
|
$result = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Safe custom fields for hacks.
|
||||||
|
if (preg_match('/script/i', io_safe_output($value))) {
|
||||||
|
$result = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = events_event_custom_id(
|
||||||
|
$id,
|
||||||
|
$value
|
||||||
|
);
|
||||||
|
|
||||||
|
// If update results failed
|
||||||
|
if (empty($result) === true || $result === false) {
|
||||||
|
returnError(
|
||||||
|
'The event could not be updated'
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
returnData('string', ['data' => 'Event updated.']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract info Agents for inventories ITSM.
|
* Extract info Agents for inventories ITSM.
|
||||||
*
|
*
|
||||||
|
@ -249,10 +249,6 @@ function config_update_config()
|
|||||||
$error_update[] = __('Enable Netflow');
|
$error_update[] = __('Enable Netflow');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_update_value('activate_sflow', (bool) get_parameter('activate_sflow'), true) === false) {
|
|
||||||
$error_update[] = __('Enable Sflow');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config_update_value('activate_feedback', (bool) get_parameter('activate_feedback'), true) === false) {
|
if (config_update_value('activate_feedback', (bool) get_parameter('activate_feedback'), true) === false) {
|
||||||
$error_update[] = __('Enable Feedback');
|
$error_update[] = __('Enable Feedback');
|
||||||
}
|
}
|
||||||
@ -371,6 +367,10 @@ function config_update_config()
|
|||||||
$error_update[] = __('show_experimental_features');
|
$error_update[] = __('show_experimental_features');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config_update_value('number_modules_queue', get_parameter('number_modules_queue'), true) === false) {
|
||||||
|
$error_update[] = __('number_modules_queue');
|
||||||
|
}
|
||||||
|
|
||||||
if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) {
|
if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) {
|
||||||
$error_update[] = __('Console log enabled');
|
$error_update[] = __('Console log enabled');
|
||||||
}
|
}
|
||||||
@ -917,10 +917,6 @@ function config_update_config()
|
|||||||
$error_update[] = __('Batch statistics period (secs)');
|
$error_update[] = __('Batch statistics period (secs)');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_update_value('agentaccess', (int) get_parameter('agentaccess'), true) === false) {
|
|
||||||
$error_update[] = __('Use agent access graph');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config_update_value('num_files_attachment', (int) get_parameter('num_files_attachment'), true) === false) {
|
if (config_update_value('num_files_attachment', (int) get_parameter('num_files_attachment'), true) === false) {
|
||||||
$error_update[] = __('Max. recommended number of files in attachment directory');
|
$error_update[] = __('Max. recommended number of files in attachment directory');
|
||||||
}
|
}
|
||||||
@ -1623,6 +1619,10 @@ function config_update_config()
|
|||||||
if (config_update_value('netflow_get_ip_hostname', (int) get_parameter('netflow_get_ip_hostname'), true) === false) {
|
if (config_update_value('netflow_get_ip_hostname', (int) get_parameter('netflow_get_ip_hostname'), true) === false) {
|
||||||
$error_update[] = __('Name resolution for IP address');
|
$error_update[] = __('Name resolution for IP address');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config_update_value('activate_sflow', (bool) get_parameter('activate_sflow'), true) === false) {
|
||||||
|
$error_update[] = __('Enable Sflow');
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sflow':
|
case 'sflow':
|
||||||
@ -2237,10 +2237,6 @@ function config_process_config()
|
|||||||
config_update_value('show_qr_code_header', false);
|
config_update_value('show_qr_code_header', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($config['agentaccess'])) {
|
|
||||||
config_update_value('agentaccess', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($config['timezone'])) {
|
if (!isset($config['timezone'])) {
|
||||||
config_update_value('timezone', 'Europe/Berlin');
|
config_update_value('timezone', 'Europe/Berlin');
|
||||||
}
|
}
|
||||||
@ -2449,6 +2445,10 @@ function config_process_config()
|
|||||||
config_update_value('show_experimental_features', 0);
|
config_update_value('show_experimental_features', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($config['number_modules_queue'])) {
|
||||||
|
config_update_value('number_modules_queue', 500);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($config['agent_vulnerabilities'])) {
|
if (!isset($config['agent_vulnerabilities'])) {
|
||||||
config_update_value('agent_vulnerabilities', 1);
|
config_update_value('agent_vulnerabilities', 1);
|
||||||
}
|
}
|
||||||
|
@ -127,6 +127,58 @@ function events_translate_event_type($event_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module status event_type into descriptive text.
|
||||||
|
*
|
||||||
|
* @param integer $event_type Event type.
|
||||||
|
*
|
||||||
|
* @return string Module status.
|
||||||
|
*/
|
||||||
|
function events_status_module_event_type($event_type)
|
||||||
|
{
|
||||||
|
$module_status = '';
|
||||||
|
switch ($event_type) {
|
||||||
|
case 'alert_fired':
|
||||||
|
case 'alert_recovered':
|
||||||
|
case 'alert_ceased':
|
||||||
|
case 'alert_manual_validation':
|
||||||
|
$module_status = AGENT_MODULE_STATUS_CRITICAL_ALERT;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'going_down_normal':
|
||||||
|
case 'going_up_normal':
|
||||||
|
$module_status = AGENT_MODULE_STATUS_NORMAL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'going_unknown':
|
||||||
|
case 'unknown':
|
||||||
|
$module_status = AGENT_MODULE_STATUS_UNKNOWN;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'going_up_warning':
|
||||||
|
case 'going_down_warning':
|
||||||
|
$module_status = AGENT_MODULE_STATUS_WARNING;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'going_up_critical':
|
||||||
|
case 'going_down_critical':
|
||||||
|
$module_status = AGENT_MODULE_STATUS_CRITICAL_BAD;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'recon_host_detected':
|
||||||
|
case 'system':
|
||||||
|
case 'error':
|
||||||
|
case 'new_agent':
|
||||||
|
case 'configuration_change':
|
||||||
|
default:
|
||||||
|
$module_status = AGENT_MODULE_STATUS_NOT_INIT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $module_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates a numeric value event_status into descriptive text.
|
* Translates a numeric value event_status into descriptive text.
|
||||||
*
|
*
|
||||||
@ -219,6 +271,7 @@ function events_get_all_fields()
|
|||||||
$columns['module_status'] = __('Module status');
|
$columns['module_status'] = __('Module status');
|
||||||
$columns['module_custom_id'] = __('Module custom id');
|
$columns['module_custom_id'] = __('Module custom id');
|
||||||
$columns['custom_data'] = __('Custom data');
|
$columns['custom_data'] = __('Custom data');
|
||||||
|
$columns['event_custom_id'] = __('Event Custom ID');
|
||||||
|
|
||||||
return $columns;
|
return $columns;
|
||||||
}
|
}
|
||||||
@ -322,6 +375,9 @@ function events_get_column_name($field, $table_alias=false)
|
|||||||
case 'custom_data':
|
case 'custom_data':
|
||||||
return __('Custom data');
|
return __('Custom data');
|
||||||
|
|
||||||
|
case 'event_custom_id':
|
||||||
|
return __('Event Custom ID');
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return __($field);
|
return __($field);
|
||||||
}
|
}
|
||||||
@ -982,6 +1038,9 @@ function events_get_all(
|
|||||||
|
|
||||||
case EVENT_NO_VALIDATED:
|
case EVENT_NO_VALIDATED:
|
||||||
$filter['status'][$key] = (EVENT_NEW.', '.EVENT_PROCESS);
|
$filter['status'][$key] = (EVENT_NEW.', '.EVENT_PROCESS);
|
||||||
|
|
||||||
|
case EVENT_NO_PROCESS:
|
||||||
|
$filter['status'][$key] = (EVENT_NEW.', '.EVENT_VALIDATE);
|
||||||
default:
|
default:
|
||||||
// Ignore.
|
// Ignore.
|
||||||
break;
|
break;
|
||||||
@ -1027,6 +1086,24 @@ function events_get_all(
|
|||||||
$validatedState
|
$validatedState
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EVENT_NO_PROCESS:
|
||||||
|
// Show comments in validated events.
|
||||||
|
$validatedState = '';
|
||||||
|
if ($validatedEvents === true) {
|
||||||
|
$validatedState = sprintf(
|
||||||
|
'OR estado = %d',
|
||||||
|
EVENT_VALIDATE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_filters[] = sprintf(
|
||||||
|
' AND (estado = %d OR estado = %d %s)',
|
||||||
|
EVENT_NEW,
|
||||||
|
EVENT_VALIDATE,
|
||||||
|
$validatedState
|
||||||
|
);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2335,7 +2412,8 @@ function events_create_event(
|
|||||||
$custom_data='',
|
$custom_data='',
|
||||||
$server_id=0,
|
$server_id=0,
|
||||||
$id_extra='',
|
$id_extra='',
|
||||||
$ack_utimestamp=0
|
$ack_utimestamp=0,
|
||||||
|
$event_custom_id=null
|
||||||
) {
|
) {
|
||||||
if ($source === false) {
|
if ($source === false) {
|
||||||
$source = get_product_name();
|
$source = get_product_name();
|
||||||
@ -2367,6 +2445,7 @@ function events_create_event(
|
|||||||
'custom_data' => $custom_data,
|
'custom_data' => $custom_data,
|
||||||
'data' => '',
|
'data' => '',
|
||||||
'module_status' => 0,
|
'module_status' => 0,
|
||||||
|
'event_custom_id' => $event_custom_id,
|
||||||
];
|
];
|
||||||
|
|
||||||
return (int) db_process_sql_insert('tevento', $values);
|
return (int) db_process_sql_insert('tevento', $values);
|
||||||
@ -2590,7 +2669,6 @@ function events_print_type_img(
|
|||||||
$urlImage = ui_get_full_url(false);
|
$urlImage = ui_get_full_url(false);
|
||||||
$icon = '';
|
$icon = '';
|
||||||
$style = 'main_menu_icon';
|
$style = 'main_menu_icon';
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'alert_recovered':
|
case 'alert_recovered':
|
||||||
$icon = 'images/alert_recovered@svg.svg';
|
$icon = 'images/alert_recovered@svg.svg';
|
||||||
@ -2656,16 +2734,6 @@ function events_print_type_img(
|
|||||||
if ($only_url) {
|
if ($only_url) {
|
||||||
$output = $urlImage.'/'.$icon;
|
$output = $urlImage.'/'.$icon;
|
||||||
} else {
|
} else {
|
||||||
/*
|
|
||||||
$output .= html_print_div(
|
|
||||||
[
|
|
||||||
'title' => events_print_type_description($type, true),
|
|
||||||
'class' => $style,
|
|
||||||
'style' => ((empty($icon) === false) ? 'background-image: url('.$icon.'); background-repeat: no-repeat;' : ''),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
$output .= html_print_image(
|
$output .= html_print_image(
|
||||||
$icon,
|
$icon,
|
||||||
true,
|
true,
|
||||||
@ -3204,12 +3272,14 @@ function events_get_all_status($report=false)
|
|||||||
$fields[1] = __('Only validated');
|
$fields[1] = __('Only validated');
|
||||||
$fields[2] = __('Only in process');
|
$fields[2] = __('Only in process');
|
||||||
$fields[3] = __('Only not validated');
|
$fields[3] = __('Only not validated');
|
||||||
|
$fields[4] = __('Only not in process');
|
||||||
} else {
|
} else {
|
||||||
$fields[-1] = __('All event');
|
$fields[-1] = __('All event');
|
||||||
$fields[0] = __('New');
|
$fields[0] = __('New');
|
||||||
$fields[1] = __('Validated');
|
$fields[1] = __('Validated');
|
||||||
$fields[2] = __('In process');
|
$fields[2] = __('In process');
|
||||||
$fields[3] = __('Not Validated');
|
$fields[3] = __('Not Validated');
|
||||||
|
$fields[4] = __('Not in process');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
@ -4039,8 +4109,14 @@ function events_get_response_target(
|
|||||||
if (empty($event['custom_data']) === false) {
|
if (empty($event['custom_data']) === false) {
|
||||||
$custom_data = json_decode($event['custom_data']);
|
$custom_data = json_decode($event['custom_data']);
|
||||||
foreach ($custom_data as $key => $value) {
|
foreach ($custom_data as $key => $value) {
|
||||||
|
if (is_array($value) === true) {
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$target = str_replace('_customdata_'.$k.'_', $v, $target);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$target = str_replace('_customdata_'.$key.'_', $value, $target);
|
$target = str_replace('_customdata_'.$key.'_', $value, $target);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($target, '_customdata_json_') !== false) {
|
if (strpos($target, '_customdata_json_') !== false) {
|
||||||
$target = str_replace('_customdata_json_', json_encode($custom_data), $target);
|
$target = str_replace('_customdata_json_', json_encode($custom_data), $target);
|
||||||
@ -4629,6 +4705,30 @@ function events_page_details($event, $server_id=0)
|
|||||||
$data[1] = '<i>'.__('N/A').'</i>';
|
$data[1] = '<i>'.__('N/A').'</i>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$table_details->data[] = $data;
|
||||||
|
$readonly = true;
|
||||||
|
if (check_acl($config['id_user'], 0, 'EW')) {
|
||||||
|
$readonly = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = [];
|
||||||
|
$data[0] = __('Event Custom ID');
|
||||||
|
$data[1] = '<div class="flex-row-center">'.html_print_input_text('event_custom_id', $event['event_custom_id'], '', false, 255, true, $readonly, false, '', 'w60p');
|
||||||
|
if ($readonly === false) {
|
||||||
|
$data[1] .= html_print_button(
|
||||||
|
__('Update'),
|
||||||
|
'update_event_custom_id',
|
||||||
|
false,
|
||||||
|
'update_event_custom_id('.$event['id_evento'].', '.$event['server_id'].');',
|
||||||
|
[
|
||||||
|
'icon' => 'next',
|
||||||
|
'mode' => 'link',
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data[1] .= '</div>';
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
|
|
||||||
$details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>';
|
$details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>';
|
||||||
@ -5999,8 +6099,38 @@ function get_count_event_criticity(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$status = ' ';
|
$status = ' ';
|
||||||
if ((int) $eventStatus !== -1) {
|
if (empty($eventStatus) === false) {
|
||||||
$status = 'AND estado = '.$eventStatus;
|
switch ($eventStatus) {
|
||||||
|
case EVENT_ALL:
|
||||||
|
default:
|
||||||
|
// Do not filter.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EVENT_NEW:
|
||||||
|
case EVENT_VALIDATE:
|
||||||
|
case EVENT_PROCESS:
|
||||||
|
$status = sprintf(
|
||||||
|
' AND estado = %d',
|
||||||
|
$eventStatus
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EVENT_NO_VALIDATED:
|
||||||
|
$status = sprintf(
|
||||||
|
' AND (estado = %d OR estado = %d)',
|
||||||
|
EVENT_NEW,
|
||||||
|
EVENT_PROCESS
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EVENT_NO_PROCESS:
|
||||||
|
$status = sprintf(
|
||||||
|
' AND (estado = %d OR estado = %d)',
|
||||||
|
EVENT_NEW,
|
||||||
|
EVENT_VALIDATE
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$criticity = ' ';
|
$criticity = ' ';
|
||||||
@ -6199,3 +6329,201 @@ function event_get_counter_extraId(array $event, ?array $filters)
|
|||||||
|
|
||||||
return $counters;
|
return $counters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update event detail custom field
|
||||||
|
*
|
||||||
|
* @param mixed $id_event Event ID or array of events.
|
||||||
|
* @param string $event_custom_id Event custom ID to be update.
|
||||||
|
*
|
||||||
|
* @return boolean Whether or not it was successful
|
||||||
|
*/
|
||||||
|
function events_event_custom_id(
|
||||||
|
$id_event,
|
||||||
|
$event_custom_id,
|
||||||
|
) {
|
||||||
|
global $config;
|
||||||
|
// Cleans up the selection for all unwanted values also casts any single
|
||||||
|
// values as an array.
|
||||||
|
if (![$id_event]) {
|
||||||
|
$id_event = (array) safe_int($id_event, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check ACL.
|
||||||
|
foreach ($id_event as $k => $id) {
|
||||||
|
$event_group = events_get_group($id);
|
||||||
|
if (check_acl($config['id_user'], $event_group, 'EW') == 0) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_ACL_VIOLATION,
|
||||||
|
'Attempted updating event #'.$id
|
||||||
|
);
|
||||||
|
|
||||||
|
unset($id_event[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($id_event) === true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the current event comments.
|
||||||
|
$first_event = $id_event;
|
||||||
|
if (is_array($id_event) === true) {
|
||||||
|
$first_event = reset($id_event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update comment.
|
||||||
|
$ret = db_process_sql_update(
|
||||||
|
'tevento',
|
||||||
|
['event_custom_id' => $event_custom_id],
|
||||||
|
['id_evento' => $first_event]
|
||||||
|
);
|
||||||
|
|
||||||
|
if (($ret === false) || ($ret === 0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function event_print_graph(
|
||||||
|
$filter,
|
||||||
|
$graph_height=100,
|
||||||
|
) {
|
||||||
|
global $config;
|
||||||
|
$show_all_data = false;
|
||||||
|
$events = events_get_all(['te.id_evento', 'te.timestamp', 'te.utimestamp'], $filter, null, null, 'te.utimestamp', true);
|
||||||
|
|
||||||
|
if (empty($filter['date_from']) === false
|
||||||
|
&& empty($filter['time_from']) === false
|
||||||
|
&& empty($filter['date_to']) === false
|
||||||
|
&& empty($filter['time_to']) === false
|
||||||
|
) {
|
||||||
|
$start_utimestamp = strtotime($filter['date_from'].' '.$filter['time_from']);
|
||||||
|
$end_utimestamp = strtotime($filter['date_to'].' '.$filter['time_to']);
|
||||||
|
} else if ($filter['event_view_hr'] !== '') {
|
||||||
|
$start_utimestamp = strtotime('-'.$filter['event_view_hr'].' hours');
|
||||||
|
$end_utimestamp = strtotime('now');
|
||||||
|
} else {
|
||||||
|
$show_all_data = true;
|
||||||
|
$start_utimestamp = $events[0]['utimestamp'];
|
||||||
|
$end_utimestamp = $events[array_key_last($events)]['utimestamp'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$data_events = [];
|
||||||
|
$control_timestamp = $start_utimestamp;
|
||||||
|
$count = 0;
|
||||||
|
foreach ($events as $event) {
|
||||||
|
if ($event['utimestamp'] === $control_timestamp) {
|
||||||
|
$count++;
|
||||||
|
} else {
|
||||||
|
$control_timestamp = $event['utimestamp'];
|
||||||
|
$count = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data_events[$control_timestamp] = $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
$num_data = count($data_events);
|
||||||
|
|
||||||
|
$num_intervals = $num_data;
|
||||||
|
|
||||||
|
$period = ($end_utimestamp - $start_utimestamp);
|
||||||
|
|
||||||
|
if ($period <= SECONDS_6HOURS) {
|
||||||
|
$chart_time_format = 'H:i:s';
|
||||||
|
} else if ($period < SECONDS_1DAY) {
|
||||||
|
$chart_time_format = 'H:i';
|
||||||
|
} else if ($period < SECONDS_15DAYS) {
|
||||||
|
$chart_time_format = 'M d H:i';
|
||||||
|
} else if ($period < SECONDS_1MONTH) {
|
||||||
|
$chart_time_format = 'M d H\h';
|
||||||
|
} else {
|
||||||
|
$chart_time_format = 'M d H\h';
|
||||||
|
}
|
||||||
|
|
||||||
|
$chart = [];
|
||||||
|
$labels = [];
|
||||||
|
$color = [];
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
|
if ($show_all_data === true) {
|
||||||
|
foreach ($events as $event) {
|
||||||
|
if ($event['utimestamp'] === $control_timestamp) {
|
||||||
|
$count++;
|
||||||
|
} else {
|
||||||
|
$control_timestamp = $event['utimestamp'];
|
||||||
|
$count = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data_events[$control_timestamp] = $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data_events = array_reverse($data_events, true);
|
||||||
|
|
||||||
|
foreach ($data_events as $utimestamp => $count) {
|
||||||
|
$labels[] = date($chart_time_format, $utimestamp);
|
||||||
|
$chart[] = [
|
||||||
|
'y' => $count,
|
||||||
|
'x' => date($chart_time_format, $utimestamp),
|
||||||
|
];
|
||||||
|
$color[] = '#82b92f';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$interval_length = (int) ($period / $num_intervals);
|
||||||
|
$intervals = [];
|
||||||
|
$intervals[0] = $start_utimestamp;
|
||||||
|
for ($i = 0; $i < $num_intervals; $i++) {
|
||||||
|
$intervals[($i + 1)] = ($intervals[$i] + $interval_length);
|
||||||
|
}
|
||||||
|
|
||||||
|
$control_data = [];
|
||||||
|
|
||||||
|
foreach ($data_events as $utimestamp => $count_event) {
|
||||||
|
for ($i = 0; $i < $num_intervals; $i++) {
|
||||||
|
if ((int) $utimestamp > (int) $intervals[$i] && (int) $utimestamp < (int) $intervals[($i + 1)]) {
|
||||||
|
$control_data[(string) $intervals[$i]] += $count_event;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i = 0; $i < $num_intervals; $i++) {
|
||||||
|
$labels[] = date($chart_time_format, $intervals[$i]);
|
||||||
|
$chart[] = [
|
||||||
|
'y' => $control_data[$intervals[$i]],
|
||||||
|
'x' => date($chart_time_format, $intervals[$i]),
|
||||||
|
];
|
||||||
|
$color[] = '#82b92f';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$water_mark = [
|
||||||
|
'file' => $config['homedir'].'/images/logo_vertical_water.png',
|
||||||
|
'url' => ui_get_full_url('/images/logo_vertical_water.png'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$options = [
|
||||||
|
'height' => $graph_height,
|
||||||
|
'waterMark' => $water_mark,
|
||||||
|
'legend' => ['display' => false],
|
||||||
|
'colors' => $color,
|
||||||
|
'border' => false,
|
||||||
|
'scales' => [
|
||||||
|
'x' => [
|
||||||
|
'grid' => ['display' => false],
|
||||||
|
],
|
||||||
|
'y' => [
|
||||||
|
'grid' => ['display' => false],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'labels' => $labels,
|
||||||
|
];
|
||||||
|
|
||||||
|
$graph = '<div style="width:100%; height: '.$graph_height.'px;">';
|
||||||
|
$graph .= vbar_graph($chart, $options);
|
||||||
|
$graph .= '</div>';
|
||||||
|
|
||||||
|
return $graph;
|
||||||
|
}
|
||||||
|
@ -1585,7 +1585,7 @@ function gis_add_conection_maps_in_form($map_connection_list)
|
|||||||
<tr class="row_0">
|
<tr class="row_0">
|
||||||
<td>'.html_print_input_text('map_connection_name_'.$mapConnection['id_conection'], $mapConnectionRowDB['conection_name'], '', 20, 40, true, true).'</td>
|
<td>'.html_print_input_text('map_connection_name_'.$mapConnection['id_conection'], $mapConnectionRowDB['conection_name'], '', 20, 40, true, true).'</td>
|
||||||
<td>'.$radioButton.'</td>
|
<td>'.$radioButton.'</td>
|
||||||
<td><a id="delete_row" href="javascript: deleteConnectionMap(\''.$mapConnection['id_conection'].'\')">'.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter']).'</a></td>
|
<td><a id="delete_row" href="javascript: deleteConnectionMap(\''.$mapConnection['id_conection'].'\')">'.html_print_image('images/delete.svg', true, ['alt' => '', 'class' => 'invert_filter main_menu_icon']).'</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -2525,92 +2525,6 @@ function combined_graph_summatory_average(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Print a graph with access data of agents.
|
|
||||||
*
|
|
||||||
* @param integer $id_agent Agent Id.
|
|
||||||
* @param integer $period Timestamp period graph.
|
|
||||||
* @param boolean|null $return Type return.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function graphic_agentaccess(
|
|
||||||
int $id_agent,
|
|
||||||
int $period=0,
|
|
||||||
?bool $return=false,
|
|
||||||
?bool $agent_view=false
|
|
||||||
) {
|
|
||||||
global $config;
|
|
||||||
|
|
||||||
// Dates.
|
|
||||||
$date = get_system_time();
|
|
||||||
$datelimit = ($date - $period);
|
|
||||||
$interval = 3600;
|
|
||||||
|
|
||||||
// Query.
|
|
||||||
$sql = sprintf(
|
|
||||||
'SELECT utimestamp, count(*) as data
|
|
||||||
FROM tagent_access
|
|
||||||
WHERE id_agent = %d
|
|
||||||
AND utimestamp >= %d
|
|
||||||
AND utimestamp <= %d
|
|
||||||
GROUP BY TRUNCATE(utimestamp/%d,0)',
|
|
||||||
$id_agent,
|
|
||||||
$datelimit,
|
|
||||||
$date,
|
|
||||||
$interval
|
|
||||||
);
|
|
||||||
|
|
||||||
$data = db_get_all_rows_sql($sql);
|
|
||||||
|
|
||||||
// Array data.
|
|
||||||
$data_array = [];
|
|
||||||
$colors = [];
|
|
||||||
if (isset($data) === true && is_array($data) === true) {
|
|
||||||
foreach ($data as $value) {
|
|
||||||
$time = io_safe_output(date('H:m', $value['utimestamp']));
|
|
||||||
$labels[] = $time;
|
|
||||||
$data_array[] = [
|
|
||||||
'y' => (int) $value['data'],
|
|
||||||
'x' => $time,
|
|
||||||
];
|
|
||||||
|
|
||||||
$colors[] = '#82b92f';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$options = [];
|
|
||||||
$options['grid']['hoverable'] = true;
|
|
||||||
|
|
||||||
if ($agent_view === true) {
|
|
||||||
$options['agent_view'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$options = [
|
|
||||||
'height' => 125,
|
|
||||||
'colors' => $colors,
|
|
||||||
'legend' => ['display' => false],
|
|
||||||
'scales' => [
|
|
||||||
'x' => [
|
|
||||||
'grid' => ['display' => false],
|
|
||||||
'ticks' => [
|
|
||||||
'fonts' => ['size' => 8],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'y' => [
|
|
||||||
'grid' => ['display' => false],
|
|
||||||
'ticks' => [
|
|
||||||
'fonts' => ['size' => 8],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'labels' => $labels,
|
|
||||||
];
|
|
||||||
|
|
||||||
return vbar_graph($data_array, $options);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a pie graph with alerts defined/fired data
|
* Print a pie graph with alerts defined/fired data
|
||||||
*
|
*
|
||||||
|
@ -774,6 +774,7 @@ function html_print_select(
|
|||||||
$select2_multiple_enable_all=false,
|
$select2_multiple_enable_all=false,
|
||||||
$form='',
|
$form='',
|
||||||
$order=false,
|
$order=false,
|
||||||
|
$custom_id=null
|
||||||
) {
|
) {
|
||||||
$output = "\n";
|
$output = "\n";
|
||||||
|
|
||||||
@ -789,6 +790,10 @@ function html_print_select(
|
|||||||
|
|
||||||
$id = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : ''));
|
$id = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : ''));
|
||||||
|
|
||||||
|
if ($custom_id !== null) {
|
||||||
|
$id = $custom_id;
|
||||||
|
}
|
||||||
|
|
||||||
$attributes = '';
|
$attributes = '';
|
||||||
if (!empty($script)) {
|
if (!empty($script)) {
|
||||||
$attributes .= ' onchange="'.$script.'"';
|
$attributes .= ' onchange="'.$script.'"';
|
||||||
@ -1740,12 +1745,13 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
$output .= html_print_input(
|
$output .= html_print_input(
|
||||||
[
|
[
|
||||||
'label' => __('Agents'),
|
'label' => __('Agents'),
|
||||||
'label_class' => 'font-title-font',
|
'label_class' => 'font-title-font',
|
||||||
'type' => 'select_from_sql',
|
'type' => 'select',
|
||||||
'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
|
'fields' => $agents,
|
||||||
'name' => 'filtered-module-agents-'.$uniqId,
|
'name' => 'filtered-module-agents-'.$uniqId,
|
||||||
'selected' => explode(',', $data['mAgents']),
|
'selected' => explode(',', $data['mAgents']),
|
||||||
'return' => true,
|
'return' => true,
|
||||||
@ -1754,6 +1760,22 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$output .= html_print_input(
|
||||||
|
[
|
||||||
|
'label' => __('Agents'),
|
||||||
|
'label_class' => 'font-title-font',
|
||||||
|
'type' => 'select_from_sql',
|
||||||
|
'sql' => 'SELECT `id_agente`,`alias` FROM tagente',
|
||||||
|
'name' => 'filtered-module-agents-'.$uniqId,
|
||||||
|
'selected' => explode(',', $data['mAgents']),
|
||||||
|
'return' => true,
|
||||||
|
'multiple' => true,
|
||||||
|
'style' => 'min-width: 200px;max-width:200px;',
|
||||||
|
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$commonModules = 0;
|
$commonModules = 0;
|
||||||
if (empty($data['mShowCommonModules']) === false) {
|
if (empty($data['mShowCommonModules']) === false) {
|
||||||
@ -4939,8 +4961,8 @@ function html_print_input_file($name, $return=false, $options=false, $inline_upl
|
|||||||
$inline_upload_anchor_to_form
|
$inline_upload_anchor_to_form
|
||||||
),
|
),
|
||||||
[
|
[
|
||||||
'mode' => 'link',
|
'class' => 'secondary',
|
||||||
'style' => 'min-width: initial;',
|
'style' => 'min-width: initial; position: relative; margin-left: 5%; ',
|
||||||
],
|
],
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
@ -7305,8 +7327,10 @@ function html_print_select_date_range(
|
|||||||
$time_end='',
|
$time_end='',
|
||||||
$date_text=SECONDS_1DAY,
|
$date_text=SECONDS_1DAY,
|
||||||
$class='w100p',
|
$class='w100p',
|
||||||
$date_format='Y/m/d',
|
$date_format_php='Y/m/d',
|
||||||
$time_format='H:i:s'
|
$time_format_php='H:i:s',
|
||||||
|
$date_format_js='yy/mm/dd',
|
||||||
|
$time_format_js='HH:mm:ss'
|
||||||
) {
|
) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
@ -7328,21 +7352,21 @@ function html_print_select_date_range(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($date_end === '') {
|
if ($date_end === '') {
|
||||||
$date_end = date($date_format);
|
$date_end = date($date_format_php);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($date_init === '') {
|
if ($date_init === '') {
|
||||||
$date_init = date($date_format, strtotime($date_end.' -1 days'));
|
$date_init = date($date_format_php, strtotime($date_end.' -1 days'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_init = date($date_format, strtotime($date_init));
|
$date_init = date($date_format_php, strtotime($date_init));
|
||||||
|
|
||||||
if ($time_init === '') {
|
if ($time_init === '') {
|
||||||
$time_init = date($time_format);
|
$time_init = date($time_format_php);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($time_end === '') {
|
if ($time_end === '') {
|
||||||
$time_end = date($time_format);
|
$time_end = date($time_format_php);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields[SECONDS_1DAY] = __('Last 24hr');
|
$fields[SECONDS_1DAY] = __('Last 24hr');
|
||||||
@ -7508,7 +7532,7 @@ function html_print_select_date_range(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#text-date').datepicker({
|
$('#text-date').datepicker({
|
||||||
dateFormat: '".DATE_FORMAT_JS."',
|
dateFormat: '".$date_format_js."',
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
changeYear: true,
|
changeYear: true,
|
||||||
showAnim: 'slideDown'
|
showAnim: 'slideDown'
|
||||||
@ -7516,7 +7540,7 @@ function html_print_select_date_range(
|
|||||||
|
|
||||||
$('[id^=text-time_init]').timepicker({
|
$('[id^=text-time_init]').timepicker({
|
||||||
showSecond: true,
|
showSecond: true,
|
||||||
timeFormat: '".TIME_FORMAT_JS."',
|
timeFormat: '".$time_format_js."',
|
||||||
timeOnlyTitle: '".__('Choose time')."',
|
timeOnlyTitle: '".__('Choose time')."',
|
||||||
timeText: '".__('Time')."',
|
timeText: '".__('Time')."',
|
||||||
hourText: '".__('Hour')."',
|
hourText: '".__('Hour')."',
|
||||||
@ -7527,7 +7551,7 @@ function html_print_select_date_range(
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('[id^=text-date_init]').datepicker ({
|
$('[id^=text-date_init]').datepicker ({
|
||||||
dateFormat: '".DATE_FORMAT_JS."',
|
dateFormat: '".$date_format_js."',
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
changeYear: true,
|
changeYear: true,
|
||||||
showAnim: 'slideDown',
|
showAnim: 'slideDown',
|
||||||
@ -7549,7 +7573,7 @@ function html_print_select_date_range(
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('[id^=text-date_end]').datepicker ({
|
$('[id^=text-date_end]').datepicker ({
|
||||||
dateFormat: '".DATE_FORMAT_JS."',
|
dateFormat: '".$date_format_js."',
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
changeYear: true,
|
changeYear: true,
|
||||||
showAnim: 'slideDown',
|
showAnim: 'slideDown',
|
||||||
@ -7572,7 +7596,7 @@ function html_print_select_date_range(
|
|||||||
|
|
||||||
$('[id^=text-time_end]').timepicker({
|
$('[id^=text-time_end]').timepicker({
|
||||||
showSecond: true,
|
showSecond: true,
|
||||||
timeFormat: '".TIME_FORMAT_JS."',
|
timeFormat: '".$time_format_js."',
|
||||||
timeOnlyTitle: '".__('Choose time')."',
|
timeOnlyTitle: '".__('Choose time')."',
|
||||||
timeText: '".__('Time')."',
|
timeText: '".__('Time')."',
|
||||||
hourText: '".__('Hour')."',
|
hourText: '".__('Hour')."',
|
||||||
|
61
pandora_console/include/functions_macros.php
Normal file
61
pandora_console/include/functions_macros.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Pandora FMS - https://pandorafms.com
|
||||||
|
// ==================================================
|
||||||
|
// Copyright (c) 2005-2023 Pandora FMS
|
||||||
|
// Please see https://pandorafms.com/community/ 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.
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return array with macros of agent like core.pm
|
||||||
|
*
|
||||||
|
* @param interger $id_agente Id agent to return data.
|
||||||
|
*
|
||||||
|
* @return array Array with all macros.
|
||||||
|
*/
|
||||||
|
function return_agent_macros($id_agente)
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
$array_macros = [];
|
||||||
|
$grupo = [];
|
||||||
|
$agente = db_get_row_sql(
|
||||||
|
'SELECT * FROM tagente WHERE id_agente = '.$id_agente
|
||||||
|
);
|
||||||
|
if (isset($agente['id_grupo'])) {
|
||||||
|
$grupo = db_get_row_sql(
|
||||||
|
'SELECT * FROM tgrupo WHERE id_grupo = '.$agente['id_grupo']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($agente['server_name'])) {
|
||||||
|
$server_ip = db_get_row_sql(
|
||||||
|
'SELECT ip_address FROM tserver WHERE name = "'.$agente['server_name'].'"'
|
||||||
|
)['id_address'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$array_macros = [
|
||||||
|
'_agentname_' => ($agente['nombre']) ?: '',
|
||||||
|
'_agentalias_' => ($agente['alias']) ?: '',
|
||||||
|
'_agent_' => ($agente['alias']) ?: (($agente['nombre']) ?: ''),
|
||||||
|
'_agentcustomid_' => ($agente['custom_id']) ?: '',
|
||||||
|
'_agentdescription_' => ($agente['comentarios']) ?: '',
|
||||||
|
'_agentgroup_' => ($grupo['nombre']) ?: '',
|
||||||
|
'_agentos_' => ($agente['id_os']) ?: '',
|
||||||
|
'_address_' => ($agente['direccion']) ?: '',
|
||||||
|
'_homeurl_' => ($config['public_url']) ?: '',
|
||||||
|
'_groupcontact_' => ($agente['contact']) ?: '',
|
||||||
|
'_groupcustomid_' => ($agente['custom_id']) ?: '',
|
||||||
|
'_groupother_' => ($agente['other']) ?: '',
|
||||||
|
'_server_ip_' => ($server_ip) ?: '',
|
||||||
|
'_server_name_' => ($agente['server_name']) ?: '',
|
||||||
|
];
|
||||||
|
|
||||||
|
return $array_macros;
|
||||||
|
}
|
@ -1003,7 +1003,7 @@ if (is_ajax()) {
|
|||||||
$dialogButtons = [];
|
$dialogButtons = [];
|
||||||
|
|
||||||
$dialogButtons[] = html_print_button(
|
$dialogButtons[] = html_print_button(
|
||||||
__('Update manager'),
|
__('Warp update'),
|
||||||
'update_manager',
|
'update_manager',
|
||||||
false,
|
false,
|
||||||
'location.href="'.ui_get_full_url('/index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=history', false, false, false).'"',
|
'location.href="'.ui_get_full_url('/index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=history', false, false, false).'"',
|
||||||
@ -1170,6 +1170,14 @@ if (is_ajax()) {
|
|||||||
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
|
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 15%;">
|
||||||
|
<p><span>'.$sys_info->data->distroInfo->name.'</span></p>
|
||||||
|
</th>
|
||||||
|
<th style="width: 85%;">
|
||||||
|
<p style="font-size: 10pt;">'.$sys_info->data->distroInfo->value.'</p>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 15%;">
|
<th style="width: 15%;">
|
||||||
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
|
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
|
||||||
|
@ -122,6 +122,7 @@ function messages_create_message(
|
|||||||
'id_usuario_origen' => $usuario_origen,
|
'id_usuario_origen' => $usuario_origen,
|
||||||
'subject' => $subject,
|
'subject' => $subject,
|
||||||
'mensaje' => $mensaje,
|
'mensaje' => $mensaje,
|
||||||
|
'subtype' => 'NOTIF.MESSAGE',
|
||||||
'id_source' => get_notification_source_id('message'),
|
'id_source' => get_notification_source_id('message'),
|
||||||
'timestamp' => get_system_time(),
|
'timestamp' => get_system_time(),
|
||||||
]
|
]
|
||||||
|
@ -251,6 +251,11 @@ function modules_copy_agent_module_to_agent($id_agent_module, $id_destiny_agent,
|
|||||||
unset($new_module['id_agente_modulo']);
|
unset($new_module['id_agente_modulo']);
|
||||||
unset($new_module['id_agente']);
|
unset($new_module['id_agente']);
|
||||||
|
|
||||||
|
// Set debug content.
|
||||||
|
if (empty($new_module['debug_content']) === false) {
|
||||||
|
$new_module['debug_content'] = str_replace("'", '"', $new_module['debug_content']);
|
||||||
|
}
|
||||||
|
|
||||||
$id_new_module = modules_create_agent_module(
|
$id_new_module = modules_create_agent_module(
|
||||||
$id_destiny_agent,
|
$id_destiny_agent,
|
||||||
$new_module['nombre'],
|
$new_module['nombre'],
|
||||||
@ -4735,7 +4740,7 @@ function export_agents_module_csv($filters)
|
|||||||
$query_filter .= ' AND tam.nombre IN '.$module_filter.' ';
|
$query_filter .= ' AND tam.nombre IN '.$module_filter.' ';
|
||||||
} else {
|
} else {
|
||||||
$module_filter = '('.implode(', ', $filter).')';
|
$module_filter = '('.implode(', ', $filter).')';
|
||||||
$query_filter .= ' AND tam.id_tipo_modulo IN '.$module_filter.' ';
|
$query_filter .= ' AND tam.id_agente_modulo IN '.$module_filter.' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -142,7 +142,6 @@ function notifications_get_subtypes(?string $source=null)
|
|||||||
'NOTIF.PANDORADB.HISTORICAL',
|
'NOTIF.PANDORADB.HISTORICAL',
|
||||||
'NOTIF.HISTORYDB.MR',
|
'NOTIF.HISTORYDB.MR',
|
||||||
'NOTIF.EXT.ELASTICSEARCH',
|
'NOTIF.EXT.ELASTICSEARCH',
|
||||||
'NOTIF.EXT.LOGSTASH',
|
|
||||||
'NOTIF.METACONSOLE.DB_CONNECTION',
|
'NOTIF.METACONSOLE.DB_CONNECTION',
|
||||||
'NOTIF.DOWNTIME',
|
'NOTIF.DOWNTIME',
|
||||||
'NOTIF.UPDATEMANAGER.REGISTRATION',
|
'NOTIF.UPDATEMANAGER.REGISTRATION',
|
||||||
@ -659,7 +658,15 @@ function notifications_get_user_label_status($source, $user, $label)
|
|||||||
*/
|
*/
|
||||||
function notifications_set_user_label_status($source, $user, $label, $value)
|
function notifications_set_user_label_status($source, $user, $label, $value)
|
||||||
{
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$user_info = get_user_info($config['id_user']);
|
||||||
|
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$source_info = notifications_get_all_sources(['id' => $source]);
|
$source_info = notifications_get_all_sources(['id' => $source]);
|
||||||
|
|
||||||
if (!isset($source_info[0])
|
if (!isset($source_info[0])
|
||||||
|| !$source_info[0]['enabled']
|
|| !$source_info[0]['enabled']
|
||||||
|| !$source_info[0]['user_editable']
|
|| !$source_info[0]['user_editable']
|
||||||
@ -1059,7 +1066,7 @@ function notification_filter()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'UPDATEMANAGER':
|
case 'UPDATEMANAGER':
|
||||||
$type_name = 'UPDATE MANAGER';
|
$type_name = 'WARP UPDATE';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ALLOWOVERRIDE':
|
case 'ALLOWOVERRIDE':
|
||||||
|
@ -308,7 +308,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
|
|||||||
'del',
|
'del',
|
||||||
'images/delete.svg',
|
'images/delete.svg',
|
||||||
1,
|
1,
|
||||||
'',
|
'background-color: transparent !important;',
|
||||||
true,
|
true,
|
||||||
[
|
[
|
||||||
'onclick' => 'delete_profile(event, this)',
|
'onclick' => 'delete_profile(event, this)',
|
||||||
@ -316,8 +316,15 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$data['actions'] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
$data['actions'] = '<form method="post" onsubmit="">';
|
||||||
$data['actions'] .= html_print_input_image('del', 'images/delete.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']);
|
$data['actions'] .= html_print_input_image(
|
||||||
|
'del',
|
||||||
|
'images/delete.svg',
|
||||||
|
1,
|
||||||
|
'background-color: transparent !important;',
|
||||||
|
true,
|
||||||
|
['class' => 'main_menu_icon invert_filter']
|
||||||
|
);
|
||||||
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
|
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
|
||||||
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
|
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
|
||||||
$data['actions'] .= html_print_input_hidden('id_user', $id, true);
|
$data['actions'] .= html_print_input_hidden('id_user', $id, true);
|
||||||
@ -391,7 +398,14 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
|
|||||||
|
|
||||||
$data['last_hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true);
|
$data['last_hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true);
|
||||||
|
|
||||||
$data['last_actions'] = html_print_input_image('add', 'images/validate.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']);
|
$data['last_actions'] = html_print_input_image(
|
||||||
|
'add',
|
||||||
|
'images/validate.svg',
|
||||||
|
1,
|
||||||
|
'background-color: transparent !important;',
|
||||||
|
true,
|
||||||
|
['class' => 'main_menu_icon invert_filter']
|
||||||
|
);
|
||||||
$data['last_actions'] .= html_print_input_hidden('id', $id, true);
|
$data['last_actions'] .= html_print_input_hidden('id', $id, true);
|
||||||
$data['last_actions'] .= html_print_input_hidden('add_profile', 1, true);
|
$data['last_actions'] .= html_print_input_hidden('add_profile', 1, true);
|
||||||
$data['last_actions'] .= '</form>';
|
$data['last_actions'] .= '</form>';
|
||||||
|
@ -42,6 +42,7 @@ require_once $config['homedir'].'/include/functions_users.php';
|
|||||||
enterprise_include_once('include/functions_reporting.php');
|
enterprise_include_once('include/functions_reporting.php');
|
||||||
enterprise_include_once('include/functions_metaconsole.php');
|
enterprise_include_once('include/functions_metaconsole.php');
|
||||||
enterprise_include_once('include/functions_inventory.php');
|
enterprise_include_once('include/functions_inventory.php');
|
||||||
|
require_once $config['homedir'].'/include/functions_inventory.php';
|
||||||
enterprise_include_once('include/functions_cron.php');
|
enterprise_include_once('include/functions_cron.php');
|
||||||
require_once $config['homedir'].'/include/functions_forecast.php';
|
require_once $config['homedir'].'/include/functions_forecast.php';
|
||||||
require_once $config['homedir'].'/include/functions_ui.php';
|
require_once $config['homedir'].'/include/functions_ui.php';
|
||||||
@ -1030,6 +1031,62 @@ function reporting_make_reporting_data(
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vuls_severity_graph':
|
||||||
|
$report['contents'][] = reporting_vuls_severity_graph(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_attack_complexity':
|
||||||
|
$report['contents'][] = reporting_vuls_attack_complexity_graph(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_packages':
|
||||||
|
$report['contents'][] = reporting_vuls_by_packages_graph(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_by_agent':
|
||||||
|
$report['contents'][] = reporting_vuls_by_agent(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'vuls_info_agent':
|
||||||
|
$report['contents'][] = reporting_vuls_info_agent(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_agents_vuls':
|
||||||
|
$report['contents'][] = reporting_top_n_agents_vuls(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'top_n_vuls_count':
|
||||||
|
$report['contents'][] = reporting_top_n_vuls_count(
|
||||||
|
$report,
|
||||||
|
$content,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Default.
|
// Default.
|
||||||
break;
|
break;
|
||||||
@ -11355,7 +11412,7 @@ function reporting_simple_graph(
|
|||||||
),
|
),
|
||||||
'ttl' => $ttl,
|
'ttl' => $ttl,
|
||||||
'compare' => $time_compare_overlapped,
|
'compare' => $time_compare_overlapped,
|
||||||
'show_unknown' => true,
|
'show_unknown' => $content['check_unknowns_graph'],
|
||||||
'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null,
|
'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null,
|
||||||
'fullscale' => $fullscale,
|
'fullscale' => $fullscale,
|
||||||
'server_id' => $id_meta,
|
'server_id' => $id_meta,
|
||||||
@ -13702,38 +13759,47 @@ function reporting_tiny_stats(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($modern === true) {
|
if ($modern === true) {
|
||||||
$out .= '<div id="bullets_modules">';
|
|
||||||
if (isset($fired_count) && $fired_count > 0) {
|
if (isset($fired_count) && $fired_count > 0) {
|
||||||
|
$out .= '<div class="bullets_modules">';
|
||||||
$out .= '<div><div id="fired_count_'.$uniq_id.'" class="forced_title bullet_modules orange_background"></div>';
|
$out .= '<div><div id="fired_count_'.$uniq_id.'" class="forced_title bullet_modules orange_background"></div>';
|
||||||
$out .= '<span class="font_12pt">'.$fired_count.'</span></div>';
|
$out .= '<span class="font_12pt">'.$fired_count.'</span></div>';
|
||||||
|
$out .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($critical_count) && $critical_count > 0) {
|
if (isset($critical_count) && $critical_count > 0) {
|
||||||
|
$out .= '<div class="bullets_modules">';
|
||||||
$out .= '<div><div id="critical_count_'.$uniq_id.'" class="forced_title bullet_modules red_background"></div>';
|
$out .= '<div><div id="critical_count_'.$uniq_id.'" class="forced_title bullet_modules red_background"></div>';
|
||||||
$out .= '<span class="font_12pt">'.$critical_count.'</span></div>';
|
$out .= '<span class="font_12pt">'.$critical_count.'</span></div>';
|
||||||
|
$out .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($warning_count) && $warning_count > 0) {
|
if (isset($warning_count) && $warning_count > 0) {
|
||||||
|
$out .= '<div class="bullets_modules">';
|
||||||
$out .= '<div><div id="warning_count_'.$uniq_id.'" class="forced_title bullet_modules yellow_background"></div>';
|
$out .= '<div><div id="warning_count_'.$uniq_id.'" class="forced_title bullet_modules yellow_background"></div>';
|
||||||
$out .= '<span class="font_12pt">'.$warning_count.'</span></div>';
|
$out .= '<span class="font_12pt">'.$warning_count.'</span></div>';
|
||||||
|
$out .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($unknown_count) && $unknown_count > 0) {
|
if (isset($unknown_count) && $unknown_count > 0) {
|
||||||
|
$out .= '<div class="bullets_modules">';
|
||||||
$out .= '<div><div id="unknown_count_'.$uniq_id.'" class="forced_title bullet_modules grey_background"></div>';
|
$out .= '<div><div id="unknown_count_'.$uniq_id.'" class="forced_title bullet_modules grey_background"></div>';
|
||||||
$out .= '<span class="font_12pt">'.$unknown_count.'</span></div>';
|
$out .= '<span class="font_12pt">'.$unknown_count.'</span></div>';
|
||||||
|
$out .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($not_init_count) && $not_init_count > 0) {
|
if (isset($not_init_count) && $not_init_count > 0) {
|
||||||
|
$out .= '<div class="bullets_modules">';
|
||||||
$out .= '<div><div id="not_init_count_'.$uniq_id.'" class="forced_title bullet_modules blue_background"></div>';
|
$out .= '<div><div id="not_init_count_'.$uniq_id.'" class="forced_title bullet_modules blue_background"></div>';
|
||||||
$out .= '<span class="font_12pt">'.$not_init_count.'</span></div>';
|
$out .= '<span class="font_12pt">'.$not_init_count.'</span></div>';
|
||||||
|
$out .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($normal_count) && $normal_count > 0) {
|
if (isset($normal_count) && $normal_count > 0) {
|
||||||
|
$out .= '<div class="bullets_modules">';
|
||||||
$out .= '<div><div id="normal_count_'.$uniq_id.'" class="forced_title bullet_modules green_background"></div>';
|
$out .= '<div><div id="normal_count_'.$uniq_id.'" class="forced_title bullet_modules green_background"></div>';
|
||||||
$out .= '<span class="font_12pt">'.$normal_count.'</span></div>';
|
$out .= '<span class="font_12pt">'.$normal_count.'</span></div>';
|
||||||
}
|
|
||||||
|
|
||||||
$out .= '</div>';
|
$out .= '</div>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Classic ones.
|
// Classic ones.
|
||||||
$out .= '<b><span id="total_count_'.$uniq_id.'" class="forced_title" >'.$total_count.'</span>';
|
$out .= '<b><span id="total_count_'.$uniq_id.'" class="forced_title" >'.$total_count.'</span>';
|
||||||
@ -15981,171 +16047,174 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$module_interval = modules_get_interval(
|
if ($metaconsole_on && $server_name != '') {
|
||||||
$content['id_agent_module']
|
// Restore db connection.
|
||||||
);
|
metaconsole_restore_db();
|
||||||
$slice = ($content['period'] / $module_interval);
|
}
|
||||||
|
|
||||||
$result_sla = reporting_advanced_sla(
|
$filter = [
|
||||||
$content['id_agent_module'],
|
'id_agentmodule' => $content['id_agent_module'],
|
||||||
($report['datetime'] - $content['period']),
|
'group_rep' => EVENT_GROUP_REP_ALL,
|
||||||
$report['datetime'],
|
'date_to' => date('Y-m-d', ($report['datetime'] - $content['period'])),
|
||||||
null,
|
'time_to' => date('H:i:s', ($report['datetime'] - $content['period'])),
|
||||||
null,
|
];
|
||||||
|
|
||||||
|
if ($metaconsole_on && $server_name != '') {
|
||||||
|
$filter['id_server'] = $connection['id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$previous_event = events_get_all(
|
||||||
|
['te.event_type, te.timestamp, te.utimestamp'],
|
||||||
|
$filter,
|
||||||
0,
|
0,
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
$slice,
|
|
||||||
1,
|
1,
|
||||||
|
'desc',
|
||||||
|
'timestamp',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Select Warning and critical values.
|
$status = '';
|
||||||
$agentmodule_info = modules_get_agentmodule($content['id_agent_module']);
|
if ($previous_event !== false) {
|
||||||
$min_value_critical = ($agentmodule_info['min_critical'] == 0) ? null : $agentmodule_info['min_critical'];
|
$previous_event = end($previous_event);
|
||||||
|
$status = $previous_event['event_type'];
|
||||||
// Check if module type is string.
|
|
||||||
$modules_is_string = modules_is_string($agentmodule_info['id_agente_modulo']);
|
|
||||||
|
|
||||||
if ($modules_is_string === false) {
|
|
||||||
if ($agentmodule_info['max_critical'] == 0) {
|
|
||||||
$max_value_critical = null;
|
|
||||||
if ($agentmodule_info['min_critical'] == 0) {
|
|
||||||
if ((bool) $content['dinamic_proc'] === true) {
|
|
||||||
$max_value_critical = 0.01;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$max_value_critical = $agentmodule_info['max_critical'];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($agentmodule_info['str_critical'] == '') {
|
|
||||||
$max_value_critical = null;
|
|
||||||
} else {
|
|
||||||
$max_value_critical = $agentmodule_info['str_critical'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$inverse_critical = $agentmodule_info['critical_inverse'];
|
$date_start = ($report['datetime'] - $content['period']);
|
||||||
|
$filter = [
|
||||||
|
'id_agentmodule' => $content['id_agent_module'],
|
||||||
|
'group_rep' => EVENT_GROUP_REP_ALL,
|
||||||
|
'date_from' => date('Y-m-d', $date_start),
|
||||||
|
'date_to' => date('Y-m-d', $report['datetime']),
|
||||||
|
'time_from' => date('H:i:s', $date_start),
|
||||||
|
'time_to' => date('H:i:s', $report['datetime']),
|
||||||
|
];
|
||||||
|
|
||||||
$min_value_warning = ($agentmodule_info['min_warning'] == 0) ? null : $agentmodule_info['min_warning'];
|
if ($metaconsole_on && $server_name != '') {
|
||||||
|
$filter['id_server'] = $connection['id'];
|
||||||
if ($modules_is_string === false) {
|
|
||||||
if ($agentmodule_info['max_warning'] == 0) {
|
|
||||||
$max_value_warning = null;
|
|
||||||
} else {
|
|
||||||
$max_value_warning = $agentmodule_info['max_warning'];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($agentmodule_info['str_warning'] == '') {
|
|
||||||
$max_value_warning = null;
|
|
||||||
} else {
|
|
||||||
$max_value_warning = $agentmodule_info['str_warning'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$inverse_warning = $agentmodule_info['warning_inverse'];
|
$events = events_get_all(
|
||||||
|
['te.event_type, te.timestamp, te.utimestamp'],
|
||||||
$data = [];
|
$filter,
|
||||||
$data['time_total'] = 0;
|
null,
|
||||||
$data['time_ok'] = 0;
|
null,
|
||||||
$data['time_error'] = 0;
|
null,
|
||||||
$data['time_warning'] = 0;
|
null,
|
||||||
$data['time_unknown'] = 0;
|
true
|
||||||
$data['time_not_init'] = 0;
|
|
||||||
$data['time_downtime'] = 0;
|
|
||||||
$data['checks_total'] = 0;
|
|
||||||
$data['checks_ok'] = 0;
|
|
||||||
$data['checks_error'] = 0;
|
|
||||||
$data['checks_warning'] = 0;
|
|
||||||
$data['checks_unknown'] = 0;
|
|
||||||
$data['checks_not_init'] = 0;
|
|
||||||
|
|
||||||
$array_graph = [];
|
|
||||||
$i = 0;
|
|
||||||
foreach ($result_sla as $value_sla) {
|
|
||||||
$data['time_total'] += $value_sla['time_total'];
|
|
||||||
$data['time_ok'] += $value_sla['time_ok'];
|
|
||||||
$data['time_error'] += $value_sla['time_error'];
|
|
||||||
$data['time_warning'] += $value_sla['time_warning'];
|
|
||||||
$data['time_unknown'] += $value_sla['time_unknown'];
|
|
||||||
$data['time_downtime'] += $value_sla['time_downtime'];
|
|
||||||
$data['time_not_init'] += $value_sla['time_not_init'];
|
|
||||||
$data['checks_total'] += $value_sla['checks_total'];
|
|
||||||
$data['checks_ok'] += $value_sla['checks_ok'];
|
|
||||||
$data['checks_error'] += $value_sla['checks_error'];
|
|
||||||
$data['checks_warning'] += $value_sla['checks_warning'];
|
|
||||||
$data['checks_unknown'] += $value_sla['checks_unknown'];
|
|
||||||
$data['checks_not_init'] += $value_sla['checks_not_init'];
|
|
||||||
|
|
||||||
// Generate raw data for graph.
|
|
||||||
if ($value_sla['time_total'] != 0) {
|
|
||||||
if ($value_sla['time_error'] > 0) {
|
|
||||||
// ERR.
|
|
||||||
$array_graph[$i]['data'] = 3;
|
|
||||||
} else if ($value_sla['time_unknown'] > 0) {
|
|
||||||
// UNKNOWN.
|
|
||||||
$array_graph[$i]['data'] = 4;
|
|
||||||
} else if ($value_sla['time_warning'] > 0) {
|
|
||||||
// Warning.
|
|
||||||
$array_graph[$i]['data'] = 2;
|
|
||||||
} else if ($value_sla['time_not_init'] == $value_sla['time_total']) {
|
|
||||||
// NOT INIT.
|
|
||||||
$array_graph[$i]['data'] = 6;
|
|
||||||
} else {
|
|
||||||
$array_graph[$i]['data'] = 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$array_graph[$i]['data'] = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
$array_graph[$i]['utimestamp'] = ($value_sla['date_to'] - $value_sla['date_from']);
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['sla_value'] = reporting_sla_get_compliance_from_array(
|
|
||||||
$data
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$data['sla_fixed'] = sla_truncate(
|
// Metaconsole connection.
|
||||||
$data['sla_value'],
|
if ($metaconsole_on && $server_name != '') {
|
||||||
$config['graph_precision']
|
$connection = metaconsole_get_connection($server_name);
|
||||||
|
if (!metaconsole_load_external_db($connection)) {
|
||||||
|
ui_print_error_message('Error connecting to '.$server_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$not_init_data = [];
|
||||||
|
$previous_data = [
|
||||||
|
'event_type' => $status,
|
||||||
|
'utimestamp' => $date_start,
|
||||||
|
];
|
||||||
|
if (empty($status) === true) {
|
||||||
|
// Si viene de no iniciado busco el primer dato del modulo y si es de histórico.
|
||||||
|
$first_utimestamp = false;
|
||||||
|
$search_historydb = false;
|
||||||
|
$extract_first_data = modules_get_first_date($content['id_agent_module'], 0);
|
||||||
|
if (empty($extract_first_data) === false) {
|
||||||
|
$first_utimestamp = $extract_first_data['first_utimestamp'];
|
||||||
|
$search_historydb = (isset($extract_first_data['search_historydb']) === true) ? $extract_first_data['search_historydb'] : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si se encuentra algun dato.
|
||||||
|
// Si no hay eventos, la fecha del primer dato no sea mayor al fin del report (seria un bloque completo de no iniciado).
|
||||||
|
// Se comprueba que si existen eventos el dato no sea previo al evento.
|
||||||
|
if ($first_utimestamp !== false
|
||||||
|
&& ((empty($events) === true && $first_utimestamp < $report['datetime']) || (empty($events) === false && $first_utimestamp < $events[0]['utimestamp']))
|
||||||
|
) {
|
||||||
|
// Tenemos en cuenta si el modulo es de tipo string.
|
||||||
|
$module = modules_get_agentmodule($content['id_agent_module']);
|
||||||
|
$module_type = $module['id_tipo_modulo'];
|
||||||
|
$module_type_str = modules_get_type_name($module_type);
|
||||||
|
$table = 'tagente_datos';
|
||||||
|
if (strstr($module_type_str, 'string') !== false) {
|
||||||
|
$table = 'tagente_datos_string';
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = sprintf(
|
||||||
|
'SELECT datos,utimestamp
|
||||||
|
FROM %s
|
||||||
|
WHERE id_agente_modulo = %d
|
||||||
|
AND utimestamp = %d
|
||||||
|
',
|
||||||
|
$table,
|
||||||
|
$content['id_agent_module'],
|
||||||
|
$first_utimestamp
|
||||||
);
|
);
|
||||||
|
|
||||||
$data_init = -1;
|
$data = db_get_all_rows_sql($query, $search_historydb);
|
||||||
$acum = 0;
|
if ($data !== false) {
|
||||||
$sum = 0;
|
$not_init_data = [
|
||||||
|
'event_type' => $status,
|
||||||
|
'utimestamp' => $date_start,
|
||||||
|
];
|
||||||
|
$previous_data = [
|
||||||
|
'event_type' => 'going_up_normal',
|
||||||
|
'utimestamp' => $data[0]['utimestamp'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$array_result = [];
|
$array_result = [];
|
||||||
|
$time_total = $content['period'];
|
||||||
|
$check_total = 0;
|
||||||
|
$check_ok = 0;
|
||||||
|
$time_ok = 0;
|
||||||
|
if (empty($events) === true) {
|
||||||
|
$events = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Añadimos el dato previo.
|
||||||
|
array_unshift($events, $previous_data);
|
||||||
|
if (empty($not_init_data) === false) {
|
||||||
|
// Añadimos si viene de no iniciado el no iniciado.
|
||||||
|
array_unshift($events, $not_init_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
$current_time = time();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($array_graph as $value) {
|
foreach ($events as $event) {
|
||||||
if ($data_init == -1) {
|
$array_result[$i]['data'] = events_status_module_event_type($event['event_type']);
|
||||||
$data_init = $value['data'];
|
if (isset($events[($i + 1)]) === true) {
|
||||||
$acum = $value['utimestamp'];
|
$period = ($events[($i + 1)]['utimestamp'] - $event['utimestamp']);
|
||||||
|
$array_result[$i]['utimestamp'] = $period;
|
||||||
} else {
|
} else {
|
||||||
if ($data_init == $value['data']) {
|
$period = ($report['datetime'] - $event['utimestamp']);
|
||||||
$acum = ($acum + $value['utimestamp']);
|
// El ultimo evento solo lo arrastramos hasta la fecha actual.
|
||||||
} else {
|
// Si pedimos mas fecha sera desconocido.
|
||||||
$array_result[$i]['data'] = $data_init;
|
if ($report['datetime'] > $current_time) {
|
||||||
$array_result[$i]['utimestamp'] = $acum;
|
$period = ($current_time - $event['utimestamp']);
|
||||||
$array_result[$i]['real_data'] = $sum;
|
}
|
||||||
|
|
||||||
|
$array_result[$i]['utimestamp'] = $period;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($array_result[$i]['data'] === AGENT_MODULE_STATUS_NORMAL) {
|
||||||
|
$check_ok++;
|
||||||
|
$time_ok += $period;
|
||||||
|
}
|
||||||
|
|
||||||
|
$check_total++;
|
||||||
$i++;
|
$i++;
|
||||||
$data_init = $value['data'];
|
|
||||||
$acum = $value['utimestamp'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($array_result) == 0) {
|
// Bloque por si se pide mas fecha.
|
||||||
$array_result = $array_graph;
|
if ($report['datetime'] > $current_time) {
|
||||||
} else {
|
$array_result[$i]['data'] = AGENT_MODULE_STATUS_UNKNOWN;
|
||||||
$array_result[$i]['data'] = $data_init;
|
$array_result[$i]['utimestamp'] = ($report['datetime'] - $current_time);
|
||||||
$array_result[$i]['utimestamp'] = $acum;
|
|
||||||
$array_result[$i]['real_data'] = $sum;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$time_total = $data['time_total'];
|
|
||||||
// Slice graphs calculation.
|
|
||||||
$return['agent'] = modules_get_agentmodule_agent_alias(
|
$return['agent'] = modules_get_agentmodule_agent_alias(
|
||||||
$content['id_agent_module']
|
$content['id_agent_module']
|
||||||
);
|
);
|
||||||
@ -16153,37 +16222,21 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
|
|||||||
$content['id_agent_module']
|
$content['id_agent_module']
|
||||||
);
|
);
|
||||||
|
|
||||||
$return['max_critical'] = $max_value_critical;
|
$return['data_ok'] = $check_ok;
|
||||||
$return['min_critical'] = $min_value_critical;
|
$return['data_total'] = $check_total;
|
||||||
$return['critical_inverse'] = $inverse_critical;
|
if ($check_total > 0) {
|
||||||
$return['max_warning'] = $max_value_warning;
|
$return['percent_ok'] = (($time_ok * 100) / $content['period']);
|
||||||
$return['min_warning'] = $min_value_warning;
|
|
||||||
$return['warning_inverse'] = $inverse_warning;
|
|
||||||
$return['data_not_init'] = $data['checks_not_init'];
|
|
||||||
$return['data_unknown'] = $data['checks_unknown'];
|
|
||||||
$return['data_critical'] = $data['checks_error'];
|
|
||||||
$return['data_warning'] = $data['checks_warning'];
|
|
||||||
$return['data_ok'] = $data['checks_ok'];
|
|
||||||
$return['data_total'] = $data['checks_total'];
|
|
||||||
$return['time_not_init'] = $data['time_not_init'];
|
|
||||||
$return['time_unknown'] = $data['time_unknown'];
|
|
||||||
$return['time_critical'] = $data['time_error'];
|
|
||||||
$return['time_warning'] = $data['time_warning'];
|
|
||||||
$return['time_ok'] = $data['time_ok'];
|
|
||||||
if ($data['checks_total'] > 0) {
|
|
||||||
$return['percent_ok'] = (($data['checks_ok'] * 100) / $data['checks_total']);
|
|
||||||
} else {
|
} else {
|
||||||
$return['percent_ok'] = 0;
|
$return['percent_ok'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$colors = [
|
$colors = [
|
||||||
1 => COL_NORMAL,
|
AGENT_MODULE_STATUS_CRITICAL_ALERT => COL_ALERTFIRED,
|
||||||
2 => COL_WARNING,
|
AGENT_MODULE_STATUS_NORMAL => COL_NORMAL,
|
||||||
3 => COL_CRITICAL,
|
AGENT_MODULE_STATUS_UNKNOWN => COL_UNKNOWN,
|
||||||
4 => COL_UNKNOWN,
|
AGENT_MODULE_STATUS_WARNING => COL_WARNING,
|
||||||
5 => COL_DOWNTIME,
|
AGENT_MODULE_STATUS_CRITICAL_BAD => COL_CRITICAL,
|
||||||
6 => COL_NOTINIT,
|
AGENT_MODULE_STATUS_NOT_INIT => COL_NOTINIT,
|
||||||
7 => COL_IGNORED,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$width_graph = 100;
|
$width_graph = 100;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user