Merge remote-tracking branch 'origin/develop' into 205-anadida-ruta-en-appdata-local-temp-por-defecto-para-windows-en-plugin-grep_log

This commit is contained in:
ismael.moreno 2019-06-11 10:03:22 +02:00
commit 400fab0bcd
657 changed files with 75283 additions and 21899 deletions

26
extras/build_rpm_rhel7.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
source build_vars.sh
if [ ! -d $RPMHOME/RPMS ]; then
mkdir -p $RPMHOME/RPMS || exit 1
fi
echo "Creating RPM packages in $RPMHOME/RPMS"
# Console
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.rhel7.spec || exit 1
# Server
#rpmbuild -ba $CODEHOME/pandora_server/pandora_server.rhel7.spec || exit 1
# Unix agent
#rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.rhel7.spec || exit 1
# Enterprise console
rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec || exit 1
# Enterprise server
#rpmbuild -ba $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.rhel7.spec || exit 1
exit 0

View File

@ -1,3 +1,3 @@
#!/bin/bash
docker build --rm=true --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \
docker build --rm=true --pull --no-cache --build-arg BRANCH="develop" --build-arg DB_PASS="pandora" -t pandorafms/pandorafms:7 . && \
docker push pandorafms/pandorafms:7

View File

@ -26,9 +26,11 @@ $CODEHOME/pandora_server/pandora_server.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \
$CODEHOME/pandora_console/pandora_console.redhat.spec \
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.redhat.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.redhat.spec"
DEBIAN_FILES="$CODEHOME/pandora_console/DEBIAN \
$CODEHOME/pandora_server/DEBIAN \
@ -54,7 +56,8 @@ AGENT_WIN_FILE="$CODEHOME/pandora_agents/win32/pandora.cc"
AGENT_WIN_MPI_FILE="$CODEHOME/pandora_agents/win32/installer/pandora.mpi"
AGENT_WIN_RC_FILE="$CODEHOME/pandora_agents/win32/versioninfo.rc"
SATELLITE_FILE="$PANDHOME_ENT/satellite_server/satellite_server.pl"
PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl \
PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_server/util/recon_script/vmware-plugin.pl \
$PANDHOME_ENT/pandora_server/util/recon_script/pcm_client.pl \
$PANDHOME_ENT/pandora_plugins/NGINX/nginx_requests_queued.pl \
$PANDHOME_ENT/pandora_plugins/Sybase/sybase_plugin.pl \
$PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \
@ -171,8 +174,8 @@ echo "Updating Pandora Console version..."
sed -i -e "s/\s*\$pandora_version\s*=.*/\$pandora_version = 'v$VERSION';/" "$CONSOLE_FILE"
sed -i -e "s/\s*\$build_version\s*=.*/\$build_version = 'PC$BUILD';/" "$CONSOLE_FILE"
echo "Updating Pandora Console installer version..."
sed -i -e "s/\s*\$version\s*=.*/\$version = '$VERSION';/" "$CONSOLE_INSTALL_FILE"
sed -i -e "s/\s*\$build\s*=.*/\$build = '$BUILD';/" "$CONSOLE_INSTALL_FILE"
sed -i -e "s/\(\s*\$version\s*=\s\).*/\1'$VERSION';/" "$CONSOLE_INSTALL_FILE"
sed -i -e "s/\(\s*\$build\s*=\s\).*/\1'$BUILD';/" "$CONSOLE_INSTALL_FILE"
echo "Setting develop_bypass to 0..."
sed -i -e "s/\s*if\s*(\s*[!]\s*isset\s*(\s*$develop_bypass\s*)\s*)\s*$develop_bypass\s*=.*/if ([!]isset($develop_bypass)) $develop_bypass = 0;/" "$CONSOLE_FILE"

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731, AIX version
# Version 7.0NG.735, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,10 +1,10 @@
package: pandorafms-agent-unix
Version: 4.0.1
Version: 7.0
Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Homepage: http://pandorafms.org/
Maintainer: ÁRTICA ST <info@artica.es>
Homepage: https://pandorafms.org/
Depends: coreutils, perl, unzip
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731, HP-UX Version
# Version 7.0NG.735, HP-UX Version
# 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.731, GNU/Linux
# Version 7.0NG.735, 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.731, GNU/Linux
# Version 7.0NG.735, 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.731, Solaris Version
# Version 7.0NG.735, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.731
# Version 7.0NG.735
# 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

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.731, AIX version
# Version 7.0NG.735, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.731
# Version 7.0NG.735
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.731, HPUX Version
# Version 7.0NG.735, HPUX Version
# General Parameters
# ==================

View File

@ -1,10 +1,10 @@
package: pandorafms-agent
Version: 4.0
Version: 7.0
Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Maintainer: ÁRTICA ST <info@artica.es>
Homepage: http://pandorafms.org/
Depends: coreutils, perl
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731
# Version 7.0NG.735
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731
# Version 7.0NG.735
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731
# Version 7.0NG.735
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.731, Solaris version
# Version 7.0NG.735, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731, AIX version
# Version 7.0NG.735, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,10 +1,10 @@
package: pandorafms-agent-unix
Version: 7.0NG.731-190220
Version: 7.0NG.735-190611
Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Maintainer: ÁRTICA ST <info@artica.es>
Homepage: http://pandorafms.org/
Depends: coreutils, perl, unzip
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

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.731-190220"
pandora_version="7.0NG.735-190611"
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

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731, HP-UX Version
# Version 7.0NG.735, HP-UX Version
# 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.731, GNU/Linux
# Version 7.0NG.735, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.731, GNU/Linux
# Version 7.0NG.735, 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.731, NetBSD Version
# Version 7.0NG.735, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

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

View File

@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.731';
use constant AGENT_BUILD => '190220';
use constant AGENT_VERSION => '7.0NG.735';
use constant AGENT_BUILD => '190611';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -536,6 +536,12 @@ sub parse_conf_modules($) {
# Check for invalid modules
next unless (($module->{'name'} ne '' && $module->{'func'} != 0) || $module->{'func'} == \&module_plugin);
# Skip disabled modules.
if (defined($module->{'disabled'}) && $module->{'disabled'} == 1) {
log_message('setup', 'Skipping disabled module "' . $module->{'name'} . '"');
next;
}
# Set the intensive interval
if ($module->{'is_intensive'} == 1) {
$module->{'intensive_interval'} = $module->{'interval'};
@ -662,6 +668,8 @@ sub parse_conf_modules($) {
$module->{'ff_timeout'} = $1;
} elsif ($line =~ /^\s*module_each_ff\s+(\S+)\s*$/) {
$module->{'each_ff'} = $1;
} elsif ($line =~ /^\s*module_ff_type\s+(\d+)\s*$/) {
$module->{'ff_type'} = $1;
# Macros
} elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) {
$module->{'macros'}{$1} = $2;
@ -1073,6 +1081,10 @@ sub send_buffered_xml_files ($;$) {
unlink ("$temporal_file/$xml_file");
}
}
# Do not get stuck trying to send buffered XML files to a secondary server.
elsif ($flag_always == 2) {
last;
}
}
if (defined($flag_always) && ($flag_always == 2)){
swap_servers ();
@ -2101,45 +2113,28 @@ sub cron_next_execution {
}
# Get day of the week and month from cron config
my ($mday, $wday) = (split (/\s/, $cron))[2, 4];
my ($wday) = (split (/\s/, $cron))[4];
# Check the wday values to avoid infinite loop
my ($wday_down, $wday_up) = cron_get_interval($wday);
if ($wday_down ne "*" && ($wday_down > 6 || (defined($wday_up) && $wday_up > 6))) {
log_message('setup', "Invalid cron configuration $cron. Day of the week is out of limits.");
$wday = "*";
}
# Get current time and day of the week
my $cur_time = time();
my $cur_wday = (localtime ($cur_time))[6];
# Any day of the week
if ($wday eq '*') {
my $nex_time = cron_next_execution_date ($cron, $cur_time, $interval);
return $nex_time - time();
}
# A range?
else {
$wday = cron_get_closest_in_range ($cur_wday, $wday);
my $nex_time = cron_next_execution_date ($cron, $cur_time, $interval);
# Check the day
while (!cron_check_interval($wday, (localtime ($nex_time))[6])) {
# If it does not acomplish the day of the week, go to the next day.
$nex_time += 86400;
$nex_time = cron_next_execution_date ($cron, $nex_time, 0);
}
# A specific day of the week
my $count = 0;
my $nex_time = $cur_time;
do {
$nex_time = cron_next_execution_date ($cron, $nex_time, $interval);
my $nex_time_wd = $nex_time;
my ($nex_mon, $nex_wday) = (localtime ($nex_time_wd))[4, 6];
my $nex_mon_wd;
do {
# Check the day of the week
if ($nex_wday == $wday) {
return $nex_time_wd - time();
}
# Move to the next day of the month
$nex_time_wd += 86400;
($nex_mon_wd, $nex_wday) = (localtime ($nex_time_wd))[4, 6];
} while ($mday eq '*' && $nex_mon_wd == $nex_mon);
$count++;
} while ($count < 60);
# Something went wrong, default to 5 minutes
return $interval;
return $nex_time - time();
}
###############################################################################
@ -2151,7 +2146,30 @@ sub cron_check_syntax ($) {
return 0 if !defined ($cron);
return ($cron =~ m/^(\d|\*|-)+ (\d|\*|-)+ (\d|\*|-)+ (\d|\*|-)+ (\d|\*|-)+$/);
}
###############################################################################
# Check if a value is inside an interval.
###############################################################################
sub cron_check_interval {
my ($elem_cron, $elem_curr_time) = @_;
# Return 1 if wildcard.
return 1 if ($elem_cron eq "*");
my ($down, $up) = cron_get_interval($elem_cron);
# Check if it is not a range
if (!defined($up)) {
return ($down == $elem_curr_time) ? 1 : 0;
}
# Check if it is on the range
if ($down < $up) {
return 0 if ($elem_curr_time < $down || $elem_curr_time > $up);
} else {
return 0 if ($elem_curr_time > $down || $elem_curr_time < $up);
}
return 1;
}
###############################################################################
# Get the next execution date for the given cron entry in seconds since epoch.
###############################################################################
@ -2189,8 +2207,7 @@ sub cron_next_execution_date {
my @nex_time_array = @curr_time_array;
# Update minutes
my ($min_down, undef) = cron_get_interval ($min);
$nex_time_array[0] = ($min_down eq '*') ? 0 : $min_down;
$nex_time_array[0] = cron_get_next_time_element($min);
$nex_time = cron_valid_date(@nex_time_array, $cur_year);
if ($nex_time >= $cur_time) {
@ -2224,8 +2241,7 @@ sub cron_next_execution_date {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
#Update the hour if fails
my ($hour_down, undef) = cron_get_interval ($hour);
$nex_time_array[1] = ($hour_down eq '*') ? 0 : $hour_down;
$nex_time_array[1] = cron_get_next_time_element($hour);
# When an overflow is passed check the hour update again
$nex_time = cron_valid_date(@nex_time_array, $cur_year);
@ -2253,10 +2269,9 @@ sub cron_next_execution_date {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
#Update the day if fails
my ($mday_down, undef) = cron_get_interval ($mday);
$nex_time_array[2] = ($mday_down eq '*') ? 1 : $mday_down;
$nex_time_array[2] = cron_get_next_time_element($mday, 1);
# When an overflow is passed check the day update in the next execution
# When an overflow is passed check the hour update in the next execution
$nex_time = cron_valid_date(@nex_time_array, $cur_year);
if ($nex_time >= $cur_time) {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
@ -2276,8 +2291,7 @@ sub cron_next_execution_date {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
#Update the month if fails
my ($mon_down, undef) = cron_get_interval ($mon);
$nex_time_array[3] = ($mon_down eq '*') ? 0 : $mon_down;
$nex_time_array[3] = cron_get_next_time_element($mon);
# When an overflow is passed check the month update in the next execution
$nex_time = cron_valid_date(@nex_time_array, $cur_year);
@ -2308,23 +2322,30 @@ sub cron_is_in_cron {
#If there is no elements means that is in cron
return 1 unless (defined($elem_cron) || defined($elem_curr_time));
# Go to last element if current is a wild card
if ($elem_cron ne '*') {
my ($down, $up) = cron_get_interval($elem_cron);
# Check if there is no a range
return 0 if (!defined($up) && ($down != $elem_curr_time));
# Check if there is on the range
if (defined($up)) {
if ($down < $up) {
return 0 if ($elem_curr_time < $down || $elem_curr_time > $up);
} else {
return 0 if ($elem_curr_time > $down || $elem_curr_time < $up);
}
}
}
# Check the element interval
return 0 unless (cron_check_interval($elem_cron, $elem_curr_time));
return cron_is_in_cron(\@deref_elems_cron, \@deref_elems_curr_time);
}
################################################################################
#Get the next tentative time for a cron value or interval in case of overflow.
#Floor data is the minimum localtime data for a position. Ex:
#Ex:
# * should returns floor data.
# 5 should returns 5.
# 10-55 should returns 10.
# 55-10 should retunrs floor data.
################################################################################
sub cron_get_next_time_element {
# Default floor data is 0
my ($curr_element, $floor_data) = @_;
$floor_data = 0 unless defined($floor_data);
my ($elem_down, $elem_up) = cron_get_interval ($curr_element);
return ($elem_down eq '*' || (defined($elem_up) && $elem_down > $elem_up))
? $floor_data
: $elem_down;
}
###############################################################################
# Returns the interval of a cron element. If there is not a range,
# returns an array with the first element in the first place of array
@ -2416,12 +2437,11 @@ sub check_module_cron {
return 1 unless ($is_first);
# Check if current timestamp is a valid cron date
my $next_execution = cron_next_execution_date(
my $next_execution = cron_next_execution(
$module->{'cron'},
$now - $interval,
$interval
0
);
return 1 if ($next_execution == $now);
return 1 if (time() + $next_execution == $now);
return 0;
}
@ -2532,6 +2552,7 @@ sub write_module_xml ($@) {
$Xml .= " <min_ff_event_critical>" . $module->{'min_ff_event_critical'} . "</min_ff_event_critical>\n" if (defined ($module->{'min_ff_event_critical'}));
$Xml .= " <ff_timeout>" . $module->{'ff_timeout'} . "</ff_timeout>\n" if (defined ($module->{'ff_timeout'}));
$Xml .= " <each_ff>" . $module->{'each_ff'} . "</each_ff>\n" if (defined ($module->{'each_ff'}));
$Xml .= " <ff_type>" . $module->{'ff_type'} . "</ff_type>\n" if (defined ($module->{'ff_type'}));
# Data list
if ($#data > 0) {
@ -3017,10 +3038,10 @@ while (1) {
my @address_list;
if( -x "/bin/ip" || -x "/sbin/ip" || -x "/usr/sbin/ip" ) {
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
}
else {
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`;
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`;
}
for (my $i = 0; $i <= $#address_list; $i++) {

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.731
%define release 190220
%define version 7.0NG.735
%define release 190611
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.731
%define release 190220
%define version 7.0NG.735
%define release 190611
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.731"
PI_BUILD="190220"
PI_VERSION="7.0NG.735"
PI_BUILD="190611"
OS_NAME=`uname -s`
FORCE=0

View File

@ -4,23 +4,44 @@
# Copyright (c) 2009 Artica Soluciones Tecnologicas S.L.
#
# inventory Generate a hardware/software inventory.
#
#
# Sample usage: ./inventory <interval in days> [cpu] [ram] [video] [nic] [hd] [cdrom] [software] [init_services] [filesystem] [process] [users]
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
#
# 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.
# GNU General Public License for more details.
#
###############################################################################
use strict;
use constant TSTAMP_FILE => '/tmp/pandora_inventory.tstamp';
use Scalar::Util qw(looks_like_number);
use Data::Dumper;
# Set environment language to English
$ENV{"LANG"} = "en_US";
# Check AIX system
my $AIX=0;
my $system = `uname -a | awk '{print $1}'`;
if ($system =~ 'AIX') {
$AIX=1;
}
sub is_enabled {
my $value = shift;
if ((defined ($value)) && looks_like_number($value) && ($value > 0)){
# return true
return 1;
}
#return false
return 0;
}
# Operation mode (LSHW or HWINFO)
my $Mode;
@ -31,12 +52,12 @@ my $Separator;
sub get_module_data ($$$$) {
my ($name, $hwinfo, $keys, $modules) = @_;
my %module;
# Store keys
$Separator='\s+\*\-';
# Store keys
foreach my $key (@{$keys}) {
push (@{$module{'_keys'}}, $key);
}
# Parse module data
while (my $line = shift (@{$hwinfo})) {
if ($line =~ /$Separator/) {
@ -46,7 +67,7 @@ sub get_module_data ($$$$) {
foreach my $key (@{$keys}) {
if ($line =~ /$key:\s+(.+)/) {
$module{$key} = $1;
# Replace semicolon by comma to avoid parse errors
# Replace semicolon by comma to avoid parse errors
$module{$key} =~ s/;/,/g;
}
}
@ -58,12 +79,65 @@ sub get_module_data ($$$$) {
push (@{$modules->{$name}}, \%module);
}
sub test_contain ($$) {
my ($value, $array)=@_;
if ( grep( /$value/, @{$array} ) ) {
return 1;
}
}
sub get_module_data_aix_ram_cpu ($$$$) {
my ($name, $hwinfo, $keys, $modules) = @_;
my %module;
# Store keys
foreach my $key (@{$keys}) {
push (@{$module{'_keys'}}, $key);
}
# Parse module data
foreach my $line (@{$hwinfo}) {
foreach my $key (@{$keys}) {
if ($line =~ /$key:\s+(.+)/) {
$module{$key} = $1;
$module{$key} =~ s/,/ /g;
}
}
}
# No data found
#my @data = keys (%module);
#return unless ($#data >= 0);
push (@{$modules->{$name}}, \%module);
}
sub get_module_data_aix ($$$$) {
my ($name,$hwinfo,$regex,$modules) = @_;
my %module;
foreach my $line (@{$hwinfo}) {
$line =~ s/\s{2,}/;/g;
$line =~ s/\+ //g;
$line =~ s/\* //g;
}
foreach my $line (@{$hwinfo}) {
if ($line =~ /$regex/){
my ($var1, $var2, $var3) = split /;/, $line;
my %module;
$module{'device'} = $var1;
$module{'serial'} = $var2;
$module{'description'}=$var3;
$module{'_keys'} = ['device','serial','description'];
push (@{$modules->{$name}}, \%module);
}
}
}
# Get a list of information file system in machine
sub get_file_system($$) {
my ($name, $modules) = @_;
my @fileSystems = `df -hP | tail -n +2`; #remove the titles of columns
my @fileSystems;
if (is_enabled $AIX){
@fileSystems = `df -gP | tail -n +2`;
} else {
@fileSystems = `df -hP | tail -n +2`; #remove the titles of columns
}
foreach my $row (@fileSystems) {
next unless ($row =~ /^(\S+)\s+\S+\s+(\S+)\s+(\S+)\s+\S+\s+(\S+)/);
@ -73,94 +147,110 @@ sub get_file_system($$) {
$module{'used'} = $2;
$module{'avail'} = $3;
$module{'mount'} = $4;
$module{'_keys'} = ['filesystem', 'used','avail', 'mount'];
push (@{$modules->{$name}}, \%module);
}
$module{'_keys'} = ['filesystem', 'used','avail', 'mount'];
push (@{$modules->{$name}}, \%module);
}
}
# Get a list of services init in machine
sub get_servicies_init_machine($$) {
my ($name, $modules) = @_;
my $runlevel = `who -r | awk '{print \$2}'`;
my $runlevel;
if (is_enabled $AIX) {
$runlevel = `who -r | awk '{print \$3}'`;
} else {
$runlevel = `who -r | awk '{print \$2}'`;
}
#ini trim($runlevel)
$runlevel =~ s/^\s*//; #ltrim
$runlevel =~ s/\s*$//; #rtrim
#end trim($runlevel)
my $script = "";
my $script;
if (-e "/etc/rc" . $runlevel .".d/") {
$script = "ls /etc/rc" . $runlevel .".d/ -l | grep \"^l.*\" | awk \"{print \\\$NF}\" | sed -e \"s/\\.\\.\\///g\" | sed -e \"s/.*init\\.d\\///g\"";
$script = "ls -l /etc/rc" . $runlevel .".d/ | grep \"^l.*\" | awk \"{print \\\$NF}\" | sed -e \"s/\\.\\.\\///g\" | sed -e \"s/.*init\\.d\\///g\"";
}
else {
$script = "ls /etc/rc.d/rc" . $runlevel .".d/ -l | grep \"^l.*\" | grep \" S.* \" | awk \"{print \\\$NF}\" | sed -e \"s/\\.\\.\\///g\" | sed -e \"s/.*init\\.d\\///g\"";
$script = "ls -l /etc/rc.d/rc" . $runlevel .".d/ | grep \"^l.*\" | grep \" S.* \" | awk \"{print \\\$NF}\" | sed -e \"s/\\.\\.\\///g\" | sed -e \"s/.*init\\.d\\///g\"";
}
my @services = `$script`;
foreach my $row (@services) {
my %module;
$row =~ s/\n//;
$module{'service'} = $row;
$module{'_keys'} = ['service'];
push (@{$modules->{$name}}, \%module);
$row =~ s/\n//;
$module{'service'} = $row;
$module{'_keys'} = ['service'];
push (@{$modules->{$name}}, \%module);
}
}
# Get a list of running processes
sub get_processes ($$) {
my ($name, $modules) = @_;
my $script;
if (is_enabled $AIX) {
$script = "ps -eo args | tail -n +2";
} else {
$script = "ps -eo command | tail -n +2";
}
my $script = "ps -eo command";
my @services = `$script`;
foreach my $row (@services) {
my %module;
# Remove carriage returns
$row =~ s/[\n\l\f]//g;
# Replace semicolon by comma to avoid parse errors
$row =~ s/;/,/g;
$module{'service'} = $row;
$module{'_keys'} = ['service'];
push (@{$modules->{$name}}, \%module);
}
my @services = `$script`;
foreach my $row (@services) {
my %module;
# Remove carriage returns
$row =~ s/[\n\l\f]//g;
# Replace semicolon by comma to avoid parse errors
$row =~ s/;/,/g;
$module{'service'} = $row;
$module{'_keys'} = ['service'];
push (@{$modules->{$name}}, \%module);
}
}
# Get a list of valid users in the system
sub get_users ($$) {
my ($name, $modules) = @_;
my $script = "cat /etc/passwd";
my ($name, $modules) = @_;
my $script = "cat /etc/passwd";
my $user = "";
my $estado = "";
my @services = `$script`;
foreach my $row (@services) {
my %module;
my @services = `$script`;
foreach my $row (@services) {
my %module;
next unless ($row =~ /^([A-Za-z0-9\-\_]*)/);
$user = $1;
$script = `passwd -S $user`;
if ( $script =~ /^(\S+)\sP./){
$module{'user'} = $user;
$module{'_keys'} = ['user'];
push (@{$modules->{$name}}, \%module);
next unless ($row =~ /^([A-Za-z0-9\-\_]*)/);
if (is_enabled $AIX) {
$user = $1;
$script = `lsuser $user`;
if ( $script =~ /^(\S+)\sid./){
$module{'user'} = $user;
$module{'_keys'} = ['user'];
push (@{$modules->{$name}}, \%module);
}
} else {
$user = $1;
$script = `passwd -S $user`;
if ( $script =~ /^(\S+)\sP./){
$module{'user'} = $user;
$module{'_keys'} = ['user'];
push (@{$modules->{$name}}, \%module);
}
}
}
}
# Show Kernel Information
sub get_kernel_info ($$) {
my ($name, $modules) = @_;
my $script = `uname -a | tr -d \";\"`;
my %module;
my ($name, $modules) = @_;
my $script = `uname -a | tr -d \";\"`;
my %module;
$module{'Kernel'} = $script;
$module{'_keys'} = ['Kernel'];
push (@{$modules->{$name}}, \%module);
$module{'Kernel'} = $script;
$module{'_keys'} = ['Kernel'];
push (@{$modules->{$name}}, \%module);
}
@ -171,11 +261,13 @@ sub get_software_module_data ($$) {
# Guess the current distribution
my $distrib_id = "";
if ( -e "/etc/SuSE-release"){
if (is_enabled $AIX) {
$distrib_id = "AIX";
}elsif ( -e "/etc/SuSE-release"){
$distrib_id = "SUSE";
} elsif ( -e "/etc/redhat-release"){
}elsif ( -e "/etc/redhat-release"){
$distrib_id = "REDHAT";
} else {
}else {
$distrib_id = "DEBIAN";
}
@ -183,7 +275,9 @@ sub get_software_module_data ($$) {
my @soft;
if ($distrib_id eq 'DEBIAN') {
@soft = `dpkg -l | grep ii`;
} else {
}elsif ($distrib_id eq 'AIX') {
@soft = `lslpp -Lcq | awk -F: '{print "ii "\$1" "\$3" "\$8}'`;
}else {
# Sometimes rpm return data splitted in two lines, and with dupes. Thats bad for our inventory system
@soft = `rpm -q -a --qf "ii %{NAME} %{VERSION} %{SUMMARY}\n" | grep "^ii" | sort -u`;
}
@ -197,7 +291,7 @@ sub get_software_module_data ($$) {
$module{'program'} = $1;
$module{'version'} = $2;
$module{'description'} = $3;
# Replace semicolon by comma to avoid parse errors
# Replace semicolon by comma to avoid parse errors
$module{'program'} =~ s/;/,/g;
$module{'version'} =~ s/;/,/g;
$module{'description'} =~ s/;/,/g;
@ -211,67 +305,95 @@ sub get_software_module_data ($$) {
#Get the list of interfaces with the ip assigned
sub get_ips ($$) {
my ($name, $modules) = @_;
my @interfaces;
my $ifconfig;
if (is_enabled $AIX) {
$ifconfig = `ifconfig -a`;
} else {
$ifconfig = `ifconfig`;
}
my $ifconfig = `ifconfig`;
my @ifconfig_array = split("\n", $ifconfig);
for(my $i = 0; $i<$#ifconfig_array; $i++) {
#Check for an interface
if ($ifconfig_array[$i] =~ /Link/) {
my %info;
my @line_split = split(" ", $ifconfig_array[$i]);
#Get interface name
$info{'interface'} = $line_split[0];
#Get IP address
my $line = $ifconfig_array[$i+1];
$line =~ s/\s+//g;
my @ifconfig_array = split("\n", $ifconfig);
@line_split = split(":", $line);
if($line_split[1] =~ /(\d+\.\d+\.\d+\.\d+).+/) {
$info{'ip'} = $1;
}
$info{'_keys'} = ['interface', 'ip'];
push (@{$modules->{$name}}, \%info);
}
foreach (@ifconfig_array){
if ($_=~/(.*)flags/){
my $match;
($match)=$_=~/^(.*?)\: flags/;
$match=~s/://;
push @interfaces,$match;
}
}
foreach (@interfaces) {
my $ifconfig_item=`ifconfig $_`;
my $interface=$_;
my @ip_array = split("\n", $ifconfig_item);
foreach (@ip_array) {
if ($_=~/(?<=inet )(.*)(?= netmask)/){
my $ip;
($ip)=$_=~/inet (.*) netmask/;
my %info;
$info{'interface'} = $interface;
$info{'ip'} = $ip;
$info{'_keys'} = ['interface','ip'];
push (@{$modules->{$name}}, \%info);
}
}
}
}
#Get route table
sub get_route_table ($$) {
my ($name, $modules) = @_;
my $route_table = `route`;
my @table_split = split("\n", $route_table);
for (my $i=2; $i<=$#table_split; $i++) {
my @split = split(" ", $table_split[$i]);
my %info;
$info{'destination'} = $split[0];
$info{'gateway'} = $split[1];
$info{'mask'} = $split[2];
$info{'flags'} = $split[3];
$info{'metric'} = $split[4];
$info{'ref'} = $split[5];
$info{'use'} = $split[6];
$info{'interface'} = $split[7];
$info{'_keys'} = ['destination', 'gateway', 'mask', 'flags', 'metric', 'use', 'interface'];
push (@{$modules->{$name}}, \%info);
}
my ($name, $modules) = @_;
my $route_table;
my @table_split;
if (is_enabled $AIX) {
$route_table = `netstat -rn`;
@table_split = split("\n", $route_table);
my $length=scalar @table_split;
for (my $i=4; $i<=$length-4; $i++) {
my @split = split(" ", $table_split[$i]);
my %info;
$info{'destination'} = $split[0];
$info{'gateway'} = $split[1];
$info{'mask'} = $split[2];
$info{'flags'} = $split[3];
$info{'metric'} = $split[4];
$info{'ref'} = $split[5];
$info{'use'} = $split[6];
$info{'interface'} = $split[7];
$info{'_keys'} = ['destination', 'gateway', 'mask', 'flags', 'metric', 'use', 'interface'];
push (@{$modules->{$name}}, \%info);
}
} else {
$route_table = `route`;
my @table_split = split("\n", $route_table);
for (my $i=2; $i<=$#table_split; $i++) {
my @split = split(" ", $table_split[$i]);
my %info;
$info{'destination'} = $split[0];
$info{'gateway'} = $split[1];
$info{'mask'} = $split[2];
$info{'flags'} = $split[3];
$info{'metric'} = $split[4];
$info{'ref'} = $split[5];
$info{'use'} = $split[6];
$info{'interface'} = $split[7];
$info{'_keys'} = ['destination', 'gateway', 'mask', 'flags', 'metric', 'use', 'interface'];
push (@{$modules->{$name}}, \%info);
}
}
}
# Print module data
sub print_module ($$) {
@ -309,14 +431,18 @@ my $enable_all = 0;
$interval = $ARGV[0];
if ($#ARGV == 0){
$enable_all = 1;
$enable_all = 1;
}
if ($interval!=/[:alpha:]/){
splice @ARGV,0,1;
}
foreach my $module (@ARGV) {
foreach my $module (@ARGV) {
if ($module eq "all"){
$enable_all = 1;
}
$enabled{$module} = 1;
$enable_all = 1;
}else {
$enabled{$module} = 1;
}
}
# Check execution interval
@ -333,76 +459,107 @@ close (FILE);
# Retrieve hardware information
$Mode = 'LSHW';
$Separator = '\s+\*\-';
my @hwinfo = `lshw 2>/dev/null`;
if ($? != 0) {
$Mode = 'HWINFO';
$Separator = 'Hardware Class:';
@hwinfo = `hwinfo --cpu --memory --gfxcard --netcard --cdrom --disk 2>/dev/null`;
my @hwinfo;
if (is_enabled $AIX) {
$Separator = '^\s*$';
@hwinfo=`prtconf 2>/dev/null`;
} else {
@hwinfo = `lshw 2>/dev/null`;
if ($? != 0) {
$Mode = 'HWINFO';
$Separator = 'Hardware Class:';
@hwinfo = `hwinfo --cpu --memory --gfxcard --netcard --cdrom --disk 2>/dev/null`;
}
}
# Parse hardware information
my %modules;
while (my $line = shift (@hwinfo)) {
if (is_enabled $AIX) {
#CPU
# VIDEO
### Not avilable in AIX ###
# NIC
### Not relevant in AIX ###
if ((test_contain('ent',\@hwinfo)) && ($enable_all == 1 || $enabled{'nic'} == 1)) {
get_module_data_aix ('NIC',\@hwinfo,'^ent',\%modules);
}
if ((test_contain('hdisk',\@hwinfo)) && ($enable_all == 1 || $enabled{'hd'} == 1)) {
get_module_data_aix ('HD',\@hwinfo,'^hdisk',\%modules);
}
foreach my $line (@hwinfo) {
chomp ($line);
#CPU
if (($line =~ /^Memory Size:/) && ($enable_all == 1 || $enabled{'ram'} == 1)) {
get_module_data_aix_ram_cpu ('RAM', \@hwinfo, ['Memory Size','Good Memory Size'], \%modules);
}
if (($line =~ /^System Model/) && ($enable_all == 1 || $enabled{'cpu'} == 1)) {
get_module_data_aix_ram_cpu ('CPU', \@hwinfo, ['System Model', 'Processor Implementation Mode', 'Number Of Processors'], \%modules);
}
}
} else {
# Parse hardware information
while (my $line= shift (@hwinfo)) {
chomp ($line);
# CPU
if (($line =~ /\*\-cpu/ || $line =~ /Hardware Class: cpu/) && ($enable_all == 1 || $enabled{'cpu'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('CPU', \@hwinfo, ['product', 'vendor', 'capacity'], \%modules);
} else {
get_module_data ('CPU', \@hwinfo, ['Model', 'Vendor', 'Clock'], \%modules);
}
}
# CPU
if (($line =~ /\*\-cpu/ || $line =~ /Hardware Class: cpu/) && ($enable_all == 1 || $enabled{'cpu'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('CPU', \@hwinfo, ['product', 'vendor', 'capacity'], \%modules);
} else {
get_module_data ('CPU', \@hwinfo, ['Model', 'Vendor', 'Clock'], \%modules);
}
}
# RAM
if (($line =~ /\*\-bank/ || $line =~ /\*\-memory/ || $line =~ /Hardware Class: memory/) && ($enable_all == 1 || $enabled{'ram'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('RAM', \@hwinfo, ['description', 'size'], \%modules);
} else {
get_module_data ('RAM', \@hwinfo, ['Model', 'Memory Size'], \%modules);
}
}
# RAM
if (($line =~ /\*\-bank/ || $line =~ /Hardware Class: memory/) && ($enable_all == 1 || $enabled{'ram'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('RAM', \@hwinfo, ['description', 'size'], \%modules);
} else {
get_module_data ('RAM', \@hwinfo, ['Model', 'Memory Size'], \%modules);
}
}
# VIDEO
if (($line =~ /\*\-display/ || $line =~ /Hardware Class: graphics card/) && ($enable_all == 1 || $enabled{'video'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('VIDEO', \@hwinfo, ['product', 'description', 'vendor'], \%modules);
} else {
# Spaces before Device and Vendor are intentional to avoid matching SubDevice and SubVendor
get_module_data ('VIDEO', \@hwinfo, ['Model', ' Device', ' Vendor'], \%modules);
}
}
# VIDEO
if (($line =~ /\*\-display/ || $line =~ /Hardware Class: graphics card/) && ($enable_all == 1 || $enabled{'video'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('VIDEO', \@hwinfo, ['product', 'description', 'vendor'], \%modules);
} else {
# Spaces before Device and Vendor are intentional to avoid matching SubDevice and SubVendor
get_module_data ('VIDEO', \@hwinfo, ['Model', ' Device', ' Vendor'], \%modules);
}
}
# NIC
if (($line =~ /\*\-network/ || $line =~ /Hardware Class: network/) && ($enable_all == 1 || $enabled{'nic'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('NIC', \@hwinfo, ['product', 'description', 'vendor', 'serial'], \%modules);
} else {
# Spaces before Device and Vendor are intentional to avoid matching SubDevice and SubVendor
get_module_data ('NIC', \@hwinfo, ['Model', ' Device', ' Vendor', 'HW Address'], \%modules);
}
}
# NIC
if (($line =~ /\*\-network/ || $line =~ /Hardware Class: network/) && ($enable_all == 1 || $enabled{'nic'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('NIC', \@hwinfo, ['product', 'description', 'vendor', 'serial'], \%modules);
} else {
# Spaces before Device and Vendor are intentional to avoid matching SubDevice and SubVendor
get_module_data ('NIC', \@hwinfo, ['Model', ' Device', ' Vendor', 'HW Address'], \%modules);
}
}
# CDROM
if (($line =~ /\*\-cdrom/ || $line =~ /Hardware Class: cdrom/) && ($enable_all == 1 || $enabled{'cdrom'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('CDROM', \@hwinfo, ['product', 'description', 'vendor'], \%modules);
} else {
# Spaces before Device and Vendor are intentional to avoid matching SubDevice and SubVendor
get_module_data ('CDROM', \@hwinfo, ['Model', ' Device', ' Vendor'], \%modules);
}
}
# CDROM
if (($line =~ /\*\-cdrom/ || $line =~ /Hardware Class: cdrom/) && ($enable_all == 1 || $enabled{'cdrom'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('CDROM', \@hwinfo, ['product', 'description', 'vendor'], \%modules);
} else {
# Spaces before Device and Vendor are intentional to avoid matching SubDevice and SubVendor
get_module_data ('CDROM', \@hwinfo, ['Model', ' Device', ' Vendor'], \%modules);
}
}
# HD
if (($line =~ /\*\-disk/ || $line =~ /Hardware Class: disk/) && ($enable_all == 1 || $enabled{'hd'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('HD', \@hwinfo, ['product', 'description', 'size'], \%modules);
} else {
get_module_data ('HD', \@hwinfo, ['Model', 'Serial ID', 'Size'], \%modules);
}
}
# HD
if (($line =~ /\*\-disk/ || $line =~ /Hardware Class: disk/) && ($enable_all == 1 || $enabled{'hd'} == 1)) {
if ($Mode eq 'LSHW') {
get_module_data ('HD', \@hwinfo, ['product', 'description', 'size'], \%modules);
} else {
get_module_data ('HD', \@hwinfo, ['Model', 'Serial ID', 'Size'], \%modules);
}
}
}
}
# Software
if ($enable_all == 1 || $enabled{'software'} == 1) {
get_software_module_data ('Software', \%modules);
@ -410,12 +567,12 @@ if ($enable_all == 1 || $enabled{'software'} == 1) {
#init_services
if ($enable_all == 1 || $enabled{'init_services'} == 1) {
get_servicies_init_machine ('Init services', \%modules);
get_servicies_init_machine ('Init_services', \%modules);
}
#filesystem
if ($enable_all == 1 || $enabled{'filesystem'} == 1) {
get_file_system('File system', \%modules);
get_file_system('Filesystem', \%modules);
}
#processes
@ -442,7 +599,6 @@ if ($enable_all == 1 || $enabled{'route'} == 1) {
if ($enable_all == 1 || $enabled{'kernel'} == 1){
get_kernel_info ('Kernel', \%modules);
}
# Print module data
print "<inventory>\n";
while (my ($name, $module) = each (%modules)) {

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.731
# Version 7.0NG.735
# 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
@ -44,6 +44,8 @@ remote_config 0
#agent_name_cmd cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\agentname.vbs"
agent_name_cmd __rand__
# Agent alias. Name should be unique rather than alias. Hostname by default
# agent_alias $Alias$
#Parent agent_name
#parent_agent_name caprica

View File

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

View File

@ -214,7 +214,7 @@ int Cron::getResetValue (int position) {
int default_value = 0;
// Days start in 1
if (position == 2) default_value = 1;
return isWildCard(position)
return (isWildCard(position) || !isNormalInterval(position))
? default_value
: this->params[position][CRDOWN];
}

View File

@ -78,6 +78,7 @@ Pandora_Module::Pandora_Module (string name) {
this->warning_inverse = "";
this->quiet = "";
this->module_ff_interval = "";
this->module_ff_type = "";
this->module_alert_template = "";
this->module_crontab = "";
}
@ -733,6 +734,13 @@ Pandora_Module::getXml () {
module_xml += this->module_ff_interval;
module_xml += "</module_ff_interval>\n";
}
/* Module FF type */
if (this->module_ff_type != "") {
module_xml += "\t<ff_type>";
module_xml += this->module_ff_type;
module_xml += "</ff_type>\n";
}
/* Module Alert template */
if (this->module_alert_template != "") {
@ -1028,6 +1036,16 @@ Pandora_Module::setModuleFFInterval (string value) {
this->module_ff_interval = value;
}
/**
* Set the module FF type for the module.
*
* @param value module FF type value to set.
*/
void
Pandora_Module::setModuleFFType (string value) {
this->module_ff_type = value;
}
/**
* Set the module Alert template for the module.
*

View File

@ -176,6 +176,7 @@ namespace Pandora_Modules {
string unit, custom_id, str_warning, str_critical;
string module_group, warning_inverse, critical_inverse, quiet;
string module_ff_interval, module_alert_template, module_crontab;
string module_ff_type;
string critical_instructions, warning_instructions, unknown_instructions, tags;
protected:
@ -277,6 +278,7 @@ namespace Pandora_Modules {
void setWarningInverse (string value);
void setQuiet (string value);
void setModuleFFInterval (string value);
void setModuleFFType (string value);
void setModuleAlertTemplate (string value);
void setModuleCrontab (string value);

View File

@ -119,6 +119,7 @@ using namespace Pandora_Strutils;
#define TOKEN_WARNING_INVERSE ("module_warning_inverse ")
#define TOKEN_QUIET ("module_quiet ")
#define TOKEN_MODULE_FF_INTERVAL ("module_ff_interval ")
#define TOKEN_MODULE_FF_TYPE ("module_ff_type ")
#define TOKEN_MACRO ("module_macro")
#define TOKEN_NATIVE_ENCODING ("module_native_encoding")
#define TOKEN_ALERT_TEMPLATE ("module_alert_template")
@ -176,7 +177,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
string module_unit, module_group, module_custom_id, module_str_warning, module_str_critical;
string module_critical_instructions, module_warning_instructions, module_unknown_instructions, module_tags;
string module_critical_inverse, module_warning_inverse, module_quiet, module_ff_interval;
string module_native_encoding, module_alert_template;
string module_native_encoding, module_alert_template, module_ff_type;
string macro;
Pandora_Module *module;
bool numeric;
@ -254,6 +255,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
module_warning_inverse = "";
module_quiet = "";
module_ff_interval = "";
module_ff_type = "";
module_native_encoding = "";
module_alert_template = "";
module_user_session = "";
@ -507,6 +509,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
if (module_ff_interval == "") {
module_ff_interval = parseLine (line, TOKEN_MODULE_FF_INTERVAL);
}
if (module_ff_type == "") {
module_ff_type = parseLine (line, TOKEN_MODULE_FF_TYPE);
}
if (module_alert_template == "") {
module_alert_template = parseLine (line, TOKEN_ALERT_TEMPLATE);
@ -1087,6 +1093,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
}
}
if (module_ff_type != "") {
pos_macro = module_ff_type.find(macro_name);
if (pos_macro != string::npos){
module_ff_type.replace(pos_macro, macro_name.size(), macro_value);
}
}
if (module_alert_template != "") {
pos_macro = module_alert_template.find(macro_name);
if (pos_macro != string::npos){
@ -1104,6 +1117,12 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
}
}
/* Skip disabled modules */
if (module_disabled == "1") {
pandoraLog ("Skipping disabled module \"%s\"", module_name.c_str ());
return NULL;
}
/* Create module objects */
if (module_exec != "") {
module = new Pandora_Module_Exec (module_name,
@ -1447,6 +1466,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
if (module_ff_interval != "") {
module->setModuleFFInterval (module_ff_interval);
}
if (module_ff_type != "") {
module->setModuleFFType (module_ff_type);
}
if (module_alert_template != "") {
module->setModuleAlertTemplate (module_alert_template);

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.731(Build 190220)")
#define PANDORA_VERSION ("7.0NG.735(Build 190611)")
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.731(Build 190220))"
VALUE "ProductVersion", "(7.0NG.735(Build 190611))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.731-190220
Version: 7.0NG.735-190611
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.731-190220"
pandora_version="7.0NG.735-190611"
package_pear=0
package_pandora=1
@ -149,7 +149,7 @@ if [ $package_pear -eq 1 ]
then
echo "Make the package \"php-xml-rpc\"."
cd temp_package
dh-make-pear --maintainer "Miguel de Dios <miguel.dedios@artica.es>" XML_RPC
dh-make-pear --maintainer "ÁRTICA ST <info@artica.es>" XML_RPC
cd php-xml-rpc-*
dpkg-buildpackage -rfakeroot
cd ..

View File

@ -10,5 +10,16 @@
"require": {
"mpdf/mpdf": "^7.1",
"swiftmailer/swiftmailer": "^6.0"
},
"autoload": {
"psr-4": {
"Models\\": "include/rest-api/models",
"Enterprise\\Models\\": "enterprise/include/rest-api/models"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
}
}

View File

@ -138,8 +138,15 @@ function mainAgentsAlerts()
$onheader['combo_refr'] = $comborefr;
}
// Header
ui_print_page_header(__('Agents/Alerts'), 'images/op_alerts.png', false, '', false, $updated_time);
// Header.
ui_print_page_header(
__('Agents/Alerts'),
'images/op_alerts.png',
false,
'agents_alerts_view',
false,
$updated_time
);
// Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table
@ -291,7 +298,7 @@ function mainAgentsAlerts()
$table2->data[2][0] = __('Threshold');
$table2->data[2][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true);
$table2->data[2][1] .= ' '.__('seconds').ui_print_help_icon('action_threshold', true);
$table2->data[2][1] .= ' '.__('seconds');
$content2 = '<form class="add_alert_form" method="post">';
$content2 .= html_print_table($table2, true);
@ -378,7 +385,8 @@ function mainAgentsAlerts()
'alerts_agents'
);
echo '<table class="databox data" cellpadding="0" cellspacing="0" border="0" width=100%>';
echo '<table class="info_table" cellpadding="0" cellspacing="0" border="0" width=100%>';
echo '<thead><tr>';
echo "<th width='140px' >".__('Agents').' / '.__('Alert templates').'</th>';
if ($hor_offset > 0) {
@ -421,9 +429,10 @@ function mainAgentsAlerts()
continue;
}
echo '<th width="20px" >'.io_safe_output($tname).html_print_image('images/information_alerts.png', true, ['title' => io_safe_output($tname), 'style' => 'margin-left:5px' ]).'</th>';
echo '<th width="20px" >'.io_safe_output($tname).'</th>';
}
echo '</tr></thead>';
if (($hor_offset + $block) < $ntemplates) {
$new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' style='' rowspan='".($nagents + 1)."'>
@ -455,7 +464,7 @@ function mainAgentsAlerts()
$cellstyle = 'background:'.COL_ALERTFIRED.';';
}
echo '<td style=";'.$cellstyle.'"> ';
echo '<td style=";'.$cellstyle.'" class="action_buttons"> ';
$uniqid = uniqid();
echo '<div>';
@ -478,6 +487,23 @@ function mainAgentsAlerts()
}
echo '</table>';
ui_pagination(
$nagents,
false,
0,
0,
false,
'offset',
true,
'pagination-bottom',
'',
[
'count' => '',
'offset' => 'offset_param',
],
'alerts_agents'
);
}
}
@ -487,7 +513,7 @@ function mainAgentsAlerts()
function print_alerts_summary_modal_window($id, $alerts)
{
$table->width = '98%';
$table->class = 'databox';
$table->class = 'info_table';
$table->data = [];
$table->head[0] = __('Module');

View File

@ -181,8 +181,15 @@ function mainAgentsModules()
// Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table
if ($config['pure'] == 0) {
// Header
ui_print_page_header(__('Agents/Modules'), 'images/module_mc.png', false, '', false, $updated_time);
// Header.
ui_print_page_header(
__('Agents/Modules'),
'images/module_mc.png',
false,
'agents_module_view',
false,
$updated_time
);
echo '<table style="width:100%;">';
echo '<tr>';
echo "<td> <span style='float: right;'>".$fullscreen['text'].'</span> </td>';
@ -661,7 +668,7 @@ $ignored_params['refresh'] = '';
else {
var agentes_id = $("#id_agents2").val();
var id_agentes = $.get("full_agents_id");
var id_agentes = getQueryParam("full_agents_id");
if (agentes_id === null && id_agentes !== null) {
id_agentes = id_agentes.split(";")
id_agentes.forEach(function(element) {
@ -799,7 +806,7 @@ $ignored_params['refresh'] = '';
$("#module").append (option);
});
var id_modules = $.get("full_modules_selected");
var id_modules = getQueryParam("full_modules_selected");
if(id_modules !== null) {
id_modules = id_modules.split(";");
id_modules.forEach(function(element) {
@ -812,20 +819,18 @@ $ignored_params['refresh'] = '';
);
}
(function($) {
$.get = function(key) {
key = key.replace(/[[]/, '[');
key = key.replace(/[]]/, ']');
var pattern = "[?&]" + key + "=([^&#]*)";
var regex = new RegExp(pattern);
var url = unescape(window.location.href);
var results = regex.exec(url);
if (results === null) {
return null;
} else {
return results[1];
}
}
})(jQuery);
function getQueryParam (key) {
key = key.replace(/[[]/, '[');
key = key.replace(/[]]/, ']');
var pattern = "[?&]" + key + "=([^&#]*)";
var regex = new RegExp(pattern);
var url = unescape(window.location.href);
var results = regex.exec(url);
if (results === null) {
return null;
} else {
return results[1];
}
}
</script>
</script>

View File

@ -25,7 +25,7 @@ function extension_db_status()
__('DB Schema check'),
'images/extensions.png',
false,
'',
'db_status_tab',
true,
''
);
@ -215,7 +215,7 @@ function extension_db_check_tables_differences(
$diff_tables = array_diff($tables_test, $tables_system);
ui_print_result_message(
!empty($diff_tables),
empty($diff_tables),
__('Success! %s DB contains all tables', get_product_name()),
__(
'%s DB could not retrieve all tables. The missing tables are (%s)',

View File

@ -148,7 +148,7 @@ function dbmgr_extension_main()
echo "<div style='overflow: auto;'>";
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
$table->head = array_keys($result[0]);
$table->data = $result;

View File

@ -45,11 +45,9 @@ if (!empty($files)) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
$table->style = [];
$table->style[1] = 'max-width: 200px;';
$table->style[2] = 'text-align: center;';
$table->style[3] = 'text-align: center;';
$table->style[4] = 'text-align: center;';
$table->head = [];
$table->head[0] = __('Name');
@ -81,6 +79,7 @@ if (!empty($files)) {
// Last modification
// Public URL
$data[4] = '';
$table->cellclass[][4] = 'action_buttons';
if (!empty($file['hash'])) {
$public_url = ui_get_full_url(EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']);
$message = __('Copy to clipboard').': Ctrl+C -> Enter';
@ -92,7 +91,7 @@ if (!empty($files)) {
}
$data[4] .= "<a href=\"$url\" target=\"_blank\">";
$data[4] .= html_print_image('images/download.png', true, ['title' => __('Download')]);
$data[4] .= html_print_image('images/download.png', true, ['title' => __('Download'), 'style' => 'padding:3px' ]);
// Download image
$data[4] .= '</a>';

View File

@ -192,7 +192,14 @@ function mainModuleGroups()
$array_data[$value['id_grupo']][$value['id_mg']] = $value;
}
ui_print_page_header(__('Combined table of agent group and module group'), 'images/module_group.png', false, '', false, '');
ui_print_page_header(
__('Combined table of agent group and module group'),
'images/module_group.png',
false,
'module_groups_view',
false,
''
);
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
<tr>";

View File

@ -29,7 +29,14 @@ function pandora_realtime_graphs()
$hide_header = get_parameter('hide_header', 0);
if (!$hide_header) {
ui_print_page_header(__('Realtime graphs'), 'images/extensions.png', false, '', false, $onheader);
ui_print_page_header(
__('Realtime graphs'),
'images/extensions.png',
false,
'real_time_view',
false,
$onheader
);
}
$chart[time()]['graph'] = '0';

View File

@ -998,20 +998,23 @@ function process_upload_xml($xml)
{
$hook_enterprise = enterprise_include('extensions/resource_registration/functions.php');
// Extract component
// Extract component.
process_upload_xml_component($xml);
$group_filter = get_parameter('group');
// Extract visual map
// Extract visual map.
process_upload_xml_visualmap($xml, $group_filter);
// Extract policies
// Extract policies.
if ($hook_enterprise === true) {
process_upload_xml_policy($xml, $group_filter);
$centralized_management = !is_central_policies_on_node();
if ($centralized_management) {
process_upload_xml_policy($xml, $group_filter);
}
}
// Extract reports
// Extract reports.
process_upload_xml_report($xml, $group_filter);
}
@ -1038,6 +1041,11 @@ function resource_registration_extension_main()
return;
}
$centralized_management = !is_central_policies_on_node();
if (!$centralized_management) {
ui_print_warning_message(__('This node is configured with centralized mode. Go to metaconsole to create a policy.'));
}
echo '<div class=notify>';
echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__("You can get more resurces in our <a href='http://pandorafms.com/Library/Library/'>Public Resource Library</a>");
echo '</div>';

View File

@ -66,10 +66,10 @@ function users_extension_main_god($god=true)
$rows = [];
echo "<div class='nf'>".__('No other users connected').'</div>';
} else {
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
$table->size = [];
$table->data = [];
$table->head = [];

View File

View File

@ -0,0 +1,3 @@
/general/login_identification_wizard.php
/general/login_required.php
/godmode/update_manager/update_manager.messages.php

View File

@ -0,0 +1,147 @@
START TRANSACTION;
UPDATE `twidget` SET `unique_name`='example' WHERE `class_name` LIKE 'WelcomeWidget';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
ALTER TABLE `trecon_task` ADD COLUMN `wmi_enabled` tinyint(1) unsigned DEFAULT '0';
ALTER TABLE `trecon_task` ADD COLUMN `auth_strings` text;
ALTER TABLE `trecon_task` ADD COLUMN `autoconfiguration_enabled` tinyint(1) unsigned default '0';
INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Application.VMware', 'Discovery&#x20;Application&#x20;script&#x20;to&#x20;monitor&#x20;VMware&#x20;technologies&#x20;&#40;ESXi,&#x20;VCenter,&#x20;VSphere&#41;', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Cloud', 'Discovery&#x20;Cloud&#x20;script&#x20;to&#x20;monitor&#x20;Cloud&#x20;technologies&#x20;&#40;AWS.EC2,&#x20;AWS.S3,&#x20;AWS.RDS,&#x20RDS,&#x20AWS.EKS&#41;', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
CREATE TABLE IF NOT EXISTS `tevent_extended` (
`id` serial PRIMARY KEY,
`id_evento` bigint(20) unsigned NOT NULL,
`external_id` bigint(20) unsigned,
`utimestamp` bigint(20) NOT NULL default '0',
`description` text,
FOREIGN KEY `tevent_ext_fk`(`id_evento`) REFERENCES `tevento`(`id_evento`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tnotification_source` (
`id` serial,
`description` VARCHAR(255) DEFAULT NULL,
`icon` text,
`max_postpone_time` int(11) DEFAULT NULL,
`enabled` int(1) DEFAULT NULL,
`user_editable` int(1) DEFAULT NULL,
`also_mail` int(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tnotification_source`
--
INSERT INTO `tnotification_source`(`description`, `icon`, `max_postpone_time`, `enabled`, `user_editable`, `also_mail`) VALUES
("System&#x20;status", "icono_info_mr.png", 86400, 1, 1, 0),
("Message", "icono_info_mr.png", 86400, 1, 1, 0),
("Pending&#x20;task", "icono_info_mr.png", 86400, 1, 1, 0),
("Advertisement", "icono_info_mr.png", 86400, 1, 1, 0),
("Official&#x20;communication", "icono_info_mr.png", 86400, 1, 1, 0),
("Sugerence", "icono_info_mr.png", 86400, 1, 1, 0);
-- -----------------------------------------------------
-- Table `tmensajes`
-- -----------------------------------------------------
ALTER TABLE `tmensajes` ADD COLUMN `url` TEXT;
ALTER TABLE `tmensajes` ADD COLUMN `response_mode` VARCHAR(200) DEFAULT NULL;
ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0';
ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL;
ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT '';
ALTER TABLE `tmensajes` ADD INDEX (`id_source`);
UPDATE `tmensajes` SET `id_source`=(SELECT `id` FROM `tnotification_source` WHERE `description` = "Message");
ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
CREATE TABLE IF NOT EXISTS `tnotification_user` (
`id_mensaje` INT(10) UNSIGNED NOT NULL,
`id_user` VARCHAR(60) NOT NULL,
`utimestamp_read` BIGINT(20),
`utimestamp_erased` BIGINT(20),
`postpone` INT,
PRIMARY KEY (`id_mensaje`,`id_user`),
FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tnotification_group` (
`id_mensaje` INT(10) UNSIGNED NOT NULL,
`id_group` mediumint(4) UNSIGNED NOT NULL,
PRIMARY KEY (`id_mensaje`,`id_group`),
FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tnotification_source_user` (
`id_source` BIGINT(20) UNSIGNED NOT NULL,
`id_user` VARCHAR(60),
`enabled` INT(1) DEFAULT NULL,
`also_mail` INT(1) DEFAULT NULL,
PRIMARY KEY (`id_source`,`id_user`),
FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tnotification_source_group` (
`id_source` BIGINT(20) UNSIGNED NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL,
PRIMARY KEY (`id_source`,`id_group`),
INDEX (`id_group`),
FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tnotification_source_group_user`(
`id_source` BIGINT(20) UNSIGNED NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL,
`id_user` VARCHAR(60),
`enabled` INT(1) DEFAULT NULL,
`also_mail` INT(1) DEFAULT NULL,
PRIMARY KEY (`id_source`,`id_user`),
FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_group`) REFERENCES `tnotification_source_group`(`id_group`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('Generate&#x20;Notification','Internal&#x20;type','This&#x20;command&#x20;allows&#x20;you&#x20;to&#x20;send&#x20;an&#x20;internal&#x20;notification&#x20;to&#x20;any&#x20;user&#x20;or&#x20;group.',1,'[\"Destination&#x20;user\",\"Destination&#x20;group\",\"Title\",\"Message\",\"Link\",\"Criticity\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="System&#x20;status"), "admin", 1, 0);
INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message";
INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`, `id_usuario_destino` FROM `tmensajes` WHERE `id_usuario_destino` != '';
INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Apache&#x20;accesses&#x20;per&#x20;client&#x20;and&#x20;status',
'&#40;.*?&#41;&#92;&#x20;-.*1.1&quot;&#92;&#x20;&#40;&#92;d+&#41;&#92;&#x20;&#92;d+',
'host,status', 1);
INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Apache&#x20;time&#x20;per&#x20;requester&#x20;and&#x20;html&#x20;code',
'&#40;.*?&#41;&#92;&#x20;-.*1.1&quot;&#92;&#x20;&#40;&#92;d+&#41;&#92;&#x20;&#40;&#92;d+&#41;',
'origin,respose,_time_', 1);
INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Count&#x20;output',
'.*',
'Coincidences', 0);
INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Events&#x20;replicated&#x20;to&#x20;metaconsole',
'.*&#x20;&#40;.*?&#41;&#x20;.*&#x20;&#40;&#92;d+&#41;&#x20;events&#x20;replicated&#x20;to&#x20;metaconsole',
'server,_events_', 0);
INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Pages&#x20;with&#x20;warnings',
'PHP&#x20;Warning:.*in&#x20;&#40;.*?&#41;&#x20;on',
'page', 0);
INSERT INTO tlog_graph_models (`title`,`regexp`,`fields`,`average`) VALUES ('Users&#x20;login',
'Starting&#x20;Session&#x20;&#92;d+&#92;&#x20;of&#x20;user&#x20;&#40;.*&#41;',
'user', 0);
COMMIT;

View File

@ -0,0 +1,24 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
`id` int(10) unsigned NOT NULL auto_increment,
`source` varchar(60) default '',
`destination` varchar(60) default '',
`utimestamp` bigint(20) default 0,
`bytes` int(18) unsigned default 0,
`pkts` int(18) unsigned default 0,
PRIMARY KEY (`id`),
UNIQUE (`source`, `destination`, `utimestamp`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
ALTER TABLE `treport_content` ADD COLUMN `show_extended_events` tinyint(1) default '0';
UPDATE `treport_content` SET type="netflow_summary" WHERE type="netflow_pie" OR type="netflow_statistics";
UPDATE `tnetflow_filter` SET aggregate="dstip" WHERE aggregate NOT IN ("dstip", "srcip", "dstport", "srcport");
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
ALTER TABLE `trecon_task` ADD COLUMN `summary` text;
COMMIT;

View File

@ -0,0 +1,54 @@
START TRANSACTION;
ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0';
ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0';
ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0';
UPDATE tuser_task SET parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
ALTER TABLE `treport_content` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `trecon_script` ADD COLUMN `type` int NOT NULL default 0;
ALTER TABLE `trecon_task` ADD COLUMN `type` int NOT NULL default 0;
UPDATE `trecon_script` SET `type` = 1 WHERE `name`="Discovery.Application.VMware";
UPDATE `trecon_script` SET `type` = 2 WHERE `name`="Discovery.Cloud";
UPDATE `trecon_script` SET `type` = 3 WHERE `name` LIKE "IPAM%Recon";
UPDATE `trecon_script` SET `type` = 4 WHERE `name` LIKE "IPMI%Recon";
UPDATE `trecon_task` SET `type`=3 WHERE `description`="Discovery.Application.VMware";
UPDATE `trecon_task` SET `type`=2 WHERE `description`="Discovery.Cloud";
UPDATE `trecon_task` SET `type`=7 WHERE `description`="Discovery.Cloud.RDS";
COMMIT;

View File

@ -0,0 +1,45 @@
START TRANSACTION;
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
DELETE FROM `tevent_response` WHERE `name` LIKE 'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event';
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (NULL,'admin','Welcome&#x20;to&#x20;Pandora&#x20;FMS&#x20;Console', '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;',NOW());
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="Official&#x20;communication"), "admin", 1, 0);
UPDATE `tnotification_source` SET `enabled`=1 WHERE `description` = 'System&#x20;status' OR `description` = 'Official&#x20;communication';
UPDATE `tnotification_source` SET `icon`="icono_logo_pandora.png" WHERE `description` = 'Official&#x20;communication';
-- ---------------------------------------------------------------------
-- Table `tvisual_console_items_cache`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tvisual_console_elements_cache` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`vc_id` INTEGER UNSIGNED NOT NULL,
`vc_item_id` INTEGER UNSIGNED NOT NULL,
`user_id` VARCHAR(60) DEFAULT NULL,
`data` TEXT NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expiration` INTEGER UNSIGNED NOT NULL COMMENT 'Seconds to expire',
PRIMARY KEY(`id`),
FOREIGN KEY(`vc_id`) REFERENCES `tlayout`(`id`)
ON DELETE CASCADE,
FOREIGN KEY(`vc_item_id`) REFERENCES `tlayout_data`(`id`)
ON DELETE CASCADE,
FOREIGN KEY (`user_id`) REFERENCES `tusuario`(`id_user`)
ON DELETE CASCADE ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_user` VARCHAR(60);
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_pass` VARCHAR(45);
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_enabled` TINYINT(1) DEFAULT '1';
COMMIT;

View File

@ -0,0 +1,6 @@
START TRANSACTION;
DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x';
COMMIT;

View File

@ -106,7 +106,9 @@ function get_value_sum($arr)
{
foreach ($arr as $clave) {
foreach ($clave as $valor) {
$result += $valor;
if (is_numeric($valor) === true) {
$result += $valor;
}
}
}
@ -120,7 +122,7 @@ function execution_time()
if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) {
return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>";
} else {
return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For a more extensive information of this data consult the Execution Time graph</a>";
return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For more information about this data, check the Execution Time graph</a>";
}
}
@ -138,7 +140,8 @@ function get_status_logs($path)
{
$status_server_log = '';
$size_server_log = number_format(get_logs_size($path));
if ($size_server_log <= 1048576) {
$size_server_log = (0 + str_replace(',', '', $size_server_log));
if ($size_server_log <= 10485760) {
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>";
} else {
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>";
@ -155,9 +158,9 @@ function percentage_modules_per_agent()
$total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo');
$average_modules_per_agent = ($total_modules / $total_agents);
if ($average_modules_per_agent <= 40) {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The average of modules per agent is less than 40 percent</a>";
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The average of modules per agent is less than 40</a>";
} else {
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbspThe average of modules per agent is more than 40 percent. You can have performance problems</a>";
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbspThe average of modules per agent is more than 40. You can have performance problems</a>";
}
return $status_average_modules;
@ -171,9 +174,9 @@ function license_capacity()
$status_license_capacity = '';
$current_count = db_get_value_sql('SELECT count(*) FROM tagente');
if ($current_count > ($license_limit * 90 / 100)) {
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is more than 90 percent</a>";
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp License capacity exceeds 90 percent</a>";
} else {
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is less than 90 percent</a>";
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp License capacity is less than 90 percent</a>";
}
return $status_license_capacity;
@ -200,9 +203,9 @@ function interval_average_of_network_modules()
$average_time = ((int) $total_module_interval_time / $total_network_modules);
if ($average_time < 180) {
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has a lot of load and a very fine configuration is required</a>";
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system is overloaded (average time $average_time) and a very fine configuration is required</a>";
} else {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has an acceptable charge</a>";
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system is not overloaded (average time $average_time) </a>";
}
if ($average_time == 0) {
@ -219,9 +222,9 @@ $attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLO
function files_attachment_folder($total_files)
{
if ($total_files <= 700) {
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has less than 700 files.</a>";
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attached folder contains less than 700 files.</a>";
} else {
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has more than 700 files.</a>";
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attached folder contains more than 700 files.</a>";
}
return $status_total_files;
@ -234,9 +237,9 @@ $tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
function status_tagente_datos($tagente_datos_size)
{
if ($tagente_datos_size <= 3000000) {
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table has an acceptable amount of data.</a>";
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table contains an acceptable amount of data.</a>";
} else {
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table has too much data. A historical database is recommended.</a>";
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table contains too much data. A historical database is recommended.</a>";
}
return $tagente_datos_size;
@ -272,6 +275,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
}
$path_server_logs = '/log/pandora/pandora_server.log';
$path_err_logs = '/log/pandora/pandora_server.error';
$path_console_logs = '/www/html/pandora_console/pandora_console.log';
$innodb_log_file_size_min_rec_value = '64M';
$innodb_log_buffer_size_min_rec_value = '16M';
@ -292,16 +296,16 @@ $key_buffer_size_min_rec_value = 256;
$read_buffer_size_min_rec_value = 32;
$read_rnd_buffer_size_min_rec_value = 32;
$query_cache_min_res_unit_min_rec_value = 2;
$innodb_file_per_table_min_rec_value = 0;
$innodb_file_per_table_min_rec_value = 1;
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation)
{
$status_tables_frag = '';
if ($tables_fragmentation > $tables_fragmentation_max_rec_value) {
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is higher than recommended. You should defragment them.</a>";
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp Table fragmentation is higher than recommended. They should be defragmented.</a>";
} else {
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is correct.</a>";
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp Table fragmentation is correct.</a>";
}
return $status_tables_frag;
@ -317,9 +321,9 @@ if ($console_mode == 1) {
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) {
echo "\nThis command line script gives information about Pandora FMS database.
This program only can be executed from console, and need a parameter, the
full path to Pandora FMS 'config.php' file.
echo "\nThis command line script contains information about Pandora FMS database.
This program can only be executed from the console, and it needs a parameter, the
full path to Pandora FMS 'config.php' file.
Usage:
php pandora_diag.php path_to_pandora_console
@ -342,15 +346,21 @@ full path to Pandora FMS 'config.php' file.
include '../include/config.php';
}
// Not from console, this is a web session
if ((!isset($config['id_user'])) or (!check_acl($config['id_user'], 0, 'PM'))) {
// Not from console, this is a web session.
if ((!isset($config['id_user'])) || (!check_acl($config['id_user'], 0, 'PM'))) {
echo "<h2>You don't have privileges to use diagnostic tool</h2>";
echo '<p>Please login with an administrator account before try to use this tool</p>';
exit;
}
// Header
ui_print_page_header(__('Pandora FMS Diagnostic tool'), '', false, '', true);
// Header.
ui_print_page_header(
__('Pandora FMS Diagnostic tool'),
'',
false,
'diagnostic_tool_tab',
true
);
echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
@ -675,7 +685,7 @@ render_info_data(
$read_rnd_buffer_size = (db_get_value_sql('SELECT @@read_rnd_buffer_size') / 1024);
$query_cache_min_res_unit = (db_get_value_sql('SELECT @@query_cache_min_res_unit') / 1024);
$innodb_file_per_table = db_get_value_sql('SELECT @@innodb_file_per_table');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('MySQL Performance metrics').'</th></tr>';
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('MySQL Performance metrics').' '.ui_print_help_icon('performance_metrics_tab', true).'</th></tr>';
render_row(status_values($innodb_log_file_size_min_rec_value, $innodb_log_file_size), 'InnoDB log file size ', 'InnoDB log file size ');
render_row(status_values($innodb_log_buffer_size_min_rec_value, $innodb_log_buffer_size), 'InnoDB log buffer size ', 'InnoDB log buffer size ');
@ -702,12 +712,14 @@ render_info_data(
render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)');
render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)');
render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Status fragmentation tables');
render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Table fragmentation status');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS logs dates').'</th></tr>';
render_row(number_format((get_logs_size($path_server_logs) / 1048576), 3).'M', 'Size server logs (current value)');
render_row(get_status_logs($path_server_logs), 'Status server logs');
render_row(number_format((get_logs_size($path_err_logs) / 1048576), 3).'M', 'Size error logs (current value)');
render_row(get_status_logs($path_err_logs), 'Status error logs');
render_row(number_format((get_logs_size($path_console_logs) / 1048576), 3).'M', 'Size console logs (current value)');
render_row(get_status_logs($path_console_logs), 'Status console logs');
@ -729,14 +741,14 @@ render_info_data(
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Status of the attachment folder').'</th></tr>';
render_row($attachment_total_files, 'Total files in the attachment folder');
render_row($attachment_total_files, 'Total files in the attached folder');
render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Information from the tagente_datos table').'</th></tr>';
render_row($tagente_datos_size, 'Total data in the tagente_datos table');
render_row(status_tagente_datos($tagente_datos_size), 'Status of the tagente_datos table');
render_row(execution_time(), 'Degradation of the execution time when executing a count');
render_row($tagente_datos_size, 'Total data in tagente_datos table');
render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status');
render_row(execution_time(), 'Execution time degradation when executing a count');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS server threads').'</th></tr>';
@ -779,6 +791,6 @@ render_info_data(
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
echo '<span>'.__(
'(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to
keep up-to-date database to get the best performance and results in Pandora'
'(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to
keep the database up-to-date to get the best performance and results in Pandora'
).'</span><br><br><br>';

View File

@ -58,6 +58,7 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` (
ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- -----------------------------------------------------
-- Table `tpolicy_modules`
@ -136,6 +137,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` (
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tpolicies`
@ -759,11 +761,41 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tnews`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tnews` (
`id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`author` varchar(255) NOT NULL DEFAULT '',
`subject` varchar(255) NOT NULL DEFAULT '',
`text` TEXT NOT NULL,
`timestamp` DATETIME NOT NULL DEFAULT 0,
`id_group` int(10) NOT NULL default 0,
`modal` tinyint(1) DEFAULT 0,
`expire` tinyint(1) DEFAULT 0,
`expire_timestamp` DATETIME NOT NULL DEFAULT 0,
PRIMARY KEY(`id_news`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE treport_content_template ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300';
ALTER TABLE treport_content_template ADD COLUMN `visual_format` tinyint(1) default '0';
ALTER TABLE treport_content_template ADD COLUMN `hide_no_data` tinyint(1) default '0';
ALTER TABLE `treport_content_template` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
-- -----------------------------------------------------
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@ -1150,6 +1182,9 @@ ALTER TABLE tagente_estado MODIFY `status_changes` tinyint(4) unsigned default 0
ALTER TABLE tagente_estado CHANGE `last_known_status` `known_status` tinyint(4) default 0;
ALTER TABLE tagente_estado ADD COLUMN `last_known_status` tinyint(4) default 0;
ALTER TABLE tagente_estado ADD COLUMN last_unknown_update bigint(20) NOT NULL default 0;
ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0';
ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0';
ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `talert_actions`
@ -1180,6 +1215,7 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria&#x20;IMS&#x20;API&#x20;path\",\"Integria&#x20;IMS&#x20;API&#x20;pass\",\"Integria&#x20;IMS&#x20;user\",\"Integria&#x20;IMS&#x20;user&#x20;pass\",\"Ticket&#x20;title\",\"Ticket&#x20;group&#x20;ID\",\"Ticket&#x20;priority\",\"Email&#x20;copy\",\"Ticket&#x20;owner\",\"Ticket&#x20;description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very&#x20;Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria&#x20;IMS&#x20;Ticket';
UPDATE `talert_commands` SET `description` = 'This&#x20;alert&#x20;send&#x20;an&#x20;email&#x20;using&#x20;internal&#x20;Pandora&#x20;FMS&#x20;Server&#x20;SMTP&#x20;capabilities&#x20;&#40;defined&#x20;in&#x20;each&#x20;server,&#x20;using:&#x0d;&#x0a;_field1_&#x20;as&#x20;destination&#x20;email&#x20;address,&#x20;and&#x0d;&#x0a;_field2_&#x20;as&#x20;subject&#x20;for&#x20;message.&#x20;&#x0d;&#x0a;_field3_&#x20;as&#x20;text&#x20;of&#x20;message.&#x20;&#x0d;&#x0a;_field4_&#x20;as&#x20;content&#x20;type&#x20;&#40;text/plain&#x20;or&#x20;html/text&#41;.', `fields_descriptions` = '[\"Destination&#x20;address\",\"Subject\",\"Text\",\"Content&#x20;Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1;
ALTER TABLE `talert_commands` ADD COLUMN `id_group` mediumint(8) unsigned NULL default 0;
ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text;
UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1;
@ -1199,13 +1235,14 @@ 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', 24);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 28);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
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', '731');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '735');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
-- ---------------------------------------------------------------------
-- Table `tconfig_os`
@ -1251,6 +1288,11 @@ alter table tusuario add autorefresh_white_list text not null default '';
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
ALTER TABLE `tusuario` DROP COLUMN `flash_chart`;
ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL default '0';
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_user` VARCHAR(60);
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_pass` VARCHAR(45);
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_enabled` TINYINT(1);
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
@ -1259,6 +1301,10 @@ ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0;
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0';
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tagente_datos`
@ -1278,6 +1324,7 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_max` int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tagente`
@ -1328,6 +1375,7 @@ ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_type` ENUM ('default
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_node_id` INT(10) NOT NULL default 0;
ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tagent_custom_fields`
@ -1354,6 +1402,7 @@ ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN `router_ip` TEXT NOT NULL DEFAULT "";
UPDATE `tnetflow_filter` SET aggregate="dstip" WHERE aggregate NOT IN ("dstip", "srcip", "dstport", "srcport");
-- ---------------------------------------------------------------------
-- Table `treport_custom_sql`
@ -1368,13 +1417,27 @@ UPDATE treport_custom_sql SET `sql` = 'select&#x20;t1.alias&#x20;as&#x20;agent_n
-- ----------------------------------------------------------------------
-- Table `treport_content`
-- ---------------------------------------------------------------------
ALTER TABLE treport_content ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300';
ALTER TABLE treport_content ADD COLUMN `visual_format` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `hide_no_data` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `recursion` tinyint(1) default NULL;
ALTER TABLE treport_content ADD COLUMN `show_extended_events` tinyint(1) default '0';
UPDATE `treport_content` SET type="netflow_summary" WHERE type="netflow_pie" OR type="netflow_statistics";
ALTER TABLE `treport_content` ADD COLUMN `total_time` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_in_unknown_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_of_not_initialized_module` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `time_of_downtime` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `total_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `checks_failed` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `checks_in_ok_status` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
@ -1406,12 +1469,17 @@ ALTER TABLE twidget_dashboard MODIFY options LONGTEXT NOT NULL default "";
ALTER TABLE trecon_task ADD `alias_as_name` int(2) unsigned default '0';
ALTER TABLE trecon_task ADD `snmp_enabled` int(2) unsigned default '0';
ALTER TABLE trecon_task ADD `vlan_enabled` int(2) unsigned default '0';
ALTER TABLE trecon_task ADD `wmi_enabled` tinyint(1) unsigned DEFAULT '0';
ALTER TABLE trecon_task ADD `auth_strings` text;
ALTER TABLE trecon_task ADD `autoconfiguration_enabled` tinyint(1) unsigned default '0';
ALTER TABLE trecon_task ADD `summary` text;
-- ---------------------------------------------------------------------
-- Table `twidget` AND Table `twidget_dashboard`
-- ---------------------------------------------------------------------
UPDATE twidget_dashboard SET id_widget = (SELECT id FROM twidget WHERE unique_name = 'graph_module_histogram') WHERE id_widget = (SELECT id FROM twidget WHERE unique_name = 'graph_availability');
DELETE FROM twidget WHERE unique_name = 'graph_availability';
UPDATE `twidget` SET `unique_name`='example' WHERE `class_name` LIKE 'WelcomeWidget';
-- ---------------------------------------------------------------------
-- Table `tbackup` (Extension table. Modify only if exists)
@ -1816,7 +1884,30 @@ CREATE TABLE IF NOT EXISTS `tlog_graph_models` (
INSERT INTO tlog_graph_models VALUES (1, 'Apache&#x20;log&#x20;model',
'^.*?&#92;s+.*&quot;.*?&#92;s&#40;&#92;/.*?&#41;&#92;?.*1.1&quot;&#92;s+&#40;.*?&#41;&#92;s+&#40;.*?&#41;&#92;s+',
'pagina,&#x20;html_err_code,&#x20;_tiempo_', 1);
INSERT INTO tlog_graph_models VALUES (2, 'Apache&#x20;accesses&#x20;per&#x20;client&#x20;and&#x20;status',
'&#40;.*?&#41;&#92;&#x20;-.*1.1&quot;&#92;&#x20;&#40;&#92;d+&#41;&#92;&#x20;&#92;d+',
'host,status', 1);
INSERT INTO tlog_graph_models VALUES (3, 'Apache&#x20;time&#x20;per&#x20;requester&#x20;and&#x20;html&#x20;code',
'&#40;.*?&#41;&#92;&#x20;-.*1.1&quot;&#92;&#x20;&#40;&#92;d+&#41;&#92;&#x20;&#40;&#92;d+&#41;',
'origin,respose,_time_', 1);
INSERT INTO tlog_graph_models VALUES (4, 'Count&#x20;output',
'.*',
'Coincidences', 0);
INSERT INTO tlog_graph_models VALUES (5, 'Events&#x20;replicated&#x20;to&#x20;metaconsole',
'.*&#x20;&#40;.*?&#41;&#x20;.*&#x20;&#40;&#92;d+&#41;&#x20;events&#x20;replicated&#x20;to&#x20;metaconsole',
'server,_events_', 0);
INSERT INTO tlog_graph_models VALUES (6, 'Pages&#x20;with&#x20;warnings',
'PHP&#x20;Warning:.*in&#x20;&#40;.*?&#41;&#x20;on',
'page', 0);
INSERT INTO tlog_graph_models VALUES (7, 'Users&#x20;login',
'Starting&#x20;Session&#x20;&#92;d+&#92;&#x20;of&#x20;user&#x20;&#40;.*&#41;',
'user', 0);
-- -----------------------------------------------------
-- Add column in table `treport`
-- -----------------------------------------------------
@ -1856,15 +1947,248 @@ ALTER TABLE `tevento` ADD COLUMN `data` double(22,5) default NULL;
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
-- ---------------------------------------------------------------------
-- Table `tevent_extended`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tevent_extended` (
`id` serial PRIMARY KEY,
`id_evento` bigint(20) unsigned NOT NULL,
`external_id` bigint(20) unsigned,
`utimestamp` bigint(20) NOT NULL default '0',
`description` text,
FOREIGN KEY `tevent_ext_fk`(`id_evento`) REFERENCES `tevento`(`id_evento`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `tgis_map_layer_groups`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tgis_map_layer_groups` (
`layer_id` INT NOT NULL,
`group_id` MEDIUMINT(4) UNSIGNED NOT NULL,
`agent_id` INT(10) UNSIGNED NOT NULL COMMENT 'Used to link the position to the group',
PRIMARY KEY (`layer_id`, `group_id`),
FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE,
FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE,
FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE
CREATE TABLE `tgis_map_layer_groups` (
`layer_id` int(11) NOT NULL,
`group_id` mediumint(4) unsigned NOT NULL,
`agent_id` int(10) unsigned NOT NULL COMMENT 'Used to link the position to the group',
PRIMARY KEY (`layer_id`,`group_id`),
KEY `group_id` (`group_id`),
KEY `agent_id` (`agent_id`),
CONSTRAINT `tgis_map_layer_groups_ibfk_1` FOREIGN KEY (`layer_id`) REFERENCES `tgis_map_layer` (`id_tmap_layer`) ON DELETE CASCADE,
CONSTRAINT `tgis_map_layer_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `tgrupo` (`id_grupo`) ON DELETE CASCADE,
CONSTRAINT `tgis_map_layer_groups_ibfk_3` FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `tnetwork_matrix`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
`id` int(10) unsigned NOT NULL auto_increment,
`source` varchar(60) default '',
`destination` varchar(60) default '',
`utimestamp` bigint(20) default 0,
`bytes` int(18) unsigned default 0,
`pkts` int(18) unsigned default 0,
PRIMARY KEY (`id`),
UNIQUE (`source`, `destination`, `utimestamp`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ;
-- ---------------------------------------------------------------------
-- Table `user_task`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tuser_task` (
`id` int(20) unsigned NOT NULL auto_increment,
`function_name` varchar(80) NOT NULL default '',
`parameters` text NOT NULL default '',
`name` varchar(60) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `user_task_scheduled`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` (
`id` int(20) unsigned NOT NULL auto_increment,
`id_usuario` varchar(60) NOT NULL default '0',
`id_user_task` int(20) unsigned NOT NULL default '0',
`args` TEXT NOT NULL,
`scheduled` enum('no','hourly','daily','weekly','monthly','yearly','custom') default 'no',
`last_run` int(20) unsigned default '0',
`custom_data` int(10) NULL default '0',
`flag_delete` tinyint(1) UNSIGNED NOT NULL default 0,
`id_grupo` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `tnotification_source`
-- -----------------------------------------------------
CREATE TABLE `tnotification_source` (
`id` serial,
`description` VARCHAR(255) DEFAULT NULL,
`icon` text,
`max_postpone_time` int(11) DEFAULT NULL,
`enabled` int(1) DEFAULT NULL,
`user_editable` int(1) DEFAULT NULL,
`also_mail` int(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tnotification_source`
--
INSERT INTO `tnotification_source`(`description`, `icon`, `max_postpone_time`, `enabled`, `user_editable`, `also_mail`) VALUES
("System&#x20;status", "icono_info_mr.png", 86400, 1, 1, 0),
("Message", "icono_info_mr.png", 86400, 1, 1, 0),
("Pending&#x20;task", "icono_info_mr.png", 86400, 1, 1, 0),
("Advertisement", "icono_info_mr.png", 86400, 1, 1, 0),
("Official&#x20;communication", "icono_logo_pandora.png", 86400, 1, 1, 0),
("Sugerence", "icono_info_mr.png", 86400, 1, 1, 0);
-- -----------------------------------------------------
-- Table `tmensajes`
-- -----------------------------------------------------
ALTER TABLE `tmensajes` ADD COLUMN `url` TEXT;
ALTER TABLE `tmensajes` ADD COLUMN `response_mode` VARCHAR(200) DEFAULT NULL;
ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0';
ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL;
ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT '';
ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- ----------------------------------------------------------------------
-- Table `tnotification_user`
-- ----------------------------------------------------------------------
CREATE TABLE `tnotification_user` (
`id_mensaje` INT(10) UNSIGNED NOT NULL,
`id_user` VARCHAR(60) NOT NULL,
`utimestamp_read` BIGINT(20),
`utimestamp_erased` BIGINT(20),
`postpone` INT,
PRIMARY KEY (`id_mensaje`,`id_user`),
FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tnotification_group`
-- ----------------------------------------------------------------------
CREATE TABLE `tnotification_group` (
`id_mensaje` INT(10) UNSIGNED NOT NULL,
`id_group` mediumint(4) UNSIGNED NOT NULL,
PRIMARY KEY (`id_mensaje`,`id_group`),
FOREIGN KEY (`id_mensaje`) REFERENCES `tmensajes`(`id_mensaje`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tnotification_source_user`
-- ----------------------------------------------------------------------
CREATE TABLE `tnotification_source_user` (
`id_source` BIGINT(20) UNSIGNED NOT NULL,
`id_user` VARCHAR(60),
`enabled` INT(1) DEFAULT NULL,
`also_mail` INT(1) DEFAULT NULL,
PRIMARY KEY (`id_source`,`id_user`),
FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tnotification_source_group`
-- ----------------------------------------------------------------------
CREATE TABLE `tnotification_source_group` (
`id_source` BIGINT(20) UNSIGNED NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL,
PRIMARY KEY (`id_source`,`id_group`),
INDEX (`id_group`),
FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tnotification_source_user`
-- ----------------------------------------------------------------------
CREATE TABLE `tnotification_source_group_user` (
`id_source` BIGINT(20) UNSIGNED NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL,
`id_user` VARCHAR(60),
`enabled` INT(1) DEFAULT NULL,
`also_mail` INT(1) DEFAULT NULL,
PRIMARY KEY (`id_source`,`id_user`),
FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`)
ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_group`) REFERENCES `tnotification_source_group`(`id_group`)
ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Add alert command 'Generate notification'
-- ----------------------------------------------------------------------
INSERT INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES ('Generate&#x20;Notification','Internal&#x20;type','This&#x20;command&#x20;allows&#x20;you&#x20;to&#x20;send&#x20;an&#x20;internal&#x20;notification&#x20;to&#x20;any&#x20;user&#x20;or&#x20;group.',1,'[\"Destination&#x20;user\",\"Destination&#x20;group\",\"Title\",\"Message\",\"Link\",\"Criticity\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');
-- ----------------------------------------------------------------------
-- Update message references and pre-configure notifications
-- ----------------------------------------------------------------------
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="System&#x20;status"), "admin", 1, 0);
INSERT INTO `tnotification_source_group` SELECT `id`,0 FROM `tnotification_source` WHERE `description`="Message";
INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`, `id_usuario_destino` FROM `tmensajes` WHERE `id_usuario_destino` != '';
INSERT INTO `tnotification_source_user` (`id_source`, `id_user`, `enabled`, `also_mail`) VALUES ((SELECT `id` FROM `tnotification_source` WHERE `description`="Official&#x20;communication"), "admin", 1, 0);
UPDATE `tnotification_source` SET `enabled`=1 WHERE `description` = 'System&#x20;status' OR `description` = 'Official&#x20;communication';
-- ----------------------------------------------------------------------
-- Add custom internal recon scripts
-- ----------------------------------------------------------------------
INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Application.VMware', 'Discovery&#x20;Application&#x20;script&#x20;to&#x20;monitor&#x20;VMware&#x20;technologies&#x20;&#40;ESXi,&#x20;VCenter,&#x20;VSphere&#41;', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Cloud', 'Discovery&#x20;Cloud&#x20;script&#x20;to&#x20;monitor&#x20;Cloud&#x20;technologies&#x20;&#40;AWS.EC2,&#x20;AWS.S3,&#x20;AWS.RDS,&#x20RDS,&#x20AWS.EKS&#41;', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
-- ----------------------------------------------------------------------
-- Add column in table `tagent_custom_fields`
-- ----------------------------------------------------------------------
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
-- ----------------------------------------------------------------------
-- Add column in table `tnetflow_filter`
-- ----------------------------------------------------------------------
ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
-- ----------------------------------------------------------------------
-- Update table `tuser_task`
-- ----------------------------------------------------------------------
UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
-- ----------------------------------------------------------------------
-- ADD message in table 'tnews'
-- ----------------------------------------------------------------------
INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES (NULL,'admin','Welcome&#x20;to&#x20;Pandora&#x20;FMS&#x20;Console', '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;',NOW());
-- ----------------------------------------------------------------------
-- Alter table `talert_templates`
-- ----------------------------------------------------------------------
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
-- ---------------------------------------------------------------------
-- Table `tvisual_console_items_cache`
-- ---------------------------------------------------------------------
CREATE TABLE `tvisual_console_elements_cache` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`vc_id` INTEGER UNSIGNED NOT NULL,
`vc_item_id` INTEGER UNSIGNED NOT NULL,
`user_id` VARCHAR(60) DEFAULT NULL,
`data` TEXT NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expiration` INTEGER UNSIGNED NOT NULL COMMENT 'Seconds to expire',
PRIMARY KEY(`id`),
FOREIGN KEY(`vc_id`) REFERENCES `tlayout`(`id`)
ON DELETE CASCADE,
FOREIGN KEY(`vc_item_id`) REFERENCES `tlayout_data`(`id`)
ON DELETE CASCADE,
FOREIGN KEY (`user_id`) REFERENCES `tusuario`(`id_user`)
ON DELETE CASCADE
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8;

View File

@ -22,7 +22,7 @@ ui_require_css_file('firts_task');
<?php echo html_print_image('images/icono_grande_reconserver.png', true, ['title' => __('Collections')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Collections'); ?> <p id="description_task">
<h3> <?php echo __('Create Collections'); ?></h3><p id="description_task">
<?php
echo __(
"A file collection is a group of files (e.g. scripts or executables) which are

View File

@ -24,7 +24,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Custom Fields')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Custom Fields'); ?> <p id="description_task">
<h3> <?php echo __('Create Custom Fields'); ?></h3><p id="description_task">
<?php
echo __(
"Custom fields are an easy way to personalized agent's information.

View File

@ -24,7 +24,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
<?php echo html_print_image('images/firts_task/icono_grande_custom_reporting.png', true, ['title' => __('Custom Graphs')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Custom Graph'); ?> <p id="description_task">
<h3> <?php echo __('Create Custom Graph'); ?></h3><p id="description_task">
<?php
echo __(
"Graphs are designed to show the data collected by %s in a temporary scale defined by the user.

View File

@ -22,7 +22,7 @@ ui_require_css_file('firts_task');
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Fields Manager')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Fields Manager'); ?> <p id="description_task">
<h3> <?php echo __('Create Fields Manager'); ?></h3><p id="description_task">
<?php
echo __(
"Custom fields are an easy way to personalized agent's information.

View File

@ -28,7 +28,7 @@ if ($incident_w || $incident_m) {
<?php echo html_print_image('images/firts_task/icono_grande_incidencia.png', true, ['title' => __('Incidents')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Incidents'); ?> <p id="description_task">
<h3> <?php echo __('Create Incidents'); ?></h3><p id="description_task">
<?php
echo __(
"Besides receiving and processing data to monitor systems or applications,

View File

@ -31,7 +31,7 @@ if ($vconsoles_write || $vconsoles_manage) {
<?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Visual Console')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Visual Console'); ?> <p id="description_task">
<h3> <?php echo __('Create Visual Console'); ?></h3><p id="description_task">
<?php
echo __(
'%s allows users to create visual maps on which each user is able to create his or her '.'own monitoring map. The new visual console editor is much more practical, although the prior '."visual console editor had its advantages. On the new visual console, we've been successful in "."imitating the sensation and touch of a drawing application like GIMP. We've also simplified the "."editor by dividing it into several subject-divided tabs named 'Data', 'Preview', 'Wizard', 'List of "."Elements' and 'Editor'. The items the %s Visual Map was designed to handle are "."'static images', 'percentage bars', 'module graphs' and 'simple values'.",

View File

@ -26,7 +26,7 @@ $networkmap_types = networkmap_get_types($strict_user);
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Network Map')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Network Map'); ?> <p id="description_task">
<h3> <?php echo __('Create Network Map'); ?></h3><p id="description_task">
<?php
echo __(
'There is also an open-source version of the network map.

View File

@ -22,7 +22,7 @@ ui_require_css_file('firts_task');
<?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Planned Downtime')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Planned Downtime'); ?> <p id="description_task">
<h3> <?php echo __('Create Planned Downtime'); ?></h3><p id="description_task">
<?php
echo __(
"%s contains a scheduled downtime management system.

View File

@ -15,17 +15,17 @@ global $config;
check_login();
ui_require_css_file('firts_task');
?>
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no recon task defined yet.') ]); ?>
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no discovery tasks defined yet.') ]); ?>
<div class="new_task">
<div class="image_task">
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Recon server')]); ?>
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Discovery server')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Recon Task'); ?> <p id="description_task">
<h3> <?php echo __('Create Discovery Task'); ?></h3><p id="description_task">
<?php
echo __(
'The Recon Task definition of Pandora FMS is used to find new elements in the network.
'Discovery Task are used to find new elements in the network.
If it detects any item, it will add that item to the monitoring, and if that item it is already being monitored, then it will
ignore it or will update its information.There are three types of detection: Based on <strong id="fuerte"> ICMP </strong>(pings),
<strong id="fuerte">SNMP</strong> (detecting the topology of networks and their interfaces), and other <strong id="fuerte"> customized </strong>
@ -33,8 +33,8 @@ ui_require_css_file('firts_task');
);
?>
</p>
<form action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Recon Task'); ?>" />
<form action="index.php?sec=gservers&sec2=godmode/servers/discovery" method="post">
<input type="submit" class="button_task" value="<?php echo __('Discover'); ?>" />
</form>
</div>
</div>

View File

@ -25,7 +25,7 @@ ui_require_css_file('firts_task');
<?php echo html_print_image('images/firts_task/icono_grande_servicios.png', true, ['title' => __('Services')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Services'); ?> <p id="description_task">
<h3> <?php echo __('Create Services'); ?></h3><p id="description_task">
<?php
echo __(
"A service is a way to group your IT resources based on their functionalities.

View File

@ -22,7 +22,7 @@ ui_require_css_file('firts_task');
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('SNMP Filter')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create SNMP Filter'); ?> <p id="description_task">
<h3> <?php echo __('Create SNMP Filter'); ?></h3><p id="description_task">
<?php
echo __(
"Some systems receive a high number of traps.

View File

@ -22,7 +22,7 @@ ui_require_css_file('firts_task');
<?php echo html_print_image('images/firts_task/icono_grande_gestiondetags.png', true, ['title' => __('Tags')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Tags'); ?> <p id="description_task">
<h3> <?php echo __('Create Tags'); ?></h3><p id="description_task">
<?php
echo __(
"Access to modules can be configured by a tagging system.

View File

@ -28,7 +28,7 @@ if ($networkmaps_write || $networkmaps_manage) {
<?php echo html_print_image('images/firts_task/icono_grande_topology.png', true, ['title' => __('Transactions')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Transactions'); ?> <p id="description_task">
<h3> <?php echo __('Create Transactions'); ?></h3><p id="description_task">
<?php
echo __(
'The new transactional server allows you to execute tasks dependent on the others following a user-defined design. This means that it is possible to coordinate several executions to check a target at a given time.

View File

@ -1,16 +1,19 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 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.
/**
* Pandora FMS - http://pandorafms.com
* ==================================================
* Copyright (c) 2005-2011 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 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.
*/
if (isset($_SERVER['REQUEST_TIME'])) {
$time = $_SERVER['REQUEST_TIME'];
} else {
@ -26,7 +29,7 @@ if (!$config['MR']) {
$config['MR'] = 0;
}
echo '<a class="white_bold footer" target="_blank" href="'.$config['homeurl'].$license_file.'">';
echo '<a class="footer" target="_blank" href="'.$config['homeurl'].$license_file.'">';
require_once $config['homedir'].'/include/functions_update_manager.php';
@ -40,9 +43,7 @@ if ($current_package == 0) {
echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR']));
echo '</a><br />';
echo '<a class="white footer">'.__('Page generated at').' '.date($config['date_format']);
echo '</a><br /><span style="color:#eff">&reg; '.get_copyright_notice().'</span>';
echo '</a> ';
if (isset($config['debug'])) {
$cache_info = [];

File diff suppressed because it is too large Load Diff

View File

@ -1,455 +0,0 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 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.
/**
* @package General
*/
global $config;
function display_register($data)
{
if ($data['instance_registered'] == 1) {
return false;
}
if ($data['force_register'] == 1) {
return true;
}
if ($data['force_register'] == 0) {
return false;
}
if ($data['identification_reminder'] == 0) {
return false;
}
if (!isset($data['identification_reminder_timestamp'])) {
return true;
}
if ($data['identification_reminder_timestamp'] < time()) {
return true;
}
return false;
}
function display_newsletter($data)
{
if ($data['newsletter_subscribed'] == 1) {
return false;
}
if ($data['force_newsletter'] == 1) {
return true;
}
if ($data['force_newsletter'] == 0) {
return false;
}
if ($data['newsletter_reminder'] === 0) {
return false;
}
if (!isset($data['newsletter_reminder_timestamp'])) {
return true;
}
if (!is_numeric($data['newsletter_reminder_timestamp'])) {
return true;
}
if ($data['newsletter_reminder_timestamp'] < time()) {
return true;
}
return false;
}
if (is_ajax()) {
include_once $config['homedir'].'/include/functions_update_manager.php';
$open_wizard = get_parameter('open_wizard', 0);
$not_return = get_parameter('not_return', 0);
$reset_initial_wizard = get_parameter('reset_initial_wizard', 0);
if ($reset_initial_wizard) {
config_update_value('initial_wizard', 0);
}
if ($open_wizard) {
$register_pandora = get_parameter('register_pandora', 0);
$newsletter = get_parameter('newsletter', 0);
$forced = get_parameter('forced', 0);
$future_8_days = (time() + 8 * SECONDS_1DAY);
$ui_feedback = [
'status' => true,
'message' => '',
];
if ($register_pandora) {
// Pandora register update
$um_message = update_manager_register_instance();
$ui_feedback['message'] .= $um_message['message'].'<br><br>';
if ($um_message['success']) {
config_update_value('instance_registered', 1);
$ui_feedback['status'] = true && $ui_feedback['status'];
} else {
$ui_feedback['status'] = false;
}
} else if (!$forced) {
config_update_value('identification_reminder_timestamp', $future_8_days);
}
if ($newsletter) {
// Pandora newsletter update
$email = get_parameter('email', '');
$um_message = update_manager_insert_newsletter($email);
$ui_feedback['message'] .= $um_message['message'];
if ($um_message['success']) {
db_process_sql_update('tusuario', ['middlename' => 1], ['id_user' => $config['id_user']]);
$ui_feedback['status'] = true && $ui_feedback['status'];
} else {
$ui_feedback['status'] = false;
}
} else if (!$forced) {
db_process_sql_update('tusuario', ['lastname' => $future_8_days], ['id_user' => $config['id_user']]);
}
// Form answer JSON
$ui_feedback['status'] = $ui_feedback['status'] ? 1 : 0;
echo io_json_mb_encode($ui_feedback);
}
if (!$not_return) {
return;
}
}
// Check if user is admin
if (!license_free()) {
return;
}
if (!users_is_admin($config['id_user'])) {
return;
}
// Get data to display properly the wizard
$wizard_data = [];
$wizard_data['newsletter_subscribed'] = db_get_value('middlename', 'tusuario', 'id_user', $config['id_user']);
// force_* = 1 -> force show
// force_* = 0 -> force hide
// force_* = -1 -> show or hide depends reminder and timestamp
$wizard_data['force_newsletter'] = get_parameter('force_newsletter', -1);
$wizard_data['newsletter_reminder'] = db_get_value('firstname', 'tusuario', 'id_user', $config['id_user']);
$wizard_data['newsletter_reminder_timestamp'] = db_get_value('lastname', 'tusuario', 'id_user', $config['id_user']);
$wizard_data['instance_registered'] = $config['instance_registered'];
$wizard_data['force_register'] = get_parameter('force_register', -1);
$wizard_data['identification_reminder'] = $config['identification_reminder'];
$wizard_data['identification_reminder_timestamp'] = $config['identification_reminder_timestamp'];
$display_newsletter = display_newsletter($wizard_data);
$display_register = display_register($wizard_data);
$display_forced = ($wizard_data['force_newsletter'] != -1) || ($wizard_data['force_register'] != -1);
// Return if it is fully completed
if ((!$display_register) && (!$display_newsletter)) {
return false;
}
$return_button = get_parameter('return_button', 0) == 1;
$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
// Avoid to show default email
if ($email == 'admin@example.com') {
$email = '';
}
// Prints accept register license
echo '<div id="login_accept_register" title="'.__('The %s community wizard', get_product_name()).'" style="">';
echo '<div style="margin: 5px 0 10px; float: left; padding-left: 15px;">';
echo html_print_image('images/pandora_circle_big.png', true);
echo '</div>';
echo '<div style="font-size: 12pt; margin: 5px 20px; float: left; padding-top: 23px;">';
echo __('Stay up to date with the %s community', get_product_name()).'.';
echo '</div>';
echo '<div id="license_newsletter">';
echo '<p>'.__('When you subscribe to the %s Update Manager service, you accept that we register your %s instance as an identifier on the database owned by Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the Update Manager options.', get_product_name(), get_product_name(), get_product_name()).'</p>';
echo '<p>'.__('In the same fashion, when subscribed to the newsletter you accept that your email will pass on to a database property of Artica TS. This data will solely be used to provide you with information about %s and will not be conceded to third parties. You can unregister from said database at any time from the newsletter subscription options.', get_product_name()).'</p>';
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; padding-top:10px; position:relative; border: 1px solid #FFF;">';
echo '<div style="float: right;">';
html_print_submit_button(__('Finish'), 'finish_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>';
$display_status_return = $return_button ? 'block' : 'none';
echo '<div style="float: right; width: 20%; display: '.$display_status_return.';">';
html_print_submit_button(__('Return'), 'return_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
echo '</div>';
echo '<div style="float: left; margin-left: 0px; width: 50%; text-align: left;">';
html_print_checkbox('register', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;" id="label-register">'.__('Join the %s community!', get_product_name()).'!</span><br>';
html_print_checkbox('newsletter', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;" id="label-newsletter">'.__('Subscribe to our newsletter').'</span>';
echo '<br>';
echo '<div id="email_container">';
echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">'.__('Email').': </span>';
html_print_input_text_extended('email-newsletter', $email, 'text-email-newsletter', '', 30, 255, false, '', ['style' => 'display:none; width: 200px;']);
echo '&nbsp;<span id="label-email-newsletter"style="font-size: 12px; display: none">'.__('Email').': </span>';
echo '&nbsp;<span id="required-email-newsletter">*'.__('Required').' </span>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
// Print yes or not dialog
echo '<div id="login_registration_yesno" title="'.__('%s instance identification wizard', get_product_name()).'" style="">';
echo '<div style="font-size: 12pt; margin: 20px;">';
echo __('Do you want to continue without any registration').'?';
echo '</div>';
echo '<div style="float: left; padding-left: 15px; padding-top: 20px;">';
html_print_submit_button(__('No'), 'no_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub cancel" style="width:100px;"');
echo '</div>';
echo '<div style="float: right; padding-right: 15px; padding-top: 20px;">';
html_print_submit_button(__('Yes'), 'yes_registration', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd" style="width:100px;"');
echo '</div>';
echo '</div>';
// Print feedback user dialog
echo '<div id="ui_messages_feedback" style="">';
echo '<div style="float: left; margin: 15px; margin-left: 5px;">';
echo html_print_image('images/success_circle_big.png', true);
echo '</div>';
echo '<div id="feedback_message" style="font-size: 13pt; margin: 15px 20px; padding-left:80px;"></div>';
echo '</div>';
?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
//Show newsletter and register checkboxes
var display_register = <?php echo json_encode($display_register); ?>;
var display_newsletter = <?php echo json_encode($display_newsletter); ?>;
var display_forced = <?php echo json_encode($display_forced); ?>;
var return_button = <?php echo json_encode($return_button); ?>;
////////////////////////////////////////////////////////////////////////
//HELPER FUNCTIONS
function submit_open_wizard (register, newsletter, email, forced) {
register = register;
newsletter = newsletter ? 1 : 0;
forced = forced ? 1 : 0;
var feedback_message = '';
var feedback_status = 1;
jQuery.post ("ajax.php",
{"page": "general/login_identification_wizard",
"open_wizard": 1,
"register_pandora": register,
"newsletter": newsletter,
"email": email,
"forced": forced},
function (data) {
var feedback_message = '';
var feedback_status = 1;
jQuery.each (data, function (i, val) {
if (i == 'message') feedback_message = val;
if (i == 'status') feedback_status = val;
});
if (feedback_status == 0) {
$("#ui_messages_feedback img").attr("src", "images/fail_circle_big.png");
} else {
$("#ui_messages_feedback img").attr("src", "images/success_circle_big.png");
}
$("#feedback_message").html(feedback_message);
},
"json"
);
}
////////////////////////////////////////////////////////////////////////
//EVENT FUNCTIONS
$("#submit-return_dialog_button").click (function () {
$("#login_accept_register" ).dialog('close');
$("#all-required").hide();
$("#login_id_dialog" ).dialog('open');
jQuery.post ("ajax.php",
{"page": "general/login_identification_wizard",
"reset_initial_wizard": 1},
function (data) {}
);
});
$("#submit-finish_dialog_button").click (function () {
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
var register = $("#checkbox-register").is(':checked');
var email = $("#text-email-newsletter").val();
if (email == '' && newsletter) {
$("#label-email-newsletter").show();
$("#text-email-newsletter").show();
$("#required-email-newsletter").show();
return;
}
if (!register && display_register && !display_forced) {
$("#login_registration_yesno").dialog('open');
} else {
var register_forced = register ? 1 : 0;
submit_open_wizard (register_forced, newsletter, email, display_forced);
$("#login_accept_register" ).dialog('close');
if (register || newsletter) {
$("#ui_messages_feedback").dialog('open');
}
}
});
$("#submit-no_registration").click (function () {
$("#login_registration_yesno").dialog('close');
});
$("#submit-yes_registration").click (function () {
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
var email = $("#text-email-newsletter").val();
submit_open_wizard (0, newsletter, email, display_forced);
$("#login_registration_yesno").dialog('close');
$("#login_accept_register" ).dialog('close');
});
$("#checkbox-newsletter").click (function () {
var newsletter = $("#checkbox-newsletter").is(':checked') ? 1 : 0;
if (!return_button && newsletter) {
$("#label-email-newsletter").show();
$("#text-email-newsletter").show();
}
if (!newsletter) {
$("#label-email-newsletter").hide();
$("#text-email-newsletter").hide();
$("#required-email-newsletter").hide();
}
});
////////////////////////////////////////////////////////////////////////
//DISPLAY
$(document).ready (function () {
$("#login_accept_register").dialog({
resizable: false,
draggable: true,
modal: true,
height: 320,
width: 750
});
$("#login_registration_yesno").dialog({
resizable: false,
draggable: true,
modal: true,
width: 320,
overlay: {
opacity: 1,
background: "black"
},
autoOpen: false
});
$("#ui_messages_feedback").dialog({
resizable: false,
draggable: true,
modal: true,
width: 300,
overlay: {
opacity: 1,
background: "black"
},
autoOpen: false
});
//Display return button if required
if (return_button) {
$("#submit-return_dialog_button").show ();
}
// Remove the completed parts
if (!display_register) {
$("#checkbox-register").attr ('style', 'display: none !important');
$("#label-register").hide ();
}
if (!display_newsletter) {
$("#checkbox-newsletter").attr ('style', 'display: none !important');
$("#label-newsletter").hide ();
}
});
/* ]]> */
</script>
<style type="text/css">
#required-email-newsletter{
font-size : 9px;
color: red;
margin-left: -2px;
margin-top: 3px;
position: absolute;
display: none;
}
#email_container{
margin-top: 3px;
width: 500px;
}
#license_newsletter {
height: 100px;
width: 100%;
overflow-y: scroll;
border: 1px solid #E4E4E4;
border-radius: 3px;
}
#license_newsletter p{
padding: 0 3px;
}
.ui-widget-overlay {
background: #000;
opacity: .6;
}
.ui-draggable {
cursor: inherit;
}
</style>

View File

@ -82,42 +82,30 @@ if (!empty($page) && !empty($sec)) {
}
$login_body_style = '';
// Overrides the default background with the defined by the user
// Overrides the default background with the defined by the user.
if (!empty($config['login_background'])) {
$background_url = 'images/backgrounds/'.$config['login_background'];
$login_body_style = "style=\"background-image: url('$background_url');\"";
$login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\"";
}
// Get the custom icons
// Get the custom icons.
$docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo();
echo '<div id="login_body" '.$login_body_style.'>';
echo '<div id="header_login">';
echo '<div id="icon_custom_pandora">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (isset($config['custom_logo'])) {
echo '<img src="enterprise/images/custom_logo/'.$config['custom_logo'].'" alt="monitoring_console">';
} else {
echo '<img src="images/custom_logo/pandora_logo_head_4.png" alt="monitoring_console">';
}
} else {
echo '<img src="images/custom_logo/pandora_logo_head_3.png" alt="monitoring_console">';
}
echo '</div>';
echo '<div id="list_icon_docs_support"><ul style="line-height: 36px;">';
echo '<div id="list_icon_docs_support"><ul>';
if ($docs_logo !== false) {
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
}
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($support_logo !== false) {
echo '<li id="li_margin_left"><a href="'.$config['custom_support_url'].'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
}
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
echo '<li><a href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
} else {
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
echo '<li>'.__('Support').'</li>';
@ -151,7 +139,8 @@ if (defined('METACONSOLE')) {
html_print_image('images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";
// I comment this in case in the future we put a logo without text.
// echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";.
}
echo '</a></div>';
@ -167,9 +156,6 @@ switch ($login_screen) {
if ($config['auth'] == 'saml') {
echo '<div id="log_nick" class="login_nick" style="display: none;">';
echo '<div>';
html_print_image('/images/usuario_login.png', false);
echo '</div>';
html_print_input_text_extended(
'nick',
'',
@ -184,9 +170,6 @@ switch ($login_screen) {
echo '</div>';
echo '<div id="log_pass" class="login_pass" style="display: none;">';
echo '<div>';
html_print_image('/images/candado_login.png', false);
echo '</div>';
html_print_input_text_extended(
'pass',
'',
@ -202,54 +185,48 @@ switch ($login_screen) {
);
echo '</div>';
echo '<div id="log_button" class="login_button" style="display: none; margin-bottom: 20px;">';
html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="sub next_login"');
echo '<div id="log_button" class="login_button" style="display: none;">';
html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="next_login"');
echo '</div>';
echo '<div class="login_button" id="remove_button" style="margin-bottom: 20px;">';
echo '<div class="login_button" id="remove_button">';
echo '<input type="button" id="input_saml" value="Login as admin" onclick="show_normal_menu()">';
echo '</div>';
echo '<div class="login_button">';
echo '<div class="login_button login_button_saml">';
html_print_submit_button(__('Login with SAML'), 'login_button_saml', false, '');
echo '</div>';
} else {
echo '<div class="login_nick">';
echo '<div>';
html_print_image('/images/usuario_login.png', false);
echo '</div>';
html_print_input_text_extended(
'nick',
'',
'nick',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('User').'"'
);
html_print_input_text_extended(
'nick',
'',
'nick',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('User').'"'
);
echo '</div>';
echo '<div class="login_pass">';
echo '<div>';
html_print_image('/images/candado_login.png', false);
echo '</div>';
html_print_input_text_extended(
'pass',
'',
'pass',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('Password').'"',
false,
true
);
html_print_input_text_extended(
'pass',
'',
'pass',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('Password').'"',
false,
true
);
echo '</div>';
echo '<div class="login_button">';
html_print_submit_button(__('Login'), 'login_button', false, 'class="sub next_login"');
html_print_submit_button(__('Login'), 'login_button', false, 'class="next_login"');
echo '</div>';
}
break;
@ -268,7 +245,7 @@ switch ($login_screen) {
html_print_input_text_extended('auth_code', '', 'auth_code', '', '', '', false, '', 'class="login login_password" placeholder="'.__('Authentication code').'"', false, true);
echo '</div>';
echo '<div class="login_button">';
html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, 'class="sub next_login"');
html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, 'class="next_login"');
echo '</div>';
break;
@ -289,9 +266,9 @@ switch ($login_screen) {
if ($config['enterprise_installed']) {
if ($config['reset_pass_option']) {
$reset_pass_link = 'reset_pass.php';
// Reset password link
echo '<div style="width:70%; height:40px; margin-right:auto; margin-left:auto; margin-top:20px; text-align:center;">';
echo '<a style="color: white !important;" href="index.php?reset=true&first=true">'.__('Forgot your password?');
// Reset password link.
echo '<div class="reset_password">';
echo '<a href="index.php?reset=true&first=true">'.__('Forgot your password?');
echo '</a>';
echo '</div>';
}
@ -328,12 +305,12 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
echo '<div class ="img_banner_login">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (isset($config['custom_splash_login'])) {
html_print_image('enterprise/images/custom_splash_login/'.$config['custom_splash_login'], false, [ 'alt' => 'splash', 'border' => 0, 'title' => $splash_title], false, true);
html_print_image('enterprise/images/custom_splash_login/'.$config['custom_splash_login'], false, [ 'alt' => 'splash', 'border' => 0], false, true);
} else {
html_print_image('enterprise/images/custom_splash_login/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0, 'title' => $splash_title], false, true);
html_print_image('enterprise/images/custom_splash_login/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0], false, true);
}
} else {
html_print_image('images/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0, 'title' => $splash_title], false, true);
html_print_image('images/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0], false, true);
}
echo '</div>';
@ -342,7 +319,7 @@ echo '</div>';
echo '<div id="ver_num">'.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'</div>';
echo '</div>';
if (!isset($process_error_message) && isset($mail)) {
if (empty($process_error_message) && isset($mail)) {
echo '<div id="reset_correct" title="'.__('Password reset').'">';
echo '<div class="content_alert">';
echo '<div class="icon_message_alert">';
@ -359,7 +336,7 @@ if (!isset($process_error_message) && isset($mail)) {
echo '</div>';
echo '</div>';
echo '</div>';
} else if (isset($process_error_message)) {
} else if (isset($process_error_message) && !empty($process_error_message)) {
echo '<div id="reset_correct" title="'.__('Password reset').'">';
echo '<div class="content_alert">';
echo '<div class="icon_message_alert">';
@ -544,7 +521,7 @@ ui_require_jquery_file('jquery-ui.min');
?>
<?php
// Hidden div to forced title
// Hidden div to forced title.
html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]);
// html_print_div(array('id' => 'modal_alert', 'hidden' => true));

View File

@ -1,273 +0,0 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 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.
/**
* @package General
*/
global $config;
if (is_ajax()) {
$save_identification = get_parameter('save_required_wizard', 0);
$change_language = get_parameter('change_language', 0);
$cancel_wizard = get_parameter('cancel_wizard', 0);
// Updates the values get on the identification wizard
if ($save_identification) {
$email = get_parameter('email', false);
$timezone = get_parameter('timezone', false);
$language = get_parameter('language', false);
if ($email !== false) {
config_update_value('language', $language);
}
if ($timezone !== false) {
config_update_value('timezone', $timezone);
}
if ($email !== false) {
db_process_sql_update(
'tusuario',
['email' => $email],
['id_user' => $config['id_user']]
);
}
// Update the alert action Mail to XXX/Administrator if it is set to default
$mail_check = 'yourmail@domain.es';
$mail_alert = alerts_get_alert_action_field1(1);
if ($mail_check === $mail_alert && $email !== false) {
alerts_update_alert_action(
1,
[
'field1' => $email,
'field1_recovery' => $email,
]
);
}
config_update_value('initial_wizard', 1);
}
// Change the language if is change in checkbox
if ($change_language !== 0) {
config_update_value('language', $change_language);
}
if ($cancel_wizard !== 0) {
config_update_value('initial_wizard', 1);
}
return;
}
$email = db_get_value('email', 'tusuario', 'id_user', $config['id_user']);
// Avoid to show default email
if ($email == 'admin@example.com') {
$email = '';
}
// Prints first step pandora registration
echo '<div id="login_id_dialog" title="'.__('%s instance identification wizard', get_product_name()).'" style="display: none;">';
echo '<div style="font-size: 10pt; margin: 20px;">';
echo __('Please fill the following information in order to configure your %s instance successfully', get_product_name()).'.';
echo '</div>';
echo '<div style="">';
$table = new StdClass();
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->size = [];
$table->size[0] = '40%';
$table->style[0] = 'font-weight:bold';
$table->size[1] = '60%';
$table->border = '5px solid';
$table->data[0][0] = __('Language code');
$table->data[0][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'language',
$config['language'],
'',
'',
'',
true
);
$zone_name = [
'Africa' => __('Africa'),
'America' => __('America'),
'Antarctica' => __('Antarctica'),
'Arctic' => __('Arctic'),
'Asia' => __('Asia'),
'Atlantic' => __('Atlantic'),
'Australia' => __('Australia'),
'Europe' => __('Europe'),
'Indian' => __('Indian'),
'Pacific' => __('Pacific'),
'UTC' => __('UTC'),
];
if ($zone_selected == '') {
if ($config['timezone'] != '') {
$zone_array = explode('/', $config['timezone']);
$zone_selected = $zone_array[0];
} else {
$zone_selected = 'Europe';
}
}
$timezones = timezone_identifiers_list();
foreach ($timezones as $timezone) {
if (strpos($timezone, $zone_selected) !== false) {
$timezone_country = preg_replace('/^.*\//', '', $timezone);
$timezone_n[$timezone] = $timezone_country;
}
}
$table->data[2][0] = __('Timezone setup').' '.ui_print_help_tip(
__('Must have the same time zone as the system or database to avoid mismatches of time.'),
true
);
$table->data[2][1] = html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone()', '', '', true);
$table->data[2][1] .= '&nbsp;&nbsp;'.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
$table->data[4][0] = __('E-mail for receiving alerts');
$table->data[4][1] = html_print_input_text('email', $email, '', 50, 255, true);
html_print_table($table);
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; bottom: 0px; right: 10px; border: 1px solid #FFF; width: 570px">';
echo '<div style="float: right; width: 20%;">';
html_print_submit_button(__('Register'), 'id_dialog_button', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>';
echo '<div style="float: right; width: 20%;">';
html_print_button(__('Cancel'), 'cancel', false, '', 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '</div>';
echo '<div id="all-required" style="float: right; margin-right: 30px; display: none; color: red;">';
echo __('All fields required');
echo '</div>';
echo '</div>';
echo '</div>';
?>
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
var default_language_displayed;
////////////////////////////////////////////////////////////////////////
//HELPER FUNCTIONS
function show_timezone () {
zone = $("#zone").val();
$.ajax({
type: "POST",
url: "ajax.php",
data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone,
dataType: "json",
success: function(data) {
$("#timezone").empty();
jQuery.each (data, function (id, value) {
timezone = value;
var timezone_country = timezone.replace (/^.*\//g, "");
$("select[name='timezone']").append($("<option>").val(timezone).html(timezone_country));
});
}
});
}
////////////////////////////////////////////////////////////////////////
//EVENT FUNCTIONS
$("#submit-id_dialog_button").click (function () {
//All fields required
if ($("#text-email").val() == '') {
$("#all-required").show();
} else {
var timezone = $("#timezone").val();
var language = $("#language").val();
var email_identification = $("#text-email").val();
jQuery.post ("ajax.php",
{"page": "general/login_required",
"save_required_wizard": 1,
"email": email_identification,
"language": language,
"timezone": timezone},
function (data) {}
);
$("#login_id_dialog").dialog('close');
first_time_identification ();
}
});
$("#language").click(function () {
var change_language = $("#language").val();
if (change_language === default_language_displayed) return;
jQuery.post ("ajax.php",
{"page": "general/login_required",
"change_language": change_language},
function (data) {}
).done(function () {
location.reload();
});
});
////////////////////////////////////////////////////////////////////////
//DISPLAY
$(document).ready (function () {
$("#login_id_dialog").dialog({
resizable: true,
draggable: true,
modal: true,
height: 280,
width: 630,
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
});
default_language_displayed = $("#language").val();
$(".ui-widget-overlay").css("background", "#000");
$(".ui-widget-overlay").css("opacity", 0.6);
$(".ui-draggable").css("cursor", "inherit");
$("#button-cancel").click (function () {
jQuery.post ("ajax.php",
{"page": "general/login_required",
"cancel_wizard": 1},
function (data) {}
);
$("#login_id_dialog" ).dialog('close');
});
});
/* ]]> */
</script>

View File

@ -1,26 +1,39 @@
<?php
/**
* Extension to self monitor Pandora FMS Console
*
* @category Main page
* @package Pandora FMS
* @subpackage Introduction
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 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 General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 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.
// Config functions.
require_once 'include/config.php';
// This solves problems in enterprise load
// This solves problems in enterprise load.
global $config;
check_login();
/*
Call all extensions login function */
// extensions_call_login_function ();
require_once 'include/functions_reporting.php';
require_once 'include/functions_tactical.php';
require_once $config['homedir'].'/include/functions_graph.php';
@ -29,8 +42,18 @@ if (tags_has_user_acl_tags()) {
ui_print_tags_warning();
}
$user_strict = (bool) db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
$all_data = tactical_status_modules_agents($config['id_user'], $user_strict, 'AR', $user_strict);
$user_strict = (bool) db_get_value(
'strict_acl',
'tusuario',
'id_user',
$config['id_user']
);
$all_data = tactical_status_modules_agents(
$config['id_user'],
$user_strict,
'AR',
$user_strict
);
$data = [];
$data['monitor_not_init'] = (int) $all_data['_monitors_not_init_'];
@ -79,8 +102,10 @@ if (!empty($all_data)) {
$data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1);
}
?>
<table border="0" width="100%">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="25%" style="padding-right: 20px;" valign="top">
@ -88,7 +113,7 @@ if (!empty($all_data)) {
<?php
//
// Overview Table
// Overview Table.
//
$table = new stdClass();
$table->class = 'databox';
@ -101,12 +126,12 @@ if (!empty($all_data)) {
$table->head[0] = '<span>'.__('%s Overview', get_product_name()).'</span>';
$table->head_colspan[0] = 4;
// Indicators
// Indicators.
$tdata = [];
$stats = reporting_get_stats_indicators($data, 120, 10, false);
$status = '<table class="status_tactical">';
foreach ($stats as $stat) {
$status .= '<tr><td><b>'.$stat['title'].'</b>'.'</td><td>'.$stat['graph'].'</td></tr>';
$status .= '<tr><td><b>'.$stat['title'].'</b></td><td>'.$stat['graph'].'</td></tr>';
}
$status .= '</table>';
@ -115,25 +140,25 @@ if (!empty($all_data)) {
$table->data[] = $tdata;
// Alerts
// Alerts.
$tdata = [];
$tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Modules by status
// Modules by status.
$tdata = [];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Total agents and modules
// Total agents and modules.
$tdata = [];
$tdata[0] = reporting_get_stats_agents_monitors($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Users
// Users.
if (users_is_admin()) {
$tdata = [];
$tdata[0] = reporting_get_stats_users($data);
@ -160,7 +185,7 @@ if (!empty($all_data)) {
if (!empty($news)) {
// NEWS BOARD/////////////////////////////
// NEWS BOARD.
echo '<div id="news_board">';
echo '<table cellpadding="0" width=100% cellspacing="0" class="databox filters">';
@ -172,32 +197,42 @@ if (!empty($all_data)) {
}
foreach ($news as $article) {
$text = io_safe_output($article['text']);
$image = false;
if ($article['text'] == '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;') {
$image = true;
}
$text_bbdd = io_safe_output($article['text']);
$text = html_entity_decode($text_bbdd);
echo '<tr><th class="green_title">'.$article['subject'].'</th></tr>';
echo '<tr><td>'.__('by').' <b>'.$article['author'].'</b> <i>'.ui_print_timestamp($article['timestamp'], true).'</i> '.$comparation_suffix.'</td></tr>';
echo '<tr><td class="datos">';
if ($image) {
echo '<center><img src="./images/welcome_image.png" alt="img colabora con nosotros - Support" width="191" height="207"></center>';
}
echo nl2br($text);
echo '</td></tr>';
}
echo '</table>';
echo '</div>';
// News board
// News board.
echo '<br><br>';
// END OF NEWS BOARD/////////////////////////////
// END OF NEWS BOARD.
}
// LAST ACTIVITY/////////////////////////////
// Show last activity from this user
// LAST ACTIVITY.
// Show last activity from this user.
echo '<div id="activity">';
$table = new stdClass();
$table->class = 'databox data';
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
// Don't specify px
// Don't specify px.
$table->data = [];
$table->size = [];
$table->size[0] = '5%';
@ -212,38 +247,14 @@ if (!empty($all_data)) {
$table->head[3] = __('Source IP');
$table->head[4] = __('Comments');
$table->title = '<span>'.__('This is your last activity performed on the %s console', get_product_name()).'</span>';
switch ($config['dbtype']) {
case 'mysql':
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
$config['id_user']
);
break;
$config['id_user']
);
case 'postgresql':
$sql = sprintf(
"SELECT \"id_usuario\", accion, \"ip_origen\", descripcion, utimestamp
FROM tsesion
WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_1WEEK.")
AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 10",
$config['id_user']
);
break;
case 'oracle':
$sql = sprintf(
"SELECT id_usuario, accion, ip_origen, descripcion, utimestamp
FROM tsesion
WHERE ((utimestamp > ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_1WEEK.")
AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC",
$config['id_user']
);
break;
}
$sessions = db_get_all_rows_sql($sql);
@ -253,24 +264,17 @@ if (!empty($all_data)) {
foreach ($sessions as $session) {
$data = [];
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
switch ($config['dbtype']) {
case 'mysql':
case 'oracle':
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
break;
case 'postgresql':
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
break;
}
$data[0] = '<strong>'.$session_id_usuario.'</strong>';
$data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
$data[2] = ui_print_help_tip(date($config['date_format'], $session['utimestamp']), true).human_time_comparation($session['utimestamp'], 'tiny');
$data[2] = ui_print_help_tip(
date($config['date_format'], $session['utimestamp']),
true
).human_time_comparation($session['utimestamp'], 'tiny');
$data[3] = $session_ip_origen;
$description = str_replace([',', ', '], ', ', $session['descripcion']);
if (strlen($description) > 100) {
@ -287,8 +291,7 @@ if (!empty($all_data)) {
unset($table);
echo '</div>';
echo '</div>';
// activity
// END OF LAST ACTIVIYY/////////////////////////////
// END OF LAST ACTIVIYY.
?>

View File

@ -16,16 +16,74 @@ if (! isset($config['id_user'])) {
exit();
}
?>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
var menuType_value = "<?php echo $config['menu_type']; ?>";
if (menuType_value == 'classic') {
$('ul.submenu').css('left', '214px');
}
else{
$('ul.submenu').css('left', '59px');
}
});
// Set the height of the menu.
$(window).on('load', function (){
$("#menu_full").height($("#container").height());
});
</script>
<?php
$autohidden_menu = 0;
if (isset($config['autohidden_menu']) && $config['autohidden_menu']) {
$autohidden_menu = 1;
}
$menu_container_id = '';
// Menu container prepared to autohide menu
echo '<div id="'.$menu_container_id.'">';
if ($config['menu_type'] == 'classic') {
echo '<div id="menu_full" class="menu_full_classic">';
} else {
echo '<div id="menu_full" class="menu_full_collapsed">';
}
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
if (!defined('PANDORA_ENTERPRISE')) {
$logo_title = get_product_name().' Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
} else {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) {
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
}
$logo_title = get_product_name().' Enterprise';
}
echo '<div class="logo_green"><a href="index.php?sec=main">';
if (isset($config['custom_logo'])) {
if ($config['menu_type'] == 'classic') {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:block']);
} else {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:none']);
}
}
if (isset($config['custom_logo_collapsed'])) {
if ($config['menu_type'] == 'classic') {
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:none']);
} else {
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:block']);
}
}
echo '</a></div>';
// echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
require 'operation/menu.php';
@ -45,16 +103,17 @@ if (check_acl($config['id_user'], 0, 'AW')
require 'godmode/menu.php';
if ($config['menu_type'] == 'classic') {
echo '<div id="button_collapse" class="button_classic button_collapse"></div>';
} else {
echo '<div id="button_collapse" class="button_collapsed button_collapse"></div>';
}
// require ("links_menu.php");
echo '</div>';
// menu_container
ui_require_jquery_file('cookie');
$config_fixed_menu = false;
if (isset($config['fixed_menu'])) {
$config_fixed_menu = $config['fixed_menu'];
}
$config_fixed_header = false;
if (isset($config['fixed_header'])) {
$config_fixed_header = $config['fixed_header'];
@ -64,25 +123,55 @@ if (isset($config['fixed_header'])) {
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
$('#button_collapse').on('click', function() {
if($('#menu_full').hasClass('menu_full_classic')){
localStorage.setItem("menuType", "collapsed");
$('ul.submenu').css('left', '59px');
var menuType_val = localStorage.getItem("menuType");
$.ajax({
type: "POST",
url: "ajax.php",
data: {
menuType: menuType_val,
page: "include/functions_menu"
},
dataType: "json"
});
}
else if($('#menu_full').hasClass('menu_full_collapsed')){
localStorage.setItem("menuType", "classic");
$('ul.submenu').css('left', '214px');
var menuType_val = localStorage.getItem("menuType");
$.ajax({
type: "POST",
url: "ajax.php",
data: {
menuType: menuType_val,
page: "include/functions_menu"
},
dataType: "json"
});
}
$('.logo_full').toggle();
$('.logo_icon').toggle();
$('#menu_full').toggleClass('menu_full_classic menu_full_collapsed');
$('#button_collapse').toggleClass('button_classic button_collapsed');
$('div#title_menu').toggleClass('title_menu_classic title_menu_collapsed');
$('div#page').toggleClass('page_classic page_collapsed');
$('#header_table').toggleClass('header_table_classic header_table_collapsed');
$('li.menu_icon').toggleClass("no_hidden_menu menu_icon_collapsed");
});
var autohidden_menu = <?php echo $autohidden_menu; ?>;
var fixed_menu = <?php echo json_encode((bool) $config_fixed_menu); ?>;
var fixed_header = <?php echo json_encode((bool) $config_fixed_header); ?>;
var id_user = "<?php echo $config['id_user']; ?>";
var cookie_name = id_user + '-pandora_menu_state';
var cookie_name_encoded = btoa(cookie_name);
var click_display = "<?php echo $config['click_display']; ?>";
var classic_menu = parseInt("<?php echo $config['classic_menu']; ?>");
if ((isNaN(classic_menu)) || (classic_menu == 0)) {
classic_menu = false;
}
else {
classic_menu = true;
}
if (classic_menu) {
autohidden_menu = 1;
}
var menuState = $.cookie(cookie_name_encoded);
if (!menuState) {
@ -109,236 +198,7 @@ function close_submenus () {
$('div.menu>ul>li.selected>ul').addClass('invisible');
}
$(document).ready( function() {
//Daniel maya 02/06/2016 Fixed menu position--INI
if (fixed_menu) {
$('div#menu')
.css('position', 'fixed')
.css('z-index', '9000')
.css('top','80px')
}else{
$('div#menu')
.css('z-index', '9000')
}
if (fixed_header) {
$('div#menu')
.css('position', 'fixed')
.css('z-index', '9000')
.css('top','80px')
$('#menu_tab_frame_view').css('margin-top','20px')
}
//Daniel maya 02/06/2016 Fixed menu position--END
/*
$("img.toggle").click (function (e) {
//In case the links gets activated, we don't want to follow link
e.preventDefault();
var menuItem = $(this).parent();
var submenu = menuItem.children("ul");
if (submenu.is(":visible")) {
submenu.slideUp();
if (typeof menuState[menuItem.attr('id')] != 'undefined')
delete menuState[menuItem.attr('id')];
}
else {
submenu.slideDown();
menuState[menuItem.attr('id')] = 1;
}
$.cookie(cookie_name_encoded, JSON.stringify(menuState), {expires: 7});
});
//Cerrar aqui los comentarios cuando esté el menu terminado
if (fixed_menu) {
$('div#menu')
.css('position', 'fixed')
.css('z-index', '9000')
.css('left', '0')
.css('top', $('div#head').innerHeight() + 'px')
.css('height', '100%')
.css('overflow', 'hidden')
.hover(function (e) {
if (!autohidden_menu) {
$(this).css('overflow', 'auto').children('div').css('width', 'auto');
}
}, function (e) {
if (!autohidden_menu) {
$(this).css('overflow', 'hidden').children('div').css('width', '100%');
}
})
.children('div')
.css('margin-bottom', $('div#head').innerHeight() + 'px');
if (!fixed_header) {
$(window).scroll(function () {
if ($(this).scrollTop() <= $('div#head').innerHeight()) {
$('div#menu').css('top', $('div#head').innerHeight() - $(this).scrollTop() + 'px' );
} else {
$('div#menu').css('top', '0');
}
});
}
}
function show_menu () {
$('#menu_container').animate({"left": "+=80px"}, 200, function () {
if (fixed_menu) {
$('#menu_container').parent().css('overflow', 'auto');
}
});
//show_menu_pretty();
}
function show_menu_pretty() {
open_submenus();
$('div.menu ul li').css('background-position', '');
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').show();
$('.titop').css('color', 'white');
$('.bg3').css('color', 'white');
$('.bg4').css('color', 'white');
}
function hide_menu () {
if (fixed_menu) {
$('#menu_container').parent().css('overflow', 'hidden');
}
$('#menu_container').animate({"left": "-=80px"}, 100);
//hide_menu_pretty();
}
function hide_menu_pretty() {
close_submenus();
$('div.menu li').css('background-position', '85px 5px');
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').hide();
$('.titop').css('color', $('.titop').css('background-color'));
$('.bg3').css('color', $('.bg3').css('background-color'));
$('.bg4').css('color', $('.bg4').css('background-color'));
}
*/
if (autohidden_menu) {
//handlerIn, handlerOut);
//openTime = 0;
//handsIn = 0;
//$('#main').css('margin-left', '50px');
//hide_menu_pretty();
/*
$('#menu').hover(function() {
handsIn = 1;
if (openTime == 0) {
show_menu();
openTime = new Date().getTime();
}
}).mouseleave(function() {
handsIn = 0;
setTimeout(function() {
openedTime = new Date().getTime() - openTime;
if(openedTime > 3000 && handsIn == 0) {
hide_menu();
openTime = 0;
}
}, 3500);
});
*/
handsInMenu = 0;
openTimeMenu = 0;
if (classic_menu) {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('#menu').css('width', '145px');
$('#menu').css('position', 'block');
$('div#menu').css('top', '80px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
$('#menu').mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '145px');
$('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}
}, 2500);
});
}
else {
if(!click_display){
$('#menu').mouseenter(function() {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('#menu').css('width', '145px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('li.menu_icon').find('li').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}).mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('li.menu_icon').find('li').removeClass( " no_hidden_menu" );
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
}
}, 2500);
});
}else{
$(document).ready(function() {
$('#menu').on("click", function() {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('#menu').css('width', '145px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('li.menu_icon').find('li').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}).mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('li.menu_icon').find('li').removeClass( " no_hidden_menu" );
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
}
}, 5500);
});
});
}
}
}
else {
$('div#title_menu').hide();
if(!click_display){
$('#menu').mouseenter(function() {
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('ul.submenu').css('left', '44px');
}).mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('li.menu_icon').removeClass( " no_hidden_menu");
$('li.menu_icon').find('li').removeClass( " no_hidden_menu" );
$('ul.submenu').css('left', '44px');
}
}, 2500);
});
}
}
});
/* ]]> */
</script>
@ -348,182 +208,199 @@ $(document).ready( function() {
handsIn = 0;
handsIn2 = 0;
if(!click_display){
$('.menu_icon').mouseenter(function() {
/**
* Positionate the submenu elements. Add a negative top.
*
* @param int index It is the position of li.menu_icon in the ul.
* @param string id_submenu It is the id of first level submenu.
* @param string id_submenu2 It is the id of second level submenu.
* @param int item_height It is the height of a menu item (28 o 35).
*
* @return (int) The position (in px).
*/
function menu_calculate_top(index, id_submenu, id_submenu2, item_height){
var level1 = index;
var level2 = $('#'+id_submenu+' ul.submenu > li').length;
var level3 = $('#'+id_submenu2+' > li.sub_subMenu').length;
var item_height = item_height;
level2--;
if (id_submenu2 !== false) {
// If level3 is set, the position is calculated like box is in the center.
// wiouth considering level2 box can be moved.
level3--;
total = (level1 + level3);
comp = level3;
} else {
total = (level1 + level2);
comp = level2;
}
// Positionate in the middle
if (total > 12 && ((total < 18) || ((level1 - comp) <= 4))) {
return - ( Math.floor(comp / 2) * item_height);
}
// Positionate in the bottom
if (total >= 18) {
return (- comp * item_height);
}
// return 0 by default
return 0;
}
/**
* Get the menu items to be positioned.
*
* @param string item It is the selector of the current element.
*
* @return Add the top position in a inline style.
*/
function get_menu_items(item){
var item_height = parseInt(item.css('min-height'));
var id_submenu = item.attr('id');
var id_submenu2 = false;
var index = item.index();
if(item.parent().hasClass('godmode')){
index = index+6; // This is because the menu has divided in two parts.
}
var top_submenu = menu_calculate_top(index, id_submenu, id_submenu2, item_height);
top_submenu = top_submenu+'px';
$('#'+id_submenu+' ul.submenu').css('top', top_submenu);
$('.has_submenu').mouseenter(function() {
id_submenu2 = item.attr('id');
id_submenu2 = $('#'+id_submenu2+' ul.submenu2').attr('id');
var top_submenu2 = menu_calculate_top(index, id_submenu, id_submenu2, item_height);
top_submenu2 = top_submenu2+'px';
$('#'+id_submenu2).css('top', top_submenu2);
});
}
/*
* Show and hide submenus
*/
if(!click_display){
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
get_menu_items(table_hover);
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 3000 && handsIn == 0) {
openTime = 4000;
$("ul#sub"+table_noHover[0].id).hide();
}
}, 2500);
});
}else{
$(document).ready(function() {
if (autohidden_menu) {
$('.menu_icon').on("click", function() {
if( typeof(table_hover) != 'undefined'){
$("ul#sub"+table_hover[0].id).hide();
}
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
get_menu_items(table_hover);
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 3000 && handsIn == 0) {
openTime = 4000;
$("ul#sub"+table_hover[0].id).hide();
if(opened > 5000 && handsIn == 0) {
openTime = 6000;
$("ul#sub"+table_noHover[0].id).hide();
}
}, 2500);
}, 5500);
});
} else {
$('.menu_icon').on("click", function() {
if( typeof(table_hover) != 'undefined'){
$("ul#sub"+table_hover[0].id).hide();
}
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
get_menu_items(table_hover);
});
}
});
}
$('.has_submenu').mouseenter(function() {
table_hover2 = $(this);
handsIn2 = 1;
openTime2 = new Date().getTime();
$("#sub"+table_hover2[0].id).show();
if( typeof(table_noHover2) != 'undefined')
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id )
$("ul#sub"+table_noHover2[0].id).hide();
}).mouseleave(function() {
table_noHover2 = table_hover2;
handsIn2 = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime2;
if(opened >= 3000 && handsIn2 == 0) {
openTime2 = 4000;
$("ul#sub"+table_hover2[0].id).hide();
}
}, 3500);
});
$(document).ready(function() {
if(!click_display){
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
});
}else{
$(document).ready(function() {
if (autohidden_menu) {
$('.menu_icon').on("click", function() {
if( typeof(table_hover) != 'undefined'){
$("ul#sub"+table_hover[0].id).hide();
}
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 5000 && handsIn == 0) {
openTime = 6000;
$("ul#sub"+table_hover[0].id).hide();
}
}, 5500);
});
} else {
$('.menu_icon').on("click", function() {
if( typeof(table_hover) != 'undefined'){
$("ul#sub"+table_hover[0].id).hide();
}
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
});
}
$('#main').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
});
}
- $('.has_submenu').mouseenter(function() {
table_hover2 = $(this);
handsIn2 = 1;
openTime2 = new Date().getTime();
$("#sub"+table_hover2[0].id).show();
if( typeof(table_noHover2) != 'undefined')
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id )
$("ul#sub"+table_noHover2[0].id).hide();
}).mouseleave(function() {
table_noHover2 = table_hover2;
handsIn2 = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime2;
if(opened >= 3000 && handsIn2 == 0) {
openTime2 = 4000;
$("ul#sub"+table_hover2[0].id).hide();
}
}, 3500);
});
$(document).ready(function() {
if (!classic_menu) {
//Daniel maya 02/06/2016 Display menu with click --INI
if(!click_display){
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
}else{
$('#main').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
}
//Daniel maya 02/06/2016 Display menu with click --END
}
else {
if(!click_display){
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '145px');
$('ul.submenu').css('left', '144px');
});
}else{
$('#main').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '145px');
$('ul.submenu').css('left', '144px');
});
}
}
$('div.menu>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
});
if (classic_menu) {
$('div.menu>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('ul.submenu').css('left', '144px');
});
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('ul.submenu').css('left', '144px');
});
}
else {
$('div.menu>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
}
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
});
});
</script>

View File

@ -0,0 +1,113 @@
<html>
<head>
<style>
#alert_messages_na{
-moz-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
z-index:2;
position:fixed;
width:700px;
background:white;
left:50%;
top:20%;
margin-left:-350px;
}
.modalheade{
text-align:center;
width:100%;
height:37px;
left:0px;
background-color:#82b92e;
}
.modalheadertex{
color:white;
position:relative;
font-family:Nunito;
font-size:13pt;
top:8px;
}
.modalconten{
color:black;
background:white;
}
.modalcontentim{
float:left;
margin-left:30px;
margin-top:30px;
margin-bottom:30px;
}
.modalcontenttex{
float:left;
text-align:justify;
color:black;
font-size: 9.5pt;
line-height:13pt;
margin-top:40px;
width:430px;
margin-left:30px;
}
.modalwikibutto{
cursor:pointer;
text-align:center;
margin-right:45px;
float:right;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin-bottom:30px;
border-radius: 3px;
width:170px;
height:30px;
border: 1px solid #82b92e;
margin-top:8%;
background-color:#82b92e;
}
.modalwikibuttontex{
color:#ffffff;
font-family:Nunito;
font-size:10pt;
position:relative;
top:6px;
}
#opacity{
background:black;opacity:0.1;left:0px;top:0px;width:100%;height:100%;
}
</style>
</head>
<body>
<div id="alert_messages_na">
<div class='modalheade'>
<span class='modalheadertex'>
<?php echo __('Database error'); ?>
</span>
</div>
<div class='modalconten'>
<img class='modalcontentim' src='<?php echo $config['homeurl']; ?>/images/mysqlerr.png'>
<div class='modalcontenttex'>
<?php
echo __('Failure to connect to Database server, please check the configuration file config.php or contact system administrator if you need assistance.');
?>
</div>
</div>
<a href='https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Configuration' target='_blank'>
<div class='modalwikibutto cerrar'>
<span class='modalwikibuttontex'> <?php echo __('Documentation'); ?></span>
</div>
</a>
</div>
<div id="opacity"></div>
</body>
</html>

View File

@ -4,29 +4,35 @@
<style>
#alert_messages_na{
-moz-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
z-index:2;
position:fixed;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width:650px;
height: 400px;
background:white;
background-image:url('images/imagen-no-acceso.jpg');
background-repeat:no-repeat;
justify-content: center;
display: flex;
flex-direction: column;
box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
}
.modalheade{
text-align:center;
width:100%;
height:37px;
left:0px;
background-color:#82b92e;
position:absolute;
top:0;
}
.modalheadertex{
color:white;
position:relative;
color:#000;
font-family:Nunito;
font-size:13pt;
top:8px;
line-height: 40px;
font-size: 23pt;
margin-bottom:30px;
}
.modalclose{
cursor:pointer;
@ -37,50 +43,59 @@
}
.modalconten{
color:black;
background:white;
}
.modalcontentim{
float:left;
margin-left:30px;
margin-top:30px;
margin-bottom:30px;
width:300px;
margin-left: 30px;
}
.modalcontenttex{
float:left;
text-align:justify;
text-align:left;
color:black;
font-size: 9.5pt;
font-size: 11pt;
line-height:13pt;
margin-top:30px;
width:430px;
margin-left:30px;
margin-bottom:30px;
}
.modalokbutto{
cursor:pointer;
text-align:center;
margin-right:45px;
float:right;
display: inline-block;
padding: 6px 45px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
margin-bottom:30px;
border-radius: 3px;width:90px;height:30px;background-color:white;border: 1px solid #82b92e;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalokbuttontex{
color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
color:#82b92e;
font-family:Nunito;
font-size:13pt;
}
.modalgobutto{
cursor:pointer;text-align:center;margin-right:15px;margin-bottom:30px;float:right;-moz-border-radius: 3px;
-webkit-border-radius: 3px;border-radius: 3px;width:240px;height:30px;background-color:white;border: 1px solid #82b92e;
cursor:pointer;
text-align:center;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalgobuttontex{
color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
color:#82b92e;
font-family:Nunito;
font-size:10pt;
}
#opacida{
position:absolute;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width:100%;height:100%;
#opacidad{
position:fixed;
background:black;
opacity:0.6;
z-index:-1;
left:0px;
top:0px;
width:100%;
height:100%;
}
/*
.textodialog{
margin-left: 0px;
color:#333;
@ -100,53 +115,50 @@ position:absolute;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width
}
.cargatextodialog p, .cargatextodialog b, .cargatextodialog a{
font-size:18pt;
font-size:18pt;
}
*/
</style>
</head>
<body>
<div id="alert_messages_na">
<div class='modalheade'>
<span class='modalheadertex'>
<?php echo __("You don't have access to this page"); ?>
</span>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/icono_cerrar.png'>
<div id="alert_messages_na">
<div class='modalheade'>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>
</div>
<div class='modalconten'>
<div class='modalheadertex'>
<?php echo __("You don't have access to this page"); ?>
</div>
<div class='modalcontenttex'>
<?php
echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance.');
echo '<br/> <br/>';
echo __('Please know that all attempts to access this page are recorded in security logs of %s System Database', get_product_name());
?>
</div>
<div class='modalokbutto cerrar'>
<span class='modalokbuttontex'>OK</span>
</div>
</div>
</div>
<div class='modalconten'>
<img class='modalcontentim' src='<?php echo $config['homeurl']; ?>images/access_denied.png'>
<div class='modalcontenttex'>
<?php
echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance.');
echo '<br/> <br/>';
echo __('Please know that all attempts to access this page are recorded in security logs of %s System Database', get_product_name());
?>
</div>
</div>
<div class='modalokbutto cerrar'>
<span class='modalokbuttontex'>OK</span>
</div>
</div>
<div id="opacida" style="position:fixed;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width:100%;height:100%;"></div>
<div id="opacidad"></div>
</body>
</html>
<script>
$(".cerrar").click(function(){
window.location=".";
});
$(".cerrar").click(function(){
window.location=".";
});
$('div#page').css('background-color','#d3d3d3');
</script>

View File

@ -0,0 +1,184 @@
<?php
/**
* Update Manager registration process client controller.
*
* @category Client controller
* @package Pandora FMS
* @subpackage Update manager
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 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 General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/include/functions_update_manager.php';
if (is_ajax()) {
// Parse responses, flow control.
$configuration_wizard = get_parameter('save_required_wizard', 0);
$change_language = get_parameter('change_language', 0);
$cancel_wizard = get_parameter('cancel_wizard', 0);
// Console registration.
$cancel_registration = get_parameter('cancel_registration', 0);
$register_console = get_parameter('register_console', 0);
// Newsletter.
$cancel_newsletter = get_parameter('cancel_newsletter', 0);
$register_newsletter = get_parameter('register_newsletter', 0);
// Load wizards.
$load_wizards = get_parameter('load_wizards', '');
$feedback = [];
// Load wizards.
if ($load_wizards != '') {
switch ($load_wizards) {
case 'initial':
return config_wiz_modal(false, false);
case 'registration':
return registration_wiz_modal(false, false);
case 'newsletter':
return newsletter_wiz_modal(false, false);
case 'all':
config_wiz_modal(false, false);
registration_wiz_modal(false, false);
newsletter_wiz_modal(false, false);
return;
default:
// Ignore.
break;
}
}
// Configuration wizard process.
if ($configuration_wizard) {
$feedback = config_wiz_process();
}
if ($change_language) {
// Change the language if is change in checkbox.
config_update_value('language', $change_language);
}
if ($cancel_wizard) {
config_update_value('initial_wizard', 1);
}
// Update Manager registration.
if ($cancel_registration) {
config_update_value('pandora_uid', 'OFFLINE');
}
if ($register_console) {
$feedback = registration_wiz_process();
}
// Newsletter.
if ($cancel_newsletter) {
db_process_sql_update(
'tusuario',
['middlename' => -1],
['id_user' => $config['id_user']]
);
// XXX: Also notify UpdateManager.
}
if ($register_newsletter) {
$feedback = newsletter_wiz_process();
}
if (is_array($feedback)) {
echo json_encode($feedback);
}
// Ajax calls finish here.
exit();
}
ui_require_css_file('register');
$initial = isset($config['initial_wizard']) !== true
|| $config['initial_wizard'] != '1';
$newsletter = db_get_value(
'middlename',
'tusuario',
'id_user',
$config['id_user']
);
$show_newsletter = $newsletter == '0' || $newsletter == '';
$registration = isset($config['pandora_uid']) !== true
|| $config['pandora_uid'] == '';
if ($initial && users_is_admin()) {
// Show all forms in order.
// 1- Ask for email, timezone, etc. Fullfill alerts and user mail.
config_wiz_modal(
false,
true,
(($registration === true) ? 'show_registration_wizard()' : null)
);
}
if ($registration && users_is_admin()) {
// Prepare registration wizard, not launch. leave control to flow.
registration_wiz_modal(
false,
// Launch only if not being launch from 'initial'.
!$initial,
(($show_newsletter === true) ? 'force_run_newsletter()' : null)
);
} else {
if ($show_newsletter) {
// Show newsletter wizard for current user.
newsletter_wiz_modal(
false,
// Launch only if not being call from 'registration'.
!$registration && !$initial
);
}
}
$newsletter = null;
?>
<script type="text/javascript">
$(document).ready (function () {
});
</script>

View File

@ -183,10 +183,10 @@ if (empty($result)) {
}
$table = new stdClass();
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
$table->size = [];
$table->data = [];
$table->head = [];
@ -246,7 +246,18 @@ foreach ($result as $row) {
}
}
foreach ($table->rowclass as $key => $value) {
if (strpos($value, 'limit_scroll') !== false) {
$table->colspan[$key] = [7];
} else {
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->cellclass[$key][6] = 'action_buttons';
}
}
}
html_print_table($table);
ui_pagination($count, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
enterprise_hook('enterpriseAuditFooter');

File diff suppressed because it is too large Load Diff

View File

@ -106,6 +106,7 @@ if (isset($_POST['template_id'])) {
'min_ff_event_normal' => $row2['min_ff_event_normal'],
'min_ff_event_warning' => $row2['min_ff_event_warning'],
'min_ff_event_critical' => $row2['min_ff_event_critical'],
'ff_type' => $row2['ff_type'],
];
$name = $row2['name'];
@ -224,7 +225,7 @@ if ($result === false) {
$table->width = '100%';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->class = 'databox data';
$table->class = 'info_table';
$table->head = [];
$table->data = [];
$table->align = [];
@ -252,9 +253,9 @@ foreach ($result as $row) {
$data[2] = mb_substr($row['descripcion'], 0, 60);
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>&nbsp;&nbsp;';
$data[3] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).'</a>';
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).'</a>';
array_push($table->data, $data);
}

View File

@ -1062,7 +1062,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1078,7 +1078,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1094,7 +1094,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1110,7 +1110,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1126,7 +1126,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -1151,7 +1151,7 @@ $(document).ready (function () {
|| ($("#module option").length == 1
&& $("#module option").eq(0).val() == 0)) {
alert('<?php echo __('Modules list is empty'); ?>');
alert("<?php echo __('Modules list is empty'); ?>");
return false;
}
$('#module option').map(function() {

View File

@ -321,6 +321,8 @@ if ($create_modules) {
$module_type = 2;
} else if (preg_match('/ifAdminStatus/', $name_array[1])) {
$module_type = 2;
} else if (preg_match('/ifOperStatus/', $name_array[1])) {
$module_type = 18;
} else {
$module_type = 4;
}
@ -367,7 +369,24 @@ if ($create_modules) {
if ($row['server_type'] == 13) {
$module_type_name = db_get_value_filter('nombre', 'ttipo_modulo', ['id_tipo' => $values['id_tipo_modulo']]);
$new_module_configuration_data = "module_begin\nmodule_name ".io_safe_input($name)."\nmodule_description ".io_safe_output($values['descripcion'])."\nmodule_type ".$module_type_name."\nmodule_snmp\nmodule_oid ".$conf_oid."\nmodule_community ".$values['snmp_community']."\nmodule_end";
$new_module_configuration_data = "module_begin\nmodule_name ".io_safe_input($name)."\nmodule_description ".io_safe_output($values['descripcion'])."\nmodule_type ".$module_type_name."\nmodule_snmp\nmodule_version ".$snmp_version."\nmodule_oid ".$conf_oid."\nmodule_community ".$values['snmp_community'];
if ($snmp_version == '3') {
$new_module_configuration_data .= "\nmodule_secname ".$snmp3_auth_user;
$new_module_configuration_data .= "\nmodule_seclevel ".$snmp3_security_level;
if ($snmp3_security_level == 'authNoPriv' || $snmp3_security_level == 'authPriv') {
$new_module_configuration_data .= "\nmodule_authpass ".$snmp3_auth_pass;
$new_module_configuration_data .= "\nmodule_authproto ".$snmp3_auth_method;
}
if ($snmp3_security_level == 'authPriv') {
$new_module_configuration_data .= "\nmodule_privproto ".$snmp3_privacy_method;
$new_module_configuration_data .= "\nmodule_privpass ".$snmp3_privacy_pass;
}
}
$new_module_configuration_data .= "\nmodule_end";
config_agents_add_module_in_conf($id_agent, $new_module_configuration_data);
}

View File

@ -317,7 +317,6 @@ $table->data[0][0] = '<b>'.__('Target IP').'</b>';
$table->data[0][1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
$table->data[0][2] = '<b>'.__('Namespace').'</b>';
$table->data[0][2] .= ui_print_help_icon('wminamespace', true);
$table->data[0][3] = html_print_input_text('tcp_send', $tcp_send, '', 15, 60, true);
$table->data[1][0] = '<b>'.__('Username').'</b>';
@ -571,7 +570,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -587,7 +586,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -603,7 +602,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -619,7 +618,7 @@ $(document).ready (function () {
$("select[name='module[]']").append($("<option></option>").val(id).html(name));
}
else {
alert('<?php echo __('Repeated'); ?>');
alert("<?php echo __('Repeated'); ?>");
}
$("#module").find("option[value='0']").remove();
}
@ -641,7 +640,7 @@ $(document).ready (function () {
$("#submit-create_modules_btn").click(function () {
if($("#module option").length == 0 || ($("#module option").length == 1 && $("#module option").eq(0).val() == 0)) {
alert('<?php echo __('Modules list is empty'); ?>');
alert("<?php echo __('Modules list is empty'); ?>");
return false;
}
$('#module option').map(function() {

File diff suppressed because it is too large Load Diff

View File

@ -25,13 +25,16 @@ $id_field = (int) get_parameter('id_field', 0);
$name = (string) get_parameter('name', '');
$display_on_front = (bool) get_parameter('display_on_front', 0);
$is_password_type = (bool) get_parameter('is_password_type', 0);
// Header
$is_combo_enable = (bool) get_parameter('is_combo_enable', 0);
$combo_values = (string) get_parameter('combo_values', '');
// Header.
if ($id_field) {
$field = db_get_row_filter('tagent_custom_fields', ['id_field' => $id_field]);
$name = $field['name'];
$display_on_front = $field['display_on_front'];
$is_password_type = $field['is_password_type'];
$combo_values = $field['combo_values'];
$is_combo_enable = $config['is_combo_enable'];
ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, '');
} else {
ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, '');
@ -40,17 +43,87 @@ if ($id_field) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->id = 'configure_field';
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold';
$table->style[6] = 'font-weight: bold';
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
echo '</div>';
echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot unset the enable combo until you clear the combo values and click on update.').'</p>';
echo '</div>';
echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
echo '</div>';
echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
$table->data[0][1] = html_print_input_text(
'name',
$name,
'',
35,
100,
true
);
$table->data[0][2] = __('Pass type').ui_print_help_tip(__('The fields with pass type enabled will be displayed like html input type pass in html'), true);
$table->data[0][3] = html_print_checkbox('is_password_type', 1, $is_password_type, true);
$table->data[1][0] = __('Pass type').ui_print_help_tip(
__('The fields with pass type enabled will be displayed like html input type pass in html'),
true
);
$table->data[1][1] = html_print_checkbox_switch(
'is_password_type',
1,
$is_password_type,
true
);
$table->data[0][4] = __('Display on front').ui_print_help_tip(__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->data[0][5] = html_print_checkbox('display_on_front', 1, $display_on_front, true);
$table->data[2][0] = __('Display on front').ui_print_help_tip(
__('The fields with display on front enabled will be displayed into the agent details'),
true
);
$table->data[2][1] = html_print_checkbox_switch(
'display_on_front',
1,
$display_on_front,
true
);
$table->data[3][0] = __('Enabled combo');
$table->data[3][1] = html_print_checkbox_switch_extended(
'is_combo_enable',
0,
$config['is_combo_enable'],
false,
'',
'',
true
);
$table->rowstyle[4] = 'display: none;';
$table->data[4][0] = __('Combo values').ui_print_help_tip(
__('Set values separated by comma'),
true
);
$table->data[4][1] = html_print_input_text(
'combo_values',
io_safe_output($combo_values),
'',
35,
200,
true
);
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
html_print_table($table);
@ -67,3 +140,67 @@ if ($id_field) {
echo '</div>';
echo '</form>';
?>
<script>
$(document).ready (function () {
if($('input[type=hidden][name=update_field]').val() == 1 && $('input[type=text][name=combo_values]').val() != ''){
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
$('input[type=checkbox][name=is_password_type]').change(function (e) {
dialog_message("#message_set_password");
$('input[type=checkbox][name=is_password_type]').prop('checked', false);
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
e.preventDefault();
});
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
if($('input[type=text][name=combo_values]').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
dialog_message("#message_set_combo");
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
e.preventDefault();
}
});
}
$('input[type=checkbox][name=is_combo_enable]').change(function () {
if( $(this).is(":checked") ){
$('#configure_field-4').show();
dialog_message("#message_no_set_password");
$('#configure_field-1').hide();
}
else{
$('#configure_field-4').hide();
$('#configure_field-1').show();
}
});
$('input[type=checkbox][name=is_password_type]').change(function () {
if( $(this).is(":checked")){
dialog_message("#message_no_set_combo");
$('#configure_field-3').hide();
}
else{
$('#configure_field-3').show();
}
});
});
function dialog_message(message_id) {
$(message_id)
.css("display", "inline")
.dialog({
modal: true,
show: "blind",
hide: "blind",
width: "400px",
buttons: {
Close: function() {
$(this).dialog("close");
}
}
});
}
</script>

View File

@ -26,7 +26,7 @@ if (!check_acl($config['id_user'], 0, 'PM')) {
return;
}
// Header
// Header.
ui_print_page_header(__('Agents custom fields manager'), 'images/custom_field.png', false, '', true, '');
$create_field = (bool) get_parameter('create_field');
@ -36,10 +36,12 @@ $id_field = (int) get_parameter('id_field', 0);
$name = (string) get_parameter('name', '');
$display_on_front = (int) get_parameter('display_on_front', 0);
$is_password_type = (int) get_parameter('is_password_type', 0);
$combo_values = (string) get_parameter('combo_values', '');
$combo_value_selected = (string) get_parameter('combo_value_selected', '');
// Create field
// Create field.
if ($create_field) {
// Check if name field is empty
// Check if name field is empty.
if ($name == '') {
ui_print_error_message(__('The name must not be empty'));
} else if ($name == db_get_value('name', 'tagent_custom_fields', 'name', $name)) {
@ -51,20 +53,22 @@ if ($create_field) {
'name' => $name,
'display_on_front' => $display_on_front,
'is_password_type' => $is_password_type,
'combo_values' => $combo_values,
]
);
ui_print_success_message(__('Field successfully created'));
}
}
// Update field
// Update field.
if ($update_field) {
// Check if name field is empty
// Check if name field is empty.
if ($name != '') {
$values = [
'name' => $name,
'display_on_front' => $display_on_front,
'is_password_type' => $is_password_type,
'combo_values' => $combo_values,
];
$result = db_process_sql_update('tagent_custom_fields', $values, ['id_field' => $id_field]);
@ -79,7 +83,7 @@ if ($update_field) {
}
}
// Delete field
// Delete field.
if ($delete_field) {
$result = db_process_sql_delete(
'tagent_custom_fields',
@ -93,11 +97,22 @@ if ($delete_field) {
}
}
$fields = db_get_all_fields_in_table('tagent_custom_fields');
// Prepare pagination.
$offset = (int) get_parameter('offset');
$limit = $config['block_size'];
$count_fields = db_get_value('count(*)', 'tagent_custom_fields');
$fields = db_get_all_rows_filter(
'tagent_custom_fields',
[
'limit' => $limit,
'offset' => $offset,
]
);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
if ($fields) {
$table->head = [];
$table->head[0] = __('ID');
@ -131,14 +146,17 @@ foreach ($fields as $field) {
$data[2] = html_print_image('images/icono_stop.png', true, ['style' => 'width:21px;height:21px;']);
}
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0']).'</a>';
$data[3] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).'</a>';
array_push($table->data, $data);
}
if ($fields) {
ui_pagination($count_fields, false, $offset);
html_print_table($table);
ui_pagination($count_fields, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
}
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configure_field">';

View File

@ -118,7 +118,7 @@ if ($enable_agent) {
enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 0];
enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]);
config_agents_update_config_token($enable_agent, 'standby', 0);
db_pandora_audit('Agent management', 'Enable '.$alias);
} else {
db_pandora_audit('Agent management', 'Fail to enable '.$alias);
@ -140,6 +140,7 @@ if ($disable_agent) {
enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 1];
enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]);
config_agents_update_config_token($disable_agent, 'standby', 1);
db_pandora_audit('Agent management', 'Disable '.$alias);
} else {
@ -224,13 +225,13 @@ switch ($config['dbtype']) {
break;
}
$selected = 'border: 1px solid black;';
$selectNameUp = '';
$selectNameDown = '';
$selectOsUp = '';
$selectOsDown = '';
$selectGroupUp = '';
$selectGroupDown = '';
$selected = true;
$selectNameUp = false;
$selectNameDown = false;
$selectOsUp = false;
$selectOsDown = false;
$selectGroupUp = false;
$selectGroupDown = false;
switch ($sortField) {
case 'remote':
switch ($sort) {
@ -441,18 +442,27 @@ if (($config['dbtype'] == 'oracle') && ($agents !== false)) {
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
if ($agents !== false) {
echo "<table cellpadding='4' id='agent_list' cellspacing='4' width='100%' class='databox data'>";
echo '<th>'.__('Agent name').' '.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
echo '</th>';
echo "<th title='".__('Remote agent configuration')."'>".__('R').' '.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectRemoteUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectRemoteDown]).'</a>';
echo '</th>';
echo '<th>'.__('OS').' '.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectOsUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectOsDown]).'</a>';
echo '</th>';
// Urls to sort the table.
$url_up_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled';
$url_down_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled';
$url_up_remote = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled';
$url_down_remote = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=down&disabled=$disabled';
$url_up_os = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled';
$url_down_os = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled';
$url_up_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled';
$url_down_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled';
echo "<table cellpadding='0' id='agent_list' cellspacing='0' width='100%' class='info_table'>";
echo '<thead><tr>';
echo '<th>'.__('Agent name').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectNameUp, $selectNameDown).'</th>';
echo "<th title='".__('Remote agent configuration')."'>".__('R').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown).'</th>';
echo '<th>'.__('OS').ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown).'</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.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectGroupUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectGroupDown]).'</a>';
echo '</th>';
echo '<th>'.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).'</th>';
echo '<th>'.__('Description').'</th>';
echo "<th style='text-align:left'>".__('Actions').'</th>';
echo '</tr></thead>';
$color = 1;
$rowPair = true;
@ -628,7 +638,7 @@ if ($agents !== false) {
$offsetArg = $offset;
}
echo "<td class='$tdcolor' align='left' style='width:7%' valign='middle'>";
echo "<td class='$tdcolor action_buttons' align='left' style='width:7%' valign='middle'>";
if ($agent['disabled']) {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
@ -654,7 +664,7 @@ if ($agents !== false) {
}
if ($check_aw) {
echo "&nbsp;&nbsp;<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
borrar_agente=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'";
if ($agent['id_os'] != 100) {
@ -670,7 +680,7 @@ if ($agents !== false) {
}
echo '</table>';
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset, 0, false, 'offset', true, 'pagination-bottom');
echo "<table width='100%'><tr><td align='right'>";
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]);

View File

@ -358,17 +358,17 @@ if ($multiple_delete) {
// TABLE LIST MODULES
// ==================
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente;
$selectNameUp = '';
$selectNameDown = '';
$selectServerUp = '';
$selectServerDown = '';
$selectTypeUp = '';
$selectTypeDown = '';
$selectIntervalUp = '';
$selectIntervalDown = '';
$selectNameUp = false;
$selectNameDown = false;
$selectServerUp = false;
$selectServerDown = false;
$selectTypeUp = false;
$selectTypeDown = false;
$selectIntervalUp = false;
$selectIntervalDown = false;
$sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none');
$selected = '';
$selected = true;
$order[] = [
'field' => 'tmodule_group.name',
@ -482,13 +482,13 @@ switch ($sortField) {
default:
$selectNameUp = $selected;
$selectNameDown = '';
$selectServerUp = '';
$selectServerDown = '';
$selectTypeUp = '';
$selectTypeDown = '';
$selectIntervalUp = '';
$selectIntervalDown = '';
$selectNameDown = false;
$selectServerUp = false;
$selectServerDown = false;
$selectTypeUp = false;
$selectTypeDown = false;
$selectIntervalUp = false;
$selectIntervalDown = false;
switch ($config['dbtype']) {
case 'mysql':
case 'postgresql':
@ -626,32 +626,39 @@ if ($paginate_module) {
ui_pagination($total_modules, $url);
}
$url_name = $url.'&sort_field=name&sort=';
$url_server = $url.'&sort_field=server&sort=';
$url_type = $url.'&sort_field=type&sort=';
$url_interval = $url.'&sort_field=interval&sort=';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
$table->head = [];
$table->head[0] = __('Name').' '.'<a href="'.$url.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="'.$url.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[0] = __('Name').ui_get_sorting_arrows($url_name.'up', $url_name.'down', $selectNameUp, $selectNameDown);
// The access to the policy is granted only with AW permission
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
$table->head[1] = "<span title='".__('Policy')."'>".__('P.').'</span>';
}
$table->head[2] = "<span title='".__('Server')."'>".__('S.').'</span>'.' '.'<a href="'.$url.'&sort_field=server&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectServerUp]).'</a>'.'<a href="'.$url.'&sort_field=server&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectServerDown]).'</a>';
$table->head[3] = __('Type').' '.'<a href="'.$url.'&sort_field=type&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectTypeUp]).'</a>'.'<a href="'.$url.'&sort_field=type&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectTypeDown]).'</a>';
$table->head[4] = __('Interval').' '.'<a href="'.$url.'&sort_field=interval&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectIntervalUp]).'</a>'.'<a href="'.$url.'&sort_field=interval&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectIntervalDown]).'</a>';
$table->head[2] = "<span title='".__('Server')."'>".__('S.').'</span>'.ui_get_sorting_arrows($url_server.'up', $url_server.'down', $selectServerUp, $selectServerDown);
$table->head[3] = __('Type').ui_get_sorting_arrows($url_type.'up', $url_type.'down', $selectTypeUp, $selectTypeDown);
$table->head[4] = __('Interval').ui_get_sorting_arrows($url_interval.'up', $url_interval.'down', $selectIntervalUp, $selectIntervalDown);
$table->head[5] = __('Description');
$table->head[6] = __('Status');
$table->head[7] = __('Warn');
$table->head[8] = __('Action');
$table->head[9] = '<span title="'.__('Delete').'">'.__('Del.').'</span>'.html_print_checkbox('all_delete', 0, false, true, false);
$table->head[9] = '<span title="'.__('Delete').'">'.__('Del.').'</span>';
$table->rowstyle = [];
$table->style = [];
$table->style[0] = 'font-weight: bold';
$table->size = [];
$table->size['checkbox'] = '20px';
$table->size[2] = '70px';
$table->align = [];
$table->align[2] = 'left';
@ -706,15 +713,19 @@ foreach ($modules as $module) {
$table->rowstyle[($i - 1)] = 'text-align: center';
$table->rowclass[($i - 1)] = 'datos3';
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->colspan[($i - 1)][0] = 10;
$table->colspan[($i - 1)][0] = 11;
} else {
$table->colspan[($i - 1)][0] = 9;
$table->colspan[($i - 1)][0] = 10;
}
$data = [];
}
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
$data['checkbox'] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true);
}
$data[0] = '';
if (isset($module['deep']) && ($module['deep'] != 0)) {
@ -858,7 +869,7 @@ foreach ($modules as $module) {
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && $module['id_tipo_modulo'] != 25) {
$data[8] .= '&nbsp;<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&duplicate_module='.$module['id_agente_modulo'].'"
$data[8] .= '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&duplicate_module='.$module['id_agente_modulo'].'"
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image(
'images/copy.png',
@ -870,7 +881,7 @@ foreach ($modules as $module) {
// Make a data normalization
if (isset($numericModules[$type])) {
if ($numericModules[$type] === true) {
$data[8] .= '&nbsp;<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&fix_module='.$module['id_agente_modulo'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&fix_module='.$module['id_agente_modulo'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image(
'images/chart_curve.png',
true,
@ -879,18 +890,19 @@ foreach ($modules as $module) {
$data[8] .= '</a>';
}
} else {
$data[8] .= '&nbsp;'.html_print_image(
$data[8] .= html_print_image(
'images/chart_curve.disabled.png',
true,
['title' => __('Normalize (Disabled)')]
);
$data[8] .= '&nbsp;&nbsp;';
}
// create network component action
if ((is_user_admin($config['id_user']))
&& ($module['id_modulo'] == MODULE_NETWORK)
) {
$data[8] .= '&nbsp;<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create_network_from_module=1&id_agente='.$id_agente.'&create_module_from='.$module['id_agente_modulo'].'"
$data[8] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create_network_from_module=1&id_agente='.$id_agente.'&create_module_from='.$module['id_agente_modulo'].'"
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image(
'images/network.png',
@ -899,11 +911,12 @@ foreach ($modules as $module) {
);
$data[8] .= '</a> ';
} else {
$data[8] .= '&nbsp;'.html_print_image(
$data[8] .= html_print_image(
'images/network.disabled.png',
true,
['title' => __('Create network component (Disabled)')]
);
$data[8] .= '&nbsp;&nbsp;';
}
}
@ -917,10 +930,17 @@ foreach ($modules as $module) {
['title' => __('Delete')]
);
$data[9] .= '</a> ';
$data[9] .= html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true);
}
$table->cellclass[] = [
8 => 'action_buttons',
9 => 'action_buttons',
];
array_push($table->data, $data);
$table->cellclass[] = [
8 => 'action_buttons',
9 => 'action_buttons',
];
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {

View File

@ -249,6 +249,7 @@ if ($id_agent_module) {
$ff_event_normal = $module['min_ff_event_normal'];
$ff_event_warning = $module['min_ff_event_warning'];
$ff_event_critical = $module['min_ff_event_critical'];
$ff_type = $module['ff_type'];
$each_ff = $module['each_ff'];
$ff_timeout = $module['ff_timeout'];
// Select tag info.
@ -393,6 +394,7 @@ if ($id_agent_module) {
$ff_event_normal = '';
$ff_event_warning = '';
$ff_event_critical = '';
$ff_type = 0;
$id_category = 0;
@ -589,7 +591,7 @@ ui_toggle(
);
ui_toggle(
html_print_table($table_macros, true),
__('Custom macros').ui_print_help_icon('module_macros', true)
__('Custom macros')
);
if ($moduletype != 13) {

View File

@ -81,7 +81,6 @@ function add_component_selection($id_network_component_type)
$data = [];
$data[0] = __('Using module component').' ';
$data[0] .= ui_print_help_icon('network_component', true);
$component_groups = network_components_get_groups($id_network_component_type);
$data[1] = '<span id="component_group" class="left">';
@ -159,6 +158,7 @@ if ($disabledBecauseInPolicy) {
}
$update_module_id = (int) get_parameter_get('update_module');
$edit_module = (bool) get_parameter_get('edit_module');
$table_simple = new stdClass();
$table_simple->id = 'simple';
$table_simple->width = '100%';
@ -270,7 +270,7 @@ if (!$in_policy) {
}
}
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon('module_type', true);
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
$table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
if (isset($id_agent_module)) {
@ -350,11 +350,40 @@ if (!$edit) {
$table_simple->data[2][1] .= html_print_input_hidden('type_names', base64_encode(io_json_mb_encode($type_names_hash)), true);
}
if ($edit_module) {
$id_module_type = (int) $id_module_type;
if (($id_module_type >= 1 && $id_module_type <= 5)
|| ($id_module_type >= 21 && $id_module_type <= 23)
|| ($id_module_type == 100)
) {
$help_header = 'local_module';
}
if ($id_module_type === 6 || $id_module_type === 7
) {
$help_header = 'icmp_module_tab';
}
if ($id_module_type >= 15 && $id_module_type <= 18) {
$help_header = 'snmp_module_tab';
}
if ($id_module_type >= 8 && $id_module_type <= 11) {
$help_header = 'tcp_module_tab';
}
if ($id_module_type >= 30 && $id_module_type <= 33) {
$help_header = 'webserver_module_tab';
}
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_header, true);
}
if ($disabledBecauseInPolicy) {
$table_simple->data[2][3] .= html_print_input_hidden('id_module_group', $id_module_group, true);
}
$table_simple->data[3][0] = __('Dynamic Threshold Interval').' '.ui_print_help_icon('dynamic_threshold', true);
$table_simple->data[3][0] = __('Dynamic Threshold Interval');
$table_simple->data[3][1] = html_print_extended_select_for_time('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px', false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
$table_simple->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image('images/cog.png', true, ['title' => __('Advanced options Dynamic Threshold')]).'</a>';
if ($in_policy) {
@ -394,7 +423,7 @@ $table_simple->data[3][2] .= html_print_input_text(
$table_simple->data[3][3] = '<span><em>'.__('Dynamic Threshold Two Tailed: ').'</em>';
$table_simple->data[3][3] .= html_print_checkbox('dynamic_two_tailed', 1, $dynamic_two_tailed, true, $disabledBecauseInPolicy);
$table_simple->data[4][0] = __('Warning status').' '.ui_print_help_icon('warning_status', true);
$table_simple->data[4][0] = __('Warning status');
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[4][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
$table_simple->data[4][1] .= html_print_input_text(
@ -431,7 +460,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
str_replace('"', '', $str_warning),
'',
10,
255,
1024,
true,
$disabledBecauseInPolicy,
false,
@ -447,7 +476,7 @@ if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[4][2] = '<svg id="svg_dinamic" width="500" height="300"> </svg>';
}
$table_simple->data[5][0] = __('Critical status').' '.ui_print_help_icon('critical_status', true);
$table_simple->data[5][0] = __('Critical status');
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[5][1] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
$table_simple->data[5][1] .= html_print_input_text(
@ -484,7 +513,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
str_replace('"', '', $str_critical),
'',
10,
255,
1024,
true,
$disabledBecauseInPolicy,
false,
@ -496,10 +525,27 @@ if (modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy);
// FF stands for Flip-flop
$table_simple->data[6][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true);
// FF stands for Flip-flop.
$table_simple->data[6][0] = __('FF threshold').' ';
$table_simple->data[6][1] = html_print_radio_button('each_ff', 0, '', $each_ff, true, $disabledBecauseInPolicy).' '.__('All state changing').' : ';
$table_simple->data[6][1] .= __('Keep counters');
$table_simple->data[6][1] .= html_print_checkbox(
'ff_type',
1,
$ff_type,
true,
$disabledBecauseInPolicy
).'<br />';
$table_simple->data[6][1] .= html_print_radio_button(
'each_ff',
0,
'',
$each_ff,
true,
$disabledBecauseInPolicy
);
$table_simple->data[6][1] .= ' '.__('All state changing').' : ';
$table_simple->data[6][1] .= html_print_input_text(
'ff_event',
$ff_event,
@ -512,7 +558,16 @@ $table_simple->data[6][1] .= html_print_input_text(
'',
$classdisabledBecauseInPolicy
).'<br />';
$table_simple->data[6][1] .= html_print_radio_button('each_ff', 1, '', $each_ff, true, $disabledBecauseInPolicy).' '.__('Each state changing').' : ';
$table_simple->data[6][1] .= html_print_radio_button(
'each_ff',
1,
'',
$each_ff,
true,
$disabledBecauseInPolicy
);
$table_simple->data[6][1] .= ' '.__('Each state changing').' : ';
$table_simple->data[6][1] .= __('To normal');
$table_simple->data[6][1] .= html_print_input_text(
'ff_event_normal',
@ -526,6 +581,7 @@ $table_simple->data[6][1] .= html_print_input_text(
'',
$classdisabledBecauseInPolicy
).' ';
$table_simple->data[6][1] .= __('To warning');
$table_simple->data[6][1] .= html_print_input_text(
'ff_event_warning',
@ -539,6 +595,7 @@ $table_simple->data[6][1] .= html_print_input_text(
'',
$classdisabledBecauseInPolicy
).' ';
$table_simple->data[6][1] .= __('To critical');
$table_simple->data[6][1] .= html_print_input_text(
'ff_event_critical',
@ -552,16 +609,31 @@ $table_simple->data[6][1] .= html_print_input_text(
'',
$classdisabledBecauseInPolicy
);
$table_simple->data[7][0] = __('Historical data');
if ($disabledBecauseInPolicy) {
// If is disabled, we send a hidden in his place and print a false checkbox because HTML dont send disabled fields and could be disabled by error
$table_simple->data[7][1] = html_print_checkbox('history_data_fake', 1, $history_data, true, $disabledBecauseInPolicy);
// If is disabled, we send a hidden in his place and print a false
// checkbox because HTML dont send disabled fields
// and could be disabled by error.
$table_simple->data[7][1] = html_print_checkbox(
'history_data_fake',
1,
$history_data,
true,
$disabledBecauseInPolicy
);
$table_simple->data[7][1] .= '<input type="hidden" name="history_data" value="'.(int) $history_data.'">';
} else {
$table_simple->data[7][1] = html_print_checkbox('history_data', 1, $history_data, true, $disabledBecauseInPolicy);
$table_simple->data[7][1] = html_print_checkbox(
'history_data',
1,
$history_data,
true,
$disabledBecauseInPolicy
);
}
// Advanced form part
// Advanced form part.
$table_advanced = new stdClass();
$table_advanced->id = 'advanced';
$table_advanced->width = '100%';
@ -629,15 +701,15 @@ if ($moduletype == MODULE_DATA) {
if (isset($id_agente)) {
$agent_interval = agents_get_interval($id_agente);
$interval_factor = ($interval / $agent_interval);
$table_advanced->data[2][1] = human_time_description_raw($interval).' ('.sprintf(__('Agent interval x %s'), $interval_factor).') '.ui_print_help_icon('module_interval_factor', true);
$table_advanced->data[2][1] = human_time_description_raw($interval).' ('.sprintf(__('Agent interval x %s'), $interval_factor).') ';
} else {
$table_advanced->data[2][1] = sprintf(__('Agent interval x %s'), $interval_factor).ui_print_help_icon('module_interval_factor', true);
$table_advanced->data[2][1] = sprintf(__('Agent interval x %s'), $interval_factor);
}
if ($__code_from == 'policies') {
// If is the policy form, module_interval will store the factor (not the seconds).
// So server will transform it to interval in seconds
$table_advanced->data[2][1] = sprintf(__('Default').': 1', $interval_factor).ui_print_help_icon('module_interval_factor', true);
$table_advanced->data[2][1] = sprintf(__('Default').': 1', $interval_factor);
$table_advanced->data[2][1] .= html_print_input_hidden('module_interval', $interval_factor, true);
} else if ($module_id_policy_module != 0) {
$table_advanced->data[2][1] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true);
@ -646,14 +718,14 @@ if ($moduletype == MODULE_DATA) {
// If it is a non policy form, the module_interval will not provided and will
// be taken the agent interval (this code is at configurar_agente.php)
} else {
$table_advanced->data[2][0] = __('Interval').ui_print_help_icon('module_interval', true);
$table_advanced->data[2][0] = __('Interval');
$table_advanced->colspan[2][1] = 2;
$table_advanced->data[2][1] = html_print_extended_select_for_time('module_interval', $interval, '', '', '0', false, true, false, false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
}
$table_advanced->data[2][1] .= html_print_input_hidden('moduletype', $moduletype, true);
$table_advanced->data[2][3] = __('Post process').' '.ui_print_help_icon('postprocess', true);
$table_advanced->data[2][3] = __('Post process');
$table_advanced->data[2][4] = html_print_extended_select_for_post_process(
'post_process',
$post_process,
@ -719,7 +791,7 @@ $table_advanced->data[4][4] = html_print_checkbox(
);
$table_advanced->colspan[4][4] = 3;
$table_advanced->data[5][0] = __('FF interval').' '.ui_print_help_icon('ff_interval', true);
$table_advanced->data[5][0] = __('FF interval');
$table_advanced->data[5][1] = html_print_input_text(
'module_ff_interval',
$ff_interval,
@ -734,7 +806,7 @@ $table_advanced->data[5][1] = html_print_input_text(
).ui_print_help_tip(__('Module execution flip flop time interval (in secs).'), true);
$table_advanced->colspan[5][1] = 2;
$table_advanced->data[5][3] = __('FF timeout').' '.ui_print_help_icon('ff_timeout', true);
$table_advanced->data[5][3] = __('FF timeout');
$module_type_name = modules_get_type_name($id_module_type);
$table_advanced->data[5][4] = '';
@ -936,7 +1008,7 @@ $table_advanced->colspan[10][1] = 6;
if (isset($id_agente) && $moduletype == MODULE_DATA) {
$has_remote_conf = enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']]);
if ($has_remote_conf) {
$table_advanced->data[11][0] = __('Cron from').ui_print_help_icon('cron', true);
$table_advanced->data[11][0] = __('Cron from');
$table_advanced->data[11][1] = html_print_extended_select_for_cron($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
@ -944,7 +1016,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
$table_advanced->data[12][1] = html_print_extended_select_for_cron($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, $disabledBecauseInPolicy, true);
$table_advanced->colspan[12][1] = 6;
} else {
$table_advanced->data[11][0] = __('Cron from').ui_print_help_icon('cron', true);
$table_advanced->data[11][0] = __('Cron from');
$table_advanced->data[11][1] = html_print_extended_select_for_cron($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, true);
$table_advanced->colspan[11][1] = 6;
@ -953,7 +1025,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
$table_advanced->colspan[12][1] = 6;
}
} else {
$table_advanced->data[11][0] = __('Cron from').ui_print_help_icon('cron', true);
$table_advanced->data[11][0] = __('Cron from');
$table_advanced->data[11][1] = html_print_extended_select_for_cron($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
@ -1126,6 +1198,7 @@ html_print_input_hidden('module_relations_count', $relations_count);
ui_require_jquery_file('json');
?>
<script type="text/javascript">
@ -1179,7 +1252,124 @@ $(document).ready (function () {
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
var type_name_selected = type_names[type_selected];
var element = document.getElementById("module_type_help");
var language = "<?php echo $config['language']; ?>" ;
element.onclick = function (event) {
if(type_name_selected == 'async_data' ||
type_name_selected == 'async_proc' ||
type_name_selected == 'async_string' ||
type_name_selected == 'generic_proc'||
type_name_selected == 'generic_data' ||
type_name_selected == 'generic_data_inc' ||
type_name_selected == 'generic_data_inc_abs'||
type_name_selected == 'generic_data_string' ||
type_name_selected == 'keep_alive'
){
if (language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Operacion&printable=yes#Tipos_de_m.C3.B3dulos',
'_blank',
'width=800,height=600'
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Operations&printable=yes#Types_of_Modules',
'_blank',
'width=800,height=600'
);
}
}
if(type_name_selected == 'remote_icmp' ||
type_name_selected == 'remote_icmp_proc'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_ICMP',
'_blank',
'width=800,height=600'
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#ICMP_Monitoring',
'_blank',
'width=800,height=600'
);
}
}
if(type_name_selected == 'remote_snmp_string' ||
type_name_selected == 'remote_snmp_proc' ||
type_name_selected == 'remote_snmp_inc' ||
type_name_selected == 'remote_snmp'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizando_con_m.C3.B3dulos_de_red_tipo_SNMP',
'_blank',
'width=800,height=600'
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#Monitoring_by_Network_Modules_with_SNMP',
'_blank',
'width=800,height=600'
);
}
}
if(type_name_selected == 'remote_tcp_string' ||
type_name_selected == 'remote_tcp_proc' ||
type_name_selected == 'remote_tcp_inc' ||
type_name_selected == 'remote_tcp'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_TCP',
'_blank',
'width=800,height=600'
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#TCP_Monitoring',
'_blank',
'width=800,height=600'
);
}
}
if(type_name_selected == 'web_data' ||
type_name_selected == 'web_proc' ||
type_name_selected == 'web_content_data' ||
type_name_selected == 'web_content_string'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_web&printable=yes#Creaci.C3.B3n_de_m.C3.B3dulos_web',
'_blank',
'width=800,height=600'
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Web_Monitoring&printable=yes#Creating_Web_Modules',
'_blank',
'width=800,height=600'
);
}
}
}
if (type_name_selected.match(/_string$/) == null) {
// Numeric types
$('#string_critical').hide();
@ -1319,7 +1509,7 @@ function disabled_two_tailed (disabledBecauseInPolicy) {
function advanced_option_dynamic() {
if($('.hide_dinamic').is(":visible")){
$('.hide_dinamic').hide();
} else {
$('.hide_dinamic').show();

View File

@ -233,7 +233,7 @@ push_table_simple($data, 'snmp_2');
// Advanced stuff
$data = [];
$data[0] = __('TCP send').' '.ui_print_help_icon('tcp_send', true);
$data[0] = __('TCP send');
$data[1] = html_print_textarea('tcp_send', 2, 65, $tcp_send, $disabledTextBecauseInPolicy, true, $largeclassdisabledBecauseInPolicy);
$table_simple->colspan['tcp_send'][1] = 3;

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