Merge branch 'develop' into '618-new-item-auto-sla-graph-in-visual-console-dev'

# Conflicts:
#   pandora_console/godmode/reporting/visual_console_builder.editor.js
#   pandora_console/include/functions_visual_map_editor.php
#   pandora_console/include/graphs/flot/pandora.flot.js
This commit is contained in:
artu30 2017-07-28 10:30:17 +02:00
commit 14a439faab
82 changed files with 943 additions and 325 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, AIX version # Version 7.0NG.708, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, FreeBSD Version # Version 7.0NG.708, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, HP-UX Version # Version 7.0NG.708, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, GNU/Linux # Version 7.0NG.708, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# Optional. UDP Server to receive orders from outside # Optional. UDP Server to receive orders from outside

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, GNU/Linux # Version 7.0NG.708, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, Solaris Version # Version 7.0NG.708, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas # (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.707 # Version 7.0NG.708
# This program is Free Software, you can redistribute it and/or modify it # 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 # 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 # 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) # 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 # NOTE: The variables $*$ will be substituted in the installation wizard
server_ip $ServerIP$ server_ip $ServerIP$
server_path $ServerPath$ server_path $ServerPath$
temporal $AgentTemp$ temporal $AgentTemp$
logfile $AgentLog$ logfile $AgentLog$
#include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf" #include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf"
#broker_agent name_agent #broker_agent name_agent
# Agent uses your hostname automatically, if you need to change agent name # Agent uses your hostname automatically, if you need to change agent name
# use directive agent_name (do not use blank spaces, please). # use directive agent_name (do not use blank spaces, please).
# This parameter is CASE SENSITIVE. # 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 # agent_name My_Custom_Agent_name
# or setting a fixed IP address, like for example:
#address 192.168.36.73 #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 assigned for this agent (descriptive, p.e: Servers)
group $AgentGroup$ group $AgentGroup$
# This limits operation if temporal dir has not enough free disk. # This limits operation if temporal dir has not enough free disk.
#temporal_min_size 1024 #temporal_min_size 1024
# Delay start execution X second before start to minonitoring nothing # Delay start execution X second before start to minonitoring nothing
#startup_delay 30 #startup_delay 30
# Interval is defined in seconds # Interval is defined in seconds
interval 300 interval 300
# tranfer_modes: Possible values are local, tentacle (default), ftp and ssh. # tranfer_modes: Possible values are local, tentacle (default), ftp and ssh.
transfer_mode tentacle transfer_mode tentacle
server_port 41121 server_port 41121
# In case of using FTP or tentacle with password. User is always "pandora" # In case of using FTP or tentacle with password. User is always "pandora"
#server_pwd 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 # debug 1
# ODBC connections. Check documentation for more information. # ODBC connections. Check documentation for more information.
# Configuring "ExampleDSN" DSN. Notice that this DSN connection must be configured # Configuring "ExampleDSN" DSN. Notice that this DSN connection must be configured
# under Control panel -> Administrative tools -> ODBC -> DSN # under Control panel -> Administrative tools -> ODBC -> DSN
# odbc_ExampleDSN_username UserNameForDsn # odbc_ExampleDSN_username UserNameForDsn
# odbc_ExampleDSN_password Password1234 # odbc_ExampleDSN_password Password1234
# If set to 1 allows the agent to be configured via the web console # If set to 1 allows the agent to be configured via the web console
# (only works on enterprise version). # (only works on enterprise version).
# remote_config 1 # remote_config 1
# Set XML encoding (ISO-8859-1 by default). # Set XML encoding (ISO-8859-1 by default).
#encoding ISO-8859-1 #encoding ISO-8859-1
# If set to 1 start Drone Agent's Proxy Mode # If set to 1 start Drone Agent's Proxy Mode
# proxy_mode 1 # proxy_mode 1
# Max number of simmultaneus connection for proxy (by default 10) # Max number of simmultaneus connection for proxy (by default 10)
# proxy_max_connection 10 # proxy_max_connection 10
# Proxy timeout (by default 1s) # Proxy timeout (by default 1s)
# proxy_timeout 1 # proxy_timeout 1
# Enable or disable XML buffer. # Enable or disable XML buffer.
xml_buffer 0 xml_buffer 0
# WMI by default. Set to NT if you don't want to use WMI. # WMI by default. Set to NT if you don't want to use WMI.
win32_monitoring_lib NT win32_monitoring_lib NT
# Secondary server configuration # Secondary server configuration
# ============================== # ==============================
# If secondary_mode is set to on_error, data files are copied to the secondary # 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 # server only if the primary server fails. If set to always, data files are
# always copied to the secondary server. # always copied to the secondary server.
#secondary_mode on_error #secondary_mode on_error
#secondary_server_ip localhost #secondary_server_ip localhost
#secondary_server_path /var/spool/pandora/data_in #secondary_server_path /var/spool/pandora/data_in
#secondary_server_port 41121 #secondary_server_port 41121
#secondary_transfer_mode tentacle #secondary_transfer_mode tentacle
#secondary_server_pwd mypassword #secondary_server_pwd mypassword
#secondary_server_ssl no #secondary_server_ssl no
#secondary_server_opts #secondary_server_opts
# Module Definition # Module Definition
# Check online documentation and module library at http://pandorafms.org # Check online documentation and module library at http://pandorafms.org
# ================= # =================
# CPU Load using WMI # CPU Load using WMI
module_begin module_begin
module_name CPU Load module_name CPU Load
module_type generic_data module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Processor module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage module_wmicolumn LoadPercentage
module_description CPU Load (%) module_description CPU Load (%)
@ -121,8 +121,8 @@ module_min_warning 80
module_max_warning 90 module_max_warning 90
module_min_critical 91 module_min_critical 91
module_max_critical 100 module_max_critical 100
module_end module_end
# Number processes # Number processes
module_begin module_begin
module_name Number processes module_name Number processes

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.707, AIX version # Version 7.0NG.708, AIX version
# General Parameters # General Parameters
# ================== # ==================
@ -11,7 +11,7 @@ pandora_path /usr/share/pandora_agent
temporal /var/spool/pandora/data_out temporal /var/spool/pandora/data_out
interval 300 interval 300
checksum 0 checksum 0
#agent_name adama # Debug mode renames XML in the temp folder and continues running
debug 0 debug 0
# By default is 22 (for ssh) # By default is 22 (for ssh)
#server_port 22 #server_port 22

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.707 # Version 7.0NG.708
# FreeBSD/IPSO version # FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena # Licenced under GPL licence, 2003-2007 Sancho Lerena
@ -13,6 +13,7 @@ pandora_path /opt/pandora_agent
temporal /var/spool/pandora/data_out temporal /var/spool/pandora/data_out
interval 600 interval 600
agent_name nokia agent_name nokia
# Debug mode renames XML in the temp folder and continues running
debug 0 debug 0
checksum 0 checksum 0
harmless_mode 1 harmless_mode 1

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.707, HPUX Version # Version 7.0NG.708, HPUX Version
# General Parameters # General Parameters
# ================== # ==================
@ -11,6 +11,7 @@ temporal /var/spool/pandora/data_out
interval 300 interval 300
#agent_name satellite_system #agent_name satellite_system
checksum 1 checksum 1
# Debug mode renames XML in the temp folder and continues running
debug 0 debug 0
# Module Definition # Module Definition

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707 # Version 7.0NG.708
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas # (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707 # Version 7.0NG.708
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas # (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707 # Version 7.0NG.708
# Licensed under GPL license v2, # Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net
@ -14,8 +14,7 @@ logfile /opt/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 30 interval 30
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.707, Solaris version # Version 7.0NG.708, Solaris version
# General Parameters # General Parameters
# ================== # ==================
@ -11,6 +11,7 @@ temporal /var/spool/pandora/data_out
interval 300 interval 300
#agent_name satellite_system #agent_name satellite_system
checksum 0 checksum 0
# Debug mode renames XML in the temp folder and continues running
debug 0 debug 0
# By default is 22 (for ssh) # By default is 22 (for ssh)
#server_port 22 #server_port 22

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, AIX version # Version 7.0NG.708, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -15,8 +15,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.707-170718 Version: 7.0NG.708-170728
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -14,3 +14,4 @@ if [ -x `command -v systemctl` ]; then
else else
update-rc.d -f pandora_agent_daemon remove update-rc.d -f pandora_agent_daemon remove
fi fi
exit 0

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, GNU/Linux # Version 7.0NG.708, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# Optional. UDP Server to receive orders from outside # Optional. UDP Server to receive orders from outside

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, FreeBSD Version # Version 7.0NG.708, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -18,8 +18,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# Optional. UDP Server to receive orders from outside # Optional. UDP Server to receive orders from outside

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, HP-UX Version # Version 7.0NG.708, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, GNU/Linux # Version 7.0NG.708, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, GNU/Linux # Version 7.0NG.708, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, NetBSD Version # Version 7.0NG.708, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.707, Solaris Version # Version 7.0NG.708, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com
@ -17,8 +17,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default # Interval in seconds, 300 by default
interval 300 interval 300
# Debug mode only generate XML, and stop after first execution, # Debug mode renames XML in the temp folder and continues running
# and does not copy XML to server.
debug 0 debug 0
# By default, agent takes machine name # By default, agent takes machine name

View File

@ -40,8 +40,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.707'; use constant AGENT_VERSION => '7.0NG.708';
use constant AGENT_BUILD => '170718'; use constant AGENT_BUILD => '170728';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -906,14 +906,13 @@ sub fix_directory ($) {
################################################################################ ################################################################################
# Sends a file to the server. # Sends a file to the server.
################################################################################ ################################################################################
#sub send_file ($;$) { #sub send_file ($;$$$) {
sub send_file { sub send_file {
my ($file, $secondary) = @_; my ($file, $secondary, $rc_primary, $flag_always) = @_;
my $output; my $output;
my $pid = fork(); my $pid = fork();
return 1 unless defined $pid; return 1 unless defined $pid;
if ($pid == 0) { if ($pid == 0) {
# execute the transfer program by child process. # execute the transfer program by child process.
eval { eval {
@ -942,14 +941,14 @@ sub send_file {
}; };
if ($@) { 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; exit 1;
} }
# Get the errorlevel # Get the errorlevel
my $rc = $? >> 8; my $rc = $? >> 8;
if ($rc != 0) { 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; exit $rc;
} }
@ -958,39 +957,104 @@ sub send_file {
waitpid ($pid, 0); waitpid ($pid, 0);
my $rc = $? >> 8; 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;
return $rc unless ($Conf{'secondary_mode'} eq 'always' || ($Conf{'secondary_mode'} eq 'on_error' && $rc != 0)); }
else{
swap_servers (); my $rc_secondary = 0;
$rc = send_file ($file); if( ($rc != 0) && ($file =~ /\.data/)){
swap_servers (); $rc_secondary = 1;
return $rc; }
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. # 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 # Read XML files from the temporal directory
opendir(TEMPORAL, $Conf{'temporal'}) or return; opendir(TEMPORAL, $temporal_file) or return;
while (my $xml_file = readdir(TEMPORAL)) { if (defined($flag_always) && ($flag_always == 2)){
swap_servers ();
}
while (my $xml_file = readdir(TEMPORAL)) {
# Skip non data files and symlinks # Skip non data files and symlinks
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$Conf{'temporal'}/$xml_file"); 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);
my $rc = send_file ("$Conf{'temporal'}/$xml_file", 1);
if ($rc == 0) { if ($rc == 0) {
if ($Conf{'debug'} eq '1') { 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 { } 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 # Send buffered XML data files
if ($Conf{'xml_buffer'} == 1) { 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'});
}
} }
} }

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.707 %define version 7.0NG.708
%define release 170718 %define release 170728
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.707 %define version 7.0NG.708
%define release 170718 %define release 170728
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.707" PI_VERSION="7.0NG.708"
PI_BUILD="170718" PI_BUILD="170728"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0
@ -150,6 +150,13 @@ uninstall () {
rm /Library/LaunchDaemons/com.pandorafms.pandorafms.plist 2> /dev/null rm /Library/LaunchDaemons/com.pandorafms.pandorafms.plist 2> /dev/null
fi 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..." echo "Removing Pandora FMS Agent..."
rm -Rf $PANDORA_BASE$PANDORA_BIN 2> /dev/null rm -Rf $PANDORA_BASE$PANDORA_BIN 2> /dev/null
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2014 Artica Soluciones Tecnologicas # (c) 2006-2014 Artica Soluciones Tecnologicas
# Version 7.0NG.707 # Version 7.0NG.708
# This program is Free Software, you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.707} {Pandora FMS Windows Agent v7.0NG.708}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{170718} {170728}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.707(Build 170718)") #define PANDORA_VERSION ("7.0NG.708(Build 170728)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.707-170718 Version: 7.0NG.708-170728
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -528,24 +528,24 @@ function mainAgentsModules() {
echo '<a href="javascript:'.$link.'">'; echo '<a href="javascript:'.$link.'">';
switch ($status) { switch ($status) {
case AGENT_MODULE_STATUS_NORMAL: 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; break;
case AGENT_MODULE_STATUS_CRITICAL_BAD: 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; break;
case AGENT_MODULE_STATUS_WARNING: 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; break;
case AGENT_MODULE_STATUS_UNKNOWN: 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; break;
case AGENT_MODULE_STATUS_NORMAL_ALERT: case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT: case AGENT_MODULE_STATUS_WARNING_ALERT:
case AGENT_MODULE_STATUS_CRITICAL_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; break;
case 4: 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; break;
} }
echo '</a>'; echo '</a>';

View File

@ -1,2 +1,17 @@
START TRANSACTION;
alter table tusuario add autorefresh_white_list text not null default ''; alter table tusuario add autorefresh_white_list text not null default '';
ALTER TABLE tserver_export MODIFY name varchar(600) BINARY 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;

View File

@ -181,6 +181,20 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` (
UNIQUE (`id_policy`, `id_agent`) UNIQUE (`id_policy`, `id_agent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) 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` -- Table `tdashboard`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -1337,6 +1351,16 @@ CREATE TABLE IF NOT EXISTS `tcontainer` (
INSERT INTO `tcontainer` SET `name` = 'Default graph container'; 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` date default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tcontainer_item` -- Table `tcontainer_item`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------

View File

@ -239,6 +239,16 @@ if ($create_agent) {
$agent_created_ok = true; $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 . $info = 'Name: ' . $nombre_agente .
' IP: ' . $direccion_agente . ' IP: ' . $direccion_agente .
' Group: ' . $grupo . ' 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. $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)); $result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
if ($result === false) { if ($result === false) {
ui_print_error_message( 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)); 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 . $info = 'Group: ' . $grupo . ' Interval: ' . $intervalo .
' Comments: ' . $comentarios . ' Mode: ' . $modo . ' Comments: ' . $comentarios . ' Mode: ' . $modo .
' ID OS: ' . $id_os . ' Disabled: ' . $disabled . ' ID OS: ' . $id_os . ' Disabled: ' . $disabled .
@ -954,10 +1000,11 @@ if ($update_module || $create_module) {
$macros = io_json_mb_encode($macros); $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) { foreach ($conf_array as $line) {
if (preg_match("/^module_name\s*(.*)/", $line, $match)) { 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 // We delete from conf all the module macros starting with _field
else if(!preg_match("/^module_macro_field.*/", $line, $match)) { 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)); $macros_for_data = enterprise_hook('config_agents_get_macros_data_conf', array($_POST));
if ($macros_for_data !== ENTERPRISE_NOT_HOOK && $macros_for_data != '') { if ($macros_for_data !== ENTERPRISE_NOT_HOOK && $macros_for_data != '') {
// Add macros to configuration file // Add macros to configuration file
$new_configuration_data = str_replace('module_end', $macros_for_data."module_end", $new_configuration_data); $new_configuration_data = str_replace('module_end', $macros_for_data."module_end", $new_configuration_data);
} }
*/
$configuration_data = $new_configuration_data; $configuration_data = str_replace('\\', "&#92;",
io_safe_input($new_configuration_data));;
html_debug($configuration_data, true);
} }
// Services are an enterprise feature, // Services are an enterprise feature,
@ -1182,7 +1243,7 @@ if ($update_module) {
'min_ff_event_critical' => $ff_event_critical, 'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff, 'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout, 'ff_timeout' => $ff_timeout,
'unit' => $unit, 'unit' => io_safe_output($unit),
'macros' => $macros, 'macros' => $macros,
'quiet' => $quiet_module, 'quiet' => $quiet_module,
'critical_instructions' => $critical_instructions, 'critical_instructions' => $critical_instructions,
@ -1342,7 +1403,7 @@ if ($create_module) {
'min_ff_event_critical' => $ff_event_critical, 'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff, 'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout, 'ff_timeout' => $ff_timeout,
'unit' => $unit, 'unit' => io_safe_output($unit),
'macros' => $macros, 'macros' => $macros,
'quiet' => $quiet_module, 'quiet' => $quiet_module,
'critical_instructions' => $critical_instructions, 'critical_instructions' => $critical_instructions,

View File

@ -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=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>'; '<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>";
echo "<th>".__('Type'). "</th>";
echo "<th>".__('Group'). ' ' . 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=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>'; '<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'>"; echo "<td class='$tdcolor' align='left' valign='middle'>";
ui_print_os_icon ($agent["id_os"], false); ui_print_os_icon ($agent["id_os"], false);
echo "</td>"; 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 // Group icon and name
echo "<td class='$tdcolor' align='left' valign='middle'>" . ui_print_group_icon ($id_grupo, true)."</td>"; echo "<td class='$tdcolor' align='left' valign='middle'>" . ui_print_group_icon ($id_grupo, true)."</td>";
// Description // Description

View File

@ -139,9 +139,51 @@ if ($update_agents) {
isset($values['id_grupo'])) { isset($values['id_grupo'])) {
$values['update_module_count'] = 1; // Force an update of the agent cache. $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', $result = db_process_sql_update ('tagente',
$values, $values,
array ('id_agente' => $id_agent)); 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 // Update Custom Fields

View File

@ -41,7 +41,7 @@ if (is_ajax()){
$id_agent = get_parameter('id_agent'); $id_agent = get_parameter('id_agent');
$id_agent_module = get_parameter('id_agent_module'); $id_agent_module = get_parameter('id_agent_module');
$time_lapse = get_parameter('time_lapse'); $time_lapse = get_parameter('time_lapse');
$only_avg = (int) get_parameter('only_avg'); $only_avg = (bool) get_parameter('only_avg');
$values = array( $values = array(
'id_container' => $id_container2, 'id_container' => $id_container2,
@ -76,6 +76,7 @@ if (is_ajax()){
$agent_alias = get_parameter('agent_alias',''); $agent_alias = get_parameter('agent_alias','');
$module_name = get_parameter('module_name',''); $module_name = get_parameter('module_name','');
$tag = get_parameter('tag',0); $tag = get_parameter('tag',0);
$only_avg = (bool) get_parameter('only_avg');
$values = array( $values = array(
'id_container' => $id_container2, 'id_container' => $id_container2,
@ -85,8 +86,8 @@ if (is_ajax()){
'id_module_group' => $module_group, 'id_module_group' => $module_group,
'agent' => $agent_alias, 'agent' => $agent_alias,
'module' => $module_name, 'module' => $module_name,
'id_tag' => $tag); 'id_tag' => $tag,
'only_average' => $only_avg);
$id_item = db_process_sql_insert('tcontainer_item', $values); $id_item = db_process_sql_insert('tcontainer_item', $values);
return; return;
} }
@ -433,7 +434,13 @@ if($edit_container){
$tag, '', __('Any'), 0, true, false, false); $tag, '', __('Any'), 0, true, false, false);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
$data = array();
$data[0] = __('Only average');
$data[1] = html_print_checkbox('only_avg', 1, false,true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array(); $data = array();
$data[0] = ""; $data[0] = "";
$data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>"; $data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>";
@ -592,6 +599,7 @@ echo html_print_input_hidden('id_agent', 0);
var group = $("#container_id_group1").val(); var group = $("#container_id_group1").val();
var module_group = $("#combo_modulegroup").val(); var module_group = $("#combo_modulegroup").val();
var tag = $("#tag").val(); var tag = $("#tag").val();
var only_avg = $("#checkbox-only_avg1").prop("checked");
var id_container = <?php echo $id_container; ?>; var id_container = <?php echo $id_container; ?>;
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "godmode/reporting/create_container", {"page" : "godmode/reporting/create_container",
@ -603,6 +611,7 @@ echo html_print_input_hidden('id_agent', 0);
"module_name" : module_name, "module_name" : module_name,
"tag" : tag, "tag" : tag,
"id_container" : id_container, "id_container" : id_container,
"only_avg" : only_avg,
}, },
function (data, status) { function (data, status) {
var url = location.href.replace('&update_container=1', ""); var url = location.href.replace('&update_container=1', "");

View File

@ -94,7 +94,7 @@ echo "</div>";
}, },
success: function(data) { success: function(data) {
$("#div_"+hash).remove(); $("#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){ if($('div[class *= graph]').length == 0 && $('div[class *= bullet]').length == 0 && $('div[id *= gauge_]').length == 0){
$("#div_"+hash).remove(); $("#div_"+hash).remove();

View File

@ -1124,8 +1124,8 @@ switch ($action) {
$values['treport_custom_sql_id'] = get_parameter('id_custom'); $values['treport_custom_sql_id'] = get_parameter('id_custom');
if ($values['treport_custom_sql_id'] == 0) { if ($values['treport_custom_sql_id'] == 0) {
$values['external_source'] = get_parameter('sql'); $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') { else if ($values['type'] == 'url') {
$values['external_source'] = get_parameter('url'); $values['external_source'] = get_parameter('url');
@ -1214,7 +1214,6 @@ switch ($action) {
break; break;
} }
$resultOperationDB = db_process_sql_update( $resultOperationDB = db_process_sql_update(
'treport_content', 'treport_content',
$values, $values,
@ -1446,8 +1445,8 @@ switch ($action) {
$values['treport_custom_sql_id'] = get_parameter('id_custom'); $values['treport_custom_sql_id'] = get_parameter('id_custom');
if ($values['treport_custom_sql_id'] == 0) { if ($values['treport_custom_sql_id'] == 0) {
$values['external_source'] = get_parameter('sql'); $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') { elseif ($values['type'] == 'url') {
$values['external_source'] = get_parameter('url'); $values['external_source'] = get_parameter('url');

View File

@ -580,8 +580,10 @@ function readFields() {
} }
values['width'] = $("input[name=width]").val(); values['width'] = $("input[name=width]").val();
values['width_data_image'] = $("#data_image_width").val(); values['width_data_image'] = $("#data_image_width").val();
if(values['width_data_image'] != 0 && values['width_data_image'] != undefined){ if(selectedItem == 'simple_value' || creationItem == 'simple_value'){
values['width'] = values['width_data_image']; if(values['width_data_image'] != 0){
values['width'] = values['width_data_image'];
}
} }
values['height'] = $("input[name=height]").val(); values['height'] = $("input[name=height]").val();
values['parent'] = $("select[name=parent]").val(); values['parent'] = $("select[name=parent]").val();
@ -3079,7 +3081,7 @@ function eventsItems(drag) {
} }
if(selectedItem == 'simple_value'){ if(selectedItem == 'simple_value'){
$('#data_image_width').val(event.currentTarget.clientWidth);
var found = $('#'+idItem).find("img"); var found = $('#'+idItem).find("img");
if(found.length > 0){ if(found.length > 0){
@ -3441,6 +3443,7 @@ function click_button_toolbox(id) {
$("#period_row." + id).css('display', 'none'); $("#period_row." + id).css('display', 'none');
break; break;
case 'label': case 'label':
$("#data_image_width").val(100);
toolbuttonActive = creationItem = 'label'; toolbuttonActive = creationItem = 'label';
toggle_item_palette(); toggle_item_palette();
break; break;
@ -3727,4 +3730,4 @@ function showGrid() {
eventsItems(); eventsItems();
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -162,12 +162,12 @@ if ($get_graphs){
tagente_modulo WHERE id_agente_modulo = ". $value['id_agent_module']); tagente_modulo WHERE id_agente_modulo = ". $value['id_agent_module']);
$sql_alias = db_get_all_rows_sql("SELECT alias from tagente $sql_alias = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo[0]['id_agente']); 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( $table .= grafico_modulo_sparse(
$value['id_agent_module'], $value['id_agent_module'],
$value['time_lapse'], $value['time_lapse'],
0, 0,
800, 1000,
300, 300,
'', '',
'', '',
@ -225,11 +225,11 @@ if ($get_graphs){
} else { } else {
$height = 300; $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, $table .= graphic_combined_module($modules,
$weights, $weights,
$value['time_lapse'], $value['time_lapse'],
800, 1000,
$height, $height,
'', '',
'', '',
@ -259,8 +259,10 @@ if ($get_graphs){
} }
break; break;
case 'dynamic_graph': 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'){ if($value['id_group'] === '0'){
$id_group = ""; $id_group = "";
} else { } else {
@ -281,8 +283,10 @@ if ($get_graphs){
$id_tag = " AND ttag_module.id_tag = ".$value['id_tag']; $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 $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 . ". $tag . "WHERE 1=1" . $id_module_group . $module_name .
" AND id_agente IN (SELECT id_agente FROM tagente WHERE 1=1" .$alias.$id_group.")" " 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 $sql_alias2 = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo2[0]['id_agente']); 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( $table .= grafico_modulo_sparse(
$value2['id_agente_modulo'], $value2['id_agente_modulo'],
$value['time_lapse'], $value['time_lapse'],
0, 0,
800, 1000,
300, 300,
'', '',
'', '',

View File

@ -22,8 +22,8 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC170718'; $build_version = 'PC170728';
$pandora_version = 'v7.0NG.707'; $pandora_version = 'v7.0NG.708';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get(); $script_tz = @date_default_timezone_get();

View File

@ -1195,7 +1195,11 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3) {
else { else {
$cascadeProtectionModule = 0; $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', $return = db_process_sql_update('tagente',
array('alias' => $alias, array('alias' => $alias,
'direccion' => $ip, 'direccion' => $ip,
@ -1216,6 +1220,40 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3) {
// register ip for this agent in 'taddress' // register ip for this agent in 'taddress'
agents_add_address ($id_agent, $ip); 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', returnData('string',
array('type' => 'string', 'data' => (int)((bool)$return))); 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' // register ip for this agent in 'taddress'
agents_add_address ($idAgente, $ip); 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', returnData('string',
array('type' => 'string', 'data' => $idAgente)); array('type' => 'string', 'data' => $idAgente));
} }

View File

@ -1653,6 +1653,10 @@ function config_process_config () {
config_update_value ('command_snapshot', 1); 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 // Juanma (06/05/2014) New feature: Custom front page for reports
if (!isset($config['custom_report_front'])) { if (!isset($config['custom_report_front'])) {
config_update_value ('custom_report_front', 0); config_update_value ('custom_report_front', 0);

View File

@ -3581,7 +3581,7 @@ function graph_custom_sql_graph ($id, $width, $height,
* @param string homeurl * @param string homeurl
* @param bool return or echo the result * @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 $config;
global $graphic_type; global $graphic_type;
@ -3598,13 +3598,14 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
$data = array (); $data = array ();
$legend = array(); $legend = array();
$full_legend = array(); $full_legend = array();
$full_legend_date = array();
$cont = 0; $cont = 0;
for ($i = 0; $i < $interval; $i++) { for ($i = 0; $i < $interval; $i++) {
$bottom = $datelimit + ($periodtime * $i); $bottom = $datelimit + ($periodtime * $i);
if (! $graphic_type) { if (! $graphic_type) {
if ($config['flash_charts']) { if ($config['flash_charts']) {
$name = date('H:i', $bottom); $name = date('H:i:s', $bottom);
} }
else { else {
$name = date('H\h', $bottom); $name = date('H\h', $bottom);
@ -3618,6 +3619,11 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
if ($cont == 0 or $cont % 2) if ($cont == 0 or $cont % 2)
$legend[$cont] = $name; $legend[$cont] = $name;
if ($from_agent_view) {
$full_date = date('Y/m/d', $bottom);
$full_legend_date[$cont] = $full_date;
}
$full_legend[$cont] = $name; $full_legend[$cont] = $name;
$top = $datelimit + ($periodtime * ($i + 1)); $top = $datelimit + ($periodtime * ($i + 1));
@ -3646,12 +3652,12 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
} }
$cont++; $cont++;
} }
$colors = array(1 => COL_NORMAL, 2 => COL_WARNING, 3 => COL_CRITICAL, 4 => COL_UNKNOWN); $colors = array(1 => COL_NORMAL, 2 => COL_WARNING, 3 => COL_CRITICAL, 4 => COL_UNKNOWN);
// Draw slicebar graph // Draw slicebar graph
if ($config['flash_charts']) { if ($config['flash_charts']) {
$out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent); $out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent, $full_legend_date);
} }
else { else {
$out = slicesbar_graph($data, $period, $width, $height, $colors, $config['fontpath'], $config['round_corner'], $homeurl); $out = slicesbar_graph($data, $period, $width, $height, $colors, $config['fontpath'], $config['round_corner'], $homeurl);

View File

@ -385,13 +385,28 @@ function html_print_select_groups($id_user = false, $privilege = "AR",
$nothing = '', $nothing_value = 0, $return = false, $nothing = '', $nothing_value = 0, $return = false,
$multiple = false, $sort = true, $class = '', $disabled = false, $multiple = false, $sort = true, $class = '', $disabled = false,
$style = false, $option_style = false, $id_group = 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; global $config;
$fields = users_get_groups_for_select($id_user, $privilege, $fields = users_get_groups_for_select($id_user, $privilege,
$returnAllGroup, true, $id_group, $keys_field); $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) { if ($strict_user) {
$fields = users_get_strict_mode_groups($config['id_user'], $returnAllGroup); $fields = users_get_strict_mode_groups($config['id_user'], $returnAllGroup);
} }

View File

@ -128,26 +128,6 @@ function reporting_make_reporting_data($report = null, $id_report,
$content['period'] = $period; $content['period'] = $period;
} }
if(defined('METACONSOLE')){
if (is_array($content['id_agent'])) {
$new_array = array();
foreach ($content['id_agent'] as $key => $value) {
$meta_id = explode("|",$value);
array_push($new_array,$meta_id[1]);
}
$content['id_agent'] = $new_array;
}
else {
$meta_id = explode("|",$content['id_agent']);
if ($meta_id[1] != null) {
$content['id_agent'] = array();
$content['id_agent'] = $meta_id[1];
}
}
}
$content['style'] = json_decode(io_safe_output($content['style']), true); $content['style'] = json_decode(io_safe_output($content['style']), true);
if(isset($content['style']['name_label'])){ if(isset($content['style']['name_label'])){
//Add macros name //Add macros name
@ -166,19 +146,17 @@ function reporting_make_reporting_data($report = null, $id_report,
continue; 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']);
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']);
if ($metaconsole_on) { if ($metaconsole_on) {
//Restore db connection //Restore db connection
@ -5811,12 +5789,17 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
require_once ($config["homedir"] . '/include/functions_graph.php'); require_once ($config["homedir"] . '/include/functions_graph.php');
if ($config['metaconsole']) { if ($type_report == 'automatic_graph') {
$id_meta = metaconsole_get_id_server($content["server_name"]); // Do none
}
else {
$server = metaconsole_get_connection_by_id ($id_meta); if ($config['metaconsole']) {
metaconsole_connect($server); $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']); $graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
@ -5870,7 +5853,6 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
'id_agent_module'=>$graph_item['id_agent_module']); 'id_agent_module'=>$graph_item['id_agent_module']);
} }
$label = reporting_label_macro($item, $content['style']['label']);
$labels[$graph_item['id_agent_module']] = $label; $labels[$graph_item['id_agent_module']] = $label;
} }
} }
@ -5889,13 +5871,6 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
$height = 50; $height = 50;
} }
} }
if (defined('METACONSOLE')) {
$modules_new = array();
foreach ($modules as $mod) {
$modules_new[] = $mod['module'];
}
$modules = $modules_new;
}
switch ($type) { switch ($type) {
case 'dinamic': case 'dinamic':
@ -10292,6 +10267,7 @@ function reporting_get_agentmodule_sla_working_timestamp ($period, $date_end, $w
} }
function reporting_label_macro ($item, $label) { function reporting_label_macro ($item, $label) {
switch ($item['type']) { switch ($item['type']) {
case 'event_report_agent': case 'event_report_agent':
case 'alert_report_agent': case 'alert_report_agent':
@ -10317,7 +10293,6 @@ function reporting_label_macro ($item, $label) {
$label = str_replace("_address_", $agent_name, $label); $label = str_replace("_address_", $agent_name, $label);
} }
break; break;
case 'automatic_graph':
case 'simple_graph': case 'simple_graph':
case 'module_histogram_graph': case 'module_histogram_graph':
case 'custom_graph': case 'custom_graph':
@ -10337,6 +10312,7 @@ function reporting_label_macro ($item, $label) {
case 'TTO': case 'TTO':
case 'MTBF': case 'MTBF':
case 'MTTR': case 'MTTR':
case 'automatic_graph':
if (preg_match("/_agent_/", $label)) { if (preg_match("/_agent_/", $label)) {
$agent_name = agents_get_alias($item['id_agent']); $agent_name = agents_get_alias($item['id_agent']);
$label = str_replace("_agent_", $agent_name, $label); $label = str_replace("_agent_", $agent_name, $label);

View File

@ -3780,6 +3780,7 @@ function reporting_get_event_histogram ($events, $text_header_event = false) {
); );
} }
} }
$table = new stdClass(); $table = new stdClass();
if (!$text_header_event) { if (!$text_header_event) {
$table->width = '100%'; $table->width = '100%';
@ -3839,6 +3840,157 @@ function reporting_get_event_histogram ($events, $text_header_event = false) {
return $event_graph; 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) { function reporting_html_planned_downtimes_table ($planned_downtimes) {
global $config; global $config;

View File

@ -660,6 +660,28 @@ function ui_print_os_icon ($id_os, $name = true, $return = false,
return $output; 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 * Prints an agent name with the correct link
* *

View File

@ -314,8 +314,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['module_row']['html'] = '<td align="left">' . $form_items['module_row']['html'] = '<td align="left">' .
__('Module') . '</td> __('Module') . '</td>
<td align="left">' . <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>'; </td>';
$event_times = array(86400 => __('24h'), $event_times = array(86400 => __('24h'),
28800 => __('8h'), 28800 => __('8h'),

View File

@ -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); values = values.split(separator2);
labels = labels.split(separator); labels = labels.split(separator);
legend = legend.split(separator); legend = legend.split(separator);
acumulate_data = acumulate_data.split(separator); acumulate_data = acumulate_data.split(separator);
datacolor = datacolor.split(separator); datacolor = datacolor.split(separator);
if (full_legend != false) {
full_legend = full_legend.split(separator);
}
// Check possible adapt_keys on classes // Check possible adapt_keys on classes
check_adaptions(graph_id); check_adaptions(graph_id);
@ -719,25 +722,43 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
} }
}); });
$('#'+graph_id).bind('plotclick', function(event, pos, item) { $('#'+graph_id).bind('plotclick', function(event, pos, item) {
if (item) { if (item) {
//from time //from time
var from = legend[item.seriesIndex]; var from = legend[item.seriesIndex];
//to time //to time
var to = legend[item.seriesIndex+1]; var to = legend[item.seriesIndex+1];
//current date //current date
var dateObj = new Date(); var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate(); if (full_legend != "") {
var year = dateObj.getUTCFullYear(); newdate = full_legend[item.seriesIndex];
newdate = year + "/" + month + "/" + day; newdate2 = full_legend[item.seriesIndex+1];
}
if(!to){ else {
to= '23:59'; var month = dateObj.getUTCMonth() + 1; //months from 1-12
} var day = dateObj.getUTCDate();
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'; 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('mouseout',resetInteractivity); $('#'+graph_id).bind('mouseout',resetInteractivity);
} }

View File

@ -846,7 +846,7 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon
return $return; 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; global $config;
include_javascript_dependencies_flot_graph(); include_javascript_dependencies_flot_graph();
@ -932,7 +932,6 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
$acumulate += $value; $acumulate += $value;
$c++; $c++;
//$return .= "<div id='value_".$i."_$graph_id' class='values_$graph_id' style='color: #000; position:absolute;'>$value</div>";
if ($value > $max) { if ($value > $max) {
$max = $value; $max = $value;
} }
@ -943,6 +942,12 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
$labels = implode($separator,$labels); $labels = implode($separator,$labels);
$datacolor = implode($separator,$datacolor); $datacolor = implode($separator,$datacolor);
$legend = io_safe_output(implode($separator,$legend)); $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)); $acumulate_data = io_safe_output(implode($separator,$acumulate_data));
// Store data series in javascript format // Store data series in javascript format
@ -966,7 +971,7 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
// Javascript code // Javascript code
$return .= "<script type='text/javascript'>"; $return .= "<script type='text/javascript'>";
$return .= "//<![CDATA[\n"; $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 .= "\n//]]>";
$return .= "</script>"; $return .= "</script>";

View File

@ -4165,4 +4165,25 @@ div#footer_help{
/*view-agents lastest events for this agent*/ /*view-agents lastest events for this agent*/
#div_all_events_24h{ #div_all_events_24h{
padding: 4px; 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;
} }

View File

@ -584,6 +584,13 @@ if (! isset ($config['id_user'])) {
$res = update_user_password ($id_user, $pass1); $res = update_user_password ($id_user, $pass1);
if ($res) { if ($res) {
$correct_reset_pass_process = __('Password changed successfully'); $correct_reset_pass_process = __('Password changed successfully');
$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;
db_process_sql_insert('treset_pass_history', $values);
} }
else { else {
$process_error_message = __('Failed to change password'); $process_error_message = __('Failed to change password');
@ -641,7 +648,7 @@ if (! isset ($config['id_user'])) {
if (!$check_user) { if (!$check_user) {
$reset = false; $reset = false;
$error = __('User doesn\'t exist in database'); $error = __('Error in reset password request');
$show_error = true; $show_error = true;
} }
else { else {

View File

@ -70,8 +70,8 @@
<body> <body>
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.707'; $version = '7.0NG.708';
$build = '170718'; $build = '170728';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -466,7 +466,10 @@ else {
'unknown_count', 'unknown_count',
'notinit_count', 'notinit_count',
'total_count', 'total_count',
'fired_count'), 'fired_count',
'ultimo_contacto_remoto',
'remote',
'agent_version'),
$access, $access,
$order); $order);
} }
@ -498,11 +501,11 @@ $table->head[1] = __('Description'). ' ' .
$table->size[1] = "16%"; $table->size[1] = "16%";
$table->head[9] = __('Remote'). ' ' . $table->head[10] = __('Remote'). ' ' .
'<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=remote&amp;sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectRemoteUp, "alt" => "up")) . '</a>' . '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=remote&amp;sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectRemoteUp, "alt" => "up")) . '</a>' .
'<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=remote&amp;sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectRemoteDown, "alt" => "down")) . '</a>'; '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=remote&amp;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'). ' ' . $table->head[2] = __('OS'). ' ' .
'<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=os&amp;sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp, "alt" => "up")) . '</a>' . '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=os&amp;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'). ' ' . $table->head[4] = __('Group'). ' ' .
'<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=group&amp;sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp, "alt" => "up")) . '</a>' . '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=group&amp;sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp, "alt" => "up")) . '</a>' .
'<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=group&amp;sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown, "alt" => "down")) . '</a>'; '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=group&amp;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->head[5] = __('Type');
$table->size[5] = "10%"; $table->size[5] = "8%";
$table->head[6] = __('Status'); $table->head[6] = __('Modules');
$table->size[6] = "4%"; $table->size[6] = "10%";
$table->head[7] = __('Alerts'); $table->head[7] = __('Status');
$table->size[7] = "4%"; $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&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=last_contact&amp;sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp, "alt" => "up")) . '</a>' . '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=last_contact&amp;sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp, "alt" => "up")) . '</a>' .
'<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=last_contact&amp;sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectLastContactDown, "alt" => "down")) . '</a>'; '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=' . $refr . '&amp;offset=' . $offset . '&amp;group_id=' . $group_id . '&amp;recursion=' . $recursion . '&amp;search=' . $search . '&amp;status='. $status . '&amp;sort_field=last_contact&amp;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 (); $table->align = array ();
@ -542,9 +548,9 @@ $table->align[5] = "left";
$table->align[6] = "left"; $table->align[6] = "left";
$table->align[7] = "left"; $table->align[7] = "left";
$table->align[8] = "left"; $table->align[8] = "left";
$table->align[9] = "left";
$table->style = array(); $table->style = array();
//$table->style[0] = 'width: 15%';
$table->data = array (); $table->data = array ();
@ -584,14 +590,14 @@ foreach ($agents as $agent) {
$data[1] = ui_print_truncate_text($agent["description"], 'description', false, true, true, '[&hellip;]', 'font-size: 6.5pt'); $data[1] = ui_print_truncate_text($agent["description"], 'description', false, true, true, '[&hellip;]', 'font-size: 6.5pt');
$data[9] = ""; $data[10] = "";
if (enterprise_installed()) { if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php'); enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) { 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); $data[4] = ui_print_group_icon ($agent["id_grupo"], true);
$agent['not_init_count'] = $agent['notinit_count']; $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[9] = agents_get_interval_status ($agent);
$data[7] = $alert_img;
$data[8] = agents_get_interval_status ($agent);
// This old code was returning "never" on agents without modules, BAD !! // This old code was returning "never" on agents without modules, BAD !!
// And does not print outdated agents in red. WRONG !!!! // And does not print outdated agents in red. WRONG !!!!

View File

@ -602,7 +602,7 @@ $data[0][0] .=
__('Events (24h)') . __('Events (24h)') .
'</th></tr>' . '</th></tr>' .
'<tr><td style="text-align:center;"><br />' . '<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>' . '<br /></td></tr>' .
'</table>'; '</table>';

View File

@ -543,8 +543,6 @@ $table_advanced->rowclass[] = '';
$data = array(); $data = array();
$data[0] = __('Date from') . $jump; $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[0] .= html_print_input_text ('date_from', $date_from, '', 15, 10, true);
$data[1] = __('Date to') . $jump; $data[1] = __('Date to') . $jump;

View File

@ -246,7 +246,7 @@ switch ($opt) {
$row = array(); $row = array();
$row[] = __('Agent'); $row[] = __('Agent');
$row[] = '<a style="font-weight: bolder;" href="?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' $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; $table->data[] = $row;
// Position // Position

View File

@ -242,6 +242,7 @@ if ($config["pure"] != 0) {
var new_height = $(document).height(); var new_height = $(document).height();
$("#map").css("height", new_height - 60); $("#map").css("height", new_height - 60);
$("svg[id*=OpenLayers]").css("height", new_height - 60);
}); });
</script> </script>

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.707 %define version 7.0NG.708
%define release 170718 %define release 170728
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.707 %define version 7.0NG.708
%define release 170718 %define release 170728
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.707" PI_VERSION="7.0NG.708"
FORCE=0 FORCE=0
DESTDIR="" DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -1143,6 +1143,16 @@ CREATE TABLE IF NOT EXISTS `tuser_double_auth` (
FOREIGN KEY (`id_user`) REFERENCES tusuario(`id_user`) ON DELETE CASCADE FOREIGN KEY (`id_user`) REFERENCES tusuario(`id_user`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- 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 default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
-- Table `tnews` -- Table `tnews`
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
@ -2168,6 +2178,20 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` (
UNIQUE (`id_policy`, `id_agent`) UNIQUE (`id_policy`, `id_agent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) 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` -- Table `tdashboard`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.707-170718 Version: 7.0NG.708-170728
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -607,13 +607,7 @@ sub main() {
$server->update(); $server->update();
} }
# Update fallen servers db_do ($DBH, "UPDATE tserver SET status = 0 WHERE now()-keepalive > 2*server_keepalive");
my @servers_db = get_db_rows ($DBH, "SELECT id_server, server_keepalive FROM tserver");
for (@servers_db) {
my %server_db = %$_;
my $expected_update = strftime ("%Y-%m-%d %H:%M:%S", localtime(time() - $server_db{'server_keepalive'} * 2));
db_do ($DBH, "UPDATE tserver SET status = 0 WHERE keepalive < ? AND id_server = ?", $expected_update, $server_db{'id_server'});
}
# Set the master server # Set the master server
pandora_set_master(\%Config, $DBH); pandora_set_master(\%Config, $DBH);

View File

@ -1,7 +1,7 @@
############################################################################# #############################################################################
# Pandora FMS Server Parameters # Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System. # Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.707 # Version 7.0NG.708
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2016 Artica Soluciones Tecnologicas # (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -42,8 +42,8 @@ our @EXPORT = qw(
); );
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.707"; my $pandora_version = "7.0NG.708";
my $pandora_build = "170718"; my $pandora_build = "170728";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -2,8 +2,8 @@
# Pandora FMS Server # Pandora FMS Server
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.707 %define version 7.0NG.708
%define release 170718 %define release 170728
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server # Pandora FMS Server
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.707 %define version 7.0NG.708
%define release 170718 %define release 170728
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.707" PI_VERSION="7.0NG.708"
PI_BUILD="170718" PI_BUILD="170728"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.707 PS170718"; my $version = "7.0NG.708 PS170728";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.707 PS170718"; my $version = "7.0NG.708 PS170728";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);

View File

@ -0,0 +1,17 @@
Pandora FMS XML count tool
==========================
This is a small diagnosis tool that counts XML data files in Pandora FMS's spool directory by agent.
Usage example
-------------
$ perl ./pandora_xml_count.pl /var/spool/pandora_data_in
Number of .data files Agent name
--------------------- ----------
1 Agent80
1 Agent25
42 Agent22
... ...
41122 Agent21

View File

@ -0,0 +1,55 @@
#!/usr/bin/perl
################################################################################
# Pandora XML count tool.
################################################################################
# Copyright (c) 2017 Artica Soluciones Tecnologicas S.L.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
################################################################################
use strict;
use warnings;
# Check command line arguments.
if (!defined($ARGV[0])) {
die("Usage: $0 <path to Pandora FMS's spool directory>\n\n");
}
my $spool_dir = $ARGV[0];
# Open Pandora's spool directory.
opendir(my $dh, $spool_dir) || die("Error opening directory $spool_dir: $!\n\n");
# Count files by agent.
my %totals;
while (my $file = readdir($dh)) {
# Skip . and ..
next if ($file eq '.') or ($file eq '..');
# Skip files unknown to the Data Server.
next if ($file !~ /^(.*)[\._]\d+\.data$/);
# Update the totals.
my $agent = $1;
if (!defined($totals{$agent})) {
$totals{$agent} = 1;
} else {
$totals{$agent} += 1;
}
}
closedir($dh);
# Print the totals.
print "Number of .data files\t\tAgent name\n";
print "---------------------\t\t----------\n";
foreach my $agent (sort { $totals{$a} <=> $totals{$b}} keys(%totals)) {
print "$totals{$agent}\t\t\t\t$agent\n";
}