mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge remote-tracking branch 'origin/develop' into ent-11607-migracion-de-discovery-bajo-demanda
This commit is contained in:
commit
0afac84b34
@ -78,16 +78,16 @@ cd unix && ./pandora_agent_installer --install
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
install_autodiscover () {
|
# install_autodiscover () {
|
||||||
local arch=$1
|
# local arch=$1
|
||||||
wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
|
# wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
|
||||||
unzip autodiscover-linux.zip
|
# unzip autodiscover-linux.zip
|
||||||
chmod +x $arch/autodiscover
|
# chmod +x $arch/autodiscover
|
||||||
mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
|
# mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
|
||||||
}
|
# }
|
||||||
|
|
||||||
## Main
|
## Main
|
||||||
echo "Starting PandoraFMS Agent deployment ver. $S_VERSION"
|
echo "Starting PandoraFMS Agent binary deployment ver. $S_VERSION"
|
||||||
|
|
||||||
execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP'
|
execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP'
|
||||||
|
|
||||||
@ -104,8 +104,6 @@ OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release
|
|||||||
[[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS
|
[[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS
|
||||||
[[ $OS =~ 'fedora' ]] && OS_RELEASE=$OS
|
[[ $OS =~ 'fedora' ]] && OS_RELEASE=$OS
|
||||||
[[ $OS =~ 'debian' ]] && OS_RELEASE=$OS
|
[[ $OS =~ 'debian' ]] && OS_RELEASE=$OS
|
||||||
#[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS
|
|
||||||
#[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS
|
|
||||||
|
|
||||||
# initialice logfile
|
# initialice logfile
|
||||||
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
||||||
@ -126,6 +124,30 @@ check_repo_connection
|
|||||||
execute_cmd "grep --version" 'Checking needed tools: grep'
|
execute_cmd "grep --version" 'Checking needed tools: grep'
|
||||||
execute_cmd "sed --version" 'Checking needed tools: sed'
|
execute_cmd "sed --version" 'Checking needed tools: sed'
|
||||||
|
|
||||||
|
# Arch check
|
||||||
|
arch=$(uname -m)
|
||||||
|
case $arch in
|
||||||
|
|
||||||
|
x86_64)
|
||||||
|
echo -e "${cyan}Arch: $arch ${reset} "
|
||||||
|
;;
|
||||||
|
|
||||||
|
x86)
|
||||||
|
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||||
|
exit -1
|
||||||
|
;;
|
||||||
|
|
||||||
|
armv7l)
|
||||||
|
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||||
|
exit -1
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||||
|
exit -1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Creating working directory
|
# Creating working directory
|
||||||
rm -rf $HOME/pandora_deploy_tmp/ &>> $LOGFILE
|
rm -rf $HOME/pandora_deploy_tmp/ &>> $LOGFILE
|
||||||
mkdir $HOME/pandora_deploy_tmp &>> $LOGFILE
|
mkdir $HOME/pandora_deploy_tmp &>> $LOGFILE
|
||||||
@ -148,6 +170,10 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
|
|||||||
# Check rh version
|
# Check rh version
|
||||||
if [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] ; then
|
if [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] ; then
|
||||||
package_manager_cmd=dnf
|
package_manager_cmd=dnf
|
||||||
|
execute_cmd "$package_manager_cmd install -y libnsl" "Installing dependencies"
|
||||||
|
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '9' ] ; then
|
||||||
|
package_manager_cmd=dnf
|
||||||
|
execute_cmd "$package_manager_cmd install -y libnsl libxcrypt-compat" "Installing dependencies"
|
||||||
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '7' ] ; then
|
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '7' ] ; then
|
||||||
package_manager_cmd=yum
|
package_manager_cmd=yum
|
||||||
|
|
||||||
@ -158,24 +184,23 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
|
|||||||
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
|
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
|
||||||
|
|
||||||
# Insatall pandora agent
|
# Insatall pandora agent
|
||||||
$package_manager_cmd install -y http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE
|
[ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm "
|
||||||
echo -en "${cyan}Installing Pandora FMS agent...${reset}"
|
execute_cmd "$package_manager_cmd install -y ${PANDORA_AGENT_PACKAGE_EL}" 'Installing Pandora FMS agent package'
|
||||||
check_cmd_status 'Error installing Pandora FMS agent'
|
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
|
||||||
[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $OS_RELEASE == 'debian' ]]; then
|
if [[ $OS_RELEASE == 'debian' ]]; then
|
||||||
|
[ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG_x86_64.tar.gz'
|
||||||
execute_cmd "apt update" 'Updating repos'
|
execute_cmd "apt update" 'Updating repos'
|
||||||
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
|
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
|
||||||
execute_cmd 'wget http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package'
|
execute_cmd "curl --output pandorafms_agent_linux-7.0NG.tar.gz ${PANDORA_AGENT_PACKAGE_UBUNTU}" 'Downloading Pandora FMS agent package'
|
||||||
execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent'
|
execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent'
|
||||||
[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
|
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
|
||||||
cd $HOME/pandora_deploy_tmp
|
cd $HOME/pandora_deploy_tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configuring Agente
|
# Configuring Agente
|
||||||
|
|
||||||
[[ $PANDORA_SERVER_IP ]] && sed -i "s/^server_ip.*$/server_ip $PANDORA_SERVER_IP/g" $PANDORA_AGENT_CONF
|
[[ $PANDORA_SERVER_IP ]] && sed -i "s/^server_ip.*$/server_ip $PANDORA_SERVER_IP/g" $PANDORA_AGENT_CONF
|
||||||
[[ $PANDORA_REMOTE_CONFIG ]] && sed -i "s/^remote_config.*$/remote_config $PANDORA_REMOTE_CONFIG/g" $PANDORA_AGENT_CONF
|
[[ $PANDORA_REMOTE_CONFIG ]] && sed -i "s/^remote_config.*$/remote_config $PANDORA_REMOTE_CONFIG/g" $PANDORA_AGENT_CONF
|
||||||
[[ $PANDORA_GROUP ]] && sed -i "s/^group.*$/group $PANDORA_GROUP/g" $PANDORA_AGENT_CONF
|
[[ $PANDORA_GROUP ]] && sed -i "s/^group.*$/group $PANDORA_GROUP/g" $PANDORA_AGENT_CONF
|
||||||
@ -187,27 +212,6 @@ fi
|
|||||||
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
|
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
|
||||||
|
|
||||||
|
|
||||||
#installing autodiscover
|
|
||||||
|
|
||||||
arch=$(uname -m)
|
|
||||||
case $arch in
|
|
||||||
|
|
||||||
x86_64)
|
|
||||||
execute_cmd 'install_autodiscover x86_64' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
|
|
||||||
;;
|
|
||||||
|
|
||||||
x86)
|
|
||||||
execute_cmd 'install_autodiscover x84' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
|
|
||||||
;;
|
|
||||||
|
|
||||||
armv7l)
|
|
||||||
echo -e "${cyan}Skiping autodiscover installation arch $arch not suported${reset}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo -e "${yellow}Skiping autodiscover installation arch $arch not suported${reset}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
#Starting pandora agent daemon.
|
#Starting pandora agent daemon.
|
||||||
execute_cmd '/etc/init.d/pandora_agent_daemon restart' 'Starting Pandora Agent'
|
execute_cmd '/etc/init.d/pandora_agent_daemon restart' 'Starting Pandora Agent'
|
||||||
|
@ -166,7 +166,7 @@ module_description User CPU Usage (%)
|
|||||||
module_min_warning 70
|
module_min_warning 70
|
||||||
module_max_warning 90
|
module_max_warning 90
|
||||||
module_min_critical 91
|
module_min_critical 91
|
||||||
module_max_critical 100
|
module_max_critical 0
|
||||||
module_unit %
|
module_unit %
|
||||||
module_end
|
module_end
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ module_description CPU Load (%)
|
|||||||
module_min_warning 80
|
module_min_warning 80
|
||||||
module_max_warning 90
|
module_max_warning 90
|
||||||
module_min_critical 91
|
module_min_critical 91
|
||||||
module_max_critical 100
|
module_max_critical 0
|
||||||
module_end
|
module_end
|
||||||
|
|
||||||
# Number processes
|
# Number processes
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-agent-unix
|
package: pandorafms-agent-unix
|
||||||
Version: 7.0NG.773.3-230904
|
Version: 7.0NG.773.3-230908
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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.773.3-230904"
|
pandora_version="7.0NG.773.3-230908"
|
||||||
|
|
||||||
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
|
||||||
|
@ -187,7 +187,7 @@ module_description User CPU Usage (%)
|
|||||||
module_min_warning 70
|
module_min_warning 70
|
||||||
module_max_warning 90
|
module_max_warning 90
|
||||||
module_min_critical 91
|
module_min_critical 91
|
||||||
module_max_critical 100
|
module_max_critical 0
|
||||||
module_end
|
module_end
|
||||||
|
|
||||||
#Get load average
|
#Get load average
|
||||||
|
@ -219,7 +219,7 @@ module_description User CPU Usage (%)
|
|||||||
module_min_warning 70
|
module_min_warning 70
|
||||||
module_max_warning 90
|
module_max_warning 90
|
||||||
module_min_critical 91
|
module_min_critical 91
|
||||||
module_max_critical 100
|
module_max_critical 0
|
||||||
module_unit %
|
module_unit %
|
||||||
module_group System
|
module_group System
|
||||||
module_end
|
module_end
|
||||||
|
@ -1031,7 +1031,7 @@ my $Sem = undef;
|
|||||||
my $ThreadSem = undef;
|
my $ThreadSem = undef;
|
||||||
|
|
||||||
use constant AGENT_VERSION => '7.0NG.773.3';
|
use constant AGENT_VERSION => '7.0NG.773.3';
|
||||||
use constant AGENT_BUILD => '230904';
|
use constant AGENT_BUILD => '230908';
|
||||||
|
|
||||||
# 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;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
%define name pandorafms_agent_linux_bin
|
%define name pandorafms_agent_linux_bin
|
||||||
%define source_name pandorafms_agent_linux
|
%define source_name pandorafms_agent_linux
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, binary version
|
Summary: Pandora FMS Linux agent, binary version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.773.3"
|
PI_VERSION="7.0NG.773.3"
|
||||||
PI_BUILD="230904"
|
PI_BUILD="230908"
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
|
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
@ -165,7 +165,7 @@ module_description User CPU Usage (%)
|
|||||||
module_min_warning 70
|
module_min_warning 70
|
||||||
module_max_warning 90
|
module_max_warning 90
|
||||||
module_min_critical 91
|
module_min_critical 91
|
||||||
module_max_critical 100
|
module_max_critical 0
|
||||||
module_unit %
|
module_unit %
|
||||||
module_group System
|
module_group System
|
||||||
module_end
|
module_end
|
||||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Version
|
Version
|
||||||
{230904}
|
{230908}
|
||||||
|
|
||||||
ViewReadme
|
ViewReadme
|
||||||
{Yes}
|
{Yes}
|
||||||
|
@ -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.773.3 Build 230904")
|
#define PANDORA_VERSION ("7.0NG.773.3 Build 230908")
|
||||||
|
|
||||||
string pandora_path;
|
string pandora_path;
|
||||||
string pandora_dir;
|
string pandora_dir;
|
||||||
|
@ -11,7 +11,7 @@ BEGIN
|
|||||||
VALUE "LegalCopyright", "Pandora FMS"
|
VALUE "LegalCopyright", "Pandora FMS"
|
||||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||||
VALUE "ProductVersion", "(7.0NG.773.3(Build 230904))"
|
VALUE "ProductVersion", "(7.0NG.773.3(Build 230908))"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "1.0.0.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-console
|
package: pandorafms-console
|
||||||
Version: 7.0NG.773.3-230904
|
Version: 7.0NG.773.3-230908
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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.773.3-230904"
|
pandora_version="7.0NG.773.3-230908"
|
||||||
|
|
||||||
package_pear=0
|
package_pear=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE `ttrap` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
UPDATE ttrap SET utimestamp=UNIX_TIMESTAMP(timestamp);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
|
CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
|
||||||
`id` INT NOT NULL auto_increment,
|
`id` INT NOT NULL auto_increment,
|
||||||
`filter_name` VARCHAR(45) NULL,
|
`filter_name` VARCHAR(45) NULL,
|
||||||
@ -18,4 +22,26 @@ UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
|||||||
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||||
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||||
|
|
||||||
|
ALTER TABLE `tsesion_filter_log_viewer`
|
||||||
|
CHANGE COLUMN `date_range` `custom_date` INT NULL DEFAULT NULL ,
|
||||||
|
CHANGE COLUMN `start_date_defined` `date` VARCHAR(45) NULL DEFAULT NULL ,
|
||||||
|
CHANGE COLUMN `start_date_time` `date_text` VARCHAR(45) NULL DEFAULT NULL ,
|
||||||
|
CHANGE COLUMN `start_date_date` `date_units` VARCHAR(45) NULL DEFAULT NULL ,
|
||||||
|
CHANGE COLUMN `start_date_date_range` `date_init` VARCHAR(45) NULL DEFAULT NULL ,
|
||||||
|
CHANGE COLUMN `start_date_time_range` `time_init` VARCHAR(45) NULL DEFAULT NULL ,
|
||||||
|
CHANGE COLUMN `end_date_date_range` `date_end` VARCHAR(45) NULL DEFAULT NULL ,
|
||||||
|
CHANGE COLUMN `end_date_time_range` `time_end` VARCHAR(45) NULL DEFAULT NULL ;
|
||||||
|
|
||||||
|
ALTER TABLE `tsesion_filter`
|
||||||
|
CHANGE COLUMN `period` `date_text` VARCHAR(45) NULL DEFAULT NULL AFTER `user`;
|
||||||
|
|
||||||
|
ALTER TABLE `tsesion_filter`
|
||||||
|
ADD COLUMN `custom_date` INT NULL AFTER `user`,
|
||||||
|
ADD COLUMN `date` VARCHAR(45) NULL AFTER `custom_date`,
|
||||||
|
ADD COLUMN `date_units` VARCHAR(45) NULL AFTER `date_text`,
|
||||||
|
ADD COLUMN `date_init` VARCHAR(45) NULL AFTER `date_units`,
|
||||||
|
ADD COLUMN `time_init` VARCHAR(45) NULL AFTER `date_init`,
|
||||||
|
ADD COLUMN `date_end` VARCHAR(45) NULL AFTER `time_init`,
|
||||||
|
ADD COLUMN `time_end` VARCHAR(45) NULL AFTER `date_end`;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
@ -1475,13 +1475,13 @@ if ($update_module === true || $create_module === true) {
|
|||||||
$plugin_pass = io_input_password(
|
$plugin_pass = io_input_password(
|
||||||
(string) get_parameter('snmp3_auth_pass')
|
(string) get_parameter('snmp3_auth_pass')
|
||||||
);
|
);
|
||||||
$plugin_parameter = (string) get_parameter('snmp3_auth_method');
|
$plugin_parameter = (string) get_parameter('snmp3_auth_method', 'MD5');
|
||||||
|
|
||||||
$custom_string_1 = (string) get_parameter('snmp3_privacy_method');
|
$custom_string_1 = (string) get_parameter('snmp3_privacy_method', 'DES');
|
||||||
$custom_string_2 = io_input_password(
|
$custom_string_2 = io_input_password(
|
||||||
(string) get_parameter('snmp3_privacy_pass')
|
(string) get_parameter('snmp3_privacy_pass')
|
||||||
);
|
);
|
||||||
$custom_string_3 = (string) get_parameter('snmp3_security_level');
|
$custom_string_3 = (string) get_parameter('snmp3_security_level', 'noAuthNoPriv');
|
||||||
} else if ($id_module_type >= 34 && $id_module_type <= 37) {
|
} else if ($id_module_type >= 34 && $id_module_type <= 37) {
|
||||||
$tcp_send = (string) get_parameter('command_text');
|
$tcp_send = (string) get_parameter('command_text');
|
||||||
$custom_string_1 = (string) get_parameter(
|
$custom_string_1 = (string) get_parameter(
|
||||||
|
@ -459,10 +459,10 @@ if ($id_agent_module) {
|
|||||||
$snmp_version = 1;
|
$snmp_version = 1;
|
||||||
$snmp3_auth_user = '';
|
$snmp3_auth_user = '';
|
||||||
$snmp3_auth_pass = '';
|
$snmp3_auth_pass = '';
|
||||||
$snmp3_auth_method = '';
|
$snmp3_auth_method = 'MD5';
|
||||||
$snmp3_privacy_method = '';
|
$snmp3_privacy_method = 'DES';
|
||||||
$snmp3_privacy_pass = '';
|
$snmp3_privacy_pass = '';
|
||||||
$snmp3_security_level = '';
|
$snmp3_security_level = 'noAuthNoPriv';
|
||||||
|
|
||||||
// For Remote CMD.
|
// For Remote CMD.
|
||||||
$command_text = '';
|
$command_text = '';
|
||||||
|
@ -405,7 +405,22 @@ push_table_simple($data, 'field_snmpv3_row1');
|
|||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = __('Privacy method');
|
$data[0] = __('Privacy method');
|
||||||
$data[1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', $disabledBecauseInPolicy);
|
$data[1] = html_print_select(
|
||||||
|
[
|
||||||
|
'DES' => __('DES'),
|
||||||
|
'AES' => __('AES'),
|
||||||
|
],
|
||||||
|
'snmp3_privacy_method',
|
||||||
|
$snmp3_privacy_method,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
$disabledBecauseInPolicy
|
||||||
|
);
|
||||||
$data[2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
|
$data[2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
|
||||||
$data[3] = html_print_input_password(
|
$data[3] = html_print_input_password(
|
||||||
'snmp3_privacy_pass',
|
'snmp3_privacy_pass',
|
||||||
|
@ -97,7 +97,7 @@ if (is_ajax()) {
|
|||||||
|
|
||||||
if (!empty($field_description)) {
|
if (!empty($field_description)) {
|
||||||
// If the value is 5, this because severity in snmp alerts is not permit to show.
|
// If the value is 5, this because severity in snmp alerts is not permit to show.
|
||||||
if (($i > 5) && ($command['id'] == 3)) {
|
if (($i > 5) && ($command['id'] === 3)) {
|
||||||
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
|
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
|
||||||
__('Field %s'),
|
__('Field %s'),
|
||||||
($i - 1)
|
($i - 1)
|
||||||
@ -118,7 +118,7 @@ if (is_ajax()) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
|
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
|
||||||
if (($i > 5) && ($command['id'] == 3)) {
|
if (($i > 5) && ($command['id'] === 3)) {
|
||||||
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
|
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
|
||||||
$fdesc = sprintf(__('Field %s'), ($i - 1));
|
$fdesc = sprintf(__('Field %s'), ($i - 1));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1272,36 +1272,58 @@ $class = 'databox filters';
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
?>
|
||||||
|
<tr id="row_servers_all" class="datos">
|
||||||
|
<td class="bolder"><?php echo __('Server'); ?></td>
|
||||||
|
<td >
|
||||||
<?php
|
<?php
|
||||||
if ($meta) {
|
html_print_select(
|
||||||
?>
|
$servers,
|
||||||
|
'combo_server_all',
|
||||||
|
$server_name,
|
||||||
|
'',
|
||||||
|
__('All nodes'),
|
||||||
|
'all'
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ($meta) {
|
||||||
|
?>
|
||||||
<tr id="row_multiple_servers" class="datos">
|
<tr id="row_multiple_servers" class="datos">
|
||||||
<td class="bolder"><?php echo __('Server'); ?></td>
|
<td class="bolder"><?php echo __('Server'); ?></td>
|
||||||
<td >
|
<td >
|
||||||
<?php
|
<?php
|
||||||
$server_ids = [];
|
$server_ids = [];
|
||||||
$server_ids[0] = __('Local metaconsole');
|
$server_ids[0] = __('Local metaconsole');
|
||||||
$get_servers = metaconsole_get_servers();
|
$get_servers = metaconsole_get_servers();
|
||||||
foreach ($get_servers as $key => $server) {
|
foreach ($get_servers as $key => $server) {
|
||||||
$server_ids[$server['id']] = $server['server_name'];
|
$server_ids[$server['id']] = $server['server_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
html_print_select(
|
html_print_select(
|
||||||
$server_ids,
|
$server_ids,
|
||||||
'server_multiple[]',
|
'server_multiple[]',
|
||||||
$server_multiple,
|
$server_multiple,
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
0,
|
0,
|
||||||
false,
|
false,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr id="row_label" class="datos">
|
<tr id="row_label" class="datos">
|
||||||
<td class="bolder">
|
<td class="bolder">
|
||||||
@ -6545,6 +6567,7 @@ function chooseType() {
|
|||||||
$("#row_alert_actions").hide();
|
$("#row_alert_actions").hide();
|
||||||
$("#row_servers").hide();
|
$("#row_servers").hide();
|
||||||
$("#row_servers_all_opt").hide();
|
$("#row_servers_all_opt").hide();
|
||||||
|
$("#row_servers_all").hide();
|
||||||
$("#row_multiple_servers").hide();
|
$("#row_multiple_servers").hide();
|
||||||
$("#row_sort").hide();
|
$("#row_sort").hide();
|
||||||
$("#row_date").hide();
|
$("#row_date").hide();
|
||||||
@ -7109,7 +7132,7 @@ function chooseType() {
|
|||||||
|
|
||||||
case 'group_report':
|
case 'group_report':
|
||||||
$("#row_group").show();
|
$("#row_group").show();
|
||||||
$("#row_servers_all_opt").show();
|
$("#row_servers_all").show();
|
||||||
$("#row_description").show();
|
$("#row_description").show();
|
||||||
$("#row_historical_db_check").hide();
|
$("#row_historical_db_check").hide();
|
||||||
break;
|
break;
|
||||||
|
@ -1986,7 +1986,7 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group_report':
|
case 'group_report':
|
||||||
$values['server_name'] = get_parameter('combo_server');
|
$values['server_name'] = get_parameter('combo_server_all');
|
||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2862,7 +2862,7 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group_report':
|
case 'group_report':
|
||||||
$values['server_name'] = get_parameter('combo_server');
|
$values['server_name'] = get_parameter('combo_server_all');
|
||||||
$good_format = true;
|
$good_format = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -759,6 +759,31 @@ if (enterprise_installed() === true) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$days_week = [
|
||||||
|
0 => __('Sunday'),
|
||||||
|
1 => __('Monday'),
|
||||||
|
2 => __('Tuesday'),
|
||||||
|
3 => __('Wednesday'),
|
||||||
|
4 => __('Thursday'),
|
||||||
|
5 => __('Friday'),
|
||||||
|
6 => __('Saturday'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$table_styles->data[$row][] = html_print_label_input_block(
|
||||||
|
__('Datepicker first day of week'),
|
||||||
|
html_print_select(
|
||||||
|
$days_week,
|
||||||
|
'datepicker_first_day',
|
||||||
|
$config['datepicker_first_day'],
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$row++;
|
$row++;
|
||||||
|
|
||||||
// Title Header.
|
// Title Header.
|
||||||
|
@ -2312,7 +2312,7 @@ $(document).ready (function () {
|
|||||||
// The row provided has a predefined class. We delete it.
|
// The row provided has a predefined class. We delete it.
|
||||||
$('#table_macros-field' + i)
|
$('#table_macros-field' + i)
|
||||||
.removeAttr('class');
|
.removeAttr('class');
|
||||||
if(old_value && i != 4){
|
if(old_value){
|
||||||
$("[name=field" + i + "_value]").val(old_value).trigger('change');
|
$("[name=field" + i + "_value]").val(old_value).trigger('change');
|
||||||
}
|
}
|
||||||
$('#table_macros-field').show();
|
$('#table_macros-field').show();
|
||||||
|
@ -912,7 +912,7 @@ class DiscoveryTaskList extends HTML
|
|||||||
'class' => 'main_menu_icon invert_filter',
|
'class' => 'main_menu_icon invert_filter',
|
||||||
]
|
]
|
||||||
).' ';
|
).' ';
|
||||||
$data[6] .= __('Discovery.NetScan (legacy)');
|
$data[6] .= __('Discovery.NetScan');
|
||||||
} else {
|
} else {
|
||||||
// APP or external script recon task.
|
// APP or external script recon task.
|
||||||
$data[6] = html_print_image(
|
$data[6] = html_print_image(
|
||||||
@ -920,7 +920,7 @@ class DiscoveryTaskList extends HTML
|
|||||||
true,
|
true,
|
||||||
['class' => 'main_menu_icon invert_filter']
|
['class' => 'main_menu_icon invert_filter']
|
||||||
).' ';
|
).' ';
|
||||||
$data[6] .= $recon_script_name.' (legacy)';
|
$data[6] .= $recon_script_name;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
BIN
pandora_console/images/widgets/groups_status_map.png
Normal file
BIN
pandora_console/images/widgets/groups_status_map.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
BIN
pandora_console/images/widgets/inventory.png
Normal file
BIN
pandora_console/images/widgets/inventory.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
@ -58,7 +58,14 @@ if ($save_log_filter) {
|
|||||||
$values = [];
|
$values = [];
|
||||||
$values['id_name'] = get_parameter('id_name');
|
$values['id_name'] = get_parameter('id_name');
|
||||||
$values['text'] = get_parameter('text', '');
|
$values['text'] = get_parameter('text', '');
|
||||||
$values['period'] = get_parameter('period', '');
|
$values['custom_date'] = get_parameter('custom_date');
|
||||||
|
$values['date'] = get_parameter('date');
|
||||||
|
$values['date_text'] = get_parameter('date_text');
|
||||||
|
$values['date_units'] = get_parameter('date_units');
|
||||||
|
$values['date_init'] = get_parameter('date_init');
|
||||||
|
$values['time_init'] = get_parameter('time_init');
|
||||||
|
$values['date_end'] = get_parameter('date_end');
|
||||||
|
$values['time_end'] = get_parameter('time_end');
|
||||||
$values['ip'] = get_parameter('ip', '');
|
$values['ip'] = get_parameter('ip', '');
|
||||||
$values['type'] = get_parameter('type', -1);
|
$values['type'] = get_parameter('type', -1);
|
||||||
$values['user'] = get_parameter('user', -1);
|
$values['user'] = get_parameter('user', -1);
|
||||||
@ -91,7 +98,14 @@ if ($update_log_filter) {
|
|||||||
$values = [];
|
$values = [];
|
||||||
$id = get_parameter('id');
|
$id = get_parameter('id');
|
||||||
$values['text'] = get_parameter('text', '');
|
$values['text'] = get_parameter('text', '');
|
||||||
$values['period'] = get_parameter('period', '');
|
$values['custom_date'] = get_parameter('custom_date');
|
||||||
|
$values['date'] = get_parameter('date');
|
||||||
|
$values['date_text'] = get_parameter('date_text');
|
||||||
|
$values['date_units'] = get_parameter('date_units');
|
||||||
|
$values['date_init'] = get_parameter('date_init');
|
||||||
|
$values['time_init'] = get_parameter('time_init');
|
||||||
|
$values['date_end'] = get_parameter('date_end');
|
||||||
|
$values['time_end'] = get_parameter('time_end');
|
||||||
$values['ip'] = get_parameter('ip', '');
|
$values['ip'] = get_parameter('ip', '');
|
||||||
$values['type'] = get_parameter('type', -1);
|
$values['type'] = get_parameter('type', -1);
|
||||||
$values['user'] = get_parameter('user', -1);
|
$values['user'] = get_parameter('user', -1);
|
||||||
@ -211,18 +225,42 @@ function load_filter_values() {
|
|||||||
$.each(data,function(i,value){
|
$.each(data,function(i,value){
|
||||||
if (i == 'text'){
|
if (i == 'text'){
|
||||||
$("#text-filter_text").val(value);
|
$("#text-filter_text").val(value);
|
||||||
}
|
} else if (i == 'ip'){
|
||||||
if (i == 'period'){
|
|
||||||
$("#filter_period").val(value).change();
|
|
||||||
}
|
|
||||||
if (i == 'ip'){
|
|
||||||
$("#text-filter_ip").val(value);
|
$("#text-filter_ip").val(value);
|
||||||
}
|
} else if (i == 'type'){
|
||||||
if (i == 'type'){
|
|
||||||
$("#filter_type").val(value).change();
|
$("#filter_type").val(value).change();
|
||||||
}
|
} else if (i == 'user'){
|
||||||
if (i == 'user'){
|
|
||||||
$("#filter_user").val(value).change();
|
$("#filter_user").val(value).change();
|
||||||
|
} else if (i == 'custom_date'){
|
||||||
|
$('#hidden-custom_date').val(value).change();
|
||||||
|
if ($('#hidden-custom_date').val()==='0'){
|
||||||
|
$('#date_default').show();
|
||||||
|
$('#date_range').hide();
|
||||||
|
$('#date_extend').hide();
|
||||||
|
$('#date').val('".SECONDS_1DAY."').trigger('change');
|
||||||
|
} else if ($('#hidden-custom_date').val()==='1'){
|
||||||
|
$('#date_range').show();
|
||||||
|
$('#date_default').hide();
|
||||||
|
$('#date_extend').hide();
|
||||||
|
} else {
|
||||||
|
$('#date_range').hide();
|
||||||
|
$('#date_default').hide();
|
||||||
|
$('#date_extend').show();
|
||||||
|
}
|
||||||
|
} else if (i == 'date'){
|
||||||
|
$('#date').val(value).change();
|
||||||
|
} else if (i == 'date_end'){
|
||||||
|
$('#text-date_end').val(value);
|
||||||
|
} else if (i == 'date_init'){
|
||||||
|
$('#text-date_init').val(value);
|
||||||
|
} else if (i == 'date_text'){
|
||||||
|
$('#text-date_text').val(value);
|
||||||
|
} else if (i == 'date_units'){
|
||||||
|
$('#date_units').val(value).change();
|
||||||
|
} else if (i == 'time_end'){
|
||||||
|
$('#text-time_end').val(value);
|
||||||
|
} else if (i == 'time_init'){
|
||||||
|
$('#text-time_init').val(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -408,7 +446,14 @@ function save_new_filter() {
|
|||||||
"save_log_filter" : 1,
|
"save_log_filter" : 1,
|
||||||
"id_name" : $("#text-id_name").val(),
|
"id_name" : $("#text-id_name").val(),
|
||||||
"text" : $("#text-filter_text").val(),
|
"text" : $("#text-filter_text").val(),
|
||||||
"period" : $("#filter_period :selected").val(),
|
"custom_date": $('#hidden-custom_date').val(),
|
||||||
|
"date": $('#date option:selected').val(),
|
||||||
|
"date_text": $('#text-date_text').val(),
|
||||||
|
"date_units": $('#date_units option:selected').val(),
|
||||||
|
"date_init": $('#text-date_init').val(),
|
||||||
|
"time_init": $('#text-time_init').val(),
|
||||||
|
"date_end": $('#text-date_end').val(),
|
||||||
|
"time_end": $('#text-time_end').val(),
|
||||||
"ip" : $('#text-filter_ip').val(),
|
"ip" : $('#text-filter_ip').val(),
|
||||||
"type" : $('#filter_type :selected').val(),
|
"type" : $('#filter_type :selected').val(),
|
||||||
"user" : $('#filter_user :selected').val(),
|
"user" : $('#filter_user :selected').val(),
|
||||||
@ -444,7 +489,14 @@ function save_update_filter() {
|
|||||||
"update_log_filter" : 1,
|
"update_log_filter" : 1,
|
||||||
"id" : $("#overwrite_filter :selected").val(),
|
"id" : $("#overwrite_filter :selected").val(),
|
||||||
"text" : $("#text-filter_text").val(),
|
"text" : $("#text-filter_text").val(),
|
||||||
"period" : $("#filter_period :selected").val(),
|
"custom_date": $('#hidden-custom_date').val(),
|
||||||
|
"date": $('#date option:selected').val(),
|
||||||
|
"date_text": $('#text-date_text').val(),
|
||||||
|
"date_units": $('#date_units option:selected').val(),
|
||||||
|
"date_init": $('#text-date_init').val(),
|
||||||
|
"time_init": $('#text-time_init').val(),
|
||||||
|
"date_end": $('#text-date_end').val(),
|
||||||
|
"time_end": $('#text-time_end').val(),
|
||||||
"ip" : $('#text-filter_ip').val(),
|
"ip" : $('#text-filter_ip').val(),
|
||||||
"type" : $('#filter_type :selected').val(),
|
"type" : $('#filter_type :selected').val(),
|
||||||
"user" : $('#filter_user :selected').val(),
|
"user" : $('#filter_user :selected').val(),
|
||||||
|
@ -1486,27 +1486,53 @@ if (check_login()) {
|
|||||||
metaconsole_connect($server);
|
metaconsole_connect($server);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($params['histogram'] === true) {
|
if ($params['enable_projected_period'] === '1') {
|
||||||
$params['id_agent_module'] = $params['agent_module_id'];
|
$params_graphic = [
|
||||||
$params['dinamic_proc'] = 1;
|
'period' => $params['period'],
|
||||||
|
'date' => strtotime(date('Y-m-d H:i:s')),
|
||||||
|
'only_image' => false,
|
||||||
|
'homeurl' => ui_get_full_url(false, false, false, false).'/',
|
||||||
|
'ttl' => false,
|
||||||
|
'height' => $config['graph_image_height'],
|
||||||
|
'landscape' => $content['landscape'],
|
||||||
|
'return_img_base_64' => true,
|
||||||
|
];
|
||||||
|
|
||||||
|
$params_combined = [
|
||||||
|
'projection' => $params['period_projected'],
|
||||||
|
];
|
||||||
|
|
||||||
|
$return['chart'] = graphic_combined_module(
|
||||||
|
[$params['agent_module_id']],
|
||||||
|
$params_graphic,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
$output .= '<div class="stat_win_histogram">';
|
$output .= '<div class="stat_win_histogram">';
|
||||||
if ($params['compare'] === 'separated') {
|
$output .= $return['chart'];
|
||||||
|
$output .= '</div>';
|
||||||
|
} else {
|
||||||
|
if ($params['histogram'] === true) {
|
||||||
|
$params['id_agent_module'] = $params['agent_module_id'];
|
||||||
|
$params['dinamic_proc'] = 1;
|
||||||
|
|
||||||
|
$output .= '<div class="stat_win_histogram">';
|
||||||
|
if ($params['compare'] === 'separated') {
|
||||||
|
$graph = \reporting_module_histogram_graph(
|
||||||
|
['datetime' => ($params['begin_date'] - $params['period'])],
|
||||||
|
$params
|
||||||
|
);
|
||||||
|
$output .= $graph['chart'];
|
||||||
|
}
|
||||||
|
|
||||||
$graph = \reporting_module_histogram_graph(
|
$graph = \reporting_module_histogram_graph(
|
||||||
['datetime' => ($params['begin_date'] - $params['period'])],
|
['datetime' => $params['begin_date']],
|
||||||
$params
|
$params
|
||||||
);
|
);
|
||||||
$output .= $graph['chart'];
|
$output .= $graph['chart'];
|
||||||
|
$output .= '</div>';
|
||||||
|
} else {
|
||||||
|
$output .= grafico_modulo_sparse($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
$graph = \reporting_module_histogram_graph(
|
|
||||||
['datetime' => $params['begin_date']],
|
|
||||||
$params
|
|
||||||
);
|
|
||||||
$output .= $graph['chart'];
|
|
||||||
$output .= '</div>';
|
|
||||||
} else {
|
|
||||||
$output .= grafico_modulo_sparse($params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole() === true && empty($server_id) === false) {
|
if (is_metaconsole() === true && empty($server_id) === false) {
|
||||||
|
@ -201,23 +201,8 @@ class AuditLog extends HTML
|
|||||||
'name' => 'filter_text',
|
'name' => 'filter_text',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Max. hours old'),
|
'label' => __('Date'),
|
||||||
'type' => 'select',
|
'type' => 'date_range',
|
||||||
'class' => 'w20px',
|
|
||||||
'select2_enable' => true,
|
|
||||||
'sort' => false,
|
|
||||||
'selected' => 168,
|
|
||||||
'fields' => [
|
|
||||||
24 => __('1 day'),
|
|
||||||
168 => __('7 days'),
|
|
||||||
360 => __('15 days'),
|
|
||||||
744 => __('1 month'),
|
|
||||||
2160 => __('3 months'),
|
|
||||||
4320 => __('6 months'),
|
|
||||||
8760 => __('1 Year'),
|
|
||||||
],
|
|
||||||
'id' => 'filter_period',
|
|
||||||
'name' => 'filter_period',
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('IP'),
|
'label' => __('IP'),
|
||||||
@ -312,10 +297,35 @@ class AuditLog extends HTML
|
|||||||
$filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $this->filterIp);
|
$filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $this->filterIp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->filterPeriod) === false) {
|
// Calculate range dates.
|
||||||
$filter .= sprintf(' AND fecha >= DATE_ADD(NOW(), INTERVAL -%d HOUR)', $this->filterPeriod);
|
$custom_date = $filters['custom_date'];
|
||||||
|
if ($custom_date === '1') {
|
||||||
|
$date_from = ($filters['date_init'].' '.$filters['time_init']);
|
||||||
|
$date_to = ($filters['date_end'].' '.$filters['time_end']);
|
||||||
|
} else if ($custom_date === '2') {
|
||||||
|
$period = ($filters['date_text'] * $filters['date_units']);
|
||||||
|
$date_to = date('Y-m-d H:i:s');
|
||||||
|
$date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $period));
|
||||||
|
} else if (in_array($filters['date'], ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($filters['date'] === 'this_week') {
|
||||||
|
$date_from = date('Y-m-d 00:00:00', strtotime('last monday'));
|
||||||
|
$date_to = date('Y-m-d 23:59:59', strtotime($date_from.' +6 days'));
|
||||||
|
} else if ($filters['date'] === 'this_month') {
|
||||||
|
$date_from = date('Y-m-d 23:59:59', strtotime('first day of this month'));
|
||||||
|
$date_to = date('Y-m-d 00:00:00', strtotime('last day of this month'));
|
||||||
|
} else if ($filters['date'] === 'past_month') {
|
||||||
|
$date_from = date('Y-m-d 00:00:00', strtotime('first day of previous month'));
|
||||||
|
$date_to = date('Y-m-d 23:59:59', strtotime('last day of previous month'));
|
||||||
|
} else if ($filters['date'] === 'past_week') {
|
||||||
|
$date_from = date('Y-m-d 00:00:00', strtotime('monday', strtotime('last week')));
|
||||||
|
$date_to = date('Y-m-d 23:59:59', strtotime('sunday', strtotime('last week')));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$date_to = date('Y-m-d H:i:s');
|
||||||
|
$date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $filters['date']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$filter .= sprintf(' AND fecha BETWEEN "%s" AND "%s"', $date_from, $date_to);
|
||||||
$count = (int) db_get_value_sql(sprintf('SELECT COUNT(*) as "total" FROM tsesion WHERE %s', $filter));
|
$count = (int) db_get_value_sql(sprintf('SELECT COUNT(*) as "total" FROM tsesion WHERE %s', $filter));
|
||||||
|
|
||||||
if ($length !== '-1') {
|
if ($length !== '-1') {
|
||||||
|
@ -549,6 +549,11 @@ class SnmpConsole extends HTML
|
|||||||
$order = get_datatable_order(true);
|
$order = get_datatable_order(true);
|
||||||
$filters = get_parameter('filter', []);
|
$filters = get_parameter('filter', []);
|
||||||
|
|
||||||
|
// Build ranges.
|
||||||
|
$now_timestamp = time();
|
||||||
|
$interval_seconds = ($filters['filter_hours_ago'] * 3600);
|
||||||
|
$ago_timestamp = ($now_timestamp - $interval_seconds);
|
||||||
|
|
||||||
// Build ranges.
|
// Build ranges.
|
||||||
$now = new DateTime();
|
$now = new DateTime();
|
||||||
$ago = new DateTime();
|
$ago = new DateTime();
|
||||||
@ -688,7 +693,7 @@ class SnmpConsole extends HTML
|
|||||||
if ($date_from_trap != '') {
|
if ($date_from_trap != '') {
|
||||||
if ($time_from_trap != '') {
|
if ($time_from_trap != '') {
|
||||||
$whereSubquery .= '
|
$whereSubquery .= '
|
||||||
AND (UNIX_TIMESTAMP(timestamp) > UNIX_TIMESTAMP("'.$date_from_trap.' '.$time_from_trap.'"))
|
AND (utimestamp > '.$ago_timestamp.')
|
||||||
';
|
';
|
||||||
} else {
|
} else {
|
||||||
$whereSubquery .= '
|
$whereSubquery .= '
|
||||||
@ -700,7 +705,7 @@ class SnmpConsole extends HTML
|
|||||||
if ($date_to_trap != '') {
|
if ($date_to_trap != '') {
|
||||||
if ($time_to_trap) {
|
if ($time_to_trap) {
|
||||||
$whereSubquery .= '
|
$whereSubquery .= '
|
||||||
AND (UNIX_TIMESTAMP(timestamp) < UNIX_TIMESTAMP("'.$date_to_trap.' '.$time_to_trap.'"))
|
AND (utimestamp < '.$now_timestamp.')
|
||||||
';
|
';
|
||||||
} else {
|
} else {
|
||||||
$whereSubquery .= '
|
$whereSubquery .= '
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pandora build version and version
|
* Pandora build version and version
|
||||||
*/
|
*/
|
||||||
$build_version = 'PC230904';
|
$build_version = 'PC230908';
|
||||||
$pandora_version = 'v7.0NG.773.3';
|
$pandora_version = 'v7.0NG.773.3';
|
||||||
|
|
||||||
// Do not overwrite default timezone set if defined.
|
// Do not overwrite default timezone set if defined.
|
||||||
|
@ -1168,6 +1168,10 @@ function config_update_config()
|
|||||||
$error_update[] = __('Custom title header');
|
$error_update[] = __('Custom title header');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config_update_value('datepicker_first_day', (string) get_parameter('datepicker_first_day'), true) === false) {
|
||||||
|
$error_update[] = __('Datepicker first day');
|
||||||
|
}
|
||||||
|
|
||||||
if (config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'), true) === false) {
|
if (config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'), true) === false) {
|
||||||
$error_update[] = __('Custom subtitle header');
|
$error_update[] = __('Custom subtitle header');
|
||||||
}
|
}
|
||||||
@ -2751,6 +2755,10 @@ function config_process_config()
|
|||||||
config_update_value('custom_title_header', __('Pandora FMS'));
|
config_update_value('custom_title_header', __('Pandora FMS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($config['datepicker_first_day'])) {
|
||||||
|
config_update_value('datepicker_first_day', '0');
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($config['custom_subtitle_header'])) {
|
if (!isset($config['custom_subtitle_header'])) {
|
||||||
config_update_value('custom_subtitle_header', __('the Flexible Monitoring System'));
|
config_update_value('custom_subtitle_header', __('the Flexible Monitoring System'));
|
||||||
}
|
}
|
||||||
|
@ -125,9 +125,22 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
|||||||
if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false) {
|
if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false) {
|
||||||
$filename = $_FILES['file']['name'];
|
$filename = $_FILES['file']['name'];
|
||||||
$real_directory = filemanager_safe_directory($destination_directory);
|
$real_directory = filemanager_safe_directory($destination_directory);
|
||||||
$umask = io_safe_output((string) get_parameter('umask'));
|
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||||
|
|
||||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
$umask = io_safe_output((string) get_parameter('umask'));
|
||||||
|
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
|
||||||
|
$parse_sec2_query = explode('=', $parse_all_queries[1]);
|
||||||
|
$check_extension = true;
|
||||||
|
if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') {
|
||||||
|
if ((strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip')) {
|
||||||
|
$check_extension = false;
|
||||||
|
} else {
|
||||||
|
$check_extension = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// (strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip')
|
||||||
|
if (strpos($real_directory, $default_real_directory) !== 0 || $check_extension === false) {
|
||||||
// Perform security check to determine whether received upload
|
// Perform security check to determine whether received upload
|
||||||
// directory is part of the default path for caller uploader and
|
// directory is part of the default path for caller uploader and
|
||||||
// user is not trying to access an external path (avoid
|
// user is not trying to access an external path (avoid
|
||||||
@ -177,14 +190,31 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
|||||||
|
|
||||||
// Upload zip.
|
// Upload zip.
|
||||||
if ($upload_zip === true) {
|
if ($upload_zip === true) {
|
||||||
|
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
|
||||||
|
$parse_sec2_query = explode('=', $parse_all_queries[1]);
|
||||||
if (isset($_FILES['file']) === true
|
if (isset($_FILES['file']) === true
|
||||||
&& empty($_FILES['file']['name']) === false
|
&& empty($_FILES['file']['name']) === false
|
||||||
) {
|
) {
|
||||||
$filename = $_FILES['file']['name'];
|
$filename = $_FILES['file']['name'];
|
||||||
$filepath = $_FILES['file']['tmp_name'];
|
$filepath = $_FILES['file']['tmp_name'];
|
||||||
$real_directory = filemanager_safe_directory($destination_directory);
|
$real_directory = filemanager_safe_directory($destination_directory);
|
||||||
|
$secure = true;
|
||||||
|
if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') {
|
||||||
|
// Security control structure.
|
||||||
|
$zip = new \ZipArchive;
|
||||||
|
if ($zip->open($filepath) === true) {
|
||||||
|
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||||
|
$unzip_filename = $zip->getNameIndex($i);
|
||||||
|
$extension = pathinfo($unzip_filename, PATHINFO_EXTENSION);
|
||||||
|
if (strtolower($extension) !== 'mib') {
|
||||||
|
$secure = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
if (strpos($real_directory, $default_real_directory) !== 0 || $secure === false) {
|
||||||
// Perform security check to determine whether received upload
|
// Perform security check to determine whether received upload
|
||||||
// directory is part of the default path for caller uploader
|
// directory is part of the default path for caller uploader
|
||||||
// and user is not trying to access an external path (avoid
|
// and user is not trying to access an external path (avoid
|
||||||
|
@ -7228,6 +7228,298 @@ function html_print_code_picker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function html_print_select_date_range(
|
||||||
|
$name,
|
||||||
|
$return,
|
||||||
|
$selected=SECONDS_1DAY,
|
||||||
|
$date_init='',
|
||||||
|
$time_init='',
|
||||||
|
$date_end='',
|
||||||
|
$time_end='',
|
||||||
|
$date_text=SECONDS_1DAY,
|
||||||
|
$class='w100p'
|
||||||
|
) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
if ($selected === 'custom') {
|
||||||
|
$display_extend = '';
|
||||||
|
$display_range = 'style="display:none"';
|
||||||
|
$display_default = 'style="display:none"';
|
||||||
|
$custom_date = 2;
|
||||||
|
} else if ($selected === 'chose_range') {
|
||||||
|
$display_range = '';
|
||||||
|
$display_default = 'style="display:none"';
|
||||||
|
$display_extend = 'style="display:none"';
|
||||||
|
$custom_date = 1;
|
||||||
|
} else {
|
||||||
|
$display_default = '';
|
||||||
|
$display_range = 'style="display:none"';
|
||||||
|
$display_extend = 'style="display:none"';
|
||||||
|
$custom_date = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($date_end === '') {
|
||||||
|
$date_end = date('Y/m/d');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($date_init === '') {
|
||||||
|
$date_init = date('Y/m/d', strtotime($date_end.' -1 days'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($time_init === '') {
|
||||||
|
$time_init = date('H:i:s');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($time_end === '') {
|
||||||
|
$time_end = date('H:i:s');
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields[SECONDS_1DAY] = __('Last 24hr');
|
||||||
|
$fields['this_week'] = __('This week');
|
||||||
|
$fields['this_month'] = __('This month');
|
||||||
|
$fields['past_week'] = __('Past week');
|
||||||
|
$fields['past_month'] = __('Past month');
|
||||||
|
$fields[SECONDS_1WEEK] = __('Last 7 days');
|
||||||
|
$fields[SECONDS_15DAYS] = __('Last 15 days');
|
||||||
|
$fields[SECONDS_1MONTH] = __('Last 30 days');
|
||||||
|
$fields['custom'] = __('Custom');
|
||||||
|
$fields['chose_range'] = __('Chose start/end date period');
|
||||||
|
|
||||||
|
$output = html_print_input_hidden('custom_date', $custom_date, true);
|
||||||
|
$output .= '<div id="'.$name.'_default" class="wauto inline_flex" '.$display_default.'>';
|
||||||
|
$output .= html_print_select(
|
||||||
|
$fields,
|
||||||
|
$name,
|
||||||
|
$selected,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
$class
|
||||||
|
);
|
||||||
|
$output .= '</div>';
|
||||||
|
$output .= '<div id="'.$name.'_range" class="inline_flex" '.$display_range.'>';
|
||||||
|
$table = new stdClass();
|
||||||
|
$table->class = 'table-adv-filter';
|
||||||
|
$table->data[0][0] .= '<div><div><div><span class="font-title-font">'.__('From').':</span></div>';
|
||||||
|
$table->data[0][0] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
|
||||||
|
$table->data[0][0] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
|
||||||
|
$table->data[0][0] .= '</div>';
|
||||||
|
$table->data[0][0] .= '<div><div><span class="font-title-font">'.__('to').':</span></div>';
|
||||||
|
$table->data[0][0] .= html_print_input_text('date_end', $date_end, '', 12, 10, true).' ';
|
||||||
|
$table->data[0][0] .= '<div id="'.$name.'_manual" class="w100p inline_line">';
|
||||||
|
$table->data[0][0] .= html_print_input_text('time_end', $time_end, '', 10, 7, true).' ';
|
||||||
|
$table->data[0][0] .= ' <a href="javascript:">'.html_print_image(
|
||||||
|
'images/logs@svg.svg',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'id' => 'back_default',
|
||||||
|
'class' => ' main_menu_icon invert_filter',
|
||||||
|
'alt' => __('List'),
|
||||||
|
'title' => __('List'),
|
||||||
|
'style' => 'width: 18px;',
|
||||||
|
]
|
||||||
|
).'</a>';
|
||||||
|
$table->data[0][0] .= '</div></div>';
|
||||||
|
$output .= html_print_table($table, true);
|
||||||
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$units = [
|
||||||
|
1 => __('seconds'),
|
||||||
|
SECONDS_1MINUTE => __('minutes'),
|
||||||
|
SECONDS_1HOUR => __('hours'),
|
||||||
|
SECONDS_1DAY => __('days'),
|
||||||
|
SECONDS_1WEEK => __('weeks'),
|
||||||
|
SECONDS_1MONTH => __('months'),
|
||||||
|
SECONDS_1YEAR => __('years'),
|
||||||
|
];
|
||||||
|
$output .= '<div id="'.$name.'_extend" class="w100p inline_flex" '.$display_extend.'>';
|
||||||
|
$output .= html_print_input_text($name.'_text', $date_text, '', false, 255, true);
|
||||||
|
$output .= html_print_select(
|
||||||
|
$units,
|
||||||
|
$name.'_units',
|
||||||
|
'1',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
' margin-left: 5px; width: 140px;',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
$output .= ' <a href="javascript:">'.html_print_image(
|
||||||
|
'images/logs@svg.svg',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'id' => 'back_default_extend',
|
||||||
|
'class' => $name.'_toggler main_menu_icon invert_filter',
|
||||||
|
'alt' => __('List'),
|
||||||
|
'title' => __('List'),
|
||||||
|
'style' => 'width: 18px;margin-bottom: -5px; padding-top: 10px;',
|
||||||
|
]
|
||||||
|
).'</a>';
|
||||||
|
$output .= '</div>';
|
||||||
|
ui_include_time_picker();
|
||||||
|
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||||
|
$output .= "<script type='text/javascript'>
|
||||||
|
$(document).ready (function () {
|
||||||
|
$('#".$name."').change(function(){
|
||||||
|
if ($(this).val() === 'chose_range') {
|
||||||
|
$('#".$name."_range').show();
|
||||||
|
$('#".$name."_default').hide();
|
||||||
|
$('#".$name."_extend').hide();
|
||||||
|
$('#hidden-custom_date').val('1');
|
||||||
|
} else if ($(this).val() === 'custom') {
|
||||||
|
$('#".$name."_range').hide();
|
||||||
|
$('#".$name."_default').hide();
|
||||||
|
$('#".$name."_extend').show();
|
||||||
|
$('#hidden-custom_date').val('2');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#back_default, #back_default_extend').click(function(){
|
||||||
|
display_default();
|
||||||
|
});
|
||||||
|
|
||||||
|
// To get position must to be showed, hide elements return 0 on offset function.
|
||||||
|
$('#".$name."_range').show();
|
||||||
|
$('#".$name."_default').hide();
|
||||||
|
$('#".$name."_extend').hide();
|
||||||
|
position_top_init = $('#text-date_init').offset().top + $('#text-date_init').outerHeight();
|
||||||
|
position_top_end = $('#text-date_end').offset().top + $('#text-date_end').outerHeight();
|
||||||
|
$('#".$name."_range').hide();
|
||||||
|
$('#".$name."_extend').hide();
|
||||||
|
$('#".$name."_default').show();
|
||||||
|
});
|
||||||
|
|
||||||
|
var position_top_init = 0;
|
||||||
|
var position_top_end = 0;
|
||||||
|
|
||||||
|
function display_default(){
|
||||||
|
$('#".$name."_default').show();
|
||||||
|
$('#".$name."_range').hide();
|
||||||
|
$('#".$name."_extend').hide();
|
||||||
|
$('#".$name."').val('".SECONDS_1DAY."').trigger('change');
|
||||||
|
$('#hidden-custom_date').val('0');
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#text-date').datepicker({
|
||||||
|
dateFormat: '".DATE_FORMAT_JS."',
|
||||||
|
changeMonth: true,
|
||||||
|
changeYear: true,
|
||||||
|
showAnim: 'slideDown'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-time_init]').timepicker({
|
||||||
|
showSecond: true,
|
||||||
|
timeFormat: '".TIME_FORMAT_JS."',
|
||||||
|
timeOnlyTitle: '".__('Choose time')."',
|
||||||
|
timeText: '".__('Time')."',
|
||||||
|
hourText: '".__('Hour')."',
|
||||||
|
minuteText: '".__('Minute')."',
|
||||||
|
secondText: '".__('Second')."',
|
||||||
|
currentText: '".__('Now')."',
|
||||||
|
closeText: '".__('Close')."'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-date_init]').datepicker ({
|
||||||
|
dateFormat: '".DATE_FORMAT_JS."',
|
||||||
|
changeMonth: true,
|
||||||
|
changeYear: true,
|
||||||
|
showAnim: 'slideDown',
|
||||||
|
firstDay: ".$config['datepicker_first_day'].",
|
||||||
|
beforeShowDay: function (date) {
|
||||||
|
show_datepicker = 'date_init';
|
||||||
|
var date_now = date.getTime();
|
||||||
|
var date_ini_split = $('[id^=text-date_init]').val().split('/');
|
||||||
|
var date_ini = new Date(date_ini_split[1]+'/'+date_ini_split[2]+'/'+date_ini_split[0]).getTime();
|
||||||
|
var date_end_split = $('[id^=text-date_end]').val().split('/');
|
||||||
|
var date_end = new Date(date_end_split[1]+'/'+date_end_split[2]+'/'+date_end_split[0]).getTime();
|
||||||
|
if (date_now > date_ini && date_now < date_end) {
|
||||||
|
return [true, 'ui-date-range-in', 'prueba'];
|
||||||
|
} else if (date_now == date_ini || date_now == date_end){
|
||||||
|
return [true, 'ui-datepicker-current-day', ''];
|
||||||
|
}
|
||||||
|
return [true, '', ''];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-date_end]').datepicker ({
|
||||||
|
dateFormat: '".DATE_FORMAT_JS."',
|
||||||
|
changeMonth: true,
|
||||||
|
changeYear: true,
|
||||||
|
showAnim: 'slideDown',
|
||||||
|
firstDay: ".$config['datepicker_first_day'].",
|
||||||
|
beforeShowDay: function (date) {
|
||||||
|
show_datepicker = 'date_end';
|
||||||
|
var date_now = date.getTime();
|
||||||
|
var date_ini_split = $('[id^=text-date_init]').val().split('/');
|
||||||
|
var date_ini = new Date(date_ini_split[1]+'/'+date_ini_split[2]+'/'+date_ini_split[0]).getTime();
|
||||||
|
var date_end_split = $('[id^=text-date_end]').val().split('/');
|
||||||
|
var date_end = new Date(date_end_split[1]+'/'+date_end_split[2]+'/'+date_end_split[0]).getTime();
|
||||||
|
if (date_now > date_ini && date_now < date_end) {
|
||||||
|
return [true, 'ui-date-range-in', 'prueba'];
|
||||||
|
} else if (date_now == date_ini || date_now == date_end){
|
||||||
|
return [true, 'ui-datepicker-current-day', ''];
|
||||||
|
}
|
||||||
|
return [true, '', ''];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-time_end]').timepicker({
|
||||||
|
showSecond: true,
|
||||||
|
timeFormat: '".TIME_FORMAT_JS."',
|
||||||
|
timeOnlyTitle: '".__('Choose time')."',
|
||||||
|
timeText: '".__('Time')."',
|
||||||
|
hourText: '".__('Hour')."',
|
||||||
|
minuteText: '".__('Minute')."',
|
||||||
|
secondText: '".__('Second')."',
|
||||||
|
currentText: '".__('Now')."',
|
||||||
|
closeText: '".__('Close')."'
|
||||||
|
});
|
||||||
|
|
||||||
|
$(window).scroll(function(e){
|
||||||
|
if ($('#date option:selected').val() == 'chose_range'){
|
||||||
|
if ($('#ui-datepicker-div').html() !== '') {
|
||||||
|
if ($(this).scrollTop() > 0){
|
||||||
|
var css_datepicker = $('#ui-datepicker-div').attr('style').replace('absolute','fixed');
|
||||||
|
if (!css_datepicker.includes('px !important')) {
|
||||||
|
if (show_datepicker == 'date_end'){
|
||||||
|
css_datepicker += '; top: '+position_top_end+'px !important';
|
||||||
|
} else {
|
||||||
|
css_datepicker += '; top: '+position_top_init+'px !important';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#ui-datepicker-div').attr('style', css_datepicker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>";
|
||||||
|
|
||||||
|
if ($return === true) {
|
||||||
|
return $output;
|
||||||
|
} else {
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function html_print_wizard_diagnosis(
|
function html_print_wizard_diagnosis(
|
||||||
$title,
|
$title,
|
||||||
$id_button,
|
$id_button,
|
||||||
@ -7266,4 +7558,5 @@ function html_print_wizard_diagnosis(
|
|||||||
} else {
|
} else {
|
||||||
echo $output;
|
echo $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -31,6 +31,7 @@ function inventory_get_data(
|
|||||||
$agents_ids,
|
$agents_ids,
|
||||||
$inventory_module_name,
|
$inventory_module_name,
|
||||||
$utimestamp,
|
$utimestamp,
|
||||||
|
$period,
|
||||||
$inventory_search_string='',
|
$inventory_search_string='',
|
||||||
$export_csv=false,
|
$export_csv=false,
|
||||||
$return_mode=false,
|
$return_mode=false,
|
||||||
@ -97,7 +98,7 @@ function inventory_get_data(
|
|||||||
|
|
||||||
// Prepare pagination.
|
// Prepare pagination.
|
||||||
$url = sprintf(
|
$url = sprintf(
|
||||||
'?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&order_by_agent=%s&submit_filter=%d',
|
'?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&period=%s&order_by_agent=%s&submit_filter=%d',
|
||||||
$pagination_url_parameters['inventory_id_agent'],
|
$pagination_url_parameters['inventory_id_agent'],
|
||||||
$pagination_url_parameters['inventory_agent'],
|
$pagination_url_parameters['inventory_agent'],
|
||||||
$pagination_url_parameters['inventory_id_group'],
|
$pagination_url_parameters['inventory_id_group'],
|
||||||
@ -105,6 +106,7 @@ function inventory_get_data(
|
|||||||
$inventory_module_name,
|
$inventory_module_name,
|
||||||
$inventory_search_string,
|
$inventory_search_string,
|
||||||
$utimestamp,
|
$utimestamp,
|
||||||
|
$period,
|
||||||
$order_by_agent,
|
$order_by_agent,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
@ -328,7 +330,7 @@ function inventory_get_data(
|
|||||||
$timestamp = db_get_value_sql(
|
$timestamp = db_get_value_sql(
|
||||||
"SELECT timestamp
|
"SELECT timestamp
|
||||||
FROM tagente_datos_inventory
|
FROM tagente_datos_inventory
|
||||||
WHERE utimestamp = $utimestamp"
|
WHERE utimestamp BETWEEN '".($utimestamp - $period)."' AND '".$utimestamp."'"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$timestamp = db_get_value_sql(
|
$timestamp = db_get_value_sql(
|
||||||
@ -892,6 +894,14 @@ function get_data_basic_info_sql($params, $count=false)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($params['utimestamp'] > 0 && $count === false) {
|
||||||
|
$where .= sprintf(
|
||||||
|
' AND utimestamp BETWEEN %d AND %d',
|
||||||
|
($params['utimestamp'] - $params['period']),
|
||||||
|
$params['utimestamp']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ($params['order'] > 0) {
|
if ($params['order'] > 0) {
|
||||||
$str_split = explode(' ', $params['order']);
|
$str_split = explode(' ', $params['order']);
|
||||||
switch ($str_split[0]) {
|
switch ($str_split[0]) {
|
||||||
|
@ -143,6 +143,10 @@ function menu_print_menu(&$menu)
|
|||||||
if (empty($new_msg) === false) {
|
if (empty($new_msg) === false) {
|
||||||
$sec2 = 'operation/messages/message_edit&new_msg='.$new_msg;
|
$sec2 = 'operation/messages/message_edit&new_msg='.$new_msg;
|
||||||
}
|
}
|
||||||
|
} else if ($sec2 === 'enterprise/godmode/servers/credential_boxes_satellite'
|
||||||
|
|| $sec2 === 'enterprise/godmode/servers/manage_credential_boxes'
|
||||||
|
) {
|
||||||
|
$sec2 = 'enterprise/godmode/servers/list_satellite';
|
||||||
} else {
|
} else {
|
||||||
$sec2 = (string) get_parameter('sec2');
|
$sec2 = (string) get_parameter('sec2');
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
* ============================================================================
|
* ============================================================================
|
||||||
*/
|
*/
|
||||||
|
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||||
|
|
||||||
require_once $config['homedir'].'/include/functions.php';
|
require_once $config['homedir'].'/include/functions.php';
|
||||||
require_once $config['homedir'].'/include/functions_db.php';
|
require_once $config['homedir'].'/include/functions_db.php';
|
||||||
@ -2582,16 +2583,66 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
|||||||
$table->colspan['group_report']['cell'] = 3;
|
$table->colspan['group_report']['cell'] = 3;
|
||||||
$table->cellstyle['group_report']['cell'] = 'text-align: center;';
|
$table->cellstyle['group_report']['cell'] = 'text-align: center;';
|
||||||
$metaconsole_connected = false;
|
$metaconsole_connected = false;
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true && $item['server_name'] != '0') {
|
||||||
$connection = metaconsole_get_connection($item['server_name']);
|
$connection = metaconsole_get_connection($item['server_name']);
|
||||||
if (metaconsole_connect($connection) == NOERR) {
|
if (metaconsole_connect($connection) == NOERR) {
|
||||||
$metaconsole_connected = true;
|
$metaconsole_connected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$all_group_id = [];
|
||||||
|
$group_events = [];
|
||||||
|
$group_os = [];
|
||||||
|
|
||||||
if ($item['subtitle'] === 'All') {
|
if ($item['subtitle'] === 'All') {
|
||||||
|
if (is_metaconsole() === true && $item['server_name'] === 'all' || $item['server_name'] === '0') {
|
||||||
|
$nodes = metaconsole_get_connections();
|
||||||
|
foreach ($nodes as $node) {
|
||||||
|
try {
|
||||||
|
$nd = new Node($node['id']);
|
||||||
|
$nd->connect();
|
||||||
|
|
||||||
|
$all_group_id_node = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo');
|
||||||
|
|
||||||
|
$group_events_node = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||||
|
FROM tevento as te
|
||||||
|
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente
|
||||||
|
GROUP BY te.id_agente'
|
||||||
|
);
|
||||||
|
$group_os_node = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||||
|
FROM tconfig_os as os
|
||||||
|
INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name'
|
||||||
|
);
|
||||||
|
|
||||||
|
$all_group_id = array_merge($all_group_id, $all_group_id_node);
|
||||||
|
$group_events = array_merge($group_events, $group_events_node);
|
||||||
|
$group_os = array_merge($group_os, $group_os_node);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$nd->disconnect();
|
||||||
|
$modules_regex_node = [];
|
||||||
|
} finally {
|
||||||
|
$nd->disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$all_group_id = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo');
|
||||||
|
|
||||||
|
$group_events = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||||
|
FROM tevento as te
|
||||||
|
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente
|
||||||
|
GROUP BY te.id_agente'
|
||||||
|
);
|
||||||
|
$group_os = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||||
|
FROM tconfig_os as os
|
||||||
|
INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$group_id = [];
|
$group_id = [];
|
||||||
$all_group_id = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo');
|
|
||||||
|
|
||||||
foreach ($all_group_id as $group) {
|
foreach ($all_group_id as $group) {
|
||||||
$group_id[] = $group['id_grupo'];
|
$group_id[] = $group['id_grupo'];
|
||||||
@ -2599,61 +2650,113 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
|||||||
|
|
||||||
$description = __('Data view of all groups');
|
$description = __('Data view of all groups');
|
||||||
$icon = '';
|
$icon = '';
|
||||||
|
|
||||||
$group_events = db_get_all_rows_sql(
|
|
||||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
|
||||||
FROM tevento as te
|
|
||||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente
|
|
||||||
GROUP BY te.id_agente'
|
|
||||||
);
|
|
||||||
|
|
||||||
$group_os = db_get_all_rows_sql(
|
|
||||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
|
||||||
FROM tconfig_os as os
|
|
||||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name'
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
$group_id = db_get_value('id_grupo', 'tgrupo', 'nombre', $item['subtitle']);
|
$group_id = db_get_value('id_grupo', 'tgrupo', 'nombre', $item['subtitle']);
|
||||||
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id);
|
|
||||||
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id);
|
|
||||||
$icon = html_print_image(
|
|
||||||
'images/'.$icon_url,
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'title' => $item['subtitle'],
|
|
||||||
'class' => 'main_menu_icon invert_filter',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
$childrens = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo WHERE parent = '.$group_id);
|
if (is_metaconsole() === true && $item['server_name'] === 'all' || $item['server_name'] === '0') {
|
||||||
$total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM tagente where id_grupo = '.$group_id);
|
$nodes = metaconsole_get_connections();
|
||||||
|
foreach ($nodes as $node) {
|
||||||
|
try {
|
||||||
|
$nd = new Node($node['id']);
|
||||||
|
$nd->connect();
|
||||||
|
|
||||||
if ($childrens !== false && (int) $total_agents[0]['total'] !== $item['data']['group_stats']['total_agents']) {
|
$group_id_node = db_get_value('id_grupo', 'tgrupo', 'nombre', $item['subtitle']);
|
||||||
$array_group_id = [];
|
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id_node);
|
||||||
$array_group_id[] = $group_id;
|
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id_node);
|
||||||
foreach ($childrens as $group) {
|
$icon = html_print_image(
|
||||||
$array_group_id[] = $group['id_grupo'];
|
'images/'.$icon_url,
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => $item['subtitle'],
|
||||||
|
'class' => 'main_menu_icon invert_filter',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$childrens = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo WHERE parent = '.$group_id_node);
|
||||||
|
$total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM tagente where id_grupo = '.$group_id_node);
|
||||||
|
|
||||||
|
if ($childrens !== false && (int) $total_agents[0]['total'] !== $item['data']['group_stats']['total_agents']) {
|
||||||
|
$array_group_id = [];
|
||||||
|
$array_group_id[] = $group_id_node;
|
||||||
|
foreach ($childrens as $group) {
|
||||||
|
$array_group_id[] = $group['id_grupo'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$group_id_node = $array_group_id;
|
||||||
|
$explode_group_id = implode(',', $group_id_node);
|
||||||
|
} else {
|
||||||
|
$explode_group_id = $group_id_node;
|
||||||
|
}
|
||||||
|
|
||||||
|
$group_events_node = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||||
|
FROM tevento as te
|
||||||
|
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.')
|
||||||
|
GROUP BY te.id_agente'
|
||||||
|
);
|
||||||
|
|
||||||
|
$group_os_node = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||||
|
FROM tconfig_os as os
|
||||||
|
INNER JOIN tagente as ta ON ta.id_os = os.id_os
|
||||||
|
WHERE ta.id_grupo IN ('.$explode_group_id.') GROUP by os.name'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (is_array($group_events_node) === true) {
|
||||||
|
$group_events = array_merge($group_events, $group_events_node);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($group_os_node) === true) {
|
||||||
|
$group_os = array_merge($group_os, $group_os_node);
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$nd->disconnect();
|
||||||
|
} finally {
|
||||||
|
$nd->disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id);
|
||||||
|
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id);
|
||||||
|
$icon = html_print_image(
|
||||||
|
'images/'.$icon_url,
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => $item['subtitle'],
|
||||||
|
'class' => 'main_menu_icon invert_filter',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$childrens = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo WHERE parent = '.$group_id);
|
||||||
|
$total_agents = db_get_all_rows_sql('SELECT COUNT(id_agente) as total FROM tagente where id_grupo = '.$group_id);
|
||||||
|
|
||||||
|
if ($childrens !== false && (int) $total_agents[0]['total'] !== $item['data']['group_stats']['total_agents']) {
|
||||||
|
$array_group_id = [];
|
||||||
|
$array_group_id[] = $group_id;
|
||||||
|
foreach ($childrens as $group) {
|
||||||
|
$array_group_id[] = $group['id_grupo'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$group_id = $array_group_id;
|
||||||
|
$explode_group_id = implode(',', $group_id);
|
||||||
|
} else {
|
||||||
|
$explode_group_id = $group_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$group_id = $array_group_id;
|
$group_events = db_get_all_rows_sql(
|
||||||
$explode_group_id = implode(',', $group_id);
|
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||||
} else {
|
FROM tevento as te
|
||||||
$explode_group_id = $group_id;
|
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.')
|
||||||
|
GROUP BY te.id_agente'
|
||||||
|
);
|
||||||
|
|
||||||
|
$group_os = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||||
|
FROM tconfig_os as os
|
||||||
|
INNER JOIN tagente as ta ON ta.id_os = os.id_os
|
||||||
|
WHERE ta.id_grupo IN ('.$explode_group_id.') GROUP by os.name'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$group_events = db_get_all_rows_sql(
|
|
||||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
|
||||||
FROM tevento as te
|
|
||||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo IN ('.$explode_group_id.')
|
|
||||||
GROUP BY te.id_agente'
|
|
||||||
);
|
|
||||||
|
|
||||||
$group_os = db_get_all_rows_sql(
|
|
||||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
|
||||||
FROM tconfig_os as os
|
|
||||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os
|
|
||||||
WHERE ta.id_grupo IN ('.$explode_group_id.') GROUP by os.name'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($metaconsole_connected === true) {
|
if ($metaconsole_connected === true) {
|
||||||
@ -2764,8 +2867,10 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
|||||||
$options = [];
|
$options = [];
|
||||||
$labels = [];
|
$labels = [];
|
||||||
foreach ($group_os as $value) {
|
foreach ($group_os as $value) {
|
||||||
$data[$value['name_os']] = $value['count_os'];
|
$data[$value['name_os']] += $value['count_os'];
|
||||||
$labels[] = io_safe_output($value['name_os']);
|
if (array_search($value['name_os'], $labels) === false) {
|
||||||
|
$labels[] = io_safe_output($value['name_os']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
|
@ -3913,6 +3913,11 @@ function ui_print_datatable(array $parameters)
|
|||||||
$parameters['toggle_collapsed'] = true;
|
$parameters['toggle_collapsed'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parameters['startDisabled'] = false;
|
||||||
|
if (isset($parameters['start_disabled']) && $parameters['start_disabled'] === true) {
|
||||||
|
$parameters['startDisabled'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
$columns_tmp = [];
|
$columns_tmp = [];
|
||||||
foreach ($parameters['columns'] as $k_column => $v_column) {
|
foreach ($parameters['columns'] as $k_column => $v_column) {
|
||||||
if (isset($parameters['columns'][$k_column]['text']) === true) {
|
if (isset($parameters['columns'][$k_column]['text']) === true) {
|
||||||
@ -4022,7 +4027,11 @@ function ui_print_datatable(array $parameters)
|
|||||||
$filter .= '<ul class="datatable_filter content filter_table no_border">';
|
$filter .= '<ul class="datatable_filter content filter_table no_border">';
|
||||||
|
|
||||||
foreach ($parameters['form']['inputs'] as $input) {
|
foreach ($parameters['form']['inputs'] as $input) {
|
||||||
$filter .= html_print_input(($input + ['return' => true]), 'li');
|
if ($input['type'] === 'date_range') {
|
||||||
|
$filter .= '<li><label>'.$input['label'].'</label>'.html_print_select_date_range('date', true).'</li>';
|
||||||
|
} else {
|
||||||
|
$filter .= html_print_input(($input + ['return' => true]), 'li');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$filter .= '</ul>';
|
$filter .= '</ul>';
|
||||||
@ -4122,7 +4131,7 @@ function ui_print_datatable(array $parameters)
|
|||||||
|
|
||||||
// Base table.
|
// Base table.
|
||||||
$table = '<table id="'.$table_id.'" ';
|
$table = '<table id="'.$table_id.'" ';
|
||||||
$table .= 'class="'.$parameters['class'].'"';
|
$table .= 'class="invisible '.$parameters['class'].'"';
|
||||||
$table .= 'style="box-sizing: border-box;'.$parameters['style'].'">';
|
$table .= 'style="box-sizing: border-box;'.$parameters['style'].'">';
|
||||||
$table .= '<thead><tr class="datatables_thead_tr">';
|
$table .= '<thead><tr class="datatables_thead_tr">';
|
||||||
|
|
||||||
@ -4196,13 +4205,19 @@ function ui_print_datatable(array $parameters)
|
|||||||
$info_msg_arr['message'] = $emptyTable;
|
$info_msg_arr['message'] = $emptyTable;
|
||||||
$info_msg_arr['div_class'] = 'info_box_container invisible_important datatable-msg-info-'.$table_id;
|
$info_msg_arr['div_class'] = 'info_box_container invisible_important datatable-msg-info-'.$table_id;
|
||||||
|
|
||||||
$spinner = '<div id="'.$table_id.'-spinner" class="spinner-fixed"><span></span><span></span><span></span><span></span></div>';
|
$info_msg_arr_filter = [];
|
||||||
|
$info_msg_arr_filter['message'] = __('Please apply a filter to display the data.');
|
||||||
|
$info_msg_arr_filter['div_class'] = 'info_box_container invisible_important datatable-msg-info-filter-'.$table_id;
|
||||||
|
|
||||||
|
$spinner = '<div id="'.$table_id.'-spinner" class="invisible spinner-fixed"><span></span><span></span><span></span><span></span></div>';
|
||||||
|
|
||||||
// TODO This widget should take a return: ui_print_info_message($info_msg_arr, '', true)
|
// TODO This widget should take a return: ui_print_info_message($info_msg_arr, '', true)
|
||||||
$info_msg = '<div>'.ui_print_info_message($info_msg_arr).'</div>';
|
$info_msg = '<div>'.ui_print_info_message($info_msg_arr).'</div>';
|
||||||
|
|
||||||
|
$info_msg_filter = '<div>'.ui_print_info_message($info_msg_arr_filter, true).'</div>';
|
||||||
|
|
||||||
$err_msg = '<div id="error-'.$table_id.'"></div>';
|
$err_msg = '<div id="error-'.$table_id.'"></div>';
|
||||||
$output = $info_msg.$err_msg.$filter.$extra.$spinner.$table.$js;
|
$output = $info_msg.$info_msg_filter.$err_msg.$filter.$extra.$spinner.$table.$js;
|
||||||
if (is_ajax() === false) {
|
if (is_ajax() === false) {
|
||||||
ui_require_css_file('datatables.min', 'include/styles/js/');
|
ui_require_css_file('datatables.min', 'include/styles/js/');
|
||||||
ui_require_css_file('tables');
|
ui_require_css_file('tables');
|
||||||
|
@ -46,6 +46,18 @@ $hash = get_parameter('hash');
|
|||||||
$file_raw = get_parameter('file');
|
$file_raw = get_parameter('file');
|
||||||
|
|
||||||
$file = base64_decode(urldecode($file_raw));
|
$file = base64_decode(urldecode($file_raw));
|
||||||
|
$secure_extension = true;
|
||||||
|
$extension = pathinfo($file, PATHINFO_EXTENSION);
|
||||||
|
if ($extension === 'php' || $extension === 'js') {
|
||||||
|
$secure_extension = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
|
||||||
|
$parse_sec2_query = explode('=', $parse_all_queries[1]);
|
||||||
|
$dirname = dirname($file);
|
||||||
|
|
||||||
|
$path_traversal = strpos($file, '../');
|
||||||
|
|
||||||
// Avoid possible inifite loop with referer.
|
// Avoid possible inifite loop with referer.
|
||||||
if (isset($_SERVER['HTTP_ORIGIN']) === false || (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI'])) {
|
if (isset($_SERVER['HTTP_ORIGIN']) === false || (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI'])) {
|
||||||
$refererPath = ui_get_full_url('index.php');
|
$refererPath = ui_get_full_url('index.php');
|
||||||
@ -53,12 +65,13 @@ if (isset($_SERVER['HTTP_ORIGIN']) === false || (isset($_SERVER['HTTP_ORIGIN'])
|
|||||||
$refererPath = $_SERVER['HTTP_REFERER'];
|
$refererPath = $_SERVER['HTTP_REFERER'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$config['server_unique_identifier']) || isset($_SERVER['HTTP_REFERER']) === false) {
|
if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$config['server_unique_identifier'])
|
||||||
|
|| isset($_SERVER['HTTP_REFERER']) === false || $path_traversal !== false || $secure_extension === false
|
||||||
|
) {
|
||||||
$errorMessage = __('Security error. Please contact the administrator.');
|
$errorMessage = __('Security error. Please contact the administrator.');
|
||||||
} else {
|
} else {
|
||||||
$downloadable_file = '';
|
$downloadable_file = '';
|
||||||
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
|
|
||||||
$parse_sec2_query = explode('=', $parse_all_queries[1]);
|
|
||||||
// Metaconsole have a route distinct than node.
|
// Metaconsole have a route distinct than node.
|
||||||
$main_file_manager = (is_metaconsole() === true) ? 'advanced/metasetup' : 'godmode/setup/file_manager';
|
$main_file_manager = (is_metaconsole() === true) ? 'advanced/metasetup' : 'godmode/setup/file_manager';
|
||||||
$main_collections = (is_metaconsole() === true) ? 'advanced/collections' : 'enterprise/godmode/agentes/collections';
|
$main_collections = (is_metaconsole() === true) ? 'advanced/collections' : 'enterprise/godmode/agentes/collections';
|
||||||
@ -70,7 +83,9 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'extensions/files_repo':
|
case 'extensions/files_repo':
|
||||||
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file;
|
$attachment_path = io_safe_output($config['attachment_store']);
|
||||||
|
$downloadable_file = $attachment_path.'/files_repo/'.$file;
|
||||||
|
// $downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'godmode/servers/plugin':
|
case 'godmode/servers/plugin':
|
||||||
@ -81,6 +96,9 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c
|
|||||||
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/collection/'.$file;
|
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/collection/'.$file;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'godmode/setup/file_manager':
|
||||||
|
$downloadable_file = ($dirname === 'image') ? $_SERVER['DOCUMENT_ROOT'].'/pandora_console/'.$file : '';
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Wrong action.
|
// Wrong action.
|
||||||
$downloadable_file = '';
|
$downloadable_file = '';
|
||||||
|
@ -943,17 +943,25 @@ function pandoraFlotSlicebar(
|
|||||||
|
|
||||||
// Format functions
|
// Format functions
|
||||||
function xFormatter(v) {
|
function xFormatter(v) {
|
||||||
// var ct = new Date();
|
var ct;
|
||||||
var ct = new timezoneJS.Date();
|
if (typeof timezoneJS === "undefined") {
|
||||||
ct.setTimezone(phpTimezone);
|
ct = new Date();
|
||||||
|
} else {
|
||||||
|
ct = new timezoneJS.Date();
|
||||||
|
ct.setTimezone(phpTimezone);
|
||||||
|
}
|
||||||
|
|
||||||
var currentTime = ct.getTime();
|
var currentTime = ct.getTime();
|
||||||
|
|
||||||
var diffDates = (currentTime - 1000 * datelimit) / 1000;
|
var diffDates = (currentTime - 1000 * datelimit) / 1000;
|
||||||
|
|
||||||
// var d = new Date(1000 * (v + datelimit));
|
var d;
|
||||||
var d = new timezoneJS.Date(1000 * (v + datelimit));
|
if (typeof timezoneJS === "undefined") {
|
||||||
d.setTimezone(phpTimezone);
|
d = new Date(1000 * (v + datelimit));
|
||||||
|
} else {
|
||||||
|
d = new timezoneJS.Date(1000 * (v + datelimit));
|
||||||
|
d.setTimezone(phpTimezone);
|
||||||
|
}
|
||||||
|
|
||||||
var monthNames = [
|
var monthNames = [
|
||||||
"Jan",
|
"Jan",
|
||||||
|
@ -83,7 +83,7 @@ function d3_relationship_graph($elements, $matrix, $width=700, $return=false, $h
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function d3_tree_map_graph($data, $width=700, $height=700, $return=false)
|
function d3_tree_map_graph($data, $width=700, $height=700, $return=false, $id_container='tree_map', $child_links=false)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ function d3_tree_map_graph($data, $width=700, $height=700, $return=false)
|
|||||||
$data = json_encode($data);
|
$data = json_encode($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = "<div id=\"tree_map\" style='overflow: hidden;'></div>";
|
$output = '<div id="'.$id_container."\" style='overflow: hidden;'></div>";
|
||||||
$output .= include_javascript_d3(true);
|
$output .= include_javascript_d3(true);
|
||||||
$output .= '<style type="text/css">
|
$output .= '<style type="text/css">
|
||||||
.cell>rect {
|
.cell>rect {
|
||||||
@ -139,8 +139,18 @@ function d3_tree_map_graph($data, $width=700, $height=700, $return=false)
|
|||||||
}
|
}
|
||||||
</style>';
|
</style>';
|
||||||
$output .= "<script language=\"javascript\" type=\"text/javascript\">
|
$output .= "<script language=\"javascript\" type=\"text/javascript\">
|
||||||
treeMap('#tree_map', $data, '$width', '$height');
|
treeMap('#$id_container', $data, '$width', '$height', $child_links);
|
||||||
</script>";
|
</script>";
|
||||||
|
if ($child_links === true) {
|
||||||
|
$output .= html_print_input_image(
|
||||||
|
'resize_parent',
|
||||||
|
'/images/normal_screen.png',
|
||||||
|
1,
|
||||||
|
'background-color: white !important; padding: 4px !important;',
|
||||||
|
true,
|
||||||
|
['class' => 'resize_button invisible']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$return) {
|
if (!$return) {
|
||||||
echo $output;
|
echo $output;
|
||||||
|
@ -402,18 +402,24 @@ function chordDiagram(recipient, elements, matrix, width, height) {
|
|||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
// };
|
// };
|
||||||
function treeMap(recipient, data, width, height) {
|
function treeMap(recipient, data, width, height, childLinks = false) {
|
||||||
//var isIE = BrowserDetect.browser == 'Explorer';
|
//var isIE = BrowserDetect.browser == 'Explorer';
|
||||||
var isIE = true;
|
var isIE = true;
|
||||||
var chartWidth = width;
|
var chartWidth = width;
|
||||||
var chartHeight = height;
|
var chartHeight = height;
|
||||||
var consoleStyle = document.getElementById("hidden-selected_style_theme")
|
const uniqueId = generateUniqueId();
|
||||||
.value;
|
if (document.getElementById("hidden-selected_style_theme") !== null) {
|
||||||
$("#tooltip").css(
|
var consoleStyle = document.getElementById("hidden-selected_style_theme")
|
||||||
|
.value;
|
||||||
|
} else {
|
||||||
|
var consoleStyle = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#tooltip_" + uniqueId).css(
|
||||||
"color",
|
"color",
|
||||||
consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)"
|
consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)"
|
||||||
);
|
);
|
||||||
$("#tooltip").css(
|
$("#tooltip_" + uniqueId).css(
|
||||||
"background-color",
|
"background-color",
|
||||||
consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)"
|
consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)"
|
||||||
);
|
);
|
||||||
@ -431,6 +437,9 @@ function treeMap(recipient, data, width, height) {
|
|||||||
var transitionDuration = 500;
|
var transitionDuration = 500;
|
||||||
var root;
|
var root;
|
||||||
var node;
|
var node;
|
||||||
|
var resize_button = $(recipient)
|
||||||
|
.parent()
|
||||||
|
.find(".resize_button");
|
||||||
|
|
||||||
var treemap = d3.layout
|
var treemap = d3.layout
|
||||||
.treemap()
|
.treemap()
|
||||||
@ -468,6 +477,7 @@ function treeMap(recipient, data, width, height) {
|
|||||||
.attr("class", "cell parent")
|
.attr("class", "cell parent")
|
||||||
.on("click", function(d) {
|
.on("click", function(d) {
|
||||||
zoom(d);
|
zoom(d);
|
||||||
|
resize_button.show();
|
||||||
})
|
})
|
||||||
.append("svg")
|
.append("svg")
|
||||||
.attr("class", "clip")
|
.attr("class", "clip")
|
||||||
@ -476,6 +486,9 @@ function treeMap(recipient, data, width, height) {
|
|||||||
})
|
})
|
||||||
.attr("height", headerHeight);
|
.attr("height", headerHeight);
|
||||||
parentEnterTransition
|
parentEnterTransition
|
||||||
|
.filter(function(d) {
|
||||||
|
if (d.name) return d;
|
||||||
|
})
|
||||||
.append("rect")
|
.append("rect")
|
||||||
.attr("width", function(d) {
|
.attr("width", function(d) {
|
||||||
return Math.max(0.01, d.dx);
|
return Math.max(0.01, d.dx);
|
||||||
@ -483,6 +496,9 @@ function treeMap(recipient, data, width, height) {
|
|||||||
.attr("height", headerHeight)
|
.attr("height", headerHeight)
|
||||||
.style("fill", headerColor);
|
.style("fill", headerColor);
|
||||||
parentEnterTransition
|
parentEnterTransition
|
||||||
|
.filter(function(d) {
|
||||||
|
if (d.name) return d;
|
||||||
|
})
|
||||||
.append("text")
|
.append("text")
|
||||||
.attr("class", "label")
|
.attr("class", "label")
|
||||||
.attr("fill", "white")
|
.attr("fill", "white")
|
||||||
@ -490,6 +506,7 @@ function treeMap(recipient, data, width, height) {
|
|||||||
.attr("width", function(d) {
|
.attr("width", function(d) {
|
||||||
return Math.max(0.01, d.dx);
|
return Math.max(0.01, d.dx);
|
||||||
})
|
})
|
||||||
|
.attr("style", "transition: all 0.5s ease-out;")
|
||||||
.attr("height", headerHeight)
|
.attr("height", headerHeight)
|
||||||
.text(function(d) {
|
.text(function(d) {
|
||||||
return d.name;
|
return d.name;
|
||||||
@ -521,6 +538,10 @@ function treeMap(recipient, data, width, height) {
|
|||||||
// remove transition
|
// remove transition
|
||||||
parentCells.exit().remove();
|
parentCells.exit().remove();
|
||||||
|
|
||||||
|
$(resize_button).on("click", function() {
|
||||||
|
zoom(root);
|
||||||
|
$(this).hide();
|
||||||
|
});
|
||||||
// create children cells
|
// create children cells
|
||||||
var childrenCells = chart
|
var childrenCells = chart
|
||||||
.selectAll("g.cell.child")
|
.selectAll("g.cell.child")
|
||||||
@ -534,19 +555,27 @@ function treeMap(recipient, data, width, height) {
|
|||||||
.append("g")
|
.append("g")
|
||||||
.attr("class", "cell child")
|
.attr("class", "cell child")
|
||||||
.on("click", function(d) {
|
.on("click", function(d) {
|
||||||
zoom(node === d.parent ? root : d.parent);
|
if (childLinks) {
|
||||||
|
if (node === d.parent) {
|
||||||
|
window.location.href = d.link;
|
||||||
|
} else {
|
||||||
|
resize_button.show();
|
||||||
|
zoom(d.parent);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
zoom(node === d.parent ? root : d.parent);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.on("mouseover", over_user)
|
|
||||||
.on("mouseout", out_user)
|
|
||||||
.on("mousemove", move_tooltip)
|
|
||||||
.append("svg")
|
.append("svg")
|
||||||
.attr("class", "clip");
|
.attr("class", "clip");
|
||||||
|
$(recipient).on("mouseover", over_user);
|
||||||
|
$(recipient).on("mouseout", out_user);
|
||||||
|
$(recipient).on("mousemove", move_tooltip);
|
||||||
childEnterTransition
|
childEnterTransition
|
||||||
.append("rect")
|
.append("rect")
|
||||||
.classed("background", true)
|
.classed("background", true)
|
||||||
.style("fill", function(d) {
|
.style("fill", function(d) {
|
||||||
return color(d.name);
|
return d.color ? d.color : color(d.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
childEnterTransition
|
childEnterTransition
|
||||||
@ -608,6 +637,30 @@ function treeMap(recipient, data, width, height) {
|
|||||||
|
|
||||||
zoom(node);
|
zoom(node);
|
||||||
|
|
||||||
|
function calculateSizeText() {
|
||||||
|
$(recipient + " .parent .clip .label").each((key, node) => {
|
||||||
|
const textElement = node;
|
||||||
|
const containerWidth = parseFloat(
|
||||||
|
$(textElement)
|
||||||
|
.parent()
|
||||||
|
.attr("width")
|
||||||
|
);
|
||||||
|
const originalFontSize = 12;
|
||||||
|
|
||||||
|
textElement.style.fontSize = "16px";
|
||||||
|
const computedTextLength = textElement.getComputedTextLength();
|
||||||
|
const textWidth = computedTextLength + 8;
|
||||||
|
textElement.style.fontSize = originalFontSize + "px";
|
||||||
|
|
||||||
|
const scaleFactor = containerWidth / textWidth;
|
||||||
|
let scaledFontSize = parseFloat(originalFontSize) * scaleFactor;
|
||||||
|
|
||||||
|
scaledFontSize = scaledFontSize > 12 ? 12 : scaledFontSize;
|
||||||
|
|
||||||
|
textElement.style.fontSize = scaledFontSize + "px";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function size(d) {
|
function size(d) {
|
||||||
return d.size;
|
return d.size;
|
||||||
}
|
}
|
||||||
@ -728,6 +781,9 @@ function treeMap(recipient, data, width, height) {
|
|||||||
if (d3.event) {
|
if (d3.event) {
|
||||||
d3.event.stopPropagation();
|
d3.event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
calculateSizeText();
|
||||||
|
}, transitionDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
function position() {
|
function position() {
|
||||||
@ -746,11 +802,10 @@ function treeMap(recipient, data, width, height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function move_tooltip(d) {
|
function move_tooltip(d) {
|
||||||
x = d3.event.pageX + 10;
|
x = d.offsetX + 40;
|
||||||
y = d3.event.pageY + 10;
|
y = d.offsetY + 40;
|
||||||
|
$("#tooltip_" + uniqueId).css("left", x + "px");
|
||||||
$("#tooltip").css("left", x + "px");
|
$("#tooltip_" + uniqueId).css("top", y + "px");
|
||||||
$("#tooltip").css("top", y + "px");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function over_user(d) {
|
function over_user(d) {
|
||||||
@ -772,17 +827,17 @@ function treeMap(recipient, data, width, height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function create_tooltip(d, x, y) {
|
function create_tooltip(d, x, y) {
|
||||||
if ($("#tooltip").length == 0) {
|
if ($("#tooltip_" + uniqueId).length == 0) {
|
||||||
$(recipient).append(
|
$(recipient).append(
|
||||||
$("<div></div>")
|
$("<div></div>")
|
||||||
.attr("id", "tooltip")
|
.attr("id", "tooltip_" + uniqueId)
|
||||||
.html(d.tooltip_content)
|
.html(d.target.__data__.tooltip_content)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$("#tooltip").html(d.tooltip_content);
|
$("#tooltip_" + uniqueId).html(d.target.__data__.tooltip_content);
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#tooltip").attr(
|
$("#tooltip_" + uniqueId).attr(
|
||||||
"style",
|
"style",
|
||||||
"background: #fff;" +
|
"background: #fff;" +
|
||||||
"color: #111;" +
|
"color: #111;" +
|
||||||
@ -805,14 +860,22 @@ function treeMap(recipient, data, width, height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function show_tooltip(d) {
|
function show_tooltip(d) {
|
||||||
x = d3.event.pageX + 10;
|
x = d.offsetX + 10;
|
||||||
y = d3.event.pageY + 10;
|
y = d.offsetY + 10;
|
||||||
|
if (d.target.__data__) {
|
||||||
create_tooltip(d, x, y);
|
create_tooltip(d, x, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide_tooltip() {
|
function hide_tooltip() {
|
||||||
$("#tooltip").hide();
|
$("#tooltip_" + uniqueId).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateUniqueId() {
|
||||||
|
const timestamp = new Date().getTime();
|
||||||
|
const randomNum = Math.floor(Math.random() * 10000);
|
||||||
|
const uniqueId = `${timestamp}-${randomNum}`;
|
||||||
|
return uniqueId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +126,11 @@ if (typeof dt.ajax_data !== "undefined") {
|
|||||||
ajaxData = dt.ajax_data;
|
ajaxData = dt.ajax_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var startDisabled = false;
|
||||||
|
if (dt.startDisabled === true) {
|
||||||
|
startDisabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
function checkPages() {
|
function checkPages() {
|
||||||
if (dt_table.page.info().pages > 1) {
|
if (dt_table.page.info().pages > 1) {
|
||||||
@ -335,7 +340,25 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.extend(settings_datatable, ajaxOrData);
|
$.extend(settings_datatable, ajaxOrData);
|
||||||
var dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable);
|
|
||||||
|
var dt_table;
|
||||||
|
|
||||||
|
if (startDisabled === true) {
|
||||||
|
$(`.datatable-msg-info-filter-${dt.id}`)
|
||||||
|
.removeClass("invisible_important")
|
||||||
|
.show();
|
||||||
|
|
||||||
|
$(`div#${dt.id}-spinner`).hide();
|
||||||
|
$(`#${dt.table_id}`).hide();
|
||||||
|
|
||||||
|
$(`#button-form_${dt.table_id}_search_bt`).click(function() {
|
||||||
|
$(`.datatable-msg-info-filter-${dt.id}`).hide();
|
||||||
|
$(`#${dt.table_id}`).show();
|
||||||
|
dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
dt_table = $(`#${dt.table_id}`).DataTable(settings_datatable);
|
||||||
|
}
|
||||||
|
|
||||||
$(`#button-${dt.form_id}_search_bt`).click(function() {
|
$(`#button-${dt.form_id}_search_bt`).click(function() {
|
||||||
dt_table.draw().page(0);
|
dt_table.draw().page(0);
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1613,3 +1613,12 @@ function type_change() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show/Hide period for projection on agent module graph.
|
||||||
|
function show_projection_period() {
|
||||||
|
if ($("#projection_switch").is(":checked")) {
|
||||||
|
$("#div_projection_period").show();
|
||||||
|
} else {
|
||||||
|
$("#div_projection_period").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -300,6 +300,10 @@ class Widget
|
|||||||
$className .= '\GroupsStatusWidget';
|
$className .= '\GroupsStatusWidget';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'groups_status_map':
|
||||||
|
$className .= '\GroupsStatusMapWidget';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'maps_made_by_user':
|
case 'maps_made_by_user':
|
||||||
$className .= '\MapsMadeByUser';
|
$className .= '\MapsMadeByUser';
|
||||||
break;
|
break;
|
||||||
@ -412,6 +416,10 @@ class Widget
|
|||||||
$className .= '\WuxWidget';
|
$className .= '\WuxWidget';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'inventory':
|
||||||
|
$className .= '\InventoryWidget';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'os_quick_report':
|
case 'os_quick_report':
|
||||||
$className .= '\OsQuickReportWidget';
|
$className .= '\OsQuickReportWidget';
|
||||||
break;
|
break;
|
||||||
|
@ -0,0 +1,460 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Widget Group status map Pandora FMS Console
|
||||||
|
*
|
||||||
|
* @category Console Class
|
||||||
|
* @package Pandora FMS
|
||||||
|
* @subpackage Widget Group status
|
||||||
|
* @version 1.0.0
|
||||||
|
* @license See below
|
||||||
|
*
|
||||||
|
* ______ ___ _______ _______ ________
|
||||||
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||||
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||||
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||||
|
*
|
||||||
|
* ============================================================================
|
||||||
|
* Copyright (c) 2005-2023 Pandora FMS
|
||||||
|
* Please see https://pandorafms.com/community/ 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.
|
||||||
|
* ============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace PandoraFMS\Dashboard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Group status map Widgets.
|
||||||
|
*/
|
||||||
|
class GroupsStatusMapWidget extends Widget
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name widget.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title widget.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page widget;
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $page;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class name widget.
|
||||||
|
*
|
||||||
|
* @var [type]
|
||||||
|
*/
|
||||||
|
protected $className;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Values options for each widget.
|
||||||
|
*
|
||||||
|
* @var [type]
|
||||||
|
*/
|
||||||
|
protected $values;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration required.
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
protected $configurationRequired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Error load widget.
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
protected $loadError;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Width.
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
protected $width;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Heigth.
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
protected $height;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grid Width.
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
protected $gridWidth;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct.
|
||||||
|
*
|
||||||
|
* @param integer $cellId Cell ID.
|
||||||
|
* @param integer $dashboardId Dashboard ID.
|
||||||
|
* @param integer $widgetId Widget ID.
|
||||||
|
* @param integer|null $width New width.
|
||||||
|
* @param integer|null $height New height.
|
||||||
|
* @param integer|null $gridWidth Grid width.
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
int $cellId,
|
||||||
|
int $dashboardId=0,
|
||||||
|
int $widgetId=0,
|
||||||
|
?int $width=0,
|
||||||
|
?int $height=0,
|
||||||
|
?int $gridWidth=0
|
||||||
|
) {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
// WARNING: Do not edit. This chunk must be in the constructor.
|
||||||
|
parent::__construct(
|
||||||
|
$cellId,
|
||||||
|
$dashboardId,
|
||||||
|
$widgetId
|
||||||
|
);
|
||||||
|
|
||||||
|
// Width.
|
||||||
|
$this->width = $width;
|
||||||
|
|
||||||
|
// Height.
|
||||||
|
$this->height = $height;
|
||||||
|
|
||||||
|
// Grid Width.
|
||||||
|
$this->gridWidth = $gridWidth;
|
||||||
|
|
||||||
|
// Options.
|
||||||
|
$this->values = $this->decoders($this->getOptionsWidget());
|
||||||
|
|
||||||
|
// Positions.
|
||||||
|
$this->position = $this->getPositionWidget();
|
||||||
|
|
||||||
|
// Page.
|
||||||
|
$this->page = basename(__FILE__);
|
||||||
|
|
||||||
|
// ClassName.
|
||||||
|
$class = new \ReflectionClass($this);
|
||||||
|
$this->className = $class->getShortName();
|
||||||
|
|
||||||
|
// Title.
|
||||||
|
$this->title = __('Group status map');
|
||||||
|
|
||||||
|
// Name.
|
||||||
|
if (empty($this->name) === true) {
|
||||||
|
$this->name = 'groups_status_map';
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->overflow_scrollbars = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decoders hack for retrocompability.
|
||||||
|
*
|
||||||
|
* @param array $decoder Values.
|
||||||
|
*
|
||||||
|
* @return array Returns the values with the correct key.
|
||||||
|
*/
|
||||||
|
public function decoders(array $decoder): array
|
||||||
|
{
|
||||||
|
$values = [];
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$values = parent::decoders($decoder);
|
||||||
|
|
||||||
|
if (isset($decoder['groups']) === true) {
|
||||||
|
$values['groupId'] = $decoder['groups'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['groupId']) === true) {
|
||||||
|
$values['groupId'] = $decoder['groupId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['groupRecursion']) === true) {
|
||||||
|
$values['groupRecursion'] = $decoder['groupRecursion'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $values;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public function getFormInputs(): array
|
||||||
|
{
|
||||||
|
$values = $this->values;
|
||||||
|
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = parent::getFormInputs();
|
||||||
|
$values['groupId'] = explode(',', $values['groupId']);
|
||||||
|
// Restrict access to group.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Groups'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select_groups',
|
||||||
|
'name' => 'groupId',
|
||||||
|
'returnAllGroup' => true,
|
||||||
|
'privilege' => 'AR',
|
||||||
|
'multiple' => true,
|
||||||
|
'selected' => $values['groupId'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Group recursion'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'groupRecursion',
|
||||||
|
'id' => 'groupRecursion',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['groupRecursion'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Post for widget.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getPost():array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$values = parent::getPost();
|
||||||
|
|
||||||
|
$values['groupId'] = \get_parameter('groupId', 0);
|
||||||
|
$values['groupRecursion'] = \get_parameter_switch('groupRecursion', 0);
|
||||||
|
|
||||||
|
return $values;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw widget.
|
||||||
|
*
|
||||||
|
* @return string;
|
||||||
|
*/
|
||||||
|
public function load()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$size = parent::getSize();
|
||||||
|
include_once $config['homedir'].'/include/graphs/functions_d3.php';
|
||||||
|
include_once $config['homedir'].'/include/functions_reporting.php';
|
||||||
|
include_once $config['homedir'].'/include/functions_graph.php';
|
||||||
|
$groups_array = (empty($this->values['groupId']) === false) ? explode(',', $this->values['groupId']) : [];
|
||||||
|
|
||||||
|
if ((bool) $this->values['groupRecursion'] === true && in_array('0', $groups_array) === false) {
|
||||||
|
foreach ($groups_array as $key => $group) {
|
||||||
|
$children = groups_get_children($group, false, 'AR', false);
|
||||||
|
foreach ($children as $key => $child) {
|
||||||
|
$groups_array[] = $child['id_grupo'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$where = '';
|
||||||
|
if (in_array('0', $groups_array) === false && count($groups_array) > 0) {
|
||||||
|
$where = ' WHERE g.id_grupo IN ('.implode(',', $groups_array).') ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$servers = metaconsole_get_servers();
|
||||||
|
$rows = [];
|
||||||
|
if (isset($servers) === true && is_array($servers) === true
|
||||||
|
) {
|
||||||
|
foreach ($servers as $server) {
|
||||||
|
if (metaconsole_connect($server) == NOERR) {
|
||||||
|
$sql = 'SELECT g.id_grupo, g.nombre, estado, count(*) AS total_modules
|
||||||
|
FROM tagente a
|
||||||
|
LEFT JOIN tgrupo g ON g.id_grupo = a.id_grupo
|
||||||
|
LEFT JOIN tagente_modulo m ON a.id_agente = m.id_agente
|
||||||
|
LEFT JOIN tagente_estado es ON es.id_agente_modulo = m.id_agente_modulo
|
||||||
|
'.$where.'
|
||||||
|
GROUP BY a.id_grupo, estado';
|
||||||
|
$result = db_process_sql($sql);
|
||||||
|
if ($result !== false) {
|
||||||
|
foreach ($result as $key => $group) {
|
||||||
|
$not_exist = true;
|
||||||
|
foreach ($rows as $key2 => $row) {
|
||||||
|
if ($group['id_grupo'] === $row['id_grupo']
|
||||||
|
&& $group['estado'] === $row['estado']
|
||||||
|
) {
|
||||||
|
$rows[$key2]['total_modules'] += $group['total_modules'];
|
||||||
|
$not_exist = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($not_exist === true) {
|
||||||
|
$rows[] = $group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
metaconsole_restore_db();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$where = '';
|
||||||
|
if (in_array('0', $groups_array) === false && count($groups_array) > 0) {
|
||||||
|
$where = ' WHERE g.id_grupo IN ('.implode(',', $groups_array).') ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'SELECT g.id_grupo, g.nombre, estado, count(*) AS total_modules
|
||||||
|
FROM tagente a
|
||||||
|
LEFT JOIN tgrupo g ON g.id_grupo = a.id_grupo
|
||||||
|
LEFT JOIN tagente_modulo m ON a.id_agente = m.id_agente
|
||||||
|
LEFT JOIN tagente_estado es ON es.id_agente_modulo = m.id_agente_modulo
|
||||||
|
'.$where.'
|
||||||
|
GROUP BY a.id_grupo, estado';
|
||||||
|
|
||||||
|
$rows = db_process_sql($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($rows === false || (is_array($rows) === true && count($rows) === 0)) {
|
||||||
|
$output = ui_print_info_message(
|
||||||
|
[
|
||||||
|
'no_close' => true,
|
||||||
|
'message' => __('No data found.'),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
$level1 = [
|
||||||
|
'name' => __('Module status map'),
|
||||||
|
'children' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
$names = [];
|
||||||
|
foreach ($rows as $key => $row) {
|
||||||
|
$color = '';
|
||||||
|
$name_status = '';
|
||||||
|
switch ($row['estado']) {
|
||||||
|
case '1':
|
||||||
|
$color = '#e63c52';
|
||||||
|
$name_status = __('Critical');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '2':
|
||||||
|
$color = '#FFB900';
|
||||||
|
$name_status = __('Warning');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '0':
|
||||||
|
$color = '#82b92e';
|
||||||
|
$name_status = __('Normal');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '3':
|
||||||
|
$color = '#B2B2B2';
|
||||||
|
$name_status = __('Unknown');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '4':
|
||||||
|
$color = '#4a83f3';
|
||||||
|
$name_status = __('No data');
|
||||||
|
$row['estado'] = 6;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$row['estado'] = 6;
|
||||||
|
$color = '#B2B2B2';
|
||||||
|
$name_status = __('Unknown');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$level1['children'][$row['id_grupo']][] = [
|
||||||
|
'id' => uniqid(),
|
||||||
|
'name' => $row['estado'],
|
||||||
|
'value' => $row['total_modules'],
|
||||||
|
'color' => $color,
|
||||||
|
'tooltip_content' => $row['total_modules'].__(' Modules(%s)', $name_status),
|
||||||
|
'link' => 'index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group='.$row['id_grupo'].'&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status='.$row['estado'].'&sort_field=&sort=none&pure=',
|
||||||
|
];
|
||||||
|
$names[$row['id_grupo']] = $row['nombre'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$level2 = [
|
||||||
|
'children' => [],
|
||||||
|
];
|
||||||
|
foreach ($level1['children'] as $id_grupo => $group) {
|
||||||
|
$level2['children'][] = [
|
||||||
|
'id' => uniqid(),
|
||||||
|
'name' => io_safe_output($names[$id_grupo]),
|
||||||
|
'children' => $group,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$id_container = 'tree_map_'.uniqid();
|
||||||
|
$output = d3_tree_map_graph($level2, $size['width'], $size['height'], true, $id_container, true);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get description.
|
||||||
|
*
|
||||||
|
* @return string.
|
||||||
|
*/
|
||||||
|
public static function getDescription()
|
||||||
|
{
|
||||||
|
return __('Group status map');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Name.
|
||||||
|
*
|
||||||
|
* @return string.
|
||||||
|
*/
|
||||||
|
public static function getName()
|
||||||
|
{
|
||||||
|
return 'groups_status_map';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get size Modal Configuration.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getSizeModalConfiguration(): array
|
||||||
|
{
|
||||||
|
$size = [
|
||||||
|
'width' => 400,
|
||||||
|
'height' => 330,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
1270
pandora_console/include/lib/Dashboard/Widgets/inventory.php
Normal file
1270
pandora_console/include/lib/Dashboard/Widgets/inventory.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -269,6 +269,14 @@ class SingleGraphWidget extends Widget
|
|||||||
$values['showLegend'] = $decoder['showLegend'];
|
$values['showLegend'] = $decoder['showLegend'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['projection_switch']) === true) {
|
||||||
|
$values['projection_switch'] = $decoder['projection_switch'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($decoder['period_projection']) === true) {
|
||||||
|
$values['period_projection'] = $decoder['period_projection'];
|
||||||
|
}
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,6 +365,33 @@ class SingleGraphWidget extends Widget
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Projection.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Projection Graph'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'projection_switch',
|
||||||
|
'id' => 'projection_switch',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['projection_switch'],
|
||||||
|
'onclick' => 'show_projection_period()',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Period Projection.
|
||||||
|
$display_projection = ($values['projection_switch'] === true) ? '' : 'display:none';
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Period Projection'),
|
||||||
|
'id' => 'div_projection_period',
|
||||||
|
'style' => $display_projection,
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'period_projection',
|
||||||
|
'type' => 'interval',
|
||||||
|
'value' => $values['period_projection'],
|
||||||
|
'script' => 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||||
|
'script_input' => 'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,6 +411,8 @@ class SingleGraphWidget extends Widget
|
|||||||
$values['moduleId'] = \get_parameter('moduleId', 0);
|
$values['moduleId'] = \get_parameter('moduleId', 0);
|
||||||
$values['period'] = \get_parameter('period', 0);
|
$values['period'] = \get_parameter('period', 0);
|
||||||
$values['showLegend'] = \get_parameter_switch('showLegend');
|
$values['showLegend'] = \get_parameter_switch('showLegend');
|
||||||
|
$values['projection_switch'] = (boolean) get_parameter_switch('projection_switch');
|
||||||
|
$values['period_projection'] = \get_parameter('period_projection', 0);
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
@ -405,23 +442,46 @@ class SingleGraphWidget extends Widget
|
|||||||
$trickHight = 40;
|
$trickHight = 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
$params = [
|
|
||||||
'agent_module_id' => $this->values['moduleId'],
|
|
||||||
'width' => '100%',
|
|
||||||
'height' => ((int) $size['height'] - $trickHight),
|
|
||||||
'period' => $this->values['period'],
|
|
||||||
'title' => $module_name,
|
|
||||||
'unit' => $units_name,
|
|
||||||
'homeurl' => $config['homeurl'],
|
|
||||||
'backgroundColor' => 'transparent',
|
|
||||||
'show_legend' => $this->values['showLegend'],
|
|
||||||
'show_title' => $module_name,
|
|
||||||
'menu' => false,
|
|
||||||
'dashboard' => true,
|
|
||||||
];
|
|
||||||
|
|
||||||
$output = '<div class="container-center widget-mrgn-0px">';
|
$output = '<div class="container-center widget-mrgn-0px">';
|
||||||
$output .= \grafico_modulo_sparse($params);
|
if ($this->values['projection_switch'] === true) {
|
||||||
|
$params_graphic = [
|
||||||
|
'period' => $this->values['period'],
|
||||||
|
'date' => strtotime(date('Y-m-d H:i:s')),
|
||||||
|
'only_image' => false,
|
||||||
|
'homeurl' => ui_get_full_url(false, false, false, false).'/',
|
||||||
|
'height' => ((int) $size['height'] - $trickHight),
|
||||||
|
'landscape' => $content['landscape'],
|
||||||
|
'return_img_base_64' => true,
|
||||||
|
];
|
||||||
|
|
||||||
|
$params_combined = [
|
||||||
|
'projection' => $this->values['period_projection'],
|
||||||
|
];
|
||||||
|
|
||||||
|
$return['chart'] = graphic_combined_module(
|
||||||
|
[$this->values['moduleId']],
|
||||||
|
$params_graphic,
|
||||||
|
$params_combined
|
||||||
|
);
|
||||||
|
$output .= $return['chart'];
|
||||||
|
} else {
|
||||||
|
$params = [
|
||||||
|
'agent_module_id' => $this->values['moduleId'],
|
||||||
|
'width' => '100%',
|
||||||
|
'height' => ((int) $size['height'] - $trickHight),
|
||||||
|
'period' => $this->values['period'],
|
||||||
|
'title' => $module_name,
|
||||||
|
'unit' => $units_name,
|
||||||
|
'homeurl' => $config['homeurl'],
|
||||||
|
'backgroundColor' => 'transparent',
|
||||||
|
'show_legend' => $this->values['showLegend'],
|
||||||
|
'show_title' => $module_name,
|
||||||
|
'menu' => false,
|
||||||
|
'dashboard' => true,
|
||||||
|
];
|
||||||
|
$output .= \grafico_modulo_sparse($params);
|
||||||
|
}
|
||||||
|
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
@ -937,3 +937,13 @@ div.basic-chart-title span {
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input.resize_button {
|
||||||
|
position: absolute;
|
||||||
|
background-color: white !important;
|
||||||
|
padding: 4px !important;
|
||||||
|
border-radius: 20px;
|
||||||
|
width: 28px;
|
||||||
|
bottom: 3%;
|
||||||
|
right: 6%;
|
||||||
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@ -107,24 +107,51 @@
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
width: 90px;
|
width: 90px;
|
||||||
}
|
}
|
||||||
.ui-widget-header .ui-icon {
|
|
||||||
background-image: url(../images/ui-icons_444444_256x240.png);
|
.ui-datepicker-prev {
|
||||||
|
margin-top: 5px;
|
||||||
|
background: url(../../../images/arrow_left_green.png) no-repeat 0 0 !important;
|
||||||
}
|
}
|
||||||
.ui-icon,
|
|
||||||
.ui-widget-content .ui-icon {
|
.ui-datepicker-next {
|
||||||
background-image: url(../images/ui-icons_444444_256x240.png);
|
margin-top: 5px;
|
||||||
|
background: url(../../../images/arrow_right_green.png) no-repeat 0 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-widget-content {
|
.ui-widget-content {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
.ui-state-default,
|
.ui-state-default,
|
||||||
.ui-widget-content .ui-state-default,
|
.ui-widget-content .ui-state-default,
|
||||||
.ui-widget-header .ui-state-default {
|
.ui-widget-header .ui-state-default {
|
||||||
margin-top: 3px;
|
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
color: #555555;
|
color: #555555;
|
||||||
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
border: 2px solid #ccc;
|
||||||
|
}
|
||||||
|
.ui-datepicker td,
|
||||||
|
a.ui-state-default,
|
||||||
|
.ui-datepicker td a {
|
||||||
|
width: 30px !important;
|
||||||
|
height: 30px !important;
|
||||||
|
}
|
||||||
|
a.ui-state-default:hover {
|
||||||
|
background-color: #82b92e;
|
||||||
|
}
|
||||||
|
a.ui-state-default > span {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
a.ui-state-default > span:hover {
|
||||||
|
font-weight: bold !important;
|
||||||
|
}
|
||||||
|
.ui-datepicker-current-day > a {
|
||||||
|
background-color: #82b92e !important;
|
||||||
|
font-weight: bold !important;
|
||||||
|
border: 2px solid #000 !important;
|
||||||
}
|
}
|
||||||
.ui-corner-all,
|
.ui-corner-all,
|
||||||
.ui-corner-top,
|
.ui-corner-top,
|
||||||
@ -153,13 +180,44 @@
|
|||||||
#ui-datepicker-div {
|
#ui-datepicker-div {
|
||||||
border-color: #b1b1b1;
|
border-color: #b1b1b1;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
|
border-radius: 15px;
|
||||||
|
overflow: hidden;
|
||||||
|
position: absolute;
|
||||||
|
width: 350px !important;
|
||||||
|
border: 2px solid var(--primary-color);
|
||||||
|
}
|
||||||
|
.ui-datepicker .ui-datepicker-header {
|
||||||
|
position: relative;
|
||||||
|
padding: 0.2em 0;
|
||||||
|
border-radius: 15px 15px 0px 0px;
|
||||||
|
}
|
||||||
|
.ui-datepicker-title,
|
||||||
|
.ui-datepicker-month,
|
||||||
|
.ui-datepicker-year {
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
.ui-datepicker-month,
|
||||||
|
.ui-datepicker-year {
|
||||||
|
width: 100px !important;
|
||||||
|
}
|
||||||
|
.ui-datepicker-month {
|
||||||
|
margin-left: -10px !important;
|
||||||
|
margin-right: 25px !important;
|
||||||
}
|
}
|
||||||
.ui-widget-header {
|
.ui-widget-header {
|
||||||
background: #b1b1b1;
|
background: white;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
.ui-datepicker-calendar th {
|
.ui-datepicker-calendar th {
|
||||||
background-color: #3f3f3f;
|
background-color: #fff;
|
||||||
|
padding-left: 15px;
|
||||||
|
text-align: initial;
|
||||||
|
}
|
||||||
|
.ui-datepicker-calendar th span {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.ui-widget-header {
|
||||||
|
height: 20px !important;
|
||||||
}
|
}
|
||||||
.ui-dialog .ui-widget-header {
|
.ui-dialog .ui-widget-header {
|
||||||
margin: 3px 3px 0px 3px;
|
margin: 3px 3px 0px 3px;
|
||||||
@ -175,7 +233,10 @@
|
|||||||
margin: 0px 15px 0px 15px;
|
margin: 0px 15px 0px 15px;
|
||||||
}
|
}
|
||||||
.ui-timepicker-div .ui-datepicker-title {
|
.ui-timepicker-div .ui-datepicker-title {
|
||||||
color: white;
|
color: black;
|
||||||
|
}
|
||||||
|
.ui-timepicker-div dl {
|
||||||
|
margin-top: 0px !important;
|
||||||
}
|
}
|
||||||
.ui-datepicker-buttonpane button {
|
.ui-datepicker-buttonpane button {
|
||||||
border-color: #b1b1b1;
|
border-color: #b1b1b1;
|
||||||
@ -200,7 +261,6 @@
|
|||||||
border: 0px;
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-state-hover .ui-icon,
|
|
||||||
.ui-state-focus .ui-icon,
|
.ui-state-focus .ui-icon,
|
||||||
.ui-button:hover .ui-icon,
|
.ui-button:hover .ui-icon,
|
||||||
.ui-button:focus .ui-icon {
|
.ui-button:focus .ui-icon {
|
||||||
@ -233,35 +293,6 @@ a.ui-button:active,
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-state-hover:before,
|
|
||||||
.ui-widget-content .ui-state-hover:before,
|
|
||||||
.ui-widget-header .ui-state-hover:before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 25%;
|
|
||||||
bottom: -10%;
|
|
||||||
height: 1px;
|
|
||||||
width: 50%;
|
|
||||||
border-bottom: 4px solid #82b92e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-priority-secondary:hover {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
bottom: -5px;
|
|
||||||
width: 100%;
|
|
||||||
border-bottom: 5px solid #82b92e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-priority-primary:hover {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
right: 5px;
|
|
||||||
bottom: -5px;
|
|
||||||
width: 100%;
|
|
||||||
border-bottom: 5px solid #82b92e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-state-active,
|
.ui-state-active,
|
||||||
.ui-widget-content .ui-state-active,
|
.ui-widget-content .ui-state-active,
|
||||||
.ui-widget-header .ui-state-active {
|
.ui-widget-header .ui-state-active {
|
||||||
@ -314,3 +345,21 @@ input[type="submit"].ui-button-dialog {
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
width: 90px;
|
width: 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-priority-primary,
|
||||||
|
.ui-priority-secondary {
|
||||||
|
background-color: #fff !important;
|
||||||
|
color: var(--primary-color) !important;
|
||||||
|
border: 2px solid var(--primary-color) !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-timepicker-div > dl dt,
|
||||||
|
.ui-timepicker-div > dl dd {
|
||||||
|
font-weight: bold !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-timepicker-div > dl dt,
|
||||||
|
.ui_tpicker_time {
|
||||||
|
margin-left: 10px !important;
|
||||||
|
}
|
||||||
|
@ -12562,3 +12562,7 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
|
|||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
justify-content: flex-start !important;
|
justify-content: flex-start !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-date-range-in > a {
|
||||||
|
background-color: #81b92e3b !important;
|
||||||
|
}
|
||||||
|
@ -131,7 +131,7 @@
|
|||||||
<div style='padding-bottom: 50px'>
|
<div style='padding-bottom: 50px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.773.3';
|
$version = '7.0NG.773.3';
|
||||||
$build = '230904';
|
$build = '230908';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@ if ($agent_view_page === true) {
|
|||||||
[
|
[
|
||||||
'id' => 'alerts_status_datatable',
|
'id' => 'alerts_status_datatable',
|
||||||
'class' => 'info_table',
|
'class' => 'info_table',
|
||||||
'style' => 'width: 99%;',
|
'style' => 'width: 100%;',
|
||||||
'columns' => $columns,
|
'columns' => $columns,
|
||||||
'column_names' => $column_names,
|
'column_names' => $column_names,
|
||||||
'no_sortable_columns' => $no_sortable_columns,
|
'no_sortable_columns' => $no_sortable_columns,
|
||||||
@ -439,6 +439,7 @@ if ($agent_view_page === true) {
|
|||||||
$strict_user
|
$strict_user
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
'start_disabled' => true,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -197,6 +197,8 @@ ui_print_message_dialog(
|
|||||||
$time_compare_overlapped = get_parameter('time_compare_overlapped', 0);
|
$time_compare_overlapped = get_parameter('time_compare_overlapped', 0);
|
||||||
$unknown_graph = get_parameter_checkbox('unknown_graph', 1);
|
$unknown_graph = get_parameter_checkbox('unknown_graph', 1);
|
||||||
$histogram = (bool) get_parameter('histogram', 0);
|
$histogram = (bool) get_parameter('histogram', 0);
|
||||||
|
$enable_projected_period = get_parameter('enable_projected_period', 0);
|
||||||
|
$period_projected = get_parameter('period_projected', 300);
|
||||||
|
|
||||||
// FORM TABLE.
|
// FORM TABLE.
|
||||||
$table = html_get_predefined_table('transparent', 2);
|
$table = html_get_predefined_table('transparent', 2);
|
||||||
@ -406,12 +408,35 @@ ui_print_message_dialog(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
$table->data[6][3] = html_print_checkbox_switch(
|
$table->data[6][3] = html_print_checkbox_switch(
|
||||||
'fullscale',
|
'fullscalee',
|
||||||
1,
|
1,
|
||||||
(bool) $fullscale,
|
(bool) $fullscale,
|
||||||
true,
|
true,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$table->data[7][0] = __('Projection graph');
|
||||||
|
$table->data[7][0] .= ui_print_help_tip(
|
||||||
|
__('Projection graph take as begin date the current time'),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$table->data[7][1] = html_print_checkbox_switch(
|
||||||
|
'enable_projected_period',
|
||||||
|
1,
|
||||||
|
(bool) $enable_projected_period,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$table->data[7][2] = __('Projection period');
|
||||||
|
$table->data[7][3] = '<div class="small-input-select2">'.html_print_extended_select_for_time(
|
||||||
|
'period_projected',
|
||||||
|
$period_projected,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
7,
|
||||||
|
true
|
||||||
|
).'</div>';
|
||||||
} else {
|
} else {
|
||||||
$table->data[0][0] = __('Begin date');
|
$table->data[0][0] = __('Begin date');
|
||||||
$table->data[0][1] = html_print_input_text(
|
$table->data[0][1] = html_print_input_text(
|
||||||
@ -514,27 +539,29 @@ ui_print_message_dialog(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'agent_module_id' => $id,
|
'agent_module_id' => $id,
|
||||||
'period' => $period,
|
'period' => $period,
|
||||||
'show_events' => $draw_events,
|
'show_events' => $draw_events,
|
||||||
'title' => $label,
|
'title' => $label,
|
||||||
'unit_name' => $unit,
|
'unit_name' => $unit,
|
||||||
'show_alerts' => $draw_alerts,
|
'show_alerts' => $draw_alerts,
|
||||||
'date' => $date,
|
'date' => $date,
|
||||||
'unit' => $unit,
|
'unit' => $unit,
|
||||||
'baseline' => $baseline,
|
'baseline' => $baseline,
|
||||||
'homeurl' => $urlImage,
|
'homeurl' => $urlImage,
|
||||||
'adapt_key' => 'adapter_'.$graph_type,
|
'adapt_key' => 'adapter_'.$graph_type,
|
||||||
'compare' => $time_compare,
|
'compare' => $time_compare,
|
||||||
'show_unknown' => $unknown_graph,
|
'show_unknown' => $unknown_graph,
|
||||||
'percentil' => (($show_percentil) ? $config['percentil'] : null),
|
'percentil' => (($show_percentil) ? $config['percentil'] : null),
|
||||||
'type_graph' => $config['type_module_charts'],
|
'type_graph' => $config['type_module_charts'],
|
||||||
'fullscale' => $fullscale,
|
'fullscale' => $fullscale,
|
||||||
'zoom' => $zoom,
|
'zoom' => $zoom,
|
||||||
'height' => 300,
|
'height' => 300,
|
||||||
'type_mode_graph' => $type_mode_graph,
|
'type_mode_graph' => $type_mode_graph,
|
||||||
'histogram' => $histogram,
|
'histogram' => $histogram,
|
||||||
'begin_date' => strtotime($start_date.' '.$start_time),
|
'begin_date' => strtotime($start_date.' '.$start_time),
|
||||||
|
'enable_projected_period' => $enable_projected_period,
|
||||||
|
'period_projected' => $period_projected,
|
||||||
];
|
];
|
||||||
|
|
||||||
// Graph.
|
// Graph.
|
||||||
|
@ -154,7 +154,7 @@ if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|
|||||||
|
|
||||||
// The execution has not been done manually.
|
// The execution has not been done manually.
|
||||||
$userRequest = (bool) get_parameter('uptbutton');
|
$userRequest = (bool) get_parameter('uptbutton');
|
||||||
if ($userRequest === false) {
|
if ($userRequest === true) {
|
||||||
$autosearch = true;
|
$autosearch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2354,7 +2354,7 @@ if (empty($result) === false) {
|
|||||||
$tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', false);
|
$tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ui_print_info_message(['no_close' => true, 'message' => __('Sorry no search parameters')]);
|
ui_print_info_message(['no_close' => true, 'message' => __('Please apply a filter to display the data')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole() !== true) {
|
if (is_metaconsole() !== true) {
|
||||||
|
@ -69,6 +69,8 @@ if (is_ajax()) {
|
|||||||
$id_group = (int) get_parameter('id_group');
|
$id_group = (int) get_parameter('id_group');
|
||||||
$pendingdelete = (bool) get_parameter('pendingdelete');
|
$pendingdelete = (bool) get_parameter('pendingdelete');
|
||||||
$get_node_agent = (bool) get_parameter('get_node_agent', false);
|
$get_node_agent = (bool) get_parameter('get_node_agent', false);
|
||||||
|
$get_agent_inventory_modules = (bool) get_parameter('get_agent_inventory_modules', false);
|
||||||
|
$get_agent_inventory_dates = (bool) get_parameter('get_agent_inventory_dates', false);
|
||||||
|
|
||||||
$refresh_contact = get_parameter('refresh_contact', 0);
|
$refresh_contact = get_parameter('refresh_contact', 0);
|
||||||
|
|
||||||
@ -1328,6 +1330,102 @@ if (is_ajax()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($get_agent_inventory_modules) {
|
||||||
|
$inventory_id_agent = get_parameter('id_agent');
|
||||||
|
$id_node = (int) get_parameter('id_node');
|
||||||
|
|
||||||
|
$sql = 'SELECT DISTINCT(`name`)
|
||||||
|
FROM tmodule_inventory, tagent_module_inventory
|
||||||
|
WHERE tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory';
|
||||||
|
|
||||||
|
if ($inventory_id_agent > 0) {
|
||||||
|
$sql .= ' AND id_agente = '.$inventory_id_agent;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields = [];
|
||||||
|
|
||||||
|
// Get results from all nodes if id_node equals to 0.
|
||||||
|
if ($id_node === 0 && is_metaconsole() === true) {
|
||||||
|
$result = [];
|
||||||
|
$nodes_connection = metaconsole_get_connections();
|
||||||
|
|
||||||
|
foreach ($nodes_connection as $key => $server) {
|
||||||
|
$id_node = $server['id'];
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$node = new Node($id_node);
|
||||||
|
$node->connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
$node_result = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
if ($node_result === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = array_merge(
|
||||||
|
$result,
|
||||||
|
$node_result
|
||||||
|
);
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$node->disconnect();
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
if ($node !== null) {
|
||||||
|
$node->disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$node = new Node($id_node);
|
||||||
|
$node->connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$node->disconnect();
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
if ($node !== null) {
|
||||||
|
$node->disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($result === false) {
|
||||||
|
$result = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($result);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($get_agent_inventory_dates) {
|
||||||
|
$inventory_module = get_parameter('module', 0);
|
||||||
|
$inventory_id_agent = (int) get_parameter('id_agent', 0);
|
||||||
|
$inventory_id_group = (int) get_parameter('id_group', 0);
|
||||||
|
|
||||||
|
$dates = inventory_get_dates(
|
||||||
|
$inventory_module,
|
||||||
|
$inventory_id_agent,
|
||||||
|
$inventory_id_group
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($dates);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,55 @@ use PandoraFMS\Enterprise\Metaconsole\Node;
|
|||||||
require_once $config['homedir'].'/include/functions_users.php';
|
require_once $config['homedir'].'/include/functions_users.php';
|
||||||
require_once $config['homedir'].'/include/functions_inventory.php';
|
require_once $config['homedir'].'/include/functions_inventory.php';
|
||||||
|
|
||||||
|
// Get different date to search the report.
|
||||||
|
$utimestamp = (int) get_parameter('date_end', 0);
|
||||||
|
$datetime_end = strtotime($utimestamp.' '.$time_end);
|
||||||
|
|
||||||
|
// Calculate new inteval for all reports.
|
||||||
|
$custom_date = get_parameter('custom_date', 0);
|
||||||
|
$date = get_parameter('date', SECONDS_1DAY);
|
||||||
|
$date_text = get_parameter('date_text', SECONDS_1DAY);
|
||||||
|
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
|
||||||
|
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
|
||||||
|
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
|
||||||
|
if ($custom_date === '1') {
|
||||||
|
if ($datetime_init >= $datetime_end) {
|
||||||
|
$datetime_init = $date_init_less;
|
||||||
|
}
|
||||||
|
|
||||||
|
$period = ($datetime_end - $datetime_init);
|
||||||
|
} else if ($custom_date === '2') {
|
||||||
|
$date_units = get_parameter('date_units');
|
||||||
|
$utimestamp = date('Y/m/d H:i:s');
|
||||||
|
$date_start = date('Y/m/d H:i:s', (strtotime($utimestamp) - ($date_text * $date_units)));
|
||||||
|
$period = (strtotime($utimestamp) - strtotime($date_start));
|
||||||
|
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($date === 'this_week') {
|
||||||
|
$monday = date('Y/m/d', strtotime('last monday'));
|
||||||
|
|
||||||
|
$sunday = date('Y/m/d', strtotime($monday.' +6 days'));
|
||||||
|
$period = (strtotime($sunday) - strtotime($monday));
|
||||||
|
$date_init = $monday;
|
||||||
|
$utimestamp = $sunday;
|
||||||
|
} else if ($date === 'this_month') {
|
||||||
|
$utimestamp = date('Y/m/d', strtotime('last day of this month'));
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
|
||||||
|
$period = (strtotime($utimestamp) - strtotime($first_of_month));
|
||||||
|
} else if ($date === 'past_month') {
|
||||||
|
$utimestamp = date('Y/m/d', strtotime('last day of previous month'));
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
|
||||||
|
$period = (strtotime($utimestamp) - strtotime($first_of_month));
|
||||||
|
} else if ($date === 'past_week') {
|
||||||
|
$utimestamp = date('Y-m-d', strtotime('sunday', strtotime('last week')));
|
||||||
|
$first_of_week = date('Y-m-d', strtotime('monday', strtotime('last week')));
|
||||||
|
$period = (strtotime($utimestamp) - strtotime($first_of_week));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$utimestamp = date('Y/m/d H:i:s');
|
||||||
|
$date_start = date('Y/m/d H:i:s', (strtotime($utimestamp) - $date));
|
||||||
|
$period = (strtotime($utimestamp) - strtotime($date_start));
|
||||||
|
}
|
||||||
|
|
||||||
if (is_ajax() === true) {
|
if (is_ajax() === true) {
|
||||||
$get_csv_url = (bool) get_parameter('get_csv_url');
|
$get_csv_url = (bool) get_parameter('get_csv_url');
|
||||||
$get_data_basic_info = (bool) get_parameter('get_data_basic_info');
|
$get_data_basic_info = (bool) get_parameter('get_data_basic_info');
|
||||||
@ -43,7 +92,6 @@ if (is_ajax() === true) {
|
|||||||
// 0 is All groups
|
// 0 is All groups
|
||||||
$inventory_search_string = (string) get_parameter('search_string');
|
$inventory_search_string = (string) get_parameter('search_string');
|
||||||
$export = (string) get_parameter('export');
|
$export = (string) get_parameter('export');
|
||||||
$utimestamp = (int) get_parameter('utimestamp', 0);
|
|
||||||
$inventory_agent = (string) get_parameter('agent', '');
|
$inventory_agent = (string) get_parameter('agent', '');
|
||||||
$order_by_agent = (boolean) get_parameter('order_by_agent', 0);
|
$order_by_agent = (boolean) get_parameter('order_by_agent', 0);
|
||||||
|
|
||||||
@ -98,6 +146,7 @@ if (is_ajax() === true) {
|
|||||||
$agents_ids,
|
$agents_ids,
|
||||||
$inventory_module,
|
$inventory_module,
|
||||||
$utimestamp,
|
$utimestamp,
|
||||||
|
$period,
|
||||||
$inventory_search_string,
|
$inventory_search_string,
|
||||||
$export,
|
$export,
|
||||||
false,
|
false,
|
||||||
@ -122,12 +171,14 @@ if (is_ajax() === true) {
|
|||||||
$id_group = (int) get_parameter('id_group', 0);
|
$id_group = (int) get_parameter('id_group', 0);
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'search' => $filter['value'],
|
'search' => $filter['value'],
|
||||||
'start' => $start,
|
'start' => $start,
|
||||||
'length' => $length,
|
'length' => $length,
|
||||||
'order' => $order,
|
'order' => $order,
|
||||||
'id_agent' => $id_agent,
|
'id_agent' => $id_agent,
|
||||||
'id_group' => $id_group,
|
'id_group' => $id_group,
|
||||||
|
'utimestamp' => strtotime($utimestamp),
|
||||||
|
'period' => $period,
|
||||||
];
|
];
|
||||||
|
|
||||||
$data = get_data_basic_info_sql($params);
|
$data = get_data_basic_info_sql($params);
|
||||||
@ -677,26 +728,17 @@ $table->data[1][1] = html_print_label_input_block(
|
|||||||
|
|
||||||
// Date filter. In Metaconsole has not reason for show.
|
// Date filter. In Metaconsole has not reason for show.
|
||||||
if (is_metaconsole() === false) {
|
if (is_metaconsole() === false) {
|
||||||
$dates = inventory_get_dates(
|
$table->data[1][2] .= html_print_label_input_block(
|
||||||
$inventory_module,
|
__('Date').':<br>',
|
||||||
$inventory_id_agent,
|
html_print_select_date_range(
|
||||||
$inventory_id_group
|
|
||||||
);
|
|
||||||
$table->data[1][2] = html_print_label_input_block(
|
|
||||||
__('Date'),
|
|
||||||
html_print_select(
|
|
||||||
$dates,
|
|
||||||
'utimestamp',
|
'utimestamp',
|
||||||
$utimestamp,
|
|
||||||
'',
|
|
||||||
__('Last'),
|
|
||||||
0,
|
|
||||||
true,
|
true,
|
||||||
false,
|
get_parameter('utimestamp', SECONDS_1DAY),
|
||||||
false,
|
$date_init,
|
||||||
'',
|
$time_init,
|
||||||
false,
|
date('Y/m/d'),
|
||||||
'width:100%;'
|
date('H:i:s'),
|
||||||
|
$date_text
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1303,6 +1345,9 @@ if ($inventory_module !== 'basic') {
|
|||||||
ui_require_jquery_file('pandora.controls');
|
ui_require_jquery_file('pandora.controls');
|
||||||
ui_require_jquery_file('ajaxqueue');
|
ui_require_jquery_file('ajaxqueue');
|
||||||
ui_require_jquery_file('bgiframe');
|
ui_require_jquery_file('bgiframe');
|
||||||
|
/*
|
||||||
|
ui_include_time_picker();
|
||||||
|
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -1341,6 +1386,51 @@ ui_require_jquery_file('bgiframe');
|
|||||||
div.firstChild.src = src;
|
div.firstChild.src = src;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
|
$("#text-date").datepicker({
|
||||||
|
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
|
||||||
|
changeMonth: true,
|
||||||
|
changeYear: true,
|
||||||
|
showAnim: "slideDown"
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-time_init]').timepicker({
|
||||||
|
showSecond: true,
|
||||||
|
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||||
|
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
||||||
|
timeText: '<?php echo __('Time'); ?>',
|
||||||
|
hourText: '<?php echo __('Hour'); ?>',
|
||||||
|
minuteText: '<?php echo __('Minute'); ?>',
|
||||||
|
secondText: '<?php echo __('Second'); ?>',
|
||||||
|
currentText: '<?php echo __('Now'); ?>',
|
||||||
|
closeText: '<?php echo __('Close'); ?>'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-date_init]').datepicker ({
|
||||||
|
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
|
||||||
|
changeMonth: true,
|
||||||
|
changeYear: true,
|
||||||
|
showAnim: "slideDown"
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-date_end]').datepicker ({
|
||||||
|
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
|
||||||
|
changeMonth: true,
|
||||||
|
changeYear: true,
|
||||||
|
showAnim: "slideDown"
|
||||||
|
});
|
||||||
|
|
||||||
|
$('[id^=text-time_end]').timepicker({
|
||||||
|
showSecond: true,
|
||||||
|
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||||
|
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
||||||
|
timeText: '<?php echo __('Time'); ?>',
|
||||||
|
hourText: '<?php echo __('Hour'); ?>',
|
||||||
|
minuteText: '<?php echo __('Minute'); ?>',
|
||||||
|
secondText: '<?php echo __('Second'); ?>',
|
||||||
|
currentText: '<?php echo __('Now'); ?>',
|
||||||
|
closeText: '<?php echo __('Close'); ?>'
|
||||||
|
});*/
|
||||||
});
|
});
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
</script>
|
</script>
|
||||||
|
@ -109,20 +109,39 @@ $interval_length = get_parameter('interval_length', NETFLOW_RES_MEDD);
|
|||||||
$address_resolution = (int) get_parameter('address_resolution', ($config['netflow_get_ip_hostname'] ?? ''));
|
$address_resolution = (int) get_parameter('address_resolution', ($config['netflow_get_ip_hostname'] ?? ''));
|
||||||
$filter_selected = (int) get_parameter('filter_selected', 0);
|
$filter_selected = (int) get_parameter('filter_selected', 0);
|
||||||
|
|
||||||
// Read time values.
|
// Calculate range dates.
|
||||||
$date = get_parameter_post('date', date(DATE_FORMAT, get_system_time()));
|
$custom_date = get_parameter('custom_date', '0');
|
||||||
$time = get_parameter_post('time', date(TIME_FORMAT, get_system_time()));
|
$date = get_parameter('date', SECONDS_1DAY);
|
||||||
$end_date = strtotime($date.' '.$time);
|
if ($custom_date === '1') {
|
||||||
$is_period = (bool) get_parameter('is_period', false);
|
$date_init = get_parameter('date_init');
|
||||||
$period = (int) get_parameter('period', SECONDS_1DAY);
|
$time_init = get_parameter('time_init');
|
||||||
$time_lower = get_parameter('time_lower', date(TIME_FORMAT, ($end_date - $period)));
|
$date_end = get_parameter('date_end');
|
||||||
$date_lower = get_parameter('date_lower', date(DATE_FORMAT, ($end_date - $period)));
|
$time_end = get_parameter('time_end');
|
||||||
$start_date = ($is_period) ? ($end_date - $period) : strtotime($date_lower.' '.$time_lower);
|
$date_from = strtotime($date_init.' '.$time_init);
|
||||||
if (!$is_period) {
|
$date_to = strtotime($date_end.' '.$time_end);
|
||||||
$period = ($end_date - $start_date);
|
} else if ($custom_date === '2') {
|
||||||
|
$date_text = get_parameter('date_text');
|
||||||
|
$date_units = get_parameter('date_units');
|
||||||
|
$period = ($date_text * $date_units);
|
||||||
|
$date_to = strtotime(date('Y-m-d H:i:s'));
|
||||||
|
$date_from = (strtotime($date_to) - $period);
|
||||||
|
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($date === 'this_week') {
|
||||||
|
$date_from = strtotime('last monday');
|
||||||
|
$date_to = strtotime($date_from.' +6 days');
|
||||||
|
} else if ($date === 'this_month') {
|
||||||
|
$date_from = strtotime('first day of this month');
|
||||||
|
$date_to = strtotime('last day of this month');
|
||||||
|
} else if ($date === 'past_month') {
|
||||||
|
$date_from = strtotime('first day of previous month');
|
||||||
|
$date_to = strtotime('last day of previous month');
|
||||||
|
} else if ($date === 'past_week') {
|
||||||
|
$date_from = strtotime('monday', strtotime('last week'));
|
||||||
|
$date_to = strtotime('sunday', strtotime('last week'));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$time_lower = date(TIME_FORMAT, $start_date);
|
$date_to = strtotime(date('Y-m-d H:i:s'));
|
||||||
$date_lower = date(DATE_FORMAT, $start_date);
|
$date_from = ($date_to - $date);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read buttons.
|
// Read buttons.
|
||||||
@ -459,82 +478,11 @@ if (empty($nodeListInput) === false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$filterTable->data[0][0] = html_print_label_input_block(
|
$filterTable->data[0][0] = html_print_label_input_block(
|
||||||
__('Interval'),
|
__('Date'),
|
||||||
html_print_extended_select_for_time(
|
html_print_select_date_range('date', true)
|
||||||
'period',
|
|
||||||
$period,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
[ 'div_id' => 'period_container' ]
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[0][0] .= html_print_label_input_block(
|
|
||||||
__('Start date'),
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => '',
|
|
||||||
'content' => html_print_input_text(
|
|
||||||
'date_lower',
|
|
||||||
$date_lower,
|
|
||||||
false,
|
|
||||||
13,
|
|
||||||
10,
|
|
||||||
true
|
|
||||||
).html_print_image(
|
|
||||||
'images/calendar_view_day.png',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'alt' => 'calendar',
|
|
||||||
'class' => 'main_menu_icon invert_filter',
|
|
||||||
]
|
|
||||||
).html_print_input_text(
|
|
||||||
'time_lower',
|
|
||||||
$time_lower,
|
|
||||||
false,
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
),
|
|
||||||
[ 'div_id' => 'end_date_container' ]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$filterTable->data[0][1] = html_print_label_input_block(
|
$filterTable->data[0][1] = html_print_label_input_block(
|
||||||
__('End date'),
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => '',
|
|
||||||
'content' => html_print_input_text(
|
|
||||||
'date',
|
|
||||||
$date,
|
|
||||||
false,
|
|
||||||
13,
|
|
||||||
10,
|
|
||||||
true
|
|
||||||
).html_print_image(
|
|
||||||
'images/calendar_view_day.png',
|
|
||||||
true,
|
|
||||||
['alt' => 'calendar']
|
|
||||||
).html_print_input_text(
|
|
||||||
'time',
|
|
||||||
$time,
|
|
||||||
false,
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[0][2] = html_print_label_input_block(
|
|
||||||
__('Resolution'),
|
__('Resolution'),
|
||||||
html_print_select(
|
html_print_select(
|
||||||
netflow_resolution_select_params(),
|
netflow_resolution_select_params(),
|
||||||
@ -552,15 +500,37 @@ $filterTable->data[0][2] = html_print_label_input_block(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$filterTable->data[1][] = html_print_label_input_block(
|
$filterTable->data[0][2] = html_print_label_input_block(
|
||||||
__('Defined period'),
|
__('Max values'),
|
||||||
html_print_checkbox_switch(
|
html_print_div(
|
||||||
'is_period',
|
[
|
||||||
1,
|
'class' => '',
|
||||||
($is_period === true) ? 1 : 0,
|
'content' => html_print_select(
|
||||||
true,
|
$max_values,
|
||||||
false,
|
'max_aggregates',
|
||||||
'nf_view_click_period(event)'
|
$max_aggregates,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true
|
||||||
|
).html_print_anchor(
|
||||||
|
[
|
||||||
|
'id' => 'max_values',
|
||||||
|
'href' => '#',
|
||||||
|
'onClick' => 'edit_max_value()',
|
||||||
|
'content' => html_print_image(
|
||||||
|
'images/edit.svg',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'id' => 'pencil',
|
||||||
|
'class' => 'main_menu_icon invert_filter',
|
||||||
|
]
|
||||||
|
),
|
||||||
|
],
|
||||||
|
true
|
||||||
|
),
|
||||||
|
],
|
||||||
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -594,39 +564,7 @@ $filterTable->data[1][] = html_print_label_input_block(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$filterTable->data[2][] = html_print_label_input_block(
|
|
||||||
__('Max values'),
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => '',
|
|
||||||
'content' => html_print_select(
|
|
||||||
$max_values,
|
|
||||||
'max_aggregates',
|
|
||||||
$max_aggregates,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
true
|
|
||||||
).html_print_anchor(
|
|
||||||
[
|
|
||||||
'id' => 'max_values',
|
|
||||||
'href' => '#',
|
|
||||||
'onClick' => 'edit_max_value()',
|
|
||||||
'content' => html_print_image(
|
|
||||||
'images/edit.svg',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'id' => 'pencil',
|
|
||||||
'class' => 'main_menu_icon invert_filter',
|
|
||||||
]
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->colspan[3][0] = 3;
|
$filterTable->colspan[3][0] = 3;
|
||||||
$filterTable->data[3][0] = html_print_label_input_block(
|
$filterTable->data[3][0] = html_print_label_input_block(
|
||||||
@ -696,15 +634,15 @@ if (empty($draw) === false) {
|
|||||||
$config['style']
|
$config['style']
|
||||||
);
|
);
|
||||||
|
|
||||||
$netflowContainerClass = ($chart_type === 'netflow_data' || $chart_type === 'netflow_summary' || $chart_type === 'netflow_top_N') ? '' : 'white_box';
|
$netflowContainerClass = ($chart_type === 'netflow_data' || $chart_type === 'netflow_summary' || $chart_type === 'netflow_top_N') ? '' : 'white_box relative';
|
||||||
|
|
||||||
// Draw the netflow chart.
|
// Draw the netflow chart.
|
||||||
html_print_div(
|
html_print_div(
|
||||||
[
|
[
|
||||||
'class' => $netflowContainerClass,
|
'class' => $netflowContainerClass,
|
||||||
'content' => netflow_draw_item(
|
'content' => netflow_draw_item(
|
||||||
$start_date,
|
$date_from,
|
||||||
$end_date,
|
$date_to,
|
||||||
$interval_length,
|
$interval_length,
|
||||||
$chart_type,
|
$chart_type,
|
||||||
$filter,
|
$filter,
|
||||||
|
@ -57,20 +57,48 @@ if (is_ajax() === true) {
|
|||||||
// Include JS timepicker.
|
// Include JS timepicker.
|
||||||
ui_include_time_picker();
|
ui_include_time_picker();
|
||||||
|
|
||||||
// Query params and other initializations.
|
|
||||||
$filter_id = (int) get_parameter('filter_id', 0);
|
// Calculate range dates.
|
||||||
$time_greater = get_parameter('time_greater', date(TIME_FORMAT));
|
$custom_date = get_parameter('custom_date', '0');
|
||||||
$date_greater = get_parameter('date_greater', date(DATE_FORMAT));
|
$date = get_parameter('date', SECONDS_1DAY);
|
||||||
$utimestamp_greater = strtotime($date_greater.' '.$time_greater);
|
if ($custom_date === '1') {
|
||||||
$is_period = (bool) get_parameter('is_period', false);
|
$date_init = get_parameter('date_init');
|
||||||
$period = (int) get_parameter('period', SECONDS_1HOUR);
|
$time_init = get_parameter('time_init');
|
||||||
$time_lower = get_parameter('time_lower', date(TIME_FORMAT, ($utimestamp_greater - $period)));
|
$date_end = get_parameter('date_end');
|
||||||
$date_lower = get_parameter('date_lower', date(DATE_FORMAT, ($utimestamp_greater - $period)));
|
$time_end = get_parameter('time_end');
|
||||||
$utimestamp_lower = ($is_period) ? ($utimestamp_greater - $period) : strtotime($date_lower.' '.$time_lower);
|
$date_from = strtotime($date_init.' '.$time_init);
|
||||||
if (!$is_period) {
|
$date_to = strtotime($date_end.' '.$time_end);
|
||||||
$period = ($utimestamp_greater - $utimestamp_lower);
|
} else if ($custom_date === '2') {
|
||||||
|
$date_text = get_parameter('date_text');
|
||||||
|
$date_units = get_parameter('date_units');
|
||||||
|
$period = ($date_text * $date_units);
|
||||||
|
$date_to = strtotime(date('Y-m-d H:i:s'));
|
||||||
|
$date_from = (strtotime($date_to) - $period);
|
||||||
|
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($date === 'this_week') {
|
||||||
|
$date_from = strtotime('last monday');
|
||||||
|
$date_to = strtotime($date_from.' +6 days');
|
||||||
|
} else if ($date === 'this_month') {
|
||||||
|
$date_from = strtotime('first day of this month');
|
||||||
|
$date_to = strtotime('last day of this month');
|
||||||
|
} else if ($date === 'past_month') {
|
||||||
|
$date_from = strtotime('first day of previous month');
|
||||||
|
$date_to = strtotime('last day of previous month');
|
||||||
|
} else if ($date === 'past_week') {
|
||||||
|
$date_from = strtotime('monday', strtotime('last week'));
|
||||||
|
$date_to = strtotime('sunday', strtotime('last week'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$date_to = strtotime(date('Y-m-d H:i:s'));
|
||||||
|
$date_from = ($date_to - $date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$filter_id = (int) get_parameter('filter_id', 0);
|
||||||
|
|
||||||
|
// Query params and other initializations.
|
||||||
|
$utimestamp_greater = $date_to;
|
||||||
|
$utimestamp_lower = $date_from;
|
||||||
|
|
||||||
$top = (int) get_parameter('top', 10);
|
$top = (int) get_parameter('top', 10);
|
||||||
$main_value = ((bool) get_parameter('remove_filter', 0)) ? '' : get_parameter('main_value', '');
|
$main_value = ((bool) get_parameter('remove_filter', 0)) ? '' : get_parameter('main_value', '');
|
||||||
if (is_numeric($main_value) && !in_array($action, ['udp', 'tcp'])) {
|
if (is_numeric($main_value) && !in_array($action, ['udp', 'tcp'])) {
|
||||||
@ -89,44 +117,6 @@ if (!in_array($order_by, ['bytes', 'pkts', 'flows'])) {
|
|||||||
$order_by = 'bytes';
|
$order_by = 'bytes';
|
||||||
}
|
}
|
||||||
|
|
||||||
$save = get_parameter('save_button', '');
|
|
||||||
$update = get_parameter('update_button', '');
|
|
||||||
|
|
||||||
// Save user defined filter.
|
|
||||||
if ($save != '' && check_acl($config['id_user'], 0, 'AW')) {
|
|
||||||
// Save filter args.
|
|
||||||
$data['filter_name'] = get_parameter('filter_name');
|
|
||||||
$data['top'] = $top;
|
|
||||||
$data['action'] = $action;
|
|
||||||
$data['advanced_filter'] = $advanced_filter;
|
|
||||||
|
|
||||||
|
|
||||||
$filter_id = db_process_sql_insert('tnetwork_explorer_filter', $data);
|
|
||||||
if ($filter_id === false) {
|
|
||||||
$filter_id = 0;
|
|
||||||
ui_print_error_message(__('Error creating filter'));
|
|
||||||
} else {
|
|
||||||
ui_print_success_message(__('Filter created successfully'));
|
|
||||||
}
|
|
||||||
} else if ($update != '' && check_acl($config['id_user'], 0, 'AW')) {
|
|
||||||
// Update current filter.
|
|
||||||
// Do not update the filter name and group.
|
|
||||||
$data['top'] = $top;
|
|
||||||
$data['action'] = $action;
|
|
||||||
$data['advanced_filter'] = $advanced_filter;
|
|
||||||
|
|
||||||
$result = db_process_sql_update(
|
|
||||||
'tnetwork_explorer_filter',
|
|
||||||
$data,
|
|
||||||
['id' => $filter_id]
|
|
||||||
);
|
|
||||||
ui_print_result_message(
|
|
||||||
$result,
|
|
||||||
__('Filter updated successfully'),
|
|
||||||
__('Error updating filter')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build the table.
|
// Build the table.
|
||||||
$filterTable = new stdClass();
|
$filterTable = new stdClass();
|
||||||
$filterTable->id = '';
|
$filterTable->id = '';
|
||||||
@ -136,95 +126,7 @@ $filterTable->size[0] = '33%';
|
|||||||
$filterTable->size[1] = '33%';
|
$filterTable->size[1] = '33%';
|
||||||
$filterTable->size[2] = '33%';
|
$filterTable->size[2] = '33%';
|
||||||
$filterTable->data = [];
|
$filterTable->data = [];
|
||||||
|
|
||||||
$filterTable->data[0][0] = html_print_label_input_block(
|
$filterTable->data[0][0] = html_print_label_input_block(
|
||||||
__('Interval'),
|
|
||||||
html_print_extended_select_for_time(
|
|
||||||
'period',
|
|
||||||
$period,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
[ 'div_id' => 'period_container' ]
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[0][0] .= html_print_label_input_block(
|
|
||||||
__('Start date'),
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => '',
|
|
||||||
'content' => html_print_input_text(
|
|
||||||
'date_lower',
|
|
||||||
$date_lower,
|
|
||||||
false,
|
|
||||||
13,
|
|
||||||
10,
|
|
||||||
true
|
|
||||||
).html_print_image(
|
|
||||||
'images/calendar_view_day.png',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'alt' => 'calendar',
|
|
||||||
'class' => 'main_menu_icon invert_filter',
|
|
||||||
]
|
|
||||||
).html_print_input_text(
|
|
||||||
'time_lower',
|
|
||||||
$time_lower,
|
|
||||||
false,
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
),
|
|
||||||
[ 'div_id' => 'end_date_container' ]
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[0][1] = html_print_label_input_block(
|
|
||||||
__('End date'),
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'content' => html_print_input_text(
|
|
||||||
'date',
|
|
||||||
$date_greater,
|
|
||||||
false,
|
|
||||||
13,
|
|
||||||
10,
|
|
||||||
true
|
|
||||||
).html_print_image(
|
|
||||||
'images/calendar_view_day.png',
|
|
||||||
true,
|
|
||||||
['alt' => 'calendar']
|
|
||||||
).html_print_input_text(
|
|
||||||
'time',
|
|
||||||
$time_greater,
|
|
||||||
false,
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[0][2] = html_print_label_input_block(
|
|
||||||
__('Defined period'),
|
|
||||||
html_print_checkbox_switch(
|
|
||||||
'is_period',
|
|
||||||
1,
|
|
||||||
($is_period === true) ? 1 : 0,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
'nf_view_click_period()'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[1][] = html_print_label_input_block(
|
|
||||||
__('Results to show'),
|
__('Results to show'),
|
||||||
html_print_select(
|
html_print_select(
|
||||||
[
|
[
|
||||||
@ -246,56 +148,9 @@ $filterTable->data[1][] = html_print_label_input_block(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$filterTable->data[1][] = html_print_label_input_block(
|
$filterTable->data[0][1] = html_print_label_input_block(
|
||||||
__('Data to show'),
|
__('Start date'),
|
||||||
html_print_select(
|
html_print_select_date_range('date', true)
|
||||||
network_get_report_actions(),
|
|
||||||
'action',
|
|
||||||
$action,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$advanced_toggle = new stdClass();
|
|
||||||
$advanced_toggle->class = 'filter-table-adv';
|
|
||||||
$advanced_toggle->size = [];
|
|
||||||
$advanced_toggle->size[0] = '50%';
|
|
||||||
$advanced_toggle->size[1] = '50%';
|
|
||||||
$advanced_toggle->width = '100%';
|
|
||||||
$user_groups = users_get_groups($config['id_user'], 'AR', $own_info['is_admin'], true);
|
|
||||||
$user_groups[0] = 0;
|
|
||||||
// Add all groups.
|
|
||||||
$sql = 'SELECT * FROM tnetwork_explorer_filter';
|
|
||||||
$advanced_toggle->data[0][0] = html_print_label_input_block(
|
|
||||||
__('Load Filter'),
|
|
||||||
html_print_select_from_sql($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true, false, true, false, 'width:100%;')
|
|
||||||
);
|
|
||||||
$advanced_toggle->data[0][1] = html_print_label_input_block(
|
|
||||||
__('Filter name'),
|
|
||||||
html_print_input_text('filter_name', '', false, 40, 45, true, false, false, '', 'w100p')
|
|
||||||
);
|
|
||||||
$advanced_toggle->colspan[1][0] = 2;
|
|
||||||
$advanced_toggle->data[1][0] = html_print_label_input_block(
|
|
||||||
__('Filter').ui_print_help_icon('pcap_filter', true),
|
|
||||||
html_print_textarea('advanced_filter', 4, 10, $advanced_filter, 'style="width:100%"', true)
|
|
||||||
);
|
|
||||||
$filterTable->colspan[2][0] = 3;
|
|
||||||
$filterTable->data[2][0] = html_print_label_input_block(
|
|
||||||
'',
|
|
||||||
ui_toggle(
|
|
||||||
html_print_table($advanced_toggle, true),
|
|
||||||
__('Advanced'),
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
'white-box-content',
|
|
||||||
'box-flat white_table_graph'
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$filterInputTable = '<form method="POST">';
|
$filterInputTable = '<form method="POST">';
|
||||||
@ -386,8 +241,6 @@ $data = netflow_get_top_summary(
|
|||||||
$hidden_main_link = [
|
$hidden_main_link = [
|
||||||
'time_greater' => $time_greater,
|
'time_greater' => $time_greater,
|
||||||
'date_greater' => $date_greater,
|
'date_greater' => $date_greater,
|
||||||
'is_period' => $is_period,
|
|
||||||
'period' => $period,
|
|
||||||
'time_lower' => $time_lower,
|
'time_lower' => $time_lower,
|
||||||
'date_lower' => $date_lower,
|
'date_lower' => $date_lower,
|
||||||
'top' => $top,
|
'top' => $top,
|
||||||
|
@ -84,19 +84,43 @@ ui_include_time_picker();
|
|||||||
|
|
||||||
// Query params and other initializations.
|
// Query params and other initializations.
|
||||||
$action = get_parameter('action', 'talkers');
|
$action = get_parameter('action', 'talkers');
|
||||||
$time_greater = get_parameter('time_greater', date(TIME_FORMAT));
|
// Calculate range dates.
|
||||||
$date_greater = get_parameter('date_greater', date(DATE_FORMAT));
|
$custom_date = get_parameter('custom_date', '0');
|
||||||
$utimestamp_greater = strtotime($date_greater.' '.$time_greater);
|
$date = get_parameter('date', SECONDS_1DAY);
|
||||||
$is_period = (bool) get_parameter('is_period', false);
|
if ($custom_date === '1') {
|
||||||
$period = (int) get_parameter('period', SECONDS_1HOUR);
|
$date_init = get_parameter('date_init');
|
||||||
$time_lower = get_parameter('time_lower', date(TIME_FORMAT, ($utimestamp_greater - $period)));
|
$time_init = get_parameter('time_init');
|
||||||
$date_lower = get_parameter('date_lower', date(DATE_FORMAT, ($utimestamp_greater - $period)));
|
$date_end = get_parameter('date_end');
|
||||||
$advanced_filter = get_parameter('advanced_filter', '');
|
$time_end = get_parameter('time_end');
|
||||||
$utimestamp_lower = ($is_period) ? ($utimestamp_greater - $period) : strtotime($date_lower.' '.$time_lower);
|
$date_from = strtotime($date_init.' '.$time_init);
|
||||||
if (!$is_period) {
|
$date_to = strtotime($date_end.' '.$time_end);
|
||||||
$period = ($utimestamp_greater - $utimestamp_lower);
|
} else if ($custom_date === '2') {
|
||||||
|
$date_text = get_parameter('date_text');
|
||||||
|
$date_units = get_parameter('date_units');
|
||||||
|
$period = ($date_text * $date_units);
|
||||||
|
$date_to = strtotime(date('Y-m-d H:i:s'));
|
||||||
|
$date_from = (strtotime($date_to) - $period);
|
||||||
|
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($date === 'this_week') {
|
||||||
|
$date_from = strtotime('last monday');
|
||||||
|
$date_to = strtotime($date_from.' +6 days');
|
||||||
|
} else if ($date === 'this_month') {
|
||||||
|
$date_from = strtotime('first day of this month');
|
||||||
|
$date_to = strtotime('last day of this month');
|
||||||
|
} else if ($date === 'past_month') {
|
||||||
|
$date_from = strtotime('first day of previous month');
|
||||||
|
$date_to = strtotime('last day of previous month');
|
||||||
|
} else if ($date === 'past_week') {
|
||||||
|
$date_from = strtotime('monday', strtotime('last week'));
|
||||||
|
$date_to = strtotime('sunday', strtotime('last week'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$date_to = strtotime(date('Y-m-d H:i:s'));
|
||||||
|
$date_from = ($date_to - $date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$advanced_filter = get_parameter('advanced_filter', '');
|
||||||
|
|
||||||
$top = (int) get_parameter('top', 10);
|
$top = (int) get_parameter('top', 10);
|
||||||
|
|
||||||
$order_by = get_parameter('order_by', 'bytes');
|
$order_by = get_parameter('order_by', 'bytes');
|
||||||
@ -186,93 +210,11 @@ $filterTable->size[2] = '33%';
|
|||||||
$filterTable->data = [];
|
$filterTable->data = [];
|
||||||
|
|
||||||
$filterTable->data[0][0] = html_print_label_input_block(
|
$filterTable->data[0][0] = html_print_label_input_block(
|
||||||
__('Interval'),
|
__('Date'),
|
||||||
html_print_extended_select_for_time(
|
html_print_select_date_range('date', true)
|
||||||
'period',
|
|
||||||
$period,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
[ 'div_id' => 'period_container' ]
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[0][0] .= html_print_label_input_block(
|
|
||||||
__('Start date'),
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'class' => '',
|
|
||||||
'content' => html_print_input_text(
|
|
||||||
'date_lower',
|
|
||||||
$date_lower,
|
|
||||||
false,
|
|
||||||
13,
|
|
||||||
10,
|
|
||||||
true
|
|
||||||
).html_print_image(
|
|
||||||
'images/calendar_view_day.png',
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'alt' => 'calendar',
|
|
||||||
'class' => 'main_menu_icon invert_filter',
|
|
||||||
]
|
|
||||||
).html_print_input_text(
|
|
||||||
'time_lower',
|
|
||||||
$time_lower,
|
|
||||||
false,
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
),
|
|
||||||
[ 'div_id' => 'end_date_container' ]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$filterTable->data[0][1] = html_print_label_input_block(
|
$filterTable->data[0][1] = html_print_label_input_block(
|
||||||
__('End date'),
|
|
||||||
html_print_div(
|
|
||||||
[
|
|
||||||
'content' => html_print_input_text(
|
|
||||||
'date',
|
|
||||||
$date_greater,
|
|
||||||
false,
|
|
||||||
13,
|
|
||||||
10,
|
|
||||||
true
|
|
||||||
).html_print_image(
|
|
||||||
'images/calendar_view_day.png',
|
|
||||||
true,
|
|
||||||
['alt' => 'calendar']
|
|
||||||
).html_print_input_text(
|
|
||||||
'time',
|
|
||||||
$time_greater,
|
|
||||||
false,
|
|
||||||
10,
|
|
||||||
8,
|
|
||||||
true
|
|
||||||
),
|
|
||||||
],
|
|
||||||
true
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[0][2] = html_print_label_input_block(
|
|
||||||
__('Defined period'),
|
|
||||||
html_print_checkbox_switch(
|
|
||||||
'is_period',
|
|
||||||
1,
|
|
||||||
($is_period === true) ? 1 : 0,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
'nf_view_click_period()'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$filterTable->data[1][] = html_print_label_input_block(
|
|
||||||
__('Results to show'),
|
__('Results to show'),
|
||||||
html_print_select(
|
html_print_select(
|
||||||
[
|
[
|
||||||
@ -294,7 +236,7 @@ $filterTable->data[1][] = html_print_label_input_block(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$filterTable->data[1][] = html_print_label_input_block(
|
$filterTable->data[0][2] = html_print_label_input_block(
|
||||||
__('Data to show'),
|
__('Data to show'),
|
||||||
html_print_select(
|
html_print_select(
|
||||||
network_get_report_actions(),
|
network_get_report_actions(),
|
||||||
@ -373,8 +315,8 @@ $has_data = false;
|
|||||||
|
|
||||||
if ((bool) get_parameter('update_netflow') === true) {
|
if ((bool) get_parameter('update_netflow') === true) {
|
||||||
$map_data = netflow_build_map_data(
|
$map_data = netflow_build_map_data(
|
||||||
$utimestamp_lower,
|
$date_from,
|
||||||
$utimestamp_greater,
|
$date_to,
|
||||||
$top,
|
$top,
|
||||||
($action === 'talkers') ? 'srcip' : 'dstip',
|
($action === 'talkers') ? 'srcip' : 'dstip',
|
||||||
$advanced_filter
|
$advanced_filter
|
||||||
|
@ -114,16 +114,53 @@ if ($view_graph) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get different date to search the report.
|
// Calculate range dates.
|
||||||
$date = (string) get_parameter('date', date(DATE_FORMAT));
|
$custom_date = get_parameter('custom_date', 0);
|
||||||
$time = (string) get_parameter('time', date(TIME_FORMAT));
|
$date = get_parameter('date', SECONDS_1DAY);
|
||||||
$unixdate = strtotime($date.' '.$time);
|
$date_text = get_parameter('date_text', SECONDS_1DAY);
|
||||||
|
if ($custom_date === '1') {
|
||||||
|
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
|
||||||
|
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
|
||||||
|
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
|
||||||
|
$datetime_init = strtotime($date_init.' '.$time_init);
|
||||||
|
$date_end = (string) get_parameter('date_end', date(DATE_FORMAT));
|
||||||
|
$time_end = (string) get_parameter('time_end', date(TIME_FORMAT));
|
||||||
|
$datetime_end = strtotime($date_end.' '.$time_end);
|
||||||
|
|
||||||
$period = (int) get_parameter('period');
|
if ($datetime_init >= $datetime_end) {
|
||||||
if (! $period) {
|
$datetime_init = $date_init_less;
|
||||||
$period = $graph['period'];
|
}
|
||||||
|
|
||||||
|
$unixdate = $datetime_end;
|
||||||
|
$period = ($unixdate - $datetime_init);
|
||||||
|
} else if ($custom_date === '2') {
|
||||||
|
$unixdate = strtotime('now');
|
||||||
|
$date_units = get_parameter('date_units');
|
||||||
|
$date_start = date('Y/m/d H:i:s', ($unixdate - ($date_text * $date_units)));
|
||||||
|
$period = ($unixdate - strtotime($date_start));
|
||||||
|
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($date === 'this_week') {
|
||||||
|
$monday = date('Y/m/d 00:00:00', strtotime('Monday this week'));
|
||||||
|
$sunday = date('Y/m/d 23:59:59', strtotime($monday.' +6 days'));
|
||||||
|
$period = (strtotime($sunday) - strtotime($monday));
|
||||||
|
$unixdate = strtotime($sunday);
|
||||||
|
} else if ($date === 'this_month') {
|
||||||
|
$unixdate = strtotime('last day of this month');
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
|
||||||
|
$period = ($unixdate - strtotime($first_of_month));
|
||||||
|
} else if ($date === 'past_month') {
|
||||||
|
$unixdate = strtotime('last day of previous month');
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
|
||||||
|
$period = ($unixdate - strtotime($first_of_month));
|
||||||
|
} else if ($date === 'past_week') {
|
||||||
|
$unixdate = strtotime('sunday', strtotime('last week'));
|
||||||
|
$first_of_week = date('Y-m-d', strtotime('monday', strtotime('last week')));
|
||||||
|
$period = ($unixdate - strtotime($first_of_week));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$period = $period;
|
$unixdate = strtotime('now');
|
||||||
|
$date_start = date('Y/m/d H:i:s', ($unixdate - $date));
|
||||||
|
$period = ($unixdate - strtotime($date_start));
|
||||||
}
|
}
|
||||||
|
|
||||||
$events = $graph['events'];
|
$events = $graph['events'];
|
||||||
@ -315,9 +352,9 @@ if ($view_graph) {
|
|||||||
$searchForm = '<form method="POST" action="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">';
|
$searchForm = '<form method="POST" action="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">';
|
||||||
$searchForm .= "<table class='filter-table-adv w100p' cellpadding='4' cellspacing='4'>";
|
$searchForm .= "<table class='filter-table-adv w100p' cellpadding='4' cellspacing='4'>";
|
||||||
$searchForm .= '<tr>';
|
$searchForm .= '<tr>';
|
||||||
|
/*
|
||||||
$searchForm .= '<td class="w30p">';
|
$searchForm .= '<td class="w30p">';
|
||||||
$searchForm .= html_print_label_input_block(
|
$searchForm .= html_print_label_input_block(
|
||||||
__('Date'),
|
__('Date'),
|
||||||
html_print_input_text(
|
html_print_input_text(
|
||||||
'date',
|
'date',
|
||||||
@ -327,9 +364,9 @@ if ($view_graph) {
|
|||||||
10,
|
10,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$searchForm .= '</td><td class="datos w30p">';
|
$searchForm .= '</td><td class="datos w30p">';
|
||||||
$searchForm .= html_print_label_input_block(
|
$searchForm .= html_print_label_input_block(
|
||||||
__('Time'),
|
__('Time'),
|
||||||
html_print_input_text(
|
html_print_input_text(
|
||||||
'time',
|
'time',
|
||||||
@ -339,33 +376,16 @@ if ($view_graph) {
|
|||||||
7,
|
7,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$searchForm .= '</td>';
|
$searchForm .= '</td>';
|
||||||
$searchForm .= "<td class='datos w30p'>";
|
$searchForm .= "<td class='datos w30p'>";
|
||||||
$searchForm .= html_print_label_input_block(
|
$searchForm .= html_print_label_input_block(
|
||||||
__('Time range'),
|
__('Time range'),
|
||||||
html_print_extended_select_for_time(
|
html_print_extended_select_for_time('period', (string) $period, '', '', 0, 10, true, 'width:100%')
|
||||||
'period',
|
);
|
||||||
(string) $period,
|
$searchForm .= '</td>';*/
|
||||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
|
||||||
'',
|
$searchForm .= '<td class="w25p">'.html_print_label_input_block(__('Date'), html_print_select_date_range('date', true)).'</td>';
|
||||||
0,
|
|
||||||
10,
|
|
||||||
true,
|
|
||||||
'width:100%',
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
0,
|
|
||||||
null,
|
|
||||||
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$searchForm .= '</td>';
|
|
||||||
$searchForm .= '</tr><tr>';
|
|
||||||
$searchForm .= "<td class='datos w30p'>";
|
$searchForm .= "<td class='datos w30p'>";
|
||||||
$stackeds = [];
|
$stackeds = [];
|
||||||
$stackeds[0] = __('Graph defined');
|
$stackeds[0] = __('Graph defined');
|
||||||
@ -559,14 +579,6 @@ if ($view_graph) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$datetime = strtotime($date.' '.$time);
|
|
||||||
$report['datetime'] = $datetime;
|
|
||||||
|
|
||||||
if ($datetime === false || $datetime == -1) {
|
|
||||||
ui_print_error_message(__('Invalid date selected'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,28 +43,59 @@ if (!reporting_user_can_see_report($id_report)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get different date to search the report.
|
// Calculations in order to modify init date of the report.
|
||||||
$date = (string) get_parameter('date', date(DATE_FORMAT));
|
|
||||||
$time = (string) get_parameter('time', date(TIME_FORMAT));
|
|
||||||
|
|
||||||
$datetime = strtotime($date.' '.$time);
|
|
||||||
|
|
||||||
// Calculations in order to modify init date of the report
|
|
||||||
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
|
$date_init_less = (strtotime(date('Y-m-j')) - SECONDS_1DAY);
|
||||||
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
|
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
|
||||||
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
|
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
|
||||||
$datetime_init = strtotime($date_init.' '.$time_init);
|
$datetime_init = strtotime($date_init.' '.$time_init);
|
||||||
$enable_init_date = get_parameter('enable_init_date', 0);
|
|
||||||
$pure = (int) get_parameter('pure', 0);
|
$pure = (int) get_parameter('pure', 0);
|
||||||
|
|
||||||
$period = null;
|
$period = null;
|
||||||
// Calculate new inteval for all reports
|
// Get different date to search the report.
|
||||||
if ($enable_init_date) {
|
$date_end = (string) get_parameter('date_end', date(DATE_FORMAT));
|
||||||
if ($datetime_init >= $datetime) {
|
$time_end = (string) get_parameter('time_end', date(TIME_FORMAT));
|
||||||
|
$datetime_end = strtotime($date_end.' '.$time_end);
|
||||||
|
|
||||||
|
// Calculate new inteval for all reports.
|
||||||
|
$custom_date = get_parameter('custom_date', 0);
|
||||||
|
$date = get_parameter('date', SECONDS_1DAY);
|
||||||
|
$date_text = get_parameter('date_text', SECONDS_1DAY);
|
||||||
|
if ($custom_date === '1') {
|
||||||
|
if ($datetime_init >= $datetime_end) {
|
||||||
$datetime_init = $date_init_less;
|
$datetime_init = $date_init_less;
|
||||||
}
|
}
|
||||||
|
|
||||||
$period = ($datetime - $datetime_init);
|
$period = ($datetime_end - $datetime_init);
|
||||||
|
} else if ($custom_date === '2') {
|
||||||
|
$date_units = get_parameter('date_units');
|
||||||
|
$date_end = date('Y/m/d H:i:s');
|
||||||
|
$date_start = date('Y/m/d H:i:s', (strtotime($date_end) - ($date_text * $date_units)));
|
||||||
|
$period = (strtotime($date_end) - strtotime($date_start));
|
||||||
|
} else if (in_array($date, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||||
|
if ($date === 'this_week') {
|
||||||
|
$monday = date('Y/m/d', strtotime('last monday'));
|
||||||
|
|
||||||
|
$sunday = date('Y/m/d', strtotime($monday.' +6 days'));
|
||||||
|
$period = (strtotime($sunday) - strtotime($monday));
|
||||||
|
$date_init = $monday;
|
||||||
|
$date_end = $sunday;
|
||||||
|
} else if ($date === 'this_month') {
|
||||||
|
$date_end = date('Y/m/d', strtotime('last day of this month'));
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
|
||||||
|
$period = (strtotime($date_end) - strtotime($first_of_month));
|
||||||
|
} else if ($date === 'past_month') {
|
||||||
|
$date_end = date('Y/m/d', strtotime('last day of previous month'));
|
||||||
|
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
|
||||||
|
$period = (strtotime($date_end) - strtotime($first_of_month));
|
||||||
|
} else if ($date === 'past_week') {
|
||||||
|
$date_end = date('Y-m-d', strtotime('sunday', strtotime('last week')));
|
||||||
|
$first_of_week = date('Y-m-d', strtotime('monday', strtotime('last week')));
|
||||||
|
$period = (strtotime($date_end) - strtotime($first_of_week));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$date_end = date('Y/m/d H:i:s');
|
||||||
|
$date_start = date('Y/m/d H:i:s', (strtotime($date_end) - $date));
|
||||||
|
$period = (strtotime($date_end) - strtotime($date_start));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shchedule report email.
|
// Shchedule report email.
|
||||||
@ -242,7 +273,7 @@ $table2->styleTable = 'border:none';
|
|||||||
|
|
||||||
if (defined('METACONSOLE')) {
|
if (defined('METACONSOLE')) {
|
||||||
$table2->width = '100%';
|
$table2->width = '100%';
|
||||||
$table2->class = 'databox filters';
|
$table2->class = 'databox filters filter-table-adv';
|
||||||
|
|
||||||
$table2->head[0] = __('View Report');
|
$table2->head[0] = __('View Report');
|
||||||
$table2->head_colspan[0] = 5;
|
$table2->head_colspan[0] = 5;
|
||||||
@ -264,14 +295,10 @@ if ($html_menu_export === ENTERPRISE_NOT_HOOK) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$table2->data[0][2] = '<div><span class="font-title-font">'.__('Set initial date').'</span><br>'.html_print_checkbox_switch('enable_init_date', 1, $enable_init_date, true).'</div><br>';
|
$table2->data[0][2] = html_print_label_input_block(
|
||||||
$table2->data[0][2] .= '<div style="display:'.$display_to.'" id="string_from"><div><span class="font-title-font">'.__('From').':</span></div>';
|
__('Date').':<br>',
|
||||||
$table2->data[0][2] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
|
html_print_select_date_range('date', true, get_parameter('date', SECONDS_1DAY), $date_init, $time_init, date('Y/m/d'), date('H:i:s'), $date_text)
|
||||||
$table2->data[0][2] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
|
);
|
||||||
$table2->data[0][2] .= '</div><div style="display:'.$display_item.'" id="string_items"><span class="font-title-font">'.__('Items period before').':</span></div>';
|
|
||||||
$table2->data[0][2] .= '<div style="display:'.$display_to.'" id="string_to"><span class="font-title-font">'.__('to').':</span></div>';
|
|
||||||
$table2->data[0][2] .= html_print_input_text('date', $date, '', 12, 10, true).' ';
|
|
||||||
$table2->data[0][2] .= html_print_input_text('time', $time, '', 10, 7, true).' ';
|
|
||||||
$table2->data[0][3] = $html_menu_export;
|
$table2->data[0][3] = $html_menu_export;
|
||||||
|
|
||||||
|
|
||||||
@ -313,7 +340,7 @@ ui_toggle(
|
|||||||
);
|
);
|
||||||
// ------------------------ END FORM ------------------------------------
|
// ------------------------ END FORM ------------------------------------
|
||||||
if ($enable_init_date) {
|
if ($enable_init_date) {
|
||||||
if ($datetime_init > $datetime) {
|
if ($datetime_init > $datetime_end) {
|
||||||
ui_print_error_message(
|
ui_print_error_message(
|
||||||
__('Invalid date selected. Initial date must be before end date.')
|
__('Invalid date selected. Initial date must be before end date.')
|
||||||
);
|
);
|
||||||
@ -323,7 +350,7 @@ if ($enable_init_date) {
|
|||||||
$report = reporting_make_reporting_data(
|
$report = reporting_make_reporting_data(
|
||||||
null,
|
null,
|
||||||
$id_report,
|
$id_report,
|
||||||
$date,
|
$date_end,
|
||||||
$time,
|
$time,
|
||||||
$period,
|
$period,
|
||||||
'dinamic'
|
'dinamic'
|
||||||
@ -367,28 +394,6 @@ $(document).ready (function () {
|
|||||||
|
|
||||||
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
||||||
|
|
||||||
$("#text-date").datepicker({
|
|
||||||
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
|
|
||||||
changeMonth: true,
|
|
||||||
changeYear: true,
|
|
||||||
showAnim: "slideDown"});
|
|
||||||
|
|
||||||
$('[id^=text-time_init]').timepicker({
|
|
||||||
showSecond: true,
|
|
||||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
|
||||||
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
|
||||||
timeText: '<?php echo __('Time'); ?>',
|
|
||||||
hourText: '<?php echo __('Hour'); ?>',
|
|
||||||
minuteText: '<?php echo __('Minute'); ?>',
|
|
||||||
secondText: '<?php echo __('Second'); ?>',
|
|
||||||
currentText: '<?php echo __('Now'); ?>',
|
|
||||||
closeText: '<?php echo __('Close'); ?>'});
|
|
||||||
|
|
||||||
$('[id^=text-date_init]').datepicker ({
|
|
||||||
dateFormat: "<?php echo DATE_FORMAT_JS; ?>",
|
|
||||||
changeMonth: true,
|
|
||||||
changeYear: true,
|
|
||||||
showAnim: "slideDown"});
|
|
||||||
|
|
||||||
/* Show/hide begin date reports controls */
|
/* Show/hide begin date reports controls */
|
||||||
$("#checkbox-enable_init_date").click(function() {
|
$("#checkbox-enable_init_date").click(function() {
|
||||||
@ -408,8 +413,4 @@ $(document).ready (function () {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($datetime === false || $datetime == -1) {
|
|
||||||
ui_print_error_message(__('Invalid date selected'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -73,9 +73,10 @@ if ($config['pure']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Control from managent polices.
|
// Control from managent polices.
|
||||||
$type = get_parameter('type', false);
|
$type = get_parameter('moduletype', false);
|
||||||
$page = get_parameter('page', false);
|
$page = get_parameter('page', false);
|
||||||
if (empty($page) && $type !== 'networkserver') {
|
|
||||||
|
if (empty($page) && $type !== 'networkserver' && $moduletype !== 2) {
|
||||||
// Header.
|
// Header.
|
||||||
ui_print_standard_header(
|
ui_print_standard_header(
|
||||||
__('SNMP Browser'),
|
__('SNMP Browser'),
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name apache2
|
%define httpd_name apache2
|
||||||
|
@ -1257,6 +1257,7 @@ CREATE TABLE IF NOT EXISTS `ttrap` (
|
|||||||
`text` VARCHAR(255) DEFAULT '',
|
`text` VARCHAR(255) DEFAULT '',
|
||||||
`description` VARCHAR(255) DEFAULT '',
|
`description` VARCHAR(255) DEFAULT '',
|
||||||
`severity` TINYINT UNSIGNED NOT NULL DEFAULT 2,
|
`severity` TINYINT UNSIGNED NOT NULL DEFAULT 2,
|
||||||
|
`utimestamp` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (`id_trap`),
|
PRIMARY KEY (`id_trap`),
|
||||||
INDEX timestamp (`timestamp`),
|
INDEX timestamp (`timestamp`),
|
||||||
INDEX status (`status`),
|
INDEX status (`status`),
|
||||||
@ -4276,10 +4277,17 @@ CREATE TABLE IF NOT EXISTS `tsesion_filter` (
|
|||||||
`id_filter` INT NOT NULL AUTO_INCREMENT,
|
`id_filter` INT NOT NULL AUTO_INCREMENT,
|
||||||
`id_name` TEXT NULL,
|
`id_name` TEXT NULL,
|
||||||
`text` TEXT NULL,
|
`text` TEXT NULL,
|
||||||
`period` TEXT NULL,
|
|
||||||
`ip` TEXT NULL,
|
`ip` TEXT NULL,
|
||||||
`type` TEXT NULL,
|
`type` TEXT NULL,
|
||||||
`user` TEXT NULL,
|
`user` TEXT NULL,
|
||||||
|
`custom_date` INT NULL,
|
||||||
|
`date` VARCHAR(45) NULL,
|
||||||
|
`date_text` VARCHAR(45) NULL,
|
||||||
|
`date_units` VARCHAR(45) NULL,
|
||||||
|
`date_init` VARCHAR(45) NULL,
|
||||||
|
`time_init` VARCHAR(45) NULL,
|
||||||
|
`date_end` VARCHAR(45) NULL,
|
||||||
|
`time_end` VARCHAR(45) NULL,
|
||||||
PRIMARY KEY (`id_filter`)
|
PRIMARY KEY (`id_filter`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||||
|
|
||||||
@ -4331,14 +4339,14 @@ CREATE TABLE IF NOT EXISTS `tsesion_filter_log_viewer` (
|
|||||||
`order` VARCHAR(45) NULL,
|
`order` VARCHAR(45) NULL,
|
||||||
`search` VARCHAR(255) NULL,
|
`search` VARCHAR(255) NULL,
|
||||||
`group_id` INT NULL,
|
`group_id` INT NULL,
|
||||||
`date_range` TINYINT NULL,
|
`custom_date` INT NULL,
|
||||||
`start_date_defined` VARCHAR(45) NULL,
|
`date` VARCHAR(45) NULL,
|
||||||
`start_date_time` VARCHAR(45) NULL,
|
`date_text` VARCHAR(45) NULL,
|
||||||
`start_date_date` VARCHAR(45) NULL,
|
`date_units` VARCHAR(45) NULL,
|
||||||
`start_date_date_range` VARCHAR(45) NULL,
|
`date_init` VARCHAR(45) NULL,
|
||||||
`start_date_time_range` VARCHAR(45) NULL,
|
`time_init` VARCHAR(45) NULL,
|
||||||
`end_date_date_range` VARCHAR(45) NULL,
|
`date_end` VARCHAR(45) NULL,
|
||||||
`end_date_time_range` VARCHAR(45) NULL,
|
`time_end` VARCHAR(45) NULL,
|
||||||
`agent` VARCHAR(255) NULL,
|
`agent` VARCHAR(255) NULL,
|
||||||
`source` VARCHAR(255) NULL,
|
`source` VARCHAR(255) NULL,
|
||||||
`display_mode` INT NULL,
|
`display_mode` INT NULL,
|
||||||
|
@ -1097,7 +1097,7 @@ INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `o
|
|||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (14,'Citrix_Sessions','module_begin\r\nmodule_name Citrix_Sessions\r\nmodule_description Opened active sessions on server\r\nmodule_type generic_data\r\nmodule_exec query session | grep Active | wc -l\r\nmodule_end ','Opened active sessions on server',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (14,'Citrix_Sessions','module_begin\r\nmodule_name Citrix_Sessions\r\nmodule_description Opened active sessions on server\r\nmodule_type generic_data\r\nmodule_exec query session | grep Active | wc -l\r\nmodule_end ','Opened active sessions on server',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (15,'Users_Connected','module_begin\r\nmodule_name Users_Connected\r\nmodule_description Users connected to this server\r\nmodule_type generic_data\r\nmodule_exec quser | grep Active | wc -l\r\nmodule_interval 2\r\nmodule_end\r\n ','Users connected to this server',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (15,'Users_Connected','module_begin\r\nmodule_name Users_Connected\r\nmodule_description Users connected to this server\r\nmodule_type generic_data\r\nmodule_exec quser | grep Active | wc -l\r\nmodule_interval 2\r\nmodule_end\r\n ','Users connected to this server',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (16,'Busy XML Threads','module_begin\r\nmodule_name Busy XML Threads\r\nmodule_description Total threads in the manager who manage the sessions. If there are more than XX, service fails. NOTE: Run this module only in managers\r\nmodule_type generic_data\r\nmodule_exec Typeperf '\\MAQUINA\Citrix Metaframe Presentation Server\Number of busy XML threads' -sc 1\r\nmodule_end\r\n','Total threads in the manager who manage the sessions. If there are more than XX, service fails. NOTE: Run this module only in managers',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (16,'Busy XML Threads','module_begin\r\nmodule_name Busy XML Threads\r\nmodule_description Total threads in the manager who manage the sessions. If there are more than XX, service fails. NOTE: Run this module only in managers\r\nmodule_type generic_data\r\nmodule_exec Typeperf '\\MAQUINA\Citrix Metaframe Presentation Server\Number of busy XML threads' -sc 1\r\nmodule_end\r\n','Total threads in the manager who manage the sessions. If there are more than XX, service fails. NOTE: Run this module only in managers',9,'',25,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (17,'CPU Load','module_begin
module_name CPU Load
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage
module_description CPU Load (%)
module_min_warning 80
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_end','CPU Load (using WMI)',9,'',11,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (17,'CPU Load','module_begin
module_name CPU Load
module_type generic_data
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage
module_description CPU Load (%)
module_min_warning 80
module_max_warning 90
module_min_critical 91
module_max_critical 0
module_end','CPU Load (using WMI)',9,'',11,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (18,'FreeMemory','# Free Memory
module_begin
module_name FreeMemory
module_type generic_data
module_freepercentmemory
module_description Free memory (%).
module_min_warning 21
module_max_warning 30
module_min_critical 0
module_max_critical 20
module_end','Free memory (%).',9,'',11,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (18,'FreeMemory','# Free Memory
module_begin
module_name FreeMemory
module_type generic_data
module_freepercentmemory
module_description Free memory (%).
module_min_warning 21
module_max_warning 30
module_min_critical 0
module_max_critical 20
module_end','Free memory (%).',9,'',11,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (19,'Microsoft Antivirus','module_begin
module_name Microsoft Antivirus
module_type generic_proc
module_service MsMpSvc
module_description Check if microsoft antivirus/malware service is running
module_end','Check if microsoft antivirus/malware service is running',9,'',11,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (19,'Microsoft Antivirus','module_begin
module_name Microsoft Antivirus
module_type generic_proc
module_service MsMpSvc
module_description Check if microsoft antivirus/malware service is running
module_end','Check if microsoft antivirus/malware service is running',9,'',11,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (21,'Microsoft Firewall','module_begin
module_name Microsoft Firewall
module_type generic_proc
module_service MpsSvc
module_description Microsoft windows firewall status.
module_end','Microsoft windows firewall status.',9,'',11,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (21,'Microsoft Firewall','module_begin
module_name Microsoft Firewall
module_type generic_proc
module_service MpsSvc
module_description Microsoft windows firewall status.
module_end','Microsoft windows firewall status.',9,'',11,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
@ -1116,7 +1116,7 @@ INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `o
|
|||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (34,'disk_root_free','module_begin
module_name disk_root_free
module_type generic_data
module_exec df -kh / | tail -1 | awk '{ print 100-$5 }'
module_max 100
module_min 0
module_description Free disk Percentage of root partition
module_end','Free disk Percentage of root partition',4,'',47,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (34,'disk_root_free','module_begin
module_name disk_root_free
module_type generic_data
module_exec df -kh / | tail -1 | awk '{ print 100-$5 }'
module_max 100
module_min 0
module_description Free disk Percentage of root partition
module_end','Free disk Percentage of root partition',4,'',47,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (35,'memfree','module_begin
module_name memfree
module_type generic_data
module_exec vmstat -H 1 2 | tail -1 | awk '{print $5}'
module_description Unused RAM memory
module_end
','Free memory on system',4,'',47,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (35,'memfree','module_begin
module_name memfree
module_type generic_data
module_exec vmstat -H 1 2 | tail -1 | awk '{print $5}'
module_description Unused RAM memory
module_end
','Free memory on system',4,'',47,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (36,'sshDaemon','module_begin
module_name sshDaemon
module_type generic_proc
module_exec ps -Af | grep sshd | grep -v "grep" | wc -l | sed "s/ //g"
module_end
','Check if SSH daemon is running',4,'',47,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (36,'sshDaemon','module_begin
module_name sshDaemon
module_type generic_proc
module_exec ps -Af | grep sshd | grep -v "grep" | wc -l | sed "s/ //g"
module_end
','Check if SSH daemon is running',4,'',47,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (37,'cpu_user','module_begin
module_name cpu_user
module_type generic_data
module_interval 1
module_exec sar 1 2 | tail -1 | awk '{ print $2 }'
module_max 100
module_min 0
module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_end','User CPU Usage (%)',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (37,'cpu_user','module_begin
module_name cpu_user
module_type generic_data
module_interval 1
module_exec sar 1 2 | tail -1 | awk '{ print $2 }'
module_max 100
module_min 0
module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 0
module_end','User CPU Usage (%)',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (38,'Load Average','module_begin
module_name Load Average
module_type generic_data
module_exec uptime | sed 's/.*load averages: //'|awk '{print $1}'
module_description Average process in CPU (Last minute)
module_end
','Average process in CPU (Last minute)',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (38,'Load Average','module_begin
module_name Load Average
module_type generic_data
module_exec uptime | sed 's/.*load averages: //'|awk '{print $1}'
module_description Average process in CPU (Last minute)
module_end
','Average process in CPU (Last minute)',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (39,'Cache mem free','module_begin
module_name Cache mem free
module_type generic_data
module_exec vm_stat | grep 'Pages free'| awk '{print $3/256}'
module_description Free cache memory in MB
module_min_warning 500
module_max_warning 600
module_min_critical 100
module_max_critical 499
module_end
','Free cache memory in MB',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (39,'Cache mem free','module_begin
module_name Cache mem free
module_type generic_data
module_exec vm_stat | grep 'Pages free'| awk '{print $3/256}'
module_description Free cache memory in MB
module_min_warning 500
module_max_warning 600
module_min_critical 100
module_max_critical 499
module_end
','Free cache memory in MB',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (40,'Free disk Percentage of root partition','module_begin
module_name disk_root_free
module_type generic_data
module_exec df -kh / | tail -1 | awk '{ print 100-$5 }'
module_max 100
module_min 0
module_description Free disk Percentage of root partition
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_end','Free disk Percentage of root partition',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (40,'Free disk Percentage of root partition','module_begin
module_name disk_root_free
module_type generic_data
module_exec df -kh / | tail -1 | awk '{ print 100-$5 }'
module_max 100
module_min 0
module_description Free disk Percentage of root partition
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_end','Free disk Percentage of root partition',8,'',48,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
|
||||||
@ -1230,7 +1230,7 @@ INSERT INTO `tpolicies` VALUES (6,'Basic Remote Checks','Basic Re
|
|||||||
|
|
||||||
INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin
module_name Bytes per second (Received)
module_type generic_data_inc
module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum ReceivedBytes |Select -ExpandProperty Sum"
module_end



',4,'','Bytes per second (Received)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin
module_name Bytes per second (Received)
module_type generic_data_inc
module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum ReceivedBytes |Select -ExpandProperty Sum"
module_end



',4,'','Bytes per second (Received)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin
module_name Bytes per second (Sent)
module_type generic_data_inc
module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum SentBytes |Select -ExpandProperty Sum"
module_end




',4,'','Bytes per second (Sent)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin
module_name Bytes per second (Sent)
module_type generic_data_inc
module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum SentBytes |Select -ExpandProperty Sum"
module_end




',4,'','Bytes per second (Sent)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin
module_name CPU %
module_type generic_data
module_cpuusage all
module_unit %
module_min_warning 79.00
module_end





',1,'CPU usage (%)','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin
module_name CPU %
module_type generic_data
module_cpuusage all
module_unit %
module_min_warning 79.00
module_max_warning 90.00;module_min_critical 91.00
module_max_critical 00.00;
module_end





',1,'CPU usage (%)','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin
module_name Total processes
module_type generic_data
module_exec tasklist | wc -l | gawk "{print $1}"
module_end


',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin
module_name Total processes
module_type generic_data
module_exec tasklist | wc -l | gawk "{print $1}"
module_end


',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin
module_name Uptime
module_type generic_data
module_exec powershell -c "((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Select -ExpandProperty Ticks) / 100000"
module_end




',1,'','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin
module_name Uptime
module_type generic_data
module_exec powershell -c "((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Select -ExpandProperty Ticks) / 100000"
module_end




',1,'','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||||||
INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin
module_name WMI Service
module_type generic_proc
module_service winmgmt
module_end

',2,'WMI Service enabled','WMI Service','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin
module_name WMI Service
module_type generic_proc
module_service winmgmt
module_end

',2,'WMI Service enabled','WMI Service','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-server
|
package: pandorafms-server
|
||||||
Version: 7.0NG.773.3-230904
|
Version: 7.0NG.773.3-230908
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -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.773.3-230904"
|
pandora_version="7.0NG.773.3-230908"
|
||||||
|
|
||||||
package_cpan=0
|
package_cpan=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||||||
|
|
||||||
# version: Defines actual version of Pandora Server for this module only
|
# version: Defines actual version of Pandora Server for this module only
|
||||||
my $pandora_version = "7.0NG.773.3";
|
my $pandora_version = "7.0NG.773.3";
|
||||||
my $pandora_build = "230904";
|
my $pandora_build = "230908";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
# Setup hash
|
# Setup hash
|
||||||
|
@ -686,9 +686,9 @@ sub get_agent_status ($$$) {
|
|||||||
if ($modules_async < $count_modules) {
|
if ($modules_async < $count_modules) {
|
||||||
my $last_contact = get_db_value($dbh,
|
my $last_contact = get_db_value($dbh,
|
||||||
'SELECT (UNIX_TIMESTAMP(ultimo_contacto) + (intervalo * 2)) AS last_contact
|
'SELECT (UNIX_TIMESTAMP(ultimo_contacto) + (intervalo * 2)) AS last_contact
|
||||||
FROM tagente WHERE id_agente = ?', $agent_id);
|
FROM tagente WHERE id_agente = ? AND UNIX_TIMESTAMP(ultimo_contacto) > 0', $agent_id);
|
||||||
|
|
||||||
if ($last_contact < time ()) {
|
if (defined($last_contact) && $last_contact < time ()) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||||||
|
|
||||||
# version: Defines actual version of Pandora Server for this module only
|
# version: Defines actual version of Pandora Server for this module only
|
||||||
my $pandora_version = "7.0NG.773.3";
|
my $pandora_version = "7.0NG.773.3";
|
||||||
my $pandora_build = "230904";
|
my $pandora_build = "230908";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||||
|
@ -382,8 +382,8 @@ sub pandora_snmptrapd {
|
|||||||
|
|
||||||
# Insert the trap into the DB
|
# Insert the trap into the DB
|
||||||
if (! defined(enterprise_hook ('snmp_insert_trap', [$pa_config, $source, $oid, $type, $value, $custom_oid, $custom_value, $custom_type, $timestamp, $server_id, $dbh]))) {
|
if (! defined(enterprise_hook ('snmp_insert_trap', [$pa_config, $source, $oid, $type, $value, $custom_oid, $custom_value, $custom_type, $timestamp, $server_id, $dbh]))) {
|
||||||
my $trap_id = db_insert ($dbh, 'id_trap', 'INSERT INTO ttrap (timestamp, source, oid, type, value, oid_custom, value_custom, type_custom) VALUES (?, ?, ?, ?, ?, ?, ?, ?)',
|
my $trap_id = db_insert ($dbh, 'id_trap', 'INSERT INTO ttrap (timestamp, source, oid, type, value, oid_custom, value_custom, type_custom, utimestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)',
|
||||||
$timestamp, $source, $oid, $type, $value, $custom_oid, $custom_value, $custom_type);
|
$timestamp, $source, $oid, $type, $value, $custom_oid, $custom_value, $custom_type, time());
|
||||||
logger ($pa_config, "Received SNMP Trap from $source", 4);
|
logger ($pa_config, "Received SNMP Trap from $source", 4);
|
||||||
|
|
||||||
# Evaluate alerts for this trap
|
# Evaluate alerts for this trap
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%global __os_install_post %{nil}
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_server
|
%define name pandorafms_server
|
||||||
%define version 7.0NG.773.3
|
%define version 7.0NG.773.3
|
||||||
%define release 230904
|
%define release 230908
|
||||||
|
|
||||||
Summary: Pandora FMS Server
|
Summary: Pandora FMS Server
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.773.3"
|
PI_VERSION="7.0NG.773.3"
|
||||||
PI_BUILD="230904"
|
PI_BUILD="230908"
|
||||||
|
|
||||||
MODE=$1
|
MODE=$1
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||||||
use PandoraFMS::DB;
|
use PandoraFMS::DB;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.773.3 Build 230904";
|
my $version = "7.0NG.773.3 Build 230908";
|
||||||
|
|
||||||
# Pandora server configuration
|
# Pandora server configuration
|
||||||
my %conf;
|
my %conf;
|
||||||
@ -359,7 +359,12 @@ sub pandora_purgedb ($$$) {
|
|||||||
log_message ('!', "Cannot execute " . $conf->{'_netflow_nfexpire'} . ", skipping.");
|
log_message ('!', "Cannot execute " . $conf->{'_netflow_nfexpire'} . ", skipping.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -r "$conf->{'_netflow_path'}" -t $conf->{'_netflow_max_lifetime'}d`;
|
# Update stats file with max lifetime.
|
||||||
|
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -u "$conf->{'_netflow_path'}" -t $conf->{'_netflow_max_lifetime'}d -w 100`;
|
||||||
|
# Rescan directory.
|
||||||
|
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -r "$conf->{'_netflow_path'}"`;
|
||||||
|
# Expire files
|
||||||
|
`yes 2>/dev/null | $conf->{'_netflow_nfexpire'} -e "$conf->{'_netflow_path'}"`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||||||
Encode::Locale::decode_argv;
|
Encode::Locale::decode_argv;
|
||||||
|
|
||||||
# version: define current version
|
# version: define current version
|
||||||
my $version = "7.0NG.773.3 Build 230904";
|
my $version = "7.0NG.773.3 Build 230908";
|
||||||
|
|
||||||
# save program name for logging
|
# save program name for logging
|
||||||
my $progname = basename($0);
|
my $progname = basename($0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user