Former-commit-id: 7704a1226754067aee849526329eebce372063a1
This commit is contained in:
marcos.alconada 2019-04-12 11:39:34 +02:00
commit ddfd3339ff
296 changed files with 331919 additions and 8173 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

@ -26,6 +26,7 @@ $CODEHOME/pandora_server/pandora_server.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \ $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \ $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \
$CODEHOME/pandora_console/pandora_console.redhat.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_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.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.redhat.spec \

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas # (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.732 # Version 7.0NG.733
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.732-190325 Version: 7.0NG.733-190412
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.732'; use constant AGENT_VERSION => '7.0NG.733';
use constant AGENT_BUILD => '190325'; use constant AGENT_BUILD => '190412';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -662,6 +662,8 @@ sub parse_conf_modules($) {
$module->{'ff_timeout'} = $1; $module->{'ff_timeout'} = $1;
} elsif ($line =~ /^\s*module_each_ff\s+(\S+)\s*$/) { } elsif ($line =~ /^\s*module_each_ff\s+(\S+)\s*$/) {
$module->{'each_ff'} = $1; $module->{'each_ff'} = $1;
} elsif ($line =~ /^\s*module_ff_type\s+(\d+)\s*$/) {
$module->{'ff_type'} = $1;
# Macros # Macros
} elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) { } elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) {
$module->{'macros'}{$1} = $2; $module->{'macros'}{$1} = $2;
@ -2101,45 +2103,28 @@ sub cron_next_execution {
} }
# Get day of the week and month from cron config # 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 # Get current time and day of the week
my $cur_time = time(); my $cur_time = time();
my $cur_wday = (localtime ($cur_time))[6]; my $cur_wday = (localtime ($cur_time))[6];
# Any day of the week my $nex_time = cron_next_execution_date ($cron, $cur_time, $interval);
if ($wday eq '*') {
my $nex_time = cron_next_execution_date ($cron, $cur_time, $interval); # Check the day
return $nex_time - time(); while (!cron_check_interval($wday, (localtime ($nex_time))[6])) {
} # If it does not acomplish the day of the week, go to the next day.
# A range? $nex_time += 86400;
else { $nex_time = cron_next_execution_date ($cron, $nex_time, 0);
$wday = cron_get_closest_in_range ($cur_wday, $wday);
} }
# A specific day of the week return $nex_time - time();
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;
} }
############################################################################### ###############################################################################
@ -2151,7 +2136,30 @@ sub cron_check_syntax ($) {
return 0 if !defined ($cron); return 0 if !defined ($cron);
return ($cron =~ m/^(\d|\*|-)+ (\d|\*|-)+ (\d|\*|-)+ (\d|\*|-)+ (\d|\*|-)+$/); 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. # Get the next execution date for the given cron entry in seconds since epoch.
############################################################################### ###############################################################################
@ -2189,8 +2197,7 @@ sub cron_next_execution_date {
my @nex_time_array = @curr_time_array; my @nex_time_array = @curr_time_array;
# Update minutes # Update minutes
my ($min_down, undef) = cron_get_interval ($min); $nex_time_array[0] = cron_get_next_time_element($min);
$nex_time_array[0] = ($min_down eq '*') ? 0 : $min_down;
$nex_time = cron_valid_date(@nex_time_array, $cur_year); $nex_time = cron_valid_date(@nex_time_array, $cur_year);
if ($nex_time >= $cur_time) { if ($nex_time >= $cur_time) {
@ -2224,8 +2231,7 @@ sub cron_next_execution_date {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array); return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
#Update the hour if fails #Update the hour if fails
my ($hour_down, undef) = cron_get_interval ($hour); $nex_time_array[1] = cron_get_next_time_element($hour);
$nex_time_array[1] = ($hour_down eq '*') ? 0 : $hour_down;
# When an overflow is passed check the hour update again # When an overflow is passed check the hour update again
$nex_time = cron_valid_date(@nex_time_array, $cur_year); $nex_time = cron_valid_date(@nex_time_array, $cur_year);
@ -2253,10 +2259,9 @@ sub cron_next_execution_date {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array); return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
#Update the day if fails #Update the day if fails
my ($mday_down, undef) = cron_get_interval ($mday); $nex_time_array[2] = cron_get_next_time_element($mday, 1);
$nex_time_array[2] = ($mday_down eq '*') ? 1 : $mday_down;
# 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); $nex_time = cron_valid_date(@nex_time_array, $cur_year);
if ($nex_time >= $cur_time) { if ($nex_time >= $cur_time) {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array); return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
@ -2276,8 +2281,7 @@ sub cron_next_execution_date {
return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array); return $nex_time if cron_is_in_cron(\@cron_array, \@nex_time_array);
#Update the month if fails #Update the month if fails
my ($mon_down, undef) = cron_get_interval ($mon); $nex_time_array[3] = cron_get_next_time_element($mon);
$nex_time_array[3] = ($mon_down eq '*') ? 0 : $mon_down;
# When an overflow is passed check the month update in the next execution # When an overflow is passed check the month update in the next execution
$nex_time = cron_valid_date(@nex_time_array, $cur_year); $nex_time = cron_valid_date(@nex_time_array, $cur_year);
@ -2308,23 +2312,30 @@ sub cron_is_in_cron {
#If there is no elements means that is in cron #If there is no elements means that is in cron
return 1 unless (defined($elem_cron) || defined($elem_curr_time)); return 1 unless (defined($elem_cron) || defined($elem_curr_time));
# Go to last element if current is a wild card # Check the element interval
if ($elem_cron ne '*') { return 0 unless (cron_check_interval($elem_cron, $elem_curr_time));
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);
}
}
}
return cron_is_in_cron(\@deref_elems_cron, \@deref_elems_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 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 # returns an array with the first element in the first place of array
@ -2416,12 +2427,11 @@ sub check_module_cron {
return 1 unless ($is_first); return 1 unless ($is_first);
# Check if current timestamp is a valid cron date # Check if current timestamp is a valid cron date
my $next_execution = cron_next_execution_date( my $next_execution = cron_next_execution(
$module->{'cron'}, $module->{'cron'},
$now - $interval, 0
$interval
); );
return 1 if ($next_execution == $now); return 1 if (time() + $next_execution == $now);
return 0; return 0;
} }
@ -2532,6 +2542,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 .= " <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 .= " <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 .= " <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 # Data list
if ($#data > 0) { if ($#data > 0) {

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.732 %define version 7.0NG.733
%define release 190325 %define release 190412
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.732 %define version 7.0NG.733
%define release 190325 %define release 190412
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.732" PI_VERSION="7.0NG.733"
PI_BUILD="190325" PI_BUILD="190412"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas # (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.732 # Version 7.0NG.733
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
@ -44,6 +44,8 @@ remote_config 0
#agent_name_cmd cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\agentname.vbs" #agent_name_cmd cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\agentname.vbs"
agent_name_cmd __rand__ 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
#parent_agent_name caprica #parent_agent_name caprica

View File

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

View File

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

View File

@ -78,6 +78,7 @@ Pandora_Module::Pandora_Module (string name) {
this->warning_inverse = ""; this->warning_inverse = "";
this->quiet = ""; this->quiet = "";
this->module_ff_interval = ""; this->module_ff_interval = "";
this->module_ff_type = "";
this->module_alert_template = ""; this->module_alert_template = "";
this->module_crontab = ""; this->module_crontab = "";
} }
@ -733,6 +734,13 @@ Pandora_Module::getXml () {
module_xml += this->module_ff_interval; module_xml += this->module_ff_interval;
module_xml += "</module_ff_interval>\n"; 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 */ /* Module Alert template */
if (this->module_alert_template != "") { if (this->module_alert_template != "") {
@ -1028,6 +1036,16 @@ Pandora_Module::setModuleFFInterval (string value) {
this->module_ff_interval = 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. * 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 unit, custom_id, str_warning, str_critical;
string module_group, warning_inverse, critical_inverse, quiet; string module_group, warning_inverse, critical_inverse, quiet;
string module_ff_interval, module_alert_template, module_crontab; string module_ff_interval, module_alert_template, module_crontab;
string module_ff_type;
string critical_instructions, warning_instructions, unknown_instructions, tags; string critical_instructions, warning_instructions, unknown_instructions, tags;
protected: protected:
@ -277,6 +278,7 @@ namespace Pandora_Modules {
void setWarningInverse (string value); void setWarningInverse (string value);
void setQuiet (string value); void setQuiet (string value);
void setModuleFFInterval (string value); void setModuleFFInterval (string value);
void setModuleFFType (string value);
void setModuleAlertTemplate (string value); void setModuleAlertTemplate (string value);
void setModuleCrontab (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_WARNING_INVERSE ("module_warning_inverse ")
#define TOKEN_QUIET ("module_quiet ") #define TOKEN_QUIET ("module_quiet ")
#define TOKEN_MODULE_FF_INTERVAL ("module_ff_interval ") #define TOKEN_MODULE_FF_INTERVAL ("module_ff_interval ")
#define TOKEN_MODULE_FF_TYPE ("module_ff_type ")
#define TOKEN_MACRO ("module_macro") #define TOKEN_MACRO ("module_macro")
#define TOKEN_NATIVE_ENCODING ("module_native_encoding") #define TOKEN_NATIVE_ENCODING ("module_native_encoding")
#define TOKEN_ALERT_TEMPLATE ("module_alert_template") #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_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_instructions, module_warning_instructions, module_unknown_instructions, module_tags;
string module_critical_inverse, module_warning_inverse, module_quiet, module_ff_interval; 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; string macro;
Pandora_Module *module; Pandora_Module *module;
bool numeric; bool numeric;
@ -254,6 +255,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
module_warning_inverse = ""; module_warning_inverse = "";
module_quiet = ""; module_quiet = "";
module_ff_interval = ""; module_ff_interval = "";
module_ff_type = "";
module_native_encoding = ""; module_native_encoding = "";
module_alert_template = ""; module_alert_template = "";
module_user_session = ""; module_user_session = "";
@ -507,6 +509,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
if (module_ff_interval == "") { if (module_ff_interval == "") {
module_ff_interval = parseLine (line, TOKEN_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 == "") { if (module_alert_template == "") {
module_alert_template = parseLine (line, TOKEN_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 != "") { if (module_alert_template != "") {
pos_macro = module_alert_template.find(macro_name); pos_macro = module_alert_template.find(macro_name);
if (pos_macro != string::npos){ if (pos_macro != string::npos){
@ -1447,6 +1460,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
if (module_ff_interval != "") { if (module_ff_interval != "") {
module->setModuleFFInterval (module_ff_interval); module->setModuleFFInterval (module_ff_interval);
} }
if (module_ff_type != "") {
module->setModuleFFType (module_ff_type);
}
if (module_alert_template != "") { if (module_alert_template != "") {
module->setModuleAlertTemplate (module_alert_template); module->setModuleAlertTemplate (module_alert_template);

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.732(Build 190325)") #define PANDORA_VERSION ("7.0NG.733(Build 190412)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.732(Build 190325))" VALUE "ProductVersion", "(7.0NG.733(Build 190412))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.732-190325 Version: 7.0NG.733-190412
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -661,7 +661,7 @@ $ignored_params['refresh'] = '';
else { else {
var agentes_id = $("#id_agents2").val(); 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) { if (agentes_id === null && id_agentes !== null) {
id_agentes = id_agentes.split(";") id_agentes = id_agentes.split(";")
id_agentes.forEach(function(element) { id_agentes.forEach(function(element) {
@ -799,7 +799,7 @@ $ignored_params['refresh'] = '';
$("#module").append (option); $("#module").append (option);
}); });
var id_modules = $.get("full_modules_selected"); var id_modules = getQueryParam("full_modules_selected");
if(id_modules !== null) { if(id_modules !== null) {
id_modules = id_modules.split(";"); id_modules = id_modules.split(";");
id_modules.forEach(function(element) { id_modules.forEach(function(element) {
@ -812,20 +812,18 @@ $ignored_params['refresh'] = '';
); );
} }
(function($) { function getQueryParam (key) {
$.get = function(key) { key = key.replace(/[[]/, '[');
key = key.replace(/[[]/, '['); key = key.replace(/[]]/, ']');
key = key.replace(/[]]/, ']'); var pattern = "[?&]" + key + "=([^&#]*)";
var pattern = "[?&]" + key + "=([^&#]*)"; var regex = new RegExp(pattern);
var regex = new RegExp(pattern); var url = unescape(window.location.href);
var url = unescape(window.location.href); var results = regex.exec(url);
var results = regex.exec(url); if (results === null) {
if (results === null) { return null;
return null; } else {
} else { return results[1];
return results[1]; }
} }
}
})(jQuery);
</script> </script>

View File

@ -1,3 +1,3 @@
/godmode/servers/recorn_script.php /godmode/servers/recon_script.php
/godmode/servers/manage_recontask_form.php /godmode/servers/manage_recontask_form.php
/godmode/servers/manage_recontask.php /godmode/servers/manage_recontask.php

View File

@ -1,8 +1,24 @@
START TRANSACTION; START TRANSACTION;
-- ---------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tnetwork_matrix` (
-- Add column in table `tagent_custom_fields` `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 tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
ALTER TABLE `trecon_task` ADD COLUMN `summary` text;
COMMIT; COMMIT;

View File

@ -0,0 +1,40 @@
START TRANSACTION;
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';
COMMIT;

View File

@ -139,7 +139,7 @@ function get_logs_size($file)
function get_status_logs($path) function get_status_logs($path)
{ {
$status_server_log = ''; $status_server_log = '';
$size_server_log = number_format(get_logs_size($path)); $size_server_log = get_logs_size($path);
if ($size_server_log <= 1048576) { if ($size_server_log <= 1048576) {
$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>"; $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 { } else {
@ -157,9 +157,9 @@ function percentage_modules_per_agent()
$total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo'); $total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo');
$average_modules_per_agent = ($total_modules / $total_agents); $average_modules_per_agent = ($total_modules / $total_agents);
if ($average_modules_per_agent <= 40) { 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 { } 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; return $status_average_modules;
@ -202,9 +202,9 @@ function interval_average_of_network_modules()
$average_time = ((int) $total_module_interval_time / $total_network_modules); $average_time = ((int) $total_module_interval_time / $total_network_modules);
if ($average_time < 180) { 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 has a lot of load (average time $average_time) and a very fine configuration is required</a>";
} else { } 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 has an acceptable charge (average time $average_time) </a>";
} }
if ($average_time == 0) { if ($average_time == 0) {
@ -274,6 +274,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
} }
$path_server_logs = '/log/pandora/pandora_server.log'; $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'; $path_console_logs = '/www/html/pandora_console/pandora_console.log';
$innodb_log_file_size_min_rec_value = '64M'; $innodb_log_file_size_min_rec_value = '64M';
$innodb_log_buffer_size_min_rec_value = '16M'; $innodb_log_buffer_size_min_rec_value = '16M';
@ -710,6 +711,8 @@ render_info_data(
render_row(number_format((get_logs_size($path_server_logs) / 1048576), 3).'M', 'Size server logs (current value)'); 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(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(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'); render_row(get_status_logs($path_console_logs), 'Status console logs');

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_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 `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tpolicy_modules` -- 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_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 `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tpolicies` -- Table `tpolicies`
@ -764,6 +766,18 @@ ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default
ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300'; 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 `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 `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';
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template) -- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@ -1150,6 +1164,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 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_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 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` -- Table `talert_actions`
@ -1199,13 +1216,13 @@ 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 ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); 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 ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 26); INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 27);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); 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_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.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'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '733'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '734');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -1260,6 +1277,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 `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 `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 `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` -- Table `tagente_datos`
@ -1279,6 +1300,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_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_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 `dynamic_two_tailed` tinyint(1) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tagente` -- Table `tagente`
@ -1355,6 +1377,7 @@ ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '
-- Table `tnetflow_filter` -- Table `tnetflow_filter`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN `router_ip` TEXT NOT NULL DEFAULT ""; 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` -- Table `treport_custom_sql`
@ -1376,6 +1399,20 @@ 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 `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 `hide_no_data` tinyint(1) default '0';
ALTER TABLE treport_content ADD COLUMN `recursion` tinyint(1) default NULL; 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';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tmodule_relationship` -- Table `tmodule_relationship`
@ -1410,6 +1447,7 @@ 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 `wmi_enabled` tinyint(1) unsigned DEFAULT '0';
ALTER TABLE trecon_task ADD `auth_strings` text; 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 `autoconfiguration_enabled` tinyint(1) unsigned default '0';
ALTER TABLE trecon_task ADD `summary` text;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `twidget` AND Table `twidget_dashboard` -- Table `twidget` AND Table `twidget_dashboard`
@ -1912,6 +1950,20 @@ CREATE TABLE `tgis_map_layer_groups` (
CONSTRAINT `tgis_map_layer_groups_ibfk_3` FOREIGN KEY (`agent_id`) REFERENCES `tagente` (`id_agente`) 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; ) 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 `tnotification_source` -- Table `tnotification_source`
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -2040,3 +2092,8 @@ INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Di
-- Add column in table `tagent_custom_fields` -- Add column in table `tagent_custom_fields`
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT ''; ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
-- ----------------------------------------------------------------------
-- 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";

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')]); ?> <?php echo html_print_image('images/icono_grande_reconserver.png', true, ['title' => __('Collections')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Collections'); ?> <p id="description_task"> <h3> <?php echo __('Create Collections'); ?></h3><p id="description_task">
<?php <?php
echo __( echo __(
"A file collection is a group of files (e.g. scripts or executables) which are "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Custom Fields')]); ?>
</div> </div>
<div class="text_task"> <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 <?php
echo __( echo __(
"Custom fields are an easy way to personalized agent's information. "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_custom_reporting.png', true, ['title' => __('Custom Graphs')]); ?>
</div> </div>
<div class="text_task"> <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 <?php
echo __( echo __(
"Graphs are designed to show the data collected by %s in a temporary scale defined by the user. "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Fields Manager')]); ?>
</div> </div>
<div class="text_task"> <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 <?php
echo __( echo __(
"Custom fields are an easy way to personalized agent's information. "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_incidencia.png', true, ['title' => __('Incidents')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Incidents'); ?> <p id="description_task"> <h3> <?php echo __('Create Incidents'); ?></h3><p id="description_task">
<?php <?php
echo __( echo __(
"Besides receiving and processing data to monitor systems or applications, "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Visual Console')]); ?>
</div> </div>
<div class="text_task"> <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 <?php
echo __( 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'.", '%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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Network Map')]); ?>
</div> </div>
<div class="text_task"> <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 <?php
echo __( echo __(
'There is also an open-source version of the network map. '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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Planned Downtime')]); ?>
</div> </div>
<div class="text_task"> <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 <?php
echo __( echo __(
"%s contains a scheduled downtime management system. "%s contains a scheduled downtime management system.

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' => __('Discovery server')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Discovery server')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Discovery Task'); ?><p id="description_task"> <h3> <?php echo __('Create Discovery Task'); ?></h3><p id="description_task">
<?php <?php
echo __( echo __(
'Discovery Task are used to find new elements in the network. 'Discovery Task are used to find new elements in the network.

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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_servicios.png', true, ['title' => __('Services')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Services'); ?> <p id="description_task"> <h3> <?php echo __('Create Services'); ?></h3><p id="description_task">
<?php <?php
echo __( echo __(
"A service is a way to group your IT resources based on their functionalities. "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('SNMP Filter')]); ?>
</div> </div>
<div class="text_task"> <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 <?php
echo __( echo __(
"Some systems receive a high number of traps. "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_gestiondetags.png', true, ['title' => __('Tags')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Tags'); ?> <p id="description_task"> <h3> <?php echo __('Create Tags'); ?></h3><p id="description_task">
<?php <?php
echo __( echo __(
"Access to modules can be configured by a tagging system. "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')]); ?> <?php echo html_print_image('images/firts_task/icono_grande_topology.png', true, ['title' => __('Transactions')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Transactions'); ?> <p id="description_task"> <h3> <?php echo __('Create Transactions'); ?></h3><p id="description_task">
<?php <?php
echo __( 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. '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

@ -44,8 +44,6 @@ if ($current_package == 0) {
echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR'])); echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR']));
echo '</a> '; echo '</a> ';
echo '<a class="footer">'.__('Page generated at').' '.date($config['date_format']);
echo '</a><br /><span>&reg; '.get_copyright_notice().'</span>';
if (isset($config['debug'])) { if (isset($config['debug'])) {
$cache_info = []; $cache_info = [];

View File

@ -18,10 +18,14 @@ require_once 'include/functions_notifications.php';
// Global errors/warnings checking. // Global errors/warnings checking.
config_check(); config_check();
?>
<div id="header_table"> if ($config['menu_type'] == 'classic') {
<div id="header_table_inner"> echo '<div id="header_table" class="header_table_classic">';
} else {
echo '<div id="header_table" class="header_table_collapsed">';
}
?>
<div id="header_table_inner">
<?php <?php
// ======= Notifications Discovery =============================================== // ======= Notifications Discovery ===============================================
$notifications_numbers = notifications_get_counters(); $notifications_numbers = notifications_get_counters();
@ -82,7 +86,7 @@ require_once 'include/functions_notifications.php';
$header_chat .= '</a></span></div>'; $header_chat .= '</a></span></div>';
// Search // Search.
$acl_head_search = true; $acl_head_search = true;
if ($config['acl_enterprise'] == 1 && !users_is_admin()) { if ($config['acl_enterprise'] == 1 && !users_is_admin()) {
$acl_head_search = db_get_sql( $acl_head_search = db_get_sql(
@ -94,7 +98,7 @@ require_once 'include/functions_notifications.php';
} }
if ($acl_head_search) { if ($acl_head_search) {
// Search bar // Search bar.
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">'; $search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
if (!isset($config['search_keywords'])) { if (!isset($config['search_keywords'])) {
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>'; $search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
@ -116,15 +120,13 @@ require_once 'include/functions_notifications.php';
} }
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');" $search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
onkeyup="javascript: fieldKeyWordEmpty = false;" onkeyup="javascript: fieldKeyWordEmpty = false;" class="search_input" />';
style="margin-top:5px;" class="search_input" />';
// $search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; // $search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />"; $search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
$search_bar .= '</form>'; $search_bar .= '</form>';
$header_searchbar = '<div id="header_searchbar">'.ui_print_help_tip(__('Blank characters are used as AND conditions'), true); $header_searchbar = '<div id="header_searchbar">'.$search_bar.'</div>';
$header_searchbar .= $search_bar.'</div>';
} }
@ -145,10 +147,19 @@ require_once 'include/functions_notifications.php';
$_GET['refr'] = null; $_GET['refr'] = null;
} }
$select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '".$config['id_user']."'"); $select = db_process_sql(
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']); "SELECT autorefresh_white_list,time_autorefresh
FROM tusuario
WHERE id_user = '".$config['id_user']."'"
);
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) { $autorefresh_list = json_decode(
$select[0]['autorefresh_white_list']
);
if ($autorefresh_list !== null
&& array_search($_GET['sec2'], $autorefresh_list) !== false
) {
$do_refresh = true; $do_refresh = true;
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
@ -157,22 +168,57 @@ require_once 'include/functions_notifications.php';
} }
if ($do_refresh) { if ($do_refresh) {
$autorefresh_img = html_print_image('images/header_refresh_gray.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]); $autorefresh_img = html_print_image(
'images/header_refresh_gray.png',
true,
[
'class' => 'bot',
'alt' => 'lightning',
'title' => __('Configure autorefresh'),
]
);
if ($_GET['refr']) { if ((isset($select[0]['time_autorefresh']) === true)
$autorefresh_txt .= ' (<span id="refrcounter">'.date('i:s', $config['refr']).'</span>)'; && $select[0]['time_autorefresh'] !== 0
&& $config['refr'] === null
) {
$config['refr'] = $select[0]['time_autorefresh'];
$autorefresh_txt .= ' (<span id="refrcounter">';
$autorefresh_txt .= date(
'i:s',
$config['refr']
);
$autorefresh_txt .= '</span>)';
} else if ($_GET['refr']) {
$autorefresh_txt .= ' (<span id="refrcounter">';
$autorefresh_txt .= date('i:s', $config['refr']);
$autorefresh_txt .= '</span>)';
} }
$ignored_params['refr'] = ''; $ignored_params['refr'] = '';
$values = get_refresh_time_array(); $values = get_refresh_time_array();
$autorefresh_additional = '<span id="combo_refr" style="display: none;">'; $autorefresh_additional = '<span id="combo_refr" style="display: none;">';
$autorefresh_additional .= html_print_select($values, 'ref', '', '', __('Select'), '0', true, false, false); $autorefresh_additional .= html_print_select(
$values,
'ref',
'',
'',
__('Select'),
'0',
true,
false,
false
);
$autorefresh_additional .= '</span>'; $autorefresh_additional .= '</span>';
unset($values); unset($values);
$autorefresh_link_open_img = '<a class="white autorefresh" href="'.ui_get_url_refresh($ignored_params).'">'; $autorefresh_link_open_img = '<a class="white autorefresh" href="'.ui_get_url_refresh($ignored_params).'">';
if ($_GET['refr']) { if ($_GET['refr']
|| ((isset($select[0]['time_autorefresh']) === true)
&& $select[0]['time_autorefresh'] !== 0)
) {
$autorefresh_link_open_txt = '<a class="autorefresh autorefresh_txt" href="'.ui_get_url_refresh($ignored_params).'">'; $autorefresh_link_open_txt = '<a class="autorefresh autorefresh_txt" href="'.ui_get_url_refresh($ignored_params).'">';
} else { } else {
$autorefresh_link_open_txt = '<a>'; $autorefresh_link_open_txt = '<a>';
@ -192,7 +238,15 @@ require_once 'include/functions_notifications.php';
$display_counter = 'display:none'; $display_counter = 'display:none';
} }
} else { } else {
$autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); $autorefresh_img = html_print_image(
'images/header_refresh_disabled_gray.png',
true,
[
'class' => 'bot autorefresh_disabled',
'alt' => 'lightning',
'title' => __('Disabled autorefresh'),
]
);
$ignored_params['refr'] = false; $ignored_params['refr'] = false;
@ -203,56 +257,80 @@ require_once 'include/functions_notifications.php';
$display_counter = 'display:none'; $display_counter = 'display:none';
} }
$header_autorefresh = '<div id="header_autorefresh">'.$autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close.'</div>'; $header_autorefresh = '<div id="header_autorefresh">';
$header_autorefresh_counter = '<div id="header_autorefresh_counter" style="'.$display_counter.'">'.$autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional.'</div>'; $header_autorefresh .= $autorefresh_link_open_img;
$header_autorefresh .= $autorefresh_img;
$header_autorefresh .= $autorefresh_link_close;
$header_autorefresh .= '</div>';
$header_autorefresh_counter = '<div id="header_autorefresh_counter" style="'.$display_counter.'">';
$header_autorefresh_counter .= $autorefresh_link_open_txt;
$header_autorefresh_counter .= $autorefresh_txt;
$header_autorefresh_counter .= $autorefresh_link_close;
$header_autorefresh_counter .= $autorefresh_additional;
$header_autorefresh_counter .= '</div>';
// Qr. // Support.
if ($config['show_qr_code_header'] == 0) { if (defined('PANDORA_ENTERPRISE')) {
$show_qr_code_header = 'display: none;'; $header_support_link = 'https://support.artica.es/';
} else { } else {
$show_qr_code_header = 'display: inline;'; $header_support_link = 'https://pandorafms.com/forums/';
} }
$header_qr = '<div id="header_qr" style="'.$show_qr_code_header.'"><div id="qr_code_container"><a href="javascript: show_dialog_qrcode();">'.html_print_image( $header_support = '<div id="header_support">';
'images/qrcode_icon_gray.png', $header_support .= '<a href="'.$header_support_link.'" target="_blank">';
true, $header_support .= html_print_image('/images/header_support.png', true, ['title' => __('Go to support'), 'class' => 'bot', 'alt' => 'user']);
[ $header_support .= '</a></div>';
'alt' => __('QR Code of the page'),
'title' => __('QR Code of the page'), // Documentation.
] $header_docu = '<div id="header_support">';
).'</a></div></div>'; $header_docu .= '<a href="https://wiki.pandorafms.com/index.php?title=Main_Page" target="_blank">';
$header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']);
$header_docu .= '</a></div>';
echo "<div style='display: none;' id='qrcode_container' title='".__('QR code of the page')."'>";
echo "<div id='qrcode_container_image'></div>";
echo '</div>';
?>
<script type='text/javascript'>
$(document).ready(function() {
$( "#qrcode_container" ).dialog({
autoOpen: false,
modal: true
});
});
</script>
<?php
// User. // User.
if (is_user_admin($config['id_user']) == 1) { if (is_user_admin($config['id_user']) == 1) {
$header_user = html_print_image('images/header_user_admin_green.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); $header_user = html_print_image(
'images/header_user_admin_green.png',
true,
[
'title' => __('Edit my user'),
'class' => 'bot',
'alt' => 'user',
]
);
} else { } else {
$header_user = html_print_image('images/header_user_green.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']); $header_user = html_print_image(
'images/header_user_green.png',
true,
[
'title' => __('Edit my user'),
'class' => 'bot',
'alt' => 'user',
]
);
} }
$header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span> ('.$config['id_user'].')</span></a></div>'; $header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span> ('.$config['id_user'].')</span></a></div>';
// Logout. // Logout.
$header_logout = '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">'; $header_logout = '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">';
$header_logout .= html_print_image('images/header_logout_gray.png', true, ['alt' => __('Logout'), 'class' => 'bot', 'title' => __('Logout')]); $header_logout .= html_print_image(
'images/header_logout_gray.png',
true,
[
'alt' => __('Logout'),
'class' => 'bot',
'title' => __('Logout'),
]
);
$header_logout .= '</a></div>'; $header_logout .= '</a></div>';
echo '<div class="header_left">'.$header_autorefresh, $header_autorefresh_counter, $header_qr, $header_chat.'</div> echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
<div class="header_center">'.$header_searchbar, $header_discovery, $servers_list.'</div> <div class="header_center">'.$header_searchbar.'</div>
<div class="header_right">'.$header_user, $header_logout.'</div>'; <div class="header_right">'.$header_chat, $header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_support, $header_docu, $header_user, $header_logout.'</div>';
?> ?>
</div> <!-- Closes #table_header_inner --> </div> <!-- Closes #table_header_inner -->
</div> <!-- Closes #table_header --> </div> <!-- Closes #table_header -->
@ -490,7 +568,12 @@ require_once 'include/functions_notifications.php';
); );
<?php <?php
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET['refr']))) { if (($autorefresh_list !== null)
&& (array_search(
$_GET['sec2'],
$autorefresh_list
) !== false) && (!isset($_GET['refr']))
) {
$do_refresh = true; $do_refresh = true;
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
@ -503,31 +586,12 @@ require_once 'include/functions_notifications.php';
if ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard' && $new_dashboard) { if ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard' && $new_dashboard) {
$do_refresh = false; $do_refresh = false;
} }
if ($do_refresh) {
?>
$("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle ();
href = $("a.autorefresh").attr ("href");
<?php
if ($select[0]['time_autorefresh']) {
?>
var refresh = '<?php echo $select[0]['time_autorefresh']; ?>';
$(document).attr ("location", href + refresh);
<?php
}
?>
<?php
}
} }
?> ?>
if (fixed_header) { if (fixed_header) {
$('div#head').addClass('fixed_header'); $('div#head').addClass('fixed_header');
$('div#page') $('div#main').css('padding-top', $('div#head').innerHeight() + 'px');
.css('padding-top', $('div#head').innerHeight() + 'px')
.css('position', 'relative');
} }
check_new_chats_icon('icon_new_messages_chat'); check_new_chats_icon('icon_new_messages_chat');
@ -547,14 +611,14 @@ require_once 'include/functions_notifications.php';
blinkpubli(); blinkpubli();
<?php <?php
if ($_GET['refr']) { if ($_GET['refr'] || $do_refresh === true) {
?> ?>
$("#header_autorefresh").css('padding-right', '5px'); $("#header_autorefresh").css('padding-right', '5px');
var refr_time = <?php echo (int) get_parameter('refr', 0); ?>; var refr_time = <?php echo (int) get_parameter('refr', 0); ?>;
var t = new Date(); var t = new Date();
t.setTime (t.getTime () + t.setTime (t.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
parseInt(<?php echo ($config['refr'] * 1000); ?>)); $("#refrcounter").countdown ({
$("#refrcounter").countdown ({until: t, until: t,
layout: '%M%nn%M:%S%nn%S', layout: '%M%nn%M:%S%nn%S',
labels: ['', '', '', '', '', '', ''], labels: ['', '', '', '', '', '', ''],
onExpiry: function () { onExpiry: function () {

View File

@ -305,12 +305,12 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
echo '<div class ="img_banner_login">'; echo '<div class ="img_banner_login">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (isset($config['custom_splash_login'])) { 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 { } 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 { } 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>'; echo '</div>';

View File

@ -1,26 +1,39 @@
<?php <?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 // Config functions.
// ==================================================
// 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.
require_once 'include/config.php'; require_once 'include/config.php';
// This solves problems in enterprise load // This solves problems in enterprise load.
global $config; global $config;
check_login(); check_login();
/*
Call all extensions login function */
// extensions_call_login_function ();
require_once 'include/functions_reporting.php'; require_once 'include/functions_reporting.php';
require_once 'include/functions_tactical.php'; require_once 'include/functions_tactical.php';
require_once $config['homedir'].'/include/functions_graph.php'; require_once $config['homedir'].'/include/functions_graph.php';
@ -29,8 +42,18 @@ if (tags_has_user_acl_tags()) {
ui_print_tags_warning(); ui_print_tags_warning();
} }
$user_strict = (bool) db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $user_strict = (bool) db_get_value(
$all_data = tactical_status_modules_agents($config['id_user'], $user_strict, 'AR', $user_strict); 'strict_acl',
'tusuario',
'id_user',
$config['id_user']
);
$all_data = tactical_status_modules_agents(
$config['id_user'],
$user_strict,
'AR',
$user_strict
);
$data = []; $data = [];
$data['monitor_not_init'] = (int) $all_data['_monitors_not_init_']; $data['monitor_not_init'] = (int) $all_data['_monitors_not_init_'];
@ -79,6 +102,8 @@ if (!empty($all_data)) {
$data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1); $data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1);
} }
?> ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0"> <table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr> <tr>
@ -88,7 +113,7 @@ if (!empty($all_data)) {
<?php <?php
// //
// Overview Table // Overview Table.
// //
$table = new stdClass(); $table = new stdClass();
$table->class = 'databox'; $table->class = 'databox';
@ -101,12 +126,12 @@ if (!empty($all_data)) {
$table->head[0] = '<span>'.__('%s Overview', get_product_name()).'</span>'; $table->head[0] = '<span>'.__('%s Overview', get_product_name()).'</span>';
$table->head_colspan[0] = 4; $table->head_colspan[0] = 4;
// Indicators // Indicators.
$tdata = []; $tdata = [];
$stats = reporting_get_stats_indicators($data, 120, 10, false); $stats = reporting_get_stats_indicators($data, 120, 10, false);
$status = '<table class="status_tactical">'; $status = '<table class="status_tactical">';
foreach ($stats as $stat) { 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>'; $status .= '</table>';
@ -115,25 +140,25 @@ if (!empty($all_data)) {
$table->data[] = $tdata; $table->data[] = $tdata;
// Alerts // Alerts.
$tdata = []; $tdata = [];
$tdata[0] = reporting_get_stats_alerts($data); $tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = ''; $table->rowclass[] = '';
$table->data[] = $tdata; $table->data[] = $tdata;
// Modules by status // Modules by status.
$tdata = []; $tdata = [];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100); $tdata[0] = reporting_get_stats_modules_status($data, 180, 100);
$table->rowclass[] = ''; $table->rowclass[] = '';
$table->data[] = $tdata; $table->data[] = $tdata;
// Total agents and modules // Total agents and modules.
$tdata = []; $tdata = [];
$tdata[0] = reporting_get_stats_agents_monitors($data); $tdata[0] = reporting_get_stats_agents_monitors($data);
$table->rowclass[] = ''; $table->rowclass[] = '';
$table->data[] = $tdata; $table->data[] = $tdata;
// Users // Users.
if (users_is_admin()) { if (users_is_admin()) {
$tdata = []; $tdata = [];
$tdata[0] = reporting_get_stats_users($data); $tdata[0] = reporting_get_stats_users($data);
@ -160,7 +185,7 @@ if (!empty($all_data)) {
if (!empty($news)) { if (!empty($news)) {
// NEWS BOARD///////////////////////////// // NEWS BOARD.
echo '<div id="news_board">'; echo '<div id="news_board">';
echo '<table cellpadding="0" width=100% cellspacing="0" class="databox filters">'; echo '<table cellpadding="0" width=100% cellspacing="0" class="databox filters">';
@ -184,20 +209,72 @@ if (!empty($all_data)) {
echo '</table>'; echo '</table>';
echo '</div>'; echo '</div>';
// News board // News board.
echo '<br><br>'; echo '<br><br>';
// END OF NEWS BOARD///////////////////////////// // END OF NEWS BOARD.
} }
// LAST ACTIVITY///////////////////////////// $nots = messages_get_overview('utimestamp', 'DESC', false);
// Show last activity from this user if (!empty($nots)) {
// Notifications board.
echo '<div id="notifications_board">';
echo '<table cellpadding="0" width=100% cellspacing="0" class="databox filters">';
echo '<tr><th style="text-align:center;"><span >'.__('Pending notifications').'</span></th></tr>';
if ($config['prominent_time'] == 'timestamp') {
$comparation_suffix = '';
} else {
$comparation_suffix = __('ago');
}
foreach ($nots as $msg) {
$conversation = io_safe_output(
messages_get_conversation($msg)
);
if (is_array($conversation)) {
$text = array_pop($conversation)['message'];
} else {
// Skip empty message.
continue;
}
$url = ui_get_full_url(
'index.php?sec=message_list&sec2=operation/messages/message_edit&read_message=1&id_message='.$msg['id_mensaje']
);
if ($msg['url'] != '') {
$url = $msg['url'];
}
echo '<tr><th class="green_title">'.$msg['subject'].'</th></tr>';
echo '<tr><td><a href="'.$url.'">';
if ($msg['id_usuario_origen'] != '') {
echo '<b>'.get_user_fullname($msg['id_usuario_origen']).'</b> ';
}
echo '<i>'.ui_print_timestamp($msg['timestamp'], true).'</i> '.$comparation_suffix.'</a></td></tr>';
echo '<tr><td class="datos">';
echo nl2br($text);
echo '</td></tr>';
}
echo '</table>';
echo '</div>';
echo '<br><br>';
// EO Notifications board.
}
// LAST ACTIVITY.
// Show last activity from this user.
echo '<div id="activity">'; echo '<div id="activity">';
$table = new stdClass(); $table = new stdClass();
$table->class = 'databox data'; $table->class = 'databox data';
$table->width = '100%'; $table->width = '100%';
// Don't specify px // Don't specify px.
$table->data = []; $table->data = [];
$table->size = []; $table->size = [];
$table->size[0] = '5%'; $table->size[0] = '5%';
@ -212,38 +289,14 @@ if (!empty($all_data)) {
$table->head[3] = __('Source IP'); $table->head[3] = __('Source IP');
$table->head[4] = __('Comments'); $table->head[4] = __('Comments');
$table->title = '<span>'.__('This is your last activity performed on the %s console', get_product_name()).'</span>'; $table->title = '<span>'.__('This is your last activity performed on the %s console', get_product_name()).'</span>';
$sql = sprintf(
switch ($config['dbtype']) { 'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
case 'mysql':
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
FROM tsesion FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.") WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10", AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
$config['id_user'] $config['id_user']
); );
break;
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); $sessions = db_get_all_rows_sql($sql);
@ -253,24 +306,17 @@ if (!empty($all_data)) {
foreach ($sessions as $session) { foreach ($sessions as $session) {
$data = []; $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[0] = '<strong>'.$session_id_usuario.'</strong>';
$data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion']; $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; $data[3] = $session_ip_origen;
$description = str_replace([',', ', '], ', ', $session['descripcion']); $description = str_replace([',', ', '], ', ', $session['descripcion']);
if (strlen($description) > 100) { if (strlen($description) > 100) {
@ -287,8 +333,7 @@ if (!empty($all_data)) {
unset($table); unset($table);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
// activity // END OF LAST ACTIVIYY.
// END OF LAST ACTIVIYY/////////////////////////////
?> ?>

View File

@ -20,31 +20,13 @@ if (! isset($config['id_user'])) {
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(document).ready(function(){ $(document).ready(function(){
var menuType_value = localStorage.getItem("menuType"); var menuType_value = "<?php echo $config['menu_type']; ?>";
if (menuType_value == 'classic') { if (menuType_value == 'classic') {
$('#menu_full').removeClass('menu_full_collapsed').addClass('menu_full_classic');
$('.logo_icon').css('display','none');
$('.logo_full').css('display','block');
$('div#title_menu').removeClass('title_menu_collapsed').addClass('title_menu_classic');
$('div#page').removeClass('page_collapsed').addClass('page_classic');
$('#header_table').removeClass('header_table_collapsed').addClass('header_table_classic');
$('#button_collapse').removeClass('button_collapsed').addClass('button_classic');
$('ul.submenu').css('left', '214px'); $('ul.submenu').css('left', '214px');
$('li.menu_icon').removeClass('menu_icon_collapsed').addClass("no_hidden_menu");
} }
else{ else{
if(menuType_value != 'collapsed'){
localStorage.setItem("menuType", "collapsed");
}
$('#menu_full').removeClass('menu_full_classic').addClass('menu_full_collapsed');
$('.logo_full').css('display','none');
$('.logo_icon').css('display','block');
$('div#title_menu').removeClass('title_menu_classic').addClass('title_menu_collapsed');
$('div#page').removeClass('page_classic').addClass('page_collapsed');
$('#header_table').removeClass('header_table_classic').addClass('header_table_collapsed');
$('#button_collapse').removeClass('button_classic').addClass('button_collapsed');
$('ul.submenu').css('left', '59px'); $('ul.submenu').css('left', '59px');
$('li.menu_icon').removeClass("no_hidden_menu").addClass('menu_icon_collapsed');
} }
}); });
@ -63,14 +45,18 @@ if (isset($config['autohidden_menu']) && $config['autohidden_menu']) {
} }
// Menu container prepared to autohide menu // Menu container prepared to autohide menu
echo '<div id="menu_full">'; 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 = 'images/custom_logo/'.$config['custom_logo'];
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed']; $custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
if (!defined('PANDORA_ENTERPRISE')) { if (!defined('PANDORA_ENTERPRISE')) {
$logo_title = get_product_name().' Opensource'; $logo_title = get_product_name().' Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_green.png'; $custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png'; $custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
} else { } else {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) { if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) {
@ -82,11 +68,19 @@ if (!defined('PANDORA_ENTERPRISE')) {
echo '<div class="logo_green"><a href="index.php?sec=main">'; echo '<div class="logo_green"><a href="index.php?sec=main">';
if (isset($config['custom_logo'])) { if (isset($config['custom_logo'])) {
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:none']); 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 (isset($config['custom_logo_collapsed'])) {
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:block']); 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 '</a></div>';
@ -109,8 +103,11 @@ if (check_acl($config['id_user'], 0, 'AW')
require 'godmode/menu.php'; require 'godmode/menu.php';
echo '<div id="button_collapse" class="button_collapse"></div>'; 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"); // require ("links_menu.php");
echo '</div>'; echo '</div>';
@ -131,10 +128,30 @@ $('#button_collapse').on('click', function() {
if($('#menu_full').hasClass('menu_full_classic')){ if($('#menu_full').hasClass('menu_full_classic')){
localStorage.setItem("menuType", "collapsed"); localStorage.setItem("menuType", "collapsed");
$('ul.submenu').css('left', '59px'); $('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')){ else if($('#menu_full').hasClass('menu_full_collapsed')){
localStorage.setItem("menuType", "classic"); localStorage.setItem("menuType", "classic");
$('ul.submenu').css('left', '214px'); $('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_full').toggle();

View File

@ -106,6 +106,7 @@ if (isset($_POST['template_id'])) {
'min_ff_event_normal' => $row2['min_ff_event_normal'], 'min_ff_event_normal' => $row2['min_ff_event_normal'],
'min_ff_event_warning' => $row2['min_ff_event_warning'], 'min_ff_event_warning' => $row2['min_ff_event_warning'],
'min_ff_event_critical' => $row2['min_ff_event_critical'], 'min_ff_event_critical' => $row2['min_ff_event_critical'],
'ff_type' => $row2['ff_type'],
]; ];
$name = $row2['name']; $name = $row2['name'];

View File

@ -375,12 +375,12 @@ if ($create_modules) {
$new_module_configuration_data .= "\nmodule_secname ".$snmp3_auth_user; $new_module_configuration_data .= "\nmodule_secname ".$snmp3_auth_user;
$new_module_configuration_data .= "\nmodule_seclevel ".$snmp3_security_level; $new_module_configuration_data .= "\nmodule_seclevel ".$snmp3_security_level;
if ($snmp3_security_level=='authNoPriv' || $snmp3_security_level=='authPriv') { if ($snmp3_security_level == 'authNoPriv' || $snmp3_security_level == 'authPriv') {
$new_module_configuration_data .= "\nmodule_authpass ".$snmp3_auth_pass; $new_module_configuration_data .= "\nmodule_authpass ".$snmp3_auth_pass;
$new_module_configuration_data .= "\nmodule_authproto ".$snmp3_auth_method; $new_module_configuration_data .= "\nmodule_authproto ".$snmp3_auth_method;
} }
if ($snmp3_security_level=='authPriv') { if ($snmp3_security_level == 'authPriv') {
$new_module_configuration_data .= "\nmodule_privproto ".$snmp3_privacy_method; $new_module_configuration_data .= "\nmodule_privproto ".$snmp3_privacy_method;
$new_module_configuration_data .= "\nmodule_privpass ".$snmp3_privacy_pass; $new_module_configuration_data .= "\nmodule_privpass ".$snmp3_privacy_pass;
} }

View File

@ -160,7 +160,7 @@ $module_macros = [];
if ($create_agent) { if ($create_agent) {
$mssg_warning = 0; $mssg_warning = 0;
$alias_safe_output = io_safe_output(get_parameter('alias', '')); $alias_safe_output = io_safe_output(get_parameter('alias', ''));
$alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output))); $alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $alias_safe_output)));
$alias_as_name = (int) get_parameter_post('alias_as_name', 0); $alias_as_name = (int) get_parameter_post('alias_as_name', 0);
$direccion_agente = (string) get_parameter_post('direccion', ''); $direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0); $unique_ip = (int) get_parameter_post('unique_ip', 0);
@ -766,7 +766,7 @@ if ($update_agent) {
$id_agente = (int) get_parameter_post('id_agente'); $id_agente = (int) get_parameter_post('id_agente');
$nombre_agente = str_replace('`', '&lsquo;', (string) get_parameter_post('agente', '')); $nombre_agente = str_replace('`', '&lsquo;', (string) get_parameter_post('agente', ''));
$alias_safe_output = io_safe_output(get_parameter('alias', '')); $alias_safe_output = io_safe_output(get_parameter('alias', ''));
$alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$-]/', '', $alias_safe_output))); $alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $alias_safe_output)));
$alias_as_name = (int) get_parameter_post('alias_as_name', 0); $alias_as_name = (int) get_parameter_post('alias_as_name', 0);
$direccion_agente = (string) get_parameter_post('direccion', ''); $direccion_agente = (string) get_parameter_post('direccion', '');
$unique_ip = (int) get_parameter_post('unique_ip', 0); $unique_ip = (int) get_parameter_post('unique_ip', 0);
@ -1320,6 +1320,7 @@ if ($update_module || $create_module) {
$ff_event_normal = (int) get_parameter('ff_event_normal'); $ff_event_normal = (int) get_parameter('ff_event_normal');
$ff_event_warning = (int) get_parameter('ff_event_warning'); $ff_event_warning = (int) get_parameter('ff_event_warning');
$ff_event_critical = (int) get_parameter('ff_event_critical'); $ff_event_critical = (int) get_parameter('ff_event_critical');
$ff_type = (int) get_parameter('ff_type');
$each_ff = (int) get_parameter('each_ff'); $each_ff = (int) get_parameter('each_ff');
$ff_timeout = (int) get_parameter('ff_timeout'); $ff_timeout = (int) get_parameter('ff_timeout');
$unit = (string) get_parameter('unit_select'); $unit = (string) get_parameter('unit_select');
@ -1482,6 +1483,7 @@ if ($update_module) {
'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_normal' => $ff_event_normal,
'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical, 'min_ff_event_critical' => $ff_event_critical,
'ff_type' => $ff_type,
'each_ff' => $each_ff, 'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout, 'ff_timeout' => $ff_timeout,
'unit' => io_safe_output($unit), 'unit' => io_safe_output($unit),
@ -1677,6 +1679,7 @@ if ($create_module) {
'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_normal' => $ff_event_normal,
'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical, 'min_ff_event_critical' => $ff_event_critical,
'ff_type' => $ff_type,
'each_ff' => $each_ff, 'each_ff' => $each_ff,
'ff_timeout' => $ff_timeout, 'ff_timeout' => $ff_timeout,
'unit' => io_safe_output($unit), 'unit' => io_safe_output($unit),

View File

@ -249,6 +249,7 @@ if ($id_agent_module) {
$ff_event_normal = $module['min_ff_event_normal']; $ff_event_normal = $module['min_ff_event_normal'];
$ff_event_warning = $module['min_ff_event_warning']; $ff_event_warning = $module['min_ff_event_warning'];
$ff_event_critical = $module['min_ff_event_critical']; $ff_event_critical = $module['min_ff_event_critical'];
$ff_type = $module['ff_type'];
$each_ff = $module['each_ff']; $each_ff = $module['each_ff'];
$ff_timeout = $module['ff_timeout']; $ff_timeout = $module['ff_timeout'];
// Select tag info. // Select tag info.
@ -393,6 +394,7 @@ if ($id_agent_module) {
$ff_event_normal = ''; $ff_event_normal = '';
$ff_event_warning = ''; $ff_event_warning = '';
$ff_event_critical = ''; $ff_event_critical = '';
$ff_type = 0;
$id_category = 0; $id_category = 0;

View File

@ -496,10 +496,28 @@ if (modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>'; $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); $table_simple->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy);
// FF stands for Flip-flop // FF stands for Flip-flop.
$table_simple->data[6][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true); $table_simple->data[6][0] = __('FF threshold').' ';
$table_simple->data[6][0] .= ui_print_help_icon('ff_threshold', true);
$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( $table_simple->data[6][1] .= html_print_input_text(
'ff_event', 'ff_event',
$ff_event, $ff_event,
@ -512,7 +530,16 @@ $table_simple->data[6][1] .= html_print_input_text(
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
).'<br />'; ).'<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] .= __('To normal');
$table_simple->data[6][1] .= html_print_input_text( $table_simple->data[6][1] .= html_print_input_text(
'ff_event_normal', 'ff_event_normal',
@ -526,6 +553,7 @@ $table_simple->data[6][1] .= html_print_input_text(
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
).' '; ).' ';
$table_simple->data[6][1] .= __('To warning'); $table_simple->data[6][1] .= __('To warning');
$table_simple->data[6][1] .= html_print_input_text( $table_simple->data[6][1] .= html_print_input_text(
'ff_event_warning', 'ff_event_warning',
@ -539,6 +567,7 @@ $table_simple->data[6][1] .= html_print_input_text(
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
).' '; ).' ';
$table_simple->data[6][1] .= __('To critical'); $table_simple->data[6][1] .= __('To critical');
$table_simple->data[6][1] .= html_print_input_text( $table_simple->data[6][1] .= html_print_input_text(
'ff_event_critical', 'ff_event_critical',
@ -552,16 +581,31 @@ $table_simple->data[6][1] .= html_print_input_text(
'', '',
$classdisabledBecauseInPolicy $classdisabledBecauseInPolicy
); );
$table_simple->data[7][0] = __('Historical data'); $table_simple->data[7][0] = __('Historical data');
if ($disabledBecauseInPolicy) { 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 // If is disabled, we send a hidden in his place and print a false
$table_simple->data[7][1] = html_print_checkbox('history_data_fake', 1, $history_data, true, $disabledBecauseInPolicy); // 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.'">'; $table_simple->data[7][1] .= '<input type="hidden" name="history_data" value="'.(int) $history_data.'">';
} else { } 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 = new stdClass();
$table_advanced->id = 'advanced'; $table_advanced->id = 'advanced';
$table_advanced->width = '100%'; $table_advanced->width = '100%';

View File

@ -844,20 +844,122 @@ $table->data['edit1'][1] = '<table width="100%">';
$table->data['edit6'][3] = html_print_extended_select_for_unit('unit', '-1', '', '', '0', '15', true, false, false, false, 1); $table->data['edit6'][3] = html_print_extended_select_for_unit('unit', '-1', '', '', '0', '15', true, false, false, false, 1);
// FF stands for Flip-flop // FF stands for Flip-flop.
$table->data['edit7'][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true); $table->data['edit7'][0] = __('FF threshold').' ';
$table->data['edit7'][0] .= ui_print_help_icon(
'ff_threshold',
true
);
$table->colspan['edit7'][1] = 3; $table->colspan['edit7'][1] = 3;
$table->data['edit7'][1] = __('Mode').' '.html_print_select(['' => __('No change'), '1' => __('Each state changing'), '0' => __('All state changing')], 'each_ff', '', '', '', '', true).'<br />'; $table->data['edit7'][1] = __('Mode').' ';
$table->data['edit7'][1] .= __('All state changing').' : '.html_print_input_text('min_ff_event', '', '', 5, 15, true).'<br />'; $table->data['edit7'][1] .= html_print_select(
[
'' => __('No change'),
'1' => __('Each state changing'),
'0' => __('All state changing'),
],
'each_ff',
'',
'',
'',
'',
true,
false,
true,
'',
false,
'width: 400px;'
).'<br />';
$table->data['edit7'][1] .= __('All state changing').' : ';
$table->data['edit7'][1] .= html_print_input_text(
'min_ff_event',
'',
'',
5,
15,
true
).'<br />';
$table->data['edit7'][1] .= __('Each state changing').' : '; $table->data['edit7'][1] .= __('Each state changing').' : ';
$table->data['edit7'][1] .= __('To normal').html_print_input_text('min_ff_event_normal', '', '', 5, 15, true).' '; $table->data['edit7'][1] .= __('To normal').' ';
$table->data['edit7'][1] .= __('To warning').html_print_input_text('min_ff_event_warning', '', '', 5, 15, true).' '; $table->data['edit7'][1] .= html_print_input_text(
$table->data['edit7'][1] .= __('To critical').html_print_input_text('min_ff_event_critical', '', '', 5, 15, true).' '; 'min_ff_event_normal',
'',
'',
5,
15,
true
).' ';
$table->data['edit7'][1] .= __('To warning').' ';
$table->data['edit7'][1] .= html_print_input_text(
'min_ff_event_warning',
'',
'',
5,
15,
true
).' ';
$table->data['edit7'][1] .= __('To critical').' ';
$table->data['edit7'][1] .= html_print_input_text(
'min_ff_event_critical',
'',
'',
5,
15,
true
).'<br>';
$table->data['edit7'][1] .= __('Keep counters').' ';
$table->data['edit7'][1] .= html_print_select(
[
'' => __('No change'),
'1' => __('Active Counters'),
'0' => __('Inactive Counters'),
],
'ff_type',
'',
'',
'',
'',
true,
false,
true,
'',
false,
'width: 400px;'
);
$table->data['edit8'][0] = __('FF interval'); $table->data['edit8'][0] = __('FF interval');
$table->data['edit8'][1] = html_print_input_text('module_ff_interval', '', '', 5, 10, true).ui_print_help_tip(__('Module execution flip flop time interval (in secs).'), true); $table->data['edit8'][1] = html_print_input_text(
'module_ff_interval',
'',
'',
5,
10,
true
);
$table->data['edit8'][1] .= ui_print_help_tip(
__('Module execution flip flop time interval (in secs).'),
true
);
$table->data['edit8'][2] = __('FF timeout'); $table->data['edit8'][2] = __('FF timeout');
$table->data['edit8'][3] = html_print_input_text('ff_timeout', '', '', 5, 10, true).ui_print_help_tip(__('Timeout in secs from start of flip flop counting. If this value is exceeded, FF counter is reset. Set to 0 for no timeout.'), true); $table->data['edit8'][3] = html_print_input_text(
'ff_timeout',
'',
'',
5,
10,
true
);
$table->data['edit8'][3] .= ui_print_help_tip(
__('Timeout in secs from start of flip flop counting. If this value is exceeded, FF counter is reset. Set to 0 for no timeout.'),
true
);
$table->data['edit9'][0] = __('Historical data'); $table->data['edit9'][0] = __('Historical data');
$table->data['edit9'][1] = html_print_select(['' => __('No change'), '1' => __('Yes'), '0' => __('No')], 'history_data', '', '', '', '', true); $table->data['edit9'][1] = html_print_select(['' => __('No change'), '1' => __('Yes'), '0' => __('No')], 'history_data', '', '', '', '', true);
@ -1685,7 +1787,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
$agents_select = [$agents_select]; $agents_select = [$agents_select];
} }
// List of fields which can be updated // List of fields which can be updated.
$fields = [ $fields = [
'dynamic_interval', 'dynamic_interval',
'dynamic_max', 'dynamic_max',
@ -1730,6 +1832,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
'min_ff_event_normal', 'min_ff_event_normal',
'min_ff_event_warning', 'min_ff_event_warning',
'min_ff_event_critical', 'min_ff_event_critical',
'ff_type',
'each_ff', 'each_ff',
'module_ff_interval', 'module_ff_interval',
'ff_timeout', 'ff_timeout',

View File

@ -24,15 +24,15 @@ $menu_godmode['class'] = 'godmode';
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
$sub = []; $sub = [];
$sub['godmode/servers/discovery']['text'] = __('Discover'); $sub['godmode/servers/discovery']['text'] = __('Discovery');
$sub['godmode/servers/discovery']['id'] = 'Discover'; $sub['godmode/servers/discovery']['id'] = 'Discovery';
$sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery']; $sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery'];
// Add to menu. // Add to menu.
$menu_godmode['discover']['text'] = __('Discovery'); $menu_godmode['discovery']['text'] = __('Discovery');
$menu_godmode['discover']['sec2'] = 'godmode/servers/discovery'; $menu_godmode['discovery']['sec2'] = 'godmode/servers/discovery';
$menu_godmode['discover']['id'] = 'god-discovery'; $menu_godmode['discovery']['id'] = 'god-discovery';
$menu_godmode['discover']['sub'] = $sub; $menu_godmode['discovery']['sub'] = $sub;
} }
@ -225,15 +225,9 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, '
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
enterprise_hook('ha_cluster'); enterprise_hook('ha_cluster');
$sub['godmode/servers/manage_recontask']['text'] = __('Recon task');
$sub['godmode/servers/manage_recontask']['id'] = 'Recon task';
$sub['godmode/servers/plugin']['text'] = __('Plugins'); $sub['godmode/servers/plugin']['text'] = __('Plugins');
$sub['godmode/servers/plugin']['id'] = 'Plugins'; $sub['godmode/servers/plugin']['id'] = 'Plugins';
$sub['godmode/servers/recon_script']['text'] = __('Recon script');
$sub['godmode/servers/recon_script']['id'] = 'Recon script';
enterprise_hook('export_target_submenu'); enterprise_hook('export_target_submenu');
enterprise_hook('manage_satellite_submenu'); enterprise_hook('manage_satellite_submenu');

View File

@ -124,6 +124,7 @@ $pure = get_parameter('pure', 0);
$ff_event_normal = (int) get_parameter('ff_event_normal'); $ff_event_normal = (int) get_parameter('ff_event_normal');
$ff_event_warning = (int) get_parameter('ff_event_warning'); $ff_event_warning = (int) get_parameter('ff_event_warning');
$ff_event_critical = (int) get_parameter('ff_event_critical'); $ff_event_critical = (int) get_parameter('ff_event_critical');
$ff_type = (int) get_parameter('ff_type');
$each_ff = (int) get_parameter('each_ff'); $each_ff = (int) get_parameter('each_ff');
if (count($id_tag_selected) == 1 && empty($id_tag_selected[0])) { if (count($id_tag_selected) == 1 && empty($id_tag_selected[0])) {
@ -261,6 +262,7 @@ if ($create_component) {
'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_normal' => $ff_event_normal,
'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical, 'min_ff_event_critical' => $ff_event_critical,
'ff_type' => $ff_type,
'each_ff' => $each_ff, 'each_ff' => $each_ff,
] ]
); );
@ -355,6 +357,7 @@ if ($update_component) {
'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_normal' => $ff_event_normal,
'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical, 'min_ff_event_critical' => $ff_event_critical,
'ff_type' => $ff_type,
'each_ff' => $each_ff, 'each_ff' => $each_ff,
] ]
); );
@ -496,6 +499,7 @@ $url = ui_get_url_refresh(
'ff_event_warning' => false, 'ff_event_warning' => false,
'ff_event_critical' => false, 'ff_event_critical' => false,
'each_ff' => false, 'each_ff' => false,
'ff_type' => false,
] ]
); );

View File

@ -76,6 +76,7 @@ if ($create_network_from_module) {
$ff_event_normal = $data_module['min_ff_event_normal']; $ff_event_normal = $data_module['min_ff_event_normal'];
$ff_event_warning = $data_module['min_ff_event_warning']; $ff_event_warning = $data_module['min_ff_event_warning'];
$ff_event_critical = $data_module['min_ff_event_critical']; $ff_event_critical = $data_module['min_ff_event_critical'];
$ff_type = $data_module['ff_type'];
$each_ff = $data_module['each_ff']; $each_ff = $data_module['each_ff'];
} }
@ -134,6 +135,7 @@ if (isset($id)) {
$ff_event_normal = $component['min_ff_event_normal']; $ff_event_normal = $component['min_ff_event_normal'];
$ff_event_warning = $component['min_ff_event_warning']; $ff_event_warning = $component['min_ff_event_warning'];
$ff_event_critical = $component['min_ff_event_critical']; $ff_event_critical = $component['min_ff_event_critical'];
$ff_type = $component['ff_type'];
$each_ff = $component['each_ff']; $each_ff = $component['each_ff'];
if ($type >= 15 && $type <= 18) { if ($type >= 15 && $type <= 18) {
@ -192,6 +194,7 @@ if (isset($id)) {
$ff_event_normal = 0; $ff_event_normal = 0;
$ff_event_warning = 0; $ff_event_warning = 0;
$ff_event_critical = 0; $ff_event_critical = 0;
$ff_type = 0;
$each_ff = 0; $each_ff = 0;
$snmp_version = 1; $snmp_version = 1;

View File

@ -233,7 +233,23 @@ $table->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inver
$table->data[6][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true); $table->data[6][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true);
$table->colspan[6][1] = 3; $table->colspan[6][1] = 3;
$table->data[6][1] = html_print_radio_button('each_ff', 0, '', $each_ff, true).' '.__('All state changing').' : ';
$table->data[6][1] = __('Keep counters');
$table->data[6][1] .= html_print_checkbox(
'ff_type',
1,
$ff_type,
true
).'<br />';
$table->data[6][1] .= html_print_radio_button(
'each_ff',
0,
'',
$each_ff,
true
).' '.__('All state changing').' : ';
$table->data[6][1] .= html_print_input_text( $table->data[6][1] .= html_print_input_text(
'ff_event', 'ff_event',
$ff_event, $ff_event,
@ -242,13 +258,40 @@ $table->data[6][1] .= html_print_input_text(
15, 15,
true true
).'<br />'; ).'<br />';
$table->data[6][1] .= html_print_radio_button('each_ff', 1, '', $each_ff, true).' '.__('Each state changing').' : '; $table->data[6][1] .= html_print_radio_button(
'each_ff',
1,
'',
$each_ff,
true
).' '.__('Each state changing').' : ';
$table->data[6][1] .= __('To normal'); $table->data[6][1] .= __('To normal');
$table->data[6][1] .= html_print_input_text('ff_event_normal', $ff_event_normal, '', 5, 15, true).' '; $table->data[6][1] .= html_print_input_text(
'ff_event_normal',
$ff_event_normal,
'',
5,
15,
true
).' ';
$table->data[6][1] .= __('To warning'); $table->data[6][1] .= __('To warning');
$table->data[6][1] .= html_print_input_text('ff_event_warning', $ff_event_warning, '', 5, 15, true).' '; $table->data[6][1] .= html_print_input_text(
'ff_event_warning',
$ff_event_warning,
'',
5,
15,
true
).' ';
$table->data[6][1] .= __('To critical'); $table->data[6][1] .= __('To critical');
$table->data[6][1] .= html_print_input_text('ff_event_critical', $ff_event_critical, '', 5, 15, true); $table->data[6][1] .= html_print_input_text(
'ff_event_critical',
$ff_event_critical,
'',
5,
15,
true
);
$table->data[7][0] = __('Historical data'); $table->data[7][0] = __('Historical data');
$table->data[7][1] = html_print_checkbox('history_data', 1, $history_data, true); $table->data[7][1] = html_print_checkbox('history_data', 1, $history_data, true);

View File

@ -85,7 +85,6 @@ if ($id) {
$dst_port = $filter['dst_port']; $dst_port = $filter['dst_port'];
$src_port = $filter['src_port']; $src_port = $filter['src_port'];
$aggregate = $filter['aggregate']; $aggregate = $filter['aggregate'];
$output = $filter['output'];
$advanced_filter = $filter['advanced_filter']; $advanced_filter = $filter['advanced_filter'];
} else { } else {
$name = ''; $name = '';
@ -94,8 +93,7 @@ if ($id) {
$ip_src = ''; $ip_src = '';
$dst_port = ''; $dst_port = '';
$src_port = ''; $src_port = '';
$aggregate = 'none'; $aggregate = 'dstip';
$output = 'bytes';
$advanced_filter = ''; $advanced_filter = '';
} }
@ -103,7 +101,6 @@ if ($update) {
$name = (string) get_parameter('name'); $name = (string) get_parameter('name');
$assign_group = (int) get_parameter('assign_group'); $assign_group = (int) get_parameter('assign_group');
$aggregate = get_parameter('aggregate', ''); $aggregate = get_parameter('aggregate', '');
$output = get_parameter('output', 'bytes');
$ip_dst = get_parameter('ip_dst', ''); $ip_dst = get_parameter('ip_dst', '');
$ip_src = get_parameter('ip_src', ''); $ip_src = get_parameter('ip_src', '');
$dst_port = get_parameter('dst_port', ''); $dst_port = get_parameter('dst_port', '');
@ -123,7 +120,6 @@ if ($update) {
'dst_port' => $dst_port, 'dst_port' => $dst_port,
'src_port' => $src_port, 'src_port' => $src_port,
'advanced_filter' => $advanced_filter, 'advanced_filter' => $advanced_filter,
'output' => $output,
]; ];
// Save filter args // Save filter args
@ -142,8 +138,7 @@ if ($update) {
if ($create) { if ($create) {
$name = (string) get_parameter('name'); $name = (string) get_parameter('name');
$assign_group = (int) get_parameter('assign_group'); $assign_group = (int) get_parameter('assign_group');
$aggregate = get_parameter('aggregate', 'none'); $aggregate = get_parameter('aggregate', 'dstip');
$output = get_parameter('output', 'bytes');
$ip_dst = get_parameter('ip_dst', ''); $ip_dst = get_parameter('ip_dst', '');
$ip_src = get_parameter('ip_src', ''); $ip_src = get_parameter('ip_src', '');
$dst_port = get_parameter('dst_port', ''); $dst_port = get_parameter('dst_port', '');
@ -159,7 +154,6 @@ if ($create) {
'src_port' => $src_port, 'src_port' => $src_port,
'aggregate' => $aggregate, 'aggregate' => $aggregate,
'advanced_filter' => $advanced_filter, 'advanced_filter' => $advanced_filter,
'output' => $output,
]; ];
// Save filter args // Save filter args
@ -241,8 +235,6 @@ $table->data[7][1] = html_print_textarea('advanced_filter', 4, 40, $advanced_fil
$table->data[8][0] = '<b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true); $table->data[8][0] = '<b>'.__('Aggregate by').'</b>'.ui_print_help_icon('aggregate_by', true);
$aggregate_list = [ $aggregate_list = [
'none' => __('None'),
'proto' => __('Protocol'),
'srcip' => __('Src Ip Address'), 'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'), 'dstip' => __('Dst Ip Address'),
'srcport' => __('Src Port'), 'srcport' => __('Src Port'),
@ -251,15 +243,6 @@ $aggregate_list = [
$table->data[8][1] = html_print_select($aggregate_list, 'aggregate', $aggregate, '', '', 0, true, false, true, '', false); $table->data[8][1] = html_print_select($aggregate_list, 'aggregate', $aggregate, '', '', 0, true, false, true, '', false);
$table->data[9][0] = '<b>'.__('Output format').'</b>';
$show_output = [
'kilobytes' => __('Kilobytes'),
'megabytes' => __('Megabytes'),
'kilobytespersecond' => __('Kilobytes per second'),
'megabytespersecond' => __('Megabytes per second'),
];
$table->data[9][1] = html_print_select($show_output, 'output', $output, '', '', 0, true, false, true, '', false);
echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">'; echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">';
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';

View File

@ -110,7 +110,7 @@ $event_graph_validated_vs_unvalidated = false;
$netflow_filter = 0; $netflow_filter = 0;
$max_values = 0; $max_values = 0;
$resolution = 0; $resolution = NETFLOW_RES_MEDD;
$lapse_calc = 0; $lapse_calc = 0;
$lapse = 300; $lapse = 300;
@ -119,6 +119,20 @@ $visual_format = 0;
// Others // Others
$filter_search = ''; $filter_search = '';
// Added for select fields.
$total_time = true;
$time_failed = true;
$time_in_ok_status = true;
$time_in_unknown_status = true;
$time_of_not_initialized_module = true;
$time_of_downtime = true;
$total_checks = true;
$checks_failed = true;
$checks_in_ok_status = true;
$unknown_checks = true;
$agent_max_value = true;
$agent_min_value = true;
switch ($action) { switch ($action) {
case 'new': case 'new':
$actionParameter = 'save'; $actionParameter = 'save';
@ -450,6 +464,7 @@ switch ($action) {
case 'event_report_agent': case 'event_report_agent':
case 'event_report_group': case 'event_report_group':
$recursion = $item['recursion']; $recursion = $item['recursion'];
$include_extended_events = $item['show_extended_events'];
break; break;
case 'event_report_module': case 'event_report_module':
@ -471,6 +486,8 @@ switch ($action) {
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated']; $event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$filter_search = $style['event_filter_search']; $filter_search = $style['event_filter_search'];
$include_extended_events = $item['show_extended_events'];
break; break;
case 'general': case 'general':
@ -498,6 +515,18 @@ switch ($action) {
$sunday = $item['sunday']; $sunday = $item['sunday'];
$time_from = $item['time_from']; $time_from = $item['time_from'];
$time_to = $item['time_to']; $time_to = $item['time_to'];
$total_time = $item['total_time'];
$time_failed = $item['time_failed'];
$time_in_ok_status = $item['time_in_ok_status'];
$time_in_unknown_status = $item['time_in_unknown_status'];
$time_of_not_initialized_module = $item['time_of_not_initialized_module'];
$time_of_downtime = $item['time_of_downtime'];
$total_checks = $item['total_checks'];
$checks_failed = $item['checks_failed'];
$checks_in_ok_status = $item['checks_in_ok_status'];
$unknown_checks = $item['unknown_checks'];
$agent_max_value = $item['agent_max_value'];
$agent_min_value = $item['agent_min_value'];
break; break;
case 'group_report': case 'group_report':
@ -597,18 +626,22 @@ switch ($action) {
break; break;
case 'netflow_area': case 'netflow_area':
case 'netflow_pie':
case 'netflow_data': case 'netflow_data':
case 'netflow_statistics':
case 'netflow_summary': case 'netflow_summary':
$netflow_filter = $item['text']; $netflow_filter = $item['text'];
// Filter // Filter.
$period = $item['period']; $period = $item['period'];
$description = $item['description']; $description = $item['description'];
$resolution = $item['top_n']; $resolution = $item['top_n'];
// Interval resolution // Interval resolution.
$max_values = $item['top_n_value']; $max_values = $item['top_n_value'];
// Max values // Max values.
break;
case 'nt_top_n':
$period = $item['period'];
$description = $item['description'];
$top_n_value = $item['top_n_value'];
break; break;
} }
@ -635,6 +668,7 @@ switch ($action) {
case 'simple_baseline_graph': case 'simple_baseline_graph':
case 'event_report_log': case 'event_report_log':
case 'increment': case 'increment':
case 'nt_top_n':
$label = (isset($style['label'])) ? $style['label'] : ''; $label = (isset($style['label'])) ? $style['label'] : '';
break; break;
@ -837,7 +871,11 @@ $class = 'databox filters';
</td> </td>
<td style=""> <td style="">
<?php <?php
html_print_extended_select_for_time('resolution', $resolution, '', '', '0', 10); html_print_select(
netflow_resolution_select_params(),
'resolution',
$resolution
);
?> ?>
</td> </td>
</tr> </tr>
@ -1585,20 +1623,6 @@ $class = 'databox filters';
REPORT_EXCEPTION_CONDITION_NOT_OK => __('Not OK'), REPORT_EXCEPTION_CONDITION_NOT_OK => __('Not OK'),
]; ];
html_print_select($list_exception_condition, 'exception_condition', $exception_condition); html_print_select($list_exception_condition, 'exception_condition', $exception_condition);
/*
echo ;
html_print_radio_button ('radiobutton_exception_condition', 0, '', $exception_condition);
echo __('>=');
html_print_radio_button ('radiobutton_exception_condition', 1, '', $exception_condition);
echo __('<');
html_print_radio_button ('radiobutton_exception_condition', 2, '', $exception_condition);
echo __('OK');
html_print_radio_button ('radiobutton_exception_condition', 3, '', $exception_condition);
echo __('Not OK');
html_print_radio_button ('radiobutton_exception_condition', 4, '', $exception_condition);
*/
?> ?>
</td> </td>
</tr> </tr>
@ -1608,6 +1632,65 @@ $class = 'databox filters';
<td><?php html_print_select($show_graph_options, 'combo_graph_options', $show_graph); ?></td> <td><?php html_print_select($show_graph_options, 'combo_graph_options', $show_graph); ?></td>
</tr> </tr>
<tr id="row_select_fields" style="" class="datos">
<td style="font-weight:bold;margin-right:150px;">
<?php
echo __('Select fields to show');
?>
</td>
<td>
<table border="0">
<td>
<p style="margin-right:30px;">
<?php
echo __('Total time');
html_print_checkbox('total_time', 1, $total_time);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Time failed');
html_print_checkbox('time_failed', 1, $time_failed);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Time in OK status');
html_print_checkbox('time_in_ok_status', 1, $time_in_ok_status);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Time in unknown status');
html_print_checkbox('time_in_unknown_status', 1, $time_in_unknown_status);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Time of not initialized module');
html_print_checkbox('time_of_not_initialized_module', 1, $time_of_not_initialized_module);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Time of downtime');
html_print_checkbox('time_of_downtime', 1, $time_of_downtime);
?>
</p>
</td>
</table>
</td>
</tr>
<tr id="row_show_address_agent" style="" class="datos"> <tr id="row_show_address_agent" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
@ -1617,7 +1700,7 @@ $class = 'databox filters';
</td> </td>
<td> <td>
<?php <?php
html_print_checkbox( html_print_checkbox_switch(
'checkbox_show_address_agent', 'checkbox_show_address_agent',
1, 1,
$show_address_agent $show_address_agent
@ -1625,12 +1708,13 @@ $class = 'databox filters';
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_show_resume" style="" class="datos"> <tr id="row_show_resume" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Show resume').ui_print_help_tip(__('Show a summary chart with max, min and average number of total modules at the end of the report and Checks.'), true); ?></td> <td style="font-weight:bold;"><?php echo __('Show resume').ui_print_help_tip(__('Show a summary chart with max, min and average number of total modules at the end of the report and Checks.'), true); ?></td>
<td> <td>
<?php <?php
html_print_checkbox( html_print_checkbox_switch(
'checkbox_show_resume', 'checkbox_show_resume',
1, 1,
$show_resume $show_resume
@ -1638,6 +1722,78 @@ $class = 'databox filters';
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_select_fields2" style="" class="datos">
<td style="font-weight:bold;margin-right:150px;">
<?php
echo __('<p style= "margin-left:15px;">Select fields to show</p>');
?>
</td>
<td>
<table border="0">
<td>
<p style="margin-right:30px;">
<?php
echo __('Total checks');
html_print_checkbox('total_checks', 1, $total_checks);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Checks failed');
html_print_checkbox('checks_failed', 1, $checks_failed);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Checks in OK status');
html_print_checkbox('checks_in_ok_status', 1, $checks_in_ok_status);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Unknown checks');
html_print_checkbox('unknown_checks', 1, $unknown_checks);
?>
</p>
</td>
<td>
</table>
</td>
</tr>
<tr id="row_select_fields3" style="" class="datos">
<td style="font-weight:bold;margin-right:150px;">
<?php
echo __('<p style= "margin-left:15px;">Select fields to show</p>');
?>
</td>
<td>
<table border="0">
<td>
<p style="margin-right:30px;">
<?php
echo __('Agent max value');
html_print_checkbox('agent_max_value', 1, $agent_max_value);
?>
</p>
</td>
<td>
<p style="margin-right:30px;">
<?php
echo __('Agent min values');
html_print_checkbox('agent_min_value', 1, $agent_min_value);
?>
</p>
</td>
<td>
</table>
</td>
</tr>
<tr id="row_show_summary_group" style="" class="datos"> <tr id="row_show_summary_group" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Show Summary group'); ?></td> <td style="font-weight:bold;"><?php echo __('Show Summary group'); ?></td>
@ -1729,6 +1885,15 @@ $class = 'databox filters';
</td> </td>
</tr> </tr>
<tr id="row_extended_events" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Include extended events'); ?></td>
<td>
<?php
html_print_checkbox('include_extended_events', true, $include_extended_events);
?>
</td>
</tr>
<tr id="row_event_graphs" style="" class="datos"> <tr id="row_event_graphs" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Event graphs'); ?></td> <td style="font-weight:bold;"><?php echo __('Event graphs'); ?></td>
<td> <td>
@ -2604,6 +2769,17 @@ $(document).ready (function () {
} }
}); });
$("#checkbox-checkbox_show_resume").change(function(){
if($(this).is(":checked")){
$("#row_select_fields2").show();
$("#row_select_fields3").show();
}
else{
$("#row_select_fields2").hide();
$("#row_select_fields3").hide();
}
});
}); });
@ -3101,6 +3277,7 @@ function chooseType() {
$("#row_event_graph_by_user").hide(); $("#row_event_graph_by_user").hide();
$("#row_event_graph_by_criticity").hide(); $("#row_event_graph_by_criticity").hide();
$("#row_event_graph_by_validated").hide(); $("#row_event_graph_by_validated").hide();
$("#row_extended_events").hide();
$("#row_netflow_filter").hide(); $("#row_netflow_filter").hide();
$("#row_max_values").hide(); $("#row_max_values").hide();
$("#row_resolution").hide(); $("#row_resolution").hide();
@ -3117,6 +3294,9 @@ function chooseType() {
$("#row_event_type").hide(); $("#row_event_type").hide();
$("#row_event_status").hide(); $("#row_event_status").hide();
$("#row_source").hide(); $("#row_source").hide();
$('#row_select_fields').hide();
$("#row_select_fields2").hide();
$("#row_select_fields3").hide();
// SLA list default state // SLA list default state
$("#sla_list").hide(); $("#sla_list").hide();
@ -3144,6 +3324,7 @@ function chooseType() {
$("#row_event_graph_by_user").show(); $("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show(); $("#row_event_graph_by_criticity").show();
$("#row_event_graph_by_validated").show(); $("#row_event_graph_by_validated").show();
$("#row_extended_events").show();
$("#row_filter_search").show(); $("#row_filter_search").show();
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
@ -3444,6 +3625,7 @@ function chooseType() {
$("#row_event_graph_by_criticity").show(); $("#row_event_graph_by_criticity").show();
$("#row_event_graph_by_validated").show(); $("#row_event_graph_by_validated").show();
$("#row_event_type").show(); $("#row_event_type").show();
$("#row_extended_events").show();
$("#row_filter_search").show(); $("#row_filter_search").show();
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
@ -3459,7 +3641,8 @@ function chooseType() {
$("#row_show_summary_group").show(); $("#row_show_summary_group").show();
$("#row_event_graphs").show(); $("#row_event_graphs").show();
$("#row_event_type").show(); $("#row_event_type").show();
$("#row_extended_events").show();
$("#row_extended_events").show();
$("#row_event_graph_by_user").show(); $("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show(); $("#row_event_graph_by_criticity").show();
@ -3482,6 +3665,7 @@ function chooseType() {
$("#row_show_summary_group").show(); $("#row_show_summary_group").show();
$("#row_event_graphs").show(); $("#row_event_graphs").show();
$("#row_event_type").show(); $("#row_event_type").show();
$("#row_extended_events").show();
$("#row_event_graph_by_user").show(); $("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show(); $("#row_event_graph_by_criticity").show();
@ -3521,6 +3705,15 @@ function chooseType() {
$("#row_show_resume").show(); $("#row_show_resume").show();
$("#row_working_time").show(); $("#row_working_time").show();
$('#row_hide_notinit_agents').show(); $('#row_hide_notinit_agents').show();
$('#row_select_fields').show();
if($("#checkbox-checkbox_show_resume").is(":checked")){
$("#row_select_fields2").show();
$("#row_select_fields3").show();
}
else{
$("#row_select_fields2").hide();
$("#row_select_fields3").hide();
}
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
@ -3656,16 +3849,6 @@ function chooseType() {
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
case 'netflow_pie':
$("#row_netflow_filter").show();
$("#row_description").show();
$("#row_period").show();
$("#row_max_values").show();
$("#row_resolution").show();
$("#row_servers").show();
$("#row_historical_db_check").hide();
break;
case 'netflow_data': case 'netflow_data':
$("#row_netflow_filter").show(); $("#row_netflow_filter").show();
$("#row_description").show(); $("#row_description").show();
@ -3677,15 +3860,6 @@ function chooseType() {
break; break;
case 'netflow_summary': case 'netflow_summary':
$("#row_netflow_filter").show();
$("#row_description").show();
$("#row_period").show();
$("#row_resolution").show();
$("#row_servers").show();
$("#row_historical_db_check").hide();
break;
case 'netflow_statistics':
$("#row_netflow_filter").show(); $("#row_netflow_filter").show();
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period").show();
@ -3694,6 +3868,12 @@ function chooseType() {
$("#row_servers").show(); $("#row_servers").show();
$("#row_historical_db_check").hide(); $("#row_historical_db_check").hide();
break; break;
case 'nt_top_n':
$("#row_description").show();
$("#row_period").show();
$("#row_quantity").show();
break;
} }
switch (type) { switch (type) {
case 'event_report_agent': case 'event_report_agent':

View File

@ -70,7 +70,7 @@ global $config;
// IMPORTANT NOTE: All reporting pages are used also for metaconsole reporting functionality // IMPORTANT NOTE: All reporting pages are used also for metaconsole reporting functionality
// So, it's very important to specify full url and paths to resources because metaconsole has a different // So, it's very important to specify full url and paths to resources because metaconsole has a different
// entry point: enterprise/meta/index.php than normal console !!! // entry point: enterprise/meta/index.php than normal console !!!
// Login check // Login check.
check_login(); check_login();
enterprise_hook('open_meta_frame'); enterprise_hook('open_meta_frame');
@ -89,7 +89,7 @@ if (!$report_r && !$report_w && !$report_m) {
require_once $config['homedir'].'/include/functions_reports.php'; require_once $config['homedir'].'/include/functions_reports.php';
// Load enterprise extensions // Load enterprise extensions.
enterprise_include('operation/reporting/custom_reporting.php'); enterprise_include('operation/reporting/custom_reporting.php');
enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_metaconsole.php');
@ -98,7 +98,7 @@ if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NO
$enterpriseEnable = true; $enterpriseEnable = true;
} }
// Constant with fonts directory // Constant with fonts directory.
define('_MPDF_TTFONTPATH', 'include/fonts/'); define('_MPDF_TTFONTPATH', 'include/fonts/');
$activeTab = get_parameter('tab', 'main'); $activeTab = get_parameter('tab', 'main');
@ -117,10 +117,10 @@ if ($schedule_report != '') {
$date = date(DATE_FORMAT); $date = date(DATE_FORMAT);
$time = date(TIME_FORMAT); $time = date(TIME_FORMAT);
$parameters[0] = get_parameter('id_schedule_report'); $parameters[0] = get_parameter('id_schedule_report');
// $parameters[1] = db_get_value('schedule_email', 'treport', 'id_report', $id_report);
$parameters[1] = get_parameter('schedule_email_address'); $parameters[1] = get_parameter('schedule_email_address');
$parameters[2] = get_parameter('schedule_subject', ''); $parameters[2] = get_parameter('schedule_subject', '');
$parameters[3] = get_parameter('schedule_email', ''); $parameters[3] = get_parameter('schedule_email', '');
$parameters[4] = get_parameter('report_type', '');
$parameters['first_execution'] = strtotime($date.' '.$time); $parameters['first_execution'] = strtotime($date.' '.$time);
$values = [ $values = [
@ -141,7 +141,7 @@ if ($schedule_report != '') {
echo '<br>'; echo '<br>';
} }
// Other Checks for the edit the reports // Other Checks for the edit the reports.
if ($idReport != 0) { if ($idReport != 0) {
$report = db_get_row_filter('treport', ['id_report' => $idReport]); $report = db_get_row_filter('treport', ['id_report' => $idReport]);
$type_access_selected = reports_get_type_access($report); $type_access_selected = reports_get_type_access($report);
@ -162,6 +162,10 @@ if ($idReport != 0) {
$edit = true; $edit = true;
} }
break; break;
default:
// Default.
break;
} }
if (! $edit) { if (! $edit) {
@ -227,6 +231,10 @@ switch ($action) {
ORDER BY "order"' ORDER BY "order"'
); );
break; break;
default:
// Default.
break;
} }
if ($items === false) { if ($items === false) {
@ -234,7 +242,7 @@ switch ($action) {
} }
// Clean the repeated order values // Clean the repeated order values.
$order_temp = 1; $order_temp = 1;
foreach ($items as $item) { foreach ($items as $item) {
switch ($config['dbtype']) { switch ($config['dbtype']) {
@ -254,6 +262,10 @@ switch ($action) {
['id_rc' => $item['id_rc']] ['id_rc' => $item['id_rc']]
); );
break; break;
default:
// Default.
break;
} }
$order_temp++; $order_temp++;
@ -281,6 +293,10 @@ switch ($action) {
ORDER BY "order"' ORDER BY "order"'
); );
break; break;
default:
// Default.
break;
} }
if ($items === false) { if ($items === false) {
@ -293,7 +309,7 @@ switch ($action) {
$temp = []; $temp = [];
foreach ($items as $item) { foreach ($items as $item) {
// Remove the contents from the block to sort // Remove the contents from the block to sort.
if (array_search($item['id_rc'], $ids) === false) { if (array_search($item['id_rc'], $ids) === false) {
$temp[$item['order']] = $item['id_rc']; $temp[$item['order']] = $item['id_rc'];
} }
@ -344,6 +360,10 @@ switch ($action) {
['id_rc' => $id] ['id_rc' => $id]
); );
break; break;
default:
// Default.
break;
} }
} }
@ -415,6 +435,10 @@ switch ($action) {
} }
} }
break; break;
default:
// Default.
break;
} }
} }
break; break;
@ -444,9 +468,9 @@ switch ($action) {
break; break;
} }
// Page header for metaconsole // Page header for metaconsole.
if ($enterpriseEnable and defined('METACONSOLE')) { if ($enterpriseEnable && defined('METACONSOLE')) {
// Bread crumbs // Bread crumbs.
ui_meta_add_breadcrumb( ui_meta_add_breadcrumb(
[ [
'link' => 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure, 'link' => 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure,
@ -456,10 +480,11 @@ switch ($action) {
ui_meta_print_page_header($nav_bar); ui_meta_print_page_header($nav_bar);
// Print header // Print header.
ui_meta_print_header(__('Reporting'), '', $buttons); ui_meta_print_header(__('Reporting'), '', $buttons);
} }
// Page header for normal console
// Page header for normal console.
else { else {
ui_print_page_header(__('Custom reporting'), 'images/op_reporting.png', false, '', false, $buttons, false, '', 60); ui_print_page_header(__('Custom reporting'), 'images/op_reporting.png', false, '', false, $buttons, false, '', 60);
} }
@ -471,7 +496,7 @@ switch ($action) {
case 'group_view': case 'group_view':
if ($config['id_user'] == $report['id_user'] || is_user_admin($config['id_user'])) { if ($config['id_user'] == $report['id_user'] || is_user_admin($config['id_user'])) {
$delete = true; $delete = true;
// owner can delete // Owner can delete.
} else { } else {
$delete = check_acl( $delete = check_acl(
$config['id_user'], $config['id_user'],
@ -484,7 +509,7 @@ switch ($action) {
case 'group_edit': case 'group_edit':
if ($config['id_user'] == $report['id_user'] || is_user_admin($config['id_user'])) { if ($config['id_user'] == $report['id_user'] || is_user_admin($config['id_user'])) {
$delete = true; $delete = true;
// owner can delete // Owner can delete.
} else { } else {
$delete = check_acl( $delete = check_acl(
$config['id_user'], $config['id_user'],
@ -501,6 +526,10 @@ switch ($action) {
$delete = true; $delete = true;
} }
break; break;
default:
// Default.
break;
} }
if (! $delete) { if (! $delete) {
@ -571,7 +600,7 @@ switch ($action) {
ui_require_jquery_file('bgiframe'); ui_require_jquery_file('bgiframe');
ui_require_jquery_file('autocomplete'); ui_require_jquery_file('autocomplete');
// Show only selected groups // Show only selected groups.
if ($id_group > 0) { if ($id_group > 0) {
$group = ["$id_group" => $id_group]; $group = ["$id_group" => $id_group];
} else { } else {
@ -595,7 +624,7 @@ switch ($action) {
} }
// Fix : group filter was not working // Fix : group filter was not working
// Show only selected groups // Show only selected groups.
if ($id_group > 0) { if ($id_group > 0) {
$group = ["$id_group" => $id_group]; $group = ["$id_group" => $id_group];
$filter['id_group'] = $id_group; $filter['id_group'] = $id_group;
@ -603,8 +632,8 @@ switch ($action) {
$group = false; $group = false;
} }
// Filter normal and metaconsole reports // Filter normal and metaconsole reports.
if ($config['metaconsole'] == 1 and defined('METACONSOLE')) { if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
$filter['metaconsole'] = 1; $filter['metaconsole'] = 1;
} else { } else {
$filter['metaconsole'] = 0; $filter['metaconsole'] = 0;
@ -670,12 +699,12 @@ switch ($action) {
$table->size['csv'] = '5%'; $table->size['csv'] = '5%';
$next = 4; $next = 4;
// Calculate dinamically the number of the column // Calculate dinamically the number of the column.
if (enterprise_hook('load_custom_reporting_1') !== ENTERPRISE_NOT_HOOK) { if (enterprise_hook('load_custom_reporting_1') !== ENTERPRISE_NOT_HOOK) {
$next = 7; $next = 7;
} }
// Admin options only for RM flag // Admin options only for RM flag.
if (check_acl($config['id_user'], 0, 'RM')) { if (check_acl($config['id_user'], 0, 'RM')) {
$table->head[$next] = __('Private'); $table->head[$next] = __('Private');
$table->size[$next] = '2%'; $table->size[$next] = '2%';
@ -743,7 +772,7 @@ switch ($action) {
$data[1] = ui_print_truncate_text($report['description'], 70); $data[1] = ui_print_truncate_text($report['description'], 70);
// Remove html and xml button if items are larger than limit // Remove html and xml button if items are larger than limit.
$item_count = db_get_num_rows('SELECT * FROM treport_content WHERE id_report='.$report['id_report']); $item_count = db_get_num_rows('SELECT * FROM treport_content WHERE id_report='.$report['id_report']);
$report['overload'] = $item_count >= $config['report_limit']; $report['overload'] = $item_count >= $config['report_limit'];
if ($report['overload']) { if ($report['overload']) {
@ -752,7 +781,7 @@ switch ($action) {
} else if (!$report['non_interactive']) { } else if (!$report['non_interactive']) {
$data[2] = '<a href="'.$config['homeurl'].'index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'&pure='.$pure.'">'.html_print_image('images/html.png', true, ['title' => __('HTML view')]).'</a>'; $data[2] = '<a href="'.$config['homeurl'].'index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'&pure='.$pure.'">'.html_print_image('images/html.png', true, ['title' => __('HTML view')]).'</a>';
$data[3] = '<a href="'.ui_get_full_url(false, false, false, false).'ajax.php?page='.$config['homedir'].'/operation/reporting/reporting_xml&id='.$report['id_report'].'">'.html_print_image('images/xml.png', true, ['title' => __('Export to XML')]).'</a>'; $data[3] = '<a href="'.ui_get_full_url(false, false, false, false).'ajax.php?page='.$config['homedir'].'/operation/reporting/reporting_xml&id='.$report['id_report'].'">'.html_print_image('images/xml.png', true, ['title' => __('Export to XML')]).'</a>';
// I chose ajax.php because it's supposed to give XML anyway // I chose ajax.php because it's supposed to give XML anyway.
} else { } else {
$data[2] = html_print_image( $data[2] = html_print_image(
'images/html_disabled.png', 'images/html_disabled.png',
@ -765,14 +794,14 @@ switch ($action) {
} }
// Calculate dinamically the number of the column // Calculate dinamically the number of the column.
$next = 4; $next = 4;
if (enterprise_hook('load_custom_reporting_2') !== ENTERPRISE_NOT_HOOK) { if (enterprise_hook('load_custom_reporting_2') !== ENTERPRISE_NOT_HOOK) {
$next = 7; $next = 7;
} }
// Admin options only for RM flag // Admin options only for RM flag.
if (check_acl($config['id_user'], 0, 'RM')) { if (check_acl($config['id_user'], 0, 'RM')) {
if ($report['private'] == 1) { if ($report['private'] == 1) {
$data[$next] = __('Yes'); $data[$next] = __('Yes');
@ -820,6 +849,10 @@ switch ($action) {
$delete = true; $delete = true;
} }
break; break;
default:
// Default.
break;
} }
if ($edit || $delete) { if ($edit || $delete) {
@ -915,7 +948,6 @@ switch ($action) {
} }
enterprise_hook('close_meta_frame'); enterprise_hook('close_meta_frame');
return; return;
break; break;
@ -943,6 +975,10 @@ switch ($action) {
$idGroupReport = $report['id_group']; $idGroupReport = $report['id_group'];
$description = $report['description']; $description = $report['description'];
break; break;
default:
// Default.
break;
} }
break; break;
@ -976,6 +1012,10 @@ switch ($action) {
$id_group_edit = 0; $id_group_edit = 0;
$private = 1; $private = 1;
break; break;
default:
// Default.
break;
} }
if ($action == 'update') { if ($action == 'update') {
@ -1026,10 +1066,10 @@ switch ($action) {
$action = 'edit'; $action = 'edit';
} else if ($action == 'save') { } else if ($action == 'save') {
if ($reportName != '' && $idGroupReport != '') { if ($reportName != '' && $idGroupReport != '') {
// This flag allow to differentiate between normal console and metaconsole reports // This flag allow to differentiate between normal console and metaconsole reports.
$metaconsole_report = (int) is_metaconsole(); $metaconsole_report = (int) is_metaconsole();
// Juanma (07/05/2014) New feature: Custom front page for reports // Juanma (07/05/2014) New feature: Custom front page for reports.
if ($config['custom_report_front']) { if ($config['custom_report_front']) {
$custom_font = $config['custom_report_front_font']; $custom_font = $config['custom_report_front_font'];
$logo = $config['custom_report_front_logo']; $logo = $config['custom_report_front_logo'];
@ -1098,7 +1138,6 @@ switch ($action) {
$good_format = false; $good_format = false;
switch ($action) { switch ($action) {
case 'update': case 'update':
$values = []; $values = [];
$values['id_report'] = $idReport; $values['id_report'] = $idReport;
// --------------------------------------------------- // ---------------------------------------------------
@ -1132,7 +1171,6 @@ switch ($action) {
break; break;
case 'event_report_log': case 'event_report_log':
$agents_to_report = get_parameter('id_agents3'); $agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', ''); $source = get_parameter('source', '');
$search = get_parameter('search', ''); $search = get_parameter('search', '');
@ -1154,7 +1192,7 @@ switch ($action) {
$values['top_n_value'] = get_parameter('quantity'); $values['top_n_value'] = get_parameter('quantity');
$interval_max = get_parameter('max_interval'); $interval_max = get_parameter('max_interval');
$interval_min = get_parameter('min_interval'); $interval_min = get_parameter('min_interval');
// Checks intervals fields // Checks intervals fields.
if (preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_max) and preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_min)) { if (preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_max) and preg_match('/^(\-)*[0-9]*\.?[0-9]+$/', $interval_min)) {
$good_format = true; $good_format = true;
} }
@ -1209,9 +1247,7 @@ switch ($action) {
break; break;
case 'netflow_area': case 'netflow_area':
case 'netflow_pie':
case 'netflow_data': case 'netflow_data':
case 'netflow_statistics':
case 'netflow_summary': case 'netflow_summary':
$values['text'] = get_parameter('netflow_filter'); $values['text'] = get_parameter('netflow_filter');
$values['description'] = get_parameter('description'); $values['description'] = get_parameter('description');
@ -1223,9 +1259,21 @@ switch ($action) {
case 'availability': case 'availability':
// HACK it is saved in show_graph field. // HACK it is saved in show_graph field.
// Show interfaces instead the modules // Show interfaces instead the modules.
$values['show_graph'] = get_parameter('checkbox_show_address_agent'); $values['show_graph'] = get_parameter('checkbox_show_address_agent');
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['total_time'] = get_parameter('total_time');
$values['time_failed'] = get_parameter('time_failed');
$values['time_in_ok_status'] = get_parameter('time_in_ok_status');
$values['time_in_unknown_status'] = get_parameter('time_in_unknown_status');
$values['time_of_not_initialized_module'] = get_parameter('time_of_not_initialized_module');
$values['time_of_downtime'] = get_parameter('time_of_downtime');
$values['total_checks'] = get_parameter('total_checks');
$values['checks_failed'] = get_parameter('checks_failed');
$values['checks_in_ok_status'] = get_parameter('checks_in_ok_status');
$values['unknown_checks'] = get_parameter('unknown_checks');
$values['agent_max_value'] = get_parameter('agent_max_value');
$values['agent_min_value'] = get_parameter('agent_min_value');
$good_format = true; $good_format = true;
break; break;
@ -1247,6 +1295,12 @@ switch ($action) {
$good_format = true; $good_format = true;
break; break;
case 'nt_top_n':
$values['period'] = get_parameter('period');
$values['top_n_value'] = get_parameter('quantity');
$good_format = true;
break;
default: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg', 0); $values['top_n'] = get_parameter('radiobutton_max_min_avg', 0);
@ -1254,6 +1308,7 @@ switch ($action) {
$values['text'] = get_parameter('text'); $values['text'] = get_parameter('text');
$values['show_graph'] = get_parameter('combo_graph_options'); $values['show_graph'] = get_parameter('combo_graph_options');
$good_format = true; $good_format = true;
break;
} }
$values['id_agent'] = get_parameter('id_agent'); $values['id_agent'] = get_parameter('id_agent');
@ -1278,6 +1333,19 @@ switch ($action) {
$values['friday'] = get_parameter('friday', 0); $values['friday'] = get_parameter('friday', 0);
$values['saturday'] = get_parameter('saturday', 0); $values['saturday'] = get_parameter('saturday', 0);
$values['sunday'] = get_parameter('sunday', 0); $values['sunday'] = get_parameter('sunday', 0);
$values['total_time'] = get_parameter('total_time', 0);
$values['time_failed'] = get_parameter('time_failed', 0);
$values['time_in_ok_status'] = get_parameter('time_in_ok_status', 0);
$values['time_in_unknown_status'] = get_parameter('time_in_unknown_status', 0);
$values['time_of_not_initialized_module'] = get_parameter('time_of_not_initialized_module', 0);
$values['time_of_downtime'] = get_parameter('time_of_downtime', 0);
$values['total_checks'] = get_parameter('total_checks', 0);
$values['checks_failed'] = get_parameter('checks_failed', 0);
$values['checks_in_ok_status'] = get_parameter('checks_in_ok_status', 0);
$values['unknown_checks'] = get_parameter('unknown_checks', 0);
$values['agent_max_value'] = get_parameter('agent_max_value', 0);
$values['agent_min_value'] = get_parameter('agent_min_value', 0);
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
@ -1289,6 +1357,10 @@ switch ($action) {
$values['time_from'] = '#to_date(\''.get_parameter('time_from').'\',\'hh24:mi:ss\')'; $values['time_from'] = '#to_date(\''.get_parameter('time_from').'\',\'hh24:mi:ss\')';
$values['time_to'] = '#to_date(\''.get_parameter('time_to').'\', \'hh24:mi:ss\')'; $values['time_to'] = '#to_date(\''.get_parameter('time_to').'\', \'hh24:mi:ss\')';
break; break;
default:
// Default.
break;
} }
$values['group_by_agent'] = get_parameter('checkbox_row_group_by_agent'); $values['group_by_agent'] = get_parameter('checkbox_row_group_by_agent');
@ -1309,7 +1381,7 @@ switch ($action) {
$values['server_name'] = get_parameter('combo_server'); $values['server_name'] = get_parameter('combo_server');
} }
if ((($values['type'] == 'custom_graph') or ($values['type'] == 'automatic_custom_graph')) && ($values['id_gs'] == 0 || $values['id_gs'] == '')) { if ((($values['type'] == 'custom_graph') || ($values['type'] == 'automatic_custom_graph')) && ($values['id_gs'] == 0 || $values['id_gs'] == '')) {
$resultOperationDB = false; $resultOperationDB = false;
break; break;
} }
@ -1326,7 +1398,7 @@ switch ($action) {
$event_filter_search = get_parameter('filter_search', ''); $event_filter_search = get_parameter('filter_search', '');
// If metaconsole is activated // If metaconsole is activated.
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) { if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
if (($values['type'] == 'custom_graph') or ($values['type'] == 'automatic_custom_graph')) { if (($values['type'] == 'custom_graph') or ($values['type'] == 'automatic_custom_graph')) {
$id_gs = substr($values['id_gs'], 0, strpos($values['id_gs'], '|')); $id_gs = substr($values['id_gs'], 0, strpos($values['id_gs'], '|'));
@ -1337,7 +1409,7 @@ switch ($action) {
} }
} }
// Get agent and server name // Get agent and server name.
$agent_name_server = io_safe_output(get_parameter('agent')); $agent_name_server = io_safe_output(get_parameter('agent'));
if (isset($agent_name_server)) { if (isset($agent_name_server)) {
@ -1347,7 +1419,7 @@ switch ($action) {
$server_name = substr($agent_name_server, $separator_pos); $server_name = substr($agent_name_server, $separator_pos);
$server_name = str_replace('(', '', $server_name); $server_name = str_replace('(', '', $server_name);
$server_name = str_replace(')', '', $server_name); $server_name = str_replace(')', '', $server_name);
// Will update server_name variable // Will update server_name variable.
$values['server_name'] = trim($server_name); $values['server_name'] = trim($server_name);
$agent_name = substr($agent_name_server, 0, $separator_pos); $agent_name = substr($agent_name_server, 0, $separator_pos);
} }
@ -1436,12 +1508,17 @@ switch ($action) {
case 'MTBF': case 'MTBF':
case 'MTTR': case 'MTTR':
case 'simple_baseline_graph': case 'simple_baseline_graph':
case 'nt_top_n':
if ($label != '') { if ($label != '') {
$style['label'] = $label; $style['label'] = $label;
} else { } else {
$style['label'] = ''; $style['label'] = '';
} }
break; break;
default:
// Default.
break;
} }
$values['style'] = io_safe_input(json_encode($style)); $values['style'] = io_safe_input(json_encode($style));
@ -1456,6 +1533,10 @@ switch ($action) {
unset($values['type']); unset($values['type']);
} }
break; break;
default:
// Default.
break;
} }
$resultOperationDB = db_process_sql_update( $resultOperationDB = db_process_sql_update(
@ -1477,7 +1558,7 @@ switch ($action) {
$values['description'] = get_parameter('description'); $values['description'] = get_parameter('description');
$label = get_parameter('label', ''); $label = get_parameter('label', '');
// Add macros name // Add macros name.
$items_label = []; $items_label = [];
$items_label['type'] = get_parameter('type'); $items_label['type'] = get_parameter('type');
$items_label['id_agent'] = get_parameter('id_agent'); $items_label['id_agent'] = get_parameter('id_agent');
@ -1487,7 +1568,7 @@ switch ($action) {
$values['name'] = reporting_label_macro($items_label, $name_it); $values['name'] = reporting_label_macro($items_label, $name_it);
// Support for projection graph, prediction date and SLA reports // Support for projection graph, prediction date and SLA reports
// 'top_n_value', 'top_n' and 'text' fields will be reused for these types of report // 'top_n_value', 'top_n' and 'text' fields will be reused for these types of report.
switch ($values['type']) { switch ($values['type']) {
case 'projection_graph': case 'projection_graph':
$values['period'] = get_parameter('period1'); $values['period'] = get_parameter('period1');
@ -1576,9 +1657,7 @@ switch ($action) {
break; break;
case 'netflow_area': case 'netflow_area':
case 'netflow_pie':
case 'netflow_data': case 'netflow_data':
case 'netflow_statistics':
case 'netflow_summary': case 'netflow_summary':
$values['text'] = get_parameter('netflow_filter'); $values['text'] = get_parameter('netflow_filter');
$values['description'] = get_parameter('description'); $values['description'] = get_parameter('description');
@ -1591,7 +1670,7 @@ switch ($action) {
case 'availability': case 'availability':
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
// HACK it is saved in show_graph field. // HACK it is saved in show_graph field.
// Show interfaces instead the modules // Show interfaces instead the modules.
$values['show_graph'] = get_parameter('checkbox_show_address_agent'); $values['show_graph'] = get_parameter('checkbox_show_address_agent');
$good_format = true; $good_format = true;
break; break;
@ -1614,6 +1693,12 @@ switch ($action) {
$good_format = true; $good_format = true;
break; break;
case 'nt_top_n':
$values['top_n_value'] = get_parameter('quantity');
$values['period'] = get_parameter('period');
$good_format = true;
break;
default: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter('radiobutton_max_min_avg', 0); $values['top_n'] = get_parameter('radiobutton_max_min_avg', 0);
@ -1660,6 +1745,10 @@ switch ($action) {
$values['only_display_wrong'] = $only_display_wrong_tmp; $values['only_display_wrong'] = $only_display_wrong_tmp;
} }
break; break;
default:
// Default.
break;
} }
$values['monday'] = get_parameter('monday', 0); $values['monday'] = get_parameter('monday', 0);
@ -1669,6 +1758,18 @@ switch ($action) {
$values['friday'] = get_parameter('friday', 0); $values['friday'] = get_parameter('friday', 0);
$values['saturday'] = get_parameter('saturday', 0); $values['saturday'] = get_parameter('saturday', 0);
$values['sunday'] = get_parameter('sunday', 0); $values['sunday'] = get_parameter('sunday', 0);
$values['total_time'] = get_parameter('total_time', 0);
$values['time_failed'] = get_parameter('time_failed', 0);
$values['time_in_ok_status'] = get_parameter('time_in_ok_status', 0);
$values['time_in_unknown_status'] = get_parameter('time_in_unknown_status', 0);
$values['time_of_not_initialized_module'] = get_parameter('time_of_not_initialized_module', 0);
$values['time_of_downtime'] = get_parameter('time_of_downtime', 0);
$values['total_checks'] = get_parameter('total_checks', 0);
$values['checks_failed'] = get_parameter('checks_failed', 0);
$values['checks_in_ok_status'] = get_parameter('checks_in_ok_status', 0);
$values['unknown_checks'] = get_parameter('unknown_checks', 0);
$values['agent_max_value'] = get_parameter('agent_max_value', 0);
$values['agent_min_value'] = get_parameter('agent_min_value', 0);
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
@ -1680,6 +1781,10 @@ switch ($action) {
$values['time_from'] = '#to_date(\''.get_parameter('time_from').'\',\'hh24:mi:ss\')'; $values['time_from'] = '#to_date(\''.get_parameter('time_from').'\',\'hh24:mi:ss\')';
$values['time_to'] = '#to_date(\''.get_parameter('time_to').'\', \'hh24:mi:ss\')'; $values['time_to'] = '#to_date(\''.get_parameter('time_to').'\', \'hh24:mi:ss\')';
break; break;
default:
// Default.
break;
} }
$values['group_by_agent'] = get_parameter('checkbox_row_group_by_agent', 0); $values['group_by_agent'] = get_parameter('checkbox_row_group_by_agent', 0);
@ -1707,8 +1812,8 @@ switch ($action) {
} }
} }
if (($values['type'] == 'sql') or ($values['type'] == 'sql_graph_hbar') if (($values['type'] == 'sql') || ($values['type'] == 'sql_graph_hbar')
or ($values['type'] == 'sql_graph_vbar') or ($values['type'] == 'sql_graph_pie') || ($values['type'] == 'sql_graph_vbar') || ($values['type'] == 'sql_graph_pie')
) { ) {
$values['treport_custom_sql_id'] = get_parameter('id_custom'); $values['treport_custom_sql_id'] = get_parameter('id_custom');
if ($values['treport_custom_sql_id'] == 0) { if ($values['treport_custom_sql_id'] == 0) {
@ -1750,7 +1855,7 @@ switch ($action) {
$event_filter_search = get_parameter('filter_search', ''); $event_filter_search = get_parameter('filter_search', '');
// Added for events items // Added for events items.
$style['show_summary_group'] = $show_summary_group; $style['show_summary_group'] = $show_summary_group;
$style['filter_event_severity'] = json_encode($filter_event_severity); $style['filter_event_severity'] = json_encode($filter_event_severity);
$style['filter_event_type'] = json_encode($filter_event_type); $style['filter_event_type'] = json_encode($filter_event_type);
@ -1772,6 +1877,10 @@ switch ($action) {
$style['label'] = ''; $style['label'] = '';
} }
break; break;
default:
// Default.
break;
} }
break; break;
@ -1809,12 +1918,17 @@ switch ($action) {
case 'MTBF': case 'MTBF':
case 'MTTR': case 'MTTR':
case 'simple_baseline_graph': case 'simple_baseline_graph':
case 'nt_top_n':
if ($label != '') { if ($label != '') {
$style['label'] = $label; $style['label'] = $label;
} else { } else {
$style['label'] = ''; $style['label'] = '';
} }
break; break;
default:
// Default.
break;
} }
$values['style'] = io_safe_input(json_encode($style)); $values['style'] = io_safe_input(json_encode($style));
@ -1829,6 +1943,10 @@ switch ($action) {
unset($values['type']); unset($values['type']);
} }
break; break;
default:
// Default.
break;
} }
$result = db_process_sql_insert( $result = db_process_sql_insert(
@ -1858,6 +1976,10 @@ switch ($action) {
WHERE id_report = '.$idReport WHERE id_report = '.$idReport
); );
break; break;
default:
// Default.
break;
} }
if ($max === false) { if ($max === false) {
@ -1883,6 +2005,10 @@ switch ($action) {
['id_rc' => $idItem] ['id_rc' => $idItem]
); );
break; break;
default:
// Default.
break;
} }
$resultOperationDB = true; $resultOperationDB = true;
@ -1890,7 +2016,8 @@ switch ($action) {
break; break;
} }
// If fields dont have good format
// If fields dont have good format.
else { else {
$resultOperationDB = false; $resultOperationDB = false;
} }
@ -1898,7 +2025,7 @@ switch ($action) {
break; break;
default: default:
if ($enterpriseEnable and $activeTab != 'advanced') { if ($enterpriseEnable && $activeTab != 'advanced') {
$resultOperationDB = reporting_enterprise_update_action(); $resultOperationDB = reporting_enterprise_update_action();
} }
break; break;
@ -1956,7 +2083,7 @@ switch ($action) {
case 'agent': case 'agent':
case 'type': case 'type':
// Sort functionality for normal console // Sort functionality for normal console.
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
switch ($field) { switch ($field) {
case 'module': case 'module':
@ -1990,6 +2117,10 @@ switch ($action) {
case 'type': case 'type':
$sql = 'SELECT id_rc FROM treport_content WHERE %s ORDER BY type %s'; $sql = 'SELECT id_rc FROM treport_content WHERE %s ORDER BY type %s';
break; break;
default:
// Default.
break;
} }
$sql = sprintf($sql, 'id_report = '.$idReport, '%s'); $sql = sprintf($sql, 'id_report = '.$idReport, '%s');
@ -2001,11 +2132,15 @@ switch ($action) {
case 'down': case 'down':
$sql = sprintf($sql, 'DESC'); $sql = sprintf($sql, 'DESC');
break; break;
default:
// Default.
break;
} }
$ids = db_get_all_rows_sql($sql); $ids = db_get_all_rows_sql($sql);
} }
// Sort functionality for metaconsole // Sort functionality for metaconsole.
else if ($config['metaconsole'] == 1) { else if ($config['metaconsole'] == 1) {
switch ($field) { switch ($field) {
case 'agent': case 'agent':
@ -2023,14 +2158,14 @@ switch ($action) {
foreach ($report_items as $report_item) { foreach ($report_items as $report_item) {
$connection = metaconsole_get_connection($report_item['server_name']); $connection = metaconsole_get_connection($report_item['server_name']);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name); // ui_print_error_message ("Error connecting to ".$server_name);.
} }
switch ($field) { switch ($field) {
case 'agent': case 'agent':
$agents_name = agents_get_agents(['id_agente' => $report_item['id_agent']], 'nombre'); $agents_name = agents_get_agents(['id_agente' => $report_item['id_agent']], 'nombre');
// Item without agent // Item without agent.
if (!$agents_name) { if (!$agents_name) {
$element_name = ''; $element_name = '';
} else { } else {
@ -2042,13 +2177,17 @@ switch ($action) {
case 'module': case 'module':
$module_name = modules_get_agentmodule_name($report_item['id_agent_module']); $module_name = modules_get_agentmodule_name($report_item['id_agent_module']);
// Item without module // Item without module.
if (!$module_name) { if (!$module_name) {
$element_name = ''; $element_name = '';
} else { } else {
$element_name = $module_name; $element_name = $module_name;
} }
break; break;
default:
// Default.
break;
} }
metaconsole_restore_db(); metaconsole_restore_db();
@ -2056,7 +2195,7 @@ switch ($action) {
$temp_sort[$report_item['id_rc']] = $element_name; $temp_sort[$report_item['id_rc']] = $element_name;
} }
// Performes sorting // Performes sorting.
switch ($dir) { switch ($dir) {
case 'up': case 'up':
asort($temp_sort); asort($temp_sort);
@ -2065,6 +2204,10 @@ switch ($action) {
case 'down': case 'down':
arsort($temp_sort); arsort($temp_sort);
break; break;
default:
// Default.
break;
} }
foreach ($temp_sort as $temp_element_key => $temp_element_val) { foreach ($temp_sort as $temp_element_key => $temp_element_val) {
@ -2073,13 +2216,13 @@ switch ($action) {
$i++; $i++;
} }
// Free resources // Free resources.
unset($temp_sort); unset($temp_sort);
unset($report_items); unset($report_items);
} }
break; break;
// Type case only depends of local database // Type case only depends of local database.
case 'type': case 'type':
$sql = 'SELECT id_rc $sql = 'SELECT id_rc
FROM treport_content FROM treport_content
@ -2098,10 +2241,13 @@ switch ($action) {
case 'down': case 'down':
$sql = sprintf($sql, 'DESC'); $sql = sprintf($sql, 'DESC');
break; break;
default:
// Default.
break;
} }
$ids = db_get_all_rows_sql($sql); $ids = db_get_all_rows_sql($sql);
break; break;
} }
} }
@ -2140,6 +2286,10 @@ switch ($action) {
WHERE id_rc = '.$idItem WHERE id_rc = '.$idItem
); );
break; break;
default:
// Default.
break;
} }
// db_get_value_filter('order', 'treport_content', array('id_rc' => $idItem)); // db_get_value_filter('order', 'treport_content', array('id_rc' => $idItem));
@ -2151,6 +2301,10 @@ switch ($action) {
case 'down': case 'down':
$newOrder = ($oldOrder + 1); $newOrder = ($oldOrder + 1);
break; break;
default:
// Default.
break;
} }
switch ($config['dbtype']) { switch ($config['dbtype']) {
@ -2188,6 +2342,10 @@ switch ($action) {
false false
); );
break; break;
default:
// Default.
break;
} }
if ($resultOperationDB !== false) { if ($resultOperationDB !== false) {
@ -2217,13 +2375,17 @@ switch ($action) {
false false
); );
break; break;
default:
// Default.
break;
} }
} }
break; break;
} }
break; break;
// Added for report templates // Added for report templates.
default: default:
if ($enterpriseEnable) { if ($enterpriseEnable) {
$buttons = [ $buttons = [
@ -2247,7 +2409,7 @@ switch ($action) {
break; break;
} }
// Page header for metaconsole // Page header for metaconsole.
if ($enterpriseEnable and defined('METACONSOLE')) { if ($enterpriseEnable and defined('METACONSOLE')) {
// Bread crumbs // Bread crumbs
ui_meta_add_breadcrumb( ui_meta_add_breadcrumb(
@ -2259,10 +2421,10 @@ switch ($action) {
ui_meta_print_page_header($nav_bar); ui_meta_print_page_header($nav_bar);
// Print header // Print header.
ui_meta_print_header(__('Reporting'), '', $buttons); ui_meta_print_header(__('Reporting'), '', $buttons);
} }
// Page header for normal console // Page header for normal console.
else { else {
ui_print_page_header($subsection, 'images/op_reporting.png', false, '', false, $buttons, false, '', 60); ui_print_page_header($subsection, 'images/op_reporting.png', false, '', false, $buttons, false, '', 60);
} }
@ -2325,9 +2487,9 @@ if ($idReport != 0) {
$textReportName = __('Create Custom Report'); $textReportName = __('Create Custom Report');
} }
// Page header for metaconsole // Page header for metaconsole.
if ($enterpriseEnable and defined('METACONSOLE')) { if ($enterpriseEnable and defined('METACONSOLE')) {
// Bread crumbs // Bread crumbs.
ui_meta_add_breadcrumb( ui_meta_add_breadcrumb(
[ [
'link' => 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure, 'link' => 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure,
@ -2337,7 +2499,7 @@ if ($enterpriseEnable and defined('METACONSOLE')) {
ui_meta_print_page_header($nav_bar); ui_meta_print_page_header($nav_bar);
// Print header // Print header.
ui_meta_print_header(__('Reporting').$textReportName, '', $buttons); ui_meta_print_header(__('Reporting').$textReportName, '', $buttons);
} else { } else {
ui_print_page_header( ui_print_page_header(

View File

@ -15,8 +15,6 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
ui_require_css_file('discovery'); ui_require_css_file('discovery');
ui_print_page_header(__('Discover'), '', false, '', true);
/** /**
* Mask class names. * Mask class names.

View File

@ -1,11 +1,10 @@
<?php <?php
/** /**
* Extension to manage a list of gateways and the node address where they should * Deprectated.
* point to.
* *
* @category Extensions * @category Deprectated
* @package Pandora FMS * @package Pandora FMS
* @subpackage Community * @subpackage Recion task script
* @version 1.0.0 * @version 1.0.0
* @license See below * @license See below
* *
@ -26,481 +25,3 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* ============================================================================ * ============================================================================
*/ */
global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Recon Task Management'
);
include 'general/noaccess.php';
exit;
}
require_once $config['homedir'].'/include/functions_network_profiles.php';
if (check_acl($config['id_user'], 0, 'AW')) {
$options[]['text'] = "<a href='index.php?sec=estado&sec2=operation/servers/recon_view'>".html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>';
}
$user_groups_w = users_get_groups(false, 'PM', true, false, null, 'id_grupo');
$user_groups_w = array_keys($user_groups_w);
$user_groups_r = users_get_groups(false, 'AW', true, false, null, 'id_grupo');
$user_groups_r = array_keys($user_groups_r);
// Headers.
ui_print_page_header(
__('Manage recontask'),
'images/gm_servers.png',
false,
'',
true,
$options
);
// --------------------------------
// DELETE A RECON TASKs.
// --------------------------------
if (isset($_GET['delete'])) {
$id = get_parameter_get('delete');
$result = db_process_sql_delete('trecon_task', ['id_rt' => $id]);
if ($result !== false) {
ui_print_success_message(__('Successfully deleted recon task'));
} else {
ui_print_error_message(__('Error deleting recon task'));
}
} else if (isset($_GET['disabled'])) {
$id = get_parameter_get('id');
$disabled = get_parameter_get('disabled');
$result = db_process_sql_update(
'trecon_task',
['disabled' => $disabled],
['id_rt' => $id]
);
if ($result !== false) {
ui_print_success_message(__('Successfully updated recon task'));
// If the action is enabled, we force recon_task to be queued asap.
if ($disabled == 0) {
servers_force_recon_task($id);
}
} else {
ui_print_error_message(__('Error updating recon task'));
}
}
// --------------------------------
// GET PARAMETERS IF UPDATE OR CREATE.
// --------------------------------
if ((isset($_GET['update'])) || ((isset($_GET['create'])))) {
$name = get_parameter_post('name');
$network = get_parameter_post('network');
$description = get_parameter_post('description');
$id_recon_server = get_parameter_post('id_recon_server');
$interval = get_parameter_post('interval');
$id_group = get_parameter_post('id_group');
$create_incident = get_parameter_post('create_incident');
$id_network_profile = get_parameter_post('id_network_profile');
$recon_ports = get_parameter_post('recon_ports', '');
$id_os = get_parameter_post('id_os', 10);
$snmp_community = get_parameter_post('snmp_community', 'public');
$id_recon_script = get_parameter('id_recon_script', 0);
$mode = get_parameter('mode', '');
$field1 = get_parameter('_field1_', '');
$field2 = get_parameter('_field2_', '');
$field3 = get_parameter('_field3_', '');
$field4 = get_parameter('_field4_', '');
$snmp_version = get_parameter_post('snmp_version');
$snmp3_auth_user = get_parameter_post('snmp_auth_user');
$snmp3_auth_pass = get_parameter_post('snmp_auth_pass');
$snmp3_privacy_method = get_parameter_post('snmp_privacy_method');
$snmp3_privacy_pass = get_parameter_post('snmp_privacy_pass');
$snmp3_auth_method = get_parameter_post('snmp_auth_method');
$snmp3_security_level = get_parameter_post('snmp_security_level');
if ($mode == 'network_sweep') {
$id_recon_script = 0;
} else {
$id_network_profile = 0;
}
$os_detect = (int) get_parameter('os_detect', 0);
$resolve_names = (int) get_parameter('resolve_names', 0);
$parent_detection = (int) get_parameter('parent_detection', 0);
$parent_recursion = (int) get_parameter('parent_recursion', 1);
$alias_as_name = (int) get_parameter('alias_as_name', 0);
$snmp_enabled = (int) get_parameter('snmp_enabled', 0);
$vlan_enabled = (int) get_parameter('vlan_enabled', 0);
// Get macros.
$macros = (string) get_parameter('macros');
if (!empty($macros)) {
$macros = json_decode(base64_decode($macros), true);
if (isset($macros) === true && is_array($macros) === true) {
foreach ($macros as $k => $m) {
$macros[$k]['value'] = get_parameter($m['macro'], '');
}
}
}
$macros = io_json_mb_encode($macros);
}
// --------------------------------
// UPDATE A RECON TASK.
// --------------------------------
if (isset($_GET['update'])) {
$id = get_parameter_get('update');
$values = [
'snmp_community' => $snmp_community,
'id_os' => $id_os,
'name' => $name,
'subnet' => $network,
'description' => $description,
'id_recon_server' => $id_recon_server,
'create_incident' => $create_incident,
'id_group' => $id_group,
'interval_sweep' => $interval,
'id_network_profile' => $id_network_profile,
'recon_ports' => $recon_ports,
'id_recon_script' => $id_recon_script,
'field1' => $field1,
'field2' => $field2,
'field3' => $field3,
'field4' => $field4,
'os_detect' => $os_detect,
'resolve_names' => $resolve_names,
'parent_detection' => $parent_detection,
'parent_recursion' => $parent_recursion,
'macros' => $macros,
'alias_as_name' => $alias_as_name,
'snmp_enabled' => $snmp_enabled,
'vlan_enabled' => $vlan_enabled,
'snmp_version' => $snmp_version,
];
$values_v3 = [
'snmp_auth_user' => $snmp3_auth_user,
'snmp_auth_pass' => $snmp3_auth_pass,
'snmp_privacy_method' => $snmp3_privacy_method,
'snmp_privacy_pass' => $snmp3_privacy_pass,
'snmp_auth_method' => $snmp3_auth_method,
'snmp_security_level' => $snmp3_security_level,
];
if ($values['snmp_version'] == '1' || $values['snmp_version'] == '2' || $values['snmp_version'] == '2c') {
$values_v3 = [
'snmp_auth_user' => '',
'snmp_auth_pass' => '',
'snmp_privacy_method' => '',
'snmp_privacy_pass' => '',
'snmp_auth_method' => '',
'snmp_security_level' => '',
];
}
$values = array_merge($values, $values_v3);
$where = ['id_rt' => $id];
$reason = '';
if ($name != '') {
if (empty($id_recon_script)) {
if (!preg_match('/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/', $network)) {
$reason = __('Wrong format in Subnet field');
$result = false;
} else {
$result = db_process_sql_update(
'trecon_task',
$values,
$where
);
}
} else {
$result = db_process_sql_update(
'trecon_task',
$values,
$where
);
}
} else {
$result = false;
}
if ($result !== false) {
ui_print_success_message(__('Successfully updated recon task'));
} else {
ui_print_error_message(__('Error updating recon task'));
echo $reason;
include 'manage_recontask_form.php';
return;
}
}
// --------------------------------
// CREATE A RECON TASK
// --------------------------------
if (isset($_GET['create'])) {
$values = [
'name' => $name,
'subnet' => $network,
'description' => $description,
'id_recon_server' => $id_recon_server,
'create_incident' => $create_incident,
'id_group' => $id_group,
'id_network_profile' => $id_network_profile,
'interval_sweep' => $interval,
'id_os' => $id_os,
'recon_ports' => $recon_ports,
'snmp_community' => $snmp_community,
'id_recon_script' => $id_recon_script,
'field1' => $field1,
'field2' => $field2,
'field3' => $field3,
'field4' => $field4,
'os_detect' => $os_detect,
'resolve_names' => $resolve_names,
'parent_detection' => $parent_detection,
'parent_recursion' => $parent_recursion,
'macros' => $macros,
'alias_as_name' => $alias_as_name,
'snmp_enabled' => $snmp_enabled,
'vlan_enabled' => $vlan_enabled,
'snmp_version' => $snmp_version,
];
$values_v3 = [
'snmp_auth_user' => $snmp3_auth_user,
'snmp_auth_pass' => $snmp3_auth_pass,
'snmp_privacy_method' => $snmp3_privacy_method,
'snmp_privacy_pass' => $snmp3_privacy_pass,
'snmp_auth_method' => $snmp3_auth_method,
'snmp_security_level' => $snmp3_security_level,
];
if ($values['snmp_version'] == '1' || $values['snmp_version'] == '2' || $values['snmp_version'] == '2c') {
$values_v3 = [
'snmp_auth_user' => '',
'snmp_auth_pass' => '',
'snmp_privacy_method' => '',
'snmp_privacy_pass' => '',
'snmp_auth_method' => '',
'snmp_security_level' => '',
];
}
if ($values['snmp_version'] == '3') {
$values['vlan_enabled'] = 0;
}
$values = array_merge($values, $values_v3);
$name = io_safe_output($name);
$name = trim($name, ' ');
$name = io_safe_input($name);
$reason = '';
if ($name != '') {
$name_exists = (bool) db_get_value('name', 'trecon_task', 'name', $name);
if (empty($id_recon_script)) {
if ($name_exists && (!preg_match('/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/', $network))) {
$reason = __('Recon-task name already exists and incorrect format in Subnet field');
$result = false;
} else if (!preg_match('/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/', $network)) {
$reason = __('Wrong format in Subnet field');
$result = false;
} else if ($name_exists) {
$reason = __('Recon-task name already exists');
$result = false;
} else {
$result = db_process_sql_insert('trecon_task', $values);
}
} else {
if ($name_exists) {
$reason = __('Recon-task name already exists');
$result = false;
} else {
$result = db_process_sql_insert('trecon_task', $values);
}
}
} else {
$reason = 'The field "Task name" is empty';
$result = false;
}
if ($result !== false) {
ui_print_success_message(__('Successfully created recon task'));
} else {
ui_print_error_message(__('Error creating recon task'));
echo $reason;
include 'manage_recontask_form.php';
return;
}
}
// --------------------------------
// SHOW TABLE WITH ALL RECON TASKs.
// --------------------------------
// Pandora Admin must see all columns.
if (! check_acl($config['id_user'], 0, 'PM')) {
$sql = sprintf(
'SELECT *
FROM trecon_task RT, tusuario_perfil UP
WHERE
UP.id_usuario = "%s" AND UP.id_grupo = RT.id_group',
$config['id_user']
);
$result = db_get_all_rows_sql($sql);
} else {
$result = db_get_all_rows_in_table('trecon_task');
}
$color = 1;
if ($result !== false) {
$table = new StdClass();
$table->head = [
__('Name'),
__('Network'),
__('Mode'),
__('Group'),
__('SNMP Version'),
__('Incident'),
__('OS'),
__('Interval'),
__('Ports'),
__('Action'),
];
$table->align = [
'left',
'left',
'left',
'left',
'left',
'left',
'left',
'left',
];
$table->width = '100%';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->class = 'databox data';
$table->data = [];
$table->style[8] = 'text-align: left;';
$table->size[8] = '15%';
foreach ($result as $row) {
if (in_array($row['id_group'], $user_groups_r)) {
$data = [];
$data[0] = $row['name'];
if ($row['id_recon_script'] == 0) {
$data[1] = $row['subnet'];
} else {
$data[1] = '-';
}
if ($row['id_recon_script'] == 0) {
// Network recon task.
$data[2] = html_print_image('images/network.png', true, ['title' => __('Network recon task')]).'&nbsp;&nbsp;';
$data[2] .= network_profiles_get_name($row['id_network_profile']);
$mode_name = '';
} else {
// APP recon task.
$data[2] = html_print_image('images/plugin.png', true).'&nbsp;&nbsp;';
$mode_name = db_get_sql(sprintf('SELECT name FROM trecon_script WHERE id_recon_script = %d', $row['id_recon_script']));
$data[2] .= $mode_name;
}
// GROUP.
if ($row['id_recon_script'] == 0) {
$data[3] = ui_print_group_icon($row['id_group'], true);
} else {
$data[3] = '-';
}
// SNMP VERSION.
if ($row['snmp_version'] == '1') {
$data[4] = 'v. 1';
} else if ($row['snmp_version'] == '2') {
$data[4] = 'v. 2';
} else if ($row['snmp_version'] == '2c') {
$data[4] = 'v. 2c';
} else if ($row['snmp_version'] == '3') {
$data[4] = 'v. 3';
}
// INCIDENT.
$data[5] = (($row['create_incident'] == 1) ? __('Yes') : __('No'));
// OS.
if ($row['id_recon_script'] == 0) {
$data[6] = (($row['id_os'] > 0) ? ui_print_os_icon($row['id_os'], false, true) : __('Any'));
} else {
$data[6] = '-';
}
// INTERVAL.
if ($row['interval_sweep'] == 0) {
$data[7] = __('Manual');
} else {
$data[7] = human_time_description_raw($row['interval_sweep']);
}
// PORTS.
if ($row['id_recon_script'] == 0) {
$data[8] = substr($row['recon_ports'], 0, 15);
} else {
$data[8] = '-';
}
// ACTION.
$task_group = $row['id_group'];
if (in_array($task_group, $user_groups_w)) {
$data[9] = '<a href="index.php?sec=estado&sec2=operation/servers/recon_view">'.html_print_image('images/eye.png', true).'</a>';
$data[9] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/manage_recontask&delete='.$row['id_rt'].'">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
if ($mode_name != 'IPAM Recon') {
$data[9] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&update='.$row['id_rt'].'">'.html_print_image('images/config.png', true).'</a>';
} else {
$sql_ipam = 'select id from tipam_network where id_recon_task ='.$row['id_rt'];
$id_recon_ipam = db_get_sql($sql_ipam);
$data[9] .= '<a href="index.php?sec=godmode/extensions&sec2=enterprise/extensions/ipam&action=edit&id='.$id_recon_ipam.'">'.html_print_image('images/config.png', true).'</a>';
}
if ($row['disabled'] == 0) {
$data[9] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/manage_recontask&id='.$row['id_rt'].'&disabled=1">'.html_print_image('images/lightbulb.png', true).'</a>';
} else {
$data[9] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/manage_recontask&id='.$row['id_rt'].'&disabled=0">'.html_print_image('images/lightbulb_off.png', true).'</a>';
}
}
$table->data[] = $data;
}
}
html_print_table($table);
unset($table);
} else {
echo '<div class="nf">'.__('There are no recon task configured').'</div>';
}
echo '<div class="action-buttons" style="width: 99%;">';
echo '<form method="post" action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&create">';
echo html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"', true);
echo '</form>';
echo '</div>';

View File

@ -1,11 +1,10 @@
<?php <?php
/** /**
* Extension to manage a list of gateways and the node address where they should * Deprectated.
* point to.
* *
* @category Extensions * @category deprecated
* @package Pandora FMS * @package Pandora FMS
* @subpackage Community * @subpackage recon task
* @version 1.0.0 * @version 1.0.0
* @license See below * @license See below
* *
@ -26,910 +25,3 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* ============================================================================ * ============================================================================
*/ */
global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Agent Management'
);
include 'general/noaccess.php';
return;
}
require_once $config['homedir'].'/include/functions_users.php';
$user_groups = users_get_groups(false, 'AW', true, false, null, 'id_grupo');
$user_groups = array_keys($user_groups);
if (is_ajax()) {
$get_explanation = (bool) get_parameter('get_explanation', 0);
if ($get_explanation) {
$id = (int) get_parameter('id', 0);
$explanation = db_get_value(
'description',
'trecon_script',
'id_recon_script',
$id
);
echo io_safe_output($explanation);
return;
}
$get_recon_script_macros = get_parameter('get_recon_script_macros');
if ($get_recon_script_macros) {
$id_recon_script = (int) get_parameter('id');
$id_recon_task = (int) get_parameter('id_rt');
if (!empty($id_recon_task) && empty($id_recon_script)) {
$recon_script_macros = db_get_value(
'macros',
'trecon_task',
'id_rt',
$id_recon_task
);
} else if (!empty($id_recon_task)) {
$recon_task_id_rs = (int) db_get_value(
'id_recon_script',
'trecon_task',
'id_rt',
$id_recon_task
);
if ($id_recon_script == $recon_task_id_rs) {
$recon_script_macros = db_get_value(
'macros',
'trecon_task',
'id_rt',
$id_recon_task
);
} else {
$recon_script_macros = db_get_value(
'macros',
'trecon_script',
'id_recon_script',
$id_recon_script
);
}
} else if (!empty($id_recon_script)) {
$recon_script_macros = db_get_value(
'macros',
'trecon_script',
'id_recon_script',
$id_recon_script
);
} else {
$recon_script_macros = [];
}
$macros = [];
$macros['base64'] = base64_encode($recon_script_macros);
$macros['array'] = json_decode($recon_script_macros, true);
echo io_json_mb_encode($macros);
return;
}
return;
}
// Edit mode.
if (isset($_GET['update']) || (isset($_GET['upd']))) {
$update_recon = true;
if (isset($_GET['upd'])) {
if ($_GET['upd'] != 'update') {
$update_recon = false;
} else {
$id_rt = get_parameter('upd');
}
}
if ($update_recon) {
if (!isset($id_rt)) {
$id_rt = (int) get_parameter_get('update');
}
$row = db_get_row('trecon_task', 'id_rt', $id_rt);
$name = $row['name'];
$network = $row['subnet'];
$id_recon_server = $row['id_recon_server'];
$description = $row['description'];
$interval = $row['interval_sweep'];
$id_group = $row['id_group'];
$create_incident = $row['create_incident'];
$id_network_profile = $row['id_network_profile'];
$id_os = $row['id_os'];
$recon_ports = $row['recon_ports'];
$snmp_community = $row['snmp_community'];
$snmp_version = $row['snmp_version'];
$snmp3_auth_user = $row['snmp_auth_user'];
$snmp3_auth_pass = $row['snmp_auth_pass'];
$snmp3_privacy_method = $row['snmp_privacy_method'];
$snmp3_privacy_pass = $row['snmp_privacy_pass'];
$snmp3_auth_method = $row['snmp_auth_method'];
$snmp3_security_level = $row['snmp_security_level'];
$id_recon_script = $row['id_recon_script'];
$field1 = $row['field1'];
$field2 = $row['field2'];
$field3 = $row['field3'];
$field4 = $row['field4'];
if ($id_recon_script == 0) {
$mode = 'network_sweep';
} else {
$mode = 'recon_script';
}
$os_detect = $row['os_detect'];
$resolve_names = $row['resolve_names'];
$os_detect = $row['os_detect'];
$parent_detection = $row['parent_detection'];
$parent_recursion = $row['parent_recursion'];
$macros = $row['macros'];
$alias_as_name = $row['alias_as_name'];
$snmp_enabled = $row['snmp_enabled'];
$vlan_enabled = $row['vlan_enabled'];
$name_script = db_get_value(
'name',
'trecon_script',
'id_recon_script',
$id_recon_script
);
if (! in_array($id_group, $user_groups)) {
db_pandora_audit(
'ACL Violation',
'Trying to access Recon Task Management'
);
include 'general/noaccess.php';
return;
}
}
} else if (isset($_GET['create']) || isset($_GET['crt'])) {
$create_recon = true;
if (isset($_GET['crt'])) {
if ($_GET['crt'] != 'Create') {
$create_recon = false;
}
}
if ($create_recon) {
$id_rt = -1;
$name = get_parameter('name');
$network = get_parameter('network');
$description = get_parameter('description');
$id_recon_server = 0;
$interval = 0;
$id_group = 0;
$create_incident = 1;
$snmp_community = 'public';
$snmp3_auth_user = '';
$snmp3_auth_pass = '';
$snmp_version = 1;
$snmp3_privacy_method = '';
$snmp3_privacy_pass = '';
$snmp3_auth_method = '';
$snmp3_security_level = '';
$id_network_profile = 0;
$id_os = -1;
$recon_ports = '';
$field1 = '';
$field2 = '';
$field3 = '';
$field4 = '';
$id_recon_script = 0;
$mode = 'network_sweep';
$os_detect = 0;
$resolve_names = 0;
$parent_detection = 1;
$parent_recursion = 5;
$macros = '';
$alias_as_name = 0;
$snmp_enabled = 0;
$vlan_enabled = 0;
}
$modify = false;
if (($name != '') || ($network != '')) {
$modify = true;
}
}
if (!$modify) {
// Headers.
ui_print_page_header(__('Manage recontask'), '', false, 'recontask', true);
}
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
if ($is_windows) {
echo '<div class="notify">';
echo __('Warning').': '.__('By default, in Windows, %s only support Standard network sweep, not custom scripts', get_product_name());
echo '</div>';
}
$table = new stdClass();
$table->id = 'table_recon';
$table->width = '100%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->class = 'databox filters';
$table->rowclass[3] = 'network_sweep';
$table->rowclass[5] = 'network_sweep';
$table->rowclass[7] = 'network_sweep';
$table->rowclass[8] = 'network_sweep';
$table->rowclass[11] = 'network_sweep';
$table->rowclass[12] = 'network_sweep';
$table->rowclass[18] = 'network_sweep';
$table->rowclass[19] = 'network_sweep';
$table->rowclass[20] = 'network_sweep';
$table->rowclass[21] = 'network_sweep';
$table->rowclass[22] = 'network_sweep';
$table->rowclass[23] = 'network_sweep';
$table->rowclass[24] = 'network_sweep';
$table->rowclass[25] = 'network_sweep recon_v3';
$table->rowclass[26] = 'network_sweep recon_v3';
$table->rowclass[27] = 'network_sweep recon_v3';
$table->rowclass[28] = 'network_sweep recon_v3';
$table->rowclass[29] = 'network_sweep recon_v3';
$table->rowclass[30] = 'network_sweep recon_v3';
$table->rowclass[6] = 'recon_script';
$table->rowclass[13] = 'recon_script';
$table->rowclass[14] = 'recon_script';
$table->rowclass[15] = 'recon_script';
$table->rowclass[16] = 'recon_script';
$table->rowclass[17] = 'recon_script';
// Name.
$table->data[0][0] = '<b>'.__('Task name').'</b>';
$table->data[0][1] = html_print_input_text('name', $name, '', 25, 0, true);
// Discovery server.
$table->data[1][0] = '<b>'.__('Discovery server').ui_print_help_tip(
__('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'),
true
);
$sql = 'SELECT id_server, name
FROM tserver
WHERE server_type = 3
ORDER BY name';
$table->data[1][1] = html_print_select_from_sql(
$sql,
'id_recon_server',
$id_recon_server,
'',
'',
'',
true
);
$fields['network_sweep'] = __('Network sweep');
if (!$is_windows) {
$fields['recon_script'] = __('Custom script');
}
$table->data[2][0] = '<b>'.__('Mode').'</b>';
$table->data[2][1] = html_print_select(
$fields,
'mode',
$mode,
'',
'',
0,
true
);
// Network.
$table->data[3][0] = '<b>'.__('Network').'</b>';
$table->data[3][0] .= ui_print_help_tip(
__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'),
true
);
$table->data[3][1] = html_print_input_text(
'network',
$network,
'',
25,
0,
true
);
// Interval.
$interv_manual = 0;
if ((int) $interval == 0) {
$interv_manual = 1;
}
$table->data[4][0] = '<b>'.__('Interval');
$table->data[4][0] .= ui_print_help_tip(
__('Manual interval means that it will be executed only On-demand'),
true
);
$values = [
0 => __('Defined'),
1 => __('Manual'),
];
$table->data[4][1] = html_print_select(
$values,
'interval_manual_defined',
$interv_manual,
'',
'',
'',
true
);
$table->data[4][1] .= '<span id="interval_manual_container">';
$table->data[4][1] .= html_print_extended_select_for_time(
'interval',
$interval,
'',
'',
'0',
false,
true,
false,
false
);
$table->data[4][1] .= ui_print_help_tip(
__('The minimum recomended interval for Recon Task is 5 minutes'),
true
);
$table->data[4][1] .= '</span>';
// Module template.
$table->data[5][0] = '<b>'.__('Module template').'</b>';
$sql = 'SELECT id_np, name
FROM tnetwork_profile
ORDER BY name';
$table->data[5][1] = html_print_select_from_sql(
$sql,
'id_network_profile',
$id_network_profile,
'',
__('None'),
0,
true
);
// Recon script.
$data[1] = '';
$table->data[6][0] = '<b>'.__('Recon script').'</b>';
$sql = "SELECT id_recon_script, name
FROM trecon_script
WHERE name <> 'IPAM Recon'
ORDER BY name";
if ($name_script != 'IPAM Recon') {
$table->data[6][1] = html_print_select_from_sql(
$sql,
'id_recon_script',
$id_recon_script,
'',
'',
'',
true
);
$table->data[6][1] .= "<span id='spinner_recon_script' style='display: none;'>".html_print_image('images/spinner.gif', true).'</span>';
$table->data[6][1] .= $data[1] .= html_print_input_hidden(
'macros',
base64_encode($macros),
true
);
} else {
$table->data[6][1] = 'IPAM Recon';
}
// OS.
$table->data[7][0] = '<b>'.__('OS').'</b>';
$sql = 'SELECT id_os, name
FROM tconfig_os
ORDER BY name';
$table->data[7][1] = html_print_select_from_sql(
$sql,
'id_os',
$id_os,
'',
__('Any'),
-1,
true
);
// Recon ports.
$table->data[8][0] = '<b>'.__('Ports').'</b>';
$table->data[8][1] = html_print_input_text(
'recon_ports',
$recon_ports,
'',
25,
0,
true
);
$table->data[8][1] .= ui_print_help_tip(
__('Ports defined like: 80 or 80,443,512 or even 0-1024 (Like Nmap command line format). If dont want to do a sweep using portscan, left it in blank'),
true
);
// Group.
$table->data[9][0] = '<b>'.__('Group');
$groups = users_get_groups(false, 'PM', false);
$table->data[9][1] = html_print_select_groups(
false,
'PM',
false,
'id_group',
$id_group,
'',
'',
0,
true
);
// Incident.
$values = [
0 => __('No'),
1 => __('Yes'),
];
$table->data[10][0] = '<b>'.__('Incident');
$table->data[10][1] = html_print_select(
$values,
'create_incident',
$create_incident,
'',
'',
'',
true
).' '.ui_print_help_tip(
__('Choose if the discovery of a new system creates an incident or not.'),
true
);
// Snmp_enabled.
$table->data[11][0] = '<b>'.__('SNMP enabled');
$table->data[11][1] = html_print_checkbox(
'snmp_enabled',
1,
$snmp_enabled,
true
);
// SNMP default community.
$table->data[12][0] = '<b>'.__('SNMP Default community');
$table->data[12][0] .= ui_print_help_tip(
__('You can specify several values, separated by commas, for example: public,mysecret,1234'),
true
);
$table->data[12][1] = html_print_input_text(
'snmp_community',
$snmp_community,
'',
35,
0,
true
);
// SNMP version.
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';
$table->data[24][0] = '<b>'._('SNMP version');
$table->data[24][1] = html_print_select(
$snmp_versions,
'snmp_version',
$snmp_version,
'',
'',
0,
true
);
$table->data[25][0] = '<b>'.__('Auth user');
$table->data[25][1] = html_print_input_text(
'snmp_auth_user',
$snmp3_auth_user,
'',
15,
60,
true,
'',
false,
'',
''
);
$table->data[26][0] = '<b>'.__('Auth password').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
$table->data[26][1] = html_print_input_password(
'snmp_auth_pass',
$snmp3_auth_pass,
'',
15,
60,
true,
'',
false,
''
);
$table->data[26][1] .= html_print_input_hidden_extended(
'active_snmp_v3',
0,
'active_snmp_v3_mmen',
true
);
$table->data[27][0] = '<b>'.__('Privacy method');
$table->data[27][1] = html_print_select(
[
'DES' => __('DES'),
'AES' => __('AES'),
],
'snmp_privacy_method',
$snmp3_privacy_method,
'',
'',
'',
true,
false,
false,
'',
''
);
$table->data[28][0] = '<b>'.__('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
$table->data[28][1] = html_print_input_password(
'snmp_privacy_pass',
$snmp3_privacy_pass,
'',
15,
60,
true,
'',
false,
''
);
$table->data[29][0] = '<b>'.__('Auth method');
$table->data[29][1] = html_print_select(
[
'MD5' => __('MD5'),
'SHA' => __('SHA'),
],
'snmp_auth_method',
$snmp3_auth_method,
'',
'',
'',
true,
false,
false,
'',
''
);
$table->data[30][0] = '<b>'.__('Security level');
$table->data[30][1] = html_print_select(
[
'noAuthNoPriv' => __('Not auth and not privacy method'),
'authNoPriv' => __('Auth and not privacy method'),
'authPriv' => __('Auth and privacy method'),
],
'snmp_security_level',
$snmp3_security_level,
'',
'',
'',
true,
false,
false,
'',
''
);
// Explanation.
$explanation = db_get_value(
'description',
'trecon_script',
'id_recon_script',
$id_recon_script
);
$table->data[13][0] = '<b>'.__('Explanation').'</b>';
$table->data[13][1] = "<span id='spinner_layout' style='display: none;'>".html_print_image('images/spinner.gif', true).'</span>'.html_print_textarea('explanation', 4, 60, $explanation, 'style="width: 388px;"', true);
// A hidden "model row" to clone it from javascript to add fields dynamicaly.
$data = [];
$data[0] = 'macro_desc';
$data[0] .= ui_print_help_tip('macro_help', true);
$data[1] = html_print_input_text(
'macro_name',
'macro_value',
'',
100,
255,
true
);
$table->colspan['macro_field'][1] = 3;
$table->rowstyle['macro_field'] = 'display:none';
$table->data['macro_field'] = $data;
// If there are $macros, we create the form fields.
if (!empty($macros)) {
$macros = json_decode($macros, true);
if (isset($macros) === true
&& is_array($macros) === true
) {
foreach ($macros as $k => $m) {
$data = [];
$data[0] = '<b>'.$m['desc'].'</b>';
if (!empty($m['help'])) {
$data[0] .= ui_print_help_tip($m['help'], true);
}
if ($m['hide']) {
$data[1] = html_print_input_password(
$m['macro'],
$m['value'],
'',
100,
255,
true
);
} else {
$data[1] = html_print_input_text(
$m['macro'],
$m['value'],
'',
100,
255,
true
);
}
$table->colspan['macro'.$m['macro']][1] = 3;
$table->rowclass['macro'.$m['macro']] = 'macro_field';
$table->data['macro'.$m['macro']] = $data;
}
}
}
// Comments.
$table->data[18][0] = '<b>'.__('Comments');
$table->data[18][1] = html_print_input_text(
'description',
$description,
'',
45,
0,
true
);
// OS detection.
$table->data[19][0] = '<b>'.__('OS detection');
$table->data[19][1] = html_print_checkbox(
'os_detect',
1,
$os_detect,
true
);
// Name resolution.
$table->data[20][0] = '<b>'.__('Name resolution');
$table->data[20][1] = html_print_checkbox(
'resolve_names',
1,
$resolve_names,
true
);
// Parent detection.
$table->data[21][0] = '<b>'.__('Parent detection');
$table->data[21][1] = html_print_checkbox(
'parent_detection',
1,
$parent_detection,
true
);
// Parent recursion.
$table->data[22][0] = '<b>'.__('Parent recursion');
$table->data[22][1] = html_print_input_text(
'parent_recursion',
$parent_recursion,
'',
5,
0,
true
).ui_print_help_tip(
__('Maximum number of parent hosts that will be created if parent detection is enabled.'),
true
);
// Vlan_enabled.
$table->data[23][0] = '<b>'.__('Vlan enabled');
$table->data[23][1] = html_print_checkbox(
'vlan_enabled',
1,
$vlan_enabled,
true
);
// NOTE: The 7.0NG Recon Server will not generate random names, since IP
// address collisions could have other consequences.
// Different Form url if it's a create or if it's a update form.
echo '<form name="modulo" method="post" action="index.php?sec=gservers&sec2=godmode/servers/manage_recontask&'.(($id_rt != -1) ? 'update='.$id_rt : 'create=1').'">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id_rt != -1) {
if ($name_script != 'IPAM Recon') {
html_print_submit_button(__('Update'), 'crt', false, 'class="sub upd"');
}
} else {
html_print_submit_button(__('Add'), 'crt', false, 'class="sub wand"');
}
echo '</div>';
echo '</form>';
ui_require_javascript_file('pandora_modules');
?>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
});
var xhrManager = function () {
var manager = {};
manager.tasks = [];
manager.addTask = function (xhr) {
manager.tasks.push(xhr);
}
manager.stopTasks = function () {
while (manager.tasks.length > 0)
manager.tasks.pop().abort();
}
return manager;
};
var taskManager = new xhrManager();
$('select#interval_manual_defined').change(function() {
if ($("#interval_manual_defined").val() == 1) {
$('#interval_manual_container').hide();
$('#text-interval_text').val(0);
$('#hidden-interval').val(0);
}
else {
$('#interval_manual_container').show();
$('#text-interval_text').val(10);
$('#hidden-interval').val(600);
$('#interval_units').val(60);
}
}).change();
$('select#id_recon_script').change(function() {
if ($('select#mode').val() == 'recon_script')
get_explanation_recon_script($(this).val());
});
$('select#snmp_version').change(function () {
if (this.value == "3") {
$(".recon_v3").show();
$("input[name=active_snmp_v3]").val(1);
$("input[name=snmp_community]").attr("disabled", true);
$("input[name=vlan_enabled]").removeAttr("checked");
$("input[name=vlan_enabled]").attr("disabled", true);
}
else {
$(".recon_v3").hide();
$("input[name=active_snmp_v3]").val(0);
$("input[name=snmp_community]").removeAttr('disabled');
$("input[name=vlan_enabled]").removeAttr('disabled');
}
});
$('select#mode').change(function() {
var type = $(this).val();
if (type == 'recon_script') {
$(".recon_script").show();
$(".network_sweep").hide();
get_explanation_recon_script($("#id_recon_script").val());
}
else if (type == 'network_sweep') {
$(".recon_script").hide();
$(".network_sweep").show();
$('.macro_field').remove();
$('select#snmp_version').trigger('change');
}
}).change();
function get_explanation_recon_script (id) {
// Stop old ajax tasks.
taskManager.stopTasks();
// Show the spinners.
$("#textarea_explanation").hide();
$("#spinner_layout").show();
var xhr = jQuery.ajax ({
data: {
'page': 'godmode/servers/manage_recontask_form',
'get_explanation': 1,
'id': id,
'id_rt': <?php echo json_encode((int) $id_rt); ?>
},
url: "<?php echo $config['homeurl']; ?>ajax.php",
type: 'POST',
dataType: 'text',
complete: function (xhr, textStatus) {
$("#spinner_layout").hide();
},
success: function (data, textStatus, xhr) {
$("#textarea_explanation").val(data);
$("#textarea_explanation").show();
},
error: function (xhr, textStatus, errorThrown) {
console.log(errorThrown);
}
});
taskManager.addTask(xhr);
// Delete all the macro fields.
$('.macro_field').remove();
$("#spinner_recon_script").show();
var xhr = jQuery.ajax ({
data: {
'page': 'godmode/servers/manage_recontask_form',
'get_recon_script_macros': 1,
'id': id,
'id_rt': <?php echo json_encode((int) $id_rt); ?>
},
url: "<?php echo $config['homeurl']; ?>ajax.php",
type: 'POST',
dataType: 'json',
complete: function (xhr, textStatus) {
$("#spinner_recon_script").hide();
forced_title_callback();
},
success: function (data, textStatus, xhr) {
if (data.array !== null) {
$('#hidden-macros').val(data.base64);
jQuery.each (data.array, function (i, macro) {
if (macro.desc != '') {
add_macro_field(macro, 'table_recon-macro');
}
});
}
},
error: function (xhr, textStatus, errorThrown) {
console.log(errorThrown);
}
});
taskManager.addTask(xhr);
}
</script>

View File

@ -1,401 +1,27 @@
<?php <?php
/**
// Pandora FMS - http://pandorafms.com * Deprectated.
// ================================================== *
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas * @category Deprectated
// Please see http://pandorafms.org for full contribution list * @package Pandora FMS
// This program is free software; you can redistribute it and/or * @subpackage recon script
// modify it under the terms of the GNU General Public License * @version 1.0.0
// as published by the Free Software Foundation for version 2. * @license See below
// 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 (is_ajax()) { * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
$get_reconscript_description = get_parameter('get_reconscript_description'); *
$id_reconscript = get_parameter('id_reconscript'); * ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
$description = db_get_value_filter( * Please see http://pandorafms.org for full contribution list
'description', * This program is free software; you can redistribute it and/or
'trecon_script', * modify it under the terms of the GNU General Public License
['id_recon_script' => $id_reconscript] * 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
echo htmlentities(io_safe_output($description), ENT_QUOTES, 'UTF-8', true); * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
return; * GNU General Public License for more details.
} * ============================================================================
// Load global vars
global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access recon script Management'
);
include 'general/noaccess.php';
return;
}
/*
* Disabled at the moment.
if (!check_referer()) {
require ("general/noaccess.php");
return;
}
*/ */
$view = get_parameter('view', '');
$create = get_parameter('create', '');
if ($view != '') {
$form_id = $view;
$reconscript = db_get_row('trecon_script', 'id_recon_script', $form_id);
$form_name = $reconscript['name'];
$form_description = $reconscript['description'];
$form_script = $reconscript['script'];
$macros = $reconscript['macros'];
}
if ($create != '') {
$form_name = '';
$form_description = '';
$form_script = '';
$macros = '';
}
// SHOW THE FORM
// =================================================================
if (($create != '') or ($view != '')) {
if ($create != '') {
ui_print_page_header(__('Recon script creation'), 'images/gm_servers.png', false, 'reconscript_definition', true);
} else {
ui_print_page_header(__('Recon script update'), 'images/gm_servers.png', false, 'reconscript_definition', true);
$id_recon_script = get_parameter('view', '');
}
if ($create == '') {
echo "<form name=reconscript method='post' action='index.php?sec=gservers&sec2=godmode/servers/recon_script&update_reconscript=$id_recon_script'>";
} else {
echo "<form name=reconscript method='post' action='index.php?sec=gservers&sec2=godmode/servers/recon_script&create_reconscript=1'>";
}
$table = new stdClass();
$table->width = '100%';
$table->id = 'table-form';
$table->class = 'databox filters';
$table->style = [];
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->data = [];
$data = [];
$data[0] = __('Name');
$data[1] = '<input type="text" name="form_name" size=30 value="'.$form_name.'">';
$table->data['recon_name'] = $data;
$table->colspan['recon_name'][1] = 3;
$data = [];
$data[0] = __('Script fullpath');
$data[1] = '<input type="text" name="form_script" size=70 value="'.$form_script.'">';
$table->data['recon_fullpath'] = $data;
$table->colspan['recon_fullpath'][1] = 3;
$data = [];
$data[0] = __('Description');
$data[1] = '<textarea name="form_description" cols="50" rows="4">';
$data[1] .= $form_description;
$data[1] .= '</textarea>';
$table->data['recon_description'] = $data;
$table->colspan['recon_description'][1] = 3;
$macros = json_decode($macros, true);
// This code is ready to add locked feature as plugins
$locked = false;
// The next row number is recon_3
$next_name_number = 3;
$i = 1;
while (1) {
// Always print at least one macro
if ((!isset($macros[$i]) || $macros[$i]['desc'] == '') && $i > 1) {
break;
}
$macro_desc_name = 'field'.$i.'_desc';
$macro_desc_value = '';
$macro_help_name = 'field'.$i.'_help';
$macro_help_value = '';
$macro_value_name = 'field'.$i.'_value';
$macro_value_value = '';
$macro_name_name = 'field'.$i.'_macro';
$macro_name = '_field'.$i.'_';
$macro_hide_value_name = 'field'.$i.'_hide';
$macro_hide_value_value = 0;
if (isset($macros[$i]['desc'])) {
$macro_desc_value = $macros[$i]['desc'];
}
if (isset($macros[$i]['help'])) {
$macro_help_value = $macros[$i]['help'];
}
if (isset($macros[$i]['value'])) {
$macro_value_value = $macros[$i]['value'];
}
if (isset($macros[$i]['hide'])) {
$macro_hide_value_value = $macros[$i]['hide'];
}
$datam = [];
$datam[0] = __('Description')."<span style='font-weight: normal'> ($macro_name)</span>";
$datam[0] .= html_print_input_hidden($macro_name_name, $macro_name, true);
$datam[1] = html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, $locked, '', "class='command_advanced_conf'", true);
if ($locked) {
$datam[1] .= html_print_image('images/lock.png', true, ['class' => 'command_advanced_conf']);
}
$datam[2] = __('Default value')."<span style='font-weight: normal'> ($macro_name)</span>";
$datam[3] = html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, $locked, '', "class='command_component command_advanced_conf'", true);
if ($locked) {
$datam[3] .= html_print_image('images/lock.png', true, ['class' => 'command_advanced_conf']);
}
$table->data['recon_'.$next_name_number] = $datam;
$next_name_number++;
$table->colspan['recon_'.$next_name_number][1] = 3;
$datam = [];
$datam[0] = __('Hide value').ui_print_help_tip(__('This field will show up as dots like a password'), true);
$datam[1] = html_print_checkbox_extended($macro_hide_value_name, 1, $macro_hide_value_value, 0, '', ['class' => 'command_advanced_conf'], true, 'checkbox-'.$macro_hide_value_name);
$table->data['recon_'.$next_name_number] = $datam;
$next_name_number++;
$table->colspan['recon_'.$next_name_number][1] = 3;
$datam = [];
$datam[0] = __('Help')."<span style='font-weight: normal'> ($macro_name)</span><br><br><br>";
$tadisabled = $locked === true ? ' disabled' : '';
$datam[1] = html_print_textarea($macro_help_name, 6, 100, $macro_help_value, 'class="command_advanced_conf" style="width: 97%;"'.$tadisabled, true);
if ($locked) {
$datam[1] .= html_print_image('images/lock.png', true, ['class' => 'command_advanced_conf']);
}
$datam[1] .= '<br><br><br>';
$table->data['recon_'.$next_name_number] = $datam;
$next_name_number++;
$i++;
}
if (!$locked) {
$datam = [];
$datam[0] = '<span style="font-weight: bold">'.__('Add macro').'</span> <a href="javascript:new_macro(\'table-form-recon_\');update_preview();">'.html_print_image('images/add.png', true).'</a>';
$datam[0] .= '<div id="next_macro" style="display:none">'.$i.'</div>';
$datam[0] .= '<div id="next_row" style="display:none">'.$next_name_number.'</div>';
$delete_macro_style = '';
if ($i <= 2) {
$delete_macro_style = 'display:none;';
}
$datam[2] = '<div id="delete_macro_button" style="'.$delete_macro_style.'">'.__('Delete macro').' <a href="javascript:delete_macro_form(\'table-form-recon_\');update_preview();">'.html_print_image('images/delete.png', true).'</a></div>';
$table->colspan['recon_action'][0] = 2;
$table->rowstyle['recon_action'] = 'text-align:center';
$table->colspan['recon_action'][2] = 2;
$table->data['recon_action'] = $datam;
}
html_print_table($table);
echo '<table width=100%>';
echo '<tr><td align="right">';
if ($create != '') {
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>";
} else {
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('Update')."'>";
}
echo '</form></table>';
} else {
ui_print_page_header(__('Recon scripts registered on %s', get_product_name()), 'images/gm_servers.png', false, '', true);
// Update reconscript
if (isset($_GET['update_reconscript'])) {
// if modified any parameter
$id_recon_script = get_parameter('update_reconscript', 0);
$reconscript_name = get_parameter('form_name', '');
$reconscript_description = get_parameter('form_description', '');
$reconscript_script = get_parameter('form_script', '');
// Get macros
$i = 1;
$macros = [];
while (1) {
$macro = (string) get_parameter('field'.$i.'_macro');
if ($macro == '') {
break;
}
$desc = (string) get_parameter('field'.$i.'_desc');
$help = (string) get_parameter('field'.$i.'_help');
$value = (string) get_parameter('field'.$i.'_value');
$hide = get_parameter('field'.$i.'_hide');
$macros[$i]['macro'] = $macro;
$macros[$i]['desc'] = $desc;
$macros[$i]['help'] = $help;
$macros[$i]['value'] = $value;
$macros[$i]['hide'] = $hide;
$i++;
}
$macros = io_json_mb_encode($macros);
$sql_update = "UPDATE trecon_script SET
name = '$reconscript_name',
description = '$reconscript_description',
script = '$reconscript_script',
macros = '$macros'
WHERE id_recon_script = $id_recon_script";
$result = false;
if ($reconscript_name != '' && $reconscript_script != '') {
$result = db_process_sql($sql_update);
}
if (! $result) {
ui_print_error_message(__('Problem updating'));
} else {
ui_print_success_message(__('Updated successfully'));
}
}
// Create reconscript
if (isset($_GET['create_reconscript'])) {
$reconscript_name = get_parameter('form_name', '');
$reconscript_description = get_parameter('form_description', '');
$reconscript_script = get_parameter('form_script', '');
// Get macros
$i = 1;
$macros = [];
while (1) {
$macro = (string) get_parameter('field'.$i.'_macro');
if ($macro == '') {
break;
}
$desc = (string) get_parameter('field'.$i.'_desc');
$help = (string) get_parameter('field'.$i.'_help');
$value = (string) get_parameter('field'.$i.'_value');
$hide = get_parameter('field'.$i.'_hide');
$macros[$i]['macro'] = $macro;
$macros[$i]['desc'] = $desc;
$macros[$i]['help'] = $help;
$macros[$i]['value'] = $value;
$macros[$i]['hide'] = $hide;
$i++;
}
$macros = io_json_mb_encode($macros);
$values = [
'name' => $reconscript_name,
'description' => $reconscript_description,
'script' => $reconscript_script,
'macros' => $macros,
];
$result = false;
if ($values['name'] != '' && $values['script'] != '') {
$result = db_process_sql_insert('trecon_script', $values);
}
if (! $result) {
ui_print_error_message(__('Problem creating'));
} else {
ui_print_success_message(__('Created successfully'));
}
}
if (isset($_GET['kill_reconscript'])) {
// if delete alert
$reconscript_id = get_parameter('kill_reconscript', 0);
$result = db_process_sql_delete(
'trecon_script',
['id_recon_script' => $reconscript_id]
);
if (! $result) {
ui_print_error_message(__('Problem deleting reconscript'));
} else {
ui_print_success_message(__('reconscript deleted successfully'));
}
if ($reconscript_id != 0) {
$result = db_process_sql_delete(
'trecon_task',
['id_recon_script' => $reconscript_id]
);
}
}
// If not edition or insert, then list available reconscripts
$rows = db_get_all_rows_in_table('trecon_script');
if ($rows !== false) {
echo '<table width="100%" cellspacing="4" cellpadding="4" class="databox data">';
echo '<th>'.__('Name').'</th>';
echo '<th>'.__('Description').'</th>';
echo '<th>'.__('Delete').'</th>';
$color = 0;
foreach ($rows as $row) {
if ($color == 1) {
$tdcolor = 'datos';
$color = 0;
} else {
$tdcolor = 'datos2';
$color = 1;
}
echo '<tr>';
echo "<td class='$tdcolor' style='min-width: 100px;'>";
echo "<b><a href='index.php?sec=gservers&sec2=godmode/servers/recon_script&view=".$row['id_recon_script']."'>";
echo $row['name'];
echo '</a></b></td>';
echo "</td><td class='$tdcolor'>";
$desc = io_safe_output($row['description']);
$desc = str_replace("\n", '<br>', $desc);
echo $desc.'<br><br>';
echo '<b>'.__('Command').': </b><i>'.$row['script'].'</i>';
echo "</td><td align='center' class='$tdcolor'>";
echo "<a href='index.php?sec=gservers&sec2=godmode/servers/recon_script&kill_reconscript=".$row['id_recon_script']."'>".html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
echo '</td></tr>';
}
echo '</table>';
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no recon scripts in the system') ]);
}
echo '<table width=100%>';
echo '<tr><td align=right>';
echo "<form name=reconscript method='post' action='index.php?sec=gservers&sec2=godmode/servers/recon_script&create=1'>";
echo "<input name='crtbutton' type='submit' class='sub next' value='".__('Add')."'>";
echo '</td></tr></table>';
}
ui_require_javascript_file('pandora_modules');

View File

@ -536,6 +536,19 @@ $table->data[] = [
), ),
]; ];
$table->data[] = [
__('Max. days before delete old network matrix data'),
html_print_input_text(
'delete_old_network_matrix',
$config['delete_old_network_matrix'],
'',
5,
5,
true
),
];
$table_other = new stdClass(); $table_other = new stdClass();
$table_other->width = '100%'; $table_other->width = '100%';
$table_other->class = 'databox filters'; $table_other->class = 'databox filters';

View File

@ -131,6 +131,14 @@ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
$table->data[19][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true); $table->data[19][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true);
$table->data[21][0] = __('Enable Network Traffic Analyzer');
$table->data[21][1] = html_print_switch(
[
'name' => 'activate_nta',
'value' => $config['activate_nta'],
]
);
$zone_name = [ $zone_name = [
'Africa' => __('Africa'), 'Africa' => __('Africa'),

View File

@ -243,7 +243,7 @@ function logo_custom_enterprise($name, $logo)
false, false,
true, true,
'', '',
$open, false,
'width:240px' 'width:240px'
); );
return $select; return $select;
@ -259,7 +259,7 @@ function logo_custom_enterprise($name, $logo)
false, false,
true, true,
'', '',
$open, true,
'width:240px' 'width:240px'
); );
return $select; return $select;
@ -462,6 +462,20 @@ if (enterprise_installed()) {
$row++; $row++;
} }
// Title Header
if (enterprise_installed()) {
$table_styles->data[$row][0] = __('Title (header)');
$table_styles->data[$row][1] = html_print_input_text('custom_title_header', $config['custom_title_header'], '', 50, 40, true);
$row++;
}
// Subtitle Header
if (enterprise_installed()) {
$table_styles->data[$row][0] = __('Subtitle (header)');
$table_styles->data[$row][1] = html_print_input_text('custom_subtitle_header', $config['custom_subtitle_header'], '', 50, 40, true);
$row++;
}
// login title1 // login title1
if (enterprise_installed()) { if (enterprise_installed()) {
$table_styles->data[$row][0] = __('Title 1 (login)'); $table_styles->data[$row][0] = __('Title 1 (login)');

View File

@ -30,7 +30,10 @@ require_once __DIR__.'/Wizard.main.php';
require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_reports.php'; require_once $config['homedir'].'/include/functions_reports.php';
require_once $config['homedir'].'/include/functions_cron.php'; require_once $config['homedir'].'/include/functions_cron.php';
enterprise_include('include/functions_tasklist.php'); enterprise_include_once('include/functions_tasklist.php');
enterprise_include_once('include/functions_cron.php');
ui_require_css_file('task_list');
/** /**
* Defined as wizard to guide user to explore running tasks. * Defined as wizard to guide user to explore running tasks.
@ -93,7 +96,8 @@ class DiscoveryTaskList extends Wizard
] ]
); );
$this->printHeader(); // Header
ui_print_page_header(__('Task list'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
// Show redirected messages from discovery.php. // Show redirected messages from discovery.php.
if ($status === 0) { if ($status === 0) {
@ -237,7 +241,7 @@ class DiscoveryTaskList extends Wizard
$id_console_task = (int) get_parameter('id_console_task'); $id_console_task = (int) get_parameter('id_console_task');
if ($id_console_task !== null) { if ($id_console_task !== null) {
enterprise_include('cron_task_run', $id_console_task, true); enterprise_hook('cron_task_run', [$id_console_task, true]);
// Trick to avoid double execution. // Trick to avoid double execution.
header('Location: '.$this->url); header('Location: '.$this->url);
} }
@ -345,6 +349,8 @@ class DiscoveryTaskList extends Wizard
$recon_tasks = []; $recon_tasks = [];
} }
$url_ajax = $config['homeurl'].'ajax.php';
$table = new StdClass(); $table = new StdClass();
$table->cellpadding = 4; $table->cellpadding = 4;
$table->cellspacing = 4; $table->cellspacing = 4;
@ -424,7 +430,16 @@ class DiscoveryTaskList extends Wizard
$data[0] = ''; $data[0] = '';
} }
$data[1] = '<b>'.$task['name'].'</b>'; // Name task.
$data[1] = '';
if ($task['disabled'] != 2) {
$data[1] .= '<a href="#" onclick="progress_task_list('.$task['id_rt'].',\''.$task['name'].'\')">';
}
$data[1] .= '<b>'.$task['name'].'</b>';
if ($task['disabled'] != 2) {
$data[1] .= '</a>';
}
$data[2] = $server_name; $data[2] = $server_name;
@ -488,6 +503,24 @@ class DiscoveryTaskList extends Wizard
$data[8] = __('Not executed yet'); $data[8] = __('Not executed yet');
} }
if ($task['disabled'] != 2) {
$data[9] = '<a href="#" onclick="progress_task_list('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image(
'images/eye.png',
true
);
$data[9] .= '</a>';
}
if ($task['disabled'] != 2 && $task['utimestamp'] > 0) {
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image(
'images/dynamic_network_icon.png',
true
);
$data[9] .= '</a>';
}
if (check_acl( if (check_acl(
$config['id_user'], $config['id_user'],
$task['id_group'], $task['id_group'],
@ -495,7 +528,7 @@ class DiscoveryTaskList extends Wizard
) )
) { ) {
if ($ipam === true) { if ($ipam === true) {
$data[9] = '<a href="'.ui_get_full_url( $data[9] .= '<a href="'.ui_get_full_url(
sprintf( sprintf(
'index.php?sec=godmode/extensions&sec2=enterprise/extensions/ipam&action=edit&id=%d', 'index.php?sec=godmode/extensions&sec2=enterprise/extensions/ipam&action=edit&id=%d',
$tipam_task_id $tipam_task_id
@ -512,7 +545,7 @@ class DiscoveryTaskList extends Wizard
).'</a>'; ).'</a>';
} else { } else {
// Check if is a H&D, Cloud or Application or IPAM. // Check if is a H&D, Cloud or Application or IPAM.
$data[9] = '<a href="'.ui_get_full_url( $data[9] .= '<a href="'.ui_get_full_url(
sprintf( sprintf(
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d', 'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
$this->getTargetWiz($task), $this->getTargetWiz($task),
@ -533,6 +566,9 @@ class DiscoveryTaskList extends Wizard
$data[9] = ''; $data[9] = '';
} }
// Div neccesary for modal progress task.
echo '<div id="progress_task_'.$task['id_rt'].'" style="display:none"></div>';
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -544,7 +580,12 @@ class DiscoveryTaskList extends Wizard
html_print_table($table); html_print_table($table);
} }
unset($table); // Div neccesary for modal map task.
echo '<div id="map_task" style="display:none"></div>';
unset($table);
ui_require_javascript_file('pandora_taskList');
} }
return true; return true;
@ -583,7 +624,12 @@ class DiscoveryTaskList extends Wizard
return 'wiz=ctask'; return 'wiz=ctask';
default: default:
return 'wiz=hd&mode=netscan'; if ($task['id_recon_script'] === null) {
return 'wiz=hd&mode=netscan';
} else {
return 'wiz=hd&mode=customnetscan';
}
break;
} }
} }

View File

@ -28,7 +28,10 @@
require_once __DIR__.'/Wizard.main.php'; require_once __DIR__.'/Wizard.main.php';
require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_users.php';
enterprise_include('include/class/CSVImportAgents.class.php'); require_once $config['homedir'].'/include/class/CustomNetScan.class.php';
require_once $config['homedir'].'/include/class/ManageNetScanScripts.class.php';
enterprise_include_once('include/class/CSVImportAgents.class.php');
enterprise_include_once('include/functions_hostdevices.php'); enterprise_include_once('include/functions_hostdevices.php');
/** /**
@ -117,6 +120,7 @@ class HostDevices extends Wizard
'icon' => 'images/wizard/netscan.png', 'icon' => 'images/wizard/netscan.png',
'label' => __('Net Scan'), 'label' => __('Net Scan'),
]; ];
if (enterprise_installed()) { if (enterprise_installed()) {
$buttons[] = [ $buttons[] = [
'url' => $this->url.'&mode=importcsv', 'url' => $this->url.'&mode=importcsv',
@ -125,6 +129,18 @@ class HostDevices extends Wizard
]; ];
} }
$buttons[] = [
'url' => $this->url.'&mode=customnetscan',
'icon' => '/images/wizard/customnetscan.png',
'label' => __('Custom NetScan'),
];
$buttons[] = [
'url' => $this->url.'&mode=managenetscanscripts',
'icon' => '/images/wizard/managenetscanscripts.png',
'label' => __('Manage NetScan scripts'),
];
$this->prepareBreadcrum( $this->prepareBreadcrum(
[ [
[ [
@ -136,19 +152,38 @@ class HostDevices extends Wizard
] ]
); );
$this->printHeader(); ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
$this->printBigButtonsList($buttons); $this->printBigButtonsList($buttons);
return; return;
} }
if (enterprise_installed()) { if (enterprise_installed()) {
if ($mode == 'importcsv') { if ($mode === 'importcsv') {
$csv_importer = new CSVImportAgents($this->page, $this->breadcrum); $csv_importer = new CSVImportAgents(
$this->page,
$this->breadcrum
);
return $csv_importer->runCSV(); return $csv_importer->runCSV();
} }
} }
if ($mode === 'customnetscan') {
$customnetscan_importer = new CustomNetScan(
$this->page,
$this->breadcrum
);
return $customnetscan_importer->runCustomNetScan();
}
if ($mode === 'managenetscanscripts') {
$managenetscanscript_importer = new ManageNetScanScripts(
$this->page,
$this->breadcrum
);
return $managenetscanscript_importer->runManageNetScanScript();
}
if ($mode == 'netscan') { if ($mode == 'netscan') {
return $this->runNetScan(); return $this->runNetScan();
} }
@ -477,9 +512,15 @@ class HostDevices extends Wizard
$task_url = '&task='.$this->task['id_rt']; $task_url = '&task='.$this->task['id_rt'];
} }
$breadcrum[] = [ $breadcrum = [
'link' => 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd', [
'label' => __($this->label), 'link' => 'index.php?sec=gservers&sec2=godmode/servers/discovery',
'label' => 'Discovery',
],
[
'link' => 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd',
'label' => __($this->label),
],
]; ];
for ($i = 0; $i < $this->maxPagesNetScan; $i++) { for ($i = 0; $i < $this->maxPagesNetScan; $i++) {
$breadcrum[] = [ $breadcrum[] = [
@ -492,7 +533,7 @@ class HostDevices extends Wizard
if ($this->page < $this->maxPagesNetScan) { if ($this->page < $this->maxPagesNetScan) {
// Avoid to print header out of wizard. // Avoid to print header out of wizard.
$this->prepareBreadcrum($breadcrum); $this->prepareBreadcrum($breadcrum);
$this->printHeader(); ui_print_page_header(__('NetScan'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
} }
if (isset($this->page) === true if (isset($this->page) === true

View File

@ -26,14 +26,15 @@
* ============================================================================ * ============================================================================
*/ */
define('CLOUDWIZARD_AWS_DESCRIPTION', 'Discovery.Cloud.AWS.EC2'); // Begin.
/**
* Global Wizard generic class. Needs to be inherited. /**
* * Global Wizard generic class. Needs to be inherited.
* Used in Hostdevices class, Applications class and others, is the core of *
* Discovery proyect. * Used in Hostdevices class, Applications class and others, is the core of
*/ * Discovery proyect.
*/
class Wizard class Wizard
{ {
@ -195,20 +196,38 @@ class Wizard
* *
* @return void * @return void
*/ */
public function prepareBreadcrum(array $urls, bool $add=false) public function prepareBreadcrum(array $urls, bool $add=false, bool $separator_beginning=false)
{ {
$bc = []; $bc = [];
$i = 0; $i = 0;
$count = 0;
$array_size = count($urls);
foreach ($urls as $url) { foreach ($urls as $url) {
$count++;
if ($url['selected'] == 1) { if ($url['selected'] == 1) {
$class = 'selected'; $class = 'selected';
} else { } else {
$class = ''; $class = '';
} }
$bc[$i] = '<a href="'.$url['link'].'" class="text_color">'; $bc[$i] = '';
$bc[$i] .= '<div class="arrow_box '.$class.'">'.$url['label'];
$bc[$i++] .= '</div></a>'; if ($separator_beginning === true) {
$bc[$i] .= '<span class="breadcrumb_link">&nbsp/&nbsp</span>';
}
$bc[$i] .= '<span><a class="breadcrumb_link '.$class.'" href="'.$url['link'].'">';
$bc[$i] .= $url['label'];
$bc[$i] .= '</a>';
if ($count < $array_size) {
$bc[$i] .= '<span class="breadcrumb_link">&nbsp/&nbsp</span>';
}
$bc[$i] .= '</span>';
$i++;
} }
if ($add === true) { if ($add === true) {
@ -256,7 +275,7 @@ class Wizard
*/ */
public function printBreadcrum() public function printBreadcrum()
{ {
return '<h1 class="wizard">'.implode('', $this->breadcrum).'</h1>'; return implode('', $this->breadcrum);
} }
@ -572,14 +591,18 @@ class Wizard
{ {
$output = ''; $output = '';
if ($input['hidden'] == 1) { if ($input['hidden'] == 1) {
$class = ' class="hidden"'; $class = ' hidden';
} else { } else {
$class = ''; $class = '';
} }
if (isset($input['class']) === true) {
$class = $input['class'].$class;
}
if (is_array($input['block_content']) === true) { if (is_array($input['block_content']) === true) {
// Print independent block of inputs. // Print independent block of inputs.
$output .= '<li id="'.$input['block_id'].'" '.$class.'>'; $output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
$output .= '<ul class="wizard">'; $output .= '<ul class="wizard">';
foreach ($input['block_content'] as $input) { foreach ($input['block_content'] as $input) {
$output .= $this->printBlock($input, $return); $output .= $this->printBlock($input, $return);
@ -588,7 +611,7 @@ class Wizard
$output .= '</ul></li>'; $output .= '</ul></li>';
} else { } else {
if ($input['arguments']['type'] != 'hidden') { if ($input['arguments']['type'] != 'hidden') {
$output .= '<li id="'.$input['id'].'" '.$class.'>'; $output .= '<li id="'.$input['id'].'" class="'.$class.'">';
$output .= '<label>'.$input['label'].'</label>'; $output .= '<label>'.$input['label'].'</label>';
$output .= $this->printInput($input['arguments']); $output .= $this->printInput($input['arguments']);
// Allow dynamic content. // Allow dynamic content.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 443 B

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