Merge branch 'develop' into '1071-Formulario-gráfica-combinada-automática-open'

# Conflicts:
#   pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
This commit is contained in:
Enrique Camargo 2017-07-28 10:34:06 +02:00
commit 88879462a3
131 changed files with 49087 additions and 40991 deletions

View File

@ -127094,7 +127094,7 @@ msgstr ""
#: ../../Documentos/Pandoras/pandorafms_develop/pandora_console/godmode/setup/setup_ehorus.php:87
#: ../../Documentos/COPIA SEG/godmode/setup/setup_ehorus.php:87
#: ../../code/pandorafms/pandora_console/godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr ""
#: ../../Documentos/Pandoras/pandorafms_develop/pandora_console/godmode/setup/setup_ehorus.php:92

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,8 +40,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.705';
use constant AGENT_BUILD => '170629';
use constant AGENT_VERSION => '7.0NG.708';
use constant AGENT_BUILD => '170728';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -906,14 +906,13 @@ sub fix_directory ($) {
################################################################################
# Sends a file to the server.
################################################################################
#sub send_file ($;$) {
#sub send_file ($;$$$) {
sub send_file {
my ($file, $secondary) = @_;
my ($file, $secondary, $rc_primary, $flag_always) = @_;
my $output;
my $pid = fork();
return 1 unless defined $pid;
if ($pid == 0) {
# execute the transfer program by child process.
eval {
@ -942,14 +941,14 @@ sub send_file {
};
if ($@) {
log_message ('error', "Error sending file '$file': File transfer command is not responding.");
log_message ('error', "Error sending file '$file' to '" . $Conf{'server_ip'} . ":" . $Conf{'server_port'}. "': File transfer command is not responding.");
exit 1;
}
# Get the errorlevel
my $rc = $? >> 8;
if ($rc != 0) {
log_message ('error', "Error sending file '$file': $output");
log_message ('error', "Error sending file '$file' to '" . $Conf{'server_ip'} . ":" . $Conf{'server_port'}. "': $output");
}
exit $rc;
}
@ -958,39 +957,104 @@ sub send_file {
waitpid ($pid, 0);
my $rc = $? >> 8;
return $rc unless (defined ($secondary));
if( ($Conf{'secondary_mode'} eq 'always') && ( !defined($flag_always) ) ){
# Send the file to the secondary server
return $rc unless ($Conf{'secondary_mode'} eq 'always');
if(defined ($secondary)){
if( ($rc != 0 && ($file =~ /\.data/)) ){
$rc_primary = 1;
}
swap_servers ();
$rc = send_file ($file, undef, $rc_primary);
swap_servers ();
# Send the file to the secondary server
return $rc unless ($Conf{'secondary_mode'} eq 'always' || ($Conf{'secondary_mode'} eq 'on_error' && $rc != 0));
swap_servers ();
$rc = send_file ($file);
swap_servers ();
return $rc;
return $rc;
}
else{
my $rc_secondary = 0;
if( ($rc != 0) && ($file =~ /\.data/)){
$rc_secondary = 1;
}
if ( $rc_secondary == 1 && defined($rc_primary) ){
return 1;
}
if ( $rc_secondary == 1 ){
if (! -d "$Conf{'temporal'}/secondary"){
mkdir "$Conf{'temporal'}/secondary";
}
eval {
copy("$file", "$Conf{'temporal'}/secondary/");
};
if ($@) {
# We shouldn't reach this point...
die ("Cannot write on $Conf{'temporal'}/secondary/");
}
return 0;
}
if ( defined($rc_primary) ){
if (! -d "$Conf{'temporal'}/primary"){
mkdir "$Conf{'temporal'}/primary";
}
eval {
copy("$file", "$Conf{'temporal'}/primary/");
};
if ($@) {
# We shouldn't reach this point...
die ("Cannot write on $Conf{'temporal'}/primary/");
}
return 0;
}
if ( $rc_secondary == 0 && !defined($rc_primary) ){
return 0;
}
}
}
elsif ( ($Conf{'secondary_mode'} eq 'always') && defined($flag_always) ){
return $rc;
}
else{
return $rc unless (defined ($secondary));
# Send the file to the secondary server
return $rc unless ($Conf{'secondary_mode'} eq 'always' || ($Conf{'secondary_mode'} eq 'on_error' && $rc != 0));
swap_servers ();
$rc = send_file ($file);
swap_servers ();
return $rc;
}
}
################################################################################
# Send buffered XML files.
################################################################################
sub send_buffered_xml_files () {
sub send_buffered_xml_files ($;$) {
my ($temporal_file, $flag_always) = @_;
# Read XML files from the temporal directory
opendir(TEMPORAL, $Conf{'temporal'}) or return;
while (my $xml_file = readdir(TEMPORAL)) {
opendir(TEMPORAL, $temporal_file) or return;
if (defined($flag_always) && ($flag_always == 2)){
swap_servers ();
}
while (my $xml_file = readdir(TEMPORAL)) {
# Skip non data files and symlinks
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$Conf{'temporal'}/$xml_file");
my $rc = send_file ("$Conf{'temporal'}/$xml_file", 1);
next if ($xml_file !~ m/^$Conf{'agent_name'}\.[0-9]+\.data$/ || -l "$temporal_file/$xml_file");
my $rc = send_file ("$temporal_file/$xml_file", 1, undef, $flag_always);
if ($rc == 0) {
if ($Conf{'debug'} eq '1') {
rename "$Conf{'temporal'}/$xml_file", "$Conf{'temporal'}/$xml_file". "sent";
rename "$temporal_file/$xml_file", "$temporal_file/$xml_file". "sent";
} else {
unlink ("$Conf{'temporal'}/$xml_file");
unlink ("$temporal_file/$xml_file");
}
}
}
if (defined($flag_always) && ($flag_always == 2)){
swap_servers ();
}
}
################################################################################
@ -2769,7 +2833,20 @@ while (1) {
# Send buffered XML data files
if ($Conf{'xml_buffer'} == 1) {
send_buffered_xml_files ();
if($Conf{'secondary_mode'} eq 'always'){
$Conf{'__temporal_primary'} = "$Conf{'temporal'}/primary";
$Conf{'__temporal_secondary'} = "$Conf{'temporal'}/secondary";
if (-d "$Conf{'__temporal_primary'}"){
send_buffered_xml_files ($Conf{'__temporal_primary'}, 1);
}
if (-d "$Conf{'__temporal_secondary'}"){
send_buffered_xml_files ($Conf{'__temporal_secondary'}, 2);
}
send_buffered_xml_files ($Conf{'temporal'});
}
else{
send_buffered_xml_files ($Conf{'temporal'});
}
}
}

View File

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

View File

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

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.705"
PI_BUILD="170629"
PI_VERSION="7.0NG.708"
PI_BUILD="170728"
OS_NAME=`uname -s`
FORCE=0
@ -150,6 +150,13 @@ uninstall () {
rm /Library/LaunchDaemons/com.pandorafms.pandorafms.plist 2> /dev/null
fi
# Stops the agent on uninstall
if [ -f $PANDORA_BASE/etc/init.d/pandora_agent_daemon ]; then
$PANDORA_BASE/etc/init.d/pandora_agent_daemon stop 12> /dev/null
else
echo "$PANDORA_BASE/etc/init.d/pandora_agent_daemon not found to stop agent"
fi
echo "Removing Pandora FMS Agent..."
rm -Rf $PANDORA_BASE$PANDORA_BIN 2> /dev/null
rm -Rf $PANDORA_BASE$PANDORA_EXEC_BIN 2> /dev/null

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2014 Artica Soluciones Tecnologicas
# Version 7.0NG.705
# Version 7.0NG.708
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
@ -36,7 +36,7 @@ temporal "%ProgramFiles%\pandora_agent\temp"
# If set to __rand__ the agent will generate a random name.
#agent_name_cmd cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\agentname.vbs"
agent_name_cmd __rand__
#Parent agent_name
#parent_agent_name caprica
@ -77,7 +77,7 @@ server_port 41121
# If set to 1 disables log writing into pandora_agent.log
#disable_logfile 1
# Debug mode do not copy XML data files to server.
# Debug mode renames XML in the temp folder and continues running
# debug 1
# If set to 1 allows the agent to be configured via the web console

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -93,7 +93,7 @@ function mainAgentsAlerts() {
$groups = users_get_groups ();
$filter_groups .= '<b>'.__('Group').'</b>';
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'width: 100px; margin-right: 10px;; margin-top: 5px;');
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'margin-right: 10px; margin-top: 5px;');
$check = '<b>'.__('Show modules without alerts').'</b>';
$check .= html_print_checkbox('slides_ids[]', $d['id'], $show_modules, true, false, '', true);

View File

@ -528,24 +528,24 @@ function mainAgentsModules() {
echo '<a href="javascript:'.$link.'">';
switch ($status) {
case AGENT_MODULE_STATUS_NORMAL:
ui_print_status_image ('module_ok.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
ui_print_status_image ('module_ok.png', modules_get_last_value($module_id), false);
break;
case AGENT_MODULE_STATUS_CRITICAL_BAD:
ui_print_status_image ('module_critical.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
ui_print_status_image ('module_critical.png', modules_get_last_value($module_id), false);
break;
case AGENT_MODULE_STATUS_WARNING:
ui_print_status_image ('module_warning.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
ui_print_status_image ('module_warning.png', modules_get_last_value($module_id), false);
break;
case AGENT_MODULE_STATUS_UNKNOWN:
ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false);
break;
case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT:
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
ui_print_status_image ('module_alertsfired.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
ui_print_status_image ('module_alertsfired.png', modules_get_last_value($module_id), false);
break;
case 4:
ui_print_status_image ('module_no_data.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
ui_print_status_image ('module_no_data.png', modules_get_last_value($module_id), false);
break;
}
echo '</a>';

View File

@ -127,7 +127,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
ui_print_error_message(
__('Unsuccessful installed tables into the testing DB'));
}
else {
else {/*
if (enterprise_installed()) {
$install_tables_enterprise =
extension_db_status_execute_sql_file(
@ -139,7 +139,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
__('Unsuccessful installed enterprise tables into the testing DB'));
}
}
*/
extension_db_check_tables_differences(
$connection_test,
$connection_system,
@ -159,6 +159,7 @@ function extension_db_check_tables_differences($connection_test,
global $config;
// --------- Check the tables --------------------------------------
mysql_select_db($db_name_test, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test);
@ -170,9 +171,8 @@ function extension_db_check_tables_differences($connection_test,
//~ $tables_test = array_merge($tables_test,
//~ extension_db_status_extension_tables());
mysql_select_db($db_name_system, $connection_system);
$result = mysql_query("SHOW TABLES", $connection_system);
mysql_select_db($db_name_system, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test);
$tables_system = array();
while ($row = mysql_fetch_array ($result)) {
$tables_system[] = $row[0];
@ -227,8 +227,8 @@ function extension_db_check_tables_differences($connection_test,
mysql_select_db($db_name_system, $connection_system);
$result = mysql_query("EXPLAIN " . $table, $connection_system);
mysql_select_db($db_name_system, $connection_test);
$result = mysql_query("EXPLAIN " . $table, $connection_test);
$fields_system = array();
if (!empty($result)) {
while ($row = mysql_fetch_array ($result)) {

View File

@ -0,0 +1,17 @@
START TRANSACTION;
alter table tusuario add autorefresh_white_list text not null default '';
ALTER TABLE tserver_export MODIFY name varchar(600) BINARY NOT NULL default '';
CREATE TABLE IF NOT EXISTS `tpolicy_groups` (
`id` int(10) unsigned NOT NULL auto_increment,
`id_policy` int(10) unsigned default '0',
`id_group` int(10) unsigned default '0',
`policy_applied` tinyint(1) unsigned default '0',
`pending_delete` tinyint(1) unsigned default '0',
`last_apply_utimestamp` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
UNIQUE (`id_policy`, `id_group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;

View File

@ -181,6 +181,20 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` (
UNIQUE (`id_policy`, `id_agent`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `tpolicy_groups`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tpolicy_groups` (
`id` int(10) unsigned NOT NULL auto_increment,
`id_policy` int(10) unsigned default '0',
`id_group` int(10) unsigned default '0',
`policy_applied` tinyint(1) unsigned default '0',
`pending_delete` tinyint(1) unsigned default '0',
`last_apply_utimestamp` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`),
UNIQUE (`id_policy`, `id_group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tdashboard`
-- ---------------------------------------------------------------------
@ -710,6 +724,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`module_names` TEXT,
`module_free_text` TEXT,
`each_agent` tinyint(1) default 1,
`historical_db` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
@ -1135,10 +1150,10 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 1);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 4);
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '704');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '708');
-- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents`
@ -1167,6 +1182,7 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
ALTER TABLE tusuario ADD COLUMN `id_filter` int(10) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE tusuario ADD CONSTRAINT `fk_id_filter` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter(`id_filter`) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default '0';
alter table tusuario add autorefresh_white_list text not null default '';
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
@ -1335,6 +1351,16 @@ CREATE TABLE IF NOT EXISTS `tcontainer` (
INSERT INTO `tcontainer` SET `name` = 'Default graph container';
-- ----------------------------------------------------------------------
-- Table `treset_pass_history`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `treset_pass_history` (
`id` int(10) unsigned NOT NULL auto_increment,
`id_user` varchar(60) NOT NULL,
`reset_moment` date default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tcontainer_item`
-- ---------------------------------------------------------------------
@ -1371,6 +1397,12 @@ UPDATE tgis_map_connection SET conection_data = '{"type":"OSM","url":"http://til
ALTER TABLE tpolicy_modules MODIFY post_process double(24,15) default 0;
-- ---------------------------------------------------------------------
-- Table `tserver_export`
-- ---------------------------------------------------------------------
ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default '';
-- ---------------------------------------------------------------------
-- Table `tgraph_source` column 'id_server'
-- ---------------------------------------------------------------------
@ -1387,4 +1419,4 @@ PREPARE pr_oum707 FROM @st_oum707;
EXECUTE pr_oum707;
DEALLOCATE PREPARE pr_oum707;
COMMIT;
COMMIT;

View File

@ -0,0 +1,25 @@
<?php
include_once ('include/config.php');
include_once ('include/functions.php');
include_once ('include/functions_db.php');
include_once ('include/auth/mysql.php');
$id = get_parameter('get_image');
$sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = '.$id;
$result = db_get_sql($sql);
$image = strpos($result, 'data:image');
if($image === false){
echo 0;
}
else{
echo 1;
}
?>

View File

@ -32,13 +32,18 @@ if (!$config["MR"]) {
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">';
if($current_package == 0){
$build_package_version = $build_version;
}
else{
$build_package_version = $current_package;
if(enterprise_installed()){
enterprise_include_once("../include/functions_update_manager.php");
}
$current_package = update_manager_get_current_package();
if($current_package == 0){
$build_package_version = $build_version;
}
else{
$build_package_version = $current_package;
}
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_package_version, $config["MR"]));

View File

@ -191,7 +191,9 @@ config_check();
$_GET['refr'] = null;
}
if ($config['autorefresh_white_list'] !== null && array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) {
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
if ($_GET['refr']) {
@ -354,7 +356,7 @@ config_check();
var new_chat = <?php echo (int)$_SESSION['new_chat'];?>;
$(document).ready (function () {
<?php
if (($config['autorefresh_white_list'] !== null) && (array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) && (!isset($_GET["refr"]))) {
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET["refr"]))) {
?>
$("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle ();

View File

@ -119,7 +119,7 @@ $(document).ready (function () {
// Update config['skip_login_help_dialog'] to don't display more this message
if (skip_login_help) {
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{"page": "general/login_help_dialog",
"skip_login_help": 1},
function (data) {}

View File

@ -134,6 +134,11 @@ echo '<div class="login_page">';
switch ($login_screen) {
case 'logout':
case 'login':
if (!empty ($page) && !empty ($sec)) {
foreach ($_POST as $key => $value) {
html_print_input_hidden (io_safe_input($key), $value);
}
}
if ($config['auth'] == 'saml') {
echo '<div id="log_nick" class="login_nick" style="display: none;">';
echo '<div>';
@ -185,6 +190,11 @@ echo '<div class="login_page">';
break;
case 'double_auth':
if (!empty ($page) && !empty ($sec)) {
foreach ($_POST as $key => $value) {
html_print_input_hidden (io_safe_input($key), $value);
}
}
echo '<div class="login_nick">';
echo '<div>';
html_print_image ("/images/icono_autenticacion.png", false);

View File

@ -239,6 +239,16 @@ if ($create_agent) {
$agent_created_ok = true;
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$grupo);
if($tpolicy_group_old){
foreach ($tpolicy_group_old as $key => $old_group) {
db_process_sql_insert ('tpolicy_agents',
array('id_policy' => $old_group['id_policy'], 'id_agent' => $id_agente));
}
}
$info = 'Name: ' . $nombre_agente .
' IP: ' . $direccion_agente .
' Group: ' . $grupo .
@ -774,6 +784,10 @@ if ($update_agent) { // if modified some agent paramenter
$values['update_module_count'] = 1; // Force an update of the agent cache.
}
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agente);
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$group_old);
$result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
if ($result === false) {
ui_print_error_message(
@ -788,6 +802,38 @@ if ($update_agent) { // if modified some agent paramenter
enterprise_hook('config_agents_update_config_interval', array($id_agente, $intervalo));
}
if($tpolicy_group_old){
foreach ($tpolicy_group_old as $key => $value) {
$tpolicy_agents_old= db_get_sql("SELECT * FROM tpolicy_agents
WHERE id_policy = ".$value['id_policy'] . " AND id_agent = " .$id_agente);
if($tpolicy_agents_old){
$result2 = db_process_sql_update ('tpolicy_agents',
array('pending_delete' => 1),
array ('id_agent' => $id_agente, 'id_policy' => $value['id_policy']));
}
}
}
$tpolicy_group = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$grupo);
if($tpolicy_group){
foreach ($tpolicy_group as $key => $value) {
$tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agente);
if(!$tpolicy_agents){
db_process_sql_insert ('tpolicy_agents',
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agente));
} else {
$result3 = db_process_sql_update ('tpolicy_agents',
array('pending_delete' => 0),
array ('id_agent' => $id_agente, 'id_policy' => $value['id_policy']));
}
}
}
$info = 'Group: ' . $grupo . ' Interval: ' . $intervalo .
' Comments: ' . $comentarios . ' Mode: ' . $modo .
' ID OS: ' . $id_os . ' Disabled: ' . $disabled .
@ -954,10 +1000,11 @@ if ($update_module || $create_module) {
$macros = io_json_mb_encode($macros);
$conf_array = explode("\n",$configuration_data);
$conf_array = explode("\n", io_safe_output($configuration_data));
foreach ($conf_array as $line) {
if (preg_match("/^module_name\s*(.*)/", $line, $match)) {
$new_configuration_data .= "module_name $name\n";
$new_configuration_data .= "module_name " . io_safe_output($name) . "\n";
}
// We delete from conf all the module macros starting with _field
else if(!preg_match("/^module_macro_field.*/", $line, $match)) {
@ -965,14 +1012,28 @@ if ($update_module || $create_module) {
}
}
$values_macros = array();
$values_macros['macros'] = base64_encode($macros);
$macros_for_data = enterprise_hook(
'config_agents_get_macros_data_conf', array($values_macros));
if ($macros_for_data != '') {
$new_configuration_data = str_replace('module_end', $macros_for_data . "module_end", $new_configuration_data);
}
/*
$macros_for_data = enterprise_hook('config_agents_get_macros_data_conf', array($_POST));
if ($macros_for_data !== ENTERPRISE_NOT_HOOK && $macros_for_data != '') {
// Add macros to configuration file
$new_configuration_data = str_replace('module_end', $macros_for_data."module_end", $new_configuration_data);
}
$configuration_data = $new_configuration_data;
*/
$configuration_data = str_replace('\\', "&#92;",
io_safe_input($new_configuration_data));;
html_debug($configuration_data, true);
}
// Services are an enterprise feature,
@ -1182,7 +1243,7 @@ if ($update_module) {
'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout,
'unit' => $unit,
'unit' => io_safe_output($unit),
'macros' => $macros,
'quiet' => $quiet_module,
'critical_instructions' => $critical_instructions,
@ -1342,7 +1403,7 @@ if ($create_module) {
'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout,
'unit' => $unit,
'unit' => io_safe_output($unit),
'macros' => $macros,
'quiet' => $quiet_module,
'critical_instructions' => $critical_instructions,

View File

@ -150,7 +150,7 @@ if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "AW"))
$return_all_group = false;
else
$return_all_group = true;
html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false, 'width:100px;');
html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
echo "<td>";
echo __('Show Agents') . '&nbsp;';
@ -488,6 +488,7 @@ if ($agents !== false) {
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp)) . '</a>' .
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown)) . '</a>';
echo "</th>";
echo "<th>".__('Type'). "</th>";
echo "<th>".__('Group'). ' ' .
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled">' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp)) . '</a>' .
'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search .'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled">' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown)) . '</a>';
@ -606,6 +607,14 @@ if ($agents !== false) {
echo "<td class='$tdcolor' align='left' valign='middle'>";
ui_print_os_icon ($agent["id_os"], false);
echo "</td>";
// Type agent (Networt, Software or Satellite)
echo "<td class='$tdcolor' align='left' valign='middle'>";
echo ui_print_type_agent_icon ($agent["id_os"], $agent['ultimo_contacto_remoto'],
$agent['ultimo_contacto'], $agent['remote'], $agent['agent_version']);
echo "</td>";
// Group icon and name
echo "<td class='$tdcolor' align='left' valign='middle'>" . ui_print_group_icon ($id_grupo, true)."</td>";
// Description

View File

@ -148,7 +148,7 @@ $table_simple->colspan[6][1] = 3;
$table_simple->data[0][0] = __('Name');
$table_simple->data[0][1] = html_print_input_text_extended ('name',
io_safe_output($name), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
io_safe_input(html_entity_decode($name)), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
//$table_simple->data[0][1] = html_print_input_text ('name',
// io_safe_output($name), '', 45, 100, true, $disabledBecauseInPolicy);

View File

@ -32,7 +32,7 @@ $id_alert = get_parameter ("id_alert", 0); // ID given as parameter
$alert = alerts_get_alert_agent_module($id_alert);
$template = alerts_get_alert_template ($alert['id_alert_template']);
$actions = alerts_get_alert_agent_module_actions ($id_alert);
$agent_name = modules_get_agentmodule_agent_name ($alert['id_agent_module']);
$agent_alias = modules_get_agentmodule_agent_alias ($alert['id_agent_module']);
$agent = modules_get_agentmodule_agent ($alert['id_agent_module']);
$module_name = modules_get_agentmodule_name ($alert['id_agent_module']);
@ -65,7 +65,7 @@ $table_details->data[] = $data;
$data[0] = __('Agent');
$data[1] ='<a style=" font-size: 7pt;" href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent.
'" title="'.$agent_name.'"><b><span style=" font-size: 7pt;">'.$agent_name.'</span></b></a>';
'" title="'.$agent_alias.'"><b><span style=" font-size: 7pt;">'.$agent_alias.'</span></b></a>';
$table_details->data[] = $data;
$data[0] = __('Module');

View File

@ -139,9 +139,51 @@ if ($update_agents) {
isset($values['id_grupo'])) {
$values['update_module_count'] = 1; // Force an update of the agent cache.
}
$group_old = false;
if($values['id_grupo']){
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agent);
}
$result = db_process_sql_update ('tagente',
$values,
array ('id_agente' => $id_agent));
if($group_old || $result){
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$group_old);
if($tpolicy_group_old){
foreach ($tpolicy_group_old as $key => $value) {
$tpolicy_agents_old= db_get_sql("SELECT * FROM tpolicy_agents
WHERE id_policy = ".$value['id_policy'] . " AND id_agent = " .$id_agent);
if($tpolicy_agents_old){
$result2 = db_process_sql_update ('tpolicy_agents',
array('pending_delete' => 1),
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
}
}
}
$tpolicy_group_new = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$values['id_grupo']);
if($tpolicy_group_new){
foreach ($tpolicy_group_new as $key => $value) {
$tpolicy_agents_new= db_get_sql("SELECT * FROM tpolicy_agents
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agent);
if(!$tpolicy_agents_new){
db_process_sql_insert ('tpolicy_agents',
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agent));
} else {
$result3 = db_process_sql_update ('tpolicy_agents',
array('pending_delete' => 0),
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
}
}
}
}
}
// Update Custom Fields

View File

@ -496,7 +496,7 @@ $table->data['edit3'][0] = __('Post process') .
ui_print_help_icon ('postprocess', true);
$table->data['edit3'][1] = html_print_extended_select_for_post_process('post_process',
0, '', 0, '', false, true, 'width:150px;', true);
-1, '','', 0, false, true, 'width:150px;', true, false, 1);
$table->data['edit3'][2] = __('SMNP community');
$table->data['edit3'][3] = html_print_input_text ('snmp_community', '',
@ -1153,6 +1153,11 @@ function process_manage_edit ($module_name, $agents_select = null) {
$values['plugin_pass'] = io_input_password($value);
}
break;
case 'post_process':
if($value !== '-1'){
$values['post_process'] = $value;
}
break;
default:
if ($value != '') {
$values[$field] = $value;

View File

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

View File

@ -94,7 +94,7 @@ echo "</div>";
},
success: function(data) {
$("#div_"+hash).remove();
$("#tgl_div_"+hash).prepend("<div id='div_"+hash+"' style='width: 100%;padding-left: 63px; padding-top: 7px;'>"+data+"</div>");
$("#tgl_div_"+hash).prepend("<div id='div_"+hash+"' class='graph_conteiner_inside' style='width: 99%;padding-left: 63px; padding-top: 7px;'>"+data+"</div>");
if($('div[class *= graph]').length == 0 && $('div[class *= bullet]').length == 0 && $('div[id *= gauge_]').length == 0){
$("#div_"+hash).remove();

View File

@ -430,7 +430,7 @@ switch ($action) {
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = "<b>". __("Group") . "</b>";
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, 'width:150px', false, false, 'id_grupo', $strict_user). '<br>';
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, "", false, false, 'id_grupo', $strict_user). '<br>';
$table_aux->data[0][2] = "<b>". __("Free text for search: ") . ui_print_help_tip(
__('Search by report name or description, list matches.'),true) . "</b>";
@ -1124,8 +1124,8 @@ switch ($action) {
$values['treport_custom_sql_id'] = get_parameter('id_custom');
if ($values['treport_custom_sql_id'] == 0) {
$values['external_source'] = get_parameter('sql');
$values['historical_db'] = get_parameter('historical_db_check');
}
$values['historical_db'] = get_parameter('historical_db_check');
}
else if ($values['type'] == 'url') {
$values['external_source'] = get_parameter('url');
@ -1214,7 +1214,6 @@ switch ($action) {
break;
}
$resultOperationDB = db_process_sql_update(
'treport_content',
$values,
@ -1446,8 +1445,8 @@ switch ($action) {
$values['treport_custom_sql_id'] = get_parameter('id_custom');
if ($values['treport_custom_sql_id'] == 0) {
$values['external_source'] = get_parameter('sql');
$values['historical_db'] = get_parameter('historical_db_check');
}
$values['historical_db'] = get_parameter('historical_db_check');
}
elseif ($values['type'] == 'url') {
$values['external_source'] = get_parameter('url');

View File

@ -84,7 +84,46 @@ function visual_map_main() {
//Fixed to wait the load of images.
$(window).load(function() {
$('#module').change(function(){
var txt = $("#module").val();
if(selectedItem == 'simple_value' || creationItem == 'simple_value'){
$.ajax({
async:false,
type: "POST",
url: "ajax.php",
data: {"page" : "general/check_image_module",
"get_image" : txt,
},
success: function(data) {
if(data == 0){
$("#data_image_check").html('Off');
$('#data_image_container').css('display','none');
$('#data_image_check').css('display','none');
$('#data_image_check_label').css('display','none');
$('.block_tinymce').remove();
$('#process_value_row').css('display','table-row');
if($('#process_value').val() != '0'){
$('#period_row').css('display','table-row');
}
}
else{
$('#data_image_container').css('display','inline');
$('#data_image_check').css('display','inline');
$('#data_image_check_label').css('display','inline');
$("#data_image_check").html('On');
$('#process_value_row').css('display','none');
$('#period_row').css('display','none');
$('#text-label_ifr').contents().find('#tinymce').html('_VALUE_');
$('.block_tinymce').remove();
$('#label_row').append('<div class="block_tinymce" style="background-color:#fbfbfb;position:absolute;left:0px;height:230px;width:100%;opacity:0.7;z-index:5;"></div>');
}
}
});
}
});
// Begin - Background label color changer
$( "#text-label_ifr" ).contents().find( "body" ).bind("contextmenu", function(e) {
@ -360,10 +399,32 @@ function update_button_palette_callback() {
setModuleGraph(idItem);
break;
case 'simple_value':
$("#text_" + idItem).html(values['label']);
//checkpoint
if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' ||
$('#text-label_ifr').contents().find('#tinymce').html() == '_VALUE_')
&& $('#data_image_check').html() != 'On'){
alert('_VALUE_ exactly value is only enable for data image. Please change label text or select a data image module.');
return;
}
$("#" + idItem).html(values['label']);
if(values['label'].replace( /<.*?>/g, '' ) == '_VALUE_'){
$("#text_" + idItem).html('<img style="width:'+values['width_data_image']+'px;" src="images/console/signes/data_image.png">');
$("#" + idItem).html('<img style="width:'+values['width_data_image']+'px;" src="images/console/signes/data_image.png">');
}
else{
$("#text_" + idItem).html(
'<table><tbody><tr><td></td></tr><tr><td><span style="" id="text_21" class="text">'+values["label"]+'</span></td></tr><tr><td></td></tr></tbody></table>'
)
$("#" + idItem).html(
'<table><tbody><tr><td></td></tr><tr><td><span style="" id="text_21" class="text">'+values["label"]+'</span></td></tr><tr><td></td></tr></tbody></table>'
)
}
//$("#simplevalue_" + idItem)
//.html($('<img></img>').attr('src', "images/spinner.gif"));
setModuleValue(idItem,values['process_simple_value'], values['period']);
setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']);
break;
case 'label':
$("#text_" + idItem).html(values['label']);
@ -510,7 +571,16 @@ function readFields() {
values['process_simple_value'] = $("select[name=process_value]").val();
values['background'] = $("#background_image").val();
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period").val();
if (values['period'] == null) {
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period_select").val();
}
values['width'] = $("input[name=width]").val();
values['width_data_image'] = $("#data_image_width").val();
if(selectedItem == 'simple_value' || creationItem == 'simple_value'){
if(values['width_data_image'] != 0){
values['width'] = values['width_data_image'];
}
}
values['height'] = $("input[name=height]").val();
values['parent'] = $("select[name=parent]").val();
values['map_linked'] = $("select[name=map_linked]").val();
@ -563,14 +633,14 @@ function create_button_palette_callback() {
var validate = true;
switch (creationItem) {
case 'box_item':
if (($("input[name='width_box']").val() == '')) {
alert('Undefined width');
validate = false;
}
if (($("input[name='height_box']").val() == '')) {
alert('Undefined height');
validate = false;
}
if (($("input[name='width_box']").val() == '')) {
alert('Undefined width');
validate = false;
}
if (($("input[name='height_box']").val() == '')) {
alert('Undefined height');
validate = false;
}
break;
case 'group_item':
case 'static_graph':
@ -630,7 +700,7 @@ function create_button_palette_callback() {
validate = false;
}
break;
case 'module_graph':
case 'module_graph':
if (values['width_module_graph'] == '') {
alert('Undefined width');
validate = false;
@ -678,6 +748,7 @@ function create_button_palette_callback() {
create_line('step_1', values);
break;
default:
insertDB(creationItem, values);
break;
}
@ -956,6 +1027,14 @@ function toggle_item_palette() {
$( "#text-label_ifr" ).contents().find( "body" ).css("background","lightgray");
}
if(creationItem != 'simple_value'){
$("#data_image_check").html('Off');
$("#data_image_check").css('display','none');
$("#data_image_check_label").css('display','none');
$("#data_image_container").css('display','none');
$('.block_tinymce').remove();
}
}
function fill_parent_select(id_item) {
@ -1518,7 +1597,6 @@ function set_static_graph_status(idElement, image, status) {
data: parameter,
success: function (data) {
set_static_graph_status(idElement, image, data);
if($('#'+idElement+' table').css('float') == 'right' || $('#'+idElement+ ' table').css('float') == 'left'){
$('#'+idElement+ ' img').css('margin-top', parseInt($('#'+idElement).css('height'))/2 - parseInt($('#'+idElement+ ' img').css('height'))/2);
}
@ -1554,7 +1632,6 @@ function set_static_graph_status(idElement, image, status) {
suffix = ".png";
break;
}
set_image("image", idElement, image + suffix);
}
@ -1678,12 +1755,13 @@ function setModuleGraph(id_data) {
}
function setModuleValue(id_data, process_simple_value, period) {
function setModuleValue(id_data, process_simple_value, period,width_data_image) {
var parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_module_value"});
parameter.push ({name: "id_element", value: id_data});
parameter.push ({name: "period", value: period});
parameter.push ({name: "width", value: width_data_image});
parameter.push ({name: "id_visual_console", value: id_visual_console});
if (process_simple_value != undefined) {
parameter.push ({name: "process_simple_value", value: process_simple_value});
@ -1695,7 +1773,9 @@ function setModuleValue(id_data, process_simple_value, period) {
type: "POST",
dataType: 'json',
success: function (data) {
var currentValue = $("#text_" + id_data).html();
var currentValue = $("#text_" + id_data).html();
//currentValue = currentValue.replace(/_VALUE_/gi, data.value);
$("#text_" + id_data).html(currentValue);
//$("#text_" + id_data).html('Data value');
@ -2025,6 +2105,10 @@ function createItem(type, values, id_data) {
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$image.attr('width', '70')
.attr('height', '70');
}
else{
$image.attr('width', $('#preview > img')[0].naturalWidth)
.attr('height', $('#preview > img')[0].naturalHeight);
}
}
else {
@ -2206,10 +2290,14 @@ function createItem(type, values, id_data) {
case 'simple_value':
sizeStyle = '';
imageSize = '';
if($('#data_image_check').html() == 'On'){
values['label'] = '<img style="width:'+$('#data_image_width').val()+'px;" src="images/console/signes/data_image.png">';
}
item = $('<div id="' + id_data + '" class="item simple_value" style="position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<span id="text_' + id_data + '" class="text"> ' + values['label'] + '</span> ' + '</div>'
);
setModuleValue(id_data,values.process_simple_value,values.period);
setModuleValue(id_data,values.process_simple_value,values.period,values.width_data_image);
break;
case 'label':
item = $('<div id="' + id_data + '" ' +
@ -2289,6 +2377,7 @@ function addItemSelectParents(id_data, text) {
}
function insertDB(type, values) {
metaconsole = $("input[name='metaconsole']").val();
$("#saving_in_progress_dialog").dialog({
@ -2421,7 +2510,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
if (type == 'simple_value') {
setModuleValue(idElement,
values.process_simple_value,
values.period);
values.period,values.width_data_image);
}
@ -2900,6 +2989,39 @@ function eventsItems(drag) {
if ((!is_opened_palette) && (autosave)) {
toggle_item_palette();
}
if(selectedItem == 'simple_value'){
$('#data_image_width').val(event.currentTarget.clientWidth);
var found = $('#'+idItem).find("img");
if(found.length > 0){
$("#data_image_check").css('display','inline');
$("#data_image_check_label").css('display','inline');
$('#data_image_container').css('display','inline');
$("#data_image_check").html('On');
$('.block_tinymce').remove();
$('#label_row').append('<div class="block_tinymce" style="background-color:#fbfbfb;position:absolute;left:0px;height:230px;width:100%;opacity:0.7;z-index:5;"></div>');
$('#process_value_row').css('display','none');
$('#period_row').css('display','none');
}
else{
$("#data_image_check").html('Off');
$("#data_image_check").css('display','none');
$("#data_image_check_label").css('display','none');
$('#data_image_container').css('display','none');
$('.block_tinymce').remove();
$('#process_value_row').css('display','table-row');
if($('#process_value').val() != 0){
$('#period_row').css('display','table-row');
}
}
}
else{
$("#data_image_check").css('display','none');
$("#data_image_check_label").css('display','none');
$('#data_image_container').css('display','none');
}
});
//Set the limit of draggable in the div with id "background" and set drag
@ -3224,6 +3346,7 @@ function click_button_toolbox(id) {
$("#period_row." + id).css('display', 'none');
break;
case 'label':
$("#data_image_width").val(100);
toolbuttonActive = creationItem = 'label';
toggle_item_palette();
break;

View File

@ -51,7 +51,8 @@ if (is_ajax ()) {
$row['control'] = __('Yes').'&nbsp;'.html_print_radio_button('fallback_local_auth', 1, '', $config['fallback_local_auth'], true).'&nbsp;&nbsp;';
$row['control'] .= __('No').'&nbsp;'.html_print_radio_button('fallback_local_auth', 0, '', $config['fallback_local_auth'], true);
$table->data['fallback_local_auth'] = $row;
if (enterprise_installed()) {
// Autocreate remote users
$row = array();
$row['name'] = __('Autocreate remote users');
@ -59,8 +60,7 @@ if (is_ajax ()) {
$row['control'] .= __('No').'&nbsp;'.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true);
$table->data['autocreate_remote_users'] = $row;
if (enterprise_installed()) {
add_enterprise_auth_autocreate_profiles($table, $type_auth);
add_enterprise_auth_autocreate_profiles($table, $type_auth);
}
}

View File

@ -84,7 +84,7 @@ $table_remote->data['ehorus_pass'] = $row;
$row = array();
$row['name'] = __('API Hostname');
$row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true);
$row['control'] .= ui_print_help_tip(__('Hostname of the eHorus API') . '. ' . __('Without protocol and port') . '. ' . __('e.g., switch.ehorus.com'), true);
$row['control'] .= ui_print_help_tip(__('Hostname of the eHorus API') . '. ' . __('Without protocol and port') . '. ' . __('e.g., portal.ehorus.com'), true);
$table_remote->data['ehorus_hostname'] = $row;
// Directory port

View File

@ -221,8 +221,6 @@ if (($filter_group == 0) && ($filter_search == '')) {
$table = new stdClass();
$table->width = '100%';
$table->class = "databox filters";
if(defined('METACONSOLE'))
$table->class = "databox_filters";
$table->rowclass[0] = '';
$table->data[0][0] = '<b>' . __('Group') . '</b>';
$table->data[0][1] = html_print_select_groups(false, "AR", true,
@ -496,3 +494,10 @@ echo '</div>';
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready (function () {
console.log('sknknan');
// text-filter_search
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -162,12 +162,12 @@ if ($get_graphs){
tagente_modulo WHERE id_agente_modulo = ". $value['id_agent_module']);
$sql_alias = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo[0]['id_agente']);
$table .= "<div style='width: 800px'><h4>AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."</h4><hr></div>";
$table .= "<div style='width: 90%'><h4>AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."</h4><hr></div>";
$table .= grafico_modulo_sparse(
$value['id_agent_module'],
$value['time_lapse'],
0,
800,
1000,
300,
'',
'',
@ -225,11 +225,11 @@ if ($get_graphs){
} else {
$height = 300;
}
$table .= "<div style='width: 800px'><h4>CUSTOM GRAPH ".$graph[0]['name']."</h4><hr></div>";
$table .= "<div style='width: 90%'><h4>".$graph[0]['name']."</h4><hr></div>";
$table .= graphic_combined_module($modules,
$weights,
$value['time_lapse'],
800,
1000,
$height,
'',
'',
@ -259,8 +259,10 @@ if ($get_graphs){
}
break;
case 'dynamic_graph':
$alias = " AND alias like '%".io_safe_output($value['agent'])."%'";
if($value['agent'] != ''){
$alias = " AND alias REGEXP '".$value['agent']."'";
}
if($value['id_group'] === '0'){
$id_group = "";
} else {
@ -281,8 +283,10 @@ if ($get_graphs){
$id_tag = " AND ttag_module.id_tag = ".$value['id_tag'];
}
$module_name = " AND nombre like '%".io_safe_output($value['module'])."%'";
if($value['module'] != ''){
$module_name = " AND nombre REGEXP '".$value['module']."'";
}
$id_agent_module = db_get_all_rows_sql("SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo
". $tag . "WHERE 1=1" . $id_module_group . $module_name .
" AND id_agente IN (SELECT id_agente FROM tagente WHERE 1=1" .$alias.$id_group.")"
@ -296,13 +300,13 @@ if ($get_graphs){
$sql_alias2 = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo2[0]['id_agente']);
$table .= "<div style='width: 800px'><h4>AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."</h4><hr></div>";
$table .= "<div style='width: 90%'><h4>AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."</h4><hr></div>";
$table .= grafico_modulo_sparse(
$value2['id_agente_modulo'],
$value['time_lapse'],
0,
800,
1000,
300,
'',
'',

View File

@ -268,21 +268,16 @@ if ($get_module_detail) {
foreach ($columns as $col => $attr) {
if ($attr[1] != "modules_format_data") {
$data[] = date('d F Y h:i:s A', $row['utimestamp']);
}
elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
// Its a single-data, multiline data (data snapshot) ?
// Detect string data with \n and convert to <br>'s
$datos = $row[$attr[0]];
//$datos = preg_replace ('/\n/i','<br>',$row[$attr[0]]);
//$datos = preg_replace ('/\s/i','&nbsp;',$datos);
// Because this *SHIT* of print_table monster, I cannot format properly this cells
// so, eat this, motherfucker :))
$datos = io_safe_input($datos);
$datos = preg_replace("/\n/", "</br></br>", $datos);
// I dont why, but using index (value) method, data is automatically converted to html entities ¿?
$data[] = $datos;
@ -290,7 +285,6 @@ if ($get_module_detail) {
elseif ($is_web_content_string) {
//Fixed the goliat sends the strings from web
//without HTML entities
$data[] = io_safe_input($row[$attr[0]]);
}
else {
@ -301,9 +295,6 @@ if ($get_module_detail) {
$data[] = io_safe_input($row[$attr[0]]);
}
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
//~ $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
//~ $data[] = (double) $row[$attr[0]];
switch($row['module_type']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
@ -328,17 +319,12 @@ if ($get_module_detail) {
$data[] = 'No data';
}
else {
if(is_snapshot_data($row[$attr[0]])){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
}
else{
$data[] = $row[$attr[0]];
}
if(is_snapshot_data($row[$attr[0]])){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
}
else{
$data[] = $row[$attr[0]];
}
}
}
}

View File

@ -0,0 +1,126 @@
<?php
//Pandora FMS- http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2017 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
include_once($config['homedir'] . "/include/functions_config.php");
include_once($config['homedir'] . "/include/functions_snmp_browser.php");
require_once ($config['homedir'] . '/include/functions_network_components.php');
global $config;
if(is_ajax()){
ob_clean();
$action = (string) get_parameter ("action", "");
$target_ip = (string) get_parameter ("target_ip", '');
$community = (string) get_parameter ("community", '');
$snmp_version = (string) get_parameter ("snmp_browser_version", '');
$snmp3_auth_user = get_parameter('snmp3_browser_auth_user');
$snmp3_security_level = get_parameter('snmp3_browser_security_level');
$snmp3_auth_method = get_parameter('snmp3_browser_auth_method');
$snmp3_auth_pass = get_parameter('snmp3_browser_auth_pass');
$snmp3_privacy_method = get_parameter('snmp3_browser_privacy_method');
$snmp3_privacy_pass = get_parameter('snmp3_browser_privacy_pass');
$targets_oids = get_parameter ("oids", "");
$targets_oids = explode(",", $targets_oids);
$custom_action = get_parameter ("custom_action", "");
if ($custom_action != "") {
$custom_action = urldecode (base64_decode ($custom_action));
}
if($action == 'create_modules_snmp'){
$fail_modules = array();
foreach ($targets_oids as $key => $target_oid) {
$oid = snmp_browser_get_oid ($target_ip, $community,
htmlspecialchars_decode($target_oid), $snmp_version, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass);
$name_check = db_get_value ('name', 'tnetwork_component',
'name', $oid['oid']);
if(empty($oid['description'])) {
$description = '';
} else {
$description = io_safe_input($oid['description']);
}
if(!$name_check){
$id = network_components_create_network_component ($oid['oid'],17,1,
array ('description' => $description,
'module_interval' => 300,
'max' => 0,
'min' => 0,
'tcp_send' => $snmp_version,
'tcp_rcv' => '',
'tcp_port' => 0,
'snmp_oid' => $oid['numeric_oid'],
'snmp_community' => $community,
'id_module_group' => 3,
'id_modulo' => 2,
'id_plugin' => 0,
'plugin_user' => '',
'plugin_pass' => '',
'plugin_parameter' => '',
'macros' => '',
'max_timeout' => 0,
'max_retries' => 0,
'history_data' => '',
'dynamic_interval' => 0,
'dynamic_max' => 0,
'dynamic_min' => 0,
'dynamic_two_tailed' => 0,
'min_warning' => 0,
'max_warning' => 0,
'str_warning' => '',
'min_critical' => 0,
'max_critical' => 0,
'str_critical' => '',
'min_ff_event' => 0,
'custom_string_1' => '',
'custom_string_2' => '',
'custom_string_3' => '',
'post_process' => 0,
'unit' => '',
'wizard_level' => 'nowizard',
'macros' => '',
'critical_instructions' => '',
'warning_instructions' => '',
'unknown_instructions' => '',
'critical_inverse' => 0,
'warning_inverse' => 0,
'id_category' => 0,
'tags' => '',
'disabled_types_event' => '{"going_unknown":1}',
'min_ff_event_normal' => 0,
'min_ff_event_warning' => 0,
'min_ff_event_critical' => 0,
'each_ff' => 0));
}
if(empty($id)) {
array_push($fail_modules,$name_check);
}
}
}
echo json_encode($fail_modules);
return;
}
?>

View File

@ -422,6 +422,7 @@ switch ($action) {
$values['type'] = visual_map_get_simple_value_type(
$process_simple_value);
$values['period'] = $period;
$values['width'] = $width;
}
case 'percentile_bar':
case 'percentile_item':
@ -897,6 +898,7 @@ switch ($action) {
//This allows min, max and avg process in a simple value
$values['type'] = visual_map_get_simple_value_type($process_simple_value);
$values['period'] = $period;
$values['width'] = $width;
break;
case 'label':
$values['type'] = LABEL;

View File

@ -22,8 +22,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC170629';
$pandora_version = 'v7.0NG.705';
$build_version = 'PC170728';
$pandora_version = 'v7.0NG.708';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();
@ -252,7 +252,7 @@ if (isset($_POST['vc_refr'])) {
//======= Autorefresh code =============================================
$select = db_process_sql("SELECT value FROM tconfig WHERE token='autorefresh_white_list'");
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['value']);
$config['autorefresh_white_list'] = array();
$config['autorefresh_white_list'] = $autorefresh_list;

View File

@ -467,6 +467,7 @@ define("OPTION_SINGLE_SELECT_TIME", 7);
define("OPTION_CUSTOM_INPUT", 8);
define("OPTION_AGENT_AUTOCOMPLETE", 9);
define("OPTION_SELECT_MULTISELECTION", 10);
define("OPTION_COLOR_PICKER", 11);
/* Transactional map constants */
define("NODE_TYPE", 0);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -37,6 +37,12 @@ div.term-container div.terminal {
-webkit-transform: rotate(360deg);
}
}
.button-color-animate {
color: #337ab7;
-webkit-transition: color 2000ms linear;
-ms-transition: color 2000ms linear;
transition: color 2000ms linear;
}
@-moz-keyframes spin {
from {
transform: scale(1) rotate(0deg);

View File

@ -61,7 +61,7 @@
position: absolute;
opacity: 0;
left: -9999em;
top: -9999em;
top: 0;
width: 0;
height: 0;
z-index: -10;
@ -71,7 +71,22 @@
resize: none;
}
.terminal .terminal-cursor {
.terminal a {
color: inherit;
text-decoration: none;
}
.terminal a:hover {
cursor: pointer;
text-decoration: underline;
}
.terminal a.xterm-invalid-link:hover {
cursor: text;
text-decoration: none;
}
.terminal.focus:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar) .terminal-cursor {
background-color: #fff;
color: #000;
}
@ -82,19 +97,41 @@
background-color: transparent;
}
.terminal.focus .terminal-cursor.blinking {
animation: blink-cursor 1.2s infinite step-end;
.terminal:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus.xterm-cursor-blink-on .terminal-cursor {
background-color: transparent;
color: inherit;
}
@keyframes blink-cursor {
0% {
background-color: #fff;
color: #000;
}
50% {
background-color: transparent;
color: #FFF;
}
.terminal.xterm-cursor-style-bar .terminal-cursor,
.terminal.xterm-cursor-style-underline .terminal-cursor {
position: relative;
}
.terminal.xterm-cursor-style-bar .terminal-cursor::before,
.terminal.xterm-cursor-style-underline .terminal-cursor::before {
content: "";
display: block;
position: absolute;
background-color: #fff;
}
.terminal.xterm-cursor-style-bar .terminal-cursor::before {
top: 0;
bottom: 0;
left: 0;
width: 1px;
}
.terminal.xterm-cursor-style-underline .terminal-cursor::before {
bottom: 0;
left: 0;
right: 0;
height: 1px;
}
.terminal.xterm-cursor-style-bar.focus.xterm-cursor-blink.xterm-cursor-blink-on .terminal-cursor::before,
.terminal.xterm-cursor-style-underline.focus.xterm-cursor-blink.xterm-cursor-blink-on .terminal-cursor::before {
background-color: transparent;
}
.terminal.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before,
.terminal.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before {
background-color: #fff;
}
.terminal .composition-view {
@ -116,6 +153,10 @@
overflow-y: scroll;
}
.terminal .xterm-wide-char {
display: inline-block;
}
.terminal .xterm-rows {
position: absolute;
left: 0;

View File

@ -1796,6 +1796,26 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
$id_group = (int) $id_group;
}
if($_SESSION['check_acl'] != null){
if (empty ($_SESSION['check_acl']))
return 0;
$result = 0;
$acl_column = get_acl_column($access);
foreach ($_SESSION['check_acl'] as $row) {
// For each profile for this pair of group and user do...
if (isset($row[$acl_column])) {
$result += $row[$acl_column];
}
}
if ($result >= 1) {
return 1;
}
return 0;
}
$parents_id = array($id_group);
if ($id_group != 0 && $onlyOneGroup !== true) {
$group = db_get_row_filter('tgrupo', array('id_grupo' => $id_group));
@ -1844,8 +1864,13 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
OR tusuario_perfil.id_grupo = 0)", $id_user, implode(', ', $parents_id));
}
$rowdup = db_get_all_rows_sql ($query);
$_SESSION['check_acl'] = $rowdup;
if (empty ($rowdup))
return 0;

View File

@ -1195,7 +1195,11 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3) {
else {
$cascadeProtectionModule = 0;
}
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agent);
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$group_old);
$return = db_process_sql_update('tagente',
array('alias' => $alias,
'direccion' => $ip,
@ -1216,6 +1220,40 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3) {
// register ip for this agent in 'taddress'
agents_add_address ($id_agent, $ip);
}
if($return){
if($tpolicy_group_old){
foreach ($tpolicy_group_old as $key => $value) {
$tpolicy_agents_old= db_get_sql("SELECT * FROM tpolicy_agents
WHERE id_policy = ".$value['id_policy'] . " AND id_agent = " .$id_agent);
if($tpolicy_agents_old){
$result2 = db_process_sql_update ('tpolicy_agents',
array('pending_delete' => 1),
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
}
}
}
$tpolicy_group = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$idGroup);
if($tpolicy_group){
foreach ($tpolicy_group as $key => $value) {
$tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents
WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agent);
if(!$tpolicy_agents){
db_process_sql_insert ('tpolicy_agents',
array('id_policy' => $value['id_policy'], 'id_agent' => $id_agent));
} else {
$result3 = db_process_sql_update ('tpolicy_agents',
array('pending_delete' => 0),
array ('id_agent' => $id_agent, 'id_policy' => $value['id_policy']));
}
}
}
}
returnData('string',
array('type' => 'string', 'data' => (int)((bool)$return)));
@ -1339,7 +1377,19 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) {
// register ip for this agent in 'taddress'
agents_add_address ($idAgente, $ip);
}
if($idGroup && !empty($idAgente)){
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
WHERE id_group = ".$idGroup);
if($tpolicy_group_old){
foreach ($tpolicy_group_old as $key => $old_group) {
db_process_sql_insert ('tpolicy_agents',
array('id_policy' => $old_group['id_policy'], 'id_agent' => $idAgente));
}
}
}
returnData('string',
array('type' => 'string', 'data' => $idAgente));
}

View File

@ -855,9 +855,6 @@ function config_process_config () {
config_update_value ('status_images_set', 'default');
}
if(!isset ($config['autorefresh_white_list'])){
config_update_value ('autorefresh_white_list', '');
}
// Load user session
if (isset ($_SESSION['id_usuario']))
$config["id_user"] = $_SESSION["id_usuario"];
@ -1656,6 +1653,10 @@ function config_process_config () {
config_update_value ('command_snapshot', 1);
}
if (!isset($config['custom_report_info'])) {
config_update_value ('custom_report_info', 1);
}
// Juanma (06/05/2014) New feature: Custom front page for reports
if (!isset($config['custom_report_front'])) {
config_update_value ('custom_report_front', 0);
@ -1749,7 +1750,7 @@ function config_process_config () {
config_update_value('ehorus_custom_field', 'eHorusID');
}
if (!isset($config['ehorus_hostname'])) {
config_update_value('ehorus_hostname', 'switch.ehorus.com');
config_update_value('ehorus_hostname', 'portal.ehorus.com');
}
if (!isset($config['ehorus_port'])) {
config_update_value('ehorus_port', 18080);

View File

@ -164,7 +164,7 @@ function custom_graphs_print($id_graph, $height, $width, $period,
$background_color = 'white', $modules_param = array(), $homeurl = '',
$name_list = array(), $unit_list = array(), $show_last = true,
$show_max = true, $show_min = true, $show_avg = true, $ttl = 1,
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false) {
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false,$id_widget_dashboard=false) {
global $config;
@ -260,7 +260,8 @@ function custom_graphs_print($id_graph, $height, $width, $period,
$dashboard,
$vconsole,
$percentil,
$from_interface);
$from_interface,
$id_widget_dashboard);
if ($return)
return $output;

View File

@ -368,6 +368,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
}
}
}
EventZoomEnd(null,map.zoom);
}
});
}
@ -396,7 +397,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
}
?>
}
last_time_of_data = Math.round(new Date().getTime() / 1000); //Unixtimestamp
//Test if the user change the refresh time.
@ -405,11 +406,16 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
oldRefreshAjaxIntervalSeconds = refreshAjaxIntervalSeconds;
}
EventZoomEnd(null,map.zoom);
}
$(document).ready (
function () {
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
EventZoomEnd(null,map.zoom);
}
);
</script>

View File

@ -579,11 +579,46 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
}
else {
$data = db_get_all_rows_filter ('tagente_datos',
array ('id_agente_modulo' => (int)$agent_module_id,
"utimestamp > $datelimit",
"utimestamp < $date",
'order' => 'utimestamp ASC'),
array ('datos', 'utimestamp'), 'AND', $search_in_history_db);
array ('id_agente_modulo' => (int)$agent_module_id,
"utimestamp > $datelimit",
"utimestamp < $date",
'order' => 'utimestamp ASC'),
array ('datos', 'utimestamp'), 'AND', false);
if ($search_in_history_db) {
$cache = false;
$history = false;
$sql = "SELECT datos, utimestamp FROM tagente_datos WHERE id_agente_modulo = " . (int)$agent_module_id .
" AND utimestamp > " . $datelimit . " AND utimestamp < " . $date .
" ORDER BY utimestamp ASC";
// Connect to the history DB
if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) {
$config['history_db_connection'] = db_connect($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false);
}
if ($config['history_db_connection'] !== false) {
$history = mysql_db_process_sql ($sql, 'affected_rows', $config['history_db_connection'], false);
}
if ($history === false) {
$history = array ();
}
$new_data = array();
$last_timestamp = 0;
foreach($history as $h) {
$new_data[] = $h;
$last_timestamp = $h['utimestamp'];
}
foreach($data as $d) {
if ($d['utimestamp'] > $last_timestamp) {
$new_data[] = $d;
$last_timestamp = $d['utimestamp'];
}
}
$data = $new_data;
}
}
// Get module warning_min and critical_min
@ -832,7 +867,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$only_image = false, $homeurl = '', $ttl = 1, $projection = false,
$adapt_key = '', $compare = false, $show_unknown = false,
$menu = true, $backgroundColor = 'white', $percentil = null,
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false) {
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false,
$id_widget_dashboard = false) {
global $config;
global $graphic_type;
@ -897,8 +933,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$date, $unit, $baseline, $return_data, $show_title,
$projection, $adapt_key, $compare, '', '', $show_unknown,
$percentil, $dashboard, $vconsole, $type_graph, $fullscale);
if ($return_data) {
return $data_returned;
}
@ -949,6 +984,13 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
}
else {
// Color commented not to restrict serie colors
if($id_widget_dashboard){
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
$color['min']['color'] = $opcion['min'];
$color['sum']['color'] = $opcion['avg'];
$color['max']['color'] = $opcion['max'];
}
return
area_graph($flash_chart, $chart, $width, $height, $color,
$legend, $long_index,
@ -1035,7 +1077,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$prediction_period = false, $background_color = 'white',
$name_list = array(), $unit_list = array(), $show_last = true, $show_max = true,
$show_min = true, $show_avg = true, $labels = array(), $dashboard = false,
$vconsole = false, $percentil = null, $from_interface = false) {
$vconsole = false, $percentil = null, $from_interface = false, $id_widget_dashboard=false) {
global $config;
global $graphic_type;
@ -1870,6 +1912,15 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$color[15] = array('border' => '#000000',
'color' => COL_GRAPH13,
'alpha' => CHART_DEFAULT_ALPHA);
if($id_widget_dashboard){
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
foreach ($module_list as $key => $value) {
if(!empty($opcion[$value])){
$color[$key]['color'] = $opcion[$value];
}
}
}
$threshold_data = array();
@ -3419,7 +3470,12 @@ function graph_custom_sql_graph ($id, $width, $height,
global $config;
$report_content = db_get_row ('treport_content', 'id_rc', $id);
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$id);
if($id != null){
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$id);
}
else{
$historical_db = $content['historical_db'];
}
if ($report_content["external_source"] != "") {
$sql = io_safe_output ($report_content["external_source"]);
}
@ -3525,7 +3581,7 @@ function graph_custom_sql_graph ($id, $width, $height,
* @param string homeurl
* @param bool return or echo the result
*/
function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $homeurl, $return = false) {
function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $homeurl, $return = false, $from_agent_view = false) {
global $config;
global $graphic_type;
@ -3542,13 +3598,14 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
$data = array ();
$legend = array();
$full_legend = array();
$full_legend_date = array();
$cont = 0;
for ($i = 0; $i < $interval; $i++) {
$bottom = $datelimit + ($periodtime * $i);
if (! $graphic_type) {
if ($config['flash_charts']) {
$name = date('H:i', $bottom);
$name = date('H:i:s', $bottom);
}
else {
$name = date('H\h', $bottom);
@ -3562,6 +3619,11 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
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));
@ -3590,12 +3652,12 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
}
$cont++;
}
$colors = array(1 => COL_NORMAL, 2 => COL_WARNING, 3 => COL_CRITICAL, 4 => COL_UNKNOWN);
// Draw slicebar graph
if ($config['flash_charts']) {
$out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent);
$out = flot_slicesbar_graph($data, $period, $width, $height, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', '', false, $id_agent, $full_legend_date);
}
else {
$out = slicesbar_graph($data, $period, $width, $height, $colors, $config['fontpath'], $config['round_corner'], $homeurl);
@ -3868,7 +3930,9 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
$timestamp_short = date($time_format, $timestamp);
$long_index[$timestamp_short] = date(
html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp);
$timestamp = $timestamp_short;
if (!$fullscale) {
$timestamp = $timestamp_short;
}
/////////////////////////////////////////////////////////////////
if ($total > $max_value) {

View File

@ -385,13 +385,28 @@ function html_print_select_groups($id_user = false, $privilege = "AR",
$nothing = '', $nothing_value = 0, $return = false,
$multiple = false, $sort = true, $class = '', $disabled = false,
$style = false, $option_style = false, $id_group = false,
$keys_field = 'id_grupo', $strict_user = false) {
$keys_field = 'id_grupo', $strict_user = false, $delete_groups = false , $include_groups = false) {
global $config;
$fields = users_get_groups_for_select($id_user, $privilege,
$returnAllGroup, true, $id_group, $keys_field);
if ($delete_groups && is_array($delete_groups)){
foreach ($delete_groups as $value) {
unset($fields[$value]);
}
}
if (is_array($include_groups)){
$field = array();
foreach ($include_groups as $value) {
$field[$value] = $fields[$value];
}
$fields = array_intersect($fields, $field);
}
if ($strict_user) {
$fields = users_get_strict_mode_groups($config['id_user'], $returnAllGroup);
}
@ -609,7 +624,7 @@ function html_print_select_from_sql ($sql, $name, $selected = '',
function html_print_extended_select_for_post_process($name, $selected = '',
$script = '', $nothing = '', $nothing_value = '0', $size = false,
$return = false, $select_style = false, $unique_name = true,
$disabled = false) {
$disabled = false, $no_change = 0) {
global $config;
@ -617,6 +632,10 @@ function html_print_extended_select_for_post_process($name, $selected = '',
$fields = post_process_get_custom_values();
if($no_change != 0){
$fields[-1] = __('No change');
}
$selected_float = (float)$selected;
$found = false;

View File

@ -1722,7 +1722,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period,
break;
//log4x
case 24:
$sql = sprintf ("SELECT datos AS data, utimestamp
$sql = sprintf ("SELECT message AS data, utimestamp
FROM tagente_datos_log4x
WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d

View File

@ -148,8 +148,9 @@ function networkmap_process_networkmap($id = 0) {
case "WINNT":
case "Windows":
$filename_plain = sys_get_temp_dir() . "\\plain.txt";
$cmd = $config['graphviz_win'] . "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
$cmd = io_safe_output($config['graphviz_bin_dir'] . "\\$filter.exe -Tplain -o " . $filename_plain . " " .
$filename_dot);
break;
default:
$filename_plain = sys_get_temp_dir() . "/plain.txt";
@ -157,7 +158,7 @@ function networkmap_process_networkmap($id = 0) {
$filename_dot;
break;
}
system ($cmd);
unlink($filename_dot);
@ -165,6 +166,8 @@ function networkmap_process_networkmap($id = 0) {
$nodes = networkmap_loadfile($id, $filename_plain,
$relation_nodes, $graph);
unlink($filename_plain);
//Set the position of modules
foreach ($nodes as $key => $node) {
if ($node['type'] == 'module') {
@ -265,8 +268,6 @@ function networkmap_process_networkmap($id = 0) {
db_process_sql_update('tmap',
array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y']),
array('id' => $id));
unlink($filename_plain);
}
return $nodes_and_relations;

View File

@ -146,6 +146,15 @@ function reporting_make_reporting_data($report = null, $id_report,
continue;
}
}
if(sizeof($content['id_agent']) != 1){
$content['style']['name_label'] = str_replace("_agent_",sizeof($content['id_agent']).__(' agents'),$content['style']['name_label']);
}
if(sizeof($content['id_agent_module']) != 1){
$content['style']['name_label'] = str_replace("_module_",sizeof($content['id_agent_module']).__(' modules'),$content['style']['name_label']);
}
$content['name'] = reporting_label_macro($items_label, $content['style']['name_label']);
@ -3940,9 +3949,12 @@ function reporting_sql($report, $content) {
$header = explode('|', $content['header_definition']);
$return['header'] = $header;
}
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$content['id_rc']);
if($content['id_rc'] != null){
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$content['id_rc']);
}
else{
$historical_db = $content['historical_db'];
}
$result = db_get_all_rows_sql($sql,$historical_db);
if ($result !== false) {
@ -4339,6 +4351,20 @@ function reporting_advanced_sla ($id_agent_module, $time_from = null, $time_to =
$max_value = null;
$min_value = null;
}
if ( (!isset($min_value)) && (!isset($max_value)) ) {
if ( ($agentmodule_info["id_tipo_modulo"] == "2") // generic_proc
|| ($agentmodule_info["id_tipo_modulo"] == "6") // remote_icmp_proc
|| ($agentmodule_info["id_tipo_modulo"] == "9") // remote_tcp_proc
|| ($agentmodule_info["id_tipo_modulo"] == "18") // remote_snmp_proc
|| ($agentmodule_info["id_tipo_modulo"] == "21") // async_proc
|| ($agentmodule_info["id_tipo_modulo"] == "31") ) { // web_proc
// Boolean values are OK if they're different from 0
$max_value = 0;
$min_value = 0;
$inverse_interval = 1;
}
}
}
// By default show last day
@ -5816,10 +5842,17 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
array_push ($weights, $graph_item["weight"]);
if (in_array('label',$content['style'])) {
if (defined('METACONSOLE')) {
$item = array('type' => 'custom_graph',
'id_agent' =>$content['id_agent'],
'id_agent_module'=>$graph_item['id_agent_module']);
}
else {
$item = array('type' => 'custom_graph',
'id_agent' =>modules_get_agentmodule_agent($graph_item['id_agent_module']),
'id_agent_module'=>$graph_item['id_agent_module']);
$label = reporting_label_macro($item, $content['style']['label']);
}
$labels[$graph_item['id_agent_module']] = $label;
}
}
@ -10279,6 +10312,7 @@ function reporting_label_macro ($item, $label) {
case 'TTO':
case 'MTBF':
case 'MTTR':
case 'automatic_graph':
if (preg_match("/_agent_/", $label)) {
$agent_name = agents_get_alias($item['id_agent']);
$label = str_replace("_agent_", $agent_name, $label);
@ -10313,4 +10347,4 @@ function reporting_label_macro ($item, $label) {
return $label;
}
?>
?>

View File

@ -3780,6 +3780,7 @@ function reporting_get_event_histogram ($events, $text_header_event = false) {
);
}
}
$table = new stdClass();
if (!$text_header_event) {
$table->width = '100%';
@ -3839,6 +3840,157 @@ function reporting_get_event_histogram ($events, $text_header_event = false) {
return $event_graph;
}
function reporting_get_event_histogram_meta ($width) {
global $config;
if (!defined("METACONSOLE")) {
include_once ($config['homedir'] .'/include/graphs/functions_gd.php');
}
else {
include_once ('../../include/graphs/functions_gd.php');
}
$period = SECONDS_1HOUR;
if (!$text_header_event) {
$text_header_event = __('Events info (1hr.)');
}
$ttl = 1;
$urlImage = ui_get_full_url(false, true, false, false);
$data = array ();
$resolution = $config['graph_res'] * ($period * 2 / $width); // Number of "slices" we want in graph
$interval = (int) ($period / $resolution);
$date = get_system_time ();
$datelimit = $date - $period;
$periodtime = floor ($period / $interval);
$time = array ();
$data = array ();
$legend = array();
$full_legend = array();
$full_legend_date = array();
$colors = array(
EVENT_CRIT_MAINTENANCE => COL_MAINTENANCE,
EVENT_CRIT_INFORMATIONAL => COL_INFORMATIONAL,
EVENT_CRIT_NORMAL => COL_NORMAL,
EVENT_CRIT_MINOR => COL_MINOR,
EVENT_CRIT_WARNING => COL_WARNING,
EVENT_CRIT_MAJOR => COL_MAJOR,
EVENT_CRIT_CRITICAL => COL_CRITICAL
);
$cont = 0;
for ($i = 0; $i < $interval; $i++) {
$bottom = $datelimit + ($periodtime * $i);
if (! $graphic_type) {
if ($config['flash_charts']) {
$name = date('H:i:s', $bottom);
}
else {
$name = date('H\h', $bottom);
}
}
else {
$name = $bottom;
}
// Show less values in legend
if ($cont == 0 or $cont % 2)
$legend[$cont] = $name;
if ($from_agent_view) {
$full_date = date('Y/m/d', $bottom);
$full_legend_date[$cont] = $full_date;
}
$full_legend[$cont] = $name;
$top = $datelimit + ($periodtime * ($i + 1));
$event = db_get_row_filter ('tmetaconsole_event',
array (
'utimestamp > '.$bottom,
'utimestamp < '.$top),
'criticity, utimestamp');
if (!empty($event['utimestamp'])) {
$data[$cont]['utimestamp'] = $periodtime;
switch ($event['criticity']) {
case 0:
$data[$cont]['data'] = EVENT_CRIT_MAINTENANCE;
break;
case 1:
$data[$cont]['data'] = EVENT_CRIT_INFORMATIONAL;
break;
case 2:
$data[$cont]['data'] = EVENT_CRIT_NORMAL;
break;
case 3:
$data[$cont]['data'] = EVENT_CRIT_WARNING;
break;
case 4:
$data[$cont]['data'] = EVENT_CRIT_CRITICAL;
break;
case 5:
$data[$cont]['data'] = EVENT_CRIT_MINOR;
break;
case 6:
$data[$cont]['data'] = EVENT_CRIT_MAJOR;
break;
case 20:
$data[$cont]['data'] = EVENT_CRIT_NOT_NORMAL;
break;
case 34:
$data[$cont]['data'] = EVENT_CRIT_WARNING_OR_CRITICAL;
break;
default:
$data[$cont]['data'] = 1;
break;
}
}
else {
$data[$cont]['utimestamp'] = $periodtime;
$data[$cont]['data'] = 1;
}
$cont++;
}
$table = new stdClass();
$table->width = '100%';
$table->data = array ();
$table->size = array ();
$table->head = array ();
$table->title = '<span>' . $text_header_event . '</span>';
$table->data[0][0] = "" ;
if (!empty($data)) {
$slicebar = flot_slicesbar_graph($data, $period, "100%", 30, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $url, '', '', false, 0, $full_legend_date);
$table->data[0][0] = $slicebar;
}
else {
$table->data[0][0] = __('No events');
}
if (!$text_header_event) {
$event_graph = '<fieldset class="databox tactical_set">
<legend>' .
$text_header_event .
'</legend>' .
html_print_table($table, true) . '</fieldset>';
}
else {
$table->class = 'noclass';
$event_graph = html_print_table($table, true);
}
return $event_graph;
}
function reporting_html_planned_downtimes_table ($planned_downtimes) {
global $config;

View File

@ -279,4 +279,111 @@ function snmp_update_translation($oid, $new_oid, $description, $post_process) {
}
}
}
/*
* Print the event filter tag cloud (enterprise feature)
* @param $filter_resume: Array with the active filters
* @param $filter_refs: Array of all arrays to humanize some tags
*/
function print_snmp_tags_active_filters ($filter_resume = array()) {
global $config;
$tags_set = array();
// Alert
if (isset($filter_resume['filter_fired'])) {
array_push ($tags_set, array(
'title' => __('Alert'),
'value' => $filter_resume['filter_fired']
));
}
// Severity
if (isset($filter_resume['filter_severity'])) {
array_push ($tags_set, array(
'title' => __('Severity'),
'value' => $filter_resume['filter_severity']
));
}
// Pagination
if ($filter_resume['pagination'] == "") {
$filter_resume['pagination'] = $config["block_size"];
}
array_push ($tags_set, array(
'title' => __('Pagination'),
'value' => $filter_resume['pagination']
));
// Free search
if (isset($filter_resume['free_search_string']) && $filter_resume['free_search_string'] != "") {
array_push ($tags_set, array(
'title' => __('Search'),
'value' => $filter_resume['free_search_string']
));
}
// Status
if (isset($filter_resume['filter_status']) && $filter_resume['filter_status'] != "") {
array_push ($tags_set, array(
'title' => __('Status'),
'value' => $filter_resume['filter_status']
));
}
// Group by
if (isset($filter_resume['group_by'])) {
if ($filter_resume['group_by'] == 0) {
array_push ($tags_set, array(
'title' => __('Group by Enterprise String / IP'),
'value' => __('No')
));
}
else {
array_push ($tags_set, array(
'title' => __('Group by Enterprise String / IP'),
'value' => __('Yes')
));
}
}
// Date from
if (isset($filter_resume['date_from_trap']) && $filter_resume['date_from_trap'] != "") {
if (isset($filter_resume['time_from_trap']) && $filter_resume['time_from_trap'] != "") {
array_push ($tags_set, array(
'title' => __('From'),
'value' => $filter_resume['date_from_trap'] . " " . $filter_resume['time_from_trap']
));
}
else {
array_push ($tags_set, array(
'title' => __('From'),
'value' => $filter_resume['date_from_trap']
));
}
}
// Date to
if (isset($filter_resume['date_to_trap']) && $filter_resume['date_to_trap'] != "") {
if (isset($filter_resume['time_to_trap']) && $filter_resume['time_to_trap'] != "") {
array_push ($tags_set, array(
'title' => __('To'),
'value' => $filter_resume['date_to_trap'] . " " . $filter_resume['time_to_trap']
));
}
else {
array_push ($tags_set, array(
'title' => __('To'),
'value' => $filter_resume['date_to_trap']
));
}
}
// Trap type
if (isset($filter_resume['trap_type'])) {
array_push ($tags_set, array(
'title' => __('Trap type'),
'value' => $filter_resume['trap_type']
));
}
$title = '';
if(!$config['pure']){
$title = isset($filter_resume['title'])
? __('Active filter') . " (" . $filter_resume['title'] . ")"
: __('Active filters');
}
if (sizeof($filter_resume) > 0) ui_print_tags_view($title, $tags_set);
}
?>

View File

@ -116,7 +116,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a
echo "</a>";
}
echo '&nbsp;<span>' . $level . '</span>';
echo html_print_checkbox("create_$sub_id", 0, false, true, false, '') .'&nbsp;<span>' . $level . '</span>';
if (isset ($sub_level['__VALUE__'])) {
echo '<span class="value" style="display: none;">&nbsp;=&nbsp;' . $sub_level['__VALUE__'] . '</span>';
}
@ -618,3 +618,137 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
}
?>
<script type="text/javascript">
$(document).ready(function () {
$('input[name*=create_network_component]').click(function () {
var id_check = $('#ul_0').find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
if($(this).is(':checked')){
return this.id;
}
} }).get();
$('input[name*=create_network_component]').removeClass("sub add");
$('input[name*=create_network_component]').addClass("sub spinn");
var target_ip = $('#text-target_ip').val();
var community = $('#text-community').val();
var snmp_version = $('#snmp_browser_version').val();
var snmp3_auth_user = $('#text-snmp3_browser_auth_user').val();
var snmp3_security_level = $('#snmp3_browser_security_level').val();
var snmp3_auth_method = $('#snmp3_browser_auth_method').val();
var snmp3_auth_pass = $('#password-snmp3_browser_auth_pass').val();
var snmp3_privacy_method = $('#snmp3_browser_privacy_method').val();
var snmp3_privacy_pass = $('#password-snmp3_browser_privacy_pass').val();
var custom_action = $('#hidden-custom_action').val();
if (custom_action == undefined) {
custom_action = '';
}
var oids = [];
id_check.forEach(function(product, index) {
var oid = $("#"+product).siblings('a').attr('href');
if(oid.indexOf('javascript: snmpGet("')!=-1) {
oid = oid.replace('javascript: snmpGet("',"");
oid = oid.replace('");',"");
oids.push(oid);
}
});
// Prepare the AJAX call
var params = [
"target_ip=" + target_ip,
"community=" + community,
"oids=" + oids,
"snmp_browser_version=" + snmp_version,
"snmp3_browser_auth_user=" + snmp3_auth_user,
"snmp3_browser_security_level=" + snmp3_security_level,
"snmp3_browser_auth_method=" + snmp3_auth_method,
"snmp3_browser_auth_pass=" + snmp3_auth_pass,
"snmp3_browser_privacy_method=" + snmp3_privacy_method,
"snmp3_browser_privacy_pass=" + snmp3_privacy_pass,
"action=" + "create_modules_snmp",
"custom_action=" + custom_action,
"page=include/ajax/snmp_browser.ajax"
];
$.ajax({
type: "GET",
url: "ajax.php",
data: params.join ("&"),
dataType: "json",
success: function(data) {
$('input[name*=create_network_component]').removeClass("sub spinn");
$('input[name*=create_network_component]').addClass("sub add");
if(data.length !== 0){
$('#error_text').text("");
data.forEach( function(valor, indice, array) {
console.log(valor);
$('#error_text').append('<br/>'+ valor );
});
$("#dialog_error")
.dialog({
resizable: true,
draggable: true,
modal: true,
height: 300,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
}
});
} else {
$("#dialog_success")
.dialog({
resizable: true,
draggable: true,
modal: true,
height: 250,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
}
});
}
}
});
});
$('input[id^=checkbox-create]').change(function () {
if ($(this).is(':checked') ) {
$('input[name*=create_network_component]').show();
var id_input = $(this).attr("id");
id_input = id_input.split("checkbox-create_");
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
return this.id;
} }).get();
checks.forEach(function(product, index) {
$("#"+product).prop('checked', "true");
});
} else {
var id_input = $(this).attr("id");
id_input = id_input.split("checkbox-create_");
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
return this.id;
} }).get();
checks.forEach(function(product, index) {
$("#"+product).prop('checked', false);
});
}
});
});
</script>

View File

@ -660,6 +660,28 @@ function ui_print_os_icon ($id_os, $name = true, $return = false,
return $output;
}
function ui_print_type_agent_icon ( $id_os = false, $remote_contact = false, $contact = false,
$return = false, $remote = 0, $version = ""){
if($id_os == 19){
//Satellite
$options['title'] = __('Satellite');
$output = html_print_image("images/op_satellite.png", true, $options, false, false, false, true);
}
else if ($remote_contact == $contact && $remote == 0 && $version == ""){
//Network
$options['title'] = __('Network');
$output = html_print_image("images/network.png", true, $options, false, false, false, true);
}
else{
//Software
$options['title'] = __('Software');
$output = html_print_image("images/data.png", true, $options, false, false, false, true);
}
return $output;
}
/**
* Prints an agent name with the correct link
*

View File

@ -1438,17 +1438,25 @@ function visual_map_print_item($mode = "read", $layoutData,
if(get_parameter('action') == 'edit'){
//echo 'Data value';
echo $io_safe_output_text;
//html_debug($layoutData);
//echo 'Data value';
if(strip_tags($io_safe_output_text) != '_VALUE_'){
echo $io_safe_output_text;
}
else{
echo "<img style='width:".$layoutData['width']."px;' src='images/console/signes/data_image.png'>";
}
}
else{
echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
if(strip_tags($io_safe_output_text) != '_VALUE_'){
echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
}
else{
echo str_replace('>', ' style="width:'.$layoutData['width'].'px">',$value);
}
}
//Restore db connection
@ -1575,6 +1583,8 @@ function visual_map_get_simple_value_type($process_simple_value) {
function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) {
global $config;
$unit_text = db_get_sql ('SELECT unit
FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module);
$unit_text = trim(io_safe_output($unit_text));
@ -1583,23 +1593,35 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
case SIMPLE_VALUE:
$value = db_get_value ('datos', 'tagente_estado',
'id_agente_modulo', $id_module);
if ($value === false) {
$value = __('Unknown');
$value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
}
else {
if ( is_numeric($value) ) {
if ($config['simple_module_value']) {
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
if(strpos($value, 'data:image') !== false){
$value = '<img class="b64img" src="'.$value.'">';
}
else{
if ( is_numeric($value) ) {
if ($config['simple_module_value']) {
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
}
}
if (!empty($unit_text)) {
$value .= " " . $unit_text;
}
$value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
}
if (!empty($unit_text)) {
$value .= " " . $unit_text;
}
}
$value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
return $value;
break;
case SIMPLE_VALUE_MAX:

View File

@ -188,7 +188,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
<td align="left" style="">' .
html_print_input_text('label', '', '', 20, 200, true) . '
<span id="advice_label" style="font-style:italic;z-index:3;display:inline;margin-top:0px;float:right;margin-right:100px;">
'.__("Click right mouse button to change background label editor color").'
'.__("Click right mouse button to change the background color of the label editor").'
</span>
</td>';
@ -314,8 +314,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['module_row']['html'] = '<td align="left">' .
__('Module') . '</td>
<td align="left">' .
html_print_select(array(), 'module', '', '', __('Any'), 0, true) .
'</td>';
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>';
$form_items['type_graph'] = array();

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);
labels = labels.split(separator);
legend = legend.split(separator);
acumulate_data = acumulate_data.split(separator);
datacolor = datacolor.split(separator);
if (full_legend != false) {
full_legend = full_legend.split(separator);
}
// Check possible adapt_keys on classes
check_adaptions(graph_id);
@ -692,15 +695,33 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
var to = legend[item.seriesIndex+1];
//current date
var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
newdate = year + "/" + month + "/" + day;
if (full_legend != "") {
newdate = full_legend[item.seriesIndex];
newdate2 = full_legend[item.seriesIndex+1];
}
else {
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
newdate = year + "/" + month + "/" + day;
}
if(!to){
to= '23:59';
}
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';
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';
}
}
});

View File

@ -846,7 +846,7 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon
return $return;
}
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '', $stat_win = false, $id_agent = 0) {
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '', $stat_win = false, $id_agent = 0, $full_legend_date = array()) {
global $config;
include_javascript_dependencies_flot_graph();
@ -932,7 +932,6 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
$acumulate += $value;
$c++;
//$return .= "<div id='value_".$i."_$graph_id' class='values_$graph_id' style='color: #000; position:absolute;'>$value</div>";
if ($value > $max) {
$max = $value;
}
@ -943,6 +942,12 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
$labels = implode($separator,$labels);
$datacolor = implode($separator,$datacolor);
$legend = io_safe_output(implode($separator,$legend));
if (!empty($full_legend_date)) {
$full_legend_date = io_safe_output(implode($separator,$full_legend_date));
}
else {
$full_legend_date = false;
}
$acumulate_data = io_safe_output(implode($separator,$acumulate_data));
// Store data series in javascript format
@ -966,7 +971,7 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
// Javascript code
$return .= "<script type='text/javascript'>";
$return .= "//<![CDATA[\n";
$return .= "pandoraFlotSlicebar('$graph_id', '$values', '$datacolor', '$labels', '$legend', '$acumulate_data', $intervaltick, false, $max, '$separator', '$separator2', '', $id_agent)";
$return .= "pandoraFlotSlicebar('$graph_id', '$values', '$datacolor', '$labels', '$legend', '$acumulate_data', $intervaltick, false, $max, '$separator', '$separator2', '', $id_agent, '$full_legend_date')";
$return .= "\n//]]>";
$return .= "</script>";

View File

@ -138,6 +138,7 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
var baseLayer = null;
map.events.on({"zoomend": EventZoomEnd});
map.events.on({"mouseup": EventZoomEnd});
//Define the maps layer
for (var baselayerIndex in objBaseLayers) {
@ -224,10 +225,18 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
.transform(map.displayProjection, map.getProjectionObject());
map.setCenter (lonLat, initial_zoom);
}
function EventZoomEnd (evt) {
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
function EventZoomEnd (evt,zoom = map.zoom) {
if(evt == null){
var actual_zoom = (zoom < 6) ? 6 : zoom;
}
else{
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
}
var max_width_marker = 38;
var max_zoom_map = map.numZoomLevels;
var max_font_size = 15;
@ -258,7 +267,6 @@ function EventZoomEnd (evt) {
var new_width_marker = (actual_zoom * max_width_marker) / max_zoom_map;
var new_height_marker = (actual_zoom * max_width_marker) / max_zoom_map;
console.log(feature);
feature.style.fontSize = '' + actual_font_size + ' !important';
feature.style.graphicHeight = new_height_marker;
feature.style.graphicWidth = new_width_marker;
@ -280,6 +288,7 @@ function EventZoomEnd (evt) {
function changeShowStatus(newShowStatus) {
statusShow = newShowStatus;
hideAgentsStatus();
EventZoomEnd(null,map.zoom);
js_refreshParentLines();
}

View File

@ -16385,7 +16385,7 @@ msgid "Without protocol and port"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:92

View File

@ -16547,7 +16547,7 @@ msgid "Without protocol and port"
msgstr "Without protocol and port"
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr "e.g., switch.eHorus.com"
#: ../../godmode/setup/setup_ehorus.php:92

View File

@ -16978,8 +16978,8 @@ msgid "Without protocol and port"
msgstr "Sin protocolo y puerto"
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgstr "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr "e.g., portal.ehorus.com"
#: ../../godmode/setup/setup_ehorus.php:92
msgid "API Port"

View File

@ -17215,7 +17215,7 @@ msgid "Without protocol and port"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:92

View File

@ -16299,8 +16299,8 @@ msgid "Without protocol and port"
msgstr "プロトコルとポート番号は含みません"
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgstr "例: switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr "例: portal.ehorus.com"
#: ../../godmode/setup/setup_ehorus.php:92
msgid "API Port"

View File

@ -656,7 +656,7 @@ input.sub[disabled] {
input.next, input.upd, input.ok, input.wand, input.delete, input.cog,
input.target, input.search, input.copy, input.add, input.graph,
input.percentile, input.binary, input.camera, input.config,
input.cancel, input.default, input.filter, input.pdf {
input.cancel, input.default, input.filter, input.pdf,input.spinn {
padding-right: 30px;
height: 23px;
@ -741,6 +741,9 @@ input.pdf:disabled {
input.camera {
background-image: url(../../images/input_camera.png) !important;
}
input.spinn {
background-image: url(../../images/spinner_green.gif) !important;
}
#toolbox #auto_save {
padding-top: 5px;
@ -4156,4 +4159,25 @@ div#footer_help{
/*view-agents lastest events for this agent*/
#div_all_events_24h{
padding: 4px;
}
/*styles graph conteiner*/
.graph_conteiner_inside > .parent_graph{
width: 100% !important;
}
.graph_conteiner_inside > .parent_graph > .menu_graph{
left: 90% !important;
}
.graph_conteiner_inside > .parent_graph > .noresizevc{
width: 90% !important;
}
.graph_conteiner_inside > div > .nodata_container > .nodata_text {
display: none;
}
.graph_conteiner_inside > div > .nodata_container{
background-size: 120px 80px !important;
}

View File

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

View File

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

View File

@ -466,7 +466,10 @@ else {
'unknown_count',
'notinit_count',
'total_count',
'fired_count'),
'fired_count',
'ultimo_contacto_remoto',
'remote',
'agent_version'),
$access,
$order);
}
@ -498,11 +501,11 @@ $table->head[1] = __('Description'). ' ' .
$table->size[1] = "16%";
$table->head[9] = __('Remote'). ' ' .
$table->head[10] = __('Remote'). ' ' .
'<a href="index.php?sec=estado&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>';
$table->size[9] = "9%";
$table->size[10] = "9%";
$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>' .
@ -517,21 +520,24 @@ $table->size[3] = "10%";
$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=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown, "alt" => "down")) . '</a>';
$table->size[4] = "15%";
$table->size[4] = "8%";
$table->head[5] = __('Modules');
$table->size[5] = "10%";
$table->head[5] = __('Type');
$table->size[5] = "8%";
$table->head[6] = __('Status');
$table->size[6] = "4%";
$table->head[6] = __('Modules');
$table->size[6] = "10%";
$table->head[7] = __('Alerts');
$table->head[7] = __('Status');
$table->size[7] = "4%";
$table->head[8] = __('Last contact'). ' ' .
$table->head[8] = __('Alerts');
$table->size[8] = "4%";
$table->head[9] = __('Last contact'). ' ' .
'<a href="index.php?sec=estado&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>';
$table->size[8] = "15%";
$table->size[9] = "15%";
$table->align = array ();
@ -542,9 +548,9 @@ $table->align[5] = "left";
$table->align[6] = "left";
$table->align[7] = "left";
$table->align[8] = "left";
$table->align[9] = "left";
$table->style = array();
//$table->style[0] = 'width: 15%';
$table->data = array ();
@ -584,14 +590,14 @@ foreach ($agents as $agent) {
$data[1] = ui_print_truncate_text($agent["description"], 'description', false, true, true, '[&hellip;]', 'font-size: 6.5pt');
$data[9] = "";
$data[10] = "";
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
$data[9] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config')));
$data[10] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config')));
}
}
@ -602,14 +608,18 @@ foreach ($agents as $agent) {
$data[4] = ui_print_group_icon ($agent["id_grupo"], true);
$agent['not_init_count'] = $agent['notinit_count'];
$data[5] = reporting_tiny_stats($agent, true, 'modules', ':', $strict_user);
$data[5] = ui_print_type_agent_icon ($agent["id_os"], $agent['ultimo_contacto_remoto'],
$agent['ultimo_contacto'], $agent['remote'],
$agent['agent_version']);
$data[6] = reporting_tiny_stats($agent, true, 'modules', ':', $strict_user);
$data[7] = $status_img;
$data[8] = $alert_img;
$data[6] = $status_img;
$data[7] = $alert_img;
$data[8] = agents_get_interval_status ($agent);
$data[9] = agents_get_interval_status ($agent);
// This old code was returning "never" on agents without modules, BAD !!
// And does not print outdated agents in red. WRONG !!!!

Some files were not shown because too many files have changed in this diff Show More