Merge branch 'develop' into '330-Agentes-sin-alertas-dev'
# Conflicts: # pandora_console/include/functions_ui.php
This commit is contained in:
commit
c678d8ba50
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, AIX version
|
||||
# Version 7.0NG.705, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, FreeBSD Version
|
||||
# Version 7.0NG.705, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, HP-UX Version
|
||||
# Version 7.0NG.705, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, GNU/Linux
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, GNU/Linux
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, Solaris Version
|
||||
# Version 7.0NG.705, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2010 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.704
|
||||
# Version 7.0NG.705
|
||||
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.704, AIX version
|
||||
# Version 7.0NG.705, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.704
|
||||
# Version 7.0NG.705
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.704, HPUX Version
|
||||
# Version 7.0NG.705, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704
|
||||
# Version 7.0NG.705
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704
|
||||
# Version 7.0NG.705
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704
|
||||
# Version 7.0NG.705
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.704, Solaris version
|
||||
# Version 7.0NG.705, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, AIX version
|
||||
# Version 7.0NG.705, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.704-170531
|
||||
Version: 7.0NG.705-170620
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.704-170531"
|
||||
pandora_version="7.0NG.705-170620"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, GNU/Linux
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, FreeBSD Version
|
||||
# Version 7.0NG.705, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, HP-UX Version
|
||||
# Version 7.0NG.705, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, GNU/Linux
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, GNU/Linux
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, NetBSD Version
|
||||
# Version 7.0NG.705, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.704, Solaris Version
|
||||
# Version 7.0NG.705, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -40,8 +40,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.704';
|
||||
use constant AGENT_BUILD => '170531';
|
||||
use constant AGENT_VERSION => '7.0NG.705';
|
||||
use constant AGENT_BUILD => '170620';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.704
|
||||
%define release 170531
|
||||
%define version 7.0NG.705
|
||||
%define release 170620
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.704
|
||||
%define release 170531
|
||||
%define version 7.0NG.705
|
||||
%define release 170620
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.704"
|
||||
PI_BUILD="170531"
|
||||
PI_VERSION="7.0NG.705"
|
||||
PI_BUILD="170620"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -48,7 +48,7 @@ else
|
|||
my $onlyexclude = 1;
|
||||
|
||||
# Store all "ext" fstypes in @lines array
|
||||
my @lines = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1":"\$2":"\$(NF-1)":"\$NF}' | grep -i "adfs\\|affs\\|autofs\\|btrfs\\|cifs\\|coda\\|coherent\\|efs\\|ext\\|hfs\\|hfsplus\\|hpfs\\|jfs\\|minix\\|msdos\\|ncpfs\\|nfs\\|nfs4\\|ntfs\\|proc\\|qnx4\\|reiserfs\\|smbfs\\|sysv\\|ubifs\\|udf\\|ufs\\|umsdos\\|usbfs\\|vfat\\|xenix\\|xfs\\|xiafs"`;
|
||||
my @lines = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1";"\$2";"\$(NF-1)";"\$NF}' | grep -i "adfs\\|affs\\|autofs\\|btrfs\\|cifs\\|coda\\|coherent\\|efs\\|ext\\|hfs\\|hfsplus\\|hpfs\\|jfs\\|minix\\|msdos\\|ncpfs\\|nfs\\|nfs4\\|ntfs\\|proc\\|qnx4\\|reiserfs\\|smbfs\\|sysv\\|ubifs\\|udf\\|ufs\\|umsdos\\|usbfs\\|vfat\\|xenix\\|xfs\\|xiafs"`;
|
||||
|
||||
chomp (@lines);
|
||||
|
||||
|
@ -61,7 +61,7 @@ else
|
|||
}
|
||||
else
|
||||
{
|
||||
my @linesmanual = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1":"\$2":"\$(NF-1)":"\$NF}' | grep -i $fs`;
|
||||
my @linesmanual = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1";"\$2";"\$(NF-1)";"\$NF}' | grep -i $fs`;
|
||||
|
||||
chomp (@linesmanual);
|
||||
|
||||
|
@ -76,7 +76,7 @@ else
|
|||
|
||||
foreach (@lines)
|
||||
{
|
||||
my ($filesystem, $fstype, $used_space, $mount_point) = split /:/,$_;
|
||||
my ($filesystem, $fstype, $used_space, $mount_point) = split /;/,$_;
|
||||
|
||||
if (defined ($filesystems{$mount_point}) || (!defined ($excluded_filesystems{$mount_point})))
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2014 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.704
|
||||
# Version 7.0NG.705
|
||||
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.704}
|
||||
{Pandora FMS Windows Agent v7.0NG.705}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{170531}
|
||||
{170620}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.704(Build 170531)")
|
||||
#define PANDORA_VERSION ("7.0NG.705(Build 170620)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.704(Build 170531))"
|
||||
VALUE "ProductVersion", "(7.0NG.705(Build 170620))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.704-170531
|
||||
Version: 7.0NG.705-170620
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.704-170531"
|
||||
pandora_version="7.0NG.705-170620"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -38,7 +38,7 @@ function createXMLData($agent, $agentModule, $time, $data) {
|
|||
io_safe_output($agent['os_version']), $agent['intervalo'],
|
||||
io_safe_output($agent['agent_version']), $time,
|
||||
io_safe_output($agent['nombre']),
|
||||
io_safe_output($agent['alias']), $agent['timezone_offset'],
|
||||
$agent['timezone_offset'],
|
||||
io_safe_output($agentModule['nombre']), io_safe_output($agentModule['descripcion']), modules_get_type_name($agentModule['id_tipo_modulo']), $data);
|
||||
|
||||
|
||||
|
|
|
@ -39,10 +39,9 @@ function view_logfile ($file_name) {
|
|||
echo "<h2>$file_name (" . __("File is too large than PHP memory allocated in the system.") . ")</h2>";
|
||||
echo "<h2>" . __("The preview file is imposible.") . "</h2>";
|
||||
}
|
||||
else if ($file_size > 512000) {
|
||||
$data = file_get_contents ($file_name, false, NULL, $file_size - 512000);
|
||||
echo "<h2>$file_name (".__("File is too large (> 500KB)").")</h2>";
|
||||
|
||||
else if ($file_size > ($config['max_log_size'] * 1000)) {
|
||||
$data = file_get_contents ($file_name, false, NULL, $file_size - ($config['max_log_size'] * 1000));
|
||||
echo "<h2>$file_name (".format_numeric(filesize ($file_name)/1024)." KB) </h2>";
|
||||
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
|
||||
echo "... ";
|
||||
echo $data;
|
||||
|
@ -68,10 +67,11 @@ function pandoralogs_extension_main () {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
ui_print_page_header (__("System logfile viewer"), "images/extensions.png", false, "", true, "" );
|
||||
|
||||
echo "<p>" . __('This tool is used just to view your Pandora FMS system logfiles directly from console') . "</p>";
|
||||
|
||||
echo "<p>" . __('You can control the size information to show in general setup (Log size limit in view extension), actually ') . $config['max_log_size'] * 1000 . "B" . "</p>";
|
||||
|
||||
$logs_directory = (!empty($config["server_log_dir"])) ? io_safe_output($config["server_log_dir"]) : "/var/log/pandora";
|
||||
|
||||
|
|
|
@ -868,7 +868,7 @@ function resource_registration_extension_main() {
|
|||
echo "<form name='submit_plugin' method='post' enctype='multipart/form-data'>";
|
||||
echo '<table class="databox" id="table1" width="98%" border="0" cellpadding="4" cellspacing="4">';
|
||||
echo "<tr>";
|
||||
echo "<td colspan='2' class='datos'><input type='file' name='resource_upload' />";
|
||||
echo "<td colspan='2' class='datos'><input type='file' name='resource_upload' accept='.ptr'/>";
|
||||
echo "<td>" . __('Group filter: ') . "</td>";
|
||||
echo "<td>";
|
||||
html_print_select_groups(false, "AW", true, 'group');
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
START TRANSACTION;
|
||||
|
||||
SET @st_oum706 = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'treport_content' AND table_schema = DATABASE() AND column_name = 'historical_db') > 0,
|
||||
"SELECT 1",
|
||||
"ALTER TABLE treport_content ADD COLUMN historical_db tinyint(1) UNSIGNED NOT NULL default 0"
|
||||
));
|
||||
|
||||
PREPARE pr_oum706 FROM @st_oum706;
|
||||
EXECUTE pr_oum706;
|
||||
DEALLOCATE PREPARE pr_oum706;
|
||||
|
||||
SET @st_oum706 = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tpolicy_modules' AND table_schema = DATABASE() AND column_name = 'ip_target') > 0,
|
||||
"SELECT 1",
|
||||
"ALTER TABLE tpolicy_modules ADD COLUMN ip_target varchar(100) default ''"
|
||||
));
|
||||
|
||||
PREPARE pr_oum706 FROM @st_oum706;
|
||||
EXECUTE pr_oum706;
|
||||
DEALLOCATE PREPARE pr_oum706;
|
||||
|
||||
COMMIT;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE tagent_custom_fields ADD is_password_type tinyint(1) NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT;
|
|
@ -1219,6 +1219,7 @@ ALTER TABLE tlayout_data ADD `label_position` varchar(50) NOT NULL default 'down
|
|||
-- Table `tagent_custom_fields`
|
||||
-- ---------------------------------------------------------------------
|
||||
INSERT INTO `tagent_custom_fields` (`name`) VALUES ('eHorusID');
|
||||
ALTER TABLE tagent_custom_fields ADD `is_password_type` tinyint(1) NOT NULL DEFAULT 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_modulo` Fixed problems with blank space
|
||||
|
@ -1246,6 +1247,12 @@ UPDATE treport_custom_sql SET `sql` = 'select (select tagente.alia
|
|||
UPDATE treport_custom_sql SET `sql` = 'select t1.alias as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;'
|
||||
WHERE id = 3;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `treport_content`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE treport_content ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmodule_relationship`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1259,6 +1266,7 @@ ALTER TABLE tlocal_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned
|
|||
-- ---------------------------------------------------------------------
|
||||
-- Table `tpolicy_module`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tpolicy_modules ADD COLUMN `ip_target`varchar(100) default '';
|
||||
ALTER TABLE tpolicy_modules ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
|
||||
ALTER TABLE tpolicy_modules ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ if (is_ajax()) {
|
|||
$not_return = get_parameter ('not_return', 0);
|
||||
$reset_initial_wizard = get_parameter ('reset_initial_wizard', 0);
|
||||
|
||||
|
||||
if ($reset_initial_wizard) {
|
||||
config_update_value ('initial_wizard', 0);
|
||||
}
|
||||
|
|
|
@ -65,18 +65,19 @@ if (!empty ($page) && !empty ($sec)) {
|
|||
$login_body_style = '';
|
||||
// Overrides the default background with the defined by the user
|
||||
if (!empty($config['login_background'])) {
|
||||
$background_url = "../../images/backgrounds/" . $config['login_background'];
|
||||
$background_url = "images/backgrounds/" . $config['login_background'];
|
||||
$login_body_style = "style=\"background-image: url('$background_url');\"";
|
||||
}
|
||||
echo '<div id="login_body" ' . $login_body_style . '>';
|
||||
echo '<div id="header_login">';
|
||||
echo '<div id="icon_custom_pandora">';
|
||||
if (defined ('PANDORA_ENTERPRISE')) {
|
||||
|
||||
if (PANDORA_ENTERPRISE) {
|
||||
if(isset ($config['custom_logo'])){
|
||||
echo '<img src="images/custom_logo/' . $config['custom_logo'] .'" alt="pandora_console">';
|
||||
echo '<img src="enterprise/images/custom_logo/' . $config['custom_logo'] .'" alt="pandora_console">';
|
||||
}
|
||||
else{
|
||||
echo '<img src="images/custom_logo/logo_login_consola.png" alt="pandora_console">';
|
||||
echo '<img src="images/custom_logo/pandora_logo_head_4.png" alt="pandora_console">';
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -460,8 +460,14 @@ foreach ($fields as $field) {
|
|||
$custom_value = '';
|
||||
}
|
||||
|
||||
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'],
|
||||
2, 65, $custom_value, 'style="min-height: 30px; width:96%;"', true);
|
||||
if ($field['is_password_type']) {
|
||||
$data[1] = html_print_input_text_extended ('customvalue_' . $field['id_field'], $custom_value, 'customvalue_' . $field['id_field'], '',
|
||||
30, 100, $view_mode, '', '', true, true);
|
||||
}
|
||||
else {
|
||||
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'],
|
||||
2, 65, $custom_value, 'style="min-height: 30px; width:96%;"', true);
|
||||
}
|
||||
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
|
|
@ -885,8 +885,12 @@ if ($update_module || $create_module) {
|
|||
// 1.23E-10 is 0.000000000123
|
||||
|
||||
$post_process = (string) get_parameter ('post_process', 0.0);
|
||||
//$prediction_module = 0;
|
||||
|
||||
if(get_parameter ('prediction_module')){
|
||||
$prediction_module = get_parameter ('prediction_module');
|
||||
}
|
||||
else{
|
||||
$prediction_module = 0;
|
||||
}
|
||||
$max_timeout = (int) get_parameter ('max_timeout');
|
||||
$max_retries = (int) get_parameter ('max_retries');
|
||||
$min = (int) get_parameter_post ("min");
|
||||
|
|
|
@ -27,12 +27,14 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
$id_field = (int) get_parameter ('id_field', 0);
|
||||
$name = (string) get_parameter ('name', '');
|
||||
$display_on_front = (bool) get_parameter ('display_on_front', 0);
|
||||
$is_password_type = (bool) get_parameter ('is_password_type', 0);
|
||||
|
||||
// Header
|
||||
if ($id_field) {
|
||||
$field = db_get_row_filter('tagent_custom_fields',array('id_field' => $id_field));
|
||||
$name = $field['name'];
|
||||
$display_on_front = $field['display_on_front'];
|
||||
$is_password_type = $field['is_password_type'];
|
||||
ui_print_page_header (__("Update agent custom field"), "images/custom_field.png", false, "", true, "");
|
||||
}
|
||||
else {
|
||||
|
@ -48,8 +50,11 @@ $table->data = array ();
|
|||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text ('name', $name, '', 35, 100, true);
|
||||
|
||||
$table->data[0][2] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
|
||||
$table->data[0][3] = html_print_checkbox ('display_on_front', 1, $display_on_front, true);
|
||||
$table->data[0][2] = __('Pass type').ui_print_help_tip (__('The fields with pass type enabled will be displayed like html input type pass in html'), true);
|
||||
$table->data[0][3] = html_print_checkbox ('is_password_type', 1, $is_password_type, true);
|
||||
|
||||
$table->data[0][4] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
|
||||
$table->data[0][5] = html_print_checkbox ('display_on_front', 1, $display_on_front, true);
|
||||
|
||||
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
|
||||
html_print_table ($table);
|
||||
|
|
|
@ -36,6 +36,7 @@ $delete_field = (bool) get_parameter ('delete_field');
|
|||
$id_field = (int) get_parameter ('id_field', 0);
|
||||
$name = (string) get_parameter ('name', '');
|
||||
$display_on_front = (int) get_parameter ('display_on_front', 0);
|
||||
$is_password_type = (int) get_parameter ('is_password_type', 0);
|
||||
|
||||
/* Create field */
|
||||
if ($create_field) {
|
||||
|
@ -48,7 +49,8 @@ if ($create_field) {
|
|||
}
|
||||
else {
|
||||
$result = db_process_sql_insert('tagent_custom_fields',
|
||||
array('name' => $name, 'display_on_front' => $display_on_front));
|
||||
array('name' => $name, 'display_on_front' => $display_on_front,
|
||||
'is_password_type' => $is_password_type));
|
||||
ui_print_success_message(__('Field successfully created'));
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +59,7 @@ if ($create_field) {
|
|||
if ($update_field) {
|
||||
/*Check if name field is empty*/
|
||||
if ( $name != "") {
|
||||
$values = array('name' => $name, 'display_on_front' => $display_on_front);
|
||||
$values = array('name' => $name, 'display_on_front' => $display_on_front, 'is_password_type' => $is_password_type);
|
||||
|
||||
$result = db_process_sql_update('tagent_custom_fields', $values, array('id_field' => $id_field));
|
||||
}
|
||||
|
@ -120,7 +122,7 @@ foreach ($fields as $field) {
|
|||
$data[2] = html_print_image('images/tick.png', true);
|
||||
}
|
||||
else {
|
||||
$data[2] = html_print_image('images/delete.png', true);
|
||||
$data[2] = html_print_image('images/icono_stop.png', true,array ('style' => 'width:21px;height:21px;'));
|
||||
}
|
||||
|
||||
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0')) . '</a>';
|
||||
|
|
|
@ -126,7 +126,14 @@ if ($delete_group) {
|
|||
|
||||
if ($result) {
|
||||
$result = db_process_sql_update('tagente_modulo', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
|
||||
db_process_sql_update('tpolicy_modules', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
db_process_sql_update('tcontainer_item', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
db_process_sql_update('tnetwork_component', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
db_process_sql_update('treport_content', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
db_process_sql_update('tnetwork_map', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
db_process_sql_update('tlocal_component', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
db_process_sql_update('treport_content_template', array('id_module_group' => 0), array('id_module_group' => $id_group));
|
||||
|
||||
// A group with no modules can be deleted, to avoid a message error then do the follwing
|
||||
if ($result !== false)
|
||||
$result = true;
|
||||
|
|
|
@ -130,6 +130,11 @@ foreach ($agent_alerts as $alert) {
|
|||
$alerts[$alert['id']] = $name;
|
||||
}
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->data['tags'][0] = __('Tags');
|
||||
$table->data['tags'][1] = html_print_select ($tags, 'tags[]',
|
||||
$tags_name, false, __('Any'), -1, true, true, true);
|
||||
|
||||
$table->data['operations'][0] = __('Operations');
|
||||
$table->data['operations'][1] = '<span class="with_modules'.(empty ($modules) ? ' invisible': '').'">';
|
||||
$table->data['operations'][1] .= html_print_checkbox ('copy_modules', 1, true, true);
|
||||
|
@ -282,12 +287,16 @@ $(document).ready (function () {
|
|||
}
|
||||
});
|
||||
|
||||
$("#tags").change(function() {
|
||||
$("#source_id_agent").trigger("change");
|
||||
});
|
||||
|
||||
$("#status_agents_destiny").change(function() {
|
||||
$("#destiny_id_group").trigger("change");
|
||||
});
|
||||
|
||||
$("#source_id_agent").change (function () {
|
||||
var id_agent = this.value;
|
||||
var id_agent = $("#source_id_agent").val();
|
||||
if (id_agent == 0) {
|
||||
$("#submit-go").attr("disabled", "disabled");
|
||||
|
||||
|
@ -302,6 +311,21 @@ $(document).ready (function () {
|
|||
return;
|
||||
}
|
||||
|
||||
var params = {
|
||||
"page" : "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json" : 1,
|
||||
"get_id_and_name" : 1,
|
||||
"disabled" : 0,
|
||||
"id_agent" : id_agent
|
||||
};
|
||||
|
||||
var tags_to_search = $('#tags').val();
|
||||
if (tags_to_search != null) {
|
||||
if (tags_to_search[0] != -1) {
|
||||
params['tags'] = tags_to_search;
|
||||
}
|
||||
}
|
||||
|
||||
$("#submit-go").attr("disabled", false);
|
||||
|
||||
$("#modules_loading").show ();
|
||||
|
@ -313,12 +337,7 @@ $(document).ready (function () {
|
|||
var no_alerts;
|
||||
/* Get modules */
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json" : 1,
|
||||
"id_agent" : this.value,
|
||||
"disabled" : 0,
|
||||
"get_id_and_name" : 1
|
||||
},
|
||||
params,
|
||||
function (data, status) {
|
||||
if (data.length == 0) {
|
||||
no_modules = true;
|
||||
|
|
|
@ -444,7 +444,12 @@ $table->data['form_agents_1'][3] = __('Select all modules of this group') . ' '
|
|||
html_print_checkbox_extended ("force_group", 'group', '', '', false,
|
||||
'', 'style="margin-right: 40px;"', true);
|
||||
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_modules_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_4'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_4'][0] = __('Tags');
|
||||
$table->data['form_modules_4'][1] = html_print_select ($tags, 'tags[]',
|
||||
$tags_name, false, __('Any'), -1, true, true, true);
|
||||
|
||||
$table->rowclass['form_agents_2'] = 'select_agents_row';
|
||||
$table->data['form_agents_2'][0] = __('Status');
|
||||
|
@ -489,7 +494,12 @@ $table->data['form_modules_2'][2] .= html_print_select(
|
|||
$table->data['form_modules_2'][3] = html_print_select (array(), 'agents[]',
|
||||
$agents_select, false, __('None'), 0, true, true, false, '', false, 'width:100%');
|
||||
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_agents_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_4'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_4'][0] = __('Tags');
|
||||
$table->data['form_agents_4'][1] = html_print_select ($tags, 'tags[]',
|
||||
$tags_name, false, __('Any'), -1, true, true, true);
|
||||
|
||||
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
||||
|
@ -544,6 +554,7 @@ $(document).ready (function () {
|
|||
.css('display', '<?php echo $modules_row?>');
|
||||
$(".select_agents_row")
|
||||
.css('display', '<?php echo $agents_row?>');
|
||||
$(".select_modules_row_2").css('display', 'none');
|
||||
|
||||
// Trigger change to refresh selection when change selection mode
|
||||
$("#agents_selection_mode").change (function() {
|
||||
|
@ -573,7 +584,7 @@ $(document).ready (function () {
|
|||
var params = {
|
||||
"page" : "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json" : 1,
|
||||
"get_distinct_name" : 1,
|
||||
"get_id_and_name" : 1,
|
||||
"indexed" : 0,
|
||||
"privilege" : "AW"
|
||||
};
|
||||
|
@ -584,6 +595,13 @@ $(document).ready (function () {
|
|||
var status_module = $('#status_module').val();
|
||||
if (status_module != '-1')
|
||||
params['status_module'] = status_module;
|
||||
|
||||
var tags_to_search = $('#tags').val();
|
||||
if (tags_to_search != null) {
|
||||
if (tags_to_search[0] != -1) {
|
||||
params['tags'] = tags_to_search;
|
||||
}
|
||||
}
|
||||
|
||||
$("#module_loading").show ();
|
||||
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
|
||||
|
@ -656,6 +674,7 @@ $(document).ready (function () {
|
|||
else if (selector == 'modules') {
|
||||
$(".select_agents_row").hide();
|
||||
$(".select_modules_row").show();
|
||||
$("#module_type").trigger("change");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -714,6 +733,15 @@ $(document).ready (function () {
|
|||
$("#status_agents").change(function() {
|
||||
$("#groups_select").trigger("change");
|
||||
});
|
||||
|
||||
$("#tags").change(function() {
|
||||
selector = $("#form_edit input[name=selection_mode]:checked").val();
|
||||
$("#module_type").trigger("change");
|
||||
});
|
||||
$("#tags1").change(function() {
|
||||
selector = $("#form_edit input[name=selection_mode]:checked").val();
|
||||
$("#id_agents").trigger("change");
|
||||
});
|
||||
|
||||
$("#form_modules").submit(function() {
|
||||
var get_parameters_count = window.location.href.slice(
|
||||
|
|
|
@ -183,7 +183,7 @@ if ($update_agents) {
|
|||
|
||||
ui_print_result_message ($result !== false,
|
||||
__('Agents updated successfully') . '(' . $n_edited . ')',
|
||||
__('Agents cannot be updated'));
|
||||
__('Agents cannot be updated (maybe there was no field to update)'));
|
||||
}
|
||||
$id_group = 0;
|
||||
|
||||
|
@ -456,7 +456,13 @@ foreach ($fields as $field) {
|
|||
$custom_value = '';
|
||||
}
|
||||
|
||||
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
|
||||
if ($field['is_password_type']) {
|
||||
$data[1] = html_print_input_text_extended ('customvalue_' . $field['id_field'], $custom_value, 'customvalue_' . $field['id_field'], '',
|
||||
30, 100, $view_mode, '', '', true, true);
|
||||
}
|
||||
else {
|
||||
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
|
||||
}
|
||||
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
// Load global vars
|
||||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "PM")) {
|
||||
if (! check_acl ($config['id_user'], 0, "AW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access massive module update");
|
||||
require ("general/noaccess.php");
|
||||
|
@ -110,6 +110,9 @@ if ($update) {
|
|||
$success += (int)$result;
|
||||
}
|
||||
}
|
||||
if ($success == 0) {
|
||||
$error_msg = __("Error updating the modules from a module type");
|
||||
}
|
||||
}
|
||||
else if ($force == 'group') {
|
||||
$agents_ = array_keys(agents_get_group_agents($group_select, false, 'none'));
|
||||
|
@ -129,6 +132,9 @@ if ($update) {
|
|||
$success += (int)$result;
|
||||
}
|
||||
}
|
||||
if ($success == 0) {
|
||||
$error_msg = __("Error updating the modules from an agent group");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -146,11 +152,14 @@ if ($update) {
|
|||
|
||||
}
|
||||
}
|
||||
if ($success == 0) {
|
||||
$error_msg = __("Error updating the modules (maybe there was no field to update)");
|
||||
}
|
||||
}
|
||||
|
||||
ui_print_result_message ($success > 0,
|
||||
__('Successfully updated') . "(" . $success . "/" . $count . ")",
|
||||
__('Could not be updated'));
|
||||
$error_msg);
|
||||
|
||||
$info = 'Modules: ' . json_encode($modules_) . ' Agents: ' . json_encode($agents_);
|
||||
if ($success > 0) {
|
||||
|
@ -303,6 +312,13 @@ $table->data['form_modules_3'][1] = html_print_select($status_list,
|
|||
'status_module', 'selected', '', __('All'), AGENT_MODULE_STATUS_ALL, true);
|
||||
$table->data['form_modules_3'][3] = '';
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_modules_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_4'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_4'][0] = __('Tags');
|
||||
$table->data['form_modules_4'][1] = html_print_select ($tags, 'tags[]',
|
||||
$tags_name, false, __('Any'), -1, true, true, true);
|
||||
|
||||
$table->rowstyle['form_modules_2'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_2'][0] = __('Modules');
|
||||
|
@ -334,8 +350,12 @@ $table->data['form_agents_2'][1] = html_print_select($status_list,
|
|||
'status_agents', 'selected', '', __('All'), AGENT_STATUS_ALL, true);
|
||||
$table->data['form_agents_2'][3] = '';
|
||||
|
||||
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_agents_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_4'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_4'][0] = __('Tags');
|
||||
$table->data['form_agents_4'][1] = html_print_select ($tags, 'tags[]',
|
||||
$tags_name, false, __('Any'), -1, true, true, true);
|
||||
|
||||
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
||||
|
@ -474,8 +494,10 @@ $table->data['edit2'][3] = html_print_select(
|
|||
|
||||
$table->data['edit3'][0] = __('Post process') .
|
||||
ui_print_help_icon ('postprocess', true);
|
||||
$table->data['edit3'][1] = html_print_input_text ('post_process', '',
|
||||
'', 10, 15, true);
|
||||
|
||||
$table->data['edit3'][1] = html_print_extended_select_for_post_process('post_process',
|
||||
0, '', 0, '', false, true, 'width:150px;', true);
|
||||
|
||||
$table->data['edit3'][2] = __('SMNP community');
|
||||
$table->data['edit3'][3] = html_print_input_text ('snmp_community', '',
|
||||
'', 10, 15, true);
|
||||
|
@ -668,8 +690,10 @@ $(document).ready (function () {
|
|||
|
||||
clean_lists();
|
||||
|
||||
|
||||
$(".select_modules_row").css('display', '<?php echo $modules_row?>');
|
||||
$(".select_agents_row").css('display', '<?php echo $agents_row?>');
|
||||
$(".select_modules_row_2").css('display', 'none');
|
||||
|
||||
// Trigger change to refresh selection when change selection mode
|
||||
$("#agents_selection_mode").change (function() {
|
||||
|
@ -716,7 +740,7 @@ $(document).ready (function () {
|
|||
var params = {
|
||||
"page" : "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json" : 1,
|
||||
"get_distinct_name" : 1,
|
||||
"get_id_and_name" : 1,
|
||||
"indexed" : 0
|
||||
};
|
||||
|
||||
|
@ -726,6 +750,13 @@ $(document).ready (function () {
|
|||
var status_module = $('#status_module').val();
|
||||
if (status_module != '-1')
|
||||
params['status_module'] = status_module;
|
||||
|
||||
var tags_to_search = $('#tags').val();
|
||||
if (tags_to_search != null) {
|
||||
if (tags_to_search[0] != -1) {
|
||||
params['tags'] = tags_to_search;
|
||||
}
|
||||
}
|
||||
|
||||
$("#module_loading").show ();
|
||||
$("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide ();
|
||||
|
@ -932,6 +963,7 @@ $(document).ready (function () {
|
|||
else if(selector == 'modules') {
|
||||
$(".select_agents_row").hide();
|
||||
$(".select_modules_row").show();
|
||||
$("#module_type").trigger("change");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -963,7 +995,6 @@ $(document).ready (function () {
|
|||
|
||||
$("#groups_select").change (
|
||||
function () {
|
||||
|
||||
if (this.value < 0) {
|
||||
clean_lists();
|
||||
$(".select_agents_row_2").css('display', 'none');
|
||||
|
@ -1047,6 +1078,14 @@ $(document).ready (function () {
|
|||
}
|
||||
});
|
||||
|
||||
$("#tags").change(function() {
|
||||
selector = $("#form_edit input[name=selection_mode]:checked").val();
|
||||
$("#module_type").trigger("change");
|
||||
});
|
||||
$("#tags1").change(function() {
|
||||
selector = $("#form_edit input[name=selection_mode]:checked").val();
|
||||
$("#id_agents").trigger("change");
|
||||
});
|
||||
});
|
||||
|
||||
function disabled_status () {
|
||||
|
|
|
@ -63,13 +63,13 @@ if (is_ajax()) {
|
|||
}
|
||||
|
||||
if ($get_agents) {
|
||||
$sql = "SELECT ta.id_agente, ta.nombre AS agent_name,
|
||||
$sql = "SELECT ta.id_agente, ta.alias AS agent_alias,
|
||||
tam.nombre AS module_name
|
||||
FROM tagente ta
|
||||
INNER JOIN tagente_modulo tam
|
||||
ON ta.id_agente = tam.id_agente
|
||||
AND tam.id_plugin = $plugin_id
|
||||
ORDER BY ta.nombre, tam.nombre";
|
||||
ORDER BY ta.alias, tam.nombre";
|
||||
$result = db_get_all_rows_sql($sql);
|
||||
if (empty($result)) $result = array();
|
||||
|
||||
|
@ -78,7 +78,7 @@ if (is_ajax()) {
|
|||
$current_element = array();
|
||||
foreach ($result as $key => $value) {
|
||||
$id = (int) $value['id_agente'];
|
||||
$name = $value['agent_name'];
|
||||
$name = io_safe_output($value['agent_alias']);
|
||||
$module_name = $value['module_name'];
|
||||
|
||||
if (!empty($current_element) && $current_element['id'] !== $id) {
|
||||
|
@ -674,7 +674,7 @@ echo '</form>';
|
|||
}
|
||||
|
||||
var processGet = function (params, callback) {
|
||||
return jQuery.get(ajaxPage, params, 'json')
|
||||
return jQuery.post(ajaxPage, params, 'json')
|
||||
.done(function (data, textStatus, jqXHR) {
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
|
@ -911,6 +911,10 @@ echo '</form>';
|
|||
try {
|
||||
var agentsFiltered = agentsFilteredWithAgents(agents, ids);
|
||||
var modules = moduleNamesFromAgents(agentsFiltered);
|
||||
|
||||
for (var i = 0; i < modules.length; i++) {
|
||||
modules[i] = htmlDecode(modules[i]);
|
||||
}
|
||||
|
||||
fillModules(modules, modulesSelected);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ $options_plugins = array(
|
|||
'edit_plugins' => __('Bulk plugin edit')
|
||||
);
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "PM")) {
|
||||
if (! check_acl ($config['id_user'], 0, "AW")) {
|
||||
unset($options_modules['edit_modules']);
|
||||
}
|
||||
|
||||
|
|
|
@ -120,6 +120,7 @@ switch ($action) {
|
|||
$description = null;
|
||||
$sql = null;
|
||||
$show_in_two_columns = 0;
|
||||
$show_in_same_row = 0;
|
||||
$show_in_landscape = 0;
|
||||
$hide_notinit_agents = 0;
|
||||
$server_name = '';
|
||||
|
@ -158,6 +159,7 @@ switch ($action) {
|
|||
$description = null;
|
||||
$sql = null;
|
||||
$show_in_two_columns = 0;
|
||||
$show_in_same_row = 0;
|
||||
$show_in_landscape = 0;
|
||||
$hide_notinit_agents = 0;
|
||||
$server_name = '';
|
||||
|
@ -182,6 +184,7 @@ switch ($action) {
|
|||
|
||||
$style = json_decode(io_safe_output($item['style']), true);
|
||||
|
||||
$show_in_same_row = $style['show_in_same_row'];
|
||||
$show_in_two_columns = $style['show_in_two_columns'];
|
||||
$show_in_landscape = $style['show_in_landscape'];
|
||||
$hide_notinit_agents = $style['hide_notinit_agents'];
|
||||
|
@ -340,24 +343,28 @@ switch ($action) {
|
|||
$sql = $item['external_source'];
|
||||
$idCustom = $item['treport_custom_sql_id'];
|
||||
$header = $item['header_definition'];
|
||||
$historical_db = $item['historical_db'];
|
||||
$period = 0;
|
||||
break;
|
||||
case 'sql_graph_pie':
|
||||
$description = $item['description'];
|
||||
$sql = $item['external_source'];
|
||||
$idCustom = $item['treport_custom_sql_id'];
|
||||
$historical_db = $item['historical_db'];
|
||||
$period = 0;
|
||||
break;
|
||||
case 'sql_graph_vbar':
|
||||
$description = $item['description'];
|
||||
$sql = $item['external_source'];
|
||||
$idCustom = $item['treport_custom_sql_id'];
|
||||
$historical_db = $item['historical_db'];
|
||||
$period = 0;
|
||||
break;
|
||||
case 'sql_graph_hbar':
|
||||
$description = $item['description'];
|
||||
$sql = $item['external_source'];
|
||||
$idCustom = $item['treport_custom_sql_id'];
|
||||
$historical_db = $item['historical_db'];
|
||||
$period = 0;
|
||||
break;
|
||||
case 'url':
|
||||
|
@ -658,7 +665,6 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_netflow_filter" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Filter');?></td>
|
||||
<td>
|
||||
|
@ -1463,10 +1469,33 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_historical_db_check" style="" class="datos">
|
||||
<td style="font-weight:bold;">
|
||||
<?php echo __('Query History Database'); ?>
|
||||
</td>
|
||||
<td style="">
|
||||
<?php
|
||||
html_print_checkbox('historical_db_check',1,$historical_db);?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_show_in_two_columns" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Show in two columns');?></td>
|
||||
<td><?php html_print_checkbox('show_in_two_columns', 1, $show_in_two_columns, false,
|
||||
false, 'if ($(\'input[name=show_in_two_columns]\').is(\':checked\')) $(\'input[name=show_in_landscape]\').attr(\'checked\', false);');?></td>
|
||||
<td><?php html_print_checkbox('show_in_two_columns', 1, $show_in_two_columns);?></td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_show_in_same_row" style="" class="datos">
|
||||
<td style="font-weight:bold;" class="datos">
|
||||
<?php
|
||||
echo __('Show in the same row');
|
||||
ui_print_help_tip(__('Show one module per row with all its operations'));
|
||||
?>
|
||||
</td>
|
||||
<td style="">
|
||||
<?php
|
||||
html_print_checkbox('show_in_same_row', '1', $show_in_same_row, false, false, '');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_sort" style="" class="datos">
|
||||
|
@ -2579,6 +2608,8 @@ function chooseType() {
|
|||
$("#row_exception_condition_value").hide();
|
||||
$("#row_exception_condition").hide();
|
||||
$("#row_show_in_two_columns").hide();
|
||||
$("#row_show_in_same_row").hide();
|
||||
$("#row_historical_db_check").hide();
|
||||
$("#row_show_in_landscape").hide();
|
||||
$('#row_hide_notinit_agents').hide();
|
||||
$("#row_module_group").hide();
|
||||
|
@ -2637,6 +2668,7 @@ function chooseType() {
|
|||
$("#row_event_graph_by_validated").show();
|
||||
|
||||
$("#row_filter_search").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'event_report_log':
|
||||
|
@ -2645,6 +2677,7 @@ function chooseType() {
|
|||
$("#row_period").show();
|
||||
$("#agents_row").show();
|
||||
$("#row_source").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'simple_graph':
|
||||
|
@ -2662,6 +2695,7 @@ function chooseType() {
|
|||
$("#row_show_in_two_columns").show();
|
||||
$("#row_show_in_landscape").show();
|
||||
$("#row_time_compare_overlapped").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'projection_graph':
|
||||
|
@ -2672,6 +2706,7 @@ function chooseType() {
|
|||
$("#row_estimate").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_show_in_landscape").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'prediction_date':
|
||||
|
@ -2681,6 +2716,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_interval").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'custom_graph':
|
||||
|
@ -2690,6 +2726,7 @@ function chooseType() {
|
|||
$("#row_custom_graph").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_show_in_landscape").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'SLA':
|
||||
|
@ -2701,6 +2738,7 @@ function chooseType() {
|
|||
$("#row_show_graph").show();
|
||||
$("#row_sort").show();
|
||||
$('#row_hide_notinit_agents').show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'availability_graph':
|
||||
|
@ -2708,6 +2746,7 @@ function chooseType() {
|
|||
$("#row_period").show();
|
||||
$("#sla_list").show();
|
||||
$("#row_working_time").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'module_histogram_graph':
|
||||
|
@ -2715,6 +2754,7 @@ function chooseType() {
|
|||
$("#row_period").show();
|
||||
$("#row_agent").show();
|
||||
$("#row_module").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'SLA_monthly':
|
||||
|
@ -2724,6 +2764,7 @@ function chooseType() {
|
|||
$("#sla_list").show();
|
||||
$("#row_working_time").show();
|
||||
$("#row_sort").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'SLA_services':
|
||||
|
@ -2740,6 +2781,7 @@ function chooseType() {
|
|||
$(".sla_list_sla_max_col").hide();
|
||||
$(".sla_list_sla_limit_col").hide();
|
||||
$("#sla_list").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'monitor_report':
|
||||
|
@ -2748,6 +2790,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'avg_value':
|
||||
|
@ -2756,6 +2799,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'max_value':
|
||||
|
@ -2764,6 +2808,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'min_value':
|
||||
|
@ -2772,6 +2817,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'sumatory':
|
||||
|
@ -2780,6 +2826,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'historical_data':
|
||||
|
@ -2788,6 +2835,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'agent_detailed':
|
||||
|
@ -2795,12 +2843,14 @@ function chooseType() {
|
|||
$("#row_agent").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'text':
|
||||
$("#row_description").show();
|
||||
$("#row_text").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'sql':
|
||||
|
@ -2811,6 +2861,7 @@ function chooseType() {
|
|||
$("#row_custom_example").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").show();
|
||||
break;
|
||||
|
||||
case 'sql_graph_pie':
|
||||
|
@ -2819,6 +2870,8 @@ function chooseType() {
|
|||
$("#row_show_in_two_columns").show();
|
||||
$("#row_show_in_landscape").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").show();
|
||||
|
||||
break;
|
||||
|
||||
case 'sql_graph_hbar':
|
||||
|
@ -2827,6 +2880,7 @@ function chooseType() {
|
|||
$("#row_show_in_two_columns").show();
|
||||
$("#row_show_in_landscape").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").show();
|
||||
break;
|
||||
|
||||
case 'sql_graph_vbar':
|
||||
|
@ -2835,11 +2889,13 @@ function chooseType() {
|
|||
$("#row_show_in_two_columns").show();
|
||||
$("#row_show_in_landscape").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").show();
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
$("#row_description").show();
|
||||
$("#row_url").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'database_serialized':
|
||||
|
@ -2851,6 +2907,7 @@ function chooseType() {
|
|||
$("#row_line_separator").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'TTRT':
|
||||
|
@ -2859,6 +2916,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'TTO':
|
||||
|
@ -2867,6 +2925,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'MTBF':
|
||||
|
@ -2875,6 +2934,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'MTTR':
|
||||
|
@ -2883,6 +2943,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'alert_report_module':
|
||||
|
@ -2891,6 +2952,7 @@ function chooseType() {
|
|||
$("#row_module").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'alert_report_group':
|
||||
|
@ -2899,6 +2961,7 @@ function chooseType() {
|
|||
$("#row_show_in_two_columns").show();
|
||||
$("#row_group").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'alert_report_agent':
|
||||
|
@ -2906,6 +2969,7 @@ function chooseType() {
|
|||
$("#row_agent").show();
|
||||
$("#row_period").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'event_report_group':
|
||||
|
@ -2924,6 +2988,7 @@ function chooseType() {
|
|||
$("#row_event_type").show();
|
||||
|
||||
$("#row_filter_search").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
|
||||
|
@ -2946,6 +3011,7 @@ function chooseType() {
|
|||
$('#agent_autocomplete').hide();
|
||||
$('#agent_autocomplete_events').show();
|
||||
$("#row_filter_search").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'event_report_module':
|
||||
|
@ -2966,6 +3032,7 @@ function chooseType() {
|
|||
$('#agent_autocomplete').hide();
|
||||
$('#agent_autocomplete_events').show();
|
||||
$("#row_filter_search").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'general':
|
||||
|
@ -2976,6 +3043,7 @@ function chooseType() {
|
|||
$("#row_order_uptodown").show();
|
||||
$("#row_show_resume").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_show_in_same_row").show();
|
||||
|
||||
var checked = $("input[name='last_value']").prop("checked");
|
||||
|
||||
|
@ -2984,6 +3052,7 @@ function chooseType() {
|
|||
$("#row_period").hide();
|
||||
$("input[name='last_value']").prop("checked", true);
|
||||
}
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'availability':
|
||||
|
@ -2996,18 +3065,21 @@ function chooseType() {
|
|||
$("#row_show_resume").show();
|
||||
$("#row_working_time").show();
|
||||
$('#row_hide_notinit_agents').show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'group_report':
|
||||
$("#row_group").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_description").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'network_interfaces_report':
|
||||
$("#row_group").show();
|
||||
$("#row_description").show();
|
||||
$("#row_period").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'top_n':
|
||||
|
@ -3020,6 +3092,7 @@ function chooseType() {
|
|||
$("#row_show_resume").show();
|
||||
$("#row_show_graph").show();
|
||||
$("#row_show_in_two_columns").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'exception':
|
||||
|
@ -3040,6 +3113,7 @@ function chooseType() {
|
|||
$("#row_period").hide();
|
||||
$("input[name='last_value']").prop("checked", true);
|
||||
}
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'agent_module':
|
||||
|
@ -3049,6 +3123,7 @@ function chooseType() {
|
|||
$("#select_agent_modules").show();
|
||||
$("#agents_row").show();
|
||||
$("#modules_row").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'inventory_changes':
|
||||
|
@ -3065,6 +3140,7 @@ function chooseType() {
|
|||
$("#combo_group").change(function() {
|
||||
updateAgents($(this).val(), <?php echo '"' . ui_get_full_url(false, false, false, false) . '"'; ?>);
|
||||
});
|
||||
$("#row_historical_db_check").hide();
|
||||
|
||||
break;
|
||||
|
||||
|
@ -3099,18 +3175,22 @@ function chooseType() {
|
|||
|
||||
if (!$("#hidden-date_selected").val())
|
||||
updateInventoryDates(<?php echo '"' . ui_get_full_url(false, false, false, false) . '"'; ?>);
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'inventory_changes':
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'agent_configuration':
|
||||
$("#row_agent").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'group_configuration':
|
||||
$("#row_group").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'netflow_area':
|
||||
|
@ -3120,6 +3200,7 @@ function chooseType() {
|
|||
$("#row_max_values").show();
|
||||
$("#row_resolution").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'netflow_pie':
|
||||
|
@ -3129,6 +3210,7 @@ function chooseType() {
|
|||
$("#row_max_values").show();
|
||||
$("#row_resolution").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'netflow_data':
|
||||
|
@ -3138,6 +3220,7 @@ function chooseType() {
|
|||
$("#row_max_values").show();
|
||||
$("#row_resolution").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'netflow_summary':
|
||||
|
@ -3146,6 +3229,7 @@ function chooseType() {
|
|||
$("#row_period").show();
|
||||
$("#row_resolution").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
||||
case 'netflow_statistics':
|
||||
|
@ -3155,6 +3239,7 @@ function chooseType() {
|
|||
$("#row_max_values").show();
|
||||
$("#row_resolution").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
}
|
||||
switch (type) {
|
||||
|
|
|
@ -1124,6 +1124,7 @@ switch ($action) {
|
|||
$values['treport_custom_sql_id'] = get_parameter('id_custom');
|
||||
if ($values['treport_custom_sql_id'] == 0) {
|
||||
$values['external_source'] = get_parameter('sql');
|
||||
$values['historical_db'] = get_parameter('historical_db_check');
|
||||
}
|
||||
}
|
||||
else if ($values['type'] == 'url') {
|
||||
|
@ -1139,6 +1140,7 @@ switch ($action) {
|
|||
|
||||
$style = array();
|
||||
$style['show_in_two_columns'] = get_parameter('show_in_two_columns', 0);
|
||||
$style['show_in_same_row'] = get_parameter('show_in_same_row', 0);
|
||||
$style['show_in_landscape'] = get_parameter('show_in_landscape', 0);
|
||||
$style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0);
|
||||
|
||||
|
@ -1444,6 +1446,7 @@ switch ($action) {
|
|||
$values['treport_custom_sql_id'] = get_parameter('id_custom');
|
||||
if ($values['treport_custom_sql_id'] == 0) {
|
||||
$values['external_source'] = get_parameter('sql');
|
||||
$values['historical_db'] = get_parameter('historical_db_check');
|
||||
}
|
||||
}
|
||||
elseif ($values['type'] == 'url') {
|
||||
|
@ -1459,6 +1462,7 @@ switch ($action) {
|
|||
|
||||
$style = array();
|
||||
$style['show_in_two_columns'] = get_parameter('show_in_two_columns', 0);
|
||||
$style['show_in_same_row'] = get_parameter('show_in_same_row', 0);
|
||||
$style['show_in_landscape'] = get_parameter('show_in_landscape', 0);
|
||||
$style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0);
|
||||
|
||||
|
|
|
@ -3181,7 +3181,6 @@ function unselectAll() {
|
|||
}
|
||||
|
||||
function click_button_toolbox(id) {
|
||||
unselectAll();
|
||||
switch (id) {
|
||||
case 'static_graph':
|
||||
toolbuttonActive = creationItem = 'static_graph';
|
||||
|
|
|
@ -83,7 +83,7 @@ foreach ($servers as $server) {
|
|||
$data = array ();
|
||||
$table->cellclass[][3] = "progress_bar";
|
||||
$data[0] = '<span title="' . $server['version'] . '">' .
|
||||
$server['name'] . '</span>';
|
||||
strip_tags($server['name']) . '</span>';
|
||||
|
||||
//Status
|
||||
$data[1] = ui_print_status_image (STATUS_SERVER_OK, '', true);
|
||||
|
@ -141,6 +141,14 @@ foreach ($servers as $server) {
|
|||
//Only Pandora Administrator can delete servers
|
||||
if (check_acl ($config["id_user"], 0, "PM")) {
|
||||
$data[8] = '';
|
||||
|
||||
if ($server['type'] == 'recon') {
|
||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=operation/servers/recon_view">';
|
||||
$data[8] .= html_print_image ('images/firts_task/icono_grande_reconserver.png', true,
|
||||
array('title' => __('Manage recon tasks'),'style' => 'width:21px;height:21px;'));
|
||||
$data[8] .= '</a> ';
|
||||
}
|
||||
|
||||
if ($server['type'] == 'data') {
|
||||
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server["id_server"].'">';
|
||||
$data[8] .= html_print_image ('images/target.png', true,
|
||||
|
|
|
@ -109,7 +109,6 @@ if (is_ajax ()) {
|
|||
break;
|
||||
|
||||
case 'pandora':
|
||||
case 'babel':
|
||||
case 'ad':
|
||||
case 'saml':
|
||||
case 'integria':
|
||||
|
|
|
@ -188,6 +188,10 @@ $table->data[32][0] = __('Server logs directory') . ui_print_help_tip (__("Direc
|
|||
$table->data[32][1] = html_print_input_text ('server_log_dir',
|
||||
$config["server_log_dir"], '', 50, 255, true);
|
||||
|
||||
$table->data[33][0] = __('Log size limit in system logs viewer extension') . ui_print_help_tip (__("Maximun size to show in system log extension."), true);
|
||||
$table->data[33][1] = html_print_input_text ('max_log_size',
|
||||
$config["max_log_size"], '', 10, 255, true) . html_print_label(" x1000", "max_log_size", true);
|
||||
|
||||
$modes_tutorial = array(
|
||||
'full' => __('Full mode'),
|
||||
'on_demand' => __('On demand'),
|
||||
|
@ -200,23 +204,23 @@ $table->data['tutorial_mode'][1] =
|
|||
$config["tutorial_mode"], '', '', 0, true);
|
||||
|
||||
$config["past_planned_downtimes"] = isset($config["past_planned_downtimes"]) ? $config["past_planned_downtimes"] : 1;
|
||||
$table->data[33][0] = __('Allow create planned downtimes in the past') .
|
||||
$table->data[34][0] = __('Allow create planned downtimes in the past') .
|
||||
ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
|
||||
$table->data[33][1] = __('Yes').' '.html_print_radio_button ('past_planned_downtimes', 1, '', $config["past_planned_downtimes"], true).' ';
|
||||
$table->data[33][1] .= __('No').' '.html_print_radio_button ('past_planned_downtimes', 0, '', $config["past_planned_downtimes"], true);
|
||||
$table->data[34][1] = __('Yes').' '.html_print_radio_button ('past_planned_downtimes', 1, '', $config["past_planned_downtimes"], true).' ';
|
||||
$table->data[34][1] .= __('No').' '.html_print_radio_button ('past_planned_downtimes', 0, '', $config["past_planned_downtimes"], true);
|
||||
|
||||
$table->data[34][0] = __('Limit parameters massive') .
|
||||
$table->data[35][0] = __('Limit parameters massive') .
|
||||
ui_print_help_tip(__('Your PHP environment is setted with %d max_input_vars. Maybe you must not set this value with upper values.', ini_get("max_input_vars")), true);
|
||||
$table->data[34][1] = html_print_input_text('limit_parameters_massive',
|
||||
$table->data[35][1] = html_print_input_text('limit_parameters_massive',
|
||||
$config['limit_parameters_massive'], '', 10, 10, true);
|
||||
|
||||
$table->data[35][0] = __('Include agents manually disabled');
|
||||
$table->data[35][1] = __('Yes').' '.html_print_radio_button ('include_agents', 1, '', $config["include_agents"], true).' ';
|
||||
$table->data[35][1] .= __('No').' '.html_print_radio_button ('include_agents', 0, '', $config["include_agents"], true);
|
||||
$table->data[36][0] = __('Include agents manually disabled');
|
||||
$table->data[36][1] = __('Yes').' '.html_print_radio_button ('include_agents', 1, '', $config["include_agents"], true).' ';
|
||||
$table->data[36][1] .= __('No').' '.html_print_radio_button ('include_agents', 0, '', $config["include_agents"], true);
|
||||
|
||||
$table->data[36][0] = __('audit log directory') .
|
||||
$table->data[37][0] = __('audit log directory') .
|
||||
ui_print_help_tip (__("Directory where audit log is stored."), true);
|
||||
$table->data[36][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true);
|
||||
$table->data[37][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true);
|
||||
|
||||
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||
|
||||
|
|
|
@ -622,10 +622,6 @@ $table->data[14][0] = __('Not Login');
|
|||
$table->data[14][0] .= ui_print_help_tip(__('The user with not login set only can access to API.'), true);
|
||||
$table->data[14][1] = html_print_checkbox('not_login', 1, $user_info["not_login"], true);
|
||||
|
||||
$table->data[15][0] = __('Strict ACL');
|
||||
$table->data[15][0] .= ui_print_help_tip(__('With this option enabled, the user will can access to accurate information. It is not recommended for admin users because performance could be affected'), true);
|
||||
$table->data[15][1] = html_print_checkbox('strict_acl', 1, $user_info["strict_acl"], true);
|
||||
|
||||
$table->data[15][0] = __('Session Time');
|
||||
$table->data[15][0] .= ui_print_help_tip(__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'), true);
|
||||
$table->data[15][1] = html_print_input_text ('session_time', $user_info["session_time"], '', 5, 5, true);
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
|
@ -17,13 +17,6 @@ global $config;
|
|||
// Login check
|
||||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "LW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once ('include/functions_agents.php');
|
||||
require_once ('include/functions_alerts.php');
|
||||
$isFunctionPolicies = enterprise_include ('include/functions_policies.php');
|
||||
|
@ -48,6 +41,13 @@ if ($get_agent_alerts_simple) {
|
|||
echo json_encode (false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "LW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
echo json_encode (false);
|
||||
return;
|
||||
}
|
||||
|
||||
require_once ('include/functions_agents.php');
|
||||
require_once ('include/functions_alerts.php');
|
||||
|
@ -73,6 +73,12 @@ if ($get_agent_alerts_simple) {
|
|||
}
|
||||
|
||||
if ($enable_alert) {
|
||||
if (! check_acl ($config['id_user'], 0, "LW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
return false;
|
||||
}
|
||||
|
||||
$id_alert = (int) get_parameter ('id_alert');
|
||||
|
||||
$result = alerts_agent_module_disable ($id_alert, false);
|
||||
|
@ -84,6 +90,11 @@ if ($enable_alert) {
|
|||
}
|
||||
|
||||
if ($disable_alert) {
|
||||
if (! check_acl ($config['id_user'], 0, "LW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
return false;
|
||||
}
|
||||
$id_alert = (int) get_parameter ('id_alert');
|
||||
|
||||
$result = alerts_agent_module_disable ($id_alert, true);
|
||||
|
@ -95,6 +106,11 @@ if ($disable_alert) {
|
|||
}
|
||||
|
||||
if ($get_actions_module) {
|
||||
if (! check_acl ($config['id_user'], 0, "LW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
return false;
|
||||
}
|
||||
$id_module = get_parameter ('id_module');
|
||||
|
||||
if (empty($id_module))
|
||||
|
@ -107,6 +123,11 @@ if ($get_actions_module) {
|
|||
}
|
||||
|
||||
if ($show_update_action_menu) {
|
||||
if (! check_acl ($config['id_user'], 0, "LW")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
return false;
|
||||
}
|
||||
$id_agent_module = (int) get_parameter ('id_agent_module');
|
||||
$id_module_action = (int) get_parameter ('id_module_action');
|
||||
$id_agent = (int) get_parameter ('id_agent');
|
||||
|
|
|
@ -302,7 +302,7 @@ if ($get_extended_event) {
|
|||
$tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png',true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Comments')."</span></a></li>";
|
||||
|
||||
if (!$readonly &&
|
||||
(tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) {
|
||||
((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids)))) {
|
||||
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/event_responses_col.png',true)."<span style='position:relative;top:-6px;left:3px;margin-right:10px;'>".__('Responses')."</span></a></li>";
|
||||
}
|
||||
if ($event['custom_data'] != '') {
|
||||
|
@ -335,9 +335,9 @@ if ($get_extended_event) {
|
|||
$img_sev = "images/status_sets/default/severity_major.png";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!$readonly &&
|
||||
(tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) {
|
||||
((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids)))) {
|
||||
$responses = events_page_responses($event, $childrens_ids);
|
||||
}
|
||||
else {
|
||||
|
@ -503,15 +503,27 @@ if ($table_events) {
|
|||
require_once ("include/functions_graph.php");
|
||||
|
||||
$id_agente = (int)get_parameter('id_agente', 0);
|
||||
$all_events_24h = (int)get_parameter('all_events_24h', 0);
|
||||
|
||||
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
|
||||
$groups = users_get_groups($config["id_user"]);
|
||||
|
||||
$tags_condition = tags_get_acl_tags($config['id_user'],
|
||||
array_keys($groups), 'ER', 'event_condition', 'AND');
|
||||
|
||||
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%',
|
||||
false, $id_agente,true);
|
||||
echo '<div id="div_all_events_24h">';
|
||||
echo '<label><b>' . __('Show all Events 24h') . '</b></label>';
|
||||
echo html_print_checkbox('all_events_24h', $all_events_24h, $all_events_24h, true, false, '', true);
|
||||
echo '</div>';
|
||||
$date_subtract_day = time() - (24 * 60 * 60);
|
||||
|
||||
if($all_events_24h){
|
||||
events_print_event_table ("utimestamp > $date_subtract_day", 10, '100%',
|
||||
false, $id_agente,true);
|
||||
}
|
||||
else{
|
||||
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%',
|
||||
false, $id_agente,true);
|
||||
}
|
||||
}
|
||||
|
||||
if ($get_list_events_agents) {
|
||||
|
|
|
@ -254,7 +254,9 @@ if ($get_module_detail) {
|
|||
|
||||
$id_type_web_content_string = db_get_value('id_tipo',
|
||||
'ttipo_modulo', 'nombre', 'web_content_string');
|
||||
|
||||
|
||||
$post_process = db_get_value_filter('post_process','tagente_modulo',array('id_agente_modulo' => $module_id));
|
||||
|
||||
foreach ($result as $row) {
|
||||
$data = array ();
|
||||
|
||||
|
@ -305,10 +307,16 @@ if ($get_module_detail) {
|
|||
switch($row['module_type']) {
|
||||
case 15:
|
||||
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
|
||||
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
|
||||
$data[] = human_milliseconds_to_string($row['data']);
|
||||
else
|
||||
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0'){
|
||||
if($post_process > 0){
|
||||
$data[] = human_milliseconds_to_string($row['data'] / $post_process);
|
||||
} else {
|
||||
$data[] = human_milliseconds_to_string($row['data']);
|
||||
}
|
||||
}else{
|
||||
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
|
||||
|
@ -970,10 +978,16 @@ if ($list_modules) {
|
|||
switch($module['id_tipo_modulo']) {
|
||||
case 15:
|
||||
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
|
||||
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
|
||||
$salida = human_milliseconds_to_string($module['datos']);
|
||||
else
|
||||
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0'){
|
||||
if($module['post_process']>0){
|
||||
$salida = human_milliseconds_to_string($module['datos'] / $module['post_process']);
|
||||
} else {
|
||||
$salida = human_milliseconds_to_string($module['datos']);
|
||||
}
|
||||
} else {
|
||||
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||
|
@ -986,16 +1000,20 @@ if ($list_modules) {
|
|||
switch($module['id_tipo_modulo']) {
|
||||
case 15:
|
||||
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
|
||||
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
|
||||
$salida = human_milliseconds_to_string($module['datos']);
|
||||
else
|
||||
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0'){
|
||||
if($module['post_process']>0){
|
||||
$salida = human_milliseconds_to_string($module['datos'] / $module['post_process']);
|
||||
} else {
|
||||
$salida = human_milliseconds_to_string($module['datos']);
|
||||
}
|
||||
} else {
|
||||
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||
break;
|
||||
}
|
||||
//~ $salida = (number_format($module["datos"], $config['graph_precision']));
|
||||
}
|
||||
// Show units ONLY in numeric data types
|
||||
if (isset($module["unit"])) {
|
||||
|
|
|
@ -116,8 +116,16 @@ if ($install_package) {
|
|||
$package = trim($package);
|
||||
|
||||
$chunks = explode("_", basename($package));
|
||||
$chunks = explode(".", $chunks[1]);
|
||||
$version = $chunks[0];
|
||||
$chunks = explode(".", $chunks[1]);
|
||||
if(is_numeric($chunks[0])){
|
||||
$version = $chunks[0];
|
||||
} else {
|
||||
$current_package = db_get_value('value', 'tconfig',
|
||||
'token', 'current_package_enterprise');
|
||||
if (!empty($current_package)) {
|
||||
$version = $current_package;
|
||||
}
|
||||
}
|
||||
|
||||
// All files extracted
|
||||
$files_total = $package . "/files.txt";
|
||||
|
|
|
@ -201,14 +201,6 @@ function process_user_login_remote ($login, $pass, $api = false) {
|
|||
}
|
||||
break;
|
||||
|
||||
// Remote Babel Enterprise
|
||||
case 'babel':
|
||||
if (enterprise_hook ('remote_babel_process_user_login', array ($login, $pass)) === false) {
|
||||
$config["auth_error"] = "User not found in database or incorrect password";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
// Remote Integria
|
||||
case 'integria':
|
||||
if (enterprise_hook ('remote_integria_process_user_login', array ($login, $pass)) === false) {
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC170531';
|
||||
$pandora_version = 'v7.0NG.704';
|
||||
$build_version = 'PC170620';
|
||||
$pandora_version = 'v7.0NG.705';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
@ -113,29 +113,45 @@ require_once ($ownDir . 'functions.php');
|
|||
// We need a timezone BEFORE calling config_process_config.
|
||||
// If not we will get ugly warnings. Set Europe/Madrid by default
|
||||
// Later will be replaced by the good one.
|
||||
if (!defined('METACONSOLE')) {
|
||||
if(!isset($config["homeurl"])){
|
||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||
$config["homeurl"] = $url[1];
|
||||
$config["homeurl_static"] = $url[1];
|
||||
$config["error"] = "homeurl_bad_defined";
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||
if($config["homeurl"] != '/'.$url[1]){
|
||||
$config["homeurl"] = '/'.$url[1];
|
||||
$config["homeurl_static"] = '/'.$url[1];
|
||||
$config["error"] = "homeurl_bad_defined";
|
||||
return;
|
||||
if(!is_dir($_SERVER['DOCUMENT_ROOT'] . $config["homeurl"]) || !is_dir($_SERVER['DOCUMENT_ROOT'] . $config["homeurl_static"])){
|
||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||
$flag_url =0;
|
||||
foreach ($url as $key => $value) {
|
||||
if (strpos($value, 'index.php') !== false || $flag_url) {
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
else if(strpos($value, 'enterprise') !== false || $flag_url){
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
}
|
||||
$config["homeurl"] = rtrim(join("/", $url),"/");
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
$config["error"] = "homeurl_bad_defined";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($config["homeurl_static"])) {
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
}
|
||||
else{
|
||||
if($config["homeurl_static"] != $config["homeurl"]){
|
||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||
$flag_url =0;
|
||||
foreach ($url as $key => $value) {
|
||||
if (strpos($value, 'index.php') !== false || $flag_url) {
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
else if(strpos($value, 'enterprise') !== false || $flag_url){
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
}
|
||||
$config["homeurl"] = rtrim(join("/", $url),"/");
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
$config["error"] = "homeurl_bad_defined";
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1282,7 +1282,7 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) {
|
|||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$sql1 = 'SELECT name
|
||||
FROM tserver WHERE name LIKE "' . $nameServer . '"';
|
||||
FROM tserver WHERE BINARY name LIKE "' . $nameServer . '"';
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
|
@ -1382,9 +1382,20 @@ function api_set_create_custom_field($t1, $t2, $other, $returnType) {
|
|||
returnError('error_parameter', 'Custom field display flag required');
|
||||
return;
|
||||
}
|
||||
|
||||
$is_password_type = 0;
|
||||
|
||||
if ($other['data'][2] != '') {
|
||||
$is_password_type = $other['data'][2];
|
||||
}
|
||||
else {
|
||||
returnError('error_parameter', 'Custom field is password type required');
|
||||
return;
|
||||
}
|
||||
|
||||
$result = db_process_sql_insert('tagent_custom_fields',
|
||||
array('name' => $name, 'display_on_front' => $display_front));
|
||||
array('name' => $name, 'display_on_front' => $display_front,
|
||||
'is_password_type' => $is_password_type));
|
||||
|
||||
$data['type'] = "string";
|
||||
$data["data"] = $result;
|
||||
|
|
|
@ -194,6 +194,8 @@ function config_update_config () {
|
|||
$error_update[] = __('Command Snapshot');
|
||||
if (!config_update_value ('server_log_dir', get_parameter('server_log_dir')))
|
||||
$error_update[] = __('Server logs directory');
|
||||
if (!config_update_value ('max_log_size', get_parameter('max_log_size')))
|
||||
$error_update[] = __('Log size limit in system logs viewer extension');
|
||||
if (!config_update_value ('tutorial_mode', get_parameter('tutorial_mode')))
|
||||
$error_update[] = __('Tutorial mode');
|
||||
if (!config_update_value ('past_planned_downtimes', get_parameter('past_planned_downtimes')))
|
||||
|
@ -348,16 +350,6 @@ function config_update_config () {
|
|||
if (!config_update_value ('rpandora_pass', io_input_password(get_parameter ('rpandora_pass'))))
|
||||
$error_update[] = __('Password');
|
||||
|
||||
if (!config_update_value ('rbabel_server', get_parameter ('rbabel_server')))
|
||||
$error_update[] = __('Babel Enterprise host');
|
||||
if (!config_update_value ('rbabel_port', get_parameter ('rbabel_port')))
|
||||
$error_update[] = __('MySQL port');
|
||||
if (!config_update_value ('rbabel_dbname', get_parameter ('rbabel_dbname')))
|
||||
$error_update[] = __('Database name');
|
||||
if (!config_update_value ('rbabel_user', get_parameter ('rbabel_user')))
|
||||
$error_update[] = __('User');
|
||||
if (!config_update_value ('rbabel_pass', io_input_password(get_parameter ('rbabel_pass'))))
|
||||
$error_update[] = __('Password');
|
||||
if (!config_update_value ('rintegria_server', get_parameter ('rintegria_server')))
|
||||
$error_update[] = __('Integria host');
|
||||
if (!config_update_value ('rintegria_port', get_parameter ('rintegria_port')))
|
||||
|
@ -1446,26 +1438,6 @@ function config_process_config () {
|
|||
config_update_value ( 'rpandora_pass', '');
|
||||
}
|
||||
|
||||
if (!isset ($config['rbabel_server'])) {
|
||||
config_update_value ( 'rbabel_server', 'localhost');
|
||||
}
|
||||
|
||||
if (!isset ($config['rbabel_port'])) {
|
||||
config_update_value ( 'rbabel_port', 3306);
|
||||
}
|
||||
|
||||
if (!isset ($config['rbabel_dbname'])) {
|
||||
config_update_value ( 'rbabel_dbname', 'babel');
|
||||
}
|
||||
|
||||
if (!isset ($config['rbabel_user'])) {
|
||||
config_update_value ( 'rbabel_user', 'babel');
|
||||
}
|
||||
|
||||
if (!isset ($config['rbabel_pass'])) {
|
||||
config_update_value ( 'rbabel_pass', '');
|
||||
}
|
||||
|
||||
if (!isset ($config['rintegria_server'])) {
|
||||
config_update_value ( 'rintegria_server', 'localhost');
|
||||
}
|
||||
|
@ -1627,6 +1599,10 @@ function config_process_config () {
|
|||
if (!isset($config['server_log_dir'])) {
|
||||
config_update_value ('server_log_dir', "");
|
||||
}
|
||||
|
||||
if (!isset($config['max_log_size'])) {
|
||||
config_update_value ('max_log_size', 512);
|
||||
}
|
||||
|
||||
if (!isset($config['show_group_name'])) {
|
||||
config_update_value ('show_group_name', 0);
|
||||
|
|
|
@ -26,7 +26,13 @@ function cron_update_module_interval ($module_id, $cron) {
|
|||
return;
|
||||
}
|
||||
|
||||
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . cron_next_execution ($cron) . ' WHERE id_agente_modulo = ' . (int) $module_id);
|
||||
if($cron == "* * * * *"){
|
||||
$module_interval = db_get_value_filter('module_interval','tagente_modulo',array("id_agente_modulo" => $module_id));
|
||||
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . $module_interval . ' WHERE id_agente_modulo = ' . (int) $module_id);
|
||||
} else {
|
||||
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . cron_next_execution ($cron) . ' WHERE id_agente_modulo = ' . (int) $module_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -64,8 +64,23 @@ function db_connect($host = null, $db = null, $user = null, $pass = null, $port
|
|||
// Something went wrong
|
||||
if ($return === false) {
|
||||
if ($critical) {
|
||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||
$flag_url =0;
|
||||
foreach ($url as $key => $value) {
|
||||
if (strpos($value, 'index.php') !== false || $flag_url) {
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
else if(strpos($value, 'enterprise') !== false || $flag_url){
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
}
|
||||
$config["homeurl"] = rtrim(join("/", $url),"/");
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
||||
$config['homedir'] = $ownDir;
|
||||
$login_screen = 'error_authconfig';
|
||||
|
||||
require($config['homedir'] . '/general/error_screen.php');
|
||||
exit;
|
||||
}
|
||||
|
@ -569,7 +584,13 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f
|
|||
|
||||
if ((!isset($tstart)) || ($tstart === false)) {
|
||||
// Return data from the begining
|
||||
$tstart = 0;
|
||||
// Get first available utimestamp in active DB
|
||||
$query_first_man_time = " SELECT utimestamp FROM tagente_datos ";
|
||||
$query_first_man_time .= " WHERE id_agente_modulo = $id_agente_modulo";
|
||||
$query_first_man_time .= " ORDER BY utimestamp ASC LIMIT 1";
|
||||
|
||||
$first_man_time = db_get_all_rows_sql( $query_first_man_time, false);
|
||||
$tstart = $first_man_time[0]['utimestamp'];
|
||||
}
|
||||
|
||||
if ((!isset($tend)) || ($tend === false)) {
|
||||
|
@ -581,7 +602,6 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
$search_historydb = false;
|
||||
$table = "tagente_datos";
|
||||
|
||||
|
@ -596,13 +616,11 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f
|
|||
$table = "tagente_datos_string";
|
||||
}
|
||||
|
||||
|
||||
// Get first available utimestamp in active DB
|
||||
$query = " SELECT utimestamp, datos FROM $table ";
|
||||
$query .= " WHERE id_agente_modulo=$id_agente_modulo AND utimestamp < $tstart";
|
||||
$query .= " ORDER BY utimestamp DESC LIMIT 1";
|
||||
|
||||
|
||||
$ret = db_get_all_rows_sql( $query , $search_historydb);
|
||||
|
||||
if ( ( $ret === false ) || (( isset($ret[0]["utimestamp"]) && ($ret[0]["utimestamp"] > $tstart )))) {
|
||||
|
@ -610,6 +628,10 @@ function db_uncompress_module_data($id_agente_modulo, $tstart = false, $tend = f
|
|||
$search_historydb = true;
|
||||
|
||||
$ret = db_get_all_rows_sql( $query , $search_historydb);
|
||||
|
||||
if ($ret) {
|
||||
$tstart = $ret[0]["utimestamp"];
|
||||
}
|
||||
}
|
||||
else {
|
||||
$first_data["utimestamp"] = $ret[0]["utimestamp"];
|
||||
|
|
|
@ -2336,7 +2336,8 @@ function events_page_general ($event) {
|
|||
|
||||
$data = array();
|
||||
$data[0] = __('Event name');
|
||||
$data[1] = strip_tags(io_safe_output($event["evento"]));
|
||||
$event["evento"] = str_replace ( '
' , '<br>' , $event["evento"]);
|
||||
$data[1] = io_safe_output($event["evento"]);
|
||||
$table_general->data[] = $data;
|
||||
|
||||
$data = array();
|
||||
|
|
|
@ -232,14 +232,14 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
$projection, $avg_only = false, $uncompressed_module = false,
|
||||
$show_events = false, $show_alerts = false, $show_unknown = false, $baseline = false,
|
||||
$baseline_data = array(), $events = array(), $series_suffix = '', $start_unknown = false,
|
||||
$percentil = null) {
|
||||
$percentil = null, $fullscale = false) {
|
||||
|
||||
global $config;
|
||||
global $chart_extra_data;
|
||||
global $series_type;
|
||||
global $max_value;
|
||||
global $min_value;
|
||||
|
||||
|
||||
$max_value = 0;
|
||||
$min_value = null;
|
||||
$flash_chart = $config['flash_charts'];
|
||||
|
@ -252,12 +252,14 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
|
||||
// Calculate chart data
|
||||
$last_known = $previous_data;
|
||||
|
||||
|
||||
|
||||
for ($i = 0; $i <= $resolution; $i++) {
|
||||
$timestamp = $datelimit + ($interval * $i);
|
||||
|
||||
|
||||
|
||||
if ($fullscale && ($resolution > ($config['graph_res'] * 50))) {
|
||||
$timestamp = $data[$i]['utimestamp'];
|
||||
}
|
||||
|
||||
$total = 0;
|
||||
$count = 0;
|
||||
|
||||
|
@ -279,6 +281,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
else if ($data[$data_i]['datos'] < $interval_min) {
|
||||
$interval_min = $data[$data_i]['datos'];
|
||||
}
|
||||
|
||||
$total += $data[$data_i]['datos'];
|
||||
$last_known = $data[$data_i]['datos'];
|
||||
$count++;
|
||||
|
@ -357,7 +360,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
$time_format = "M \nd H\h";
|
||||
}
|
||||
else {
|
||||
$time_format = "M Y";
|
||||
$time_format = "Y M \nd H\h";
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -378,7 +381,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
$time_format = "M d H\h";
|
||||
}
|
||||
else {
|
||||
$time_format = "M Y";
|
||||
$time_format = "Y M d H\h";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -386,7 +389,9 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
$long_index[$timestamp_short] = date(
|
||||
html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp);
|
||||
if (!$projection) {
|
||||
$timestamp = $timestamp_short;
|
||||
if (!$fullscale) {
|
||||
$timestamp = $timestamp_short;
|
||||
}
|
||||
}
|
||||
|
||||
// Data
|
||||
|
@ -450,8 +455,14 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
$series_type['no_data'.$series_suffix] = 'area';
|
||||
}
|
||||
else {
|
||||
$chart[$timestamp]['no_data'.$series_suffix] = $last_known;
|
||||
$series_type['no_data'.$series_suffix] = 'area';
|
||||
if($uncompressed_module){
|
||||
$chart[$timestamp]['sum'.$series_suffix] = $last_known;
|
||||
$series_type['sum'.$series_suffix] = 'area';
|
||||
}
|
||||
else{
|
||||
$chart[$timestamp]['no_data'.$series_suffix] = $last_known;
|
||||
$series_type['no_data'.$series_suffix] = 'area';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,20 +475,6 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
$series_type['unknown'.$series_suffix] = 'area';
|
||||
}
|
||||
|
||||
//$chart[$timestamp]['count'] = 0;
|
||||
/////////
|
||||
//$chart[$timestamp]['timestamp_bottom'] = $timestamp;
|
||||
//$chart[$timestamp]['timestamp_top'] = $timestamp + $interval;
|
||||
/////////
|
||||
|
||||
//Baseline was replaced by compare graphs feature
|
||||
/*if ($baseline) {
|
||||
$chart[$timestamp]['baseline'.$series_suffix] = array_shift ($baseline_data);
|
||||
if ($chart[$timestamp]['baseline'.$series_suffix] == NULL) {
|
||||
$chart[$timestamp]['baseline'.$series_suffix] = 0;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (!empty($event_ids)) {
|
||||
$chart_extra_data[count($chart)-1]['events'] = implode(',',$event_ids);
|
||||
}
|
||||
|
@ -504,7 +501,8 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
$show_alerts = false, $avg_only = 0, $date = 0, $unit = '',
|
||||
$baseline = 0, $return_data = 0, $show_title = true, $projection = false,
|
||||
$adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '',
|
||||
$show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false,$type_graph='area') {
|
||||
$show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false,
|
||||
$type_graph='area', $fullscale = false) {
|
||||
|
||||
global $config;
|
||||
global $chart;
|
||||
|
@ -571,13 +569,22 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
}
|
||||
|
||||
// Get module data
|
||||
$data = db_get_all_rows_filter ('tagente_datos',
|
||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||
"utimestamp > $datelimit",
|
||||
"utimestamp < $date",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'), 'AND', $search_in_history_db);
|
||||
|
||||
if ($fullscale) {
|
||||
$data = db_get_all_rows_filter ('tagente_datos',
|
||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||
"utimestamp > $datelimit",
|
||||
"utimestamp < $date",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'), 'AND', true);
|
||||
}
|
||||
else {
|
||||
$data = db_get_all_rows_filter ('tagente_datos',
|
||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||
"utimestamp > $datelimit",
|
||||
"utimestamp < $date",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'), 'AND', $search_in_history_db);
|
||||
}
|
||||
|
||||
// Get module warning_min and critical_min
|
||||
$warning_min = db_get_value('min_warning','tagente_modulo','id_agente_modulo',$agent_module_id);
|
||||
|
@ -618,7 +625,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
|
||||
$min_necessary = 2;
|
||||
}
|
||||
|
||||
|
||||
// Check available data
|
||||
if (count ($data) < $min_necessary) {
|
||||
if (!$graphic_type) {
|
||||
|
@ -661,6 +668,13 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
if (empty($unit)) {
|
||||
$unit = modules_get_unit($agent_module_id);
|
||||
}
|
||||
|
||||
if ($fullscale) {
|
||||
if (count($data) > $resolution) {
|
||||
$resolution = count($data); //Number of points of the graph
|
||||
$interval = (int) ($period / $resolution);
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate chart data
|
||||
grafico_modulo_sparse_data_chart ($chart, $chart_data_extra, $long_index,
|
||||
|
@ -668,10 +682,29 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
$projection, $avg_only, $uncompressed_module,
|
||||
$show_events, $show_alerts, $show_unknown, $baseline,
|
||||
$baseline_data, $events, $series_suffix, $start_unknown,
|
||||
$percentil);
|
||||
|
||||
|
||||
|
||||
$percentil, $fullscale);
|
||||
|
||||
if ($fullscale) {
|
||||
if (!$flash_chart) {
|
||||
$time_format = "Y M \nd H:i:s";
|
||||
}
|
||||
else {
|
||||
$time_format = "Y M d H:i:s";
|
||||
}
|
||||
|
||||
$new_chart = array();
|
||||
$new_long_index = array();
|
||||
foreach ($chart as $c_timestamp => $c_data) {
|
||||
$timestamp_short = date($time_format, $c_timestamp);
|
||||
$new_long_index[$timestamp_short] = date(
|
||||
html_entity_decode($time_format, ENT_QUOTES, "UTF-8"), $c_timestamp);
|
||||
$new_chart[$timestamp_short] = $c_data;
|
||||
}
|
||||
|
||||
$long_index = $new_long_index;
|
||||
$chart = $new_chart;
|
||||
}
|
||||
|
||||
// Return chart data and don't draw
|
||||
if ($return_data == 1) {
|
||||
return $chart;
|
||||
|
@ -742,8 +775,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
$color['min'.$series_suffix] = array(
|
||||
'border' => '#000000', 'color' => $config['graph_color1'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA);
|
||||
//Baseline was replaced by compare graph feature
|
||||
//$color['baseline'.$series_suffix] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
|
||||
|
||||
$color['unit'.$series_suffix] = array('border' => null, 'color' => '#0097BC', 'alpha' => 10);
|
||||
|
||||
if ($show_events) {
|
||||
|
@ -755,7 +787,17 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
$chart_extra_data['legend_alerts'] = $legend['alert'.$series_suffix_str];
|
||||
}
|
||||
|
||||
if ($dashboard || $vconsole) {
|
||||
if ($vconsole) {
|
||||
$legend['sum'.$series_suffix] =
|
||||
__('Last') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])) . ($unit ? ' ' . $unit : '') . ' ; '
|
||||
. __('Avg') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])) . ($unit ? ' ' . $unit : '');
|
||||
}
|
||||
else if ($dashboard && !$avg_only) {
|
||||
$legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['max']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['max']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['max']['min'], $config['graph_precision'])).' '.$unit;
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
$legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['min']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['min']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['min']['min'], $config['graph_precision'])).' '.$unit;
|
||||
}
|
||||
else if ($dashboard) {
|
||||
$legend['sum'.$series_suffix] =
|
||||
__('Last') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])) . ($unit ? ' ' . $unit : '') . ' ; '
|
||||
. __('Avg') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])) . ($unit ? ' ' . $unit : '');
|
||||
|
@ -768,12 +810,6 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
else {
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
}
|
||||
//Baseline was replaced by compare graph feature
|
||||
/*if ($baseline) {
|
||||
$legend['baseline'.$series_suffix] = __('Baseline');
|
||||
}*/
|
||||
//$legend['no_data'.$series_suffix] = __('No data').$series_suffix_str;
|
||||
//$chart_extra_data['legend_no_data'] = $legend['no_data'.$series_suffix_str];
|
||||
|
||||
if ($show_unknown) {
|
||||
$legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str;
|
||||
|
@ -796,7 +832,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
|||
$only_image = false, $homeurl = '', $ttl = 1, $projection = false,
|
||||
$adapt_key = '', $compare = false, $show_unknown = false,
|
||||
$menu = true, $backgroundColor = 'white', $percentil = null,
|
||||
$dashboard = false, $vconsole = false, $type_graph = 'area') {
|
||||
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false) {
|
||||
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
@ -826,7 +862,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
|||
$show_alerts, $avg_only, $date-$period, $unit, $baseline,
|
||||
$return_data, $show_title, $projection, $adapt_key,
|
||||
$compare, $series_suffix, $series_suffix_str,
|
||||
$show_unknown, $percentil, $dashboard, $vconsole,$type_graph);
|
||||
$show_unknown, $percentil, $dashboard, $vconsole,$type_graph,
|
||||
$fullscale);
|
||||
|
||||
switch ($compare) {
|
||||
case 'separated':
|
||||
|
@ -859,7 +896,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
|||
$show_alerts, $avg_only,
|
||||
$date, $unit, $baseline, $return_data, $show_title,
|
||||
$projection, $adapt_key, $compare, '', '', $show_unknown,
|
||||
$percentil, $dashboard, $vconsole,$type_graph);
|
||||
$percentil, $dashboard, $vconsole, $type_graph, $fullscale);
|
||||
|
||||
|
||||
if ($return_data) {
|
||||
|
@ -1035,7 +1072,8 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
$time_format_2 = 'H\h';
|
||||
}
|
||||
else {
|
||||
$time_format = "M Y";
|
||||
$time_format = "Y M d";
|
||||
$time_format_2 = 'H\h';
|
||||
}
|
||||
|
||||
// Set variables
|
||||
|
@ -1053,7 +1091,6 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
while ($in_range) {
|
||||
$timestamp_f = graph_get_formatted_date($j, $time_format, $time_format_2);
|
||||
|
||||
//$timestamp_f = date('d M Y H:i:s', $j);
|
||||
$before_projection[$timestamp_f] = 0;
|
||||
|
||||
if ($j > $date) {
|
||||
|
@ -3382,6 +3419,7 @@ function graph_custom_sql_graph ($id, $width, $height,
|
|||
global $config;
|
||||
|
||||
$report_content = db_get_row ('treport_content', 'id_rc', $id);
|
||||
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$id);
|
||||
if ($report_content["external_source"] != "") {
|
||||
$sql = io_safe_output ($report_content["external_source"]);
|
||||
}
|
||||
|
@ -3413,8 +3451,9 @@ function graph_custom_sql_graph ($id, $width, $height,
|
|||
break;
|
||||
}
|
||||
|
||||
$data_result = db_get_all_rows_sql ($sql,$historical_db);
|
||||
|
||||
|
||||
$data_result = db_get_all_rows_sql ($sql);
|
||||
|
||||
if (($config['metaconsole'] == 1) && defined('METACONSOLE'))
|
||||
enterprise_hook('metaconsole_restore_db');
|
||||
|
@ -3438,17 +3477,16 @@ function graph_custom_sql_graph ($id, $width, $height,
|
|||
switch ($type) {
|
||||
case 'sql_graph_vbar': // vertical bar
|
||||
case 'sql_graph_hbar': // horizontal bar
|
||||
$data[$label]['g'] = $value;
|
||||
$data[$label."_".$count]['g'] = $value;
|
||||
break;
|
||||
case 'sql_graph_pie': // Pie
|
||||
$data[$label] = $value;
|
||||
$data[$label."_".$count] = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$flash_charts = $config['flash_charts'];
|
||||
|
||||
|
||||
|
||||
if ($only_image) {
|
||||
$flash_charts = false;
|
||||
}
|
||||
|
@ -3588,7 +3626,8 @@ function fs_error_image ($width = 300, $height = 110) {
|
|||
|
||||
function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
||||
$unit_name, $show_alerts, $avg_only = 0,
|
||||
$date = 0, $series_suffix = '', $series_suffix_str = '', $show_unknown = false) {
|
||||
$date = 0, $series_suffix = '', $series_suffix_str = '', $show_unknown = false,
|
||||
$fullscale = false) {
|
||||
|
||||
global $config;
|
||||
global $chart;
|
||||
|
@ -3597,8 +3636,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
global $long_index;
|
||||
global $series_type;
|
||||
global $chart_extra_data;
|
||||
|
||||
|
||||
|
||||
$chart = array();
|
||||
$color = array();
|
||||
$legend = array();
|
||||
|
@ -3645,13 +3683,30 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
}
|
||||
}
|
||||
|
||||
// Get module data
|
||||
$data = db_get_all_rows_filter ('tagente_datos',
|
||||
array ('id_agente_modulo' => $agent_module_id,
|
||||
"utimestamp > $datelimit",
|
||||
"utimestamp < $date",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'), 'AND', $search_in_history_db);
|
||||
if ($fullscale) {
|
||||
// Get module data
|
||||
$data = db_get_all_rows_filter ('tagente_datos',
|
||||
array ('id_agente_modulo' => $agent_module_id,
|
||||
"utimestamp > $datelimit",
|
||||
"utimestamp < $date",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'), 'AND', true);
|
||||
|
||||
if (count($data) > $resolution) {
|
||||
$resolution = count($data); //Number of points of the graph
|
||||
$interval = (int) ($period / $resolution);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Get module data
|
||||
$data = db_get_all_rows_filter ('tagente_datos',
|
||||
array ('id_agente_modulo' => $agent_module_id,
|
||||
"utimestamp > $datelimit",
|
||||
"utimestamp < $date",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'), 'AND', $search_in_history_db);
|
||||
}
|
||||
|
||||
if ($data === false) {
|
||||
$data = array ();
|
||||
}
|
||||
|
@ -3721,6 +3776,10 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
$last_known = $previous_data;
|
||||
for ($i = 0; $i <= $resolution; $i++) {
|
||||
$timestamp = $datelimit + ($interval * $i);
|
||||
|
||||
if ($fullscale) {
|
||||
$timestamp = $data[$i]['utimestamp'];
|
||||
}
|
||||
|
||||
$zero = 0;
|
||||
$total = 0;
|
||||
|
@ -3801,12 +3860,9 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
}
|
||||
elseif ($period < SECONDS_1MONTH) {
|
||||
$time_format = 'M d H\h';
|
||||
}
|
||||
elseif ($period < SECONDS_6MONTHS) {
|
||||
$time_format = "M d H\h";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$time_format = "M Y";
|
||||
$time_format = 'M d H\h';
|
||||
}
|
||||
|
||||
$timestamp_short = date($time_format, $timestamp);
|
||||
|
@ -3836,13 +3892,6 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
$series_type['alert'.$series_suffix] = 'points';
|
||||
}
|
||||
|
||||
//The order filling the array is very important to get the same colors
|
||||
//in legends and graphs!!!
|
||||
//Boolean graph doesn't have max!!!
|
||||
/*if (!$avg_only) {
|
||||
$chart[$timestamp]['max'.$series_suffix] = 0;
|
||||
}*/
|
||||
|
||||
// Data and zeroes (draw a step)
|
||||
if ($zero == 1 && $count > 0) {
|
||||
|
||||
|
@ -3877,11 +3926,6 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
|
||||
$series_type['sum' . $series_suffix] = 'boolean';
|
||||
|
||||
//Boolean graph doesn't have min!!!
|
||||
/*if (!$avg_only) {
|
||||
$chart[$timestamp]['min'.$series_suffix] = 0;
|
||||
}*/
|
||||
|
||||
if (!empty($event_ids)) {
|
||||
$chart_extra_data[count($chart)-1]['events'] = implode(',',$event_ids);
|
||||
}
|
||||
|
@ -3931,7 +3975,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
$time_format = "M d H\h";
|
||||
}
|
||||
else {
|
||||
$time_format = "M Y";
|
||||
$time_format = 'M d H\h';
|
||||
}
|
||||
|
||||
// Flash chart
|
||||
|
@ -3948,17 +3992,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
$chart_extra_data['legend_alerts'] = $legend['alert'.$series_suffix];
|
||||
}
|
||||
|
||||
if (!$avg_only) {
|
||||
//Boolean graph doesn't have max!!!
|
||||
//$legend['max'.$series_suffix] = __('Max').$series_suffix_str .': '.__('Last').': '.$graph_stats['max']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['max']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['max']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['max']['min'].' '.$unit;
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
// Boolean graph doesn't have min!!!
|
||||
// $legend['min'.$series_suffix] = __('Min').$series_suffix_str .': '.__('Last').': '.number_format($graph_stats['min']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['min']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['min']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['min']['min'], $config['graph_precision']).' '.$unit;
|
||||
}
|
||||
else {
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
|
||||
}
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
|
||||
if ($show_unknown) {
|
||||
$legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str;
|
||||
|
@ -3990,13 +4024,12 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
array('border' => '#999999', 'color' => '#999999',
|
||||
'alpha' => CHART_DEFAULT_ALPHA);
|
||||
}
|
||||
//$color['baseline'.$series_suffix] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
|
||||
}
|
||||
|
||||
function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
||||
$width, $height , $title='', $unit_name, $show_alerts, $avg_only = 0, $pure=0,
|
||||
$date = 0, $only_image = false, $homeurl = '', $adapt_key = '', $compare = false,
|
||||
$show_unknown = false, $menu = true) {
|
||||
$show_unknown = false, $menu = true, $fullscale = false) {
|
||||
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
@ -4017,7 +4050,6 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||
else
|
||||
$unit = $unit_name;
|
||||
|
||||
|
||||
$series_suffix_str = '';
|
||||
if ($compare !== false) {
|
||||
$series_suffix = '2';
|
||||
|
@ -4025,7 +4057,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||
// Build the data of the previous period
|
||||
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
||||
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
|
||||
$series_suffix_str, $show_unknown);
|
||||
$series_suffix_str, $show_unknown, $fullscale);
|
||||
switch ($compare) {
|
||||
case 'separated':
|
||||
// Store the chart calculated
|
||||
|
@ -4051,7 +4083,28 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||
}
|
||||
|
||||
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
||||
$unit_name, $show_alerts, $avg_only, $date, '', '', $show_unknown);
|
||||
$unit_name, $show_alerts, $avg_only, $date, '', '', $show_unknown, $fullscale);
|
||||
|
||||
if ($fullscale) {
|
||||
if (!$flash_chart) {
|
||||
$time_format = "Y M \nd H:i:s";
|
||||
}
|
||||
else {
|
||||
$time_format = "Y M d H:i:s";
|
||||
}
|
||||
|
||||
$new_chart = array();
|
||||
$new_long_index = array();
|
||||
foreach ($chart as $c_timestamp => $c_data) {
|
||||
$timestamp_short = date($time_format, $c_timestamp);
|
||||
$new_long_index[$timestamp_short] = date(
|
||||
html_entity_decode($time_format, ENT_QUOTES, "UTF-8"), $c_timestamp);
|
||||
$new_chart[$timestamp_short] = $c_data;
|
||||
}
|
||||
|
||||
$long_index = $new_long_index;
|
||||
$chart = $new_chart;
|
||||
}
|
||||
|
||||
if ($compare === 'overlapped') {
|
||||
$i = 0;
|
||||
|
@ -4154,7 +4207,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit =
|
|||
$chart_time_format = "M d H\h";
|
||||
}
|
||||
else {
|
||||
$chart_time_format = "M Y";
|
||||
$chart_time_format = "Y M d H\h";
|
||||
}
|
||||
|
||||
// Calculate source indexes
|
||||
|
@ -4283,7 +4336,7 @@ function graph_netflow_total_area ($data, $period, $width, $height, $unit = '',
|
|||
$chart_time_format = "M d H\h";
|
||||
}
|
||||
else {
|
||||
$chart_time_format = "M Y";
|
||||
$chart_time_format = "Y M d H\h";
|
||||
}
|
||||
|
||||
// Calculate min, max and avg values
|
||||
|
@ -4582,7 +4635,7 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||
$time_format = "M d H\h";
|
||||
}
|
||||
else {
|
||||
$time_format = "M Y";
|
||||
$time_format = "Y M d H\h";
|
||||
}
|
||||
|
||||
$timestamp_short = date($time_format, $timestamp);
|
||||
|
@ -4760,7 +4813,7 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
|
|||
$time_format = "M d H\h";
|
||||
}
|
||||
else {
|
||||
$time_format = "M Y";
|
||||
$time_format = "Y M d H\h";
|
||||
}
|
||||
|
||||
$legend = array();
|
||||
|
@ -5603,4 +5656,4 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
|
|||
return d3_sunburst_graph ($graph_data, $width, $height, true);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
|
@ -2512,7 +2512,7 @@ function modules_get_agentmodule_mininterval_no_async($id_agent) {
|
|||
$sql = 'SELECT COUNT(tae.current_interval) AS num_interval, MIN(tae.current_interval) AS min_interval
|
||||
FROM tagente_estado tae
|
||||
INNER JOIN tagente_modulo tam ON tae.id_agente_modulo = tam.id_agente_modulo
|
||||
INNER JOIN ttipo_modulo ttm ON tam.id_tipo_modulo = ttm.id_tipo where ttm.nombre not like "async%" and tae.id_agente = '.$id_agent.' and tam.disabled = 0';
|
||||
INNER JOIN ttipo_modulo ttm ON tam.id_tipo_modulo = ttm.id_tipo where ttm.nombre not like "async%" and tae.id_agente = '.$id_agent.' and tam.disabled = 0 and tae.current_interval != 0';
|
||||
|
||||
return db_get_row_sql($sql);
|
||||
}
|
||||
|
|
|
@ -122,7 +122,16 @@ function networkmap_process_networkmap($id = 0) {
|
|||
null,
|
||||
$old_mode);
|
||||
|
||||
$filename_dot = sys_get_temp_dir() . "/networkmap_" . $filter;
|
||||
switch (PHP_OS) {
|
||||
case "WIN32":
|
||||
case "WINNT":
|
||||
case "Windows":
|
||||
$filename_dot = sys_get_temp_dir() . "\\networkmap_" . $filter;
|
||||
break;
|
||||
default:
|
||||
$filename_dot = sys_get_temp_dir() . "/networkmap_" . $filter;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($simple) {
|
||||
$filename_dot .= "_simple";
|
||||
|
@ -133,11 +142,21 @@ function networkmap_process_networkmap($id = 0) {
|
|||
$filename_dot .= "_" . $id . ".dot";
|
||||
|
||||
file_put_contents($filename_dot, $graph);
|
||||
|
||||
$filename_plain = sys_get_temp_dir() . "/plain.txt";
|
||||
|
||||
$cmd = "$filter -Tplain -o " . $filename_plain . " " .
|
||||
$filename_dot;
|
||||
|
||||
switch (PHP_OS) {
|
||||
case "WIN32":
|
||||
case "WINNT":
|
||||
case "Windows":
|
||||
$filename_plain = sys_get_temp_dir() . "\\plain.txt";
|
||||
$cmd = $config['graphviz_win'] . "$filter -Tplain -o " . $filename_plain . " " .
|
||||
$filename_dot;
|
||||
break;
|
||||
default:
|
||||
$filename_plain = sys_get_temp_dir() . "/plain.txt";
|
||||
$cmd = "$filter -Tplain -o " . $filename_plain . " " .
|
||||
$filename_dot;
|
||||
break;
|
||||
}
|
||||
|
||||
system ($cmd);
|
||||
|
||||
|
@ -764,7 +783,7 @@ function networkmap_write_js_array($id, $nodes_and_relations = array(), $map_das
|
|||
echo "var set_center_menu = '" . __('Set center') . "';\n";
|
||||
echo "var refresh_menu = '" . __('Refresh') . "';\n";
|
||||
echo "var refresh_holding_area_menu = '" . __('Refresh Holding area') . "';\n";
|
||||
echo "var abort_relationship_interface = '" . __('Abort the action of set interface relationship') . "';\n";
|
||||
echo "var abort_relationship_interface = '" . __('Abort the interface relationship') . "';\n";
|
||||
echo "var abort_relationship_menu = '" . __('Abort the action of set relationship') . "';\n";
|
||||
|
||||
echo "\n";
|
||||
|
|
|
@ -3941,7 +3941,9 @@ function reporting_sql($report, $content) {
|
|||
$return['header'] = $header;
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql($sql);
|
||||
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$content['id_rc']);
|
||||
|
||||
$result = db_get_all_rows_sql($sql,$historical_db);
|
||||
if ($result !== false) {
|
||||
|
||||
foreach ($result as $row) {
|
||||
|
@ -5471,9 +5473,8 @@ function reporting_availability_graph($report, $content, $pdf=false) {
|
|||
*
|
||||
*/
|
||||
function reporting_general($report, $content) {
|
||||
|
||||
global $config;
|
||||
|
||||
|
||||
$return = array();
|
||||
$return['type'] = 'general';
|
||||
$return['subtype'] = $content['group_by_agent'];
|
||||
|
@ -5501,6 +5502,7 @@ function reporting_general($report, $content) {
|
|||
$return["max"]["formated_value"] = null;
|
||||
$return["max"]["agent"] = null;
|
||||
$return["max"]["module"] = null;
|
||||
$return["show_in_same_row"] = $content['style']['show_in_same_row'];
|
||||
|
||||
if (empty($content['subitems'])) {
|
||||
$generals = db_get_all_rows_filter(
|
||||
|
@ -5517,7 +5519,8 @@ function reporting_general($report, $content) {
|
|||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($generals as $key => $row) {
|
||||
$index = 0;
|
||||
foreach ($generals as $row) {
|
||||
//Metaconsole connection
|
||||
$server_name = $row ['server_name'];
|
||||
if (($config ['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
|
||||
|
@ -5547,78 +5550,78 @@ function reporting_general($report, $content) {
|
|||
$row['id_agent_module']);
|
||||
|
||||
if ($content['period'] == 0) {
|
||||
$data_res[$key] =
|
||||
$data_res[$index] =
|
||||
modules_get_last_value($row['id_agent_module']);
|
||||
}
|
||||
else {
|
||||
if(is_numeric($type_mod)){
|
||||
switch ($row['operation']) {
|
||||
case 'sum':
|
||||
$data_res[$key] =
|
||||
$data_res[$index] =
|
||||
reporting_get_agentmodule_data_sum(
|
||||
$row['id_agent_module'], $content['period'], $report["datetime"]);
|
||||
break;
|
||||
case 'max':
|
||||
$data_res[$key] =
|
||||
$data_res[$index] =
|
||||
reporting_get_agentmodule_data_max(
|
||||
$row['id_agent_module'], $content['period']);
|
||||
break;
|
||||
case 'min':
|
||||
$data_res[$key] =
|
||||
$data_res[$index] =
|
||||
reporting_get_agentmodule_data_min(
|
||||
$row['id_agent_module'], $content['period']);
|
||||
break;
|
||||
case 'avg':
|
||||
default:
|
||||
$data_res[$key] =
|
||||
$data_res[$index] =
|
||||
reporting_get_agentmodule_data_average(
|
||||
$row['id_agent_module'], $content['period']);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$data_res[$key] = $type_mod;
|
||||
$data_res[$index] = $type_mod;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($content['group_by_agent']) {
|
||||
case REPORT_GENERAL_NOT_GROUP_BY_AGENT:
|
||||
$id_agent_module[$key] = $row['id_agent_module'];
|
||||
$agent_name[$key] = $ag_name;
|
||||
$module_name[$key] = $mod_name;
|
||||
$units[$key] = $unit;
|
||||
$operations[$key] = $row['operation'];
|
||||
$id_agent_module[$index] = $row['id_agent_module'];
|
||||
$agent_name[$index] = $ag_name;
|
||||
$module_name[$index] = $mod_name;
|
||||
$units[$index] = $unit;
|
||||
$operations[$index] = $row['operation'];
|
||||
break;
|
||||
case REPORT_GENERAL_GROUP_BY_AGENT:
|
||||
if ($data_res[$key] === false) {
|
||||
if ($data_res[$index] === false) {
|
||||
$return["data"][$ag_name][$mod_name] = null;
|
||||
}
|
||||
else {
|
||||
if (!is_numeric($data_res[$key])) {
|
||||
$return["data"][$ag_name][$mod_name] = $data_res[$key];
|
||||
if (!is_numeric($data_res[$index])) {
|
||||
$return["data"][$ag_name][$mod_name] = $data_res[$index];
|
||||
}
|
||||
else {
|
||||
$return["data"][$ag_name][$mod_name] =
|
||||
format_for_graph($data_res[$key], 2) . " " . $unit;
|
||||
format_for_graph($data_res[$index], 2) . " " . $unit;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Calculate the avg, min and max
|
||||
if (is_numeric($data_res[$key])) {
|
||||
if (is_numeric($data_res[$index])) {
|
||||
$change_min = false;
|
||||
if (is_null($return["min"]["value"])) {
|
||||
$change_min = true;
|
||||
}
|
||||
else {
|
||||
if ($return["min"]["value"] > $data_res[$key]) {
|
||||
if ($return["min"]["value"] > $data_res[$index]) {
|
||||
$change_min = true;
|
||||
}
|
||||
}
|
||||
if ($change_min) {
|
||||
$return["min"]["value"] = $data_res[$key];
|
||||
$return["min"]["value"] = $data_res[$index];
|
||||
$return["min"]["formated_value"] =
|
||||
format_for_graph($data_res[$key], 2) . " " . $unit;
|
||||
format_for_graph($data_res[$index], 2) . " " . $unit;
|
||||
$return["min"]["agent"] = $ag_name;
|
||||
$return["min"]["module"] = $mod_name;
|
||||
}
|
||||
|
@ -5628,30 +5631,31 @@ function reporting_general($report, $content) {
|
|||
$change_max = true;
|
||||
}
|
||||
else {
|
||||
if ($return["max"]["value"] < $data_res[$key]) {
|
||||
if ($return["max"]["value"] < $data_res[$index]) {
|
||||
$change_max = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($change_max) {
|
||||
$return["max"]["value"] = $data_res[$key];
|
||||
$return["max"]["value"] = $data_res[$index];
|
||||
$return["max"]["formated_value"] =
|
||||
format_for_graph($data_res[$key], 2) . " " . $unit;
|
||||
format_for_graph($data_res[$index], 2) . " " . $unit;
|
||||
$return["max"]["agent"] = $ag_name;
|
||||
$return["max"]["module"] = $mod_name;
|
||||
}
|
||||
|
||||
if ($i == 0) {
|
||||
$return["avg_value"] = $data_res[$key];
|
||||
$return["avg_value"] = $data_res[$index];
|
||||
}
|
||||
else {
|
||||
$return["avg_value"] =
|
||||
(($return["avg_value"] * $i) / ($i + 1))
|
||||
+
|
||||
($data_res[$key] / ($i + 1));
|
||||
($data_res[$index] / ($i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$index++;
|
||||
$i++;
|
||||
|
||||
//Restore dbconnection
|
||||
|
@ -5692,8 +5696,9 @@ function reporting_general($report, $content) {
|
|||
$data = array();
|
||||
$data['agent'] = $agent_name[$i];
|
||||
$data['module'] = $module_name[$i];
|
||||
|
||||
|
||||
$data['id_agent_module'] = $id_agent_module[$i];
|
||||
$data['id_agent'] = agents_get_agent_id_by_module_id($id_agent_module[$i]);
|
||||
|
||||
$data['operator'] = "";
|
||||
if ($content['period'] != 0) {
|
||||
switch ($operations[$i]) {
|
||||
|
|
|
@ -2578,50 +2578,88 @@ function get_agent_first_time ($agent_name) {
|
|||
}
|
||||
|
||||
function reporting_html_general(&$table, $item) {
|
||||
|
||||
if (!empty($item["data"])) {
|
||||
$data_in_same_row = $item['show_in_same_row'];
|
||||
switch ($item['subtype']) {
|
||||
case REPORT_GENERAL_NOT_GROUP_BY_AGENT:
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '99%';
|
||||
$table1->data = array ();
|
||||
$table1->head = array ();
|
||||
$table1->head[0] = __('Agent');
|
||||
$table1->head[1] = __('Module');
|
||||
if ($item['date']['period'] != 0) {
|
||||
$table1->head[2] = __('Operation');
|
||||
}
|
||||
$table1->head[3] = __('Value');
|
||||
$table1->style[0] = 'text-align: left';
|
||||
$table1->style[1] = 'text-align: left';
|
||||
$table1->style[2] = 'text-align: left';
|
||||
$table1->style[3] = 'text-align: left';
|
||||
|
||||
/* Begin - Order by agent */
|
||||
|
||||
foreach ($item['data'] as $key => $row) {
|
||||
$aux[$key] = $row['agent'];
|
||||
}
|
||||
|
||||
array_multisort($aux, SORT_ASC, $item['data']);
|
||||
|
||||
/* End - Order by agent */
|
||||
|
||||
foreach ($item['data'] as $row) {
|
||||
if (!$data_in_same_row) {
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '99%';
|
||||
$table1->data = array ();
|
||||
$table1->head = array ();
|
||||
$table1->head[0] = __('Agent');
|
||||
$table1->head[1] = __('Module');
|
||||
if ($item['date']['period'] != 0) {
|
||||
$table1->data[] = array(
|
||||
$row['agent'],
|
||||
$row['module'],
|
||||
$row['operator'],
|
||||
$row['formated_value']);
|
||||
$table1->head[2] = __('Operation');
|
||||
}
|
||||
else {
|
||||
$table1->data[] = array(
|
||||
$row['agent'],
|
||||
$row['module'],
|
||||
$row['formated_value']);
|
||||
$table1->head[3] = __('Value');
|
||||
$table1->style[0] = 'text-align: left';
|
||||
$table1->style[1] = 'text-align: left';
|
||||
$table1->style[2] = 'text-align: left';
|
||||
$table1->style[3] = 'text-align: left';
|
||||
|
||||
/* Begin - Order by agent */
|
||||
|
||||
foreach ($item['data'] as $key => $row) {
|
||||
$aux[$key] = $row['agent'];
|
||||
}
|
||||
|
||||
array_multisort($aux, SORT_ASC, $item['data']);
|
||||
|
||||
/* End - Order by agent */
|
||||
|
||||
foreach ($item['data'] as $row) {
|
||||
if ($item['date']['period'] != 0) {
|
||||
$table1->data[] = array(
|
||||
$row['agent'],
|
||||
$row['module'],
|
||||
$row['operator'],
|
||||
$row['formated_value']);
|
||||
}
|
||||
else {
|
||||
$table1->data[] = array(
|
||||
$row['agent'],
|
||||
$row['module'],
|
||||
$row['formated_value']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$order_data = array();
|
||||
foreach ($item['data'] as $row) {
|
||||
$order_data[$row['id_agent']][$row['id_agent_module']][$row['operator']] = $row['formated_value'];
|
||||
}
|
||||
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '99%';
|
||||
$table1->data = array ();
|
||||
$table1->head = array ();
|
||||
$table1->head[0] = __('Agent');
|
||||
$table1->head[1] = __('Module');
|
||||
$table1->head[2] = __('Avg');
|
||||
$table1->head[3] = __('Max');
|
||||
$table1->head[4] = __('Min');
|
||||
$table1->head[5] = __('Sum');
|
||||
$table1->style[0] = 'text-align: center';
|
||||
$table1->style[1] = 'text-align: center';
|
||||
$table1->style[2] = 'text-align: center';
|
||||
$table1->style[3] = 'text-align: center';
|
||||
$table1->style[4] = 'text-align: center';
|
||||
$table1->style[4] = 'text-align: center';
|
||||
|
||||
foreach ($order_data as $id_agent => $row) {
|
||||
foreach ($row as $id_module => $row2) {
|
||||
$table1->data[] = array(
|
||||
agents_get_alias($id_agent),
|
||||
modules_get_agentmodule_name($id_module),
|
||||
$row2['Rate'],
|
||||
$row2['Maximum'],
|
||||
$row2['Minimum'],
|
||||
$row2['Summatory']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case REPORT_GENERAL_GROUP_BY_AGENT:
|
||||
$list_modules = array();
|
||||
|
@ -2639,9 +2677,9 @@ function reporting_html_general(&$table, $item) {
|
|||
$row = array();
|
||||
|
||||
$row['agent'] = $agent;
|
||||
$table1->style['agent'] = 'text-align: left;';
|
||||
$table1->style['agent'] = 'text-align: center;';
|
||||
foreach ($list_modules as $name) {
|
||||
$table1->style[$name] = 'text-align: right;';
|
||||
$table1->style[$name] = 'text-align: center;';
|
||||
if (isset($modules[$name])) {
|
||||
$row[$name] = $modules[$name];
|
||||
}
|
||||
|
@ -3870,4 +3908,4 @@ function reporting_html_planned_downtimes_table ($planned_downtimes) {
|
|||
return $downtimes_table;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
|
@ -898,47 +898,52 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
if ($width == 0 || $height == 0) {
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], 180, 300,
|
||||
$layoutData['id_custom_graph'], 180, 480,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true).'</div>';
|
||||
}
|
||||
elseif ($layoutData['label_position']=='right') {
|
||||
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], 180, 300,
|
||||
$layoutData['id_custom_graph'], 180, 480,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true).'</div>';
|
||||
}
|
||||
else {
|
||||
$img = custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], 180, 300,
|
||||
$layoutData['id_custom_graph'], 180, 480,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], $height, $width,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true).'</div>';
|
||||
}
|
||||
elseif($layoutData['label_position']=='right') {
|
||||
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], $height, $width,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true).'</div>';
|
||||
if ($width < 480){
|
||||
$img = '<div class="error">'._("Could not draw pie with labels contained inside canvas. Resize widget to 500px width minimum").'</div>';
|
||||
}
|
||||
else {
|
||||
$img = custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], $height, $width,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true);
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div style="float:right;height:'.$himg.'px;">'.custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], $height, $width,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true).'</div>';
|
||||
}
|
||||
elseif($layoutData['label_position']=='right') {
|
||||
$img = '<div style="float:left;height:'.$himg.'px;">'.custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], $height, $width,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true).'</div>';
|
||||
}
|
||||
else {
|
||||
$img = custom_graphs_print(
|
||||
$layoutData['id_custom_graph'], $height, $width,
|
||||
$period, null, true, 0, $only_image, $layoutData['image'],
|
||||
array(), '', array(), array(), true,
|
||||
false, false, true, 1, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ Besides the defined module macros, the following macros are available:
|
|||
<li>_modulegroup_: Module’s group name.</li>
|
||||
<li>_moduledescription_: Description of the module that triggered the alert.</li>
|
||||
<li>_modulestatus_: Module status.</li>
|
||||
<li>_moduledata_X_: Last data of module X (module name, cannot have white spaces).</li>
|
||||
<li>_alert_name_: Alert name.</li>
|
||||
<li>_alert_priority_: Alert’s numeric priority.</li>
|
||||
<li>_alert_text_severity_: Priority level, in text, for the alert (Maintenance, Informational, Normal Minor, Major, Critical).</li>
|
||||
|
|
|
@ -39,6 +39,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
|
|||
<li>_modulegroup_: Nombre del grupo del módulo.</li>
|
||||
<li>_moduledescription_: Descripcion del modulo.</li>
|
||||
<li>_modulestatus_: Estado del módulo.</li>
|
||||
<li>_moduledata_X_: Último dato del módulo X (nombre del módulo, no puede tener espacios).</li>
|
||||
<li>_alert_name_: Nombre de la alerta.</li>
|
||||
<li>_alert_priority_: Prioridad numérica de la alerta.</li>
|
||||
<li>_alert_text_severity_: Prioridad en texto de la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
|
||||
|
|
|
@ -175,7 +175,9 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
|||
//val() because the var is same <option val="NNN"></option>
|
||||
idAgents.push($(val).val());
|
||||
});
|
||||
|
||||
|
||||
var tags_to_search = $('#tags1').val();
|
||||
|
||||
//Hack to find only enabled modules
|
||||
//Pass a flag as global var
|
||||
find_modules = 'all';
|
||||
|
@ -226,6 +228,7 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
|||
"page": "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json_for_multiple_agents": 1,
|
||||
"id_agent[]": idAgents,
|
||||
"tags[]": tags_to_search,
|
||||
"all": find_modules,
|
||||
"module_types_excluded[]": module_types_excluded,
|
||||
"name": module_name,
|
||||
|
@ -401,8 +404,6 @@ function alert_templates_changed_by_multiple_agents_with_alerts (event, id_agent
|
|||
templates.push($(val).val());
|
||||
});
|
||||
|
||||
console.log(templates);
|
||||
|
||||
$('#module').attr ('disabled', 1);
|
||||
$('#module').empty ();
|
||||
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
|
||||
|
@ -1092,7 +1093,7 @@ function openURLTagWindow(url) {
|
|||
window.open(url, '','width=300, height=300, toolbar=no, location=no, directories=no, status=no, menubar=no');
|
||||
}
|
||||
|
||||
function removeTinyMCE(elementID) {console.log(elementID);
|
||||
function removeTinyMCE(elementID) {
|
||||
if (elementID.length > 0 && !isEmptyObject(tinyMCE))
|
||||
tinyMCE.EditorManager.execCommand('mceRemoveControl', true, elementID);
|
||||
}
|
||||
|
@ -1183,3 +1184,13 @@ var autoHideElement = function (element, hideTime) {
|
|||
// Start hide
|
||||
startHideTimeout(hideTime);
|
||||
}
|
||||
|
||||
function htmlEncode(value){
|
||||
// Create a in-memory div, set its inner text (which jQuery automatically encodes)
|
||||
// Then grab the encoded contents back out. The div never exists on the page.
|
||||
return $('<div/>').text(value).html();
|
||||
}
|
||||
|
||||
function htmlDecode(value){
|
||||
return $('<div/>').html(value).text();
|
||||
}
|
|
@ -46,6 +46,7 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
|
|||
modal: true,
|
||||
close: function() {
|
||||
$("#refrcounter").countdown("resume");
|
||||
$('div.vc-countdown').countdown('resume');
|
||||
},
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
|
@ -55,8 +56,9 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
|
|||
height: 530
|
||||
})
|
||||
.show ();
|
||||
|
||||
$("#refrcounter").countdown("pause");
|
||||
|
||||
$("#refrcounter").countdown('pause');
|
||||
$('div.vc-countdown').countdown('pause');
|
||||
|
||||
switch (result) {
|
||||
case 'comment_ok':
|
||||
|
|
|
@ -1237,7 +1237,8 @@ function install_free_package_prev_step(package, version, homeurl) {
|
|||
}
|
||||
},
|
||||
{
|
||||
"Cancel": function () {
|
||||
text:cancel_button,
|
||||
click: function () {
|
||||
$(this).dialog("close");
|
||||
|
||||
$("<div id='cancel_mr' class='dialog ui-dialog-content' title='" + mr_available + "'></div>").dialog ({
|
||||
|
|
|
@ -3555,13 +3555,14 @@ div.simple_value > a > span.text p
|
|||
.modalheaderh1{
|
||||
text-align:center;
|
||||
width:100%;
|
||||
height:37px;
|
||||
height:26px;
|
||||
left:0px;
|
||||
padding-top:10px;
|
||||
background-color:#82b92e;
|
||||
color:white;
|
||||
position:relative;
|
||||
font-family:Nunito;
|
||||
font-size:13pt;
|
||||
font-size:11pt;
|
||||
}
|
||||
.modalclosex{
|
||||
cursor:pointer;
|
||||
|
@ -4150,4 +4151,9 @@ div#footer_help{
|
|||
/*center ui dialog center*/
|
||||
.ui-dialog-titlebar .ui-icon-closethick {
|
||||
margin-top: -5px !important;
|
||||
}
|
||||
|
||||
/*view-agents lastest events for this agent*/
|
||||
#div_all_events_24h{
|
||||
padding: 4px;
|
||||
}
|
|
@ -27,14 +27,23 @@ if ($develop_bypass != 1) {
|
|||
// If no config file, automatically try to install
|
||||
if (! file_exists ("include/config.php")) {
|
||||
if (! file_exists ("install.php")) {
|
||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||
$flag_url =0;
|
||||
foreach ($url as $key => $value) {
|
||||
if (strpos($value, 'index.php') !== false || $flag_url) {
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
else if(strpos($value, 'enterprise') !== false || $flag_url){
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
}
|
||||
$config["homeurl"] = rtrim(join("/", $url),"/");
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
$login_screen = 'error_noconfig';
|
||||
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
||||
$config['homedir'] = $ownDir;
|
||||
$config['homeurl'] = $_SERVER['REQUEST_URI'];
|
||||
$config['homeurl_static'] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
|
||||
|
||||
require('general/error_screen.php');
|
||||
exit;
|
||||
}
|
||||
|
@ -67,11 +76,22 @@ if ($develop_bypass != 1) {
|
|||
if ((substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0600") &&
|
||||
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0660") &&
|
||||
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) {
|
||||
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
||||
$url = explode('/', $_SERVER['REQUEST_URI']);
|
||||
$flag_url =0;
|
||||
foreach ($url as $key => $value) {
|
||||
if (strpos($value, 'index.php') !== false || $flag_url) {
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
else if(strpos($value, 'enterprise') !== false || $flag_url){
|
||||
$flag_url=1;
|
||||
unset($url[$key]);
|
||||
}
|
||||
}
|
||||
$config["homeurl"] = rtrim(join("/", $url),"/");
|
||||
$config["homeurl_static"] = $config["homeurl"];
|
||||
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
|
||||
$config['homedir'] = $ownDir;
|
||||
$config['homeurl'] = "/" . $url[1];
|
||||
$config['homeurl_static'] = "/" . $url[1];
|
||||
$login_screen = 'error_perms';
|
||||
require('general/error_screen.php');
|
||||
exit;
|
||||
|
@ -1093,11 +1113,11 @@ require('include/php_to_js_values.php');
|
|||
function first_time_identification () {
|
||||
run_identification_wizard (-1, -1, 1);
|
||||
}
|
||||
|
||||
var times_fired_register_wizard = 0;
|
||||
|
||||
function run_identification_wizard (register, newsletter , return_button) {
|
||||
|
||||
if (times_fired_register_wizard) {
|
||||
|
||||
$(".ui-dialog-titlebar-close").show();
|
||||
|
||||
//Reset some values
|
||||
|
@ -1127,10 +1147,9 @@ require('include/php_to_js_values.php');
|
|||
$("#login_accept_register").dialog('open');
|
||||
}
|
||||
else {
|
||||
|
||||
$(".ui-dialog-titlebar-close").show();
|
||||
$("#container").append('<div class="id_wizard"></div>');
|
||||
jQuery.get ("ajax.php",
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_identification_wizard",
|
||||
"not_return": 1,
|
||||
"force_register": register,
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
<body>
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.704';
|
||||
$build = '170531';
|
||||
$version = '7.0NG.705';
|
||||
$build = '170620';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -367,7 +367,8 @@ if ($search != "") {
|
|||
if($id != ''){
|
||||
$aux = $id[0]['id_agent'];
|
||||
$search_sql = " AND ( nombre " . $order_collation . "
|
||||
LIKE '%$search%' OR tagente.id_agente = $aux";
|
||||
COLLATE utf8_general_ci LIKE '%$search%' OR alias ".$order_collation." COLLATE utf8_general_ci LIKE '%$search%'
|
||||
OR tagente.id_agente = $aux";
|
||||
if(count($id)>=2){
|
||||
for ($i = 1; $i < count($id); $i++){
|
||||
$aux = $id[$i]['id_agent'];
|
||||
|
@ -377,7 +378,7 @@ if ($search != "") {
|
|||
$search_sql .= ")";
|
||||
}else{
|
||||
$search_sql = " AND ( nombre " . $order_collation . "
|
||||
LIKE '%$search%' OR alias ".$order_collation." LIKE '%$search%') ";
|
||||
COLLATE utf8_general_ci LIKE '%$search%' OR alias ".$order_collation." COLLATE utf8_general_ci LIKE '%$search%') ";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,9 +429,8 @@ if ($strict_user) {
|
|||
|
||||
$total_agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $count_filter, $fields, false, $strict_user, true);
|
||||
$total_agents = count($total_agents);
|
||||
|
||||
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
$total_agents = agents_get_agents(array (
|
||||
|
|
|
@ -75,9 +75,35 @@ $modules_others = agents_get_modules(
|
|||
'<>21', // != async_proc
|
||||
'<>31') // != web_proc
|
||||
));
|
||||
|
||||
if (empty($modules_others))
|
||||
$modules_others = array();
|
||||
|
||||
$modules_boolean = agents_get_modules(
|
||||
$id_agente, false, array(
|
||||
'id_tipo_modulo' => array(
|
||||
'<>1',
|
||||
'<>3',
|
||||
'<>4',
|
||||
'<>5',
|
||||
'<>7',
|
||||
'<>8',
|
||||
'<>10',
|
||||
'<>11',
|
||||
'<>15',
|
||||
'<>16',
|
||||
'<>17',
|
||||
'<>22',
|
||||
'<>23',
|
||||
'<>24',
|
||||
'<>30',
|
||||
'<>32',
|
||||
'<>33',
|
||||
'<>100')
|
||||
));
|
||||
if (empty($modules_boolean))
|
||||
$modules_boolean = array();
|
||||
|
||||
//Cleaned the duplicate $modules and other things
|
||||
$modules_others = array_diff_key($modules_others,
|
||||
$modules_networkmap_no_proc);
|
||||
|
@ -91,10 +117,15 @@ foreach ($modules_networkmap_no_proc as $i => $m) {
|
|||
'optgroup' => __('Modules network no proc'),
|
||||
'name' => $m);
|
||||
}
|
||||
foreach ($modules_boolean as $i => $m) {
|
||||
$modules_boolean[$i] = array(
|
||||
'optgroup' => __('Modules boolean'),
|
||||
'name' => $m);
|
||||
}
|
||||
|
||||
|
||||
$list_modules = $modules_networkmap_no_proc +
|
||||
$modules_others;
|
||||
$modules_others + $modules_boolean;
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
if (empty($modules)) {
|
||||
|
|
|
@ -181,26 +181,32 @@ if (!empty($result_groups)) {
|
|||
$groups_id = $data["_id_"];
|
||||
|
||||
// Calculate entire row color
|
||||
if ($data["_monitors_alerts_fired_"] > 0) {
|
||||
$color_class = 'group_view_alrm';
|
||||
$status_image = ui_print_status_image ('agent_alertsfired_ball.png', "", true);
|
||||
}
|
||||
elseif ($data["_monitors_critical_"] > 0) {
|
||||
$color_class = 'group_view_crit';
|
||||
$status_image = ui_print_status_image ('agent_critical_ball.png', "", true);
|
||||
}
|
||||
elseif ($data["_monitors_warning_"] > 0) {
|
||||
$color_class = 'group_view_warn';
|
||||
$status_image = ui_print_status_image ('agent_warning_ball.png', "", true);
|
||||
}
|
||||
elseif ($data["_monitors_ok_"] > 0) {
|
||||
|
||||
$color_class = 'group_view_ok';
|
||||
$status_image = ui_print_status_image ('agent_ok_ball.png', "", true);
|
||||
}
|
||||
elseif (($data["_monitors_unknown_"] > 0) || ($data["_agents_unknown_"] > 0)) {
|
||||
$color_class = 'group_view_unk';
|
||||
$status_image = ui_print_status_image ('agent_no_monitors_ball.png', "", true);
|
||||
if ($groups_id != 0) {
|
||||
if ($data["_monitors_alerts_fired_"] > 0) {
|
||||
$color_class = 'group_view_alrm';
|
||||
$status_image = ui_print_status_image ('agent_alertsfired_ball.png', "", true);
|
||||
}
|
||||
elseif ($data["_monitors_critical_"] > 0) {
|
||||
$color_class = 'group_view_crit';
|
||||
$status_image = ui_print_status_image ('agent_critical_ball.png', "", true);
|
||||
}
|
||||
elseif ($data["_monitors_warning_"] > 0) {
|
||||
$color_class = 'group_view_warn';
|
||||
$status_image = ui_print_status_image ('agent_warning_ball.png', "", true);
|
||||
}
|
||||
elseif (($data["_monitors_unknown_"] > 0) || ($data["_agents_unknown_"] > 0)) {
|
||||
$color_class = 'group_view_unk';
|
||||
$status_image = ui_print_status_image ('agent_no_monitors_ball.png', "", true);
|
||||
}
|
||||
elseif ($data["_monitors_ok_"] > 0) {
|
||||
|
||||
$color_class = 'group_view_ok';
|
||||
$status_image = ui_print_status_image ('agent_ok_ball.png', "", true);
|
||||
}
|
||||
else {
|
||||
$color_class = '';
|
||||
$status_image = ui_print_status_image ('agent_no_data_ball.png', "", true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$color_class = '';
|
||||
|
|
|
@ -167,6 +167,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
$time_compare_separated = get_parameter ("time_compare_separated", 0);
|
||||
$time_compare_overlapped = get_parameter ("time_compare_overlapped", 0);
|
||||
$unknown_graph = get_parameter_checkbox ("unknown_graph", 1);
|
||||
$fullscale = get_parameter ("fullscale", 0);
|
||||
|
||||
// To avoid the horizontal overflow
|
||||
$width -= 20;
|
||||
|
@ -211,7 +212,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
$width, $height, $label_graph, $unit, $draw_alerts,
|
||||
$avg_only, false, $date, false, $urlImage,
|
||||
'adapter_' . $graph_type, $time_compare,
|
||||
$unknown_graph);
|
||||
$unknown_graph, true, $fullscale);
|
||||
echo '<br>';
|
||||
if ($show_events_graph)
|
||||
echo graphic_module_events($id, $width, $height,
|
||||
|
@ -226,7 +227,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
'adapter_' . $graph_type, $time_compare,
|
||||
$unknown_graph, true, 'white',
|
||||
(($show_percentil)? $config['percentil'] : null),
|
||||
false, false, $config['type_module_charts']);
|
||||
false, false, $config['type_module_charts'], $fullscale);
|
||||
echo '<br>';
|
||||
if ($show_events_graph)
|
||||
echo graphic_module_events($id, $width, $height,
|
||||
|
@ -398,6 +399,12 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
$table->rowclass[] = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Show full scale graph (TIP)');
|
||||
$data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$form_table = html_print_table($table, true);
|
||||
|
||||
|
|
|
@ -35,11 +35,15 @@ ui_toggle(
|
|||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
events_table(0);
|
||||
});
|
||||
|
||||
function events_table(all_events_24h){
|
||||
var parameters = {};
|
||||
|
||||
parameters["table_events"] = 1;
|
||||
parameters["id_agente"] = <?php echo $id_agente; ?>;
|
||||
parameters["page"] = "include/ajax/events";
|
||||
parameters["all_events_24h"] = all_events_24h;
|
||||
|
||||
jQuery.ajax ({
|
||||
data: parameters,
|
||||
|
@ -49,7 +53,17 @@ ui_toggle(
|
|||
success: function (data) {
|
||||
$("#event_list").empty();
|
||||
$("#event_list").html(data);
|
||||
$('#checkbox-all_events_24h').on('change',function(){
|
||||
if( $('#checkbox-all_events_24h').is(":checked") ){
|
||||
$('#checkbox-all_events_24h').val(1);
|
||||
}
|
||||
else{
|
||||
$('#checkbox-all_events_24h').val(0);
|
||||
}
|
||||
all_events_24h = $('#checkbox-all_events_24h').val();
|
||||
events_table(all_events_24h);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -45,7 +45,7 @@ else {
|
|||
ui_meta_print_header(__('Monitor view'));
|
||||
}
|
||||
|
||||
$ag_freestring = get_parameter ('ag_freestring');
|
||||
$ag_freestring = (string)get_parameter ('ag_freestring');
|
||||
$moduletype = (string) get_parameter ('moduletype');
|
||||
$datatype = (string) get_parameter ('datatype');
|
||||
$ag_modulename = (string) get_parameter ('ag_modulename');
|
||||
|
@ -160,14 +160,12 @@ if ($moduletype != '') {
|
|||
$sql_conditions .= sprintf (' AND tagente_modulo.id_modulo =' .$moduletype);
|
||||
}
|
||||
|
||||
|
||||
// Freestring selector
|
||||
if ($ag_freestring != '') {
|
||||
$sql_conditions .= sprintf (' AND (tagente.nombre LIKE \'%%%s%%\'
|
||||
OR tagente.alias LIKE \'%%%s%%\'
|
||||
OR tagente_modulo.nombre LIKE \'%%%s%%\'
|
||||
OR tagente_modulo.descripcion LIKE \'%%%s%%\')',
|
||||
$ag_freestring, $ag_freestring, $ag_freestring);
|
||||
$sql_conditions .= ' AND (tagente.nombre COLLATE utf8_general_ci LIKE \'%%' . $ag_freestring . '%%\'
|
||||
OR tagente.alias COLLATE utf8_general_ci LIKE \'%%' . $ag_freestring . '%%\'
|
||||
OR tagente_modulo.nombre COLLATE utf8_general_ci LIKE \'%%' . $ag_freestring . '%%\'
|
||||
OR tagente_modulo.descripcion COLLATE utf8_general_ci LIKE \'%%' . $ag_freestring . '%%\')';
|
||||
}
|
||||
|
||||
// Status selector
|
||||
|
|
|
@ -301,6 +301,7 @@ if (is_ajax ()) {
|
|||
|
||||
if ($get_agent_modules_json_for_multiple_agents) {
|
||||
$idAgents = get_parameter('id_agent');
|
||||
$tags = get_parameter('tags', null);
|
||||
$module_types_excluded = get_parameter('module_types_excluded', array());
|
||||
$module_name = (string) get_parameter('name');
|
||||
$selection_mode = get_parameter('selection_mode', 'common');
|
||||
|
@ -491,7 +492,7 @@ if (is_ajax ()) {
|
|||
}
|
||||
else {
|
||||
if(implode(',', $idAgents) < 0) {
|
||||
$sql = 'SELECT DISTINCT(nombre) FROM tagente_modulo
|
||||
$sql = 'SELECT DISTINCT nombre, id_agente_modulo FROM tagente_modulo
|
||||
WHERE nombre IN (
|
||||
SELECT nombre
|
||||
FROM tagente_modulo
|
||||
|
@ -499,7 +500,7 @@ if (is_ajax ()) {
|
|||
HAVING count(nombre) = (SELECT count(nombre) FROM tagente_modulo))';
|
||||
}
|
||||
else {
|
||||
$sql = 'SELECT DISTINCT(nombre)
|
||||
$sql = 'SELECT DISTINCT nombre, id_agente_modulo
|
||||
FROM tagente_modulo t1
|
||||
WHERE ' . $filter . '
|
||||
AND t1.delete_pending = 0
|
||||
|
@ -521,6 +522,31 @@ if (is_ajax ()) {
|
|||
|
||||
$nameModules = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($tags != null) {
|
||||
if ((count($tags) >= 1) && ($tags[0] != "") && ($tags[0] != -1)) {
|
||||
$implode_tags = implode(",", $tags);
|
||||
$tag_modules = db_get_all_rows_sql("SELECT DISTINCT id_agente_modulo FROM ttag_module WHERE id_tag IN (" . $implode_tags . ")");
|
||||
if ($tag_modules) {
|
||||
$final_modules = array();
|
||||
foreach ($nameModules as $key => $module) {
|
||||
$in_array = false;
|
||||
foreach ($tag_modules as $t_module) {
|
||||
if ($module['id_agente_modulo'] == $t_module['id_agente_modulo']) {
|
||||
$in_array = true;
|
||||
}
|
||||
}
|
||||
if ($in_array) {
|
||||
$final_modules[] = $module;
|
||||
}
|
||||
}
|
||||
$nameModules = $final_modules;
|
||||
}
|
||||
else {
|
||||
$nameModules = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($nameModules == false) {
|
||||
$nameModules = array();
|
||||
}
|
||||
|
@ -549,7 +575,9 @@ if (is_ajax ()) {
|
|||
// Use 0 as not received
|
||||
$id_tipo_modulo = (int) get_parameter ('id_tipo_modulo', 0);
|
||||
$status_modulo = (int) get_parameter ('status_module', -1);
|
||||
|
||||
|
||||
$tags = (array) get_parameter ('tags', array());
|
||||
|
||||
// Filter
|
||||
$filter = array();
|
||||
if ($disabled !== -1)
|
||||
|
@ -629,7 +657,7 @@ if (is_ajax ()) {
|
|||
agents_get_group_agents(
|
||||
array_keys (users_get_groups ()), $search, "none"));
|
||||
|
||||
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed);
|
||||
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, false, $tags);
|
||||
}
|
||||
// Restore db connection
|
||||
metaconsole_restore_db();
|
||||
|
@ -642,20 +670,39 @@ if (is_ajax ()) {
|
|||
agents_get_group_agents(
|
||||
array_keys(users_get_groups ()), $search, "none"));
|
||||
|
||||
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed);
|
||||
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, false, $tags);
|
||||
}
|
||||
|
||||
if (empty($agent_modules))
|
||||
$agent_modules = array();
|
||||
|
||||
if (!empty($tags)) {
|
||||
$implode_tags = implode(",", $tags);
|
||||
$tag_modules = db_get_all_rows_sql("SELECT DISTINCT id_agente_modulo FROM ttag_module WHERE id_tag IN (" . $implode_tags . ")");
|
||||
if ($tag_modules) {
|
||||
$final_modules = array();
|
||||
foreach ($agent_modules as $key => $module) {
|
||||
$in_array = false;
|
||||
foreach ($tag_modules as $t_module) {
|
||||
if ($module['id_agente_modulo'] == $t_module['id_agente_modulo']) {
|
||||
$in_array = true;
|
||||
}
|
||||
}
|
||||
if ($in_array) {
|
||||
$final_modules[] = $module;
|
||||
}
|
||||
}
|
||||
$agent_modules = $final_modules;
|
||||
}
|
||||
else {
|
||||
$agent_modules = array();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($agent_modules as $key => $module) {
|
||||
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
|
||||
}
|
||||
|
||||
|
||||
//Hack to translate text "any" in PHP to javascript
|
||||
//$agent_modules['any_text'] = __('Any');
|
||||
|
||||
echo json_encode ($agent_modules);
|
||||
|
||||
return;
|
||||
|
|
|
@ -76,9 +76,33 @@ switch ($status) {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
$events_wi_cdata = db_get_all_rows_sql('SELECT id_evento,custom_data from tevento WHERE custom_data != ""');
|
||||
$count_events = 0;
|
||||
$events_wi_cdata_id = 'OR id_evento IN (';
|
||||
foreach ($events_wi_cdata as $key => $value) {
|
||||
if(strpos(strtolower(base64_decode($value['custom_data'])),strtolower($search)) != false){
|
||||
$events_wi_cdata_id .= $value['id_evento'];
|
||||
$count_events++;
|
||||
}
|
||||
if ($value !== end($events_wi_cdata) && $count_events > 0) {
|
||||
$events_wi_cdata_id .= ',';
|
||||
$events_wi_cdata_id = str_replace(',,', ',', $events_wi_cdata_id);
|
||||
}
|
||||
}
|
||||
|
||||
$events_wi_cdata_id .= ')';
|
||||
|
||||
$events_wi_cdata_id = str_replace(',)', ')', $events_wi_cdata_id);
|
||||
|
||||
if($count_events == 0){
|
||||
$events_wi_cdata_id = '';
|
||||
}
|
||||
|
||||
|
||||
if ($search != "") {
|
||||
$filter_resume['free_search'] = $search;
|
||||
$sql_post .= " AND (evento LIKE '%". io_safe_input($search) . "%' OR id_evento LIKE '%$search%')";
|
||||
$sql_post .= " AND (evento LIKE '%". io_safe_input($search) . "%' OR id_evento LIKE '%$search%' ".$events_wi_cdata_id.")";
|
||||
}
|
||||
|
||||
if ($event_type != "") {
|
||||
|
|
|
@ -160,18 +160,46 @@ if (is_ajax ()) {
|
|||
if ($resultAlert) {
|
||||
$return = array('fired' => $resultAlert,
|
||||
'sound' => $config['sound_alert']);
|
||||
$event = events_get_event($resultAlert);
|
||||
|
||||
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||
$agent_name = agents_get_alias($event['id_agente']);
|
||||
|
||||
$return['message'] = $agent_name . " - " . __('Alert fired in module ') . io_safe_output($module_name) .
|
||||
" - " . $event['timestamp'];
|
||||
}
|
||||
else if ($resultCritical) {
|
||||
$return = array('fired' => $resultCritical,
|
||||
'sound' => $config['sound_critical']);
|
||||
$event = events_get_event($resultCritical);
|
||||
|
||||
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||
$agent_name = agents_get_alias($event['id_agente']);
|
||||
|
||||
$return['message'] = $agent_name . " - " . __('Module ') . io_safe_output($module_name) . __(' is going to critical') .
|
||||
" - " . $event['timestamp'];
|
||||
}
|
||||
else if ($resultWarning) {
|
||||
$return = array('fired' => $resultWarning,
|
||||
'sound' => $config['sound_warning']);
|
||||
$event = events_get_event($resultWarning);
|
||||
|
||||
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||
$agent_name = agents_get_alias($event['id_agente']);
|
||||
|
||||
$return['message'] = $agent_name . " - " . __('Module ') . io_safe_output($module_name) . __(' is going to warning') .
|
||||
" - " . $event['timestamp'];
|
||||
}
|
||||
else if ($resultUnknown) {
|
||||
$return = array('fired' => $resultWarning,
|
||||
$return = array('fired' => $resultUnknown,
|
||||
'sound' => $config['sound_alert']);
|
||||
$event = events_get_event($resultUnknown);
|
||||
|
||||
$module_name = modules_get_agentmodule_name($event['id_agentmodule']);
|
||||
$agent_name = agents_get_alias($event['id_agente']);
|
||||
|
||||
$return['message'] = $agent_name . " - " . __('Module ') . io_safe_output($module_name) . __(' is going to unknown') .
|
||||
" - " . $event['timestamp'];
|
||||
}
|
||||
else {
|
||||
$return = array('fired' => 0);
|
||||
|
@ -436,7 +464,7 @@ if ($config["pure"] == 0 || $meta) {
|
|||
echo ui_get_full_url('operation/events/sound_events.php');
|
||||
?>';
|
||||
|
||||
window.open(url, '<?php __('Sound Alerts'); ?>','width=400, height=380, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no');
|
||||
window.open(url, '<?php __('Sound Alerts'); ?>','width=600, height=450, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no');
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
|
|
@ -64,11 +64,12 @@ echo "<title>" . __("Sound Events") . "</title>";
|
|||
echo '<link rel="icon" href="../../images/pandora.ico" type="image/ico" />';
|
||||
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css" />';
|
||||
echo "</head>";
|
||||
echo "<body style='max-width: 400px; max-height: 400px;'>";
|
||||
echo "<body style='background-color: #494949; max-width: 550px; max-height: 400px; margin-top:40px;'>";
|
||||
echo "<h1 class='modalheaderh1'>" . __("Sound console"). "</h1>";
|
||||
|
||||
$table = null;
|
||||
$table->width = '100%';
|
||||
$table->styleTable = 'padding-left:16px; padding-right:16px; padding-top:16px;';
|
||||
$table->class = ' ';
|
||||
$table->size[0] = '10%';
|
||||
$table->style[0] = 'font-weight: bold; vertical-align: top;';
|
||||
|
@ -76,22 +77,29 @@ $table->style[1] = 'font-weight: bold; vertical-align: top;';
|
|||
$table->style[2] = 'font-weight: bold; vertical-align: top;';
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] .= html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true) . '<br />' . '<br />';
|
||||
$table->data[1][0] .= __('Agent');
|
||||
$table->data[1][1] .= html_print_select($agents, 'id_agents[]', true, false, '', '', true, true,'','','','','',false,'','',true);
|
||||
$table->data[0][1] = html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true, false, true, '', false, 'width:120px;') . '<br />' . '<br />';
|
||||
|
||||
$table->data[0][2] = __('Type');
|
||||
$table->data[0][3] .= html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '<br />' .
|
||||
$table->data[0][3] = html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '<br />' .
|
||||
html_print_checkbox('critical', 'critical', true, true, false, 'changeType();') . __('Monitor critical') . '<br />' .
|
||||
html_print_checkbox('unknown', 'unknown', true, true, false, 'changeType();') . __('Monitor unknown') . '<br />' .
|
||||
html_print_checkbox('warning', 'warning', true, true, false, 'changeType();') . __('Monitor warning') . '<br />';
|
||||
|
||||
$table->data[1][0] = __('Agent');
|
||||
$table->data[1][1] = html_print_select($agents, 'id_agents[]', true, false, '', '', true, true,'','','','width:120px; height:100px','',false,'','',true);
|
||||
|
||||
$table->data[1][2] = __('Event');
|
||||
$table->data[1][3] = html_print_textarea ("events_fired", 200, 20, '', 'readonly="readonly" style="max-height:100px; background: #ddd; resize:none;"', true);
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
echo '<br>';
|
||||
$table = null;
|
||||
$table->width = '100%';
|
||||
$table->rowstyle[0] = 'text-align:center;';
|
||||
$table->styleTable = 'padding-top:16px;padding-bottom:16px;';
|
||||
$table->class = ' ';
|
||||
$table->bgcolor = 'white';
|
||||
|
||||
$table->data[0][0] = '<a href="javascript: toggleButton();">' .
|
||||
html_print_image("images/play.button.png", true, array("id" => "button")) .
|
||||
'</a>';
|
||||
|
@ -103,10 +111,15 @@ $table->data[0][1] .= '<a href="javascript: ok();">' .
|
|||
$table->data[0][2] .= '<a href="javascript: test_sound_button();">' .
|
||||
html_print_image("images/icono_test.png", true, array("id" => "button_try", "style" => "margin-left: 15px;")) .
|
||||
'</a>';
|
||||
|
||||
$table->data[0][3] .= html_print_image("images/tick_sound_events.png", true, array("id" => "button_status", "style" => "margin-left: 15px;"));
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
?>
|
||||
|
||||
<script src="../../include/javascript/jquery.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var group = 0;
|
||||
var alert_fired = true;
|
||||
|
@ -115,12 +128,9 @@ var warning = true;
|
|||
var unknown = true;
|
||||
|
||||
var running = false;
|
||||
var fired = false;
|
||||
|
||||
var id_row = 0;
|
||||
|
||||
var redBackground = false;
|
||||
|
||||
var button_play_status = "play";
|
||||
|
||||
var test_sound = false;
|
||||
|
@ -167,17 +177,13 @@ function changeType() {
|
|||
}
|
||||
|
||||
function toggleButton() {
|
||||
|
||||
if (button_play_status == 'pause') {
|
||||
//~ if ($("#button").attr('src') == '../../images/pause.button.png') {
|
||||
|
||||
$("#button").attr('src', '../../images/play.button.png');
|
||||
stopSound();
|
||||
|
||||
button_play_status = 'play';
|
||||
}
|
||||
else {
|
||||
|
||||
$("#button").attr('src', '../../images/pause.button.png');
|
||||
forgetPreviousEvents();
|
||||
startSound();
|
||||
|
@ -187,19 +193,17 @@ function toggleButton() {
|
|||
}
|
||||
|
||||
function ok() {
|
||||
fired = false;
|
||||
$('body').css('background', 'white');
|
||||
$('#button_status').attr('src','../../images/tick_sound_events.png');
|
||||
$('audio').remove();
|
||||
$('#textarea_events_fired').val("");
|
||||
}
|
||||
|
||||
function stopSound() {
|
||||
$('audio').remove();
|
||||
|
||||
$('body').css('background', 'white');
|
||||
redBackground = false;
|
||||
$('body').css('background', '#494949');
|
||||
|
||||
running = false;
|
||||
fired = false;
|
||||
}
|
||||
|
||||
function startSound() {
|
||||
|
@ -235,55 +239,47 @@ function check_event() {
|
|||
var agents = $("#id_agents").val();
|
||||
|
||||
if (running) {
|
||||
if (!fired) {
|
||||
jQuery.post ("../../ajax.php",
|
||||
{"page" : "operation/events/events",
|
||||
"get_events_fired": 1,
|
||||
"id_group": group,
|
||||
"agents[]" : agents,
|
||||
"alert_fired": alert_fired,
|
||||
"critical": critical,
|
||||
"warning": warning,
|
||||
"unknown": unknown,
|
||||
"id_row": id_row
|
||||
},
|
||||
function (data) {
|
||||
firedId = parseInt(data['fired']);
|
||||
if (firedId != 0) {
|
||||
id_row = firedId;
|
||||
fired = true;
|
||||
$('body').append("<audio src='../../" + data['sound'] + "' autoplay='true' hidden='true' loop='true'>");
|
||||
jQuery.post ("../../ajax.php",
|
||||
{"page" : "operation/events/events",
|
||||
"get_events_fired": 1,
|
||||
"id_group": group,
|
||||
"agents[]" : agents,
|
||||
"alert_fired": alert_fired,
|
||||
"critical": critical,
|
||||
"warning": warning,
|
||||
"unknown": unknown,
|
||||
"id_row": id_row
|
||||
},
|
||||
function (data) {
|
||||
firedId = parseInt(data['fired']);
|
||||
if (firedId != 0) {
|
||||
id_row = firedId;
|
||||
var actual_text = $('#textarea_events_fired').val();
|
||||
if (actual_text == "") {
|
||||
$('#textarea_events_fired').val(data['message'] + "\n");
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function animation() {
|
||||
if (fired) {
|
||||
window.focus();
|
||||
if (redBackground) {
|
||||
redBackground = false;
|
||||
$('body').css('background', 'white');
|
||||
//~ window.moveBy(5, 0);
|
||||
}
|
||||
else {
|
||||
redBackground = true;
|
||||
$('body').css('background-color', 'red');
|
||||
//~ window.moveBy(-5, 0);
|
||||
}
|
||||
else {
|
||||
$('#textarea_events_fired').val(actual_text + "\n" + data['message'] + "\n");
|
||||
}
|
||||
$('#button_status').attr('src','../../images/sound_events_console_alert.gif');
|
||||
$('audio').remove();
|
||||
$('body').append("<audio src='../../" + data['sound'] + "' autoplay='true' hidden='true' loop='true'>");
|
||||
}
|
||||
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready (function () {
|
||||
setInterval("check_event()", (10 * 1000)); //10 seconds between ajax request
|
||||
setInterval("animation()", (0.1 * 1000));
|
||||
$("#table1").css("background-color", "#fff");
|
||||
$("#table2").css("background-color", "#fff");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
echo "</body>";
|
||||
echo "</html>";
|
||||
|
|
|
@ -317,7 +317,7 @@ if (check_acl ($config['id_user'], 0, "ER")
|
|||
|
||||
window.open(url,
|
||||
'<?php __('Sound Alerts'); ?>',
|
||||
'width=400, height=380, resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no');
|
||||
'width=600, height=450, resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no');
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
|
|
@ -125,6 +125,7 @@ if ($searchAgents) {
|
|||
$aux = $id[0]['id_agent'];
|
||||
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%cd " . $stringSearchSQL . "%%' OR
|
||||
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.alias COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.id_agente = $aux";
|
||||
|
||||
if (count($id) >= 2) {
|
||||
|
@ -180,7 +181,7 @@ if ($searchAgents) {
|
|||
$query = $select . $sql;
|
||||
|
||||
$query .= $limit;
|
||||
|
||||
|
||||
$agents = db_process_sql($query);
|
||||
if (empty($agents))
|
||||
$agents = array();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue