mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'develop' into '1077-sql-error-in-log4x-data-module-dialog-dev'
# Conflicts: # pandora_console/include/functions_modules.php
This commit is contained in:
commit
9c32a72c9f
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, AIX version
|
||||
# Version 7.0NG.710, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, FreeBSD Version
|
||||
# Version 7.0NG.710, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, HP-UX Version
|
||||
# Version 7.0NG.710, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Version 7.0NG.710, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# Optional. UDP Server to receive orders from outside
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Version 7.0NG.710, 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.705, Solaris Version
|
||||
# Version 7.0NG.710, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2010 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.705
|
||||
# Version 7.0NG.710
|
||||
|
||||
# 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
|
||||
@ -11,109 +11,109 @@
|
||||
|
||||
# Edit this file to change your parameters or/and add your own modules
|
||||
# Any line with a # character at the first column will be ignored (comment)
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
||||
# NOTE: The variables $*$ will be substituted in the installation wizard
|
||||
|
||||
server_ip $ServerIP$
|
||||
server_path $ServerPath$
|
||||
temporal $AgentTemp$
|
||||
logfile $AgentLog$
|
||||
|
||||
server_ip $ServerIP$
|
||||
server_path $ServerPath$
|
||||
temporal $AgentTemp$
|
||||
logfile $AgentLog$
|
||||
|
||||
#include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf"
|
||||
#broker_agent name_agent
|
||||
|
||||
|
||||
# Agent uses your hostname automatically, if you need to change agent name
|
||||
# use directive agent_name (do not use blank spaces, please).
|
||||
# This parameter is CASE SENSITIVE.
|
||||
|
||||
# agent_name My_Custom_Agent_name
|
||||
|
||||
#Parent agent_name
|
||||
#parent_agent_name caprica
|
||||
|
||||
# address: Enforce to server a ip address to this agent
|
||||
# You can also try to detect the first IP using "auto", for example
|
||||
|
||||
#address auto
|
||||
# or setting a fixed IP address, like for example:
|
||||
#address 192.168.36.73
|
||||
|
||||
# agent_name My_Custom_Agent_name
|
||||
|
||||
#Parent agent_name
|
||||
#parent_agent_name caprica
|
||||
|
||||
# address: Enforce to server a ip address to this agent
|
||||
# You can also try to detect the first IP using "auto", for example
|
||||
|
||||
#address auto
|
||||
# or setting a fixed IP address, like for example:
|
||||
#address 192.168.36.73
|
||||
|
||||
# Group assigned for this agent (descriptive, p.e: Servers)
|
||||
group $AgentGroup$
|
||||
|
||||
|
||||
# This limits operation if temporal dir has not enough free disk.
|
||||
#temporal_min_size 1024
|
||||
|
||||
|
||||
# Delay start execution X second before start to minonitoring nothing
|
||||
#startup_delay 30
|
||||
|
||||
|
||||
# Interval is defined in seconds
|
||||
interval 300
|
||||
|
||||
|
||||
# tranfer_modes: Possible values are local, tentacle (default), ftp and ssh.
|
||||
transfer_mode tentacle
|
||||
transfer_mode tentacle
|
||||
server_port 41121
|
||||
|
||||
|
||||
# In case of using FTP or tentacle with password. User is always "pandora"
|
||||
#server_pwd pandora
|
||||
|
||||
# Debug mode do not copy XML data files to server.
|
||||
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
# debug 1
|
||||
|
||||
|
||||
# ODBC connections. Check documentation for more information.
|
||||
# Configuring "ExampleDSN" DSN. Notice that this DSN connection must be configured
|
||||
# under Control panel -> Administrative tools -> ODBC -> DSN
|
||||
# odbc_ExampleDSN_username UserNameForDsn
|
||||
# odbc_ExampleDSN_password Password1234
|
||||
|
||||
|
||||
# If set to 1 allows the agent to be configured via the web console
|
||||
# (only works on enterprise version).
|
||||
# remote_config 1
|
||||
|
||||
|
||||
# Set XML encoding (ISO-8859-1 by default).
|
||||
#encoding ISO-8859-1
|
||||
|
||||
# If set to 1 start Drone Agent's Proxy Mode
|
||||
# proxy_mode 1
|
||||
|
||||
# Max number of simmultaneus connection for proxy (by default 10)
|
||||
# proxy_max_connection 10
|
||||
|
||||
# Proxy timeout (by default 1s)
|
||||
# proxy_timeout 1
|
||||
|
||||
|
||||
# If set to 1 start Drone Agent's Proxy Mode
|
||||
# proxy_mode 1
|
||||
|
||||
# Max number of simmultaneus connection for proxy (by default 10)
|
||||
# proxy_max_connection 10
|
||||
|
||||
# Proxy timeout (by default 1s)
|
||||
# proxy_timeout 1
|
||||
|
||||
# Enable or disable XML buffer.
|
||||
xml_buffer 0
|
||||
|
||||
# WMI by default. Set to NT if you don't want to use WMI.
|
||||
win32_monitoring_lib NT
|
||||
|
||||
# Secondary server configuration
|
||||
# ==============================
|
||||
|
||||
# If secondary_mode is set to on_error, data files are copied to the secondary
|
||||
# server only if the primary server fails. If set to always, data files are
|
||||
# always copied to the secondary server.
|
||||
|
||||
# Secondary server configuration
|
||||
# ==============================
|
||||
|
||||
# If secondary_mode is set to on_error, data files are copied to the secondary
|
||||
# server only if the primary server fails. If set to always, data files are
|
||||
# always copied to the secondary server.
|
||||
#secondary_mode on_error
|
||||
#secondary_server_ip localhost
|
||||
#secondary_server_path /var/spool/pandora/data_in
|
||||
#secondary_server_port 41121
|
||||
#secondary_transfer_mode tentacle
|
||||
#secondary_server_pwd mypassword
|
||||
#secondary_server_ssl no
|
||||
#secondary_server_opts
|
||||
|
||||
# Module Definition
|
||||
#secondary_server_path /var/spool/pandora/data_in
|
||||
#secondary_server_port 41121
|
||||
#secondary_transfer_mode tentacle
|
||||
#secondary_server_pwd mypassword
|
||||
#secondary_server_ssl no
|
||||
#secondary_server_opts
|
||||
|
||||
# Module Definition
|
||||
# Check online documentation and module library at http://pandorafms.org
|
||||
# =================
|
||||
|
||||
# =================
|
||||
|
||||
# CPU Load using WMI
|
||||
module_begin
|
||||
module_name CPU Load
|
||||
module_type generic_data
|
||||
module_type generic_data
|
||||
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
|
||||
module_wmicolumn LoadPercentage
|
||||
module_description CPU Load (%)
|
||||
@ -121,8 +121,8 @@ module_min_warning 80
|
||||
module_max_warning 90
|
||||
module_min_critical 91
|
||||
module_max_critical 100
|
||||
module_end
|
||||
|
||||
module_end
|
||||
|
||||
# Number processes
|
||||
module_begin
|
||||
module_name Number processes
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.705, AIX version
|
||||
# Version 7.0NG.710, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
@ -11,7 +11,7 @@ pandora_path /usr/share/pandora_agent
|
||||
temporal /var/spool/pandora/data_out
|
||||
interval 300
|
||||
checksum 0
|
||||
#agent_name adama
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
# By default is 22 (for ssh)
|
||||
#server_port 22
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.705
|
||||
# Version 7.0NG.710
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
@ -13,6 +13,7 @@ pandora_path /opt/pandora_agent
|
||||
temporal /var/spool/pandora/data_out
|
||||
interval 600
|
||||
agent_name nokia
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
checksum 0
|
||||
harmless_mode 1
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.705, HPUX Version
|
||||
# Version 7.0NG.710, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
@ -11,6 +11,7 @@ temporal /var/spool/pandora/data_out
|
||||
interval 300
|
||||
#agent_name satellite_system
|
||||
checksum 1
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# Module Definition
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705
|
||||
# Version 7.0NG.710
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705
|
||||
# Version 7.0NG.710
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705
|
||||
# Version 7.0NG.710
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
@ -14,8 +14,7 @@ logfile /opt/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 30
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.705, Solaris version
|
||||
# Version 7.0NG.710, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
@ -11,6 +11,7 @@ temporal /var/spool/pandora/data_out
|
||||
interval 300
|
||||
#agent_name satellite_system
|
||||
checksum 0
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
# By default is 22 (for ssh)
|
||||
#server_port 22
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, AIX version
|
||||
# Version 7.0NG.710, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.705-170710
|
||||
Version: 7.0NG.710-170814
|
||||
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.705-170710"
|
||||
pandora_version="7.0NG.710-170814"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -14,3 +14,4 @@ if [ -x `command -v systemctl` ]; then
|
||||
else
|
||||
update-rc.d -f pandora_agent_daemon remove
|
||||
fi
|
||||
exit 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Version 7.0NG.710, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# Optional. UDP Server to receive orders from outside
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, FreeBSD Version
|
||||
# Version 7.0NG.710, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -18,8 +18,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# Optional. UDP Server to receive orders from outside
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, HP-UX Version
|
||||
# Version 7.0NG.710, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Version 7.0NG.710, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -18,8 +18,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# Optional. UDP Server to receive orders from outside
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, GNU/Linux
|
||||
# Version 7.0NG.710, 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.705, NetBSD Version
|
||||
# Version 7.0NG.710, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.705, Solaris Version
|
||||
# Version 7.0NG.710, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
|
||||
# Debug mode only generate XML, and stop after first execution,
|
||||
# and does not copy XML to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
|
||||
# By default, agent takes machine name
|
||||
|
@ -40,8 +40,8 @@ my $Sem = undef;
|
||||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.705';
|
||||
use constant AGENT_BUILD => '170710';
|
||||
use constant AGENT_VERSION => '7.0NG.710';
|
||||
use constant AGENT_BUILD => '170814';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
@ -906,14 +906,13 @@ sub fix_directory ($) {
|
||||
################################################################################
|
||||
# Sends a file to the server.
|
||||
################################################################################
|
||||
#sub send_file ($;$) {
|
||||
#sub send_file ($;$$$) {
|
||||
sub send_file {
|
||||
my ($file, $secondary) = @_;
|
||||
my ($file, $secondary, $rc_primary, $flag_always) = @_;
|
||||
my $output;
|
||||
|
||||
my $pid = fork();
|
||||
return 1 unless defined $pid;
|
||||
|
||||
|
||||
if ($pid == 0) {
|
||||
# execute the transfer program by child process.
|
||||
eval {
|
||||
@ -942,14 +941,14 @@ sub send_file {
|
||||
};
|
||||
|
||||
if ($@) {
|
||||
log_message ('error', "Error sending file '$file': File transfer command is not responding.");
|
||||
log_message ('error', "Error sending file '$file' to '" . $Conf{'server_ip'} . ":" . $Conf{'server_port'}. "': File transfer command is not responding.");
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Get the errorlevel
|
||||
my $rc = $? >> 8;
|
||||
if ($rc != 0) {
|
||||
log_message ('error', "Error sending file '$file': $output");
|
||||
log_message ('error', "Error sending file '$file' to '" . $Conf{'server_ip'} . ":" . $Conf{'server_port'}. "': $output");
|
||||
}
|
||||
exit $rc;
|
||||
}
|
||||
@ -958,39 +957,104 @@ sub send_file {
|
||||
waitpid ($pid, 0);
|
||||
my $rc = $? >> 8;
|
||||
|
||||
return $rc unless (defined ($secondary));
|
||||
if( ($Conf{'secondary_mode'} eq 'always') && ( !defined($flag_always) ) ){
|
||||
# Send the file to the secondary server
|
||||
return $rc unless ($Conf{'secondary_mode'} eq 'always');
|
||||
|
||||
if(defined ($secondary)){
|
||||
if( ($rc != 0 && ($file =~ /\.data/)) ){
|
||||
$rc_primary = 1;
|
||||
}
|
||||
swap_servers ();
|
||||
$rc = send_file ($file, undef, $rc_primary);
|
||||
swap_servers ();
|
||||
|
||||
# Send the file to the secondary server
|
||||
return $rc unless ($Conf{'secondary_mode'} eq 'always' || ($Conf{'secondary_mode'} eq 'on_error' && $rc != 0));
|
||||
|
||||
swap_servers ();
|
||||
$rc = send_file ($file);
|
||||
swap_servers ();
|
||||
return $rc;
|
||||
return $rc;
|
||||
}
|
||||
else{
|
||||
my $rc_secondary = 0;
|
||||
if( ($rc != 0) && ($file =~ /\.data/)){
|
||||
$rc_secondary = 1;
|
||||
}
|
||||
|
||||
if ( $rc_secondary == 1 && defined($rc_primary) ){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( $rc_secondary == 1 ){
|
||||
if (! -d "$Conf{'temporal'}/secondary"){
|
||||
mkdir "$Conf{'temporal'}/secondary";
|
||||
}
|
||||
eval {
|
||||
copy("$file", "$Conf{'temporal'}/secondary/");
|
||||
};
|
||||
if ($@) {
|
||||
# We shouldn't reach this point...
|
||||
die ("Cannot write on $Conf{'temporal'}/secondary/");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( defined($rc_primary) ){
|
||||
if (! -d "$Conf{'temporal'}/primary"){
|
||||
mkdir "$Conf{'temporal'}/primary";
|
||||
}
|
||||
eval {
|
||||
copy("$file", "$Conf{'temporal'}/primary/");
|
||||
};
|
||||
if ($@) {
|
||||
# We shouldn't reach this point...
|
||||
die ("Cannot write on $Conf{'temporal'}/primary/");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( $rc_secondary == 0 && !defined($rc_primary) ){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ( ($Conf{'secondary_mode'} eq 'always') && defined($flag_always) ){
|
||||
return $rc;
|
||||
}
|
||||
else{
|
||||
return $rc unless (defined ($secondary));
|
||||
|
||||
# Send the file to the secondary server
|
||||
return $rc unless ($Conf{'secondary_mode'} eq 'always' || ($Conf{'secondary_mode'} eq 'on_error' && $rc != 0));
|
||||
|
||||
swap_servers ();
|
||||
$rc = send_file ($file);
|
||||
swap_servers ();
|
||||
return $rc;
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Send buffered XML files.
|
||||
################################################################################
|
||||
sub send_buffered_xml_files () {
|
||||
|
||||
sub send_buffered_xml_files ($;$) {
|
||||
my ($temporal_file, $flag_always) = @_;
|
||||
# Read XML files from the temporal directory
|
||||
opendir(TEMPORAL, $Conf{'temporal'}) or return;
|
||||
while (my $xml_file = readdir(TEMPORAL)) {
|
||||
|
||||
opendir(TEMPORAL, $temporal_file) or return;
|
||||
if (defined($flag_always) && ($flag_always == 2)){
|
||||
swap_servers ();
|
||||
}
|
||||
while (my $xml_file = readdir(TEMPORAL)) {
|
||||
# Skip non data files and symlinks
|
||||
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$Conf{'temporal'}/$xml_file");
|
||||
|
||||
my $rc = send_file ("$Conf{'temporal'}/$xml_file", 1);
|
||||
|
||||
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$temporal_file/$xml_file");
|
||||
my $rc = send_file ("$temporal_file/$xml_file", 1, undef, $flag_always);
|
||||
if ($rc == 0) {
|
||||
if ($Conf{'debug'} eq '1') {
|
||||
rename "$Conf{'temporal'}/$xml_file", "$Conf{'temporal'}/$xml_file". "sent";
|
||||
rename "$temporal_file/$xml_file", "$temporal_file/$xml_file". "sent";
|
||||
} else {
|
||||
unlink ("$Conf{'temporal'}/$xml_file");
|
||||
unlink ("$temporal_file/$xml_file");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (defined($flag_always) && ($flag_always == 2)){
|
||||
swap_servers ();
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@ -2769,7 +2833,20 @@ while (1) {
|
||||
|
||||
# Send buffered XML data files
|
||||
if ($Conf{'xml_buffer'} == 1) {
|
||||
send_buffered_xml_files ();
|
||||
if($Conf{'secondary_mode'} eq 'always'){
|
||||
$Conf{'__temporal_primary'} = "$Conf{'temporal'}/primary";
|
||||
$Conf{'__temporal_secondary'} = "$Conf{'temporal'}/secondary";
|
||||
if (-d "$Conf{'__temporal_primary'}"){
|
||||
send_buffered_xml_files ($Conf{'__temporal_primary'}, 1);
|
||||
}
|
||||
if (-d "$Conf{'__temporal_secondary'}"){
|
||||
send_buffered_xml_files ($Conf{'__temporal_secondary'}, 2);
|
||||
}
|
||||
send_buffered_xml_files ($Conf{'temporal'});
|
||||
}
|
||||
else{
|
||||
send_buffered_xml_files ($Conf{'temporal'});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.705
|
||||
%define release 170710
|
||||
%define version 7.0NG.710
|
||||
%define release 170814
|
||||
|
||||
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.705
|
||||
%define release 170710
|
||||
%define version 7.0NG.710
|
||||
%define release 170814
|
||||
|
||||
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.705"
|
||||
PI_BUILD="170710"
|
||||
PI_VERSION="7.0NG.710"
|
||||
PI_BUILD="170814"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
@ -150,6 +150,13 @@ uninstall () {
|
||||
rm /Library/LaunchDaemons/com.pandorafms.pandorafms.plist 2> /dev/null
|
||||
fi
|
||||
|
||||
# Stops the agent on uninstall
|
||||
if [ -f $PANDORA_BASE/etc/init.d/pandora_agent_daemon ]; then
|
||||
$PANDORA_BASE/etc/init.d/pandora_agent_daemon stop 12> /dev/null
|
||||
else
|
||||
echo "$PANDORA_BASE/etc/init.d/pandora_agent_daemon not found to stop agent"
|
||||
fi
|
||||
|
||||
echo "Removing Pandora FMS Agent..."
|
||||
rm -Rf $PANDORA_BASE$PANDORA_BIN 2> /dev/null
|
||||
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2014 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.705
|
||||
# Version 7.0NG.710
|
||||
|
||||
# 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
|
||||
@ -36,7 +36,7 @@ temporal "%ProgramFiles%\pandora_agent\temp"
|
||||
# If set to __rand__ the agent will generate a random name.
|
||||
#agent_name_cmd cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\agentname.vbs"
|
||||
agent_name_cmd __rand__
|
||||
|
||||
|
||||
|
||||
#Parent agent_name
|
||||
#parent_agent_name caprica
|
||||
@ -77,7 +77,7 @@ server_port 41121
|
||||
# If set to 1 disables log writing into pandora_agent.log
|
||||
#disable_logfile 1
|
||||
|
||||
# Debug mode do not copy XML data files to server.
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
# debug 1
|
||||
|
||||
# If set to 1 allows the agent to be configured via the web console
|
||||
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
||||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.705}
|
||||
{Pandora FMS Windows Agent v7.0NG.710}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{170710}
|
||||
{170814}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.705(Build 170710)")
|
||||
#define PANDORA_VERSION ("7.0NG.710(Build 170814)")
|
||||
|
||||
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.705(Build 170710))"
|
||||
VALUE "ProductVersion", "(7.0NG.710(Build 170814))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.705-170710
|
||||
Version: 7.0NG.710-170814
|
||||
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.705-170710"
|
||||
pandora_version="7.0NG.710-170814"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -528,24 +528,24 @@ function mainAgentsModules() {
|
||||
echo '<a href="javascript:'.$link.'">';
|
||||
switch ($status) {
|
||||
case AGENT_MODULE_STATUS_NORMAL:
|
||||
ui_print_status_image ('module_ok.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
|
||||
ui_print_status_image ('module_ok.png', modules_get_last_value($module_id), false);
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_CRITICAL_BAD:
|
||||
ui_print_status_image ('module_critical.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
|
||||
ui_print_status_image ('module_critical.png', modules_get_last_value($module_id), false);
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_WARNING:
|
||||
ui_print_status_image ('module_warning.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
|
||||
ui_print_status_image ('module_warning.png', modules_get_last_value($module_id), false);
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_UNKNOWN:
|
||||
ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
|
||||
ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false);
|
||||
break;
|
||||
case AGENT_MODULE_STATUS_NORMAL_ALERT:
|
||||
case AGENT_MODULE_STATUS_WARNING_ALERT:
|
||||
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
|
||||
ui_print_status_image ('module_alertsfired.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
|
||||
ui_print_status_image ('module_alertsfired.png', modules_get_last_value($module_id), false);
|
||||
break;
|
||||
case 4:
|
||||
ui_print_status_image ('module_no_data.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
|
||||
ui_print_status_image ('module_no_data.png', modules_get_last_value($module_id), false);
|
||||
break;
|
||||
}
|
||||
echo '</a>';
|
||||
|
@ -127,7 +127,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
|
||||
ui_print_error_message(
|
||||
__('Unsuccessful installed tables into the testing DB'));
|
||||
}
|
||||
else {
|
||||
else {/*
|
||||
if (enterprise_installed()) {
|
||||
$install_tables_enterprise =
|
||||
extension_db_status_execute_sql_file(
|
||||
@ -139,7 +139,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
|
||||
__('Unsuccessful installed enterprise tables into the testing DB'));
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
extension_db_check_tables_differences(
|
||||
$connection_test,
|
||||
$connection_system,
|
||||
@ -159,6 +159,7 @@ function extension_db_check_tables_differences($connection_test,
|
||||
|
||||
global $config;
|
||||
|
||||
|
||||
// --------- Check the tables --------------------------------------
|
||||
mysql_select_db($db_name_test, $connection_test);
|
||||
$result = mysql_query("SHOW TABLES", $connection_test);
|
||||
@ -170,9 +171,8 @@ function extension_db_check_tables_differences($connection_test,
|
||||
//~ $tables_test = array_merge($tables_test,
|
||||
//~ extension_db_status_extension_tables());
|
||||
|
||||
|
||||
mysql_select_db($db_name_system, $connection_system);
|
||||
$result = mysql_query("SHOW TABLES", $connection_system);
|
||||
mysql_select_db($db_name_system, $connection_test);
|
||||
$result = mysql_query("SHOW TABLES", $connection_test);
|
||||
$tables_system = array();
|
||||
while ($row = mysql_fetch_array ($result)) {
|
||||
$tables_system[] = $row[0];
|
||||
@ -227,8 +227,8 @@ function extension_db_check_tables_differences($connection_test,
|
||||
|
||||
|
||||
|
||||
mysql_select_db($db_name_system, $connection_system);
|
||||
$result = mysql_query("EXPLAIN " . $table, $connection_system);
|
||||
mysql_select_db($db_name_system, $connection_test);
|
||||
$result = mysql_query("EXPLAIN " . $table, $connection_test);
|
||||
$fields_system = array();
|
||||
if (!empty($result)) {
|
||||
while ($row = mysql_fetch_array ($result)) {
|
||||
|
17
pandora_console/extras/mr/4.sql
Normal file
17
pandora_console/extras/mr/4.sql
Normal file
@ -0,0 +1,17 @@
|
||||
START TRANSACTION;
|
||||
|
||||
alter table tusuario add autorefresh_white_list text not null default '';
|
||||
ALTER TABLE tserver_export MODIFY name varchar(600) BINARY NOT NULL default '';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tpolicy_groups` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_policy` int(10) unsigned default '0',
|
||||
`id_group` int(10) unsigned default '0',
|
||||
`policy_applied` tinyint(1) unsigned default '0',
|
||||
`pending_delete` tinyint(1) unsigned default '0',
|
||||
`last_apply_utimestamp` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (`id_policy`, `id_group`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
COMMIT;
|
15
pandora_console/extras/mr/5.sql
Normal file
15
pandora_console/extras/mr/5.sql
Normal file
@ -0,0 +1,15 @@
|
||||
START TRANSACTION;
|
||||
|
||||
SET @st_oum707 = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tgraph_source' AND table_schema = DATABASE() AND column_name = 'id_server') > 0,
|
||||
"SELECT 1",
|
||||
"ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default 0"
|
||||
));
|
||||
|
||||
PREPARE pr_oum707 FROM @st_oum707;
|
||||
EXECUTE pr_oum707;
|
||||
DEALLOCATE PREPARE pr_oum707;
|
||||
|
||||
ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) BINARY NOT NULL default '';
|
||||
|
||||
COMMIT;
|
@ -181,6 +181,20 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` (
|
||||
UNIQUE (`id_policy`, `id_agent`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tpolicy_groups`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tpolicy_groups` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_policy` int(10) unsigned default '0',
|
||||
`id_group` int(10) unsigned default '0',
|
||||
`policy_applied` tinyint(1) unsigned default '0',
|
||||
`pending_delete` tinyint(1) unsigned default '0',
|
||||
`last_apply_utimestamp` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (`id_policy`, `id_group`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tdashboard`
|
||||
-- ---------------------------------------------------------------------
|
||||
@ -1136,10 +1150,10 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 1);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 4);
|
||||
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
|
||||
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '704');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '708');
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tplanned_downtime_agents`
|
||||
@ -1168,6 +1182,7 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
|
||||
ALTER TABLE tusuario ADD COLUMN `id_filter` int(10) UNSIGNED NULL DEFAULT NULL;
|
||||
ALTER TABLE tusuario ADD CONSTRAINT `fk_id_filter` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter(`id_filter`) ON DELETE SET NULL;
|
||||
ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default '0';
|
||||
alter table tusuario add autorefresh_white_list text not null default '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
@ -1312,6 +1327,7 @@ IF @vv1>0 THEN
|
||||
END IF;
|
||||
END;
|
||||
//
|
||||
delimiter;
|
||||
CALL addcol();
|
||||
DROP PROCEDURE addcol;
|
||||
|
||||
@ -1336,6 +1352,17 @@ CREATE TABLE IF NOT EXISTS `tcontainer` (
|
||||
|
||||
INSERT INTO `tcontainer` SET `name` = 'Default graph container';
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `treset_pass_history`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `treset_pass_history` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_user` varchar(60) NOT NULL,
|
||||
`reset_moment` datetime NOT NULL,
|
||||
`success` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tcontainer_item`
|
||||
-- ---------------------------------------------------------------------
|
||||
@ -1371,3 +1398,21 @@ CREATE TABLE IF NOT EXISTS `treset_pass` (
|
||||
UPDATE tgis_map_connection SET conection_data = '{"type":"OSM","url":"http://tile.openstreetmap.org/${z}/${x}/${y}.png"}' where id_tmap_connection = 1;
|
||||
|
||||
ALTER TABLE tpolicy_modules MODIFY post_process double(24,15) default 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tserver_export`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tgraph_source` column 'id_server'
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tserver_export_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) BINARY NOT NULL default '';
|
||||
|
25
pandora_console/general/check_image_module.php
Normal file
25
pandora_console/general/check_image_module.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
include_once ('include/config.php');
|
||||
include_once ('include/functions.php');
|
||||
include_once ('include/functions_db.php');
|
||||
include_once ('include/auth/mysql.php');
|
||||
|
||||
$id = get_parameter('get_image');
|
||||
|
||||
$sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = '.$id;
|
||||
|
||||
$result = db_get_sql($sql);
|
||||
|
||||
$image = strpos($result, 'data:image');
|
||||
|
||||
if($image === false){
|
||||
echo 0;
|
||||
}
|
||||
else{
|
||||
echo 1;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
@ -32,13 +32,18 @@ if (!$config["MR"]) {
|
||||
|
||||
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">';
|
||||
|
||||
if($current_package == 0){
|
||||
$build_package_version = $build_version;
|
||||
}
|
||||
else{
|
||||
$build_package_version = $current_package;
|
||||
if(enterprise_installed()){
|
||||
enterprise_include_once("../include/functions_update_manager.php");
|
||||
}
|
||||
|
||||
$current_package = update_manager_get_current_package();
|
||||
|
||||
if($current_package == 0){
|
||||
$build_package_version = $build_version;
|
||||
}
|
||||
else{
|
||||
$build_package_version = $current_package;
|
||||
}
|
||||
|
||||
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_package_version, $config["MR"]));
|
||||
|
||||
|
@ -191,7 +191,9 @@ config_check();
|
||||
$_GET['refr'] = null;
|
||||
}
|
||||
|
||||
if ($config['autorefresh_white_list'] !== null && array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) {
|
||||
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
|
||||
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
|
||||
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
|
||||
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
|
||||
|
||||
if ($_GET['refr']) {
|
||||
@ -354,7 +356,7 @@ config_check();
|
||||
var new_chat = <?php echo (int)$_SESSION['new_chat'];?>;
|
||||
$(document).ready (function () {
|
||||
<?php
|
||||
if (($config['autorefresh_white_list'] !== null) && (array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) && (!isset($_GET["refr"]))) {
|
||||
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET["refr"]))) {
|
||||
?>
|
||||
$("a.autorefresh_txt").toggle ();
|
||||
$("#combo_refr").toggle ();
|
||||
|
@ -119,7 +119,7 @@ $(document).ready (function () {
|
||||
|
||||
// Update config['skip_login_help_dialog'] to don't display more this message
|
||||
if (skip_login_help) {
|
||||
jQuery.get ("ajax.php",
|
||||
jQuery.post ("ajax.php",
|
||||
{"page": "general/login_help_dialog",
|
||||
"skip_login_help": 1},
|
||||
function (data) {}
|
||||
|
@ -239,6 +239,16 @@ if ($create_agent) {
|
||||
|
||||
$agent_created_ok = true;
|
||||
|
||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$grupo);
|
||||
|
||||
if($tpolicy_group_old){
|
||||
foreach ($tpolicy_group_old as $key => $old_group) {
|
||||
db_process_sql_insert ('tpolicy_agents',
|
||||
array('id_policy' => $old_group['id_policy'], 'id_agent' => $id_agente));
|
||||
}
|
||||
}
|
||||
|
||||
$info = 'Name: ' . $nombre_agente .
|
||||
' IP: ' . $direccion_agente .
|
||||
' Group: ' . $grupo .
|
||||
@ -774,6 +784,10 @@ if ($update_agent) { // if modified some agent paramenter
|
||||
$values['update_module_count'] = 1; // Force an update of the agent cache.
|
||||
}
|
||||
|
||||
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agente);
|
||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$group_old);
|
||||
|
||||
$result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
|
||||
if ($result === false) {
|
||||
ui_print_error_message(
|
||||
@ -788,6 +802,38 @@ if ($update_agent) { // if modified some agent paramenter
|
||||
enterprise_hook('config_agents_update_config_interval', array($id_agente, $intervalo));
|
||||
}
|
||||
|
||||
if($tpolicy_group_old){
|
||||
foreach ($tpolicy_group_old as $key => $value) {
|
||||
$tpolicy_agents_old= db_get_sql("SELECT * FROM tpolicy_agents
|
||||
WHERE id_policy = ".$value['id_policy'] . " AND id_agent = " .$id_agente);
|
||||
|
||||
if($tpolicy_agents_old){
|
||||
$result2 = db_process_sql_update ('tpolicy_agents',
|
||||
array('pending_delete' => 1),
|
||||
array ('id_agent' => $id_agente, 'id_policy' => $value['id_policy']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpolicy_group = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$grupo);
|
||||
|
||||
if($tpolicy_group){
|
||||
foreach ($tpolicy_group as $key => $value) {
|
||||
$tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents
|
||||
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agente);
|
||||
|
||||
if(!$tpolicy_agents){
|
||||
db_process_sql_insert ('tpolicy_agents',
|
||||
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agente));
|
||||
} else {
|
||||
$result3 = db_process_sql_update ('tpolicy_agents',
|
||||
array('pending_delete' => 0),
|
||||
array ('id_agent' => $id_agente, 'id_policy' => $value['id_policy']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$info = 'Group: ' . $grupo . ' Interval: ' . $intervalo .
|
||||
' Comments: ' . $comentarios . ' Mode: ' . $modo .
|
||||
' ID OS: ' . $id_os . ' Disabled: ' . $disabled .
|
||||
@ -954,10 +1000,11 @@ if ($update_module || $create_module) {
|
||||
|
||||
$macros = io_json_mb_encode($macros);
|
||||
|
||||
$conf_array = explode("\n",$configuration_data);
|
||||
$conf_array = explode("\n", io_safe_output($configuration_data));
|
||||
|
||||
foreach ($conf_array as $line) {
|
||||
if (preg_match("/^module_name\s*(.*)/", $line, $match)) {
|
||||
$new_configuration_data .= "module_name $name\n";
|
||||
$new_configuration_data .= "module_name " . io_safe_output($name) . "\n";
|
||||
}
|
||||
// We delete from conf all the module macros starting with _field
|
||||
else if(!preg_match("/^module_macro_field.*/", $line, $match)) {
|
||||
@ -965,14 +1012,28 @@ if ($update_module || $create_module) {
|
||||
}
|
||||
}
|
||||
|
||||
$values_macros = array();
|
||||
$values_macros['macros'] = base64_encode($macros);
|
||||
|
||||
$macros_for_data = enterprise_hook(
|
||||
'config_agents_get_macros_data_conf', array($values_macros));
|
||||
|
||||
if ($macros_for_data != '') {
|
||||
$new_configuration_data = str_replace('module_end', $macros_for_data . "module_end", $new_configuration_data);
|
||||
}
|
||||
|
||||
/*
|
||||
$macros_for_data = enterprise_hook('config_agents_get_macros_data_conf', array($_POST));
|
||||
|
||||
if ($macros_for_data !== ENTERPRISE_NOT_HOOK && $macros_for_data != '') {
|
||||
// Add macros to configuration file
|
||||
$new_configuration_data = str_replace('module_end', $macros_for_data."module_end", $new_configuration_data);
|
||||
}
|
||||
|
||||
$configuration_data = $new_configuration_data;
|
||||
*/
|
||||
$configuration_data = str_replace('\\', "\",
|
||||
io_safe_input($new_configuration_data));;
|
||||
|
||||
html_debug($configuration_data, true);
|
||||
}
|
||||
|
||||
// Services are an enterprise feature,
|
||||
@ -1182,7 +1243,7 @@ if ($update_module) {
|
||||
'min_ff_event_critical' => $ff_event_critical,
|
||||
'each_ff' => $each_ff,
|
||||
'ff_timeout' => $ff_timeout,
|
||||
'unit' => $unit,
|
||||
'unit' => io_safe_output($unit),
|
||||
'macros' => $macros,
|
||||
'quiet' => $quiet_module,
|
||||
'critical_instructions' => $critical_instructions,
|
||||
@ -1342,7 +1403,7 @@ if ($create_module) {
|
||||
'min_ff_event_critical' => $ff_event_critical,
|
||||
'each_ff' => $each_ff,
|
||||
'ff_timeout' => $ff_timeout,
|
||||
'unit' => $unit,
|
||||
'unit' => io_safe_output($unit),
|
||||
'macros' => $macros,
|
||||
'quiet' => $quiet_module,
|
||||
'critical_instructions' => $critical_instructions,
|
||||
@ -1466,7 +1527,8 @@ if ($delete_module) { // DELETE agent module !
|
||||
if ($result === false)
|
||||
$error++;
|
||||
|
||||
if (alerts_delete_alert_agent_module($id_borrar_modulo) === false)
|
||||
if (alerts_delete_alert_agent_module(false,
|
||||
array('id_agent_module' => $id_borrar_modulo)) === false)
|
||||
$error++;
|
||||
|
||||
$result = db_process_delete_temp('ttag_module', 'id_agente_modulo',
|
||||
|
@ -488,6 +488,7 @@ if ($agents !== false) {
|
||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp)) . '</a>' .
|
||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown)) . '</a>';
|
||||
echo "</th>";
|
||||
echo "<th>".__('Type'). "</th>";
|
||||
echo "<th>".__('Group'). ' ' .
|
||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp)) . '</a>' .
|
||||
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown)) . '</a>';
|
||||
@ -606,6 +607,14 @@ if ($agents !== false) {
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>";
|
||||
ui_print_os_icon ($agent["id_os"], false);
|
||||
echo "</td>";
|
||||
|
||||
// Type agent (Networt, Software or Satellite)
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>";
|
||||
echo ui_print_type_agent_icon ($agent["id_os"], $agent['ultimo_contacto_remoto'],
|
||||
$agent['ultimo_contacto'], $agent['remote'], $agent['agent_version']);
|
||||
echo "</td>";
|
||||
|
||||
|
||||
// Group icon and name
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>" . ui_print_group_icon ($id_grupo, true)."</td>";
|
||||
// Description
|
||||
|
@ -148,7 +148,7 @@ $table_simple->colspan[6][1] = 3;
|
||||
|
||||
$table_simple->data[0][0] = __('Name');
|
||||
$table_simple->data[0][1] = html_print_input_text_extended ('name',
|
||||
io_safe_output($name), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
|
||||
io_safe_input(html_entity_decode($name)), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
|
||||
//$table_simple->data[0][1] = html_print_input_text ('name',
|
||||
// io_safe_output($name), '', 45, 100, true, $disabledBecauseInPolicy);
|
||||
|
||||
|
@ -32,7 +32,7 @@ $id_alert = get_parameter ("id_alert", 0); // ID given as parameter
|
||||
$alert = alerts_get_alert_agent_module($id_alert);
|
||||
$template = alerts_get_alert_template ($alert['id_alert_template']);
|
||||
$actions = alerts_get_alert_agent_module_actions ($id_alert);
|
||||
$agent_name = modules_get_agentmodule_agent_name ($alert['id_agent_module']);
|
||||
$agent_alias = modules_get_agentmodule_agent_alias ($alert['id_agent_module']);
|
||||
$agent = modules_get_agentmodule_agent ($alert['id_agent_module']);
|
||||
$module_name = modules_get_agentmodule_name ($alert['id_agent_module']);
|
||||
|
||||
@ -65,7 +65,7 @@ $table_details->data[] = $data;
|
||||
|
||||
$data[0] = __('Agent');
|
||||
$data[1] ='<a style=" font-size: 7pt;" href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent.
|
||||
'" title="'.$agent_name.'"><b><span style=" font-size: 7pt;">'.$agent_name.'</span></b></a>';
|
||||
'" title="'.$agent_alias.'"><b><span style=" font-size: 7pt;">'.$agent_alias.'</span></b></a>';
|
||||
$table_details->data[] = $data;
|
||||
|
||||
$data[0] = __('Module');
|
||||
|
@ -139,9 +139,51 @@ if ($update_agents) {
|
||||
isset($values['id_grupo'])) {
|
||||
$values['update_module_count'] = 1; // Force an update of the agent cache.
|
||||
}
|
||||
$group_old = false;
|
||||
if($values['id_grupo']){
|
||||
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agent);
|
||||
}
|
||||
|
||||
$result = db_process_sql_update ('tagente',
|
||||
$values,
|
||||
array ('id_agente' => $id_agent));
|
||||
|
||||
if($group_old || $result){
|
||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$group_old);
|
||||
|
||||
if($tpolicy_group_old){
|
||||
foreach ($tpolicy_group_old as $key => $value) {
|
||||
$tpolicy_agents_old= db_get_sql("SELECT * FROM tpolicy_agents
|
||||
WHERE id_policy = ".$value['id_policy'] . " AND id_agent = " .$id_agent);
|
||||
|
||||
if($tpolicy_agents_old){
|
||||
$result2 = db_process_sql_update ('tpolicy_agents',
|
||||
array('pending_delete' => 1),
|
||||
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpolicy_group_new = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$values['id_grupo']);
|
||||
|
||||
if($tpolicy_group_new){
|
||||
foreach ($tpolicy_group_new as $key => $value) {
|
||||
$tpolicy_agents_new= db_get_sql("SELECT * FROM tpolicy_agents
|
||||
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agent);
|
||||
|
||||
if(!$tpolicy_agents_new){
|
||||
db_process_sql_insert ('tpolicy_agents',
|
||||
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agent));
|
||||
} else {
|
||||
$result3 = db_process_sql_update ('tpolicy_agents',
|
||||
array('pending_delete' => 0),
|
||||
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update Custom Fields
|
||||
|
@ -41,8 +41,13 @@ if (is_ajax()){
|
||||
$id_agent = get_parameter('id_agent');
|
||||
$id_agent_module = get_parameter('id_agent_module');
|
||||
$time_lapse = get_parameter('time_lapse');
|
||||
$only_avg = (int) get_parameter('only_avg');
|
||||
|
||||
$only_avg = get_parameter('only_avg');
|
||||
if($only_avg != 'false'){
|
||||
$only_avg = 1;
|
||||
}
|
||||
else{
|
||||
$only_avg = 0;
|
||||
}
|
||||
$values = array(
|
||||
'id_container' => $id_container2,
|
||||
'type' => "simple_graph",
|
||||
@ -76,7 +81,13 @@ if (is_ajax()){
|
||||
$agent_alias = get_parameter('agent_alias','');
|
||||
$module_name = get_parameter('module_name','');
|
||||
$tag = get_parameter('tag',0);
|
||||
|
||||
$only_avg = get_parameter('only_avg');
|
||||
if($only_avg != 'false'){
|
||||
$only_avg = 1;
|
||||
}
|
||||
else{
|
||||
$only_avg = 0;
|
||||
}
|
||||
$values = array(
|
||||
'id_container' => $id_container2,
|
||||
'type' => "dynamic_graph",
|
||||
@ -85,8 +96,8 @@ if (is_ajax()){
|
||||
'id_module_group' => $module_group,
|
||||
'agent' => $agent_alias,
|
||||
'module' => $module_name,
|
||||
'id_tag' => $tag);
|
||||
|
||||
'id_tag' => $tag,
|
||||
'only_average' => $only_avg);
|
||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||
return;
|
||||
}
|
||||
@ -433,7 +444,13 @@ if($edit_container){
|
||||
$tag, '', __('Any'), 0, true, false, false);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Only average');
|
||||
$data[1] = html_print_checkbox('only_avg_2', 1, false,true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = "";
|
||||
$data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>";
|
||||
@ -592,6 +609,7 @@ echo html_print_input_hidden('id_agent', 0);
|
||||
var group = $("#container_id_group1").val();
|
||||
var module_group = $("#combo_modulegroup").val();
|
||||
var tag = $("#tag").val();
|
||||
var only_avg = $("#checkbox-only_avg_2").prop("checked");
|
||||
var id_container = <?php echo $id_container; ?>;
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "godmode/reporting/create_container",
|
||||
@ -603,6 +621,7 @@ echo html_print_input_hidden('id_agent', 0);
|
||||
"module_name" : module_name,
|
||||
"tag" : tag,
|
||||
"id_container" : id_container,
|
||||
"only_avg" : only_avg,
|
||||
},
|
||||
function (data, status) {
|
||||
var url = location.href.replace('&update_container=1', "");
|
||||
|
@ -94,7 +94,7 @@ echo "</div>";
|
||||
},
|
||||
success: function(data) {
|
||||
$("#div_"+hash).remove();
|
||||
$("#tgl_div_"+hash).prepend("<div id='div_"+hash+"' style='width: 100%;padding-left: 63px; padding-top: 7px;'>"+data+"</div>");
|
||||
$("#tgl_div_"+hash).prepend("<div id='div_"+hash+"' class='graph_conteiner_inside' style='width: 99%;padding-left: 63px; padding-top: 7px;'>"+data+"</div>");
|
||||
|
||||
if($('div[class *= graph]').length == 0 && $('div[class *= bullet]').length == 0 && $('div[id *= gauge_]').length == 0){
|
||||
$("#div_"+hash).remove();
|
||||
|
@ -1124,8 +1124,8 @@ 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');
|
||||
}
|
||||
$values['historical_db'] = get_parameter('historical_db_check');
|
||||
}
|
||||
else if ($values['type'] == 'url') {
|
||||
$values['external_source'] = get_parameter('url');
|
||||
@ -1214,7 +1214,6 @@ switch ($action) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$resultOperationDB = db_process_sql_update(
|
||||
'treport_content',
|
||||
$values,
|
||||
@ -1446,8 +1445,8 @@ 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');
|
||||
}
|
||||
$values['historical_db'] = get_parameter('historical_db_check');
|
||||
}
|
||||
elseif ($values['type'] == 'url') {
|
||||
$values['external_source'] = get_parameter('url');
|
||||
|
@ -84,7 +84,46 @@ function visual_map_main() {
|
||||
//Fixed to wait the load of images.
|
||||
$(window).load(function() {
|
||||
|
||||
|
||||
$('#module').change(function(){
|
||||
var txt = $("#module").val();
|
||||
if(selectedItem == 'simple_value' || creationItem == 'simple_value'){
|
||||
$.ajax({
|
||||
async:false,
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {"page" : "general/check_image_module",
|
||||
"get_image" : txt,
|
||||
},
|
||||
success: function(data) {
|
||||
if(data == 0){
|
||||
$("#data_image_check").html('Off');
|
||||
$('#data_image_container').css('display','none');
|
||||
$('#data_image_check').css('display','none');
|
||||
$('#data_image_check_label').css('display','none');
|
||||
$('.block_tinymce').remove();
|
||||
$('#process_value_row').css('display','table-row');
|
||||
if($('#process_value').val() != '0'){
|
||||
$('#period_row').css('display','table-row');
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#data_image_container').css('display','inline');
|
||||
$('#data_image_check').css('display','inline');
|
||||
$('#data_image_check_label').css('display','inline');
|
||||
$("#data_image_check").html('On');
|
||||
$('#process_value_row').css('display','none');
|
||||
$('#period_row').css('display','none');
|
||||
$('#text-label_ifr').contents().find('#tinymce').html('_VALUE_');
|
||||
$('.block_tinymce').remove();
|
||||
$('#label_row').append('<div class="block_tinymce" style="background-color:#fbfbfb;position:absolute;left:0px;height:230px;width:100%;opacity:0.7;z-index:5;"></div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Begin - Background label color changer
|
||||
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).bind("contextmenu", function(e) {
|
||||
@ -231,14 +270,14 @@ function update_button_palette_callback() {
|
||||
break;
|
||||
case 'box_item':
|
||||
|
||||
if($('input[name=width_box]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_box]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=width_box]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_box]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#" + idItem + " div").css('background-color', values['fill_color']);
|
||||
$("#" + idItem + " div").css('border-color', values['border_color']);
|
||||
@ -256,55 +295,53 @@ function update_button_palette_callback() {
|
||||
case 'group_item':
|
||||
case 'static_graph':
|
||||
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', 70);
|
||||
$("#image_" + idItem).attr('height', 70);
|
||||
$("#image_" + idItem).css('width', '70px');
|
||||
$("#image_" + idItem).css('height', '70px');
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
if($('input[name=height]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', 70);
|
||||
$("#image_" + idItem).attr('height', 70);
|
||||
$("#image_" + idItem).css('width', '70px');
|
||||
$("#image_" + idItem).css('height', '70px');
|
||||
}
|
||||
else{
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
||||
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
||||
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', values['width']);
|
||||
$("#image_" + idItem).attr('height', values['height']);
|
||||
$("#image_" + idItem).css('width', values['width'] + 'px');
|
||||
$("#image_" + idItem).css('height', values['height'] + 'px');
|
||||
}
|
||||
$("#image_" + idItem).attr('width', values['width']);
|
||||
$("#image_" + idItem).attr('height', values['height']);
|
||||
$("#image_" + idItem).css('width', values['width'] + 'px');
|
||||
$("#image_" + idItem).css('height', values['height'] + 'px');
|
||||
}
|
||||
break;
|
||||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
|
||||
if($('input[name=width_percentile]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_percentile]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
if($('input[name=width_percentile]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_percentile]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
@ -315,96 +352,126 @@ function update_button_palette_callback() {
|
||||
setPercentileBar(idItem, values);
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
case 'module_graph':
|
||||
|
||||
|
||||
if($('#dir_items').html() == 'horizontal'){
|
||||
if(parseInt($('#text-left').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))
|
||||
|| parseInt($('#text-left').val()) + (parseInt($('input[name=width_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))){
|
||||
|
||||
alert($('#count_items').html()+' joined graph items are wider than background');
|
||||
return false;
|
||||
|
||||
if($('#dir_items').html() == 'horizontal'){
|
||||
if(parseInt($('#text-left').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))
|
||||
|| parseInt($('#text-left').val()) + (parseInt($('input[name=width_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))){
|
||||
|
||||
alert($('#count_items').html()+' joined graph items are wider than background');
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($('#dir_items').html() == 'vertical'){
|
||||
if(parseInt($('#text-top').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('height'))){
|
||||
alert($('#count_items').html()+' joined graph items are higher than background');
|
||||
return false;
|
||||
|
||||
|
||||
if($('#dir_items').html() == 'vertical'){
|
||||
if(parseInt($('#text-top').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('height'))){
|
||||
alert($('#count_items').html()+' joined graph items are higher than background');
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($('input[name=width_module_graph]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_module_graph]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
if($('#custom_graph_row').css('display') != 'none' && $("#custom_graph option:selected").html() == 'None'){
|
||||
|
||||
if($('input[name=width_module_graph]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height_module_graph]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
if($('#custom_graph_row').css('display') != 'none' && $("#custom_graph option:selected").html() == 'None'){
|
||||
alert('Undefined graph');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
setModuleGraph(idItem);
|
||||
break;
|
||||
case 'simple_value':
|
||||
case 'auto_sla_graph':
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
|
||||
setEventsBar(idItem, values);
|
||||
break;
|
||||
case 'simple_value':
|
||||
//checkpoint
|
||||
// if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' ||
|
||||
// $('#text-label_ifr').contents().find('#tinymce').html() == '_VALUE_')
|
||||
// && $('#data_image_check').html() != 'On'){
|
||||
// alert('_VALUE_ exactly value is only enable for data image. Please change label text or select a data image module.');
|
||||
// return;
|
||||
// }
|
||||
$("#" + idItem).html(values['label']);
|
||||
if( (values['label'].replace( /<.*?>/g, '' ) != '_VALUE_')
|
||||
&& (values['label'].replace( /<.*?>/g, '' ) != '(_VALUE_)') ){
|
||||
|
||||
$("#text_" + idItem).html('<img style="width:'+values['width_data_image']+'px;" src="images/console/signes/data_image.png">');
|
||||
$("#" + idItem).html('<img style="width:'+values['width_data_image']+'px;" src="images/console/signes/data_image.png">');
|
||||
}
|
||||
else{
|
||||
$("#text_" + idItem).html(
|
||||
'<table><tbody><tr><td></td></tr><tr><td><span style="" id="text_21" class="text">'+values["label"]+'</span></td></tr><tr><td></td></tr></tbody></table>'
|
||||
)
|
||||
$("#" + idItem).html(
|
||||
'<table><tbody><tr><td></td></tr><tr><td><span style="" id="text_21" class="text">'+values["label"]+'</span></td></tr><tr><td></td></tr></tbody></table>'
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
//$("#simplevalue_" + idItem)
|
||||
//.html($('<img></img>').attr('src', "images/spinner.gif"));
|
||||
setModuleValue(idItem,values['process_simple_value'], values['period']);
|
||||
setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']);
|
||||
break;
|
||||
case 'label':
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
break;
|
||||
case 'icon':
|
||||
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
$("#image_" + idItem).attr('src', "images/spinner.gif");
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
if($('input[name=height]').val() == ''){
|
||||
alert('Undefined height');
|
||||
return false;
|
||||
}
|
||||
$("#image_" + idItem).attr('src', "images/spinner.gif");
|
||||
if ((values['width'] == 0) || (values['height'] == 0)) {
|
||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', 70);
|
||||
$("#image_" + idItem).attr('height', 70);
|
||||
$("#image_" + idItem).css('width', '70px');
|
||||
$("#image_" + idItem).css('height', '70px');
|
||||
}
|
||||
else{
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
||||
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', 70);
|
||||
$("#image_" + idItem).attr('height', 70);
|
||||
$("#image_" + idItem).css('width', '70px');
|
||||
$("#image_" + idItem).css('height', '70px');
|
||||
}
|
||||
else{
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
|
||||
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
|
||||
$("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#image_" + idItem).removeAttr('width');
|
||||
$("#image_" + idItem).removeAttr('height');
|
||||
$("#image_" + idItem).attr('width', values['width']);
|
||||
$("#image_" + idItem).attr('height', values['height']);
|
||||
$("#image_" + idItem).css('width', values['width'] + 'px');
|
||||
$("#image_" + idItem).css('height', values['height'] + 'px');
|
||||
}
|
||||
$("#image_" + idItem).attr('width', values['width']);
|
||||
$("#image_" + idItem).attr('height', values['height']);
|
||||
$("#image_" + idItem).css('width', values['width'] + 'px');
|
||||
$("#image_" + idItem).css('height', values['height'] + 'px');
|
||||
}
|
||||
var image = values['image'] + ".png";
|
||||
set_image("image", idItem, image);
|
||||
break;
|
||||
@ -510,14 +577,24 @@ function readFields() {
|
||||
values['process_simple_value'] = $("select[name=process_value]").val();
|
||||
values['background'] = $("#background_image").val();
|
||||
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period").val();
|
||||
if (values['period'] == null) {
|
||||
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period_select").val();
|
||||
}
|
||||
values['width'] = $("input[name=width]").val();
|
||||
values['width_data_image'] = $("#data_image_width").val();
|
||||
if(selectedItem == 'simple_value' || creationItem == 'simple_value'){
|
||||
if(values['width_data_image'] != 0){
|
||||
values['width'] = values['width_data_image'];
|
||||
}
|
||||
}
|
||||
values['height'] = $("input[name=height]").val();
|
||||
values['parent'] = $("select[name=parent]").val();
|
||||
values['map_linked'] = $("select[name=map_linked]").val();
|
||||
values['width_percentile'] = $("input[name=width_percentile]").val();
|
||||
values['max_percentile'] = $("input[name=max_percentile]").val();
|
||||
values['max_percentile'] = parseInt($("input[name=max_percentile]").val());
|
||||
values['width_module_graph'] = $("input[name=width_module_graph]").val();
|
||||
values['height_module_graph'] = $("input[name=height_module_graph]").val();
|
||||
values['event_max_time_row'] = $("select[name=event_max_time_row]").val();
|
||||
values['type_percentile'] = $("input[name=type_percentile]:checked").val();
|
||||
values['value_show'] = $("input[name=value_show]:checked").val();
|
||||
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
|
||||
@ -563,14 +640,14 @@ function create_button_palette_callback() {
|
||||
var validate = true;
|
||||
switch (creationItem) {
|
||||
case 'box_item':
|
||||
if (($("input[name='width_box']").val() == '')) {
|
||||
alert('Undefined width');
|
||||
validate = false;
|
||||
}
|
||||
if (($("input[name='height_box']").val() == '')) {
|
||||
alert('Undefined height');
|
||||
validate = false;
|
||||
}
|
||||
if (($("input[name='width_box']").val() == '')) {
|
||||
alert('Undefined width');
|
||||
validate = false;
|
||||
}
|
||||
if (($("input[name='height_box']").val() == '')) {
|
||||
alert('Undefined height');
|
||||
validate = false;
|
||||
}
|
||||
break;
|
||||
case 'group_item':
|
||||
case 'static_graph':
|
||||
@ -587,6 +664,16 @@ function create_button_palette_callback() {
|
||||
validate = false;
|
||||
}
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
if ((values['agent'] == '')) {
|
||||
alert($("#message_alert_no_agent").html());
|
||||
validate = false;
|
||||
}
|
||||
if ((values['module'] == 0)) {
|
||||
alert($("#message_alert_no_module").html());
|
||||
validate = false;
|
||||
}
|
||||
break;
|
||||
case 'label':
|
||||
if ((values['label'] == '')) {
|
||||
alert($("#message_alert_no_label").html());
|
||||
@ -630,7 +717,7 @@ function create_button_palette_callback() {
|
||||
validate = false;
|
||||
}
|
||||
break;
|
||||
case 'module_graph':
|
||||
case 'module_graph':
|
||||
if (values['width_module_graph'] == '') {
|
||||
alert('Undefined width');
|
||||
validate = false;
|
||||
@ -678,6 +765,7 @@ function create_button_palette_callback() {
|
||||
create_line('step_1', values);
|
||||
break;
|
||||
default:
|
||||
|
||||
insertDB(creationItem, values);
|
||||
break;
|
||||
}
|
||||
@ -861,6 +949,7 @@ function toggle_item_palette() {
|
||||
activeToolboxButton('group_item', true);
|
||||
activeToolboxButton('box_item', true);
|
||||
activeToolboxButton('line_item', true);
|
||||
activeToolboxButton('auto_sla_graph', true);
|
||||
|
||||
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
||||
enterprise_activeToolboxButton(true);
|
||||
@ -880,6 +969,7 @@ function toggle_item_palette() {
|
||||
|
||||
activeToolboxButton('static_graph', false);
|
||||
activeToolboxButton('module_graph', false);
|
||||
activeToolboxButton('auto_sla_graph', false);
|
||||
activeToolboxButton('simple_value', false);
|
||||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
@ -956,6 +1046,14 @@ function toggle_item_palette() {
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).css("background","lightgray");
|
||||
|
||||
}
|
||||
|
||||
if(creationItem != 'simple_value'){
|
||||
$("#data_image_check").html('Off');
|
||||
$("#data_image_check").css('display','none');
|
||||
$("#data_image_check_label").css('display','none');
|
||||
$("#data_image_container").css('display','none');
|
||||
$('.block_tinymce').remove();
|
||||
}
|
||||
}
|
||||
|
||||
function fill_parent_select(id_item) {
|
||||
@ -1012,6 +1110,8 @@ function loadFieldsFromDB(item) {
|
||||
fill_parent_select(idItem);
|
||||
|
||||
jQuery.each(data, function(key, val) {
|
||||
if (key == 'event_max_time_row')
|
||||
$("select[name=event_max_time_row]").val(val);
|
||||
if (key == 'background')
|
||||
$("#background_image").val(val);
|
||||
if (key == 'width') $("input[name=width]").val(val);
|
||||
@ -1346,6 +1446,9 @@ function hiddenFields(item) {
|
||||
$("#process_value_row").css('display', 'none');
|
||||
$("#process_value_row." + item).css('display', '');
|
||||
|
||||
$("#event_max_time_row").css('display', 'none');
|
||||
$("#event_max_time_row." + item).css('display', '');
|
||||
|
||||
$("#background_row_1").css('display', 'none');
|
||||
$("#background_row_1." + item).css('display', '');
|
||||
|
||||
@ -1518,7 +1621,6 @@ function set_static_graph_status(idElement, image, status) {
|
||||
data: parameter,
|
||||
success: function (data) {
|
||||
set_static_graph_status(idElement, image, data);
|
||||
|
||||
if($('#'+idElement+' table').css('float') == 'right' || $('#'+idElement+ ' table').css('float') == 'left'){
|
||||
$('#'+idElement+ ' img').css('margin-top', parseInt($('#'+idElement).css('height'))/2 - parseInt($('#'+idElement+ ' img').css('height'))/2);
|
||||
}
|
||||
@ -1554,7 +1656,6 @@ function set_static_graph_status(idElement, image, status) {
|
||||
suffix = ".png";
|
||||
break;
|
||||
}
|
||||
|
||||
set_image("image", idElement, image + suffix);
|
||||
}
|
||||
|
||||
@ -1678,12 +1779,13 @@ function setModuleGraph(id_data) {
|
||||
|
||||
}
|
||||
|
||||
function setModuleValue(id_data, process_simple_value, period) {
|
||||
function setModuleValue(id_data, process_simple_value, period,width_data_image) {
|
||||
var parameter = Array();
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "get_module_value"});
|
||||
parameter.push ({name: "id_element", value: id_data});
|
||||
parameter.push ({name: "period", value: period});
|
||||
parameter.push ({name: "width", value: width_data_image});
|
||||
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
||||
if (process_simple_value != undefined) {
|
||||
parameter.push ({name: "process_simple_value", value: process_simple_value});
|
||||
@ -1695,7 +1797,9 @@ function setModuleValue(id_data, process_simple_value, period) {
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
var currentValue = $("#text_" + id_data).html();
|
||||
|
||||
var currentValue = $("#text_" + id_data).html();
|
||||
|
||||
//currentValue = currentValue.replace(/_VALUE_/gi, data.value);
|
||||
$("#text_" + id_data).html(currentValue);
|
||||
//$("#text_" + id_data).html('Data value');
|
||||
@ -1780,6 +1884,55 @@ function setPercentileBar(id_data, values) {
|
||||
});
|
||||
}
|
||||
|
||||
function setEventsBar(id_data, values) {
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
url_hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "get_module_events"});
|
||||
parameter.push ({name: "id_agent", value: values['id_agent']});
|
||||
parameter.push ({name: "id_agent_module", value: values['module']});
|
||||
if (is_metaconsole()) {
|
||||
parameter.push ({name: "id_metaconsole", value: id_metaconsole});
|
||||
}
|
||||
parameter.push ({name: "period", value: values['event_max_time_row']});
|
||||
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
||||
jQuery.ajax({
|
||||
url: get_url_ajax(),
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data['no_data'] == true) {
|
||||
if (values['width'] == "0" || values['height'] == "0") {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/module-events.png');
|
||||
}
|
||||
else {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/module-events.png');
|
||||
$("#" + id_data + " img").css('width', values['width'] + 'px');
|
||||
$("#" + id_data + " img").css('height', values['height'] + 'px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/module-events.png');
|
||||
|
||||
if($('#text-width').val() == 0 || $('#text-height').val() == 0){
|
||||
$("#" + id_data + " img").css('width', '300px');
|
||||
$("#" + id_data + " img").css('height', '180px');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('width', $('#text-width').val()+'px');
|
||||
$("#" + id_data + " img").css('height', $('#text-height').val()+'px');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setPercentileBubble(id_data, values) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
@ -2025,6 +2178,10 @@ function createItem(type, values, id_data) {
|
||||
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
|
||||
$image.attr('width', '70')
|
||||
.attr('height', '70');
|
||||
}
|
||||
else{
|
||||
$image.attr('width', $('#preview > img')[0].naturalWidth)
|
||||
.attr('height', $('#preview > img')[0].naturalHeight);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -2091,6 +2248,17 @@ function createItem(type, values, id_data) {
|
||||
|
||||
set_static_graph_status(id_data, values['image']);
|
||||
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
var sizeStyle = '';
|
||||
var imageSize = '';
|
||||
item = $('<div id="' + id_data + '" class="item auto_sla_graph" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
setEventsBar(id_data, values);
|
||||
break;
|
||||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
@ -2206,10 +2374,14 @@ function createItem(type, values, id_data) {
|
||||
case 'simple_value':
|
||||
sizeStyle = '';
|
||||
imageSize = '';
|
||||
if($('#data_image_check').html() == 'On'){
|
||||
values['label'] = '<img style="width:'+$('#data_image_width').val()+'px;" src="images/console/signes/data_image.png">';
|
||||
|
||||
}
|
||||
item = $('<div id="' + id_data + '" class="item simple_value" style="position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<span id="text_' + id_data + '" class="text"> ' + values['label'] + '</span> ' + '</div>'
|
||||
);
|
||||
setModuleValue(id_data,values.process_simple_value,values.period);
|
||||
setModuleValue(id_data,values.process_simple_value,values.period,values.width_data_image);
|
||||
break;
|
||||
case 'label':
|
||||
item = $('<div id="' + id_data + '" ' +
|
||||
@ -2289,6 +2461,7 @@ function addItemSelectParents(id_data, text) {
|
||||
}
|
||||
|
||||
function insertDB(type, values) {
|
||||
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
$("#saving_in_progress_dialog").dialog({
|
||||
@ -2411,17 +2584,17 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
||||
set_static_graph_status(idElement, values['image']);
|
||||
|
||||
}
|
||||
break;
|
||||
case 'percentile_item':
|
||||
case 'simple_value':
|
||||
case 'label':
|
||||
case 'icon':
|
||||
case 'module_graph':
|
||||
|
||||
|
||||
case 'auto_sla_graph':
|
||||
if (type == 'simple_value') {
|
||||
setModuleValue(idElement,
|
||||
values.process_simple_value,
|
||||
values.period);
|
||||
values.period,values.width_data_image);
|
||||
}
|
||||
|
||||
|
||||
@ -2580,7 +2753,6 @@ function updateDB(type, idElement , values, event) {
|
||||
update_user_line(type, idElement, top, left);
|
||||
break;
|
||||
default:
|
||||
|
||||
if ((typeof(values['mov_left']) != 'undefined') &&
|
||||
(typeof(values['mov_top']) != 'undefined')) {
|
||||
top = parseInt($("#" + idElement)
|
||||
@ -2641,8 +2813,6 @@ function updateDB(type, idElement , values, event) {
|
||||
function copyDB(idItem) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
|
||||
|
||||
parameter = Array();
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "copy"});
|
||||
@ -2813,6 +2983,15 @@ function eventsItems(drag) {
|
||||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('auto_sla_graph')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'auto_sla_graph';
|
||||
idItem = $(divParent).attr('id');
|
||||
activeToolboxButton('copy_item', true);
|
||||
activeToolboxButton('edit_item', true);
|
||||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('group_item')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'group_item';
|
||||
@ -2900,6 +3079,39 @@ function eventsItems(drag) {
|
||||
if ((!is_opened_palette) && (autosave)) {
|
||||
toggle_item_palette();
|
||||
}
|
||||
|
||||
if(selectedItem == 'simple_value'){
|
||||
$('#data_image_width').val(event.currentTarget.clientWidth);
|
||||
var found = $('#'+idItem).find("img");
|
||||
|
||||
if(found.length > 0){
|
||||
$("#data_image_check").css('display','inline');
|
||||
$("#data_image_check_label").css('display','inline');
|
||||
$('#data_image_container').css('display','inline');
|
||||
$("#data_image_check").html('On');
|
||||
$('.block_tinymce').remove();
|
||||
$('#label_row').append('<div class="block_tinymce" style="background-color:#fbfbfb;position:absolute;left:0px;height:230px;width:100%;opacity:0.7;z-index:5;"></div>');
|
||||
$('#process_value_row').css('display','none');
|
||||
$('#period_row').css('display','none');
|
||||
}
|
||||
else{
|
||||
$("#data_image_check").html('Off');
|
||||
$("#data_image_check").css('display','none');
|
||||
$("#data_image_check_label").css('display','none');
|
||||
$('#data_image_container').css('display','none');
|
||||
$('.block_tinymce').remove();
|
||||
$('#process_value_row').css('display','table-row');
|
||||
if($('#process_value').val() != 0){
|
||||
$('#period_row').css('display','table-row');
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
$("#data_image_check").css('display','none');
|
||||
$("#data_image_check_label").css('display','none');
|
||||
$('#data_image_container').css('display','none');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//Set the limit of draggable in the div with id "background" and set drag
|
||||
@ -2920,6 +3132,9 @@ function eventsItems(drag) {
|
||||
if ($(event.target).hasClass('static_graph')) {
|
||||
selectedItem = 'static_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('auto_sla_graph')) {
|
||||
selectedItem = 'auto_sla_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('group_item')) {
|
||||
selectedItem = 'group_item';
|
||||
}
|
||||
@ -3218,12 +3433,17 @@ function click_button_toolbox(id) {
|
||||
toolbuttonActive = creationItem = 'module_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
toolbuttonActive = creationItem = 'auto_sla_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'simple_value':
|
||||
toolbuttonActive = creationItem = 'simple_value';
|
||||
toggle_item_palette();
|
||||
$("#period_row." + id).css('display', 'none');
|
||||
break;
|
||||
case 'label':
|
||||
$("#data_image_width").val(100);
|
||||
toolbuttonActive = creationItem = 'label';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
@ -3273,7 +3493,7 @@ function click_button_toolbox(id) {
|
||||
activeToolboxButton('icon', false);
|
||||
activeToolboxButton('service', false);
|
||||
activeToolboxButton('group_item', false);
|
||||
|
||||
activeToolboxButton('auto_sla_graph', false);
|
||||
activeToolboxButton('copy_item', false);
|
||||
activeToolboxButton('edit_item', false);
|
||||
activeToolboxButton('delete_item', false);
|
||||
@ -3303,6 +3523,7 @@ function click_button_toolbox(id) {
|
||||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
activeToolboxButton('group_item', true);
|
||||
activeToolboxButton('auto_sla_graph', true);
|
||||
}
|
||||
break;
|
||||
case 'save_visualmap':
|
||||
@ -3509,4 +3730,4 @@ function showGrid() {
|
||||
|
||||
eventsItems();
|
||||
}
|
||||
}
|
||||
}
|
@ -152,6 +152,11 @@ foreach ($layoutDatas as $layoutData) {
|
||||
html_print_image('images/chart_curve.png', true,
|
||||
array('title' => __('Module Graph')));
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
$table->data[$i + 1]['icon'] =
|
||||
html_print_image('images/auto_sla_graph.png', true,
|
||||
array('title' => __('Auto SLA Graph')));
|
||||
break;
|
||||
case SIMPLE_VALUE:
|
||||
$table->data[$i + 1]['icon'] =
|
||||
html_print_image('images/binary.png', true,
|
||||
@ -465,6 +470,7 @@ foreach ($layoutDatas as $layoutData) {
|
||||
switch ($layoutData['type']) {
|
||||
case LINE_ITEM:
|
||||
case BOX_ITEM:
|
||||
case AUTO_SLA_GRAPH:
|
||||
$table->data[$i + 2][4] = "";
|
||||
break;
|
||||
default:
|
||||
|
@ -51,7 +51,8 @@ if (is_ajax ()) {
|
||||
$row['control'] = __('Yes').' '.html_print_radio_button('fallback_local_auth', 1, '', $config['fallback_local_auth'], true).' ';
|
||||
$row['control'] .= __('No').' '.html_print_radio_button('fallback_local_auth', 0, '', $config['fallback_local_auth'], true);
|
||||
$table->data['fallback_local_auth'] = $row;
|
||||
|
||||
|
||||
if (enterprise_installed()) {
|
||||
// Autocreate remote users
|
||||
$row = array();
|
||||
$row['name'] = __('Autocreate remote users');
|
||||
@ -59,8 +60,7 @@ if (is_ajax ()) {
|
||||
$row['control'] .= __('No').' '.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true);
|
||||
$table->data['autocreate_remote_users'] = $row;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
add_enterprise_auth_autocreate_profiles($table, $type_auth);
|
||||
add_enterprise_auth_autocreate_profiles($table, $type_auth);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,8 +221,6 @@ if (($filter_group == 0) && ($filter_search == '')) {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = "databox filters";
|
||||
if(defined('METACONSOLE'))
|
||||
$table->class = "databox_filters";
|
||||
$table->rowclass[0] = '';
|
||||
$table->data[0][0] = '<b>' . __('Group') . '</b>';
|
||||
$table->data[0][1] = html_print_select_groups(false, "AR", true,
|
||||
@ -496,3 +494,10 @@ echo '</div>';
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
console.log('sknknan');
|
||||
// text-filter_search
|
||||
});
|
||||
</script>
|
||||
|
||||
|
BIN
pandora_console/images/auto_sla_graph.disabled.png
Normal file
BIN
pandora_console/images/auto_sla_graph.disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 B |
BIN
pandora_console/images/auto_sla_graph.png
Normal file
BIN
pandora_console/images/auto_sla_graph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 B |
BIN
pandora_console/images/console/signes/data_image.png
Normal file
BIN
pandora_console/images/console/signes/data_image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
pandora_console/images/console/signes/module-events.png
Normal file
BIN
pandora_console/images/console/signes/module-events.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
BIN
pandora_console/images/image_problem_area.png
Normal file
BIN
pandora_console/images/image_problem_area.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
pandora_console/images/spinner_green.gif
Normal file
BIN
pandora_console/images/spinner_green.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
@ -162,12 +162,12 @@ if ($get_graphs){
|
||||
tagente_modulo WHERE id_agente_modulo = ". $value['id_agent_module']);
|
||||
$sql_alias = db_get_all_rows_sql("SELECT alias from tagente
|
||||
WHERE id_agente = ". $sql_modulo[0]['id_agente']);
|
||||
$table .= "<div style='width: 800px'><h4>AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."</h4><hr></div>";
|
||||
$table .= "<div style='width: 90%'><h4>AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."</h4><hr></div>";
|
||||
$table .= grafico_modulo_sparse(
|
||||
$value['id_agent_module'],
|
||||
$value['time_lapse'],
|
||||
0,
|
||||
800,
|
||||
1000,
|
||||
300,
|
||||
'',
|
||||
'',
|
||||
@ -225,11 +225,11 @@ if ($get_graphs){
|
||||
} else {
|
||||
$height = 300;
|
||||
}
|
||||
$table .= "<div style='width: 800px'><h4>CUSTOM GRAPH ".$graph[0]['name']."</h4><hr></div>";
|
||||
$table .= "<div style='width: 90%'><h4>".$graph[0]['name']."</h4><hr></div>";
|
||||
$table .= graphic_combined_module($modules,
|
||||
$weights,
|
||||
$value['time_lapse'],
|
||||
800,
|
||||
1000,
|
||||
$height,
|
||||
'',
|
||||
'',
|
||||
@ -259,8 +259,10 @@ if ($get_graphs){
|
||||
}
|
||||
break;
|
||||
case 'dynamic_graph':
|
||||
$alias = " AND alias like '%".io_safe_output($value['agent'])."%'";
|
||||
|
||||
if($value['agent'] != ''){
|
||||
$alias = " AND alias REGEXP '".$value['agent']."'";
|
||||
}
|
||||
|
||||
if($value['id_group'] === '0'){
|
||||
$id_group = "";
|
||||
} else {
|
||||
@ -281,8 +283,10 @@ if ($get_graphs){
|
||||
$id_tag = " AND ttag_module.id_tag = ".$value['id_tag'];
|
||||
}
|
||||
|
||||
$module_name = " AND nombre like '%".io_safe_output($value['module'])."%'";
|
||||
|
||||
if($value['module'] != ''){
|
||||
$module_name = " AND nombre REGEXP '".$value['module']."'";
|
||||
}
|
||||
|
||||
$id_agent_module = db_get_all_rows_sql("SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo
|
||||
". $tag . "WHERE 1=1" . $id_module_group . $module_name .
|
||||
" AND id_agente IN (SELECT id_agente FROM tagente WHERE 1=1" .$alias.$id_group.")"
|
||||
@ -296,13 +300,13 @@ if ($get_graphs){
|
||||
$sql_alias2 = db_get_all_rows_sql("SELECT alias from tagente
|
||||
WHERE id_agente = ". $sql_modulo2[0]['id_agente']);
|
||||
|
||||
$table .= "<div style='width: 800px'><h4>AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."</h4><hr></div>";
|
||||
$table .= "<div style='width: 90%'><h4>AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."</h4><hr></div>";
|
||||
|
||||
$table .= grafico_modulo_sparse(
|
||||
$value2['id_agente_modulo'],
|
||||
$value['time_lapse'],
|
||||
0,
|
||||
800,
|
||||
1000,
|
||||
300,
|
||||
'',
|
||||
'',
|
||||
|
@ -268,21 +268,16 @@ if ($get_module_detail) {
|
||||
foreach ($columns as $col => $attr) {
|
||||
if ($attr[1] != "modules_format_data") {
|
||||
$data[] = date('d F Y h:i:s A', $row['utimestamp']);
|
||||
|
||||
}
|
||||
elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
|
||||
// Its a single-data, multiline data (data snapshot) ?
|
||||
|
||||
|
||||
// Detect string data with \n and convert to <br>'s
|
||||
$datos = $row[$attr[0]];
|
||||
//$datos = preg_replace ('/\n/i','<br>',$row[$attr[0]]);
|
||||
//$datos = preg_replace ('/\s/i',' ',$datos);
|
||||
|
||||
// Because this *SHIT* of print_table monster, I cannot format properly this cells
|
||||
// so, eat this, motherfucker :))
|
||||
|
||||
$datos = io_safe_input($datos);
|
||||
$datos = preg_replace("/\n/", "</br></br>", $datos);
|
||||
|
||||
// I dont why, but using index (value) method, data is automatically converted to html entities ¿?
|
||||
$data[] = $datos;
|
||||
@ -290,7 +285,6 @@ if ($get_module_detail) {
|
||||
elseif ($is_web_content_string) {
|
||||
//Fixed the goliat sends the strings from web
|
||||
//without HTML entities
|
||||
|
||||
$data[] = io_safe_input($row[$attr[0]]);
|
||||
}
|
||||
else {
|
||||
@ -301,9 +295,6 @@ if ($get_module_detail) {
|
||||
$data[] = io_safe_input($row[$attr[0]]);
|
||||
}
|
||||
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
|
||||
|
||||
//~ $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
|
||||
//~ $data[] = (double) $row[$attr[0]];
|
||||
switch($row['module_type']) {
|
||||
case 15:
|
||||
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
|
||||
@ -328,17 +319,12 @@ if ($get_module_detail) {
|
||||
$data[] = 'No data';
|
||||
}
|
||||
else {
|
||||
|
||||
if(is_snapshot_data($row[$attr[0]])){
|
||||
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
|
||||
}
|
||||
else{
|
||||
$data[] = $row[$attr[0]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(is_snapshot_data($row[$attr[0]])){
|
||||
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
|
||||
}
|
||||
else{
|
||||
$data[] = $row[$attr[0]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
126
pandora_console/include/ajax/snmp_browser.ajax.php
Normal file
126
pandora_console/include/ajax/snmp_browser.ajax.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
//Pandora FMS- http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2017 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
include_once($config['homedir'] . "/include/functions_config.php");
|
||||
include_once($config['homedir'] . "/include/functions_snmp_browser.php");
|
||||
require_once ($config['homedir'] . '/include/functions_network_components.php');
|
||||
|
||||
global $config;
|
||||
|
||||
if(is_ajax()){
|
||||
ob_clean();
|
||||
$action = (string) get_parameter ("action", "");
|
||||
$target_ip = (string) get_parameter ("target_ip", '');
|
||||
$community = (string) get_parameter ("community", '');
|
||||
$snmp_version = (string) get_parameter ("snmp_browser_version", '');
|
||||
$snmp3_auth_user = get_parameter('snmp3_browser_auth_user');
|
||||
$snmp3_security_level = get_parameter('snmp3_browser_security_level');
|
||||
$snmp3_auth_method = get_parameter('snmp3_browser_auth_method');
|
||||
$snmp3_auth_pass = get_parameter('snmp3_browser_auth_pass');
|
||||
$snmp3_privacy_method = get_parameter('snmp3_browser_privacy_method');
|
||||
$snmp3_privacy_pass = get_parameter('snmp3_browser_privacy_pass');
|
||||
|
||||
$targets_oids = get_parameter ("oids", "");
|
||||
$targets_oids = explode(",", $targets_oids);
|
||||
|
||||
|
||||
$custom_action = get_parameter ("custom_action", "");
|
||||
if ($custom_action != "") {
|
||||
$custom_action = urldecode (base64_decode ($custom_action));
|
||||
}
|
||||
if($action == 'create_modules_snmp'){
|
||||
$fail_modules = array();
|
||||
foreach ($targets_oids as $key => $target_oid) {
|
||||
$oid = snmp_browser_get_oid ($target_ip, $community,
|
||||
htmlspecialchars_decode($target_oid), $snmp_version, $snmp3_auth_user,
|
||||
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
|
||||
$snmp3_privacy_method, $snmp3_privacy_pass);
|
||||
|
||||
|
||||
$name_check = db_get_value ('name', 'tnetwork_component',
|
||||
'name', $oid['oid']);
|
||||
|
||||
if(empty($oid['description'])) {
|
||||
$description = '';
|
||||
} else {
|
||||
$description = io_safe_input($oid['description']);
|
||||
}
|
||||
|
||||
if(!$name_check){
|
||||
$id = network_components_create_network_component ($oid['oid'],17,1,
|
||||
array ('description' => $description,
|
||||
'module_interval' => 300,
|
||||
'max' => 0,
|
||||
'min' => 0,
|
||||
'tcp_send' => $snmp_version,
|
||||
'tcp_rcv' => '',
|
||||
'tcp_port' => 0,
|
||||
'snmp_oid' => $oid['numeric_oid'],
|
||||
'snmp_community' => $community,
|
||||
'id_module_group' => 3,
|
||||
'id_modulo' => 2,
|
||||
'id_plugin' => 0,
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '',
|
||||
'plugin_parameter' => '',
|
||||
'macros' => '',
|
||||
'max_timeout' => 0,
|
||||
'max_retries' => 0,
|
||||
'history_data' => '',
|
||||
'dynamic_interval' => 0,
|
||||
'dynamic_max' => 0,
|
||||
'dynamic_min' => 0,
|
||||
'dynamic_two_tailed' => 0,
|
||||
'min_warning' => 0,
|
||||
'max_warning' => 0,
|
||||
'str_warning' => '',
|
||||
'min_critical' => 0,
|
||||
'max_critical' => 0,
|
||||
'str_critical' => '',
|
||||
'min_ff_event' => 0,
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'post_process' => 0,
|
||||
'unit' => '',
|
||||
'wizard_level' => 'nowizard',
|
||||
'macros' => '',
|
||||
'critical_instructions' => '',
|
||||
'warning_instructions' => '',
|
||||
'unknown_instructions' => '',
|
||||
'critical_inverse' => 0,
|
||||
'warning_inverse' => 0,
|
||||
'id_category' => 0,
|
||||
'tags' => '',
|
||||
'disabled_types_event' => '{"going_unknown":1}',
|
||||
'min_ff_event_normal' => 0,
|
||||
'min_ff_event_warning' => 0,
|
||||
'min_ff_event_critical' => 0,
|
||||
'each_ff' => 0));
|
||||
}
|
||||
|
||||
if(empty($id)) {
|
||||
array_push($fail_modules,$name_check);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($fail_modules);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
@ -95,6 +95,7 @@ $top = get_parameter('top', null);
|
||||
$agent = get_parameter('agent', null);
|
||||
$id_module = get_parameter('module', null);
|
||||
$period = get_parameter('period', null);
|
||||
$event_max_time_row = get_parameter('event_max_time_row', null);
|
||||
$width = get_parameter('width', null);
|
||||
$height = get_parameter('height', null);
|
||||
$parent = get_parameter('parent', null);
|
||||
@ -139,7 +140,39 @@ switch ($action) {
|
||||
echo json_encode($return);
|
||||
break;
|
||||
|
||||
|
||||
case 'get_module_events':
|
||||
$data = array ();
|
||||
|
||||
$date = get_system_time ();
|
||||
$datelimit = $date - $event_max_time_row;
|
||||
|
||||
$events = db_get_row_filter ('tevento',
|
||||
array ('id_agente' => $id_agent,
|
||||
'id_agentmodule' => $id_module,
|
||||
'utimestamp > ' . $datelimit,
|
||||
'utimestamp < ' . $date), 'criticity, utimestamp');
|
||||
|
||||
$return = array();
|
||||
if (!$events) {
|
||||
$return['no_data'] = true;
|
||||
if (!empty($id_metaconsole)) {
|
||||
$connection = db_get_row_filter ('tmetaconsole_setup',
|
||||
$id_metaconsole);
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$return['url'] = true;
|
||||
if (!empty($id_metaconsole)) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$return['no_data'] = false;
|
||||
}
|
||||
|
||||
echo json_encode($return);
|
||||
break;
|
||||
|
||||
case 'get_image_sparse':
|
||||
//Metaconsole db connection
|
||||
@ -422,6 +455,7 @@ switch ($action) {
|
||||
$values['type'] = visual_map_get_simple_value_type(
|
||||
$process_simple_value);
|
||||
$values['period'] = $period;
|
||||
$values['width'] = $width;
|
||||
}
|
||||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
@ -429,6 +463,7 @@ switch ($action) {
|
||||
case 'module_graph':
|
||||
case 'label':
|
||||
case 'icon':
|
||||
case 'auto_sla_graph':
|
||||
default:
|
||||
if ($type == 'label') {
|
||||
$values['type'] = LABEL;
|
||||
@ -503,6 +538,18 @@ switch ($action) {
|
||||
$values['border_color'] = $line_color;
|
||||
break;
|
||||
// -------------------------------------------------
|
||||
case 'auto_sla_graph':
|
||||
$values['type'] = AUTO_SLA_GRAPH;
|
||||
if ($event_max_time_row !== null) {
|
||||
$values['period'] = $event_max_time_row;
|
||||
}
|
||||
if ($width !== null) {
|
||||
$values['width'] = $width;
|
||||
}
|
||||
if ($height !== null) {
|
||||
$values['height'] = $height;
|
||||
}
|
||||
break;
|
||||
case 'box_item':
|
||||
$values['border_width'] = $border_width;
|
||||
$values['border_color'] = $border_color;
|
||||
@ -621,7 +668,7 @@ switch ($action) {
|
||||
if (($item_in_db['parent_item'] == 0) && ($values['parent_item'] != 0)) {
|
||||
$new_line = 1;
|
||||
}
|
||||
|
||||
|
||||
$result = db_process_sql_update('tlayout_data', $values,
|
||||
array('id' => $id_element));
|
||||
|
||||
@ -658,6 +705,7 @@ switch ($action) {
|
||||
case 'simple_value':
|
||||
case 'label':
|
||||
case 'icon':
|
||||
case 'auto_sla_graph':
|
||||
$elementFields = db_get_row_filter('tlayout_data',
|
||||
array('id' => $id_element));
|
||||
|
||||
@ -709,6 +757,8 @@ switch ($action) {
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'auto_sla_graph':
|
||||
$elementFields['event_max_time_row'] = $elementFields['period'];
|
||||
case 'percentile_item':
|
||||
case 'percentile_bar':
|
||||
$elementFields['width_percentile'] = $elementFields['width'];
|
||||
@ -868,6 +918,12 @@ switch ($action) {
|
||||
}
|
||||
$values['period'] = $period;
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
$values['type'] = AUTO_SLA_GRAPH;
|
||||
$values['period'] = $event_max_time_row;
|
||||
$values['width'] = $width;
|
||||
$values['height'] = $height;
|
||||
break;
|
||||
case 'percentile_item':
|
||||
case 'percentile_bar':
|
||||
if ($type_percentile == 'percentile') {
|
||||
@ -897,6 +953,7 @@ switch ($action) {
|
||||
//This allows min, max and avg process in a simple value
|
||||
$values['type'] = visual_map_get_simple_value_type($process_simple_value);
|
||||
$values['period'] = $period;
|
||||
$values['width'] = $width;
|
||||
break;
|
||||
case 'label':
|
||||
$values['type'] = LABEL;
|
||||
@ -983,8 +1040,6 @@ switch ($action) {
|
||||
echo json_encode($return);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'delete':
|
||||
if (db_process_sql_delete('tlayout_data', array('id' => $id_element, 'id_layout' => $id_visual_console)) === false) {
|
||||
$return['correct'] = 0;
|
||||
|
@ -22,8 +22,8 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC170710';
|
||||
$pandora_version = 'v7.0NG.705';
|
||||
$build_version = 'PC170814';
|
||||
$pandora_version = 'v7.0NG.710';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
@ -252,7 +252,7 @@ if (isset($_POST['vc_refr'])) {
|
||||
|
||||
|
||||
//======= Autorefresh code =============================================
|
||||
$select = db_process_sql("SELECT value FROM tconfig WHERE token='autorefresh_white_list'");
|
||||
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
|
||||
$autorefresh_list = json_decode($select[0]['value']);
|
||||
$config['autorefresh_white_list'] = array();
|
||||
$config['autorefresh_white_list'] = $autorefresh_list;
|
||||
|
@ -185,6 +185,7 @@ define('AGENT_STATUS_WARNING', 2);
|
||||
define('STATIC_GRAPH', 0);
|
||||
define('PERCENTILE_BAR', 3);
|
||||
define('MODULE_GRAPH', 1);
|
||||
define('AUTO_SLA_GRAPH', 14);
|
||||
define('SIMPLE_VALUE', 2);
|
||||
define('LABEL', 4);
|
||||
define('ICON', 5);
|
||||
@ -467,6 +468,7 @@ define("OPTION_SINGLE_SELECT_TIME", 7);
|
||||
define("OPTION_CUSTOM_INPUT", 8);
|
||||
define("OPTION_AGENT_AUTOCOMPLETE", 9);
|
||||
define("OPTION_SELECT_MULTISELECTION", 10);
|
||||
define("OPTION_COLOR_PICKER", 11);
|
||||
|
||||
/* Transactional map constants */
|
||||
define("NODE_TYPE", 0);
|
||||
|
@ -2754,4 +2754,14 @@ function remove_right_zeros ($value) {
|
||||
}
|
||||
}
|
||||
|
||||
function register_pass_change_try ($id_user, $success) {
|
||||
$values = array();
|
||||
$values['id_user'] = $id_user;
|
||||
$reset_pass_moment = new DateTime('now');
|
||||
$reset_pass_moment = $reset_pass_moment->format("Y-m-d H:i:s");
|
||||
$values['reset_moment'] = $reset_pass_moment;
|
||||
$values['success'] = $success;
|
||||
db_process_sql_insert('treset_pass_history', $values);
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -1195,7 +1195,11 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3) {
|
||||
else {
|
||||
$cascadeProtectionModule = 0;
|
||||
}
|
||||
|
||||
|
||||
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agent);
|
||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$group_old);
|
||||
|
||||
$return = db_process_sql_update('tagente',
|
||||
array('alias' => $alias,
|
||||
'direccion' => $ip,
|
||||
@ -1216,6 +1220,40 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3) {
|
||||
// register ip for this agent in 'taddress'
|
||||
agents_add_address ($id_agent, $ip);
|
||||
}
|
||||
|
||||
if($return){
|
||||
if($tpolicy_group_old){
|
||||
foreach ($tpolicy_group_old as $key => $value) {
|
||||
$tpolicy_agents_old= db_get_sql("SELECT * FROM tpolicy_agents
|
||||
WHERE id_policy = ".$value['id_policy'] . " AND id_agent = " .$id_agent);
|
||||
|
||||
if($tpolicy_agents_old){
|
||||
$result2 = db_process_sql_update ('tpolicy_agents',
|
||||
array('pending_delete' => 1),
|
||||
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpolicy_group = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$idGroup);
|
||||
|
||||
if($tpolicy_group){
|
||||
foreach ($tpolicy_group as $key => $value) {
|
||||
$tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents
|
||||
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agent);
|
||||
|
||||
if(!$tpolicy_agents){
|
||||
db_process_sql_insert ('tpolicy_agents',
|
||||
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agent));
|
||||
} else {
|
||||
$result3 = db_process_sql_update ('tpolicy_agents',
|
||||
array('pending_delete' => 0),
|
||||
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
returnData('string',
|
||||
array('type' => 'string', 'data' => (int)((bool)$return)));
|
||||
@ -1339,7 +1377,19 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) {
|
||||
// register ip for this agent in 'taddress'
|
||||
agents_add_address ($idAgente, $ip);
|
||||
}
|
||||
|
||||
|
||||
if($idGroup && !empty($idAgente)){
|
||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||
WHERE id_group = ".$idGroup);
|
||||
|
||||
if($tpolicy_group_old){
|
||||
foreach ($tpolicy_group_old as $key => $old_group) {
|
||||
db_process_sql_insert ('tpolicy_agents',
|
||||
array('id_policy' => $old_group['id_policy'], 'id_agent' => $idAgente));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
returnData('string',
|
||||
array('type' => 'string', 'data' => $idAgente));
|
||||
}
|
||||
@ -9506,6 +9556,257 @@ function api_set_create_special_day($thrash1, $thrash2, $other, $thrash3) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a service and return service id.
|
||||
*
|
||||
* @param $thrash1 Don't use.
|
||||
* @param $thrash2 Don't use.
|
||||
* @param array $other it's array, $other as param is <description>;<id_group>;<critical>;
|
||||
* <warning>;<id_agent>;<sla_interval>;<sla_limit>;<id_warning_module_template_alert>;
|
||||
* <id_critical_module_template_alert>;<id_critical_module_sla_template_alert>;
|
||||
* in this order and separator char (after text ; ) and separator
|
||||
* (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* @param $thrash3 Don't use
|
||||
*
|
||||
* example:
|
||||
* http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_service&return_type=json
|
||||
* &other=test1%7CDescripcion de prueba%7C12%7C1%7C0.5%7C1&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
|
||||
*/
|
||||
function api_set_create_service($thrash1, $thrash2, $other, $thrash3) {
|
||||
|
||||
$name = $other['data'][0];
|
||||
$description = $other['data'][1];
|
||||
$id_group = $other['data'][2];
|
||||
$critical = $other['data'][3];
|
||||
$warning = $other['data'][4];
|
||||
$mode = 0;
|
||||
$id_agent = $other['data'][5];
|
||||
$sla_interval = $other['data'][6];
|
||||
$sla_limit = $other['data'][7];
|
||||
$id_warning_module_template = $other['data'][8];
|
||||
$id_critical_module_template = $other['data'][9];
|
||||
$id_unknown_module_template = 0;
|
||||
$id_critical_module_sla = $other['data'][10];
|
||||
|
||||
if(empty($name)){
|
||||
returnError('error_create_service', __('Error in creation service. No name'));
|
||||
return;
|
||||
}
|
||||
if(empty($id_group)){
|
||||
// By default applications
|
||||
$id_group = 12;
|
||||
}
|
||||
if(empty($critical)){
|
||||
$critical = 1;
|
||||
}
|
||||
if(empty($warning)){
|
||||
$warning = 0.5;
|
||||
}
|
||||
if(empty($id_agent)){
|
||||
returnError('error_create_service', __('Error in creation service. No agent id'));
|
||||
return;
|
||||
}
|
||||
if(empty($sla_interval)){
|
||||
// By default one month
|
||||
$sla_interval = 2592000;
|
||||
}
|
||||
if(empty($sla_limit)){
|
||||
$sla_limit = 95;
|
||||
}
|
||||
if(empty($id_warning_module_template)){
|
||||
$id_warning_module_template = 0;
|
||||
}
|
||||
if(empty($id_critical_module_template)){
|
||||
$id_critical_module_template = 0;
|
||||
}
|
||||
if(empty($id_critical_module_sla)){
|
||||
$id_critical_module_sla = 0;
|
||||
}
|
||||
|
||||
$result = services_create_service ($name, $description, $id_group,
|
||||
$critical, $warning, SECONDS_5MINUTES, $mode, $id_agent, $sla_interval, $sla_limit,
|
||||
$id_warning_module_template, $id_critical_module_template,
|
||||
$id_unknown_module_template, $id_critical_module_sla);
|
||||
|
||||
if($result){
|
||||
returnData('string', array('type' => 'string', 'data' => $result));
|
||||
} else {
|
||||
returnError('error_create_service', __('Error in creation service'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a service.
|
||||
*
|
||||
* @param $thrash1 service id.
|
||||
* @param $thrash2 Don't use.
|
||||
* @param array $other it's array, $other as param is <name>;<description>;<id_group>;<critical>;
|
||||
* <warning>;<id_agent>;<sla_interval>;<sla_limit>;<id_warning_module_template_alert>;
|
||||
* <id_critical_module_template_alert>;<id_critical_module_sla_template_alert>;
|
||||
* in this order and separator char (after text ; ) and separator
|
||||
* (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* @param $thrash3 Don't use
|
||||
*
|
||||
* example:
|
||||
* http://172.17.0.1/pandora_console/include/api.php?op=set&op2=update_service&return_type=json
|
||||
* &id=4&other=test2%7CDescripcion%7C%7C%7C0.6%7C&other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
|
||||
*
|
||||
*/
|
||||
function api_set_update_service($thrash1, $thrash2, $other, $thrash3) {
|
||||
|
||||
$id_service = $thrash1;
|
||||
if(empty($id_service)){
|
||||
returnError('error_update_service', __('Error in update service. No service id'));
|
||||
return;
|
||||
}
|
||||
|
||||
$service = db_get_row('tservice',
|
||||
'id', $id_service);
|
||||
|
||||
$name = $other['data'][0];
|
||||
if(empty($name)){
|
||||
$name = $service['name'];
|
||||
}
|
||||
$description = $other['data'][1];
|
||||
if(empty($description)){
|
||||
$description = $service['description'];
|
||||
}
|
||||
$id_group = $other['data'][2];
|
||||
if(empty($id_group)){
|
||||
$id_group = $service['id_group'];
|
||||
}
|
||||
$critical = $other['data'][3];
|
||||
if(empty($critical)){
|
||||
$critical = $service['critical'];
|
||||
}
|
||||
$warning = $other['data'][4];
|
||||
if(empty($warning)){
|
||||
$warning = $service['warning'];
|
||||
}
|
||||
|
||||
$mode = 0;
|
||||
|
||||
$id_agent = $other['data'][5];
|
||||
if(empty($id_agent)){
|
||||
$id_agent = $service['id_agent_module'];
|
||||
}
|
||||
$sla_interval = $other['data'][6];
|
||||
if(empty($sla_interval)){
|
||||
$sla_interval = $service['sla_interval'];
|
||||
}
|
||||
$sla_limit = $other['data'][7];
|
||||
if(empty($sla_limit)){
|
||||
$sla_limit = $service['sla_limit'];
|
||||
}
|
||||
$id_warning_module_template = $other['data'][8];
|
||||
if(empty($id_warning_module_template)){
|
||||
$id_warning_module_template = $service['id_template_alert_warning'];
|
||||
}
|
||||
$id_critical_module_template = $other['data'][9];
|
||||
if(empty($id_critical_module_template)){
|
||||
$id_critical_module_template = $service['id_template_alert_critical'];
|
||||
}
|
||||
|
||||
$id_unknown_module_template = 0;
|
||||
|
||||
$id_critical_module_sla = $other['data'][10];
|
||||
if(empty($id_critical_module_sla)){
|
||||
$id_critical_module_sla = $service['id_template_alert_critical_sla'];
|
||||
}
|
||||
|
||||
$result = services_update_service ($id_service, $name,$description, $id_group, $critical, $warning,
|
||||
SECONDS_5MINUTES, $mode, $id_agent,$sla_interval, $sla_limit,$id_warning_module_template,
|
||||
$id_critical_module_template,$id_unknown_module_template,$id_critical_module_sla);
|
||||
|
||||
|
||||
if($result){
|
||||
returnData('string', array('type' => 'string', 'data' => $result));
|
||||
} else {
|
||||
returnError('error_update_service', __('Error in update service'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add elements to service.
|
||||
*
|
||||
* @param $thrash1 service id.
|
||||
* @param $thrash2 Don't use.
|
||||
* @param array $other it's a json, $other as param is <description>;<id_group>;<critical>;
|
||||
* <warning>;<id_agent>;<sla_interval>;<sla_limit>;<id_warning_module_template_alert>;
|
||||
* <id_critical_module_template_alert>;<id_critical_module_sla_template_alert>;
|
||||
* in this order and separator char (after text ; ) and separator
|
||||
* (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* @param $thrash3 Don't use
|
||||
*
|
||||
* example:
|
||||
* http://172.17.0.1/pandora_console/include/api.php?op=set&op2=add_element_service&return_type=json&id=1
|
||||
* &other=W3sidHlwZSI6ImFnZW50IiwiaWQiOjIsImRlc2NyaXB0aW9uIjoiamlqaWppIiwid2VpZ2h0X2NyaXRpY2FsIjowLCJ3ZWlnaHRfd2FybmluZyI6MCwid2VpZ2h0X3Vua25vd24iOjAsIndlaWdodF9vayI6MH0seyJ0eXBlIjoibW9kdWxlIiwiaWQiOjEsImRlc2NyaXB0aW9uIjoiSG9sYSBxdWUgdGFsIiwid2VpZ2h0X2NyaXRpY2FsIjowLCJ3ZWlnaHRfd2FybmluZyI6MCwid2VpZ2h0X3Vua25vd24iOjAsIndlaWdodF9vayI6MH0seyJ0eXBlIjoic2VydmljZSIsImlkIjozLCJkZXNjcmlwdGlvbiI6ImplamVqZWplIiwid2VpZ2h0X2NyaXRpY2FsIjowLCJ3ZWlnaHRfd2FybmluZyI6MCwid2VpZ2h0X3Vua25vd24iOjAsIndlaWdodF9vayI6MH1d
|
||||
* &other_mode=url_encode_separator_%7C&apipass=1234&user=admin&pass=pandora
|
||||
*
|
||||
*/
|
||||
function api_set_add_element_service($thrash1, $thrash2, $other, $thrash3) {
|
||||
|
||||
$id = $thrash1;
|
||||
|
||||
if(empty($id)){
|
||||
returnError('error_add_service_element', __('Error adding elements to service. No service id'));
|
||||
return;
|
||||
}
|
||||
|
||||
$array_json = json_decode(base64_decode(io_safe_output($other['data'][0])), true);
|
||||
if(!empty($array_json)){
|
||||
$results = false;
|
||||
foreach ($array_json as $key => $element) {
|
||||
if($element['id'] == 0){
|
||||
continue;
|
||||
}
|
||||
switch ($element['type']) {
|
||||
case 'agent':
|
||||
$id_agente_modulo = 0;
|
||||
$id_service_child = 0;
|
||||
$agent_id = $element['id'];
|
||||
break;
|
||||
|
||||
case 'module':
|
||||
$agent_id = 0;
|
||||
$id_service_child = 0;
|
||||
$id_agente_modulo = $element['id'];
|
||||
break;
|
||||
|
||||
case 'service':
|
||||
$agent_id = 0;
|
||||
$id_agente_modulo = 0;
|
||||
$id_service_child = $element['id'];
|
||||
break;
|
||||
}
|
||||
|
||||
$values = array(
|
||||
'id_agente_modulo' => $id_agente_modulo,
|
||||
'description' => $element['description'],
|
||||
'id_service' => $id,
|
||||
'weight_critical' => $element['weight_critical'],
|
||||
'weight_warning' => $element['weight_warning'],
|
||||
'weight_unknown' => $element['weight_unknown'],
|
||||
'weight_ok' => $element['weight_ok'],
|
||||
'id_agent' => $agent_id,
|
||||
'id_service_child' => $id_service_child,
|
||||
'id_server_meta' => 0);
|
||||
|
||||
$result = db_process_sql_insert('tservice_element',$values);
|
||||
if($result && !$results){
|
||||
$results = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($results){
|
||||
returnData('string', array('type' => 'string', 'data' => 1));
|
||||
} else {
|
||||
returnError('error_add_service_element', __('Error adding elements to service'));
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Update a special day. And return a message with the result of the operation.
|
||||
*
|
||||
|
@ -855,9 +855,6 @@ function config_process_config () {
|
||||
config_update_value ('status_images_set', 'default');
|
||||
}
|
||||
|
||||
if(!isset ($config['autorefresh_white_list'])){
|
||||
config_update_value ('autorefresh_white_list', '');
|
||||
}
|
||||
// Load user session
|
||||
if (isset ($_SESSION['id_usuario']))
|
||||
$config["id_user"] = $_SESSION["id_usuario"];
|
||||
@ -1656,6 +1653,10 @@ function config_process_config () {
|
||||
config_update_value ('command_snapshot', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['custom_report_info'])) {
|
||||
config_update_value ('custom_report_info', 1);
|
||||
}
|
||||
|
||||
// Juanma (06/05/2014) New feature: Custom front page for reports
|
||||
if (!isset($config['custom_report_front'])) {
|
||||
config_update_value ('custom_report_front', 0);
|
||||
|
@ -164,7 +164,7 @@ function custom_graphs_print($id_graph, $height, $width, $period,
|
||||
$background_color = 'white', $modules_param = array(), $homeurl = '',
|
||||
$name_list = array(), $unit_list = array(), $show_last = true,
|
||||
$show_max = true, $show_min = true, $show_avg = true, $ttl = 1,
|
||||
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false) {
|
||||
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false,$id_widget_dashboard=false) {
|
||||
|
||||
global $config;
|
||||
|
||||
@ -260,7 +260,8 @@ function custom_graphs_print($id_graph, $height, $width, $period,
|
||||
$dashboard,
|
||||
$vconsole,
|
||||
$percentil,
|
||||
$from_interface);
|
||||
$from_interface,
|
||||
$id_widget_dashboard);
|
||||
|
||||
if ($return)
|
||||
return $output;
|
||||
|
@ -2115,7 +2115,7 @@ function events_page_details ($event, $server = "") {
|
||||
"type" => $graph_type,
|
||||
"period" => SECONDS_1DAY,
|
||||
"id" => $module["id_agente_modulo"],
|
||||
"label" => rawurlencode(urlencode(base64_encode($module["nombre"]))),
|
||||
"label" => base64_encode($module["nombre"]),
|
||||
"refresh" => SECONDS_10MINUTES
|
||||
);
|
||||
|
||||
|
@ -368,6 +368,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
|
||||
}
|
||||
}
|
||||
}
|
||||
EventZoomEnd(null,map.zoom);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -396,7 +397,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
||||
|
||||
last_time_of_data = Math.round(new Date().getTime() / 1000); //Unixtimestamp
|
||||
|
||||
//Test if the user change the refresh time.
|
||||
@ -405,11 +406,16 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
|
||||
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
|
||||
oldRefreshAjaxIntervalSeconds = refreshAjaxIntervalSeconds;
|
||||
}
|
||||
|
||||
EventZoomEnd(null,map.zoom);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready (
|
||||
function () {
|
||||
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
|
||||
EventZoomEnd(null,map.zoom);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
@ -867,7 +867,8 @@ 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', $fullscale = false) {
|
||||
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false,
|
||||
$id_widget_dashboard = false) {
|
||||
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
@ -932,8 +933,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
||||
$date, $unit, $baseline, $return_data, $show_title,
|
||||
$projection, $adapt_key, $compare, '', '', $show_unknown,
|
||||
$percentil, $dashboard, $vconsole, $type_graph, $fullscale);
|
||||
|
||||
|
||||
|
||||
if ($return_data) {
|
||||
return $data_returned;
|
||||
}
|
||||
@ -984,6 +984,13 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
||||
}
|
||||
else {
|
||||
// Color commented not to restrict serie colors
|
||||
if($id_widget_dashboard){
|
||||
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
|
||||
$color['min']['color'] = $opcion['min'];
|
||||
$color['sum']['color'] = $opcion['avg'];
|
||||
$color['max']['color'] = $opcion['max'];
|
||||
}
|
||||
|
||||
return
|
||||
area_graph($flash_chart, $chart, $width, $height, $color,
|
||||
$legend, $long_index,
|
||||
@ -1070,7 +1077,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
||||
$prediction_period = false, $background_color = 'white',
|
||||
$name_list = array(), $unit_list = array(), $show_last = true, $show_max = true,
|
||||
$show_min = true, $show_avg = true, $labels = array(), $dashboard = false,
|
||||
$vconsole = false, $percentil = null, $from_interface = false) {
|
||||
$vconsole = false, $percentil = null, $from_interface = false, $id_widget_dashboard=false) {
|
||||
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
@ -1085,25 +1092,25 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
||||
|
||||
// Set the title and time format
|
||||
if ($temp_range <= SECONDS_1DAY) {
|
||||
$time_format = 'd.m.Y H:i:s';
|
||||
$time_format = 'Y M d H:i:s';
|
||||
}
|
||||
elseif ($temp_range < SECONDS_15DAYS) {
|
||||
$time_format = 'M d';
|
||||
$time_format = 'Y M d';
|
||||
$time_format_2 = 'H:i';
|
||||
if ($projection != false) {
|
||||
$time_format_2 = 'H\h';
|
||||
}
|
||||
}
|
||||
elseif ($temp_range <= SECONDS_1MONTH) {
|
||||
$time_format = 'M d';
|
||||
$time_format = 'Y M d';
|
||||
$time_format_2 = 'H\h';
|
||||
}
|
||||
elseif ($temp_range <= SECONDS_1MONTH) {
|
||||
$time_format = 'M d';
|
||||
$time_format = 'Y M d';
|
||||
$time_format_2 = 'H\h';
|
||||
}
|
||||
}
|
||||
elseif ($period < SECONDS_6MONTHS) {
|
||||
$time_format = 'M d';
|
||||
$time_format = 'Y M d';
|
||||
$time_format_2 = 'H\h';
|
||||
}
|
||||
else {
|
||||
@ -1375,7 +1382,8 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
||||
|
||||
// Calculate chart data
|
||||
$last_known = $previous_data;
|
||||
for ($l = 0; $l < $resolution; $l++) {
|
||||
|
||||
for ($l = 0; $l <= $resolution; $l++) {
|
||||
$countAvg ++;
|
||||
|
||||
$timestamp = $datelimit + ($interval * $l);
|
||||
@ -1391,6 +1399,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
||||
// Read data that falls in the current interval
|
||||
$interval_min = $last_known;
|
||||
$interval_max = $last_known;
|
||||
|
||||
while (isset ($data[$j]) && $data[$j]['utimestamp'] >= $timestamp && $data[$j]['utimestamp'] < ($timestamp + $interval)) {
|
||||
if ($data[$j]['datos'] > $interval_max) {
|
||||
$interval_max = $data[$j]['datos'];
|
||||
@ -1905,6 +1914,15 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
||||
$color[15] = array('border' => '#000000',
|
||||
'color' => COL_GRAPH13,
|
||||
'alpha' => CHART_DEFAULT_ALPHA);
|
||||
|
||||
if($id_widget_dashboard){
|
||||
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
|
||||
foreach ($module_list as $key => $value) {
|
||||
if(!empty($opcion[$value])){
|
||||
$color[$key]['color'] = $opcion[$value];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$threshold_data = array();
|
||||
|
||||
@ -3565,7 +3583,7 @@ function graph_custom_sql_graph ($id, $width, $height,
|
||||
* @param string homeurl
|
||||
* @param bool return or echo the result
|
||||
*/
|
||||
function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $homeurl, $return = false) {
|
||||
function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $homeurl, $return = false, $from_agent_view = false) {
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
@ -3582,13 +3600,119 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
|
||||
$data = array ();
|
||||
$legend = array();
|
||||
$full_legend = array();
|
||||
$full_legend_date = array();
|
||||
|
||||
$cont = 0;
|
||||
for ($i = 0; $i < $interval; $i++) {
|
||||
$bottom = $datelimit + ($periodtime * $i);
|
||||
if (! $graphic_type) {
|
||||
if ($config['flash_charts']) {
|
||||
$name = date('H:i', $bottom);
|
||||
$name = date('H:i:s', $bottom);
|
||||
}
|
||||
else {
|
||||
$name = date('H\h', $bottom);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$name = $bottom;
|
||||
}
|
||||
|
||||
// Show less values in legend
|
||||
if ($cont == 0 or $cont % 2)
|
||||
$legend[$cont] = $name;
|
||||
|
||||
if ($from_agent_view) {
|
||||
$full_date = date('Y/m/d', $bottom);
|
||||
$full_legend_date[$cont] = $full_date;
|
||||
}
|
||||
|
||||
$full_legend[$cont] = $name;
|
||||
|
||||
$top = $datelimit + ($periodtime * ($i + 1));
|
||||
$event = db_get_row_filter ('tevento',
|
||||
array ('id_agente' => $id_agent,
|
||||
'utimestamp > '.$bottom,
|
||||
'utimestamp < '.$top), 'criticity, utimestamp');
|
||||
|
||||
if (!empty($event['utimestamp'])) {
|
||||
$data[$cont]['utimestamp'] = $periodtime;
|
||||
switch ($event['criticity']) {
|
||||
case EVENT_CRIT_WARNING:
|
||||
$data[$cont]['data'] = 2;
|
||||
break;
|
||||
case EVENT_CRIT_CRITICAL:
|
||||
$data[$cont]['data'] = 3;
|
||||
break;
|
||||
default:
|
||||
$data[$cont]['data'] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$data[$cont]['utimestamp'] = $periodtime;
|
||||
$data[$cont]['data'] = 1;
|
||||
}
|
||||
$cont++;
|
||||
}
|
||||
|
||||
$colors = array(1 => COL_NORMAL, 2 => COL_WARNING, 3 => COL_CRITICAL, 4 => COL_UNKNOWN);
|
||||
|
||||
// Draw slicebar graph
|
||||
if ($config['flash_charts']) {
|
||||
$out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent, $full_legend_date);
|
||||
}
|
||||
else {
|
||||
$out = slicesbar_graph($data, $period, $width, $height, $colors, $config['fontpath'], $config['round_corner'], $homeurl);
|
||||
|
||||
// Draw legend
|
||||
$out .= "<br>";
|
||||
$out .= " ";
|
||||
foreach ($legend as $hour) {
|
||||
$out .= "<span style='font-size: 6pt'>" . $hour . "</span>";
|
||||
$out .= " ";
|
||||
}
|
||||
}
|
||||
|
||||
if ($return) {
|
||||
return $out;
|
||||
}
|
||||
else {
|
||||
echo $out;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a static graph with event data of agents
|
||||
*
|
||||
* @param integer id_agent Agent ID
|
||||
* @param integer width pie graph width
|
||||
* @param integer height pie graph height
|
||||
* @param integer period time period
|
||||
* @param string homeurl
|
||||
* @param bool return or echo the result
|
||||
*/
|
||||
function graph_graphic_moduleevents ($id_agent, $id_module, $width, $height, $period = 0, $homeurl, $return = false) {
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
$data = array ();
|
||||
|
||||
$resolution = $config['graph_res'] * ($period * 2 / $width); // Number of "slices" we want in graph
|
||||
$interval = (int) ($period / $resolution);
|
||||
$date = get_system_time ();
|
||||
$datelimit = $date - $period;
|
||||
$periodtime = floor ($period / $interval);
|
||||
$time = array ();
|
||||
$data = array ();
|
||||
$legend = array();
|
||||
$full_legend = array();
|
||||
|
||||
$cont = 0;
|
||||
for ($i = 0; $i < $interval; $i++) {
|
||||
$bottom = $datelimit + ($periodtime * $i);
|
||||
if (! $graphic_type) {
|
||||
if ($config['flash_charts']) {
|
||||
$name = date('H:i:s', $bottom);
|
||||
}
|
||||
else {
|
||||
$name = date('H\h', $bottom);
|
||||
@ -3605,11 +3729,13 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
|
||||
$full_legend[$cont] = $name;
|
||||
|
||||
$top = $datelimit + ($periodtime * ($i + 1));
|
||||
|
||||
$event = db_get_row_filter ('tevento',
|
||||
array ('id_agente' => $id_agent,
|
||||
'id_agentmodule' => $id_module,
|
||||
'utimestamp > '.$bottom,
|
||||
'utimestamp < '.$top), 'criticity, utimestamp');
|
||||
|
||||
|
||||
if (!empty($event['utimestamp'])) {
|
||||
$data[$cont]['utimestamp'] = $periodtime;
|
||||
switch ($event['criticity']) {
|
||||
|
@ -385,13 +385,28 @@ function html_print_select_groups($id_user = false, $privilege = "AR",
|
||||
$nothing = '', $nothing_value = 0, $return = false,
|
||||
$multiple = false, $sort = true, $class = '', $disabled = false,
|
||||
$style = false, $option_style = false, $id_group = false,
|
||||
$keys_field = 'id_grupo', $strict_user = false) {
|
||||
$keys_field = 'id_grupo', $strict_user = false, $delete_groups = false , $include_groups = false) {
|
||||
|
||||
global $config;
|
||||
|
||||
$fields = users_get_groups_for_select($id_user, $privilege,
|
||||
$returnAllGroup, true, $id_group, $keys_field);
|
||||
|
||||
if ($delete_groups && is_array($delete_groups)){
|
||||
foreach ($delete_groups as $value) {
|
||||
unset($fields[$value]);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($include_groups)){
|
||||
|
||||
$field = array();
|
||||
foreach ($include_groups as $value) {
|
||||
$field[$value] = $fields[$value];
|
||||
}
|
||||
$fields = array_intersect($fields, $field);
|
||||
}
|
||||
|
||||
if ($strict_user) {
|
||||
$fields = users_get_strict_mode_groups($config['id_user'], $returnAllGroup);
|
||||
}
|
||||
|
@ -2597,4 +2597,4 @@ function recursive_get_dt_from_modules_tree (&$f_modules, $modules, $deep) {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@ -146,6 +146,15 @@ function reporting_make_reporting_data($report = null, $id_report,
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(sizeof($content['id_agent']) != 1){
|
||||
$content['style']['name_label'] = str_replace("_agent_",sizeof($content['id_agent']).__(' agents'),$content['style']['name_label']);
|
||||
}
|
||||
|
||||
if(sizeof($content['id_agent_module']) != 1){
|
||||
$content['style']['name_label'] = str_replace("_module_",sizeof($content['id_agent_module']).__(' modules'),$content['style']['name_label']);
|
||||
}
|
||||
|
||||
$content['name'] = reporting_label_macro($items_label, $content['style']['name_label']);
|
||||
|
||||
@ -2438,7 +2447,14 @@ function reporting_database_serialized($report, $content) {
|
||||
$return['agent_name'] = $agent_name;
|
||||
$return['module_name'] = $module_name;
|
||||
|
||||
|
||||
if ($config['metaconsole']) {
|
||||
$id_meta = metaconsole_get_id_server($content["server_name"]);
|
||||
|
||||
|
||||
$server = metaconsole_get_connection_by_id ($id_meta);
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
|
||||
$datelimit = $report["datetime"] - $content['period'];
|
||||
$search_in_history_db = db_search_in_history_db($datelimit);
|
||||
|
||||
@ -2514,6 +2530,10 @@ function reporting_database_serialized($report, $content) {
|
||||
$data[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['metaconsole']) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
$return["data"] = $data;
|
||||
|
||||
@ -5780,17 +5800,10 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||
|
||||
require_once ($config["homedir"] . '/include/functions_graph.php');
|
||||
|
||||
if ($type_report == 'automatic_graph') {
|
||||
// Do none
|
||||
}
|
||||
else {
|
||||
if ($config['metaconsole']) {
|
||||
$id_meta = metaconsole_get_id_server($content["server_name"]);
|
||||
|
||||
|
||||
$server = metaconsole_get_connection_by_id ($id_meta);
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
|
||||
$id_meta = metaconsole_get_id_server($content["server_name"]);
|
||||
$server = metaconsole_get_connection_by_id ($id_meta);
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
|
||||
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
|
||||
@ -5833,10 +5846,36 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||
|
||||
array_push ($weights, $graph_item["weight"]);
|
||||
if (in_array('label',$content['style'])) {
|
||||
if (defined('METACONSOLE')) {
|
||||
$item = array('type' => 'custom_graph',
|
||||
'id_agent' =>$content['id_agent'],
|
||||
'id_agent_module'=>$graph_item['id_agent_module']);
|
||||
}
|
||||
else {
|
||||
$item = array('type' => 'custom_graph',
|
||||
'id_agent' =>modules_get_agentmodule_agent($graph_item['id_agent_module']),
|
||||
'id_agent_module'=>$graph_item['id_agent_module']);
|
||||
$label = reporting_label_macro($item, $content['style']['label']);
|
||||
}
|
||||
|
||||
if($type_report == 'automatic_graph'){
|
||||
$label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
|
||||
if (!empty($label)) {
|
||||
if ($config['metaconsole']) {
|
||||
$id_meta = metaconsole_get_id_server($content["server_name"]);
|
||||
$server = metaconsole_get_connection_by_id ($id_meta);
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
$label = reporting_label_macro($content, $label);
|
||||
|
||||
if ($config['metaconsole']) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
|
||||
$label = reporting_label_macro($content, $label);
|
||||
}
|
||||
|
||||
$labels[$graph_item['id_agent_module']] = $label;
|
||||
}
|
||||
}
|
||||
@ -5893,13 +5932,8 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||
break;
|
||||
}
|
||||
|
||||
if ($type_report == 'automatic_graph') {
|
||||
// Do none
|
||||
}
|
||||
else {
|
||||
if ($config['metaconsole']) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
return reporting_check_structure_content($return);
|
||||
@ -10296,6 +10330,7 @@ function reporting_label_macro ($item, $label) {
|
||||
case 'TTO':
|
||||
case 'MTBF':
|
||||
case 'MTTR':
|
||||
case 'automatic_graph':
|
||||
if (preg_match("/_agent_/", $label)) {
|
||||
$agent_name = agents_get_alias($item['id_agent']);
|
||||
$label = str_replace("_agent_", $agent_name, $label);
|
||||
@ -10330,4 +10365,4 @@ function reporting_label_macro ($item, $label) {
|
||||
return $label;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@ -3780,6 +3780,7 @@ function reporting_get_event_histogram ($events, $text_header_event = false) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
if (!$text_header_event) {
|
||||
$table->width = '100%';
|
||||
@ -3839,6 +3840,157 @@ function reporting_get_event_histogram ($events, $text_header_event = false) {
|
||||
return $event_graph;
|
||||
}
|
||||
|
||||
function reporting_get_event_histogram_meta ($width) {
|
||||
global $config;
|
||||
if (!defined("METACONSOLE")) {
|
||||
include_once ($config['homedir'] .'/include/graphs/functions_gd.php');
|
||||
}
|
||||
else {
|
||||
include_once ('../../include/graphs/functions_gd.php');
|
||||
}
|
||||
|
||||
$period = SECONDS_1HOUR;
|
||||
|
||||
if (!$text_header_event) {
|
||||
$text_header_event = __('Events info (1hr.)');
|
||||
}
|
||||
|
||||
$ttl = 1;
|
||||
$urlImage = ui_get_full_url(false, true, false, false);
|
||||
|
||||
$data = array ();
|
||||
|
||||
$resolution = $config['graph_res'] * ($period * 2 / $width); // Number of "slices" we want in graph
|
||||
|
||||
$interval = (int) ($period / $resolution);
|
||||
$date = get_system_time ();
|
||||
$datelimit = $date - $period;
|
||||
$periodtime = floor ($period / $interval);
|
||||
$time = array ();
|
||||
$data = array ();
|
||||
$legend = array();
|
||||
$full_legend = array();
|
||||
$full_legend_date = array();
|
||||
|
||||
$colors = array(
|
||||
EVENT_CRIT_MAINTENANCE => COL_MAINTENANCE,
|
||||
EVENT_CRIT_INFORMATIONAL => COL_INFORMATIONAL,
|
||||
EVENT_CRIT_NORMAL => COL_NORMAL,
|
||||
EVENT_CRIT_MINOR => COL_MINOR,
|
||||
EVENT_CRIT_WARNING => COL_WARNING,
|
||||
EVENT_CRIT_MAJOR => COL_MAJOR,
|
||||
EVENT_CRIT_CRITICAL => COL_CRITICAL
|
||||
);
|
||||
|
||||
$cont = 0;
|
||||
for ($i = 0; $i < $interval; $i++) {
|
||||
$bottom = $datelimit + ($periodtime * $i);
|
||||
if (! $graphic_type) {
|
||||
if ($config['flash_charts']) {
|
||||
$name = date('H:i:s', $bottom);
|
||||
}
|
||||
else {
|
||||
$name = date('H\h', $bottom);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$name = $bottom;
|
||||
}
|
||||
|
||||
// Show less values in legend
|
||||
if ($cont == 0 or $cont % 2)
|
||||
$legend[$cont] = $name;
|
||||
|
||||
if ($from_agent_view) {
|
||||
$full_date = date('Y/m/d', $bottom);
|
||||
$full_legend_date[$cont] = $full_date;
|
||||
}
|
||||
|
||||
$full_legend[$cont] = $name;
|
||||
|
||||
$top = $datelimit + ($periodtime * ($i + 1));
|
||||
$event = db_get_row_filter ('tmetaconsole_event',
|
||||
array (
|
||||
'utimestamp > '.$bottom,
|
||||
'utimestamp < '.$top),
|
||||
'criticity, utimestamp');
|
||||
|
||||
if (!empty($event['utimestamp'])) {
|
||||
$data[$cont]['utimestamp'] = $periodtime;
|
||||
switch ($event['criticity']) {
|
||||
case 0:
|
||||
$data[$cont]['data'] = EVENT_CRIT_MAINTENANCE;
|
||||
break;
|
||||
case 1:
|
||||
$data[$cont]['data'] = EVENT_CRIT_INFORMATIONAL;
|
||||
break;
|
||||
case 2:
|
||||
$data[$cont]['data'] = EVENT_CRIT_NORMAL;
|
||||
break;
|
||||
case 3:
|
||||
$data[$cont]['data'] = EVENT_CRIT_WARNING;
|
||||
break;
|
||||
case 4:
|
||||
$data[$cont]['data'] = EVENT_CRIT_CRITICAL;
|
||||
break;
|
||||
case 5:
|
||||
$data[$cont]['data'] = EVENT_CRIT_MINOR;
|
||||
break;
|
||||
case 6:
|
||||
$data[$cont]['data'] = EVENT_CRIT_MAJOR;
|
||||
break;
|
||||
case 20:
|
||||
$data[$cont]['data'] = EVENT_CRIT_NOT_NORMAL;
|
||||
break;
|
||||
case 34:
|
||||
$data[$cont]['data'] = EVENT_CRIT_WARNING_OR_CRITICAL;
|
||||
break;
|
||||
default:
|
||||
$data[$cont]['data'] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$data[$cont]['utimestamp'] = $periodtime;
|
||||
$data[$cont]['data'] = 1;
|
||||
}
|
||||
$cont++;
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
|
||||
$table->width = '100%';
|
||||
|
||||
$table->data = array ();
|
||||
$table->size = array ();
|
||||
$table->head = array ();
|
||||
$table->title = '<span>' . $text_header_event . '</span>';
|
||||
$table->data[0][0] = "" ;
|
||||
|
||||
if (!empty($data)) {
|
||||
$slicebar = flot_slicesbar_graph($data, $period, "100%", 30, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $url, '', '', false, 0, $full_legend_date);
|
||||
|
||||
$table->data[0][0] = $slicebar;
|
||||
}
|
||||
else {
|
||||
$table->data[0][0] = __('No events');
|
||||
}
|
||||
|
||||
if (!$text_header_event) {
|
||||
$event_graph = '<fieldset class="databox tactical_set">
|
||||
<legend>' .
|
||||
$text_header_event .
|
||||
'</legend>' .
|
||||
html_print_table($table, true) . '</fieldset>';
|
||||
}
|
||||
else {
|
||||
$table->class = 'noclass';
|
||||
$event_graph = html_print_table($table, true);
|
||||
}
|
||||
|
||||
return $event_graph;
|
||||
}
|
||||
|
||||
function reporting_html_planned_downtimes_table ($planned_downtimes) {
|
||||
global $config;
|
||||
|
||||
|
@ -279,4 +279,111 @@ function snmp_update_translation($oid, $new_oid, $description, $post_process) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the event filter tag cloud (enterprise feature)
|
||||
* @param $filter_resume: Array with the active filters
|
||||
* @param $filter_refs: Array of all arrays to humanize some tags
|
||||
*/
|
||||
function print_snmp_tags_active_filters ($filter_resume = array()) {
|
||||
global $config;
|
||||
|
||||
$tags_set = array();
|
||||
|
||||
// Alert
|
||||
if (isset($filter_resume['filter_fired'])) {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Alert'),
|
||||
'value' => $filter_resume['filter_fired']
|
||||
));
|
||||
}
|
||||
// Severity
|
||||
if (isset($filter_resume['filter_severity'])) {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Severity'),
|
||||
'value' => $filter_resume['filter_severity']
|
||||
));
|
||||
}
|
||||
// Pagination
|
||||
if ($filter_resume['pagination'] == "") {
|
||||
$filter_resume['pagination'] = $config["block_size"];
|
||||
}
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Pagination'),
|
||||
'value' => $filter_resume['pagination']
|
||||
));
|
||||
// Free search
|
||||
if (isset($filter_resume['free_search_string']) && $filter_resume['free_search_string'] != "") {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Search'),
|
||||
'value' => $filter_resume['free_search_string']
|
||||
));
|
||||
}
|
||||
// Status
|
||||
if (isset($filter_resume['filter_status']) && $filter_resume['filter_status'] != "") {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Status'),
|
||||
'value' => $filter_resume['filter_status']
|
||||
));
|
||||
}
|
||||
// Group by
|
||||
if (isset($filter_resume['group_by'])) {
|
||||
if ($filter_resume['group_by'] == 0) {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Group by Enterprise String / IP'),
|
||||
'value' => __('No')
|
||||
));
|
||||
}
|
||||
else {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Group by Enterprise String / IP'),
|
||||
'value' => __('Yes')
|
||||
));
|
||||
}
|
||||
}
|
||||
// Date from
|
||||
if (isset($filter_resume['date_from_trap']) && $filter_resume['date_from_trap'] != "") {
|
||||
if (isset($filter_resume['time_from_trap']) && $filter_resume['time_from_trap'] != "") {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('From'),
|
||||
'value' => $filter_resume['date_from_trap'] . " " . $filter_resume['time_from_trap']
|
||||
));
|
||||
}
|
||||
else {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('From'),
|
||||
'value' => $filter_resume['date_from_trap']
|
||||
));
|
||||
}
|
||||
}
|
||||
// Date to
|
||||
if (isset($filter_resume['date_to_trap']) && $filter_resume['date_to_trap'] != "") {
|
||||
if (isset($filter_resume['time_to_trap']) && $filter_resume['time_to_trap'] != "") {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('To'),
|
||||
'value' => $filter_resume['date_to_trap'] . " " . $filter_resume['time_to_trap']
|
||||
));
|
||||
}
|
||||
else {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('To'),
|
||||
'value' => $filter_resume['date_to_trap']
|
||||
));
|
||||
}
|
||||
}
|
||||
// Trap type
|
||||
if (isset($filter_resume['trap_type'])) {
|
||||
array_push ($tags_set, array(
|
||||
'title' => __('Trap type'),
|
||||
'value' => $filter_resume['trap_type']
|
||||
));
|
||||
}
|
||||
$title = '';
|
||||
if(!$config['pure']){
|
||||
$title = isset($filter_resume['title'])
|
||||
? __('Active filter') . " (" . $filter_resume['title'] . ")"
|
||||
: __('Active filters');
|
||||
}
|
||||
if (sizeof($filter_resume) > 0) ui_print_tags_view($title, $tags_set);
|
||||
}
|
||||
?>
|
||||
|
@ -116,7 +116,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a
|
||||
echo "</a>";
|
||||
}
|
||||
|
||||
echo ' <span>' . $level . '</span>';
|
||||
echo html_print_checkbox("create_$sub_id", 0, false, true, false, '') .' <span>' . $level . '</span>';
|
||||
if (isset ($sub_level['__VALUE__'])) {
|
||||
echo '<span class="value" style="display: none;"> = ' . $sub_level['__VALUE__'] . '</span>';
|
||||
}
|
||||
@ -618,3 +618,137 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('input[name*=create_network_component]').click(function () {
|
||||
var id_check = $('#ul_0').find('input').map(function(){
|
||||
if(this.id.indexOf('checkbox-create_')!=-1){
|
||||
if($(this).is(':checked')){
|
||||
return this.id;
|
||||
}
|
||||
|
||||
} }).get();
|
||||
$('input[name*=create_network_component]').removeClass("sub add");
|
||||
$('input[name*=create_network_component]').addClass("sub spinn");
|
||||
|
||||
var target_ip = $('#text-target_ip').val();
|
||||
var community = $('#text-community').val();
|
||||
var snmp_version = $('#snmp_browser_version').val();
|
||||
var snmp3_auth_user = $('#text-snmp3_browser_auth_user').val();
|
||||
var snmp3_security_level = $('#snmp3_browser_security_level').val();
|
||||
var snmp3_auth_method = $('#snmp3_browser_auth_method').val();
|
||||
var snmp3_auth_pass = $('#password-snmp3_browser_auth_pass').val();
|
||||
var snmp3_privacy_method = $('#snmp3_browser_privacy_method').val();
|
||||
var snmp3_privacy_pass = $('#password-snmp3_browser_privacy_pass').val();
|
||||
|
||||
var custom_action = $('#hidden-custom_action').val();
|
||||
if (custom_action == undefined) {
|
||||
custom_action = '';
|
||||
}
|
||||
|
||||
var oids = [];
|
||||
id_check.forEach(function(product, index) {
|
||||
var oid = $("#"+product).siblings('a').attr('href');
|
||||
if(oid.indexOf('javascript: snmpGet("')!=-1) {
|
||||
oid = oid.replace('javascript: snmpGet("',"");
|
||||
oid = oid.replace('");',"");
|
||||
oids.push(oid);
|
||||
}
|
||||
|
||||
});
|
||||
// Prepare the AJAX call
|
||||
var params = [
|
||||
"target_ip=" + target_ip,
|
||||
"community=" + community,
|
||||
"oids=" + oids,
|
||||
"snmp_browser_version=" + snmp_version,
|
||||
"snmp3_browser_auth_user=" + snmp3_auth_user,
|
||||
"snmp3_browser_security_level=" + snmp3_security_level,
|
||||
"snmp3_browser_auth_method=" + snmp3_auth_method,
|
||||
"snmp3_browser_auth_pass=" + snmp3_auth_pass,
|
||||
"snmp3_browser_privacy_method=" + snmp3_privacy_method,
|
||||
"snmp3_browser_privacy_pass=" + snmp3_privacy_pass,
|
||||
"action=" + "create_modules_snmp",
|
||||
"custom_action=" + custom_action,
|
||||
"page=include/ajax/snmp_browser.ajax"
|
||||
];
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "ajax.php",
|
||||
data: params.join ("&"),
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$('input[name*=create_network_component]').removeClass("sub spinn");
|
||||
$('input[name*=create_network_component]').addClass("sub add");
|
||||
|
||||
if(data.length !== 0){
|
||||
$('#error_text').text("");
|
||||
data.forEach( function(valor, indice, array) {
|
||||
console.log(valor);
|
||||
$('#error_text').append('<br/>'+ valor );
|
||||
});
|
||||
$("#dialog_error")
|
||||
.dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 300,
|
||||
width: 500,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$("#dialog_success")
|
||||
.dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 250,
|
||||
width: 500,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('input[id^=checkbox-create]').change(function () {
|
||||
if ($(this).is(':checked') ) {
|
||||
$('input[name*=create_network_component]').show();
|
||||
var id_input = $(this).attr("id");
|
||||
id_input = id_input.split("checkbox-create_");
|
||||
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
|
||||
if(this.id.indexOf('checkbox-create_')!=-1){
|
||||
return this.id;
|
||||
} }).get();
|
||||
|
||||
checks.forEach(function(product, index) {
|
||||
$("#"+product).prop('checked', "true");
|
||||
});
|
||||
|
||||
} else {
|
||||
var id_input = $(this).attr("id");
|
||||
|
||||
id_input = id_input.split("checkbox-create_");
|
||||
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
|
||||
if(this.id.indexOf('checkbox-create_')!=-1){
|
||||
return this.id;
|
||||
} }).get();
|
||||
|
||||
checks.forEach(function(product, index) {
|
||||
$("#"+product).prop('checked', false);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@ -660,6 +660,28 @@ function ui_print_os_icon ($id_os, $name = true, $return = false,
|
||||
return $output;
|
||||
}
|
||||
|
||||
function ui_print_type_agent_icon ( $id_os = false, $remote_contact = false, $contact = false,
|
||||
$return = false, $remote = 0, $version = ""){
|
||||
|
||||
if($id_os == 19){
|
||||
//Satellite
|
||||
$options['title'] = __('Satellite');
|
||||
$output = html_print_image("images/op_satellite.png", true, $options, false, false, false, true);
|
||||
}
|
||||
else if ($remote_contact == $contact && $remote == 0 && $version == ""){
|
||||
//Network
|
||||
$options['title'] = __('Network');
|
||||
$output = html_print_image("images/network.png", true, $options, false, false, false, true);
|
||||
}
|
||||
else{
|
||||
//Software
|
||||
$options['title'] = __('Software');
|
||||
$output = html_print_image("images/data.png", true, $options, false, false, false, true);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints an agent name with the correct link
|
||||
*
|
||||
|
@ -110,13 +110,11 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$border_color = $layoutData['border_color'];
|
||||
$fill_color = $layoutData['fill_color'];
|
||||
$label_position = $layoutData['label_position'];
|
||||
|
||||
|
||||
$sizeStyle = '';
|
||||
$borderStyle = '';
|
||||
$imageSize = '';
|
||||
|
||||
|
||||
|
||||
|
||||
if (!empty($proportion)) {
|
||||
$top = $top * $proportion['proportion_height'];
|
||||
$left = $left * $proportion['proportion_width'];
|
||||
@ -156,6 +154,7 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$wimg ='70';
|
||||
break;
|
||||
case 3:
|
||||
case 14:
|
||||
if (get_parameter('action') == 'edit') {
|
||||
$himg = '30';
|
||||
$wimg = '150';
|
||||
@ -201,7 +200,7 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$text = '<table style="float:right;height:'.$himg.'px;"><tr><td></td></tr><tr><td><span style="" id="text_' . $id . '" class="text">' . $label .'</span></td></tr><tr><td></td></tr></table>';
|
||||
}
|
||||
else {
|
||||
$text = '<table style="width:'.$wimg.'px;"><tr><td></td></tr><tr><td><span style="" id="text_' . $id . '" class="text">' . $label .'</span></td></tr><tr><td></td></tr></table>';
|
||||
$text = '<table style="text-align:center ;width:'.$wimg.'px;"><tr><td></td></tr><tr><td><span style="" id="text_' . $id . '" class="text">' . $label .'</span></td></tr><tr><td></td></tr></table>';
|
||||
}
|
||||
|
||||
|
||||
@ -376,6 +375,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$link = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
$link = true;
|
||||
break;
|
||||
default:
|
||||
if (!empty($element_enterprise)) {
|
||||
@ -391,7 +393,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$is_a_service = false;
|
||||
$is_a_link_to_other_visualconsole = false;
|
||||
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$id_service = services_service_from_module
|
||||
($layoutData['id_agente_modulo']);
|
||||
@ -404,9 +405,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
$is_a_link_to_other_visualconsole = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($is_a_service) {
|
||||
if (empty($layoutData['id_metaconsole'])) {
|
||||
$url = $config['homeurl'] .
|
||||
@ -458,6 +456,36 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
$e_period = $layoutData['period'];
|
||||
$date = get_system_time ();
|
||||
$datelimit = $date - $e_period;
|
||||
|
||||
$time_format = "Y/m/d H:i:s";
|
||||
|
||||
$timestamp_init = date($time_format, $datelimit);
|
||||
$timestamp_end = date($time_format, $date);
|
||||
|
||||
$timestamp_init_aux = explode(" ", $timestamp_init);
|
||||
$timestamp_end_aux = explode(" ", $timestamp_end);
|
||||
|
||||
$date_from = $timestamp_init_aux[0];
|
||||
$time_from = $timestamp_init_aux[1];
|
||||
|
||||
$date_to = $timestamp_end_aux[0];
|
||||
$time_to = $timestamp_end_aux[1];
|
||||
|
||||
if (empty($layout_data['id_metaconsole'])) {
|
||||
$url = $config['homeurl'] . "index.php?sec=eventos&sec2=operation/events/events&id_agent=" . $layoutData['id_agent'] .
|
||||
"&module_search_hidden=" . $layoutData['id_agente_modulo'] . "&date_from=" . $date_from . "&time_from=" . $time_from .
|
||||
"&date_to=" . $date_to . "&time_to=" . $time_to . "&status=-1";
|
||||
}
|
||||
else {
|
||||
$url = "index.php?sec=eventos&sec2=operation/events/events&id_agent=" . $layoutData['id_agent'] .
|
||||
"&module_search_hidden=" . $layoutData['id_agente_modulo'] . "&date_from=" . $date_from . "&time_from=" . $time_from .
|
||||
"&date_to=" . $date_to . "&time_to=" . $time_to . "&status=-1";
|
||||
}
|
||||
break;
|
||||
case GROUP_ITEM:
|
||||
$is_a_link_to_other_visualconsole = false;
|
||||
@ -1037,8 +1065,6 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
//$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
|
||||
|
||||
break;
|
||||
case LABEL:
|
||||
$z_index = 4 + 1;
|
||||
@ -1046,6 +1072,61 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
case BOX_ITEM:
|
||||
$z_index = 1;
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
|
||||
if($width == 0 || $height == 0){
|
||||
if ($layoutData['id_metaconsole'] != 0) {
|
||||
$img = '<img src="../../images/console/signes/module-events.png">';
|
||||
}
|
||||
else{
|
||||
$img = '<img src="images/console/signes/module-events.png">';
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($layoutData['id_metaconsole'] != 0) {
|
||||
$img = '<img src="../../images/console/signes/module-events.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||
}
|
||||
else{
|
||||
$img = '<img src="images/console/signes/module-events.png" style="width:'.$width.'px;height:'. $height.'px;">';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($width == 0 || $height == 0) {
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div style="float:left;height:'.$himg.'px;">' .
|
||||
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], 500, 50, $layoutData['period'], '', true);
|
||||
}
|
||||
elseif ($layoutData['label_position']=='right') {
|
||||
$img = '<div style="float:right;height:'.$himg.'px;">' .
|
||||
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], 500, 50, $layoutData['period'], '', true);
|
||||
}
|
||||
else {
|
||||
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], 500, 50, $layoutData['period'], '', true);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($layoutData['label_position']=='left') {
|
||||
$img = '<div style="float:left;height:'.$himg.'px;">' .
|
||||
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], $width, $height, $layoutData['period'], '', true);
|
||||
}
|
||||
elseif ($layoutData['label_position']=='right') {
|
||||
$img = '<div style="float:right;height:'.$himg.'px;">' .
|
||||
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], $width, $height, $layoutData['period'], '', true);
|
||||
}
|
||||
else {
|
||||
$img = graph_graphic_moduleevents ($layoutData['id_agent'], $layoutData['id_agente_modulo'], $width, $height, $layoutData['period'], '', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Restore db connection
|
||||
if ($layoutData['id_metaconsole'] != 0) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
$z_index = 2 + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
$class = "item ";
|
||||
@ -1053,6 +1134,9 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
case STATIC_GRAPH:
|
||||
$class .= "static_graph";
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
$class .= "auto_sla_graph";
|
||||
break;
|
||||
case GROUP_ITEM:
|
||||
$class .= "group_item";
|
||||
break;
|
||||
@ -1386,6 +1470,20 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
if ($layoutData['label_position']=='up') {
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
|
||||
echo $img;
|
||||
|
||||
if ($layoutData['label_position']=='down') {
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
elseif($layoutData['label_position']=='left' || $layoutData['label_position']=='right') {
|
||||
echo io_safe_output($text);
|
||||
}
|
||||
break;
|
||||
case SIMPLE_VALUE:
|
||||
case SIMPLE_VALUE_MAX:
|
||||
case SIMPLE_VALUE_MIN:
|
||||
@ -1433,23 +1531,23 @@ function visual_map_print_item($mode = "read", $layoutData,
|
||||
}
|
||||
}
|
||||
|
||||
//$io_safe_output_text = str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
|
||||
|
||||
|
||||
|
||||
if(get_parameter('action') == 'edit'){
|
||||
|
||||
//echo 'Data value';
|
||||
|
||||
echo $io_safe_output_text;
|
||||
|
||||
if( (strip_tags($io_safe_output_text) != '_VALUE_') || (strip_tags($io_safe_output_text) != '(_VALUE_)') ) {
|
||||
echo $io_safe_output_text;
|
||||
}
|
||||
else{
|
||||
|
||||
echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
|
||||
|
||||
else {
|
||||
echo "<img style='width:".$layoutData['width']."px;' src='images/console/signes/data_image.png'>";
|
||||
}
|
||||
|
||||
} else {
|
||||
if(strrpos(strip_tags($io_safe_output_text),'(_VALUE_)') !== false || (strip_tags($io_safe_output_text) == '(_VALUE_)')) {
|
||||
echo str_replace(array("(_VALUE_)","(_value_)"), $value, $io_safe_output_text);
|
||||
}
|
||||
elseif(strrpos(strip_tags($io_safe_output_text),'_VALUE_') !== false || (strip_tags($io_safe_output_text) == '_VALUE_')) {
|
||||
echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
|
||||
} else {
|
||||
echo str_replace('>', ' style="width:'.$layoutData['width'].'px">',$value);
|
||||
}
|
||||
}
|
||||
|
||||
//Restore db connection
|
||||
if ($layoutData['id_metaconsole'] != 0) {
|
||||
@ -1585,21 +1683,31 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
|
||||
'id_agente_modulo', $id_module);
|
||||
if ($value === false) {
|
||||
$value = __('Unknown');
|
||||
|
||||
$value = preg_replace ('/\n/i','<br>',$value);
|
||||
$value = preg_replace ('/\s/i',' ',$value);
|
||||
}
|
||||
else {
|
||||
if ( is_numeric($value) ) {
|
||||
if ($config['simple_module_value']) {
|
||||
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
|
||||
if(strpos($value, 'data:image') !== false){
|
||||
$value = '<img class="b64img" src="'.$value.'">';
|
||||
}
|
||||
else{
|
||||
|
||||
if ( is_numeric($value) ) {
|
||||
if ($config['simple_module_value']) {
|
||||
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
|
||||
}
|
||||
}
|
||||
if (!empty($unit_text)) {
|
||||
$value .= " " . $unit_text;
|
||||
}
|
||||
|
||||
$value = preg_replace ('/\n/i','<br>',$value);
|
||||
$value = preg_replace ('/\s/i',' ',$value);
|
||||
|
||||
}
|
||||
if (!empty($unit_text)) {
|
||||
$value .= " " . $unit_text;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$value = preg_replace ('/\n/i','<br>',$value);
|
||||
$value = preg_replace ('/\s/i',' ',$value);
|
||||
|
||||
return $value;
|
||||
break;
|
||||
case SIMPLE_VALUE_MAX:
|
||||
@ -2746,6 +2854,10 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
|
||||
case MODULE_GRAPH:
|
||||
$text = __('Module graph');
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
case AUTO_SLA_GRAPH:
|
||||
$text = __('Auto SLA Graph');
|
||||
break;
|
||||
case 'percentile_bar':
|
||||
case PERCENTILE_BAR:
|
||||
$text = __('Percentile bar');
|
||||
@ -2857,6 +2969,9 @@ function visual_map_type_in_js($type) {
|
||||
case MODULE_GRAPH:
|
||||
return 'module_graph';
|
||||
break;
|
||||
case AUTO_SLA_GRAPH:
|
||||
return 'auto_sla_graph';
|
||||
break;
|
||||
case SIMPLE_VALUE:
|
||||
return 'simple_value';
|
||||
break;
|
||||
|
@ -54,6 +54,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
'static_graph' => __('Static Graph'),
|
||||
'percentile_item' => __('Percentile Item'),
|
||||
'module_graph' => __('Graph'),
|
||||
'auto_sla_graph' => __('Auto SLA Graph'),
|
||||
'simple_value' => __('Simple value') . ui_print_help_tip(__("To use 'label'field, you should write
|
||||
a text to replace '(_VALUE_)' and the value of the module will be printed at the end."), true),
|
||||
'label' => __('Label'),
|
||||
@ -153,7 +154,6 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
html_print_input_text('height_module_graph', 180, '', 3, 5, true) .
|
||||
'</td>';
|
||||
|
||||
|
||||
$form_items['label_row'] = array();
|
||||
$form_items['label_row']['items'] = array('label',
|
||||
'static_graph',
|
||||
@ -162,7 +162,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
'module_graph',
|
||||
'simple_value',
|
||||
'datos',
|
||||
'group_item');
|
||||
'group_item',
|
||||
'auto_sla_graph');
|
||||
$form_items['label_row']['html'] =
|
||||
'<td align="left" valign="top" style="">' . __('Label') . '
|
||||
|
||||
@ -188,7 +189,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
<td align="left" style="">' .
|
||||
html_print_input_text('label', '', '', 20, 200, true) . '
|
||||
<span id="advice_label" style="font-style:italic;z-index:3;display:inline;margin-top:0px;float:right;margin-right:100px;">
|
||||
'.__("Click right mouse button to change background label editor color").'
|
||||
'.__("Click right mouse button to change the background color of the label editor").'
|
||||
</span>
|
||||
</td>';
|
||||
|
||||
@ -276,7 +277,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
$form_items['agent_row'] = array();
|
||||
$form_items['agent_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos');
|
||||
'simple_value', 'datos', 'auto_sla_graph');
|
||||
$form_items['agent_row']['html'] = '<td align="left">' .
|
||||
__('Agent') . '</td>';
|
||||
$params = array();
|
||||
@ -306,28 +307,38 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
ui_print_agent_autocomplete_input($params) .
|
||||
'</td>';
|
||||
|
||||
|
||||
$form_items['module_row'] = array();
|
||||
$form_items['module_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'datos');
|
||||
'simple_value', 'datos', 'auto_sla_graph');
|
||||
$form_items['module_row']['html'] = '<td align="left">' .
|
||||
__('Module') . '</td>
|
||||
<td align="left">' .
|
||||
html_print_select(array(), 'module', '', '', __('Any'), 0, true) .
|
||||
html_print_select(array(), 'module', '', '', __('Any'), 0, true) . '<div id="data_image_container" style="display:none;"><span id="data_image_check_label" style="margin-left:20px;">'.__("Data image").': </span><span id="data_image_check">Off</span><span id="data_image_width_label"> - Width: </span><input style="margin-left:5px;width:40px;" type="number" min="0" id="data_image_width" value="100"></input></div>
|
||||
</td>';
|
||||
|
||||
$event_times = array(86400 => __('24h'),
|
||||
28800 => __('8h'),
|
||||
7200 => __('2h'),
|
||||
3600 => __('1h'),);
|
||||
$form_items['event_max_time_row'] = array();
|
||||
$form_items['event_max_time_row']['items'] = array('auto_sla_graph');
|
||||
$form_items['event_max_time_row']['html'] = '<td align="left">' .
|
||||
__('Max. Time') . '</td>
|
||||
<td align="left">' .
|
||||
html_print_select($event_times, 'event_max_time_row', '', '', 0, 86400, true, false, false) .
|
||||
'</td>';
|
||||
|
||||
|
||||
$form_items['type_graph'] = array();
|
||||
$form_items['type_graph']['items'] = array(
|
||||
'Line',
|
||||
'Area');
|
||||
$form_items['type_graph']['html'] = '<td align="left"><span>' .
|
||||
__('Type of graph') . '</span></td>
|
||||
<td align="left">'. html_print_select (
|
||||
array ('line' => __('Line'),
|
||||
'area' => __('Area')),
|
||||
'type_graph', '', '', 0, 'area', true, false, false) . '</td>';
|
||||
$form_items['type_graph'] = array();
|
||||
$form_items['type_graph']['items'] = array(
|
||||
'Line',
|
||||
'Area');
|
||||
$form_items['type_graph']['html'] = '<td align="left"><span>' .
|
||||
__('Type of graph') . '</span></td>
|
||||
<td align="left">'. html_print_select (
|
||||
array ('line' => __('Line'),
|
||||
'area' => __('Area')),
|
||||
'type_graph', '', '', 0, 'area', true, false, false) . '</td>';
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "PM"))
|
||||
@ -499,7 +510,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
$form_items_advance['position_row'] = array();
|
||||
$form_items_advance['position_row']['items'] = array('static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'label', 'icon', 'datos', 'box_item');
|
||||
'simple_value', 'label', 'icon', 'datos', 'box_item',
|
||||
'auto_sla_graph');
|
||||
$form_items_advance['position_row']['html'] = '
|
||||
<td align="left">' . __('Position') . '</td>
|
||||
<td align="left">(' . html_print_input_text('left', '0', '', 3, 5, true) .
|
||||
@ -510,7 +522,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
$form_items_advance['size_row'] = array();
|
||||
$form_items_advance['size_row']['items'] = array(
|
||||
'group_item', 'background',
|
||||
'static_graph', 'icon datos');
|
||||
'static_graph', 'icon datos',
|
||||
'auto_sla_graph');
|
||||
$form_items_advance['size_row']['html'] = '<td align="left">' .
|
||||
__('Size') .
|
||||
ui_print_help_tip (
|
||||
@ -527,7 +540,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
||||
$form_items_advance['parent_row']['items'] = array(
|
||||
'group_item', 'static_graph',
|
||||
'percentile_bar', 'percentile_item', 'module_graph',
|
||||
'simple_value', 'label', 'icon', 'datos');
|
||||
'simple_value', 'label', 'icon', 'datos', 'auto_sla_graph');
|
||||
$form_items_advance['parent_row']['html'] = '<td align="left">' .
|
||||
__('Parent') . '</td>
|
||||
<td align="left">' .
|
||||
@ -654,6 +667,7 @@ function visual_map_editor_print_toolbox() {
|
||||
visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true);
|
||||
visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true);
|
||||
visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true);
|
||||
visual_map_print_button_editor('auto_sla_graph', __('Auto SLA Graph'), 'left', false, 'auto_sla_graph_min', true);
|
||||
visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true);
|
||||
visual_map_print_button_editor('label', __('Label'), 'left', false, 'label_min', true);
|
||||
visual_map_print_button_editor('icon', __('Icon'), 'left', false, 'icon_min', true);
|
||||
@ -672,7 +686,6 @@ function visual_map_editor_print_toolbox() {
|
||||
|
||||
$text_autosave = html_print_input_hidden ('auto_save', true, true);
|
||||
visual_map_print_item_toolbox('auto_save', $text_autosave, 'right');
|
||||
//visual_map_print_button_editor('save_visualmap', __('Save'), 'right', true, 'save_min', true);
|
||||
visual_map_print_button_editor('show_grid', __('Show grid'), 'right', true, 'grid_min', true);
|
||||
visual_map_print_button_editor('edit_item', __('Update item'), 'right', true, 'config_min', true);
|
||||
visual_map_print_button_editor('delete_item', __('Delete item'), 'right', true, 'delete_min', true);
|
||||
|
@ -88,7 +88,10 @@
|
||||
else if (typeof labels[index] !== 'undefined')
|
||||
date = labels[index];
|
||||
|
||||
result.data.push([date, value,dataObject.label]);
|
||||
var clean_label = dataObject.label;
|
||||
clean_label = clean_label.replace( new RegExp("<.*?>", "g"), "");
|
||||
clean_label = clean_label.replace( new RegExp(";", "g"), "");
|
||||
result.data.push([date, value, clean_label]);
|
||||
});
|
||||
}
|
||||
/* [
|
||||
@ -139,7 +142,7 @@
|
||||
|
||||
try {
|
||||
var elements = [];
|
||||
var custom_graph = $('input:hidden[name=custom_graph]').value;
|
||||
var custom_graph = $('#hidden-custom_graph').val();
|
||||
|
||||
if (custom_graph) {
|
||||
dataObject = retrieveDataOject(dataObjects);
|
||||
|
@ -608,13 +608,16 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
|
||||
}
|
||||
}
|
||||
|
||||
function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumulate_data, intervaltick, water_mark, maxvalue, separator, separator2, graph_javascript, id_agent) {
|
||||
function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumulate_data, intervaltick, water_mark, maxvalue, separator, separator2, graph_javascript, id_agent, full_legend) {
|
||||
values = values.split(separator2);
|
||||
labels = labels.split(separator);
|
||||
legend = legend.split(separator);
|
||||
acumulate_data = acumulate_data.split(separator);
|
||||
datacolor = datacolor.split(separator);
|
||||
|
||||
if (full_legend != false) {
|
||||
full_legend = full_legend.split(separator);
|
||||
}
|
||||
|
||||
// Check possible adapt_keys on classes
|
||||
check_adaptions(graph_id);
|
||||
|
||||
@ -635,7 +638,11 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
||||
|
||||
var stack = 0, bars = true, lines = false, steps = false;
|
||||
|
||||
var options = {
|
||||
var regex = /visual_console/;
|
||||
var match = regex.exec(window.location.href);
|
||||
|
||||
if (match == null) {
|
||||
var options = {
|
||||
series: {
|
||||
stack: stack,
|
||||
shadowSize: 0.1,
|
||||
@ -662,51 +669,99 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
|
||||
show: false
|
||||
}
|
||||
};
|
||||
}
|
||||
else {
|
||||
var options = {
|
||||
series: {
|
||||
stack: stack,
|
||||
shadowSize: 0.1,
|
||||
color: '#ddd'
|
||||
},
|
||||
grid: {
|
||||
hoverable: false,
|
||||
clickable: false,
|
||||
borderWidth:1,
|
||||
borderColor: '',
|
||||
tickColor: '#fff'
|
||||
},
|
||||
xaxes: [ {
|
||||
tickFormatter: xFormatter,
|
||||
color: '',
|
||||
tickSize: intervaltick,
|
||||
tickLength: 0
|
||||
} ],
|
||||
yaxes: [ {
|
||||
show: false,
|
||||
tickLength: 0
|
||||
}],
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var plot = $.plot($('#'+graph_id), datas, options );
|
||||
|
||||
// Events
|
||||
$('#'+graph_id).bind('plothover', function (event, pos, item) {
|
||||
if (item) {
|
||||
var from = legend[item.seriesIndex];
|
||||
var to = legend[item.seriesIndex+1];
|
||||
if (match == null) {
|
||||
// Events
|
||||
$('#'+graph_id).bind('plothover', function (event, pos, item) {
|
||||
if (item) {
|
||||
var from = legend[item.seriesIndex];
|
||||
var to = legend[item.seriesIndex+1];
|
||||
|
||||
if (to == undefined) {
|
||||
to = '>';
|
||||
if (to == undefined) {
|
||||
to = '>';
|
||||
}
|
||||
|
||||
$('#extra_'+graph_id).text(from+'-'+to);
|
||||
var extra_height = parseInt($('#extra_'+graph_id).css('height').split('px')[0]);
|
||||
var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]);
|
||||
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/4)+'px');
|
||||
//$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
|
||||
$('#extra_'+graph_id).show();
|
||||
}
|
||||
});
|
||||
|
||||
$('#extra_'+graph_id).text(from+'-'+to);
|
||||
var extra_height = parseInt($('#extra_'+graph_id).css('height').split('px')[0]);
|
||||
var extra_width = parseInt($('#extra_'+graph_id).css('width').split('px')[0]);
|
||||
$('#extra_'+graph_id).css('left',pos.pageX-(extra_width/4)+'px');
|
||||
//$('#extra_'+graph_id).css('top',plot.offset().top-extra_height-5+'px');
|
||||
$('#extra_'+graph_id).show();
|
||||
}
|
||||
});
|
||||
$('#'+graph_id).bind('plotclick', function(event, pos, item) {
|
||||
if (item) {
|
||||
//from time
|
||||
var from = legend[item.seriesIndex];
|
||||
//to time
|
||||
var to = legend[item.seriesIndex+1];
|
||||
//current date
|
||||
var dateObj = new Date();
|
||||
|
||||
if (full_legend != "") {
|
||||
newdate = full_legend[item.seriesIndex];
|
||||
newdate2 = full_legend[item.seriesIndex+1];
|
||||
}
|
||||
else {
|
||||
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
||||
var day = dateObj.getUTCDate();
|
||||
var year = dateObj.getUTCFullYear();
|
||||
newdate = year + "/" + month + "/" + day;
|
||||
}
|
||||
|
||||
if(!to){
|
||||
to= '23:59';
|
||||
}
|
||||
|
||||
if (full_legend != "") {
|
||||
if (newdate2 == undefined) {
|
||||
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&status=-1';
|
||||
}
|
||||
else {
|
||||
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&date_to='+newdate2+'&time_to='+to+'&status=-1';
|
||||
}
|
||||
}
|
||||
else {
|
||||
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&date_to='+newdate+'&time_to='+to+'&status=-1';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#'+graph_id).bind('plotclick', function(event, pos, item) {
|
||||
if (item) {
|
||||
//from time
|
||||
var from = legend[item.seriesIndex];
|
||||
//to time
|
||||
var to = legend[item.seriesIndex+1];
|
||||
//current date
|
||||
var dateObj = new Date();
|
||||
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
||||
var day = dateObj.getUTCDate();
|
||||
var year = dateObj.getUTCFullYear();
|
||||
newdate = year + "/" + month + "/" + day;
|
||||
|
||||
if(!to){
|
||||
to= '23:59';
|
||||
}
|
||||
window.location='index.php?sec=eventos&sec2=operation/events/events&id_agent='+id_agent+'&date_from='+newdate+'&time_from='+from+'&date_to='+newdate+'&time_to='+to+'&status=-1';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#'+graph_id).bind('mouseout',resetInteractivity);
|
||||
$('#'+graph_id).bind('mouseout',resetInteractivity);
|
||||
}
|
||||
|
||||
// Reset interactivity styles
|
||||
function resetInteractivity() {
|
||||
@ -1421,7 +1476,6 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||
xaxes: [{
|
||||
axisLabelFontSizePixels: font_size,
|
||||
axisLabelUseCanvas: false,
|
||||
axisLabel: xaxisname,
|
||||
tickFormatter: xFormatter,
|
||||
labelHeight: 50,
|
||||
color: '',
|
||||
|
@ -846,7 +846,7 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon
|
||||
return $return;
|
||||
}
|
||||
|
||||
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '', $stat_win = false, $id_agent = 0) {
|
||||
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '', $stat_win = false, $id_agent = 0, $full_legend_date = array()) {
|
||||
global $config;
|
||||
|
||||
include_javascript_dependencies_flot_graph();
|
||||
@ -932,7 +932,6 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
|
||||
$acumulate += $value;
|
||||
$c++;
|
||||
|
||||
//$return .= "<div id='value_".$i."_$graph_id' class='values_$graph_id' style='color: #000; position:absolute;'>$value</div>";
|
||||
if ($value > $max) {
|
||||
$max = $value;
|
||||
}
|
||||
@ -943,6 +942,12 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
|
||||
$labels = implode($separator,$labels);
|
||||
$datacolor = implode($separator,$datacolor);
|
||||
$legend = io_safe_output(implode($separator,$legend));
|
||||
if (!empty($full_legend_date)) {
|
||||
$full_legend_date = io_safe_output(implode($separator,$full_legend_date));
|
||||
}
|
||||
else {
|
||||
$full_legend_date = false;
|
||||
}
|
||||
$acumulate_data = io_safe_output(implode($separator,$acumulate_data));
|
||||
|
||||
// Store data series in javascript format
|
||||
@ -966,7 +971,7 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
|
||||
// Javascript code
|
||||
$return .= "<script type='text/javascript'>";
|
||||
$return .= "//<![CDATA[\n";
|
||||
$return .= "pandoraFlotSlicebar('$graph_id', '$values', '$datacolor', '$labels', '$legend', '$acumulate_data', $intervaltick, false, $max, '$separator', '$separator2', '', $id_agent)";
|
||||
$return .= "pandoraFlotSlicebar('$graph_id', '$values', '$datacolor', '$labels', '$legend', '$acumulate_data', $intervaltick, false, $max, '$separator', '$separator2', '', $id_agent, '$full_legend_date')";
|
||||
$return .= "\n//]]>";
|
||||
$return .= "</script>";
|
||||
|
||||
|
@ -138,6 +138,7 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
|
||||
var baseLayer = null;
|
||||
|
||||
map.events.on({"zoomend": EventZoomEnd});
|
||||
map.events.on({"mouseup": EventZoomEnd});
|
||||
|
||||
//Define the maps layer
|
||||
for (var baselayerIndex in objBaseLayers) {
|
||||
@ -224,10 +225,18 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
|
||||
.transform(map.displayProjection, map.getProjectionObject());
|
||||
|
||||
map.setCenter (lonLat, initial_zoom);
|
||||
|
||||
}
|
||||
|
||||
function EventZoomEnd (evt) {
|
||||
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
|
||||
function EventZoomEnd (evt,zoom = map.zoom) {
|
||||
if(evt == null){
|
||||
var actual_zoom = (zoom < 6) ? 6 : zoom;
|
||||
}
|
||||
else{
|
||||
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
|
||||
}
|
||||
|
||||
|
||||
var max_width_marker = 38;
|
||||
var max_zoom_map = map.numZoomLevels;
|
||||
var max_font_size = 15;
|
||||
@ -258,7 +267,6 @@ function EventZoomEnd (evt) {
|
||||
var new_width_marker = (actual_zoom * max_width_marker) / max_zoom_map;
|
||||
var new_height_marker = (actual_zoom * max_width_marker) / max_zoom_map;
|
||||
|
||||
console.log(feature);
|
||||
feature.style.fontSize = '' + actual_font_size + ' !important';
|
||||
feature.style.graphicHeight = new_height_marker;
|
||||
feature.style.graphicWidth = new_width_marker;
|
||||
@ -280,6 +288,7 @@ function EventZoomEnd (evt) {
|
||||
function changeShowStatus(newShowStatus) {
|
||||
statusShow = newShowStatus;
|
||||
hideAgentsStatus();
|
||||
EventZoomEnd(null,map.zoom);
|
||||
js_refreshParentLines();
|
||||
}
|
||||
|
||||
|
@ -656,7 +656,7 @@ input.sub[disabled] {
|
||||
input.next, input.upd, input.ok, input.wand, input.delete, input.cog,
|
||||
input.target, input.search, input.copy, input.add, input.graph,
|
||||
input.percentile, input.binary, input.camera, input.config,
|
||||
input.cancel, input.default, input.filter, input.pdf {
|
||||
input.cancel, input.default, input.filter, input.pdf,input.spinn {
|
||||
padding-right: 30px;
|
||||
height: 23px;
|
||||
|
||||
@ -741,6 +741,9 @@ input.pdf:disabled {
|
||||
input.camera {
|
||||
background-image: url(../../images/input_camera.png) !important;
|
||||
}
|
||||
input.spinn {
|
||||
background-image: url(../../images/spinner_green.gif) !important;
|
||||
}
|
||||
|
||||
#toolbox #auto_save {
|
||||
padding-top: 5px;
|
||||
@ -778,6 +781,12 @@ input.percentile_item_min {
|
||||
input.percentile_item_min[disabled] {
|
||||
background: #fefefe url(../../images/percentile_item.disabled.png) no-repeat center !important;
|
||||
}
|
||||
input.auto_sla_graph_min {
|
||||
background: #fefefe url(../../images/auto_sla_graph.png) no-repeat center !important;
|
||||
}
|
||||
input.auto_sla_graph_min[disabled] {
|
||||
background: #fefefe url(../../images/auto_sla_graph.disabled.png) no-repeat center !important;
|
||||
}
|
||||
input.binary_min {
|
||||
background: #fefefe url(../../images/binary.png) no-repeat center !important;
|
||||
}
|
||||
@ -4156,4 +4165,25 @@ div#footer_help{
|
||||
/*view-agents lastest events for this agent*/
|
||||
#div_all_events_24h{
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
/*styles graph conteiner*/
|
||||
.graph_conteiner_inside > .parent_graph{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.graph_conteiner_inside > .parent_graph > .menu_graph{
|
||||
left: 90% !important;
|
||||
}
|
||||
|
||||
.graph_conteiner_inside > .parent_graph > .noresizevc{
|
||||
width: 90% !important;
|
||||
}
|
||||
|
||||
.graph_conteiner_inside > div > .nodata_container > .nodata_text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.graph_conteiner_inside > div > .nodata_container{
|
||||
background-size: 120px 80px !important;
|
||||
}
|
@ -584,12 +584,18 @@ if (! isset ($config['id_user'])) {
|
||||
$res = update_user_password ($id_user, $pass1);
|
||||
if ($res) {
|
||||
$correct_reset_pass_process = __('Password changed successfully');
|
||||
|
||||
register_pass_change_try($id_user, 1);
|
||||
}
|
||||
else {
|
||||
register_pass_change_try($id_user, 0);
|
||||
|
||||
$process_error_message = __('Failed to change password');
|
||||
}
|
||||
}
|
||||
else {
|
||||
register_pass_change_try($id_user, 0);
|
||||
|
||||
$process_error_message = __('Passwords must be the same');
|
||||
}
|
||||
require_once ('general/login_page.php');
|
||||
@ -605,6 +611,7 @@ if (! isset ($config['id_user'])) {
|
||||
|
||||
if ($db_reset_pass_entry) {
|
||||
if (($db_reset_pass_entry + SECONDS_2HOUR) < time()) {
|
||||
register_pass_change_try($id_user, 0);
|
||||
$process_error_message = __('Too much time since password change request');
|
||||
delete_reset_pass_entry($id_user);
|
||||
require_once ('general/login_page.php');
|
||||
@ -615,6 +622,7 @@ if (! isset ($config['id_user'])) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
register_pass_change_try($id_user, 0);
|
||||
$process_error_message = __('This user has not requested a password change');
|
||||
require_once ('general/login_page.php');
|
||||
}
|
||||
@ -641,7 +649,8 @@ if (! isset ($config['id_user'])) {
|
||||
|
||||
if (!$check_user) {
|
||||
$reset = false;
|
||||
$error = __('User doesn\'t exist in database');
|
||||
register_pass_change_try($user_reset_pass, 0);
|
||||
$error = __('Error in reset password request');
|
||||
$show_error = true;
|
||||
}
|
||||
else {
|
||||
@ -649,6 +658,7 @@ if (! isset ($config['id_user'])) {
|
||||
|
||||
if (!$check_mail) {
|
||||
$reset = false;
|
||||
register_pass_change_try($user_reset_pass, 0);
|
||||
$error = __('This user doesn\'t have a valid email address');
|
||||
$show_error = true;
|
||||
}
|
||||
|
@ -70,8 +70,8 @@
|
||||
<body>
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.705';
|
||||
$build = '170710';
|
||||
$version = '7.0NG.710';
|
||||
$build = '170814';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
@ -466,7 +466,10 @@ else {
|
||||
'unknown_count',
|
||||
'notinit_count',
|
||||
'total_count',
|
||||
'fired_count'),
|
||||
'fired_count',
|
||||
'ultimo_contacto_remoto',
|
||||
'remote',
|
||||
'agent_version'),
|
||||
$access,
|
||||
$order);
|
||||
}
|
||||
@ -498,11 +501,11 @@ $table->head[1] = __('Description'). ' ' .
|
||||
|
||||
$table->size[1] = "16%";
|
||||
|
||||
$table->head[9] = __('Remote'). ' ' .
|
||||
$table->head[10] = __('Remote'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=remote&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectRemoteUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=remote&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectRemoteDown, "alt" => "down")) . '</a>';
|
||||
|
||||
$table->size[9] = "9%";
|
||||
$table->size[10] = "9%";
|
||||
|
||||
$table->head[2] = __('OS'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=os&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp, "alt" => "up")) . '</a>' .
|
||||
@ -517,21 +520,24 @@ $table->size[3] = "10%";
|
||||
$table->head[4] = __('Group'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=group&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=group&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown, "alt" => "down")) . '</a>';
|
||||
$table->size[4] = "15%";
|
||||
$table->size[4] = "8%";
|
||||
|
||||
$table->head[5] = __('Modules');
|
||||
$table->size[5] = "10%";
|
||||
$table->head[5] = __('Type');
|
||||
$table->size[5] = "8%";
|
||||
|
||||
$table->head[6] = __('Status');
|
||||
$table->size[6] = "4%";
|
||||
$table->head[6] = __('Modules');
|
||||
$table->size[6] = "10%";
|
||||
|
||||
$table->head[7] = __('Alerts');
|
||||
$table->head[7] = __('Status');
|
||||
$table->size[7] = "4%";
|
||||
|
||||
$table->head[8] = __('Last contact'). ' ' .
|
||||
$table->head[8] = __('Alerts');
|
||||
$table->size[8] = "4%";
|
||||
|
||||
$table->head[9] = __('Last contact'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=last_contact&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=last_contact&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectLastContactDown, "alt" => "down")) . '</a>';
|
||||
$table->size[8] = "15%";
|
||||
$table->size[9] = "15%";
|
||||
|
||||
$table->align = array ();
|
||||
|
||||
@ -542,9 +548,9 @@ $table->align[5] = "left";
|
||||
$table->align[6] = "left";
|
||||
$table->align[7] = "left";
|
||||
$table->align[8] = "left";
|
||||
$table->align[9] = "left";
|
||||
|
||||
$table->style = array();
|
||||
//$table->style[0] = 'width: 15%';
|
||||
|
||||
$table->data = array ();
|
||||
|
||||
@ -584,14 +590,14 @@ foreach ($agents as $agent) {
|
||||
|
||||
$data[1] = ui_print_truncate_text($agent["description"], 'description', false, true, true, '[…]', 'font-size: 6.5pt');
|
||||
|
||||
$data[9] = "";
|
||||
$data[10] = "";
|
||||
|
||||
if (enterprise_installed()) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
|
||||
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
|
||||
|
||||
$data[9] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config')));
|
||||
$data[10] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config')));
|
||||
|
||||
}
|
||||
}
|
||||
@ -602,14 +608,18 @@ foreach ($agents as $agent) {
|
||||
|
||||
$data[4] = ui_print_group_icon ($agent["id_grupo"], true);
|
||||
$agent['not_init_count'] = $agent['notinit_count'];
|
||||
$data[5] = reporting_tiny_stats($agent, true, 'modules', ':', $strict_user);
|
||||
|
||||
$data[5] = ui_print_type_agent_icon ($agent["id_os"], $agent['ultimo_contacto_remoto'],
|
||||
$agent['ultimo_contacto'], $agent['remote'],
|
||||
$agent['agent_version']);
|
||||
|
||||
$data[6] = reporting_tiny_stats($agent, true, 'modules', ':', $strict_user);
|
||||
|
||||
$data[7] = $status_img;
|
||||
|
||||
$data[8] = $alert_img;
|
||||
|
||||
$data[6] = $status_img;
|
||||
|
||||
$data[7] = $alert_img;
|
||||
|
||||
$data[8] = agents_get_interval_status ($agent);
|
||||
$data[9] = agents_get_interval_status ($agent);
|
||||
|
||||
// This old code was returning "never" on agents without modules, BAD !!
|
||||
// And does not print outdated agents in red. WRONG !!!!
|
||||
|
@ -602,7 +602,7 @@ $data[0][0] .=
|
||||
__('Events (24h)') .
|
||||
'</th></tr>' .
|
||||
'<tr><td style="text-align:center;"><br />' .
|
||||
graph_graphic_agentevents ($id_agente, 450, 15, SECONDS_1DAY, '', true) .
|
||||
graph_graphic_agentevents ($id_agente, 450, 15, SECONDS_1DAY, '', true, true) .
|
||||
'<br /></td></tr>' .
|
||||
'</table>';
|
||||
|
||||
|
@ -141,9 +141,29 @@ $result = db_get_all_rows_sql ($sql, true);
|
||||
|
||||
|
||||
if ($result === false) {
|
||||
ui_print_empty_data( __('This agent doesn\'t have any GIS data.') );
|
||||
|
||||
$sql2 = sprintf ("
|
||||
SELECT current_longitude AS longitude, current_latitude AS latitude, current_altitude AS altitude,
|
||||
start_timestamp, description, number_of_packages, manual_placement
|
||||
FROM tgis_data_status
|
||||
WHERE tagente_id_agente = %d
|
||||
ORDER BY start_timestamp DESC
|
||||
LIMIT %d OFFSET %d", $agentId, $config['block_size'], (int)get_parameter ('offset'));
|
||||
|
||||
$result2 = db_get_all_rows_sql ($sql2, true);
|
||||
|
||||
if ($result2 === false) {
|
||||
ui_print_empty_data( __('This agent doesn\'t have any GIS data.') );
|
||||
} else {
|
||||
$result2[0]['end_timestamp'] = date('Y-m-d H:i:s');
|
||||
$result = $result2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if ($result !== false) {
|
||||
if(!$countData){
|
||||
$countData = 1;
|
||||
}
|
||||
ui_pagination ($countData, false) ;
|
||||
$table->data = array();
|
||||
foreach ($result as $key => $row) {
|
||||
|
@ -139,7 +139,10 @@ $interface_traffic_modules = array(
|
||||
}
|
||||
|
||||
// Get input parameters
|
||||
$period = (int) get_parameter('period', SECONDS_1HOUR);
|
||||
$period = get_parameter ("period");
|
||||
if ($period == "") {
|
||||
$period = get_parameter ("period_select", SECONDS_1DAY);
|
||||
}
|
||||
$width = (int) get_parameter("width", 555);
|
||||
$height = (int) get_parameter("height", 245);
|
||||
$start_date = (string) get_parameter("start_date", date("Y-m-d"));
|
||||
|
@ -150,7 +150,10 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
||||
$avg_only = $show_other;
|
||||
}
|
||||
|
||||
$period = get_parameter ("period", SECONDS_1DAY);
|
||||
$period = get_parameter ("period");
|
||||
if ($period == "") {
|
||||
$period = get_parameter ("period_select", SECONDS_1DAY);
|
||||
}
|
||||
$id = get_parameter ("id", 0);
|
||||
$width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH);
|
||||
$height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT);
|
||||
|
@ -543,8 +543,6 @@ $table_advanced->rowclass[] = '';
|
||||
$data = array();
|
||||
$data[0] = __('Date from') . $jump;
|
||||
|
||||
//~ $user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all());
|
||||
|
||||
$data[0] .= html_print_input_text ('date_from', $date_from, '', 15, 10, true);
|
||||
|
||||
$data[1] = __('Date to') . $jump;
|
||||
|
@ -246,7 +246,7 @@ switch ($opt) {
|
||||
$row = array();
|
||||
$row[] = __('Agent');
|
||||
$row[] = '<a style="font-weight: bolder;" href="?sec=estado&sec2=operation/agentes/ver_agente&id_agente='
|
||||
. $agent['id_agente'] . '">'.$agent['nombre'].'</a>';
|
||||
. $agent['id_agente'] . '">'.$agent['alias'].'</a>';
|
||||
$table->data[] = $row;
|
||||
|
||||
// Position
|
||||
|
@ -58,7 +58,7 @@ $confMap = gis_get_map_conf($idMap);
|
||||
|
||||
// Default open map (used to overwrite unlicensed google map view)
|
||||
$confMapDefault = get_good_con();
|
||||
$confMapUrlDefault = json_decode($confMapDefault['conection_data'], true)['url'];
|
||||
$confMapUrlDefault = json_decode($confMapDefault['conection_data'], true);
|
||||
|
||||
$num_baselayer=0;
|
||||
// Initialy there is no Gmap base layer.
|
||||
@ -77,7 +77,7 @@ if ($confMap !== false) {
|
||||
case 'Gmap':
|
||||
if (!isset($decodeJSON['gmap_key']) || empty($decodeJSON['gmap_key'])) {
|
||||
// If there is not gmap_key, show the default view
|
||||
$baselayers[$num_baselayer]['url'] = $confMapUrlDefault;
|
||||
$baselayers[$num_baselayer]['url'] = $confMapUrlDefault['url'];
|
||||
$baselayers[$num_baselayer]['typeBaseLayer'] = 'OSM';
|
||||
} else {
|
||||
$baselayers[$num_baselayer]['gmap_type'] = $decodeJSON['gmap_type'];
|
||||
@ -207,6 +207,7 @@ if ($layers != false) {
|
||||
|
||||
var new_height = $(document).height();
|
||||
$("#map").css("height", new_height - 60);
|
||||
$("svg[id*=OpenLayers]").css("height", new_height - 60);
|
||||
|
||||
});
|
||||
</script>
|
@ -242,6 +242,7 @@ if ($config["pure"] != 0) {
|
||||
|
||||
var new_height = $(document).height();
|
||||
$("#map").css("height", new_height - 60);
|
||||
$("svg[id*=OpenLayers]").css("height", new_height - 60);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user