Merge remote-tracking branch 'origin/develop' into new-vc-line-element
Conflicts: pandora_console/include/javascript/pandora.js
This commit is contained in:
commit
63dd3c48f8
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, AIX version
|
||||
# Version 7.0NG.741, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -36,6 +36,8 @@ mkdir -p temp_package/usr/bin/
|
|||
mkdir -p temp_package/usr/sbin/
|
||||
mkdir -p temp_package/etc/pandora/plugins
|
||||
mkdir -p temp_package/etc/pandora/collections
|
||||
mkdir -p temp_package/etc/pandora/trans
|
||||
mkdir -p temp_package/etc/pandora/commands
|
||||
mkdir -p temp_package/etc/init.d/
|
||||
mkdir -p temp_package/var/log/pandora/
|
||||
mkdir -p temp_package/usr/share/man/man1/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, FreeBSD Version
|
||||
# Version 7.0NG.741, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, HP-UX Version
|
||||
# Version 7.0NG.741, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, GNU/Linux
|
||||
# Version 7.0NG.741, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, GNU/Linux
|
||||
# Version 7.0NG.741, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, Solaris Version
|
||||
# Version 7.0NG.741, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2010 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.739
|
||||
# Version 7.0NG.741
|
||||
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
|
|
@ -324,6 +324,11 @@ install () {
|
|||
cp -r collections $PANDORA_BASE$PANDORA_HOME
|
||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections
|
||||
ln -s $PANDORA_BASE$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
echo "Copying Pandora FMS Agent commands to $PANDORA_BASE$PANDORA_HOME/commands..."
|
||||
cp -r commands $PANDORA_BASE$PANDORA_HOME
|
||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/commands
|
||||
ln -s $PANDORA_BASE$PANDORA_HOME/commands $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
echo "Copying tentacle server to $PANDORA_BASE$TENTACLE_SERVER"
|
||||
cp tentacle_server $PANDORA_BASE$TENTACLE_SERVER
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.739, AIX version
|
||||
# Version 7.0NG.741, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.739
|
||||
# Version 7.0NG.741
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.739, HPUX Version
|
||||
# Version 7.0NG.741, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739
|
||||
# Version 7.0NG.741
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739
|
||||
# Version 7.0NG.741
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739
|
||||
# Version 7.0NG.741
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.739, Solaris version
|
||||
# Version 7.0NG.741, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, AIX version
|
||||
# Version 7.0NG.741, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.739-190930
|
||||
Version: 7.0NG.741-191212
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.739-190930"
|
||||
pandora_version="7.0NG.741-191212"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -36,6 +36,8 @@ mkdir -p temp_package/usr/bin/
|
|||
mkdir -p temp_package/usr/sbin/
|
||||
mkdir -p temp_package/etc/pandora/plugins
|
||||
mkdir -p temp_package/etc/pandora/collections
|
||||
mkdir -p temp_package/etc/pandora/trans
|
||||
mkdir -p temp_package/etc/pandora/commands
|
||||
mkdir -p temp_package/etc/init.d/
|
||||
mkdir -p temp_package/lib/systemd/system/
|
||||
mkdir -p temp_package/var/log/pandora/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, GNU/Linux
|
||||
# Version 7.0NG.741, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, FreeBSD Version
|
||||
# Version 7.0NG.741, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, HP-UX Version
|
||||
# Version 7.0NG.741, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, GNU/Linux
|
||||
# Version 7.0NG.741, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, GNU/Linux
|
||||
# Version 7.0NG.741, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, NetBSD Version
|
||||
# Version 7.0NG.741, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.739, Solaris Version
|
||||
# Version 7.0NG.741, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -24,6 +24,7 @@ Version 6.0
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use POSIX qw(strftime floor);
|
||||
use Sys::Hostname;
|
||||
use File::Basename;
|
||||
|
@ -32,6 +33,18 @@ use IO::Socket;
|
|||
use Sys::Syslog;
|
||||
use Time::Local;
|
||||
|
||||
my $YAML = 0;
|
||||
# Dynamic load. Avoid unwanted behaviour.
|
||||
eval {
|
||||
eval 'require YAML::Tiny;1' or die('YAML::Tiny lib not found, commands feature won\'t be available');
|
||||
};
|
||||
if ($@) {
|
||||
$YAML = 0;
|
||||
print STDERR $@;
|
||||
} else {
|
||||
$YAML = 1;
|
||||
}
|
||||
|
||||
# Agent XML data
|
||||
my $Xml;
|
||||
|
||||
|
@ -41,8 +54,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.739';
|
||||
use constant AGENT_BUILD => '190930';
|
||||
use constant AGENT_VERSION => '7.0NG.741';
|
||||
use constant AGENT_BUILD => '191212';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -187,6 +200,7 @@ my %DefaultConf = (
|
|||
'custom_id' => '',
|
||||
'url_address' => '',
|
||||
'standby' => 0,
|
||||
'cmd_file' => undef,
|
||||
);
|
||||
my %Conf = %DefaultConf;
|
||||
|
||||
|
@ -268,6 +282,91 @@ sub error ($) {
|
|||
exit 1;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Try to load extra libraries.c
|
||||
################################################################################
|
||||
sub load_libraries() {
|
||||
# Dynamic load. Avoid unwanted behaviour.
|
||||
eval {eval 'require YAML::Tiny;1' or die('YAML::Tiny lib not found, commands feature won\'t be available');};
|
||||
if ($@) {
|
||||
$YAML = 0;
|
||||
print STDERR $@;
|
||||
} else {
|
||||
$YAML = 1;
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Erase blank spaces before and after the string
|
||||
################################################################################
|
||||
sub trim {
|
||||
my $string = shift;
|
||||
if (empty($string)){
|
||||
return "";
|
||||
}
|
||||
|
||||
$string =~ s/\r//g;
|
||||
|
||||
chomp($string);
|
||||
$string =~ s/^\s+//g;
|
||||
$string =~ s/\s+$//g;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Mix hashses
|
||||
################################################################################
|
||||
sub merge_hashes {
|
||||
my $_h1 = shift;
|
||||
my $_h2 = shift;
|
||||
|
||||
if (ref($_h1) ne "HASH") {
|
||||
return \%{$_h2} if (ref($_h2) eq "HASH");
|
||||
}
|
||||
|
||||
if (ref($_h2) ne "HASH") {
|
||||
return \%{$_h1} if (ref($_h1) eq "HASH");
|
||||
}
|
||||
|
||||
if ((ref($_h1) ne "HASH") && (ref($_h2) ne "HASH")) {
|
||||
return {};
|
||||
}
|
||||
|
||||
my %ret = (%{$_h1}, %{$_h2});
|
||||
|
||||
return \%ret;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Empty
|
||||
################################################################################
|
||||
sub empty {
|
||||
my $str = shift;
|
||||
|
||||
if (!(defined($str)) ){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(looks_like_number($str)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ref($str) eq "ARRAY") {
|
||||
return (($#{$str}<0)?1:0);
|
||||
}
|
||||
|
||||
if (ref($str) eq "HASH") {
|
||||
my @tmp = keys %{$str};
|
||||
return (($#tmp<0)?1:0);
|
||||
}
|
||||
|
||||
if ($str =~ /^\ *[\n\r]{0,2}\ *$/) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Check a regular expression. Returns 1 if its valid, 0 otherwise.
|
||||
################################################################################
|
||||
|
@ -284,6 +383,27 @@ sub valid_regexp ($) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Reads a file and returns entire content or undef if error.
|
||||
################################################################################
|
||||
sub read_file {
|
||||
my $path = shift;
|
||||
|
||||
my $_FILE;
|
||||
if( !open($_FILE, "<", $path) ) {
|
||||
# failed to open, return undef
|
||||
return undef;
|
||||
}
|
||||
|
||||
# Slurp configuration file content.
|
||||
my $content = do { local $/; <$_FILE> };
|
||||
|
||||
# Close file
|
||||
close($_FILE);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Recursively delete files and directories.
|
||||
################################################################################
|
||||
|
@ -776,7 +896,21 @@ sub read_config (;$) {
|
|||
next if ($line =~ /^module\s*\w*/);
|
||||
|
||||
#Configuration token
|
||||
if ($line =~ /^\s*(\S+)\s+(.*)$/) {
|
||||
if ($line =~ /^\s*(\S+)\s+(.*)$/) {
|
||||
# Reserved keyword.
|
||||
next if ($1 eq "commands");
|
||||
|
||||
if ($1 eq "cmd_file") {
|
||||
# Commands
|
||||
if (ref ($Conf{'commands'}) ne "HASH") {
|
||||
$Conf{'commands'} = {};
|
||||
}
|
||||
# Initialize empty command hash.
|
||||
$Conf{'commands'}->{$2} = {};
|
||||
log_message('setup', "Command required $2");
|
||||
next;
|
||||
}
|
||||
|
||||
log_message ('setup', "$1 is $2");
|
||||
$Conf{$1} = $2;
|
||||
|
||||
|
@ -923,6 +1057,7 @@ sub read_config (;$) {
|
|||
$Conf{'secondary_server_opts'} = '-x \'' . $Conf{'secondary_server_pwd'} . '\' ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_pwd'} ne '');
|
||||
$Conf{'secondary_server_opts'} = '-c ' . $Conf{'secondary_server_opts'} if ($Conf{'secondary_server_ssl'} eq '1');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#################################################################################
|
||||
|
@ -1157,14 +1292,14 @@ sub recv_file {
|
|||
};
|
||||
|
||||
if ($@) {
|
||||
log_message ('error', "Error retrieving file: File transfer command is not responding.");
|
||||
log_message ('error', "Error retrieving file: '.$file.' File transfer command is not responding.");
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Get the errorlevel
|
||||
my $rc = $? >> 8;
|
||||
if ($rc != 0) {
|
||||
log_message ('error', "Error retrieving file: $output");
|
||||
log_message ('error', "Error retrieving file: '$file' $output");
|
||||
}
|
||||
exit $rc;
|
||||
}
|
||||
|
@ -1233,6 +1368,10 @@ sub check_remote_config () {
|
|||
%Collections = ();
|
||||
%Conf = %DefaultConf;
|
||||
|
||||
# Supposed to discard current configuration but not.
|
||||
# Cleanup old commands configuration.
|
||||
$Conf{'commands'} = {};
|
||||
|
||||
# Reload the new configuration
|
||||
read_config ();
|
||||
|
||||
|
@ -1362,6 +1501,336 @@ sub check_collections () {
|
|||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Check for remote commands defined.
|
||||
################################################################################
|
||||
sub prepare_commands {
|
||||
if ($YAML == 0) {
|
||||
log_message(
|
||||
'error',
|
||||
'Cannot use commands without YAML dependency, please install it.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
# Force configuration file read.
|
||||
my @commands = read_config('cmd_file');
|
||||
|
||||
if (empty(\@commands)) {
|
||||
$Conf{'commands'} = {};
|
||||
} else {
|
||||
foreach my $rcmd (@commands) {
|
||||
$Conf{'commands'}->{trim($rcmd)} = {};
|
||||
}
|
||||
}
|
||||
|
||||
# Cleanup old commands. Not registered.
|
||||
cleanup_old_commands();
|
||||
|
||||
foreach my $ref (keys %{$Conf{'commands'}}) {
|
||||
my $file_content;
|
||||
my $download = 0;
|
||||
my $rcmd_file = $ConfDir.'/commands/'.$ref.'.rcmd';
|
||||
|
||||
# Check for local .rcmd.done files
|
||||
if (-e $rcmd_file.'.done') {
|
||||
# Ignore.
|
||||
delete $Conf{'commands'}->{$ref};
|
||||
next;
|
||||
}
|
||||
|
||||
# Search for local .rcmd file
|
||||
if (-e $rcmd_file) {
|
||||
my $remote_md5_file = $Conf{'temporal'}.'/'.$ref.'.md5';
|
||||
|
||||
$file_content = read_file($rcmd_file);
|
||||
if (recv_file($ref.'.md5', $remote_md5_file) != 0) {
|
||||
# Remote file could not be retrieved, skip.
|
||||
delete $Conf{'commands'}->{$ref};
|
||||
next;
|
||||
}
|
||||
|
||||
my $local_md5 = md5($file_content);
|
||||
my $remote_md5 = md5(read_file($remote_md5_file));
|
||||
|
||||
if ($local_md5 ne $remote_md5) {
|
||||
# Must be downloaded again.
|
||||
$download = 1;
|
||||
}
|
||||
} else {
|
||||
$download = 1;
|
||||
}
|
||||
|
||||
# Search for remote .rcmd file
|
||||
if ($download == 1) {
|
||||
# Download .rcmd file
|
||||
if (recv_file($ref.'.rcmd') != 0) {
|
||||
# Remote file could not be retrieved, skip.
|
||||
delete $Conf{'commands'}->{$ref};
|
||||
next;
|
||||
} else {
|
||||
# Success
|
||||
move($Conf{'temporal'}.'/'.$ref.'.rcmd', $rcmd_file);
|
||||
}
|
||||
}
|
||||
|
||||
# Parse and prepare in memory skel.
|
||||
eval {
|
||||
$Conf{'commands'}->{$ref} = YAML::Tiny->read($rcmd_file);
|
||||
};
|
||||
if ($@) {
|
||||
# Failed.
|
||||
log_message('error', 'Failed to decode command. ' . "\n".$@);
|
||||
delete $Conf{'commands'}->{$ref};
|
||||
next;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Command report.
|
||||
################################################################################
|
||||
sub report_command {
|
||||
my ($ref, $err_level) = @_;
|
||||
|
||||
# Retrieve content from .stdout and .stderr
|
||||
my $stdout_file = $Conf{'temporal'}.'/'.$ref.'.stdout';
|
||||
my $stderr_file = $Conf{'temporal'}.'/'.$ref.'.stderr';
|
||||
|
||||
my $return;
|
||||
eval {
|
||||
$return = {
|
||||
'error_level' => $err_level,
|
||||
'stdout' => read_file($stdout_file),
|
||||
'stderr' => read_file($stderr_file),
|
||||
};
|
||||
|
||||
$return->{'name'} = $Conf{'commands'}->{$ref}->[0]->{'name'};
|
||||
};
|
||||
if ($@) {
|
||||
log_message('error', 'Failed to report command output. ' . $@);
|
||||
}
|
||||
|
||||
# Cleanup
|
||||
unlink($stdout_file) if (-e $stdout_file);
|
||||
unlink($stderr_file) if (-e $stderr_file);
|
||||
|
||||
# Mark command as done.
|
||||
open (my $R_FILE, '> '.$ConfDir.'/commands/'.$ref.'.rcmd.done');
|
||||
print $R_FILE $err_level;
|
||||
close($R_FILE);
|
||||
|
||||
|
||||
$return->{'stdout'} = '' unless defined ($return->{'stdout'});
|
||||
$return->{'stderr'} = '' unless defined ($return->{'stderr'});
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Cleanup unreferenced rcmd and rcmd.done files.
|
||||
################################################################################
|
||||
sub cleanup_old_commands {
|
||||
# Cleanup old .rcmd and .rcmd.done files.
|
||||
my %registered = map { $_.'.rcmd' => 1 } keys %{$Conf{'commands'}};
|
||||
if(opendir(my $dir, $ConfDir.'/commands/')) {
|
||||
while (my $item = readdir($dir)) {
|
||||
|
||||
# Skip other files.
|
||||
next if ($item !~ /\.rcmd$/);
|
||||
|
||||
# Clean .rcmd.done file if its command is not referenced in conf.
|
||||
if (!defined($registered{$item})) {
|
||||
if (-e $ConfDir.'/commands/'.$item) {
|
||||
unlink($ConfDir.'/commands/'.$item);
|
||||
}
|
||||
if (-e $ConfDir.'/commands/'.$item.'.done') {
|
||||
unlink($ConfDir.'/commands/'.$item.'.done');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Close dir.
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Executes a command using defined timeout.
|
||||
################################################################################
|
||||
sub execute_command_timeout {
|
||||
my ($cmd, $timeout) = @_;
|
||||
|
||||
if (!defined($timeout)
|
||||
|| !looks_like_number($timeout)
|
||||
|| $timeout <= 0
|
||||
) {
|
||||
`$cmd`;
|
||||
return $?>>8;
|
||||
}
|
||||
|
||||
my $remaining_timeout = $timeout;
|
||||
|
||||
my $RET;
|
||||
my $output;
|
||||
|
||||
my $pid = open ($RET, "-|");
|
||||
if (!defined($pid)) {
|
||||
# Failed to fork.
|
||||
log_message('error', '[command] Failed to fork.');
|
||||
return undef;
|
||||
}
|
||||
if ($pid == 0) {
|
||||
# Child.
|
||||
my $ret;
|
||||
eval {
|
||||
local $SIG{ALRM} = sub { die "timeout\n" };
|
||||
alarm $timeout;
|
||||
`$cmd`;
|
||||
alarm 0;
|
||||
};
|
||||
|
||||
my $result = ($?>>8);
|
||||
print $result;
|
||||
|
||||
# Exit child.
|
||||
# Child finishes.
|
||||
exit;
|
||||
|
||||
} else {
|
||||
# Parent waiting.
|
||||
while( --$remaining_timeout > 0 ){
|
||||
if (wait == -1) {
|
||||
last;
|
||||
}
|
||||
# Wait child up to timeout seconds.
|
||||
sleep 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($remaining_timeout > 0) {
|
||||
# Retrieve output from child.
|
||||
$output = do { local $/; <$RET> };
|
||||
$output = $output>>8;
|
||||
}
|
||||
else {
|
||||
# Timeout expired.
|
||||
return 124;
|
||||
}
|
||||
|
||||
close($RET);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Executes a block of commands, returns error level, leaves output in
|
||||
# redirection set by $std_files. E.g:
|
||||
# $std_files = ' >> /tmp/stdout 2>> /tmp/stderr
|
||||
################################################################################
|
||||
sub execute_command_block {
|
||||
my ($commands, $std_files, $timeout, $retry) = @_;
|
||||
|
||||
return 0 unless defined($commands);
|
||||
|
||||
my $retries = $retry;
|
||||
|
||||
$retries = 1 unless looks_like_number($retries) && $retries > 0;
|
||||
|
||||
my $err_level = 0;
|
||||
$std_files = '' unless defined ($std_files);
|
||||
|
||||
if (ref($commands) ne "ARRAY") {
|
||||
return 0 if $commands eq '';
|
||||
|
||||
do {
|
||||
$err_level = execute_command_timeout(
|
||||
"($commands) $std_files",
|
||||
$timeout
|
||||
);
|
||||
|
||||
# Do not retry if success.
|
||||
last if looks_like_number($err_level) && $err_level == 0;
|
||||
} while ((--$retries) > 0);
|
||||
|
||||
} else {
|
||||
foreach my $comm (@{$commands}) {
|
||||
next unless defined($comm);
|
||||
$retries = $retry;
|
||||
$retries = 1 unless looks_like_number($retries) && $retries > 0;
|
||||
|
||||
do {
|
||||
$err_level = execute_command_timeout(
|
||||
"($comm) $std_files",
|
||||
$timeout
|
||||
);
|
||||
|
||||
# Do not retry if success.
|
||||
last if looks_like_number($err_level) && $err_level == 0;
|
||||
|
||||
} while ((--$retries) > 0);
|
||||
|
||||
# Do not continue evaluating block if failed.
|
||||
last unless ($err_level == 0);
|
||||
}
|
||||
}
|
||||
|
||||
return $err_level;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Evalate given command.
|
||||
################################################################################
|
||||
sub evaluate_command {
|
||||
my ($ref) = @_;
|
||||
|
||||
# Not found.
|
||||
return unless defined $Conf{'commands'}->{$ref};
|
||||
|
||||
# Already completed.
|
||||
return if (-e $ConfDir.'/commands/'.$ref.'.rcmd.done');
|
||||
|
||||
# [0] because how library works.
|
||||
my $cmd = $Conf{'commands'}->{$ref}->[0];
|
||||
|
||||
my $std_files = ' >> '.$Conf{'temporal'}.'/'.$ref.'.stdout ';
|
||||
$std_files .= ' 2>> '.$Conf{'temporal'}.'/'.$ref.'.stderr ';
|
||||
|
||||
# Check preconditions
|
||||
my $err_level;
|
||||
|
||||
$err_level = execute_command_block(
|
||||
$cmd->{'preconditions'},
|
||||
$std_files,
|
||||
$cmd->{'timeout'}
|
||||
);
|
||||
|
||||
# Precondition not satisfied.
|
||||
return report_command($ref, $err_level) unless ($err_level == 0);
|
||||
|
||||
# Main run.
|
||||
$err_level = execute_command_block(
|
||||
$cmd->{'script'},
|
||||
$std_files,
|
||||
$cmd->{'timeout'}
|
||||
);
|
||||
|
||||
# Script not success.
|
||||
return report_command($ref, $err_level) unless ($err_level == 0);
|
||||
|
||||
# Check postconditions
|
||||
$err_level = execute_command_block(
|
||||
$cmd->{'postconditions'},
|
||||
$std_files,
|
||||
$cmd->{'timeout'}
|
||||
);
|
||||
|
||||
# Return results.
|
||||
return report_command($ref, $err_level);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Sleep function
|
||||
################################################################################
|
||||
|
@ -2985,6 +3454,8 @@ my $iter_base_time = time();
|
|||
$LogFileIdx = -1;
|
||||
# Loop
|
||||
while (1) {
|
||||
load_libraries();
|
||||
|
||||
if (-e $Conf{'logfile'} && (stat($Conf{'logfile'}))[7] > $Conf{'logsize'}) {
|
||||
rotate_log();
|
||||
}
|
||||
|
@ -2999,6 +3470,9 @@ while (1) {
|
|||
# Check file collections
|
||||
check_collections () unless ($Conf{'debug'} eq '1');
|
||||
|
||||
# Check scheduled commands
|
||||
prepare_commands() unless ($Conf{'debug'} eq '1');
|
||||
|
||||
# Launch broker agents
|
||||
@BrokerPid = ();
|
||||
my @broker_agents = read_config ('broker_agent');
|
||||
|
@ -3128,6 +3602,24 @@ while (1) {
|
|||
}
|
||||
}
|
||||
|
||||
if (ref ($Conf{'commands'}) eq "HASH") {
|
||||
foreach my $command (keys %{$Conf{'commands'}}) {
|
||||
my $result = evaluate_command($command);
|
||||
if (ref($result) eq "HASH") {
|
||||
# Process command result.
|
||||
$Xml .= "<cmd_report>\n";
|
||||
$Xml .= " <cmd_response>\n";
|
||||
$Xml .= " <cmd_name><![CDATA[".$result->{'name'}."]]></cmd_name>\n";
|
||||
$Xml .= " <cmd_key><![CDATA[".$command."]]></cmd_key>\n";
|
||||
$Xml .= " <cmd_errorlevel><![CDATA[".$result->{'error_level'}."]]></cmd_errorlevel>\n";
|
||||
$Xml .= " <cmd_stdout><![CDATA[".$result->{'stdout'}."]]></cmd_stdout>\n";
|
||||
$Xml .= " <cmd_stderr><![CDATA[".$result->{'stderr'}."]]></cmd_stderr>\n";
|
||||
$Xml .= " </cmd_response>\n";
|
||||
$Xml .= "</cmd_report>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Wait for all the threads
|
||||
$ThreadSem->down ($Conf{'agent_threads'}) if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
|
||||
$ThreadSem->up ($Conf{'agent_threads'}) if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.739
|
||||
%define release 190930
|
||||
%define version 7.0NG.741
|
||||
%define release 191212
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
|
|||
Requires: fileutils textutils unzip
|
||||
Requires: util-linux procps grep
|
||||
Requires: /sbin/ip /bin/awk
|
||||
Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip)
|
||||
Requires: perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
|
||||
# Required by plugins
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
AutoReq: 0
|
||||
|
@ -99,6 +99,11 @@ if [ ! -e /etc/pandora/collections ]; then
|
|||
ln -s /usr/share/pandora_agent/collections /etc/pandora
|
||||
fi
|
||||
|
||||
if [ ! -e /etc/pandora/commands ]; then
|
||||
mkdir -p /usr/share/pandora_agent/commands
|
||||
ln -s /usr/share/pandora_agent/commands /etc/pandora
|
||||
fi
|
||||
|
||||
mkdir -p /var/spool/pandora/data_out
|
||||
if [ ! -d /var/log/pandora ]; then
|
||||
mkdir -p /var/log/pandora
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.739
|
||||
%define release 190930
|
||||
%define version 7.0NG.741
|
||||
%define release 191212
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -19,7 +19,7 @@ Prefix: /usr/share
|
|||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
BuildArch: noarch
|
||||
PreReq: %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep /usr/sbin/useradd
|
||||
Requires: coreutils unzip perl
|
||||
Requires: coreutils unzip perl perl(Sys::Syslog) perl(IO::Compress::Zip) perl(YAML::Tiny)
|
||||
AutoReq: 0
|
||||
Provides: %{name}-%{version}
|
||||
|
||||
|
@ -90,6 +90,11 @@ fi
|
|||
if [ ! -e /etc/pandora/collections ]; then
|
||||
mkdir /etc/pandora/collections
|
||||
fi
|
||||
|
||||
if [ ! -e /etc/pandora/commands ]; then
|
||||
mkdir /etc/pandora/commands
|
||||
fi
|
||||
|
||||
cp -aRf /usr/share/pandora_agent/pandora_agent_logrotate /etc/logrotate.d/pandora_agent
|
||||
|
||||
# Enable the service on SystemD
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.739"
|
||||
PI_BUILD="190930"
|
||||
PI_VERSION="7.0NG.741"
|
||||
PI_BUILD="191212"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -89,7 +89,7 @@ fi
|
|||
[ "$4" ] && PANDORA_PERL_PATH=$4
|
||||
|
||||
# Check for Perl 5.6.x or higher available
|
||||
PERL_VERSION=`$PANDORA_PERL_PATH -v | egrep 'v5.[6-9]|v5.[12][0-9]' | grep perl`
|
||||
PERL_VERSION=`$PANDORA_PERL_PATH -v | egrep 'v5.[6-9]|v5.[1-3][0-9]' | grep perl`
|
||||
|
||||
if [ -z "$PERL_VERSION" ]
|
||||
then
|
||||
|
@ -400,6 +400,11 @@ install () {
|
|||
mkdir -p $PANDORA_BASE$PANDORA_HOME/collections
|
||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections
|
||||
ln -s $PANDORA_BASE_REAL$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
echo "Creating the commands directory in $PANDORA_BASE$PANDORA_HOME/commands..."
|
||||
mkdir -p $PANDORA_BASE$PANDORA_HOME/commands
|
||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/commands
|
||||
ln -s $PANDORA_BASE_REAL$PANDORA_HOME/commands $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
if [ $WITHOUT_TENTACLE_SERVER -eq 0 ]
|
||||
then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2017 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.739
|
||||
# Version 7.0NG.741
|
||||
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.739}
|
||||
{Pandora FMS Windows Agent v7.0NG.741}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{190930}
|
||||
{191212}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -1708,3 +1708,17 @@ void
|
|||
Pandora_Module::setExecutions (long executions) {
|
||||
this->executions = executions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the module has intensive conditions.
|
||||
*
|
||||
* @return true if the module's intensive condition list is not empty, false if it is.
|
||||
*/
|
||||
bool
|
||||
Pandora_Module::isIntensive () {
|
||||
if (this->intensive_condition_list == NULL || this->intensive_condition_list->size () <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -303,6 +303,7 @@ namespace Pandora_Modules {
|
|||
time_t getTimestamp ();
|
||||
void setIntensiveMatch (unsigned char intensive_match);
|
||||
unsigned char getIntensiveMatch ();
|
||||
bool isIntensive ();
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.739(Build 190930)")
|
||||
#define PANDORA_VERSION ("7.0NG.741(Build 191212)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -1918,16 +1918,19 @@ Pandora_Windows_Service::pandora_run_broker (string config, long executions) {
|
|||
}
|
||||
|
||||
/* Evaluate intensive conditions */
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->broker_modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
if (module->isIntensive()) {
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->broker_modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
}
|
||||
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
}
|
||||
|
||||
/* Evaluate module conditions */
|
||||
|
@ -2038,16 +2041,19 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
|
|||
}
|
||||
|
||||
/* Evaluate intensive conditions */
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
if (module->isIntensive()) {
|
||||
intensive_match = module->evaluateIntensiveConditions ();
|
||||
if (forced_run != 1 && intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
|
||||
module->setNoOutput ();
|
||||
this->modules->goNext ();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
}
|
||||
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
}
|
||||
|
||||
/* Evaluate module conditions */
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.739(Build 190930))"
|
||||
VALUE "ProductVersion", "(7.0NG.741(Build 191212))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.739-190930
|
||||
Version: 7.0NG.741-191212
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.739-190930"
|
||||
pandora_version="7.0NG.741-191212"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -11,4 +11,11 @@ echo Restart the apache.
|
|||
/etc/init.d/apache2 restart
|
||||
fi
|
||||
|
||||
# Install pandora_websocket_engine service.
|
||||
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
|
||||
chmod +x /etc/init.d/pandora_websocket_engine
|
||||
|
||||
echo "You can now start the Pandora FMS Websocket service by executing"
|
||||
echo " /etc/init.d/pandora_websocket_engine start"
|
||||
|
||||
echo "Please, now, point your browser to http://your_IP_address/pandora_console/install.php and follow all the steps described on it."
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "Pandora FMS",
|
||||
"name": "pandorafms/console",
|
||||
"description": "Pandora Flexible Monitoring System ",
|
||||
"authors": [
|
||||
{
|
||||
|
@ -14,7 +14,9 @@
|
|||
"autoload": {
|
||||
"psr-4": {
|
||||
"Models\\": "include/rest-api/models",
|
||||
"Enterprise\\Models\\": "enterprise/include/rest-api/models"
|
||||
"Enterprise\\Models\\": "enterprise/include/rest-api/models",
|
||||
"PandoraFMS\\": "include/lib",
|
||||
"PandoraFMS\\Enterprise\\": "enterprise/include/lib"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
|
|
|
@ -13,7 +13,264 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
|
||||
|
||||
/**
|
||||
* Extra JS.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function agents_modules_load_js()
|
||||
{
|
||||
$ignored_params['refresh'] = '';
|
||||
|
||||
?>
|
||||
<style type='text/css'>
|
||||
.rotate_text_module {
|
||||
-ms-transform: rotate(270deg);
|
||||
-webkit-transform: rotate(270deg);
|
||||
-moz-transform: rotate(270deg);
|
||||
-o-transform: rotate(270deg);
|
||||
writing-mode: lr-tb;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function () {
|
||||
//Get max width of name of modules
|
||||
max_width = 0;
|
||||
$.each($('.th_class_module_r'), function (i, elem) {
|
||||
id = $(elem).attr('id').replace('th_module_r_', '');
|
||||
|
||||
width = $("#div_module_r_" + id).width();
|
||||
|
||||
if (max_width < width) {
|
||||
max_width = width;
|
||||
}
|
||||
});
|
||||
|
||||
$.each($('.th_class_module_r'), function (i, elem) {
|
||||
id = $(elem).attr('id').replace('th_module_r_', '');
|
||||
$("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px');
|
||||
$("#div_module_r_" + id).css('margin-top', (max_width - 20) + 'px');
|
||||
$("#div_module_r_" + id).show();
|
||||
});
|
||||
|
||||
var refr = '<?php echo get_parameter('refresh', 0); ?>';
|
||||
var pure = '<?php echo get_parameter('pure', 0); ?>';
|
||||
var href =' <?php echo ui_get_url_refresh($ignored_params); ?>';
|
||||
|
||||
if (pure) {
|
||||
var startCountDown = function (duration, cb) {
|
||||
$('div.vc-countdown').countdown('destroy');
|
||||
if (!duration) return;
|
||||
var t = new Date();
|
||||
t.setTime(t.getTime() + duration * 1000);
|
||||
$('div.vc-countdown').countdown({
|
||||
until: t,
|
||||
format: 'MS',
|
||||
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>) ',
|
||||
alwaysExpire: true,
|
||||
onExpiry: function () {
|
||||
$('div.vc-countdown').countdown('destroy');
|
||||
url = js_html_entity_decode( href ) + duration;
|
||||
$(document).attr ("location", url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(refr>0){
|
||||
startCountDown(refr, false);
|
||||
}
|
||||
|
||||
var controls = document.getElementById('vc-controls');
|
||||
autoHideElement(controls, 1000);
|
||||
|
||||
$('select#refresh').change(function (event) {
|
||||
refr = Number.parseInt(event.target.value, 10);
|
||||
startCountDown(refr, false);
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
var agentes_id = $("#id_agents2").val();
|
||||
var id_agentes = getQueryParam("full_agents_id");
|
||||
if (agentes_id === null && id_agentes !== null) {
|
||||
id_agentes = id_agentes.split(";")
|
||||
id_agentes.forEach(function(element) {
|
||||
$("#id_agents2 option[value="+ element +"]").attr("selected",true);
|
||||
});
|
||||
|
||||
selection_agent_module();
|
||||
}
|
||||
|
||||
$('#refresh').change(function () {
|
||||
$('#hidden-vc_refr').val($('#refresh option:selected').val());
|
||||
});
|
||||
}
|
||||
|
||||
$("#group_id").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : this.value,
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente"])
|
||||
.html (value["alias"]);
|
||||
$("#id_agents").append (option);
|
||||
$("#id_agents2").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#checkbox-recursion").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : $("#group_id").val(),
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente"])
|
||||
.html (value["alias"]);
|
||||
$("#id_agents").append (option);
|
||||
$("#id_agents2").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#modulegroup").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : this.value,
|
||||
"id_agents" : $("#id_agents2").val(),
|
||||
"selection" : $("#selection_agent_module").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
if(data){
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#id_agents2").click (function(){
|
||||
selection_agent_module();
|
||||
});
|
||||
|
||||
$("#selection_agent_module").change(function() {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : $("#modulegroup").val(),
|
||||
"id_agents" : $("#id_agents2").val(),
|
||||
"selection" : $("#selection_agent_module").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
if(data){
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
function selection_agent_module() {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : $("#modulegroup").val(),
|
||||
"id_agents" : $("#id_agents2").val(),
|
||||
"selection" : $("#selection_agent_module").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
if(data){
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
|
||||
var id_modules = getQueryParam("full_modules_selected");
|
||||
if(id_modules !== null) {
|
||||
id_modules = id_modules.split(";");
|
||||
id_modules.forEach(function(element) {
|
||||
$("#module option[value="+ element +"]").attr("selected",true);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
function getQueryParam (key) {
|
||||
key = key.replace(/[[]/, '[');
|
||||
key = key.replace(/[]]/, ']');
|
||||
var pattern = "[?&]" + key + "=([^&#]*)";
|
||||
var regex = new RegExp(pattern);
|
||||
var url = unescape(window.location.href);
|
||||
var results = regex.exec(url);
|
||||
if (results === null) {
|
||||
return null;
|
||||
} else {
|
||||
return results[1];
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main method.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function mainAgentsModules()
|
||||
{
|
||||
global $config;
|
||||
|
@ -36,6 +293,9 @@ function mainAgentsModules()
|
|||
exit;
|
||||
}
|
||||
|
||||
// JS.
|
||||
agents_modules_load_js();
|
||||
|
||||
// Update network modules for this group
|
||||
// Check for Network FLAG change request
|
||||
// Made it a subquery, much faster on both the database and server side.
|
||||
|
@ -617,243 +877,3 @@ function mainAgentsModules()
|
|||
|
||||
extensions_add_operation_menu_option(__('Agents/Modules view'), 'estado', 'agents_modules/icon_menu.png', 'v1r1', 'view');
|
||||
extensions_add_main_function('mainAgentsModules');
|
||||
|
||||
$ignored_params['refresh'] = '';
|
||||
|
||||
?>
|
||||
<style type='text/css'>
|
||||
.rotate_text_module {
|
||||
-ms-transform: rotate(270deg);
|
||||
-webkit-transform: rotate(270deg);
|
||||
-moz-transform: rotate(270deg);
|
||||
-o-transform: rotate(270deg);
|
||||
writing-mode: lr-tb;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function () {
|
||||
//Get max width of name of modules
|
||||
max_width = 0;
|
||||
$.each($('.th_class_module_r'), function (i, elem) {
|
||||
id = $(elem).attr('id').replace('th_module_r_', '');
|
||||
|
||||
width = $("#div_module_r_" + id).width();
|
||||
|
||||
if (max_width < width) {
|
||||
max_width = width;
|
||||
}
|
||||
});
|
||||
|
||||
$.each($('.th_class_module_r'), function (i, elem) {
|
||||
id = $(elem).attr('id').replace('th_module_r_', '');
|
||||
$("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px');
|
||||
$("#div_module_r_" + id).css('margin-top', (max_width - 20) + 'px');
|
||||
$("#div_module_r_" + id).show();
|
||||
});
|
||||
|
||||
var refr = '<?php echo get_parameter('refresh', 0); ?>';
|
||||
var pure = '<?php echo get_parameter('pure', 0); ?>';
|
||||
var href =' <?php echo ui_get_url_refresh($ignored_params); ?>';
|
||||
|
||||
if (pure) {
|
||||
var startCountDown = function (duration, cb) {
|
||||
$('div.vc-countdown').countdown('destroy');
|
||||
if (!duration) return;
|
||||
var t = new Date();
|
||||
t.setTime(t.getTime() + duration * 1000);
|
||||
$('div.vc-countdown').countdown({
|
||||
until: t,
|
||||
format: 'MS',
|
||||
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>) ',
|
||||
alwaysExpire: true,
|
||||
onExpiry: function () {
|
||||
$('div.vc-countdown').countdown('destroy');
|
||||
url = js_html_entity_decode( href ) + duration;
|
||||
$(document).attr ("location", url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(refr>0){
|
||||
startCountDown(refr, false);
|
||||
}
|
||||
|
||||
var controls = document.getElementById('vc-controls');
|
||||
autoHideElement(controls, 1000);
|
||||
|
||||
$('select#refresh').change(function (event) {
|
||||
refr = Number.parseInt(event.target.value, 10);
|
||||
startCountDown(refr, false);
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
var agentes_id = $("#id_agents2").val();
|
||||
var id_agentes = getQueryParam("full_agents_id");
|
||||
if (agentes_id === null && id_agentes !== null) {
|
||||
id_agentes = id_agentes.split(";")
|
||||
id_agentes.forEach(function(element) {
|
||||
$("#id_agents2 option[value="+ element +"]").attr("selected",true);
|
||||
});
|
||||
|
||||
selection_agent_module();
|
||||
}
|
||||
|
||||
$('#refresh').change(function () {
|
||||
$('#hidden-vc_refr').val($('#refresh option:selected').val());
|
||||
});
|
||||
}
|
||||
|
||||
$("#group_id").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : this.value,
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente"])
|
||||
.html (value["alias"]);
|
||||
$("#id_agents").append (option);
|
||||
$("#id_agents2").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#checkbox-recursion").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : $("#group_id").val(),
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente"])
|
||||
.html (value["alias"]);
|
||||
$("#id_agents").append (option);
|
||||
$("#id_agents2").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#modulegroup").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : this.value,
|
||||
"id_agents" : $("#id_agents2").val(),
|
||||
"selection" : $("#selection_agent_module").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
if(data){
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#id_agents2").click (function(){
|
||||
selection_agent_module();
|
||||
});
|
||||
|
||||
$("#selection_agent_module").change(function() {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : $("#modulegroup").val(),
|
||||
"id_agents" : $("#id_agents2").val(),
|
||||
"selection" : $("#selection_agent_module").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
if(data){
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
function selection_agent_module() {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_modules_group_json" : 1,
|
||||
"id_module_group" : $("#modulegroup").val(),
|
||||
"id_agents" : $("#id_agents2").val(),
|
||||
"selection" : $("#selection_agent_module").val()
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
if(data){
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente_modulo"])
|
||||
.html (value["nombre"]);
|
||||
$("#module").append (option);
|
||||
});
|
||||
|
||||
var id_modules = getQueryParam("full_modules_selected");
|
||||
if(id_modules !== null) {
|
||||
id_modules = id_modules.split(";");
|
||||
id_modules.forEach(function(element) {
|
||||
$("#module option[value="+ element +"]").attr("selected",true);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
function getQueryParam (key) {
|
||||
key = key.replace(/[[]/, '[');
|
||||
key = key.replace(/[]]/, ']');
|
||||
var pattern = "[?&]" + key + "=([^&#]*)";
|
||||
var regex = new RegExp(pattern);
|
||||
var url = unescape(window.location.href);
|
||||
var results = regex.exec(url);
|
||||
if (results === null) {
|
||||
return null;
|
||||
} else {
|
||||
return results[1];
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
global $config;
|
||||
|
||||
check_login();
|
||||
// ACL Check
|
||||
if (!check_acl($config['id_user'], 0, 'AR')) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access Module Groups view'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
if (is_ajax()) {
|
||||
$get_info_alert_module_group = (bool) get_parameter('get_info_alert_module_group');
|
||||
|
@ -82,6 +91,16 @@ function mainModuleGroups()
|
|||
$agent_group_search = get_parameter('agent_group_search', '');
|
||||
$module_group_search = get_parameter('module_group_search', '');
|
||||
|
||||
// Check the user's group permissions.
|
||||
$user_groups = users_get_groups($config['user'], 'AR');
|
||||
$info = array_filter(
|
||||
$info,
|
||||
function ($v, $k) use ($user_groups) {
|
||||
return $user_groups[$v['id']] != null;
|
||||
},
|
||||
ARRAY_FILTER_USE_BOTH
|
||||
);
|
||||
|
||||
$info = array_filter(
|
||||
$info,
|
||||
function ($v, $k) use ($agent_group_search) {
|
||||
|
@ -265,7 +284,7 @@ function mainModuleGroups()
|
|||
text-align: center;
|
||||
';
|
||||
|
||||
if (true) {
|
||||
if ($info && $array_module_group) {
|
||||
$table = new StdClass();
|
||||
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
|
||||
$table->width = '100%';
|
||||
|
@ -296,22 +315,22 @@ function mainModuleGroups()
|
|||
$url = 'index.php?sec=estado&sec2=operation/agentes/status_monitor&status=-1&ag_group='.$key.'&modulegroup='.$k;
|
||||
|
||||
if ($array_data[$key][$k]['alerts_module_count'] != 0) {
|
||||
$color = '#FFA631';
|
||||
$color = COL_ALERTFIRED;
|
||||
// Orange when the cell for this model group and agent has at least one alert fired.
|
||||
} else if ($array_data[$key][$k]['critical_module_count'] != 0) {
|
||||
$color = '#e63c52';
|
||||
$color = COL_CRITICAL;
|
||||
// Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
|
||||
} else if ($array_data[$key][$k]['warning_module_count'] != 0) {
|
||||
$color = '#f3b200';
|
||||
$color = COL_WARNING;
|
||||
// Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
|
||||
} else if ($array_data[$key][$k]['unknown_module_count'] != 0) {
|
||||
$color = '#B2B2B2 ';
|
||||
$color = COL_UNKNOWN;
|
||||
// Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
|
||||
} else if ($array_data[$key][$k]['normal_module_count'] != 0) {
|
||||
$color = '#82b92e';
|
||||
$color = COL_NORMAL;
|
||||
// Green when the cell for this model group and agent has OK state all modules.
|
||||
} else if ($array_data[$key][$k]['notInit_module_count'] != 0) {
|
||||
$color = '#5BB6E5';
|
||||
$color = COL_NOTINIT;
|
||||
// Blue when the cell for this module group and all modules have not init value.
|
||||
}
|
||||
|
||||
|
@ -359,7 +378,7 @@ function mainModuleGroups()
|
|||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module group and agent have all modules in OK status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_MAINTENANCE.";'></div></td><td>".__('Blue cell when the module group and agent have all modules in not init status.').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></td><td>".__('Blue cell when the module group and agent have all modules in not init status.').'</td></tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
} else {
|
||||
|
|
|
@ -312,7 +312,7 @@ function main_net_tools()
|
|||
$ips = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT ip FROM taddress WHERE id_a IN (%s)',
|
||||
join($ids)
|
||||
join(',', $ids)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -23,12 +23,12 @@ function pluginreg_extension_main()
|
|||
return;
|
||||
}
|
||||
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
ui_print_page_header(__('Plugin registration'), 'images/extensions.png', false, '', true, '');
|
||||
|
||||
echo '<div class="new_task">
|
||||
<div class="image_task">';
|
||||
echo html_print_image('images/firts_task/icono_grande_import.png', true, ['title' => __('Plugin Registration') ]);
|
||||
echo html_print_image('images/first_task/icono_grande_import.png', true, ['title' => __('Plugin Registration') ]);
|
||||
echo '</div>';
|
||||
echo '<div class="text_task">';
|
||||
echo '<h3>'.__('Plugin registration').'</h3>';
|
||||
|
|
|
@ -0,0 +1,541 @@
|
|||
<?php
|
||||
/**
|
||||
* Quick Shell extension.
|
||||
*
|
||||
* @category Extension
|
||||
* @package Pandora FMS
|
||||
* @subpackage QuickShell
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
|
||||
|
||||
|
||||
/**
|
||||
* Show Quick Shell interface.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function quickShell()
|
||||
{
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM') === false) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access Profile Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$agent_id = get_parameter('id_agente', 0);
|
||||
$username = get_parameter('username', null);
|
||||
$method = get_parameter('method', null);
|
||||
$method_port = get_parameter('port', null);
|
||||
|
||||
// Retrieve main IP Address.
|
||||
$address = agents_get_address($agent_id);
|
||||
|
||||
ui_require_css_file('wizard');
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
// Settings.
|
||||
// WebSocket host, where to connect.
|
||||
if (isset($config['ws_host']) === false) {
|
||||
config_update_value('ws_host', $_SERVER['SERVER_ADDR']);
|
||||
}
|
||||
|
||||
if (isset($config['ws_port']) === false) {
|
||||
config_update_value('ws_port', 8080);
|
||||
}
|
||||
|
||||
if (empty($config['ws_proxy_url']) === true) {
|
||||
$ws_url = 'http://'.$config['ws_host'].':'.$config['ws_port'];
|
||||
} else {
|
||||
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
|
||||
if (isset($_SERVER['HTTPS']) === true) {
|
||||
$ws_url = 'https://'.$matches[1];
|
||||
} else {
|
||||
$ws_url = 'http://'.$matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
// Gotty settings. Internal communication (WS).
|
||||
if (isset($config['gotty_host']) === false) {
|
||||
config_update_value('gotty_host', '127.0.0.1');
|
||||
}
|
||||
|
||||
if (isset($config['gotty_telnet_port']) === false) {
|
||||
config_update_value('gotty_telnet_port', 8082);
|
||||
}
|
||||
|
||||
if (isset($config['gotty_ssh_port']) === false) {
|
||||
config_update_value('gotty_ssh_port', 8081);
|
||||
}
|
||||
|
||||
// Username. Retrieve from form.
|
||||
if (empty($username) === true) {
|
||||
// No username provided, ask for it.
|
||||
$wiz = new Wizard();
|
||||
|
||||
$test = file_get_contents($ws_url);
|
||||
if ($test === false) {
|
||||
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
|
||||
$wiz->printForm(
|
||||
[
|
||||
'form' => [
|
||||
'method' => 'POST',
|
||||
'action' => '#',
|
||||
],
|
||||
'inputs' => [
|
||||
[
|
||||
'class' => 'w100p',
|
||||
'arguments' => [
|
||||
'name' => 'submit',
|
||||
'label' => __('Retry'),
|
||||
'type' => 'submit',
|
||||
'attributes' => 'class="sub next"',
|
||||
'return' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$wiz->printForm(
|
||||
[
|
||||
'form' => [
|
||||
'action' => '#',
|
||||
'class' => 'wizard',
|
||||
'method' => 'post',
|
||||
],
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Username'),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'name' => 'username',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Port'),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'id' => 'port',
|
||||
'name' => 'port',
|
||||
'value' => 22,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Method'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'name' => 'method',
|
||||
'fields' => [
|
||||
'ssh' => __('SSH'),
|
||||
'telnet' => __('Telnet'),
|
||||
],
|
||||
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'type' => 'submit',
|
||||
'label' => __('Connect'),
|
||||
'attributes' => 'class="sub next"',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize Gotty Client.
|
||||
$host = $config['gotty_host'];
|
||||
if ($method == 'ssh') {
|
||||
// SSH.
|
||||
$port = $config['gotty_ssh_port'];
|
||||
$command_arguments = "var args = '?arg=".$username.'@'.$address;
|
||||
$command_arguments .= '&arg=-p '.$method_port."';";
|
||||
} else if ($method == 'telnet') {
|
||||
// Telnet.
|
||||
$port = $config['gotty_telnet_port'];
|
||||
$command_arguments = "var args = '?arg=-l ".$username;
|
||||
$command_arguments .= '&arg='.$address;
|
||||
$command_arguments .= '&arg='.$method_port."';";
|
||||
} else {
|
||||
ui_print_error_message(__('Please use SSH or Telnet.'));
|
||||
return;
|
||||
}
|
||||
|
||||
// If rediretion is enabled, we will try to connect to http:// or https:// endpoint.
|
||||
$test = get_headers($ws_url);
|
||||
if ($test === false) {
|
||||
if (empty($wiz) === true) {
|
||||
$wiz = new Wizard();
|
||||
}
|
||||
|
||||
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
|
||||
echo $wiz->printGoBackButton('#');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check credentials.
|
||||
$auth_str = '';
|
||||
$gotty_url = $host.':'.$port;
|
||||
if (empty($config['gotty_user']) === false
|
||||
&& empty($config['gotty_pass']) === false
|
||||
) {
|
||||
$auth_str = io_safe_output($config['gotty_user']);
|
||||
$auth_str .= ':'.io_output_password($config['gotty_pass']);
|
||||
$gotty_url = $auth_str.'@'.$host.':'.$port;
|
||||
}
|
||||
|
||||
$r = file_get_contents('http://'.$gotty_url.'/js/hterm.js');
|
||||
if (empty($r) === true) {
|
||||
if (empty($wiz) === true) {
|
||||
$wiz = new Wizard();
|
||||
}
|
||||
|
||||
ui_print_error_message(__('WebService engine is not working properly, please check documentation.'));
|
||||
echo $wiz->printGoBackButton('#');
|
||||
return;
|
||||
}
|
||||
|
||||
// Override gotty client settings.
|
||||
if (empty($auth_str) === true) {
|
||||
$r .= "var gotty_auth_token = '';";
|
||||
} else {
|
||||
$r .= "var gotty_auth_token = '";
|
||||
$r .= $auth_str."';";
|
||||
}
|
||||
|
||||
// Set websocket target and method.
|
||||
$gotty = file_get_contents('http://'.$gotty_url.'/js/gotty.js');
|
||||
$url = "var url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws';";
|
||||
if (empty($config['ws_proxy_url']) === true) {
|
||||
$new = "var url = (httpsEnabled ? 'wss://' : 'ws://')";
|
||||
$new .= " + window.location.host + ':";
|
||||
$new .= $config['ws_port'].'/'.$method."';";
|
||||
} else {
|
||||
$new = "var url = '";
|
||||
$new .= $config['ws_proxy_url'].'/'.$method."';";
|
||||
}
|
||||
|
||||
// Update url.
|
||||
$gotty = str_replace($url, $new, $gotty);
|
||||
|
||||
// Update websocket arguments.
|
||||
$args = 'var args = window.location.search;';
|
||||
$new = $command_arguments;
|
||||
|
||||
// Update arguments.
|
||||
$gotty = str_replace($args, $new, $gotty);
|
||||
|
||||
?>
|
||||
<style>#terminal {
|
||||
height: 650px;
|
||||
width: 100%;
|
||||
margin: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
#terminal > iframe {
|
||||
position: relative!important;
|
||||
}
|
||||
</style>
|
||||
<div id="terminal"></div>
|
||||
<script type="text/javascript">
|
||||
<?php echo $r; ?>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
<?php echo $gotty; ?>
|
||||
</script>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Provide an interface where configure all settings.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function quickShellSettings()
|
||||
{
|
||||
global $config;
|
||||
|
||||
ui_require_css_file('wizard');
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
// Gotty settings. Internal communication (WS).
|
||||
if (isset($config['gotty_host']) === false) {
|
||||
config_update_value('gotty_host', '127.0.0.1');
|
||||
}
|
||||
|
||||
if (isset($config['gotty_telnet_port']) === false) {
|
||||
config_update_value('gotty_telnet_port', 8082);
|
||||
}
|
||||
|
||||
if (isset($config['gotty_ssh_port']) === false) {
|
||||
config_update_value('gotty_ssh_port', 8081);
|
||||
}
|
||||
|
||||
// Parser.
|
||||
if (get_parameter('qs_update', false) !== false) {
|
||||
// Gotty settings. Internal communication (WS).
|
||||
$gotty = get_parameter(
|
||||
'gotty',
|
||||
''
|
||||
);
|
||||
$gotty_host = get_parameter(
|
||||
'gotty_host',
|
||||
$config['gotty_host']
|
||||
);
|
||||
$gotty_ssh_port = get_parameter(
|
||||
'gotty_ssh_port',
|
||||
$config['gotty_ssh_port']
|
||||
);
|
||||
$gotty_telnet_port = get_parameter(
|
||||
'gotty_telnet_port',
|
||||
$config['gotty_telnet_port']
|
||||
);
|
||||
|
||||
$gotty_user = get_parameter(
|
||||
'gotty_user',
|
||||
''
|
||||
);
|
||||
|
||||
$gotty_pass = get_parameter(
|
||||
'gotty_pass',
|
||||
''
|
||||
);
|
||||
|
||||
$gotty_pass = io_input_password($gotty_pass);
|
||||
|
||||
$changes = 0;
|
||||
$critical = 0;
|
||||
if ($config['gotty'] != $gotty) {
|
||||
config_update_value('gotty', $gotty);
|
||||
$changes++;
|
||||
$critical++;
|
||||
}
|
||||
|
||||
if ($config['gotty_host'] != $gotty_host) {
|
||||
config_update_value('gotty_host', $gotty_host);
|
||||
$changes++;
|
||||
}
|
||||
|
||||
if ($config['gotty_telnet_port'] != $gotty_telnet_port) {
|
||||
config_update_value('gotty_telnet_port', $gotty_telnet_port);
|
||||
$changes++;
|
||||
}
|
||||
|
||||
if ($config['gotty_ssh_port'] != $gotty_ssh_port) {
|
||||
config_update_value('gotty_ssh_port', $gotty_ssh_port);
|
||||
$changes++;
|
||||
}
|
||||
|
||||
if ($config['gotty_user'] != $gotty_user) {
|
||||
config_update_value('gotty_user', $gotty_user);
|
||||
$changes++;
|
||||
$critical++;
|
||||
}
|
||||
|
||||
if ($config['gotty_pass'] != $gotty_pass) {
|
||||
$gotty_pass = io_input_password($gotty_pass);
|
||||
config_update_value('gotty_pass', $gotty_pass);
|
||||
$changes++;
|
||||
$critical++;
|
||||
}
|
||||
}
|
||||
|
||||
// Interface.
|
||||
ui_print_page_header(
|
||||
__('QuickShell settings'),
|
||||
'',
|
||||
false,
|
||||
'quickshell_settings'
|
||||
);
|
||||
|
||||
if ($changes > 0) {
|
||||
$msg = __('%d Updated', $changes);
|
||||
if ($critical > 0) {
|
||||
$msg = __(
|
||||
'%d Updated, please restart WebSocket engine service',
|
||||
$changes
|
||||
);
|
||||
}
|
||||
|
||||
ui_print_success_message($msg);
|
||||
}
|
||||
|
||||
// Form.
|
||||
$wiz = new Wizard();
|
||||
|
||||
$wiz->printForm(
|
||||
[
|
||||
'form' => [
|
||||
'action' => '#',
|
||||
'class' => 'wizard',
|
||||
'method' => 'post',
|
||||
],
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Gotty path').ui_print_help_tip(
|
||||
__('Leave blank if using an external Gotty service'),
|
||||
true
|
||||
),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'name' => 'gotty',
|
||||
'value' => $config['gotty'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Gotty host'),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'name' => 'gotty_host',
|
||||
'value' => $config['gotty_host'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Gotty ssh port'),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'name' => 'gotty_ssh_port',
|
||||
'value' => $config['gotty_ssh_port'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Gotty telnet port'),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'name' => 'gotty_telnet_port',
|
||||
'value' => $config['gotty_telnet_port'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'toggle' => true,
|
||||
'toggle_name' => 'Advanced',
|
||||
'block_content' => [
|
||||
[
|
||||
'label' => __('Gotty user').ui_print_help_tip(
|
||||
__('Optional, set a user to access gotty service'),
|
||||
true
|
||||
),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'name' => 'gotty_user',
|
||||
'value' => $config['gotty_user'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Gotty password').ui_print_help_tip(
|
||||
__('Optional, set a password to access gotty service'),
|
||||
true
|
||||
),
|
||||
'arguments' => [
|
||||
'type' => 'password',
|
||||
'name' => 'gotty_pass',
|
||||
'value' => io_output_password($config['gotty_pass']),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'type' => 'hidden',
|
||||
'name' => 'qs_update',
|
||||
'value' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'type' => 'submit',
|
||||
'label' => __('Update'),
|
||||
'attributes' => 'class="sub next"',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// This extension is usefull only if the agent has associated IP.
|
||||
$agent_id = get_parameter('id_agente');
|
||||
if (empty($agent_id) === false
|
||||
&& get_parameter('sec2', '') == 'operation/agentes/ver_agente'
|
||||
) {
|
||||
$address = agents_get_address($agent_id);
|
||||
if (empty($address) === false) {
|
||||
// Extension registration.
|
||||
extensions_add_opemode_tab_agent(
|
||||
// TabId.
|
||||
'quick_shell',
|
||||
// TabName.
|
||||
__('QuickShell'),
|
||||
// TabIcon.
|
||||
'images/ehorus/terminal.png',
|
||||
// TabFunction.
|
||||
'quickShell',
|
||||
// Version.
|
||||
'N/A',
|
||||
// Acl.
|
||||
'PM'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extensions_add_godmode_menu_option(
|
||||
// Name.
|
||||
__('QuickShell settings'),
|
||||
// Acl.
|
||||
'PM',
|
||||
// FatherId.
|
||||
'gextensions',
|
||||
// Icon.
|
||||
'images/ehorus/terminal.png',
|
||||
// Version.
|
||||
'N/A',
|
||||
// SubfatherId.
|
||||
null
|
||||
);
|
||||
|
||||
extensions_add_godmode_function('quickShellSettings');
|
|
@ -238,18 +238,6 @@ function output_xml_report($id)
|
|||
echo '<line_separator><![CDATA['.io_safe_output($item['line_separator']).']]></line_separator>';
|
||||
echo '<column_separator><![CDATA['.io_safe_output($item['header_definition']).']]></column_separator>';
|
||||
break;
|
||||
|
||||
case 'TTRT':
|
||||
break;
|
||||
|
||||
case 'TTO':
|
||||
break;
|
||||
|
||||
case 'MTBF':
|
||||
break;
|
||||
|
||||
case 'MTTR':
|
||||
break;
|
||||
}
|
||||
|
||||
echo "</item>\n";
|
||||
|
|
|
@ -375,18 +375,6 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
$values['line_separator'] = io_safe_input($item['line_separator']);
|
||||
$values['column_separator'] = io_safe_input($item['column_separator']);
|
||||
break;
|
||||
|
||||
case 'TTRT':
|
||||
break;
|
||||
|
||||
case 'TTO':
|
||||
break;
|
||||
|
||||
case 'MTBF':
|
||||
break;
|
||||
|
||||
case 'MTTR':
|
||||
break;
|
||||
}
|
||||
|
||||
if (empty($agents_item)) {
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
require_once __DIR__.'/../include/config.php';
|
||||
require_once __DIR__.'/../include/auth/mysql.php';
|
||||
require_once __DIR__.'/../include/functions.php';
|
||||
require_once __DIR__.'/../include/functions_db.php';
|
||||
/*
|
||||
* Review if sample agent is active and deploys configuration for
|
||||
* visual consoles if necessary
|
||||
*/
|
||||
global $config;
|
||||
|
||||
// Deployment of sample agent for visual consoles.
|
||||
if ($config['sample_agent'] == 1 && !isset($config['sample_agent_deployed'])) {
|
||||
$id_agente = db_get_sql('SELECT id_agente FROM tagente WHERE nombre = "Sample_Agent";');
|
||||
$modules = db_get_all_rows_filter('tagente_modulo', ['id_agente' => $id_agente], 'id_agente_modulo');
|
||||
$count_modules = count($modules);
|
||||
|
||||
// Update of layout 1 (Rack sample).
|
||||
$images_rack_server = [
|
||||
'rack_server_rack',
|
||||
'rack_server',
|
||||
'rack_switch',
|
||||
'rack_firewall',
|
||||
'rack_double_server',
|
||||
'rack_frame',
|
||||
'rack_pdu',
|
||||
];
|
||||
$query = 'UPDATE `tlayout_data` SET `id_agent` = '.$id_agente.', `id_agente_modulo` = CASE ';
|
||||
for ($i = 0; $i < $count_modules; $i++) {
|
||||
$query .= 'WHEN `image` = "'.$images_rack_server[$i].'" THEN '.$modules[$i]['id_agente_modulo'].' ';
|
||||
}
|
||||
|
||||
$query .= 'END WHERE `id_layout` = 1 AND `image` IN ("'.implode('","', $images_rack_server).'");';
|
||||
|
||||
db_process_sql($query);
|
||||
// Update of layout 2 (Dashboard).
|
||||
$query = 'UPDATE `tlayout_data` SET `id_agent`= '.$id_agente.', `id_agente_modulo` = CASE ';
|
||||
$query .= 'WHEN `id` = 107 THEN '.$modules[0]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 108 THEN '.$modules[1]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 109 THEN '.$modules[2]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 110 THEN '.$modules[2]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 111 THEN '.$modules[3]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 112 THEN '.$modules[4]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 113 THEN '.$modules[5]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 114 THEN '.$modules[6]['id_agente_modulo'].' ';
|
||||
$query .= 'END WHERE `id_layout` = 2 AND `id` IN (107,108,109,110,111,112,113,114);';
|
||||
|
||||
db_process_sql($query);
|
||||
|
||||
// This setting will avoid regenerate all the times the visual consoles.
|
||||
config_update_value('sample_agent_deployed', 1);
|
||||
}
|
||||
|
||||
extensions_add_main_function('sample_agent_deployment');
|
|
@ -0,0 +1,95 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `treport_template` ADD COLUMN `agent_regex` varchar(600) NOT NULL default '';
|
||||
ALTER TABLE `tlayout_template_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
|
||||
|
||||
INSERT INTO `ttipo_modulo` VALUES
|
||||
(34,'remote_cmd', 10, 'Remote execution, numeric data', 'mod_remote_cmd.png'),
|
||||
(35,'remote_cmd_proc', 10, 'Remote execution, boolean data', 'mod_remote_cmd_proc.png'),
|
||||
(36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'),
|
||||
(37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png');
|
||||
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | find /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace[0] * 100 /$obj.Size[0]','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux uptime','System uptime',43,36,0,0,300,0,'uptime |sed s/us\.*$//g | sed s/,\.*$//g','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux processes','Running processes',43,34,0,0,300,0,'ps elf | wc -l','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux system load','Current load (5 min)',43,34,0,0,300,0,'uptime | awk '{print $(NF-1)}' | tr -d ','','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available memory percent','Available memory %',43,34,0,0,300,0,'free | grep Mem | awk '{print $NF/$2 * 100}'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
|
||||
ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '';
|
||||
ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL;
|
||||
ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL;
|
||||
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT;
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT;
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT;
|
||||
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent';
|
||||
|
||||
UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != '';
|
||||
UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != '';
|
||||
UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0;
|
||||
UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != '';
|
||||
UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != '';
|
||||
UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != '';
|
||||
UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != '';
|
||||
UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99';
|
||||
UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != '';
|
||||
UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0;
|
||||
UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != '';
|
||||
UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != '';
|
||||
UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != '';
|
||||
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0;
|
||||
ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400;
|
||||
|
||||
CREATE TABLE `tremote_command` (
|
||||
`id` SERIAL,
|
||||
`name` varchar(150) NOT NULL,
|
||||
`timeout` int(10) unsigned NOT NULL default 30,
|
||||
`retries` int(10) unsigned NOT NULL default 3,
|
||||
`preconditions` text,
|
||||
`script` text,
|
||||
`postconditions` text,
|
||||
`utimestamp` int(20) unsigned NOT NULL default 0,
|
||||
`id_group` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `tremote_command_target` (
|
||||
`id` SERIAL,
|
||||
`rcmd_id` bigint unsigned NOT NULL,
|
||||
`id_agent` int(10) unsigned NOT NULL,
|
||||
`utimestamp` int(20) unsigned NOT NULL default 0,
|
||||
`stdout` MEDIUMTEXT,
|
||||
`stderr` MEDIUMTEXT,
|
||||
`errorlevel` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`)
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `tconfig`(`token`, `value`) VALUES ('welcome_state', -1);
|
||||
|
||||
|
||||
ALTER TABLE `tcredential_store` MODIFY COLUMN `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM';
|
||||
ALTER TABLE `tevent_filter` ADD COLUMN `id_source_event` int(10);
|
||||
|
||||
|
||||
ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`);
|
||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
|
||||
|
||||
COMMIT;
|
|
@ -0,0 +1,10 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
|
||||
ALTER TABLE `tevent_response` ADD COLUMN `command_timeout` int(5) unsigned NOT NULL DEFAULT 90;
|
||||
|
||||
COMMIT;
|
|
@ -1,796 +1,2 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function effectFadeOut() {
|
||||
$('.content').fadeOut(800).fadeIn(800)
|
||||
}
|
||||
$(document).ready(function(){
|
||||
setInterval(effectFadeOut, 1600);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
// Pandora FMS - the Flexible Monitoring System
|
||||
// ============================================
|
||||
// Copyright (c) 2010 Artica Soluciones Tecnologicas, http://www.artica.es
|
||||
// Please see http://pandora.sourceforge.net 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.
|
||||
global $config;
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
db_pandora_audit('ACL Violation', 'Trying to change License settings');
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$update_settings = (bool) get_parameter_post('update_settings');
|
||||
|
||||
if ($update_settings) {
|
||||
foreach ($_POST['keys'] as $key => $value) {
|
||||
db_process_sql_update(
|
||||
'tupdate_settings',
|
||||
[db_escape_key_identifier('value') => $value],
|
||||
[db_escape_key_identifier('key') => $key]
|
||||
);
|
||||
}
|
||||
|
||||
ui_print_success_message(__('License updated'));
|
||||
}
|
||||
|
||||
ui_require_javascript_file_enterprise('load_enterprise');
|
||||
enterprise_include_once('include/functions_license.php');
|
||||
$license = enterprise_hook('license_get_info');
|
||||
|
||||
$rows = db_get_all_rows_in_table('tupdate_settings');
|
||||
|
||||
$settings = new StdClass;
|
||||
foreach ($rows as $row) {
|
||||
$settings->{$row['key']} = $row['value'];
|
||||
}
|
||||
|
||||
echo '<script type="text/javascript">';
|
||||
if (enterprise_installed()) {
|
||||
print_js_var_enteprise();
|
||||
}
|
||||
|
||||
echo '</script>';
|
||||
|
||||
|
||||
function render_info($table)
|
||||
{
|
||||
global $console_mode;
|
||||
|
||||
$info = db_get_sql("SELECT COUNT(*) FROM $table");
|
||||
render_row($info, "DB Table $table");
|
||||
}
|
||||
|
||||
|
||||
function render_info_data($query, $label)
|
||||
{
|
||||
global $console_mode;
|
||||
|
||||
$info = db_get_sql($query);
|
||||
render_row($info, $label);
|
||||
}
|
||||
|
||||
|
||||
function render_row($data, $label)
|
||||
{
|
||||
global $console_mode;
|
||||
|
||||
if ($console_mode == 1) {
|
||||
echo $label;
|
||||
echo '|';
|
||||
echo $data;
|
||||
echo "\n";
|
||||
} else {
|
||||
echo '<tr>';
|
||||
echo "<td style='padding:2px;border:0px;' width='60%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$label;
|
||||
echo '</div></td>';
|
||||
echo "<td style='font-weight:bold;padding:2px;border:0px;' width='40%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$data;
|
||||
echo '</div></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_value_sum($arr)
|
||||
{
|
||||
foreach ($arr as $clave) {
|
||||
foreach ($clave as $valor) {
|
||||
if (is_numeric($valor) === true) {
|
||||
$result += $valor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
function execution_time()
|
||||
{
|
||||
$times = db_get_all_rows_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = 29 ORDER BY utimestamp DESC LIMIT 2');
|
||||
if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) {
|
||||
return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>   The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>";
|
||||
} else {
|
||||
return "<a style ='color: green;'>Normal Status</a><a>   The execution time is correct. For more information about this data, check the Execution Time graph</a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_logs_size($file)
|
||||
{
|
||||
$file_name = '/var'.$file.'';
|
||||
$size_server_log = filesize($file_name);
|
||||
return $size_server_log;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function get_status_logs($path)
|
||||
{
|
||||
$status_server_log = '';
|
||||
$size_server_log = number_format(get_logs_size($path));
|
||||
$size_server_log = (0 + str_replace(',', '', $size_server_log));
|
||||
if ($size_server_log <= 10485760) {
|
||||
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   You have less than 10 MB of logs</a>";
|
||||
} else {
|
||||
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   You have more than 10 MB of logs</a>";
|
||||
}
|
||||
|
||||
return $status_server_log;
|
||||
}
|
||||
|
||||
|
||||
function percentage_modules_per_agent()
|
||||
{
|
||||
$status_average_modules = '';
|
||||
$total_agents = db_get_value_sql('SELECT count(*) FROM tagente');
|
||||
$total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo');
|
||||
$average_modules_per_agent = ($total_modules / $total_agents);
|
||||
if ($average_modules_per_agent <= 40) {
|
||||
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The average of modules per agent is less than 40</a>";
|
||||
} else {
|
||||
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>  The average of modules per agent is more than 40. You can have performance problems</a>";
|
||||
}
|
||||
|
||||
return $status_average_modules;
|
||||
}
|
||||
|
||||
|
||||
function license_capacity()
|
||||
{
|
||||
$license = enterprise_hook('license_get_info');
|
||||
$license_limit = $license['limit'];
|
||||
$status_license_capacity = '';
|
||||
$current_count = db_get_value_sql('SELECT count(*) FROM tagente');
|
||||
if ($current_count > ($license_limit * 90 / 100)) {
|
||||
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   License capacity exceeds 90 percent</a>";
|
||||
} else {
|
||||
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   License capacity is less than 90 percent</a>";
|
||||
}
|
||||
|
||||
return $status_license_capacity;
|
||||
}
|
||||
|
||||
|
||||
function status_license_params($license_param)
|
||||
{
|
||||
$status_license_par = '';
|
||||
if ($license_param <= 0) {
|
||||
$status_license_par = 'OFF';
|
||||
} else {
|
||||
$status_license_par = 'ON';
|
||||
}
|
||||
|
||||
return $status_license_par;
|
||||
}
|
||||
|
||||
|
||||
function interval_average_of_network_modules()
|
||||
{
|
||||
$total_network_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18');
|
||||
$total_module_interval_time = db_get_value_sql('SELECT SUM(module_interval) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18');
|
||||
$average_time = ((int) $total_module_interval_time / $total_network_modules);
|
||||
|
||||
if ($average_time < 180) {
|
||||
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The system is overloaded (average time $average_time) and a very fine configuration is required</a>";
|
||||
} else {
|
||||
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The system is not overloaded (average time $average_time) </a>";
|
||||
}
|
||||
|
||||
if ($average_time == 0) {
|
||||
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The system has no load</a>";
|
||||
}
|
||||
|
||||
return $status_average_modules;
|
||||
}
|
||||
|
||||
|
||||
$attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLOB_BRACE));
|
||||
|
||||
|
||||
function files_attachment_folder($total_files)
|
||||
{
|
||||
if ($total_files <= 700) {
|
||||
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The attached folder contains less than 700 files.</a>";
|
||||
} else {
|
||||
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   The attached folder contains more than 700 files.</a>";
|
||||
}
|
||||
|
||||
return $status_total_files;
|
||||
}
|
||||
|
||||
|
||||
$tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
|
||||
|
||||
|
||||
function status_tagente_datos($tagente_datos_size)
|
||||
{
|
||||
if ($tagente_datos_size <= 3000000) {
|
||||
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   The tagente_datos table contains an acceptable amount of data.</a>";
|
||||
} else {
|
||||
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>   The tagente_datos table contains too much data. A historical database is recommended.</a>";
|
||||
}
|
||||
|
||||
return $tagente_datos_size;
|
||||
}
|
||||
|
||||
|
||||
function status_values($val_rec, $val)
|
||||
{
|
||||
if ($val_rec <= $val) {
|
||||
return $val."<a style='text-decoration: none;'> (Min. Recommended Value </a>".$val_rec.'<a>)</a>';
|
||||
} else {
|
||||
return $val."<a style='text-decoration: none;'> (Min. Recommended Value </a>".$val_rec."<a>)</a><a class= 'content' style ='color: red;text-decoration: none;'> Warning Status</a>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$tables_fragmentation = db_get_sql(
|
||||
"SELECT (data_free/(index_length+data_length))
|
||||
as frag_ratio from information_schema.tables where DATA_FREE > 0 and table_name='tagente_datos' and table_schema='pandora'"
|
||||
);
|
||||
$db_size = db_get_all_rows_sql(
|
||||
'SELECT table_schema,
|
||||
ROUND(SUM(data_length+index_length)/1024/1024,3)
|
||||
FROM information_schema.TABLES
|
||||
GROUP BY table_schema;'
|
||||
);
|
||||
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
$total_server_threads = shell_exec('ps -T aux | grep pandora_server | grep -v grep | wc -l');
|
||||
$percentage_threads_ram = shell_exec("ps axo pmem,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
|
||||
$percentage_threads_cpu = shell_exec("ps axo pcpu,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
|
||||
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
|
||||
}
|
||||
|
||||
$path_server_logs = '/log/pandora/pandora_server.log';
|
||||
$path_err_logs = '/log/pandora/pandora_server.error';
|
||||
$path_console_logs = '/www/html/pandora_console/pandora_console.log';
|
||||
$innodb_log_file_size_min_rec_value = '64M';
|
||||
$innodb_log_buffer_size_min_rec_value = '16M';
|
||||
$innodb_flush_log_at_trx_commit_min_rec_value = 0;
|
||||
$query_cache_limit_min_rec_value = 2;
|
||||
$max_allowed_packet_min_rec_value = 32;
|
||||
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
|
||||
$sort_buffer_size_min_rec_value = 32;
|
||||
$join_buffer_size_min_rec_value = 265;
|
||||
$query_cache_type_min_rec_value = 'ON';
|
||||
$query_cache_size_min_rec_value = 24;
|
||||
$innodb_lock_wait_timeout_max_rec_value = 120;
|
||||
$tables_fragmentation_max_rec_value = 10;
|
||||
$thread_cache_size_max_rec_value = 8;
|
||||
$thread_stack_min_rec_value = 256;
|
||||
$max_connections_max_rec_value = 150;
|
||||
$key_buffer_size_min_rec_value = 256;
|
||||
$read_buffer_size_min_rec_value = 32;
|
||||
$read_rnd_buffer_size_min_rec_value = 32;
|
||||
$query_cache_min_res_unit_min_rec_value = 2;
|
||||
$innodb_file_per_table_min_rec_value = 1;
|
||||
|
||||
|
||||
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation)
|
||||
{
|
||||
$status_tables_frag = '';
|
||||
if ($tables_fragmentation > $tables_fragmentation_max_rec_value) {
|
||||
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>   Table fragmentation is higher than recommended. They should be defragmented.</a>";
|
||||
} else {
|
||||
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>   Table fragmentation is correct.</a>";
|
||||
}
|
||||
|
||||
return $status_tables_frag;
|
||||
}
|
||||
|
||||
|
||||
$console_mode = 1;
|
||||
if (!isset($argc)) {
|
||||
$console_mode = 0;
|
||||
}
|
||||
|
||||
if ($console_mode == 1) {
|
||||
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
|
||||
|
||||
if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) {
|
||||
echo "\nThis command line script contains information about Pandora FMS database.
|
||||
This program can only be executed from the console, and it needs a parameter, the
|
||||
full path to Pandora FMS 'config.php' file.
|
||||
|
||||
Usage:
|
||||
php pandora_diag.php path_to_pandora_console
|
||||
|
||||
Example:
|
||||
php pandora_diag.php /var/www/pandora_console
|
||||
|
||||
";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (preg_match('/[^a-zA-Z0-9_\/\.]|(\/\/)|(\.\.)/', $argv[1])) {
|
||||
echo "Invalid path: $argv[1]. Always use absolute paths.";
|
||||
exit;
|
||||
}
|
||||
|
||||
include $argv[1].'/include/config.php';
|
||||
} else {
|
||||
if (file_exists('../include/config.php')) {
|
||||
include '../include/config.php';
|
||||
}
|
||||
|
||||
// Not from console, this is a web session.
|
||||
if ((!isset($config['id_user'])) || (!check_acl($config['id_user'], 0, 'PM'))) {
|
||||
echo "<h2>You don't have privileges to use diagnostic tool</h2>";
|
||||
echo '<p>Please login with an administrator account before try to use this tool</p>';
|
||||
exit;
|
||||
}
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Pandora FMS Diagnostic tool'),
|
||||
'',
|
||||
false,
|
||||
'diagnostic_tool_tab',
|
||||
true
|
||||
);
|
||||
|
||||
echo "<table id='diagnostic_info' width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
|
||||
}
|
||||
|
||||
render_row($build_version, 'Pandora FMS Build');
|
||||
render_row($pandora_version, 'Pandora FMS Version');
|
||||
render_info_data("SELECT value FROM tconfig where token ='MR'", 'Minor Release');
|
||||
render_row($config['homedir'], 'Homedir');
|
||||
render_row($config['homeurl'], 'HomeUrl');
|
||||
render_info_data(
|
||||
"SELECT `value`
|
||||
FROM tconfig
|
||||
WHERE `token` = 'enterprise_installed'",
|
||||
'Enterprise installed'
|
||||
);
|
||||
|
||||
$full_key = db_get_sql(
|
||||
"SELECT value
|
||||
FROM tupdate_settings
|
||||
WHERE `key` = 'customer_key'"
|
||||
);
|
||||
|
||||
$compressed_key = substr($full_key, 0, 5).'...'.substr($full_key, -5);
|
||||
|
||||
render_row($compressed_key, 'Update Key');
|
||||
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tupdate_settings
|
||||
WHERE `key` = 'updating_code_path'",
|
||||
'Updating code path'
|
||||
);
|
||||
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tupdate_settings
|
||||
WHERE `key` = 'current_update'",
|
||||
'Current Update #'
|
||||
);
|
||||
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('PHP setup').'</th></tr>';
|
||||
|
||||
|
||||
render_row(phpversion(), 'PHP Version');
|
||||
|
||||
render_row(ini_get('max_execution_time').' seconds', 'PHP Max execution time');
|
||||
|
||||
render_row(ini_get('max_input_time').' seconds', 'PHP Max input time');
|
||||
|
||||
render_row(ini_get('memory_limit'), 'PHP Memory limit');
|
||||
|
||||
render_row(ini_get('session.cookie_lifetime'), 'Session cookie lifetime');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database size stats').'</th></tr>';
|
||||
|
||||
render_info_data('SELECT COUNT(*) FROM tagente', 'Total agents');
|
||||
render_info_data('SELECT COUNT(*) FROM tagente_modulo', 'Total modules');
|
||||
render_info_data('SELECT COUNT(*) FROM tgrupo', 'Total groups');
|
||||
render_info_data('SELECT COUNT(*) FROM tagente_datos', 'Total module data records');
|
||||
render_info_data('SELECT COUNT(*) FROM tagent_access', 'Total agent access record');
|
||||
render_info_data('SELECT COUNT(*) FROM tevento', 'Total events');
|
||||
|
||||
if ($config['enterprise_installed']) {
|
||||
render_info_data('SELECT COUNT(*) FROM ttrap', 'Total traps');
|
||||
}
|
||||
|
||||
render_info_data('SELECT COUNT(*) FROM tusuario', 'Total users');
|
||||
render_info_data('SELECT COUNT(*) FROM tsesion', 'Total sessions');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database sanity').'</th></tr>';
|
||||
|
||||
render_info_data(
|
||||
'SELECT COUNT( DISTINCT tagente.id_agente)
|
||||
FROM tagente_estado, tagente, tagente_modulo
|
||||
WHERE tagente.disabled = 0
|
||||
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_estado.id_agente = tagente.id_agente
|
||||
AND tagente_estado.estado = 3',
|
||||
'Total unknown agents'
|
||||
);
|
||||
|
||||
render_info_data(
|
||||
'SELECT COUNT(tagente_estado.estado)
|
||||
FROM tagente_estado
|
||||
WHERE tagente_estado.estado = 4',
|
||||
'Total not-init modules'
|
||||
);
|
||||
|
||||
|
||||
$last_run_difference = '';
|
||||
|
||||
$diferencia = (time() - date(
|
||||
db_get_sql(
|
||||
"SELECT `value`
|
||||
FROM tconfig
|
||||
WHERE `token` = 'db_maintance'"
|
||||
)
|
||||
));
|
||||
|
||||
$last_run_difference_months = 0;
|
||||
$last_run_difference_weeks = 0;
|
||||
$last_run_difference_days = 0;
|
||||
$last_run_difference_minutos = 0;
|
||||
$last_run_difference_seconds = 0;
|
||||
|
||||
while ($diferencia >= 2419200) {
|
||||
$diferencia -= 2419200;
|
||||
$last_run_difference_months++;
|
||||
}
|
||||
|
||||
while ($diferencia >= 604800) {
|
||||
$diferencia -= 604800;
|
||||
$last_run_difference_weeks++;
|
||||
}
|
||||
|
||||
while ($diferencia >= 86400) {
|
||||
$diferencia -= 86400;
|
||||
$last_run_difference_days++;
|
||||
}
|
||||
|
||||
while ($diferencia >= 3600) {
|
||||
$diferencia -= 3600;
|
||||
$last_run_difference_hours++;
|
||||
}
|
||||
|
||||
while ($diferencia >= 60) {
|
||||
$diferencia -= 60;
|
||||
$last_run_difference_minutes++;
|
||||
}
|
||||
|
||||
$last_run_difference_seconds = $diferencia;
|
||||
|
||||
if ($last_run_difference_months > 0) {
|
||||
$last_run_difference .= $last_run_difference_months.'month/s ';
|
||||
}
|
||||
|
||||
if ($last_run_difference_weeks > 0) {
|
||||
$last_run_difference .= $last_run_difference_weeks.' week/s ';
|
||||
}
|
||||
|
||||
if ($last_run_difference_days > 0) {
|
||||
$last_run_difference .= $last_run_difference_days.' day/s ';
|
||||
}
|
||||
|
||||
if ($last_run_difference_hours > 0) {
|
||||
$last_run_difference .= $last_run_difference_hours.' hour/s ';
|
||||
}
|
||||
|
||||
if ($last_run_difference_minutes > 0) {
|
||||
$last_run_difference .= $last_run_difference_minutes.' minute/s ';
|
||||
}
|
||||
|
||||
$last_run_difference .= $last_run_difference_seconds.' second/s ago';
|
||||
|
||||
render_row(
|
||||
date(
|
||||
'Y/m/d H:i:s',
|
||||
db_get_sql(
|
||||
"SELECT `value`
|
||||
FROM tconfig
|
||||
WHERE `token` = 'db_maintance'"
|
||||
)
|
||||
).' ('.$last_run_difference.')'.' *',
|
||||
'PandoraDB Last run'
|
||||
);
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database status info').'</th></tr>';
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
render_info_data(
|
||||
"SELECT `value`
|
||||
FROM tconfig
|
||||
WHERE `token` = 'db_scheme_first_version'",
|
||||
'DB Schema Version (first installed)'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT `value`
|
||||
FROM tconfig
|
||||
WHERE `token` = 'db_scheme_version'",
|
||||
'DB Schema Version (actual)'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT `value`
|
||||
FROM tconfig
|
||||
WHERE `token` = 'db_scheme_build'",
|
||||
'DB Schema Build'
|
||||
);
|
||||
|
||||
render_row(get_value_sum($db_size).'M', 'DB Size');
|
||||
|
||||
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('System info').'</th></tr>';
|
||||
|
||||
$output = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
|
||||
$output2 = 'cat /proc/cpuinfo | grep "processor" | wc -l';
|
||||
|
||||
render_row(exec($output).' x '.exec($output2), 'CPU');
|
||||
|
||||
$output = 'cat /proc/meminfo | grep "MemTotal"';
|
||||
|
||||
render_row(exec($output), 'RAM');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
render_info_data(
|
||||
"SELECT \"value\"
|
||||
FROM tconfig
|
||||
WHERE \"token\" = 'db_scheme_version'",
|
||||
'DB Schema Version'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT \"value\"
|
||||
FROM tconfig
|
||||
WHERE \"token\" = 'db_scheme_build'",
|
||||
'DB Schema Build'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT \"value\"
|
||||
FROM tconfig
|
||||
WHERE \"token\" = 'enterprise_installed'",
|
||||
'Enterprise installed'
|
||||
);
|
||||
render_row(
|
||||
date(
|
||||
'Y/m/d H:i:s',
|
||||
db_get_sql(
|
||||
"SELECT \"value\"
|
||||
FROM tconfig WHERE \"token\" = 'db_maintance'"
|
||||
)
|
||||
),
|
||||
'PandoraDB Last run'
|
||||
);
|
||||
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tupdate_settings
|
||||
WHERE \"key\" = 'customer_key';",
|
||||
'Update Key'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tupdate_settings
|
||||
WHERE \"key\" = 'updating_code_path'",
|
||||
'Updating code path'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tupdate_settings
|
||||
WHERE \"key\" = 'current_update'",
|
||||
'Current Update #'
|
||||
);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tconfig
|
||||
WHERE token = 'db_scheme_version'",
|
||||
'DB Schema Version'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tconfig
|
||||
WHERE token = 'db_scheme_build'",
|
||||
'DB Schema Build'
|
||||
);
|
||||
render_info_data(
|
||||
"SELECT value
|
||||
FROM tconfig
|
||||
WHERE token = 'enterprise_installed'",
|
||||
'Enterprise installed'
|
||||
);
|
||||
render_row(
|
||||
db_get_sql(
|
||||
"SELECT value
|
||||
FROM tconfig
|
||||
WHERE token = 'db_maintance'"
|
||||
),
|
||||
'PandoraDB Last run'
|
||||
);
|
||||
|
||||
render_info_data(
|
||||
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
|
||||
WHERE \"key\" = 'customer_key'",
|
||||
'Update Key'
|
||||
);
|
||||
render_info_data(
|
||||
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
|
||||
WHERE \"key\" = 'updating_code_path'",
|
||||
'Updating code path'
|
||||
);
|
||||
render_info_data(
|
||||
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
|
||||
WHERE \"key\" = 'current_update'",
|
||||
'Current Update #'
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
$innodb_log_file_size = (db_get_value_sql('SELECT @@innodb_log_file_size') / 1048576);
|
||||
$innodb_log_buffer_size = (db_get_value_sql('SELECT @@innodb_log_buffer_size') / 1048576);
|
||||
$innodb_flush_log_at_trx_commit = db_get_value_sql('SELECT @@innodb_flush_log_at_trx_commit');
|
||||
$max_allowed_packet = (db_get_value_sql('SELECT @@max_allowed_packet') / 1048576);
|
||||
$innodb_buffer_pool_size = (db_get_value_sql('SELECT @@innodb_buffer_pool_size') / 1024);
|
||||
$sort_buffer_size = number_format((db_get_value_sql('SELECT @@sort_buffer_size') / 1024), 2);
|
||||
$join_buffer_size = (db_get_value_sql('SELECT @@join_buffer_size') / 1024);
|
||||
$query_cache_type = db_get_value_sql('SELECT @@query_cache_type');
|
||||
$query_cache_size = (db_get_value_sql('SELECT @@query_cache_size') / 1048576);
|
||||
$query_cache_limit = (db_get_value_sql('SELECT @@query_cache_limit') / 1048576);
|
||||
$innodb_lock_wait_timeout = db_get_value_sql('SELECT @@innodb_lock_wait_timeout');
|
||||
$thread_cache_size = db_get_value_sql('SELECT @@thread_cache_size');
|
||||
$thread_stack = (db_get_value_sql('SELECT @@thread_stack') / 1024);
|
||||
$max_connections = db_get_value_sql('SELECT @@max_connections');
|
||||
$key_buffer_size = (db_get_value_sql('SELECT @@key_buffer_size') / 1024);
|
||||
$read_buffer_size = (db_get_value_sql('SELECT @@read_buffer_size') / 1024);
|
||||
$read_rnd_buffer_size = (db_get_value_sql('SELECT @@read_rnd_buffer_size') / 1024);
|
||||
$query_cache_min_res_unit = (db_get_value_sql('SELECT @@query_cache_min_res_unit') / 1024);
|
||||
$innodb_file_per_table = db_get_value_sql('SELECT @@innodb_file_per_table');
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('MySQL Performance metrics').' '.ui_print_help_icon('performance_metrics_tab', true).'</th></tr>';
|
||||
|
||||
render_row(status_values($innodb_log_file_size_min_rec_value, $innodb_log_file_size), 'InnoDB log file size ', 'InnoDB log file size ');
|
||||
render_row(status_values($innodb_log_buffer_size_min_rec_value, $innodb_log_buffer_size), 'InnoDB log buffer size ', 'InnoDB log buffer size ');
|
||||
render_row(status_values($innodb_flush_log_at_trx_commit_min_rec_value, $innodb_flush_log_at_trx_commit), 'InnoDB flush log at trx-commit ', 'InnoDB flush log at trx-commit ');
|
||||
render_row(status_values($max_allowed_packet_min_rec_value, $max_allowed_packet), 'Maximun allowed packet ', 'Maximun allowed packet ');
|
||||
render_row(status_values($innodb_buffer_pool_size_min_rec_value, $innodb_buffer_pool_size), 'InnoDB buffer pool size ', 'InnoDB buffer pool size ');
|
||||
render_row(status_values($sort_buffer_size_min_rec_value, $sort_buffer_size), 'Sort buffer size ', 'Sort buffer size ');
|
||||
render_row(status_values($join_buffer_size_min_rec_value, $join_buffer_size), 'Join buffer size ', 'Join buffer size ');
|
||||
render_row(status_values($query_cache_type_min_rec_value, $query_cache_type), 'Query cache type ', 'Query cache type ');
|
||||
render_row(status_values($query_cache_size_min_rec_value, $query_cache_size), 'Query cache size ', 'Query cache size ');
|
||||
render_row(status_values($query_cache_limit_min_rec_value, $query_cache_limit), 'Query cache limit ', 'Query cache limit ');
|
||||
render_row(status_values($innodb_lock_wait_timeout_max_rec_value, $innodb_lock_wait_timeout), 'InnoDB lock wait timeout ', 'InnoDB lock wait timeout ');
|
||||
render_row(status_values($thread_cache_size_max_rec_value, $thread_cache_size), 'Thread cache size ', 'Thread cache size ');
|
||||
render_row(status_values($thread_stack_min_rec_value, $thread_stack), 'Thread stack ', 'Thread stack ');
|
||||
render_row(status_values($max_connections_max_rec_value, $max_connections), 'Maximum connections ', 'Maximun connections ');
|
||||
render_row(status_values($key_buffer_size_min_rec_value, $key_buffer_size), 'Key buffer size ', 'Key buffer size ');
|
||||
render_row(status_values($read_buffer_size_min_rec_value, $read_buffer_size), 'Read buffer size ', 'Read buffer size ');
|
||||
render_row(status_values($read_rnd_buffer_size_min_rec_value, $read_rnd_buffer_size), 'Read rnd-buffer size ', 'Read rnd-buffer size ');
|
||||
render_row(status_values($query_cache_min_res_unit_min_rec_value, $query_cache_min_res_unit), 'Query cache min-res-unit ', 'Query cache min-res-unit ');
|
||||
render_row(status_values($innodb_file_per_table_min_rec_value, $innodb_file_per_table), 'InnoDB file per table ', 'InnoDB file per table ');
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Tables fragmentation in the Pandora FMS database').'</th></tr>';
|
||||
|
||||
|
||||
|
||||
render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)');
|
||||
render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)');
|
||||
render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Table fragmentation status');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS logs dates').'</th></tr>';
|
||||
|
||||
render_row(number_format((get_logs_size($path_server_logs) / 1048576), 3).'M', 'Size server logs (current value)');
|
||||
render_row(get_status_logs($path_server_logs), 'Status server logs');
|
||||
render_row(number_format((get_logs_size($path_err_logs) / 1048576), 3).'M', 'Size error logs (current value)');
|
||||
render_row(get_status_logs($path_err_logs), 'Status error logs');
|
||||
render_row(number_format((get_logs_size($path_console_logs) / 1048576), 3).'M', 'Size console logs (current value)');
|
||||
render_row(get_status_logs($path_console_logs), 'Status console logs');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS Licence Information').'</th></tr>';
|
||||
|
||||
render_row(html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:40px; width:450px;"', true), 'Customer key');
|
||||
render_row($license['expiry_date'], $license['expiry_caption']);
|
||||
render_row($license['limit'].' agents', 'Platform Limit');
|
||||
render_row($license['count'].' agents', 'Current Platform Count');
|
||||
render_row($license['count_enabled'].' agents', 'Current Platform Count (enabled: items)');
|
||||
render_row($license['count_disabled'].' agents', 'Current Platform Count (disabled: items)');
|
||||
render_row($license['license_mode'], 'License Mode');
|
||||
render_row(status_license_params($license['nms']), 'Network Management System');
|
||||
render_row(status_license_params($license['dhpm']), 'Satellite');
|
||||
render_row($license['licensed_to'], 'Licensed to');
|
||||
render_row(license_capacity(), 'Status of agents capacity');
|
||||
render_row(percentage_modules_per_agent(), 'Status of average modules per agent');
|
||||
render_row(interval_average_of_network_modules(), 'Interval average of the network modules');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Status of the attachment folder').'</th></tr>';
|
||||
|
||||
render_row($attachment_total_files, 'Total files in the attached folder');
|
||||
render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Information from the tagente_datos table').'</th></tr>';
|
||||
|
||||
render_row($tagente_datos_size, 'Total data in tagente_datos table');
|
||||
render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status');
|
||||
render_row(execution_time(), 'Execution time degradation when executing a count');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS server threads').'</th></tr>';
|
||||
|
||||
render_row($total_server_threads, 'Total server threads');
|
||||
render_row($percentage_threads_ram.'%', 'Percentage of threads used by the RAM');
|
||||
render_row($percentage_threads_cpu.'%', 'Percentage of threads used by the CPU');
|
||||
|
||||
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Graphs modules that represent the self-monitoring system').'</th></tr>';
|
||||
|
||||
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE master = 1');
|
||||
$agent_id = db_get_value_sql("SELECT id_agente FROM tagente WHERE nombre = '$server_name'");
|
||||
|
||||
$id_modules = agents_get_modules($agent_id);
|
||||
|
||||
$id_modules = [
|
||||
modules_get_agentmodule_id('Agents_Unknown', $agent_id),
|
||||
modules_get_agentmodule_id('Database Maintenance', $agent_id),
|
||||
modules_get_agentmodule_id('FreeDisk_SpoolDir', $agent_id),
|
||||
modules_get_agentmodule_id('Free_RAM', $agent_id),
|
||||
modules_get_agentmodule_id('Queued_Modules', $agent_id),
|
||||
modules_get_agentmodule_id('Status', $agent_id),
|
||||
modules_get_agentmodule_id('System_Load_AVG', $agent_id),
|
||||
modules_get_agentmodule_id('Execution_time', $agent_id),
|
||||
];
|
||||
|
||||
foreach ($id_modules as $id_module) {
|
||||
$params = [
|
||||
'agent_module_id' => $id_module['id_agente_modulo'],
|
||||
'period' => SECONDS_1MONTH,
|
||||
'date' => time(),
|
||||
'height' => '150',
|
||||
];
|
||||
render_row(grafico_modulo_sparse($params), 'Graph of the '.$id_module['nombre'].' module.');
|
||||
}
|
||||
|
||||
if ($console_mode == 0) {
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
|
||||
|
||||
echo '<span>'.__(
|
||||
'(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to
|
||||
keep the database up-to-date to get the best performance and results in Pandora'
|
||||
).'</span><br><br><br>';
|
||||
// remove file.
|
||||
|
|
|
@ -60,6 +60,10 @@ ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_next` bigint(20) NOT NULL def
|
|||
ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
|
||||
|
||||
ALTER TABLE `tlocal_component` MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0',
|
||||
MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tpolicy_modules`
|
||||
-- -----------------------------------------------------
|
||||
|
@ -138,6 +142,10 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` (
|
|||
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
|
||||
ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE `tpolicy_modules` MODIFY COLUMN `ip_target` varchar(100) NULL DEFAULT '',
|
||||
MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0',
|
||||
MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tpolicies`
|
||||
|
@ -187,6 +195,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_agents` (
|
|||
|
||||
ALTER TABLE `tpolicy_agents` ADD COLUMN `id_node` int(10) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tpolicy_agents` ADD UNIQUE(`id_policy`, `id_agent`, `id_node`);
|
||||
ALTER TABLE `tpolicy_agents` DROP INDEX `id_policy`, ADD UNIQUE INDEX `id_policy` (`id_policy`, `id_agent`, `id_node`), DROP INDEX `id_policy_2`;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tpolicy_groups`
|
||||
|
@ -377,6 +386,12 @@ ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbhost` text;
|
|||
ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbport` text;
|
||||
ALTER TABLE tmetaconsole_setup ADD COLUMN `meta_dbname` text;
|
||||
|
||||
ALTER TABLE `tmetaconsole_setup` MODIFY COLUMN `meta_dbuser` text NULL,
|
||||
MODIFY COLUMN `meta_dbpass` text NULL,
|
||||
MODIFY COLUMN `meta_dbhost` text NULL,
|
||||
MODIFY COLUMN `meta_dbport` text NULL,
|
||||
MODIFY COLUMN `meta_dbname` text NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tprofile_view`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -564,6 +579,39 @@ CREATE TABLE IF NOT EXISTS `tevent_rule` (
|
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `group_recursion` INT(1) unsigned default 0;
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `log_content` TEXT;
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `log_source` TEXT;
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `log_agent` TEXT;
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_agent` text COMMENT 'Operator for agent';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_usuario` text COMMENT 'Operator for id_usuario';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_grupo` text COMMENT 'Operator for id_grupo';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_evento` text COMMENT 'Operator for evento';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_event_type` text COMMENT 'Operator for event_type';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_module` text COMMENT 'Operator for module';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_alert` text COMMENT 'Operator for alert';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_criticity` text COMMENT 'Operator for criticity';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_user_comment` text COMMENT 'Operator for user_comment';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_id_tag` text COMMENT 'Operator for id_tag';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_content` text COMMENT 'Operator for log_content';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_source` text COMMENT 'Operator for log_source';
|
||||
ALTER TABLE `tevent_rule` ADD COLUMN `operator_log_agent` text COMMENT 'Operator for log_agent';
|
||||
ALTER TABLE `tevent_rule` MODIFY COLUMN `event_type` enum('','unknown','alert_fired','alert_recovered','alert_ceased','alert_manual_validation','recon_host_detected','system','error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_down_normal','going_down_critical','going_up_normal') default '';
|
||||
ALTER TABLE `tevent_rule` MODIFY COLUMN `criticity` int(4) unsigned DEFAULT NULL;
|
||||
ALTER TABLE `tevent_rule` MODIFY COLUMN `id_grupo` mediumint(4) DEFAULT NULL;
|
||||
|
||||
UPDATE `tevent_rule` SET `operator_agent` = "REGEX" WHERE `agent` != '';
|
||||
UPDATE `tevent_rule` SET `operator_id_usuario` = "REGEX" WHERE `id_usuario` != '';
|
||||
UPDATE `tevent_rule` SET `operator_id_grupo` = "REGEX" WHERE `id_grupo` > 0;
|
||||
UPDATE `tevent_rule` SET `operator_evento` = "REGEX" WHERE `evento` != '';
|
||||
UPDATE `tevent_rule` SET `operator_event_type` = "REGEX" WHERE `event_type` != '';
|
||||
UPDATE `tevent_rule` SET `operator_module` = "REGEX" WHERE `module` != '';
|
||||
UPDATE `tevent_rule` SET `operator_alert` = "REGEX" WHERE `alert` != '';
|
||||
UPDATE `tevent_rule` SET `operator_criticity` = "REGEX" WHERE `criticity` != '99';
|
||||
UPDATE `tevent_rule` SET `operator_user_comment` = "REGEX" WHERE `user_comment` != '';
|
||||
UPDATE `tevent_rule` SET `operator_id_tag` = "REGEX" WHERE `id_tag` > 0;
|
||||
UPDATE `tevent_rule` SET `operator_log_content` = "REGEX" WHERE `log_content` != '';
|
||||
UPDATE `tevent_rule` SET `operator_log_source` = "REGEX" WHERE `log_source` != '';
|
||||
UPDATE `tevent_rule` SET `operator_log_agent` = "REGEX" WHERE `log_agent` != '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevent_alert`
|
||||
|
@ -612,6 +660,9 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` (
|
|||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0;
|
||||
ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevent_alert_action`
|
||||
-- -----------------------------------------------------
|
||||
|
@ -713,6 +764,8 @@ CREATE TABLE IF NOT EXISTS `treport_template` (
|
|||
`footer` MEDIUMTEXT default NULL,
|
||||
`custom_font` varchar(200) default NULL,
|
||||
`metaconsole` tinyint(1) DEFAULT 0,
|
||||
`agent_regex` varchar(600) NOT NULL default '',
|
||||
|
||||
PRIMARY KEY(`id_report`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
@ -764,23 +817,6 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
|
|||
PRIMARY KEY(`id_rc`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnews`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tnews` (
|
||||
`id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`author` varchar(255) NOT NULL DEFAULT '',
|
||||
`subject` varchar(255) NOT NULL DEFAULT '',
|
||||
`text` TEXT NOT NULL,
|
||||
`timestamp` DATETIME NOT NULL DEFAULT 0,
|
||||
`id_group` int(10) NOT NULL default 0,
|
||||
`modal` tinyint(1) DEFAULT 0,
|
||||
`expire` tinyint(1) DEFAULT 0,
|
||||
`expire_timestamp` DATETIME NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY(`id_news`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE treport_content_template ADD COLUMN `historical_db` tinyint(1) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE treport_content_template ADD COLUMN `lapse_calc` tinyint(1) default '0';
|
||||
ALTER TABLE treport_content_template ADD COLUMN `lapse` int(11) default '300';
|
||||
|
@ -802,6 +838,28 @@ ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEF
|
|||
ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
|
||||
ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300',
|
||||
MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnews`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tnews` (
|
||||
`id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`author` varchar(255) NOT NULL DEFAULT '',
|
||||
`subject` varchar(255) NOT NULL DEFAULT '',
|
||||
`text` TEXT NOT NULL,
|
||||
`timestamp` DATETIME NOT NULL DEFAULT 0,
|
||||
`id_group` int(10) NOT NULL default 0,
|
||||
`modal` tinyint(1) DEFAULT 0,
|
||||
`expire` tinyint(1) DEFAULT 0,
|
||||
`expire_timestamp` DATETIME NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY(`id_news`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
|
||||
|
@ -913,6 +971,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
|
|||
|
||||
ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL;
|
||||
ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0';
|
||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmetaconsole_event_history`
|
||||
|
@ -1048,6 +1107,14 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
|
|||
FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `remote` tinyint(1) NOT NULL DEFAULT '0',
|
||||
ADD COLUMN `cascade_protection_module` int(10) unsigned NULL DEFAULT '0',
|
||||
ADD COLUMN `transactional_agent` tinyint(1) NOT NULL DEFAULT '0',
|
||||
ADD COLUMN `alias` varchar(600) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
MODIFY COLUMN `update_secondary_groups` tinyint(1) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0',
|
||||
ADD INDEX `id_tagente_idx` (`id_tagente`);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `ttransaction`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1103,6 +1170,8 @@ CREATE TABLE IF NOT EXISTS `titem` (
|
|||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `titem` MODIFY COLUMN `source_data` varchar(250) NULL DEFAULT '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmap`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1129,7 +1198,6 @@ CREATE TABLE IF NOT EXISTS `tmap` (
|
|||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `trel_item`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1147,6 +1215,10 @@ CREATE TABLE IF NOT EXISTS `trel_item` (
|
|||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `trel_item` MODIFY COLUMN `id_map` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `id_parent_source_data` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `id_child_source_data` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `talert_templates`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1170,6 +1242,11 @@ ALTER TABLE talert_snmp ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT "";
|
|||
ALTER TABLE talert_snmp ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT "";
|
||||
ALTER TABLE talert_snmp ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT "";
|
||||
ALTER TABLE talert_snmp ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT "";
|
||||
ALTER TABLE `talert_snmp` MODIFY COLUMN `al_field11` text NOT NULL,
|
||||
MODIFY COLUMN `al_field12` text NOT NULL,
|
||||
MODIFY COLUMN `al_field13` text NOT NULL,
|
||||
MODIFY COLUMN `al_field14` text NOT NULL,
|
||||
MODIFY COLUMN `al_field15` text NOT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `talert_snmp_action`
|
||||
|
@ -1184,6 +1261,7 @@ ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT "";
|
|||
-- Table `tserver`
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE tserver ADD COLUMN `server_keepalive` int(11) DEFAULT 0;
|
||||
ALTER TABLE `tserver` MODIFY COLUMN `server_keepalive` int(11) NOT NULL DEFAULT '0';
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tagente_estado`
|
||||
|
@ -1195,6 +1273,11 @@ ALTER TABLE tagente_estado ADD COLUMN last_unknown_update bigint(20) NOT NULL de
|
|||
ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0';
|
||||
ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0';
|
||||
ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0';
|
||||
ALTER TABLE `tagente_estado` MODIFY COLUMN `datos` mediumtext NOT NULL,
|
||||
MODIFY COLUMN `known_status` tinyint(4) NULL DEFAULT '0',
|
||||
MODIFY COLUMN `last_known_status` tinyint(4) NULL DEFAULT '0',
|
||||
MODIFY COLUMN `last_dynamic_update` bigint(20) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `last_unknown_update` bigint(20) NOT NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `talert_actions`
|
||||
|
@ -1218,6 +1301,11 @@ ALTER TABLE talert_actions ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT "
|
|||
ALTER TABLE talert_actions ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT "";
|
||||
ALTER TABLE talert_actions ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT "";
|
||||
ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "";
|
||||
ALTER TABLE `talert_actions` MODIFY COLUMN `field11` text NOT NULL,
|
||||
MODIFY COLUMN `field12` text NOT NULL,
|
||||
MODIFY COLUMN `field13` text NOT NULL,
|
||||
MODIFY COLUMN `field14` text NOT NULL,
|
||||
MODIFY COLUMN `field15` text NOT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `talert_commands`
|
||||
|
@ -1231,15 +1319,12 @@ UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/ht
|
|||
|
||||
DELETE FROM `talert_commands` WHERE `id` = 11;
|
||||
|
||||
ALTER TABLE `talert_commands` MODIFY COLUMN `id_group` mediumint(8) unsigned NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmap`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tmap MODIFY `id_user` varchar(128);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `titem`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
|
||||
ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tconfig`
|
||||
|
@ -1247,13 +1332,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
|
|||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 32);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 34);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
|
||||
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
|
||||
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '739');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '742');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
|
||||
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
|
||||
|
@ -1314,6 +1399,9 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
|
|||
ALTER TABLE tevent_filter ADD COLUMN `user_comment` text NOT NULL;
|
||||
ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL;
|
||||
ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL;
|
||||
ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10);
|
||||
ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tusuario`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1328,7 +1416,11 @@ ALTER TABLE `tusuario` ADD COLUMN `default_custom_view` int(10) unsigned NULL de
|
|||
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_user` VARCHAR(60);
|
||||
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_pass` VARCHAR(45);
|
||||
ALTER TABLE `tusuario` ADD COLUMN `ehorus_user_level_enabled` TINYINT(1);
|
||||
|
||||
ALTER TABLE `tusuario` MODIFY COLUMN `default_event_filter` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
ADD INDEX `fk_filter_id` (`id_filter`),
|
||||
ADD CONSTRAINT `fk_filter_id` FOREIGN KEY `fk_filter_id` (`id_filter`) REFERENCES `tevent_filter` (`id_filter`) ON DELETE SET NULL ON UPDATE RESTRICT,
|
||||
DROP FOREIGN KEY `fk_id_filter`,
|
||||
DROP INDEX `fk_id_filter`;
|
||||
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1339,14 +1431,23 @@ ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned d
|
|||
ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL default 0;
|
||||
ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0;
|
||||
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0';
|
||||
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0';
|
||||
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0';
|
||||
ALTER TABLE `tagente_modulo` DROP COLUMN `ff_normal`,
|
||||
DROP COLUMN `ff_warning`,
|
||||
DROP COLUMN `ff_critical`,
|
||||
MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0',
|
||||
MODIFY COLUMN `dynamic_next` bigint(20) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `dynamic_two_tailed` tinyint(1) unsigned NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_datos`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tagente_datos MODIFY `datos` double(22,5);
|
||||
ALTER TABLE `tagente_datos` DROP INDEX `data_index1`, ADD INDEX `data_index1` (`id_agente_modulo`, `utimestamp`);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_datos_string`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `tagente_datos_string` MODIFY COLUMN `datos` mediumtext NOT NULL, DROP INDEX `data_string_index_1`, ADD INDEX `data_string_index_1` (`id_agente_modulo`, `utimestamp`);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_datos_inc`
|
||||
|
@ -1362,6 +1463,7 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0';
|
|||
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE `tnetwork_component` MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente`
|
||||
|
@ -1376,6 +1478,12 @@ ALTER TABLE `tagente` ADD COLUMN `cps` int NOT NULL default 0;
|
|||
|
||||
UPDATE tagente SET tagente.alias = tagente.nombre;
|
||||
|
||||
ALTER TABLE `tagente` MODIFY COLUMN `remote` tinyint(1) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `cascade_protection_module` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `update_secondary_groups` tinyint(1) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `alias` varchar(600) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tservice`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1395,6 +1503,8 @@ ALTER TABLE tlayout MODIFY `name` varchar(600) NOT NULL;
|
|||
|
||||
UPDATE tlayout SET is_favourite = 1 WHERE name REGEXP '^(' OR name REGEXP '^\\[';
|
||||
|
||||
ALTER TABLE `tlayout` MODIFY COLUMN `is_favourite` int(10) unsigned NOT NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tlayout_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1413,6 +1523,13 @@ ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_warning`
|
|||
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0;
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN `linked_layout_node_id` INT(10) NOT NULL default 0;
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `tlayout_data` MODIFY COLUMN `type_graph` varchar(50) NOT NULL DEFAULT 'area',
|
||||
MODIFY COLUMN `label_position` varchar(50) NOT NULL DEFAULT 'down',
|
||||
MODIFY COLUMN `linked_layout_node_id` int(10) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `linked_layout_status_type` enum('default','weight','service') NULL DEFAULT 'default',
|
||||
MODIFY COLUMN `element_group` int(10) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `linked_layout_status_as_service_warning` float(20,3) NOT NULL DEFAULT '0.000',
|
||||
MODIFY COLUMN `linked_layout_status_as_service_critical` float(20,3) NOT NULL DEFAULT '0.000';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagent_custom_fields`
|
||||
|
@ -1434,6 +1551,7 @@ ALTER TABLE tgraph ADD COLUMN `summatory_series` tinyint(1) UNSIGNED NOT NULL de
|
|||
ALTER TABLE tgraph ADD COLUMN `average_series` tinyint(1) UNSIGNED NOT NULL default '0';
|
||||
ALTER TABLE tgraph ADD COLUMN `modules_series` tinyint(1) UNSIGNED NOT NULL default '0';
|
||||
ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '0';
|
||||
ALTER TABLE `tgraph` MODIFY COLUMN `percentil` tinyint(1) unsigned NOT NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tnetflow_filter`
|
||||
|
@ -1479,12 +1597,21 @@ ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
|
|||
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
|
||||
ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
|
||||
ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
|
||||
ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300',
|
||||
MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `failover_mode` tinyint(1) NULL DEFAULT '1',
|
||||
MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1';
|
||||
ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmodule_relationship`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tmodule_relationship ADD COLUMN `id_server` varchar(100) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
|
||||
ALTER TABLE `tmodule_relationship` MODIFY COLUMN `id_server` varchar(100) NOT NULL DEFAULT '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tpolicy_module`
|
||||
|
@ -1515,6 +1642,14 @@ ALTER TABLE trecon_task ADD `wmi_enabled` tinyint(1) unsigned DEFAULT '0';
|
|||
ALTER TABLE trecon_task ADD `auth_strings` text;
|
||||
ALTER TABLE trecon_task ADD `autoconfiguration_enabled` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE trecon_task ADD `summary` text;
|
||||
ALTER TABLE `trecon_task` ADD COLUMN `type` int(11) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `alias_as_name` tinyint(2) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `snmp_enabled` tinyint(1) unsigned NULL DEFAULT '0',
|
||||
MODIFY COLUMN `vlan_enabled` tinyint(1) unsigned NULL DEFAULT '0',
|
||||
MODIFY COLUMN `wmi_enabled` tinyint(1) unsigned NULL DEFAULT '0',
|
||||
MODIFY COLUMN `auth_strings` text NULL,
|
||||
MODIFY COLUMN `autoconfiguration_enabled` tinyint(1) unsigned NULL DEFAULT '0',
|
||||
MODIFY COLUMN `summary` text NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `twidget` AND Table `twidget_dashboard`
|
||||
|
@ -1627,12 +1762,14 @@ ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default ''
|
|||
|
||||
ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default 0;
|
||||
ALTER TABLE tgraph_source ADD COLUMN `field_order` int(10) NOT NULL default 0;
|
||||
ALTER TABLE `tgraph_source` MODIFY COLUMN `id_server` int(11) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `field_order` int(10) NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tserver_export_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) BINARY NOT NULL default '';
|
||||
ALTER TABLE tserver_export_data MODIFY `module_name` varchar(600) NOT NULL default '';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tserver`
|
||||
|
@ -1643,6 +1780,7 @@ ALTER TABLE tserver ADD COLUMN exec_proxy tinyint(1) UNSIGNED NOT NULL default 0
|
|||
-- Table `tevent_response`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0;
|
||||
ALTER TABLE tevent_response ADD COLUMN command_timeout int(5) unsigned NOT NULL DEFAULT 90;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmodule`
|
||||
|
@ -1654,7 +1792,12 @@ INSERT INTO tmodule VALUES (8, 'Wux module');
|
|||
-- Table `ttipo_modulo`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
INSERT INTO ttipo_modulo VALUES (25,'web_analysis', 8, 'Web analysis data', 'module-wux.png');
|
||||
INSERT INTO `ttipo_modulo` VALUES
|
||||
(25,'web_analysis', 8, 'Web analysis data', 'module-wux.png'),
|
||||
(34,'remote_cmd', 10, 'Remote execution, numeric data', 'mod_remote_cmd.png'),
|
||||
(35,'remote_cmd_proc', 10, 'Remote execution, boolean data', 'mod_remote_cmd_proc.png'),
|
||||
(36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'),
|
||||
(37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png');
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tdashboard`
|
||||
|
@ -1808,6 +1951,7 @@ create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`(
|
|||
ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
|
||||
ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0';
|
||||
ALTER TABLE tusuario_perfil ADD COLUMN `no_hierarchy` tinyint(1) NOT NULL default '0';
|
||||
ALTER TABLE `tmetaconsole_agent_secondary_group` ADD INDEX `id_tagente` (`id_tagente`);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tautoconfig`
|
||||
|
@ -1907,10 +2051,16 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
|
|||
`linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0,
|
||||
`linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0,
|
||||
`linked_layout_node_id` INT(10) NOT NULL default 0,
|
||||
`cache_expiration` INTEGER UNSIGNED NOT NULL default 0,
|
||||
PRIMARY KEY(`id`),
|
||||
FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE `tlayout_template_data` MODIFY COLUMN `linked_layout_node_id` int(10) NOT NULL DEFAULT '0',
|
||||
MODIFY COLUMN `linked_layout_status_type` enum('default','weight','service') NULL DEFAULT 'default',
|
||||
MODIFY COLUMN `linked_layout_status_as_service_warning` float(20,3) NOT NULL DEFAULT '0.000',
|
||||
MODIFY COLUMN `linked_layout_status_as_service_critical` float(20,3) NOT NULL DEFAULT '0.000';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tlog_graph_models`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1956,6 +2106,7 @@ INSERT INTO tlog_graph_models VALUES (7, 'Users login',
|
|||
|
||||
ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `treport` ADD COLUMN `orientation` varchar(25) NOT NULL default 'vertical';
|
||||
ALTER TABLE `treport` MODIFY COLUMN `hidden` tinyint(1) NULL DEFAULT '0' AFTER `non_interactive`;
|
||||
|
||||
ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1';
|
||||
ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default '';
|
||||
|
@ -2092,7 +2243,8 @@ ALTER TABLE `tmensajes` ADD COLUMN `citicity` INT(10) UNSIGNED DEFAULT '0';
|
|||
ALTER TABLE `tmensajes` ADD COLUMN `id_source` BIGINT(20) UNSIGNED NOT NULL;
|
||||
ALTER TABLE `tmensajes` ADD COLUMN `subtype` VARCHAR(255) DEFAULT '';
|
||||
ALTER TABLE `tmensajes` ADD CONSTRAINT `tsource_fk` FOREIGN KEY (`id_source`) REFERENCES `tnotification_source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE `tmensajes` DROP COLUMN `id_usuario_destino`,
|
||||
ADD UNIQUE INDEX `id_mensaje` (`id_mensaje`);
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tnotification_user`
|
||||
|
@ -2194,7 +2346,7 @@ ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT
|
|||
-- Add column in table `tnetflow_filter`
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
|
||||
|
||||
ALTER TABLE `tnetflow_filter` MODIFY COLUMN `router_ip` text NOT NULL;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Update table `tuser_task`
|
||||
|
@ -2213,6 +2365,17 @@ INSERT INTO `tnews` (`id_news`, `author`, `subject`, `text`, `timestamp`) VALUES
|
|||
|
||||
ALTER TABLE `talert_templates` MODIFY COLUMN `type` ENUM('regex','max_min','max','min','equal','not_equal','warning','critical','onchange','unknown','always','not_normal');
|
||||
|
||||
ALTER TABLE `talert_templates` MODIFY COLUMN `field11` text NOT NULL,
|
||||
MODIFY COLUMN `field12` text NOT NULL,
|
||||
MODIFY COLUMN `field13` text NOT NULL,
|
||||
MODIFY COLUMN `field14` text NOT NULL,
|
||||
MODIFY COLUMN `field15` text NOT NULL,
|
||||
MODIFY COLUMN `field11_recovery` text NOT NULL,
|
||||
MODIFY COLUMN `field12_recovery` text NOT NULL,
|
||||
MODIFY COLUMN `field13_recovery` text NOT NULL,
|
||||
MODIFY COLUMN `field14_recovery` text NOT NULL,
|
||||
MODIFY COLUMN `field15_recovery` text NOT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tvisual_console_items_cache`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -2240,7 +2403,7 @@ CREATE TABLE `tvisual_console_elements_cache` (
|
|||
CREATE TABLE IF NOT EXISTS `tcredential_store` (
|
||||
`identifier` varchar(100) NOT NULL,
|
||||
`id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
|
||||
`product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM',
|
||||
`product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE', 'SAP') default 'CUSTOM',
|
||||
`username` text,
|
||||
`password` text,
|
||||
`extra_1` text,
|
||||
|
@ -2293,3 +2456,55 @@ CREATE TABLE `tdeployment_hosts` (
|
|||
FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`)
|
||||
ON UPDATE CASCADE ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tremote_command`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE `tremote_command` (
|
||||
`id` SERIAL,
|
||||
`name` varchar(150) NOT NULL,
|
||||
`timeout` int(10) unsigned NOT NULL default 30,
|
||||
`retries` int(10) unsigned NOT NULL default 3,
|
||||
`preconditions` text,
|
||||
`script` text,
|
||||
`postconditions` text,
|
||||
`utimestamp` int(20) unsigned NOT NULL default 0,
|
||||
`id_group` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `tremote_command_target`
|
||||
-- ----------------------------------------------------------------------
|
||||
CREATE TABLE `tremote_command_target` (
|
||||
`id` SERIAL,
|
||||
`rcmd_id` bigint unsigned NOT NULL,
|
||||
`id_agent` int(10) unsigned NOT NULL,
|
||||
`utimestamp` int(20) unsigned NOT NULL default 0,
|
||||
`stdout` MEDIUMTEXT,
|
||||
`stderr` MEDIUMTEXT,
|
||||
`errorlevel` int(10) unsigned NOT NULL default 0,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`rcmd_id`) REFERENCES `tremote_command`(`id`)
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
=========
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `trecon_script`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `trecon_script` ADD COLUMN `type` int(11) NOT NULL DEFAULT '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tusuario_perfil`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `tusuario_perfil` MODIFY COLUMN `no_hierarchy` tinyint(1) NOT NULL DEFAULT '0';
|
||||
|
||||
|
||||
-- Extra tnetwork_component
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('N. total processes','Number of running processes in a Windows system.',11,34,0,0,300,0,'tasklist /NH | find /c /v ""','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Free space in C:','Free space available in C:',11,34,0,0,300,0,'powershell $obj=(Get-WmiObject -class "Win32_LogicalDisk" -namespace "root\CIMV2") ; $obj.FreeSpace[0] * 100 /$obj.Size[0]','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','windows','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux uptime','System uptime',43,36,0,0,300,0,'uptime |sed s/us\.*$//g | sed s/,\.*$//g','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux processes','Running processes',43,34,0,0,300,0,'ps elf | wc -l','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux system load','Current load (5 min)',43,34,0,0,300,0,'uptime | awk '{print $(NF-1)}' | tr -d ','','','','',6,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available memory percent','Available memory %',43,34,0,0,300,0,'free | grep Mem | awk '{print $NF/$2 * 100}'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'',0.00,0.00,'',0,'','linux','',0,0,0.000000000000000,'%','nowizard','','','','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `max_critical`, `str_warning`, `min_ff_event`, `min_critical`, `custom_string_2`, `str_critical`, `custom_integer_1`, `custom_string_1`, `post_process`, `custom_string_3`, `wizard_level`, `custom_integer_2`, `critical_instructions`, `unit`, `unknown_instructions`, `macros`, `warning_inverse`, `warning_instructions`, `tags`, `critical_inverse`, `module_macros`, `id_category`, `min_ff_event_warning`, `disabled_types_event`, `ff_type`, `min_ff_event_normal`, `dynamic_interval`, `min_ff_event_critical`, `dynamic_min`, `each_ff`, `dynamic_two_tailed`, `dynamic_max`, `dynamic_next`) VALUES ('Linux available disk /','Available free space in mountpoint /',43,34,0,0,300,0,'df / | tail -n +2 | awk '{print $(NF-1)}' | tr -d '%'','','','',4,2,0,'','','',0,0,1,0.00,0.00,'0.00',0.00,0.00,'',0,'','inherited','',0,0,0.000000000000000,'','nowizard','','nowizard','0','',0,0,0,'','{\"going_unknown\":1}','',0,0,0,0,0,0,0,0,0,0);
|
||||
|
|
|
@ -105,7 +105,7 @@ if (check_login()) {
|
|||
|
||||
echo __(
|
||||
"This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.<br><br>
|
||||
<a href='%s' target='_blanck' style='color: #82b92e; font-size: 10pt; text-decoration: underline;'>Download the official documentation</a>",
|
||||
<a href='%s' target='_blanck' class='pandora_green_text' style='font-size: 10pt; text-decoration: underline;'>Download the official documentation</a>",
|
||||
get_product_name(),
|
||||
get_product_name(),
|
||||
get_product_name(),
|
||||
|
|
|
@ -33,13 +33,13 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
|||
exit;
|
||||
}
|
||||
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clusters defined yet.') ]);
|
||||
?>
|
||||
|
||||
<div class="new_task_cluster">
|
||||
<div class="image_task_cluster">
|
||||
<?php echo html_print_image('images/firts_task/slave-mode.png', true, ['title' => __('Clusters')]); ?>
|
||||
<?php echo html_print_image('images/first_task/slave-mode.png', true, ['title' => __('Clusters')]); ?>
|
||||
</div>
|
||||
<div class="text_task_cluster">
|
||||
<h3> <?php echo __('PANDORA FMS DB CLUSTER'); ?></h3>
|
|
@ -24,7 +24,7 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'],
|
|||
return;
|
||||
}
|
||||
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no clusters defined yet.') ]);
|
||||
|
@ -32,7 +32,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no cluster
|
|||
|
||||
<div class="new_task_cluster">
|
||||
<div class="image_task_cluster">
|
||||
<?php echo html_print_image('images/firts_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?>
|
||||
</div>
|
||||
<div class="text_task_cluster">
|
||||
<h3> <?php echo __('Create Cluster'); ?></h3>
|
|
@ -13,7 +13,7 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no collections defined yet.') ]); ?>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no custom fields defined yet.') ]);
|
||||
|
@ -21,7 +21,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
|
|||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Custom Fields')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_reconserver.png', true, ['title' => __('Custom Fields')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Custom Fields'); ?></h3><p id="description_task">
|
|
@ -13,7 +13,7 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no custom graphs defined yet.') ]);
|
||||
|
@ -21,7 +21,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
|
|||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_custom_reporting.png', true, ['title' => __('Custom Graphs')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_custom_reporting.png', true, ['title' => __('Custom Graphs')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Custom Graph'); ?></h3><p id="description_task">
|
|
@ -13,13 +13,13 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no custom fields defined yet.') ]); ?>
|
||||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Fields Manager')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_reconserver.png', true, ['title' => __('Fields Manager')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Fields Manager'); ?></h3><p id="description_task">
|
|
@ -15,7 +15,7 @@ global $config;
|
|||
global $incident_w;
|
||||
global $incident_m;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no incidents defined yet.') ]);
|
||||
|
@ -25,7 +25,7 @@ if ($incident_w || $incident_m) {
|
|||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_incidencia.png', true, ['title' => __('Incidents')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_incidencia.png', true, ['title' => __('Incidents')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Incidents'); ?></h3><p id="description_task">
|
|
@ -15,7 +15,7 @@ global $config;
|
|||
global $vconsoles_write;
|
||||
global $vconsoles_manage;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
|
||||
ui_print_info_message(
|
||||
[
|
||||
|
@ -28,7 +28,7 @@ if ($vconsoles_write || $vconsoles_manage) {
|
|||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Visual Console')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Visual Console')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Visual Console'); ?></h3><p id="description_task">
|
|
@ -13,7 +13,7 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no network map defined yet.') ]);
|
||||
|
@ -23,7 +23,7 @@ $networkmap_types = networkmap_get_types($strict_user);
|
|||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Network Map')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_reconserver.png', true, ['title' => __('Network Map')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Network Map'); ?></h3><p id="description_task">
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
/**
|
||||
* Omnishell first task.
|
||||
*
|
||||
* @category Omnishell
|
||||
* @package Pandora FMS
|
||||
* @subpackage Enterprise
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2007-2019 Artica Soluciones Tecnologicas, http://www.artica.es
|
||||
* This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
* You cannnot redistribute it without written permission of copyright holder.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There is no command defined yet.') ]); ?>
|
||||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/first_task/omnishell.png', true, ['title' => __('Omnishell')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Omnishell'); ?></h3><p id="description_task">
|
||||
<?php
|
||||
echo '<p>'.__(
|
||||
'Omnishell is an enterprise feature which allows you to execute a structured command along any agent in your %s. The only requirement is to have remote configuration enabled in your agent.',
|
||||
io_safe_output(get_product_name())
|
||||
).'</p>';
|
||||
|
||||
echo '<p>'.__(
|
||||
'You can execute any command on as many agents you need, and check the execution on all of them using the Omnishell Command View'
|
||||
).'</p>';
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
if (enterprise_installed()) {
|
||||
?>
|
||||
<form action="index.php?sec=gextensions&sec2=enterprise/tools/omnishell&page=1" method="post">
|
||||
<input type="submit" class="button_task" value="<?php echo __('Define a command'); ?>" />
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
|
@ -13,13 +13,13 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no planned downtime defined yet.') ]); ?>
|
||||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_visualconsole.png', true, ['title' => __('Planned Downtime')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Planned Downtime')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Planned Downtime'); ?></h3><p id="description_task">
|
||||
|
@ -33,7 +33,7 @@ ui_require_css_file('firts_task');
|
|||
);
|
||||
?>
|
||||
</p>
|
||||
<form action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor" method="post">
|
||||
<form action="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor" method="post">
|
||||
<input type="submit" class="button_task" value="<?php echo __('Create Planned Downtime'); ?>" />
|
||||
</form>
|
||||
</div>
|
|
@ -13,13 +13,13 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no discovery tasks defined yet.') ]); ?>
|
||||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('Discovery server')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_reconserver.png', true, ['title' => __('Discovery server')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Discovery Task'); ?></h3><p id="description_task">
|
|
@ -15,14 +15,14 @@ global $config;
|
|||
global $agent_w;
|
||||
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no services defined yet.') ]); ?>
|
||||
|
||||
<?php if ($agent_w) { ?>
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_servicios.png', true, ['title' => __('Services')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_servicios.png', true, ['title' => __('Services')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Services'); ?></h3><p id="description_task">
|
|
@ -13,13 +13,13 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no SNMP filter defined yet.') ]); ?>
|
||||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_reconserver.png', true, ['title' => __('SNMP Filter')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_reconserver.png', true, ['title' => __('SNMP Filter')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create SNMP Filter'); ?></h3><p id="description_task">
|
|
@ -13,13 +13,13 @@
|
|||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no tags defined yet.') ]); ?>
|
||||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_gestiondetags.png', true, ['title' => __('Tags')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_gestiondetags.png', true, ['title' => __('Tags')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Tags'); ?></h3><p id="description_task">
|
|
@ -15,7 +15,7 @@ global $config;
|
|||
global $networkmaps_write;
|
||||
global $networkmaps_manage;
|
||||
check_login();
|
||||
ui_require_css_file('firts_task');
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no transactions defined yet.') ]);
|
||||
|
@ -25,7 +25,7 @@ if ($networkmaps_write || $networkmaps_manage) {
|
|||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/firts_task/icono_grande_topology.png', true, ['title' => __('Transactions')]); ?>
|
||||
<?php echo html_print_image('images/first_task/icono_grande_topology.png', true, ['title' => __('Transactions')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Transactions'); ?></h3><p id="description_task">
|
|
@ -328,22 +328,40 @@ if ($config['menu_type'] == 'classic') {
|
|||
$header_autorefresh_counter .= $autorefresh_additional;
|
||||
$header_autorefresh_counter .= '</div>';
|
||||
|
||||
// Button for feedback pandora.
|
||||
if (enterprise_installed()) {
|
||||
$header_feedback = '<div id="feedback-icon-header">';
|
||||
$header_feedback .= '<div id="modal-feedback-form" style="display:none;"></div>';
|
||||
$header_feedback .= '<div id="msg-header" style="display: none"></div>';
|
||||
$header_feedback .= html_print_image(
|
||||
'/images/feedback-header.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Feedback'),
|
||||
'id' => 'feedback-header',
|
||||
'alt' => __('Feedback'),
|
||||
'style' => 'cursor: pointer;',
|
||||
]
|
||||
);
|
||||
$header_feedback .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
// Support.
|
||||
if (defined('PANDORA_ENTERPRISE')) {
|
||||
$header_support_link = 'https://support.artica.es/';
|
||||
if (enterprise_installed()) {
|
||||
$header_support_link = $config['custom_support_url'];
|
||||
} else {
|
||||
$header_support_link = 'https://pandorafms.com/forums/';
|
||||
}
|
||||
|
||||
$header_support = '<div id="header_support">';
|
||||
$header_support .= '<a href="'.$header_support_link.'" target="_blank">';
|
||||
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
|
||||
$header_support .= html_print_image('/images/header_support.png', true, ['title' => __('Go to support'), 'class' => 'bot', 'alt' => 'user']);
|
||||
$header_support .= '</a></div>';
|
||||
|
||||
// Documentation.
|
||||
$header_docu = '<div id="header_docu">';
|
||||
$header_docu .= '<a href="https://wiki.pandorafms.com/index.php?title=Main_Page" target="_blank">';
|
||||
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
|
||||
$header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']);
|
||||
$header_docu .= '</a></div>';
|
||||
|
||||
|
@ -388,9 +406,9 @@ if ($config['menu_type'] == 'classic') {
|
|||
|
||||
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
|
||||
<div class="header_center">'.$header_searchbar.'</div>
|
||||
<div class="header_right">'.$header_chat, $header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
<div class="header_right">'.$header_chat, $header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
?>
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
</div> <!-- Closes #table_header -->
|
||||
|
||||
|
||||
|
@ -610,8 +628,41 @@ if ($config['menu_type'] == 'classic') {
|
|||
});
|
||||
|
||||
var fixed_header = <?php echo json_encode((bool) $config_fixed_header); ?>;
|
||||
|
||||
|
||||
var new_chat = <?php echo (int) $_SESSION['new_chat']; ?>;
|
||||
|
||||
/**
|
||||
* Loads modal from AJAX to add feedback.
|
||||
*/
|
||||
function show_feedback() {
|
||||
var btn_ok_text = '<?php echo __('Send'); ?>';
|
||||
var btn_cancel_text = '<?php echo __('Cancel'); ?>';
|
||||
var title = '<?php echo __('Report an issue'); ?>';
|
||||
var url = '<?php echo 'tools/diagnostics'; ?>';
|
||||
|
||||
load_modal({
|
||||
target: $('#modal-feedback-form'),
|
||||
form: 'modal_form_feedback',
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
modal: {
|
||||
title: title,
|
||||
ok: btn_ok_text,
|
||||
cancel: btn_cancel_text,
|
||||
},
|
||||
onshow: {
|
||||
page: url,
|
||||
method: 'formFeedback',
|
||||
},
|
||||
onsubmit: {
|
||||
page: url,
|
||||
method: 'createdScheduleFeedbackTask',
|
||||
dataType: 'json',
|
||||
},
|
||||
ajax_callback: generalShowMsg,
|
||||
idMsgCallback: 'msg-header',
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
// Check new notifications on a periodic way
|
||||
|
@ -661,7 +712,17 @@ if ($config['menu_type'] == 'classic') {
|
|||
$("#ui_close_dialog_titlebar").click(function () {
|
||||
$("#agent_access").css("display","");
|
||||
});
|
||||
|
||||
|
||||
<?php if (enterprise_installed()) { ?>
|
||||
// Feedback.
|
||||
$("#feedback-header").click(function () {
|
||||
// Clean DOM.
|
||||
$("#feedback-header").empty();
|
||||
// Function charge Modal.
|
||||
show_feedback();
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
function blinkpubli(){
|
||||
$(".publienterprise").delay(100).fadeTo(300,0.2).delay(100).fadeTo(300,1, blinkpubli);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
/**
|
||||
* Credential store
|
||||
*
|
||||
* @category HelperFeedBack
|
||||
* @package Pandora FMS
|
||||
* @subpackage Help Feedback
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
|
||||
/**
|
||||
* Class HelpFeedBack.
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/class/HelpFeedBack.class.php';
|
||||
|
||||
$ajaxPage = 'general/help_feedback';
|
||||
|
||||
// Control call flow.
|
||||
try {
|
||||
// User access and validation is being processed on class constructor.
|
||||
$helpfeedback = new HelpFeedBack($ajaxPage);
|
||||
} catch (Exception $e) {
|
||||
if (is_ajax()) {
|
||||
echo json_encode(['error' => '[HelpFeedBack]'.$e->getMessage() ]);
|
||||
exit;
|
||||
} else {
|
||||
echo '[HelpFeedBack]'.$e->getMessage();
|
||||
}
|
||||
|
||||
// Stop this execution, but continue 'globally'.
|
||||
return;
|
||||
}
|
||||
|
||||
// Ajax controller.
|
||||
if (is_ajax()) {
|
||||
$method = get_parameter('method', '');
|
||||
|
||||
if (method_exists($helpfeedback, $method) === true) {
|
||||
if ($helpfeedback->ajaxMethod($method) === true) {
|
||||
$helpfeedback->{$method}();
|
||||
} else {
|
||||
$helpfeedback->error('Unavailable method.');
|
||||
}
|
||||
} else {
|
||||
$helpfeedback->error('Method not found. ['.$method.']');
|
||||
}
|
||||
|
||||
|
||||
// Stop any execution.
|
||||
exit;
|
||||
} else {
|
||||
// Run.
|
||||
$helpfeedback->run();
|
||||
}
|
|
@ -87,7 +87,7 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
|
|||
echo '</td>';
|
||||
|
||||
echo '<td style="border:1px solid #FFF; text-align:center;">';
|
||||
echo '<a href="'.$config['custom_docs_url'].'" target="_blank" style="text-decoration:none;">'.html_print_image(
|
||||
echo '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank" style="text-decoration:none;">'.html_print_image(
|
||||
'images/documentation.png',
|
||||
true,
|
||||
[
|
||||
|
@ -96,7 +96,7 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
|
|||
]
|
||||
).'</a>';
|
||||
echo '<br style="margin-bottom: 40px;" />';
|
||||
echo '<a style="font-size: 9pt;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Documentation').'</span></a>';
|
||||
echo '<a style="font-size: 9pt;"href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Documentation').'</span></a>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
|
|
|
@ -88,27 +88,59 @@ if (!empty($config['login_background'])) {
|
|||
$login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\"";
|
||||
}
|
||||
|
||||
// Get alternative custom in case of db fail.
|
||||
$custom_fields = [
|
||||
'custom_logo_login',
|
||||
'custom_splash_login',
|
||||
'custom_title1_login',
|
||||
'custom_title2_login',
|
||||
'rb_product_name',
|
||||
'custom_docs_url',
|
||||
'custom_support_url',
|
||||
];
|
||||
|
||||
foreach ($custom_fields as $field) {
|
||||
if (!isset($config[$field])) {
|
||||
if (isset($config[$field.'_alt'])) {
|
||||
$config[$field] = $config[$field.'_alt'];
|
||||
$custom_conf_enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get the custom icons.
|
||||
$docs_logo = ui_get_docs_logo();
|
||||
$support_logo = ui_get_support_logo();
|
||||
echo '<div id="login_body" '.$login_body_style.'>';
|
||||
echo '<div id="header_login">';
|
||||
|
||||
echo '<div id="list_icon_docs_support"><ul>';
|
||||
if ($docs_logo !== false) {
|
||||
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
}
|
||||
echo '<div id="list_icon_docs_support"><ul>';
|
||||
|
||||
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if ($support_logo !== false) {
|
||||
echo '<li id="li_margin_left"><a href="'.$config['custom_support_url'].'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
if (isset($config['custom_docs_url'])) {
|
||||
if ($docs_logo !== false) {
|
||||
echo '<li><a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
}
|
||||
|
||||
echo '<li><a href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
|
||||
} else {
|
||||
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li>'.__('Support').'</li>';
|
||||
echo '<li><a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Docs').'</li>';
|
||||
} else if (!$custom_conf_enabled) {
|
||||
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank">'.__('Docs').'</li>';
|
||||
}
|
||||
|
||||
if (isset($config['custom_support_url'])) {
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if ($support_logo !== false) {
|
||||
echo '<li id="li_margin_left"><a href="'.ui_get_full_external_url($config['custom_support_url']).'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
}
|
||||
|
||||
echo '<li><a href="'.ui_get_full_external_url($config['custom_support_url']).'" target="_blank">'.__('Support').'</li>';
|
||||
} else {
|
||||
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li>'.__('Support').'</li>';
|
||||
}
|
||||
} else if (!$custom_conf_enabled) {
|
||||
echo '<li id="li_margin_left"><a href="https://support.artica.es" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li><a href="https://support.artica.es" target="_blank">'.__('Docs').'</li>';
|
||||
}
|
||||
|
||||
echo '</ul></div>';
|
||||
|
@ -133,7 +165,7 @@ if (defined('METACONSOLE')) {
|
|||
html_print_image('enterprise/images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
} else {
|
||||
if (!isset($config['custom_logo_login']) || $config['custom_logo_login'] == 0) {
|
||||
if (!isset($config['custom_logo_login']) || $config['custom_logo_login'] === 0) {
|
||||
html_print_image('images/custom_logo_login/pandora_logo.png', false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
} else {
|
||||
html_print_image('images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
|
@ -423,9 +455,14 @@ if ($login_screen == 'logout') {
|
|||
}
|
||||
|
||||
switch ($login_screen) {
|
||||
case 'error_authconfig':
|
||||
case 'error_dbconfig':
|
||||
$title = __('Problem with %s database', get_product_name());
|
||||
case 'error_authconfig':
|
||||
if (!isset($config['rb_product_name_alt'])) {
|
||||
$title = __('Problem with %s database', get_product_name());
|
||||
} else {
|
||||
$title = __('Problem with %s database', $config['rb_product_name_alt']);
|
||||
}
|
||||
|
||||
$message = __(
|
||||
'Cannot connect to the database, please check your database setup in the <b>include/config.php</b> file.<i><br/><br/>
|
||||
Probably your database, hostname, user or password values are incorrect or
|
||||
|
|
|
@ -83,7 +83,6 @@ background:black;opacity:0.1;left:0px;top:0px;width:100%;height:100%;
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="alert_messages_na">
|
||||
|
||||
<div class='modalheade'>
|
||||
|
@ -100,10 +99,35 @@ background:black;opacity:0.1;left:0px;top:0px;width:100%;height:100%;
|
|||
?>
|
||||
</div>
|
||||
</div>
|
||||
<a href='https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Configuration' target='_blank'>
|
||||
<div class='modalwikibutto cerrar'>
|
||||
<span class='modalwikibuttontex'> <?php echo __('Documentation'); ?></span>
|
||||
</div>
|
||||
<?php
|
||||
$custom_conf_enabled = false;
|
||||
foreach ($config as $key => $value) {
|
||||
if (preg_match('/._alt/i', $key)) {
|
||||
$custom_conf_enabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$custom_conf_enabled || isset($config['custom_docs_url_alt'])) {
|
||||
if (isset($config['custom_docs_url_alt'])) {
|
||||
$docs_url = $config['custom_docs_url_alt'];
|
||||
} else {
|
||||
$docs_url = 'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Configuration';
|
||||
}
|
||||
|
||||
echo '
|
||||
<a href="'.ui_get_full_external_url($docs_url).'" target="_blank">
|
||||
<div class="modalwikibutto cerrar">
|
||||
<span class="modalwikibuttontex">'.__('Documentation').'
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
require_once $config['homedir'].'/include/class/WelcomeWindow.class.php';
|
||||
|
||||
|
||||
if (is_ajax()) {
|
||||
|
@ -122,6 +123,8 @@ if (is_ajax()) {
|
|||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
ui_require_css_file('register');
|
||||
|
||||
$initial = isset($config['initial_wizard']) !== true
|
||||
|
@ -170,6 +173,16 @@ if (!$config['disabled_newsletter']) {
|
|||
}
|
||||
}
|
||||
|
||||
$welcome = !$registration && !$show_newsletter && !$initial;
|
||||
try {
|
||||
$welcome_window = new WelcomeWindow($welcome);
|
||||
if ($welcome_window !== null) {
|
||||
$welcome_window->run();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$welcome = false;
|
||||
}
|
||||
|
||||
$newsletter = null;
|
||||
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
/**
|
||||
* Credential store
|
||||
*
|
||||
* @category HelperFeedBack
|
||||
* @package Pandora FMS
|
||||
* @subpackage Help Feedback
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
|
||||
/**
|
||||
* Class sap_views.
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
enterprise_include_once('/include/class/SAPView.class.php');
|
||||
|
||||
$ajaxPage = 'general/sap_view';
|
||||
|
||||
// Control call flow.
|
||||
try {
|
||||
// User access and validation is being processed on class constructor.
|
||||
$sap_views = new SAPView($ajaxPage);
|
||||
} catch (Exception $e) {
|
||||
if (is_ajax()) {
|
||||
echo json_encode(['error' => '[sap_views]'.$e->getMessage() ]);
|
||||
exit;
|
||||
} else {
|
||||
echo '[sap_views]'.$e->getMessage();
|
||||
}
|
||||
|
||||
// Stop this execution, but continue 'globally'.
|
||||
return;
|
||||
}
|
||||
|
||||
// Ajax controller.
|
||||
if (is_ajax()) {
|
||||
$method = get_parameter('method', '');
|
||||
|
||||
if (method_exists($sap_views, $method) === true) {
|
||||
if ($sap_views->ajaxMethod($method) === true) {
|
||||
$sap_views->{$method}();
|
||||
} else {
|
||||
$sap_views->error('Unavailable method.');
|
||||
}
|
||||
} else {
|
||||
$sap_views->error('Method not found. ['.$method.']');
|
||||
}
|
||||
|
||||
|
||||
// Stop any execution.
|
||||
exit;
|
||||
} else {
|
||||
// Run.
|
||||
$sap_views->run();
|
||||
}
|
|
@ -13,7 +13,8 @@ switch ($_GET['module']) {
|
|||
$sql = sprintf(
|
||||
'SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria between 3 and 5 '
|
||||
WHERE categoria between 3 and 5
|
||||
OR categoria = 10 '
|
||||
);
|
||||
break;
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ if ($new_agent) {
|
|||
|
||||
$table_alias = '<div class="label_select"><p class="input_label">'.__('Alias').': '.ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'</p>';
|
||||
$table_alias .= '<div class='.$label_select_parent.'>';
|
||||
$table_alias .= '<div class='.$label_select_child_left.'>'.html_print_input_text('alias', $alias, '', 50, 100, true).'</div>';
|
||||
$table_alias .= '<div class='.$label_select_child_left.'>'.html_print_input_text('alias', $alias, '', 50, 100, true, false, true).'</div>';
|
||||
if ($new_agent) {
|
||||
$table_alias .= '<div class="label_select_child_right">'.html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name').'</div>';
|
||||
}
|
||||
|
@ -765,7 +765,7 @@ $table_adv_agent_icon .= html_print_select(
|
|||
).'</div>';
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$table_adv_gis = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Ignore new GIS data:').'</p>';
|
||||
$table_adv_gis = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Update new GIS data:').'</p>';
|
||||
if ($new_agent) {
|
||||
$update_gis_data = true;
|
||||
}
|
||||
|
@ -774,11 +774,14 @@ if ($config['activate_gis']) {
|
|||
}
|
||||
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$advanced_div = '<div class="secondary_groups_list">';
|
||||
} else {
|
||||
$advanced_div = '<div class="secondary_groups_list" style="display: none">';
|
||||
}
|
||||
|
||||
// General display distribution.
|
||||
$table_adv_options = '
|
||||
<div class="secondary_groups_list">
|
||||
'.$adv_secondary_groups_label.'
|
||||
$table_adv_options = $advanced_div.$adv_secondary_groups_label.'
|
||||
<div class="sg_source">
|
||||
'.$adv_secondary_groups_left.'
|
||||
</div>
|
||||
|
|
|
@ -546,7 +546,7 @@ if ($create_modules) {
|
|||
$module_values = $common_values;
|
||||
|
||||
$module_values['descripcion'] = sprintf(__('Check if the process %s is running or not'), $process);
|
||||
$module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp_proc');
|
||||
$module_values['id_tipo_modulo'] = modules_get_type_id('generic_proc');
|
||||
$module_values['id_modulo'] = MODULE_PLUGIN;
|
||||
$module_values['id_plugin'] = $plugin['id'];
|
||||
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* Pandora FMS - http://pandorafms.com.
|
||||
* * ==================================================
|
||||
* * Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
* * Please see http://pandorafms.org for full contribution list
|
||||
* * This program is free software; you can redistribute it and/or
|
||||
* * modify it under the terms of the GNU General Public License
|
||||
* * as published by the Free Software Foundation; version 2
|
||||
* * This program is distributed in the hope that it will be useful,
|
||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* * GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
require_once 'include/functions_modules.php';
|
||||
|
@ -23,19 +25,19 @@ require_once 'include/graphs/functions_utils.php';
|
|||
check_login();
|
||||
|
||||
$ip_target = (string) get_parameter('ip_target', $ipAgent);
|
||||
// Host
|
||||
// Host.
|
||||
$plugin_user = (string) get_parameter('plugin_user', 'Administrator');
|
||||
// Username
|
||||
// Username.
|
||||
$plugin_pass = io_safe_output(get_parameter('plugin_pass', ''));
|
||||
// Password
|
||||
// Password.
|
||||
$tcp_send = (string) get_parameter('tcp_send');
|
||||
// Namespace
|
||||
// Namespace.
|
||||
$server_to_exec = get_parameter('server_to_exec', 0);
|
||||
|
||||
// See if id_agente is set (either POST or GET, otherwise -1
|
||||
// See if id_agente is set (either POST or GET, otherwise -1.
|
||||
$id_agent = $idAgent;
|
||||
|
||||
// Get passed variables
|
||||
// Get passed variables.
|
||||
$wmiexplore = (int) get_parameter('wmiexplore', 0);
|
||||
$create_modules = (int) get_parameter('create_modules', 0);
|
||||
|
||||
|
@ -44,24 +46,30 @@ $interfaces = [];
|
|||
$wmi_client = 'wmic';
|
||||
|
||||
if ($wmiexplore) {
|
||||
$wmi_command = wmi_compose_query($wmi_client, $plugin_user, $plugin_pass, $ip_target, $tcp_send);
|
||||
$wmi_command = wmi_compose_query(
|
||||
$wmi_client,
|
||||
$plugin_user,
|
||||
$plugin_pass,
|
||||
$ip_target,
|
||||
$tcp_send
|
||||
);
|
||||
|
||||
$processes = [];
|
||||
$services = [];
|
||||
$disks = [];
|
||||
$network_component_groups = [];
|
||||
|
||||
// Processes
|
||||
// Processes.
|
||||
$wmi_processes = $wmi_command.' "select Name from Win32_Process"';
|
||||
$processes_name_field = 1;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ($server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_processes."'", $output, $rc);
|
||||
} else {
|
||||
exec($wmi_processes, $output);
|
||||
}
|
||||
if (enterprise_installed() && (int) $server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec(
|
||||
'ssh pandora_exec_proxy@'.$server_data['ip_address']."
|
||||
'".$wmi_processes."'",
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
exec($wmi_processes, $output);
|
||||
}
|
||||
|
@ -73,7 +81,7 @@ if ($wmiexplore) {
|
|||
|
||||
if (!$fail) {
|
||||
foreach ($output as $index => $row) {
|
||||
// First and second rows are Class and column names, ignore it
|
||||
// First and second rows are Class and column names, ignore it.
|
||||
if ($index < 2) {
|
||||
continue;
|
||||
}
|
||||
|
@ -81,60 +89,74 @@ if ($wmiexplore) {
|
|||
$row_exploded = explode('|', $row);
|
||||
|
||||
if (!in_array($row_exploded[$processes_name_field], $processes)) {
|
||||
$processes[$row_exploded[$processes_name_field]] = $row_exploded[$processes_name_field];
|
||||
if (preg_match('/ERROR/', $row_exploded[$processes_name_field])) {
|
||||
$processes[$row_exploded[$prouycesses_name_field]] = __('None');
|
||||
} else {
|
||||
$processes[$row_exploded[$prouycesses_name_field]] = $row_exploded[$processes_name_field];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($output);
|
||||
|
||||
// Services
|
||||
// Services.
|
||||
$wmi_services = $wmi_command.' "select Name from Win32_Service"';
|
||||
$services_name_field = 0;
|
||||
$services_check_field = 1;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ($server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_services."'", $output, $rc);
|
||||
} else {
|
||||
exec($wmi_services, $output);
|
||||
}
|
||||
if (enterprise_installed() && (int) $server_to_exec != 0) {
|
||||
$server_data = db_get_row(
|
||||
'tserver',
|
||||
'id_server',
|
||||
$server_to_exec
|
||||
);
|
||||
exec(
|
||||
'ssh pandora_exec_proxy@'.$server_data['ip_address']."
|
||||
'".$wmi_services."'",
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
exec($wmi_services, $output);
|
||||
}
|
||||
|
||||
foreach ($output as $index => $row) {
|
||||
// First and second rows are Class and column names, ignore it
|
||||
// First and second rows are Class and column names, ignore it.
|
||||
if ($index < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$row_exploded = explode('|', $row);
|
||||
$row_exploded = explode('|', $row);
|
||||
|
||||
if (!in_array($row_exploded[$services_name_field], $services)) {
|
||||
$services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field];
|
||||
if (preg_match('/ERROR/', $row_exploded[$services_name_field])) {
|
||||
$services[$row_exploded[$services_name_field]] = __('None');
|
||||
} else {
|
||||
$services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($output);
|
||||
|
||||
// Disks
|
||||
// Disks.
|
||||
$wmi_disks = $wmi_command.' "Select DeviceID from Win32_LogicalDisk"';
|
||||
$disks_name_field = 0;
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ($server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec('ssh pandora_exec_proxy@'.$server_data['ip_address']." '".$wmi_disks."'", $output, $rc);
|
||||
} else {
|
||||
exec($wmi_disks, $output);
|
||||
}
|
||||
if (enterprise_installed() && (int) $server_to_exec != 0) {
|
||||
$server_data = db_get_row('tserver', 'id_server', $server_to_exec);
|
||||
exec(
|
||||
'ssh pandora_exec_proxy@'.$server_data['ip_address']."
|
||||
'".$wmi_disks."'",
|
||||
$output,
|
||||
$rc
|
||||
);
|
||||
} else {
|
||||
exec($wmi_disks, $output);
|
||||
}
|
||||
|
||||
foreach ($output as $index => $row) {
|
||||
// First and second rows are Class and column names, ignore it
|
||||
// First and second rows are Class and column names, ignore it.
|
||||
if ($index < 2) {
|
||||
continue;
|
||||
}
|
||||
|
@ -142,14 +164,21 @@ if ($wmiexplore) {
|
|||
$row_exploded = explode('|', $row);
|
||||
|
||||
if (!in_array($row_exploded[$disks_name_field], $services)) {
|
||||
$disk_string = sprintf(__('Free space on %s'), $row_exploded[$disks_name_field]);
|
||||
$disks[$row_exploded[$disks_name_field]] = $disk_string;
|
||||
if (preg_match('/ERROR/', $row_exploded[$disks_name_field])) {
|
||||
$disks[$row_exploded[$disks_name_field]] = __('None');
|
||||
} else {
|
||||
$disk_string = sprintf(
|
||||
__('Free space on %s'),
|
||||
$row_exploded[$disks_name_field]
|
||||
);
|
||||
$disks[$row_exploded[$disks_name_field]] = $disk_string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($output);
|
||||
|
||||
// WMI Components
|
||||
// WMI Components.
|
||||
$network_component_groups = network_components_get_groups(MODULE_WMI);
|
||||
}
|
||||
}
|
||||
|
@ -163,14 +192,14 @@ if ($create_modules) {
|
|||
$components = [];
|
||||
|
||||
foreach ($modules as $module) {
|
||||
// Split module data to get type
|
||||
// Split module data to get type.
|
||||
$module_exploded = explode('_', $module);
|
||||
$type = $module_exploded[0];
|
||||
|
||||
// Delete type from module data
|
||||
// Delete type from module data.
|
||||
unset($module_exploded[0]);
|
||||
|
||||
// Rebuild module data
|
||||
// Rebuild module data.
|
||||
$module = implode('_', $module_exploded);
|
||||
|
||||
switch ($type) {
|
||||
|
@ -189,10 +218,14 @@ if ($create_modules) {
|
|||
case 'component':
|
||||
$components[] = $module;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Common values for WMI modules
|
||||
// Common values for WMI modules.
|
||||
$values = [
|
||||
'ip_target' => $ip_target,
|
||||
'tcp_send' => $tcp_send,
|
||||
|
@ -202,7 +235,10 @@ if ($create_modules) {
|
|||
];
|
||||
|
||||
if ($server_to_exec != 0) {
|
||||
$sql = sprintf('SELECT server_type FROM tserver WHERE id_server = %d', $server_to_exec);
|
||||
$sql = sprintf(
|
||||
'SELECT server_type FROM tserver WHERE id_server = %d',
|
||||
$server_to_exec
|
||||
);
|
||||
$row = db_get_row_sql($sql);
|
||||
|
||||
if ($row['server_type'] == 13) {
|
||||
|
@ -210,89 +246,146 @@ if ($create_modules) {
|
|||
}
|
||||
}
|
||||
|
||||
// Create Service modules
|
||||
// Create Service modules.
|
||||
$services_values = $values;
|
||||
|
||||
$services_values['snmp_community'] = 'Running';
|
||||
// Key string
|
||||
// Key string.
|
||||
$services_values['tcp_port'] = 1;
|
||||
// Field number (Running/Stopped)
|
||||
// Field number (Running/Stopped).
|
||||
$services_values['id_tipo_modulo'] = 2;
|
||||
// Generic boolean
|
||||
$services_result = wmi_create_wizard_modules($id_agent, $services, 'services', $services_values, 0, 0, $server_to_exec);
|
||||
// Generic boolean.
|
||||
$services_result = wmi_create_wizard_modules(
|
||||
$id_agent,
|
||||
$services,
|
||||
'services',
|
||||
$services_values,
|
||||
0,
|
||||
0,
|
||||
$server_to_exec
|
||||
);
|
||||
|
||||
// Create Process modules
|
||||
// Create Process modules.
|
||||
$processes_values = $values;
|
||||
|
||||
$processes_values['tcp_port'] = 0;
|
||||
// Field number (OID)
|
||||
// Field number (OID).
|
||||
$processes_values['id_tipo_modulo'] = 2;
|
||||
// Generic boolean
|
||||
$processes_result = wmi_create_wizard_modules($id_agent, $processes, 'processes', $processes_values, 0, 0, $server_to_exec);
|
||||
// Generic boolean.
|
||||
$processes_result = wmi_create_wizard_modules(
|
||||
$id_agent,
|
||||
$processes,
|
||||
'processes',
|
||||
$processes_values,
|
||||
0,
|
||||
0,
|
||||
$server_to_exec
|
||||
);
|
||||
|
||||
// Create Space on disk modules
|
||||
// Create Space on disk modules.
|
||||
$disks_values = $values;
|
||||
|
||||
$disks_values['tcp_port'] = 1;
|
||||
// Free space in bytes
|
||||
// Free space in bytes.
|
||||
$disks_values['id_tipo_modulo'] = 1;
|
||||
// Generic numeric
|
||||
// Generic numeric.
|
||||
$disks_values['unit'] = 'Bytes';
|
||||
// Unit
|
||||
$disks_result = wmi_create_wizard_modules($id_agent, $disks, 'disks', $disks_values, 0, 0, $server_to_exec);
|
||||
// Unit.
|
||||
$disks_result = wmi_create_wizard_modules(
|
||||
$id_agent,
|
||||
$disks,
|
||||
'disks',
|
||||
$disks_values,
|
||||
0,
|
||||
0,
|
||||
$server_to_exec
|
||||
);
|
||||
|
||||
// Create modules from component
|
||||
// Create modules from component.
|
||||
$components_values = $values;
|
||||
|
||||
$components_values['id_agente'] = $id_agent;
|
||||
|
||||
$components_result = wmi_create_module_from_components($components, $components_values, 0, 0, $server_to_exec);
|
||||
$components_result = wmi_create_module_from_components(
|
||||
$components,
|
||||
$components_values,
|
||||
0,
|
||||
0,
|
||||
$server_to_exec
|
||||
);
|
||||
|
||||
|
||||
// Errors/Success messages
|
||||
// Errors/Success messages.
|
||||
$success_message = '';
|
||||
$error_message = '';
|
||||
if (!empty($services_result)) {
|
||||
if (count($services_result[NOERR]) > 0) {
|
||||
$success_message .= sprintf(__('%s service modules created succesfully'), count($services_result[NOERR])).'<br>';
|
||||
$success_message .= sprintf(
|
||||
__('%s service modules created succesfully'),
|
||||
count($services_result[NOERR])
|
||||
).'<br>';
|
||||
}
|
||||
|
||||
if (count($services_result[ERR_GENERIC]) > 0) {
|
||||
$error_message .= sprintf(__('Error creating %s service modules'), count($services_result[ERR_GENERIC])).'<br>';
|
||||
$error_message .= sprintf(
|
||||
__('Error creating %s service modules'),
|
||||
count($services_result[ERR_GENERIC])
|
||||
).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($processes_result)) {
|
||||
if (count($processes_result[NOERR]) > 0) {
|
||||
$success_message .= sprintf(__('%s process modules created succesfully'), count($processes_result[NOERR])).'<br>';
|
||||
$success_message .= sprintf(
|
||||
__('%s process modules created succesfully'),
|
||||
count($processes_result[NOERR])
|
||||
).'<br>';
|
||||
}
|
||||
|
||||
if (count($processes_result[ERR_GENERIC]) > 0) {
|
||||
$error_message .= sprintf(__('Error creating %s process modules'), count($processes_result[ERR_GENERIC])).'<br>';
|
||||
$error_message .= sprintf(
|
||||
__('Error creating %s process modules'),
|
||||
count($processes_result[ERR_GENERIC])
|
||||
).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($disks_result)) {
|
||||
if (count($disks_result[NOERR]) > 0) {
|
||||
$success_message .= sprintf(__('%s disk space modules created succesfully'), count($disks_result[NOERR])).'<br>';
|
||||
$success_message .= sprintf(
|
||||
__('%s disk space modules created succesfully'),
|
||||
count($disks_result[NOERR])
|
||||
).'<br>';
|
||||
}
|
||||
|
||||
if (count($disks_result[ERR_GENERIC]) > 0) {
|
||||
$error_message .= sprintf(__('Error creating %s disk space modules'), count($disks_result[ERR_GENERIC])).'<br>';
|
||||
$error_message .= sprintf(
|
||||
__('Error creating %s disk space modules'),
|
||||
count($disks_result[ERR_GENERIC])
|
||||
).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($components_result)) {
|
||||
if (count($components_result[NOERR]) > 0) {
|
||||
$success_message .= sprintf(__('%s modules created from components succesfully'), count($components_result[NOERR])).'<br>';
|
||||
$success_message .= sprintf(
|
||||
__('%s modules created from components succesfully'),
|
||||
count($components_result[NOERR])
|
||||
).'<br>';
|
||||
}
|
||||
|
||||
if (count($components_result[ERR_GENERIC]) > 0) {
|
||||
$error_message .= sprintf(__('Error creating %s modules from components'), count($components_result[ERR_GENERIC])).'<br>';
|
||||
$error_message .= sprintf(
|
||||
__('Error creating %s modules from components'),
|
||||
count($components_result[ERR_GENERIC])
|
||||
).'<br>';
|
||||
}
|
||||
|
||||
if (count($components_result[ERR_EXIST]) > 0) {
|
||||
$error_message .= sprintf(__('%s modules already exist'), count($components_result[ERR_EXIST])).'<br>';
|
||||
$error_message .= sprintf(
|
||||
__('%s modules already exist'),
|
||||
count($components_result[ERR_EXIST])
|
||||
).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,7 +399,9 @@ if ($create_modules) {
|
|||
}
|
||||
|
||||
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||
echo "<form method='post' id='wmi_form' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
echo "<form method='post' id='wmi_form'
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&
|
||||
tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
|
@ -314,18 +409,47 @@ $table->cellspacing = 0;
|
|||
$table->class = 'databox filters';
|
||||
|
||||
$table->data[0][0] = '<b>'.__('Target IP').'</b>';
|
||||
$table->data[0][1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'ip_target',
|
||||
$ip_target,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[0][2] = '<b>'.__('Namespace').'</b>';
|
||||
$table->data[0][3] = html_print_input_text('tcp_send', $tcp_send, '', 15, 60, true);
|
||||
$table->data[0][3] = html_print_input_text(
|
||||
'tcp_send',
|
||||
$tcp_send,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][0] = '<b>'.__('Username').'</b>';
|
||||
$table->data[1][1] = html_print_input_text('plugin_user', $plugin_user, '', 15, 60, true);
|
||||
$table->data[1][1] = html_print_input_text(
|
||||
'plugin_user',
|
||||
$plugin_user,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][2] = '<b>'.__('Password').'</b>';
|
||||
$table->data[1][3] = html_print_input_password('plugin_pass', $plugin_pass, '', 15, 60, true);
|
||||
$table->data[1][3] = html_print_input_password(
|
||||
'plugin_pass',
|
||||
$plugin_pass,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">'.html_print_image('images/spinner.gif', true).'</div>';
|
||||
$table->data[1][3] .= '<div id="spinner_modules" style="float: left; display: none;">
|
||||
'.html_print_image('images/spinner.gif', true).'</div>';
|
||||
html_print_input_hidden('wmiexplore', 1);
|
||||
|
||||
$servers_to_exec = [];
|
||||
|
@ -346,13 +470,27 @@ if (enterprise_installed()) {
|
|||
}
|
||||
|
||||
$table->data[2][0] = '<b>'.__('Server to execute command').'</b>';
|
||||
$table->data[2][1] = html_print_select($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true);
|
||||
$table->data[2][1] = html_print_select(
|
||||
$servers_to_exec,
|
||||
'server_to_exec',
|
||||
$server_to_exec,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
echo "<div style='text-align:right; width:".$table->width."'>";
|
||||
echo '<span id="oid_loading" class="invisible">'.html_print_image('images/spinner.gif', true).'</span>';
|
||||
html_print_submit_button(__('WMI Explore'), 'wmi_explore', false, ['class' => 'sub next']);
|
||||
echo '<span id="oid_loading" class="invisible">
|
||||
'.html_print_image('images/spinner.gif', true).'</span>';
|
||||
html_print_submit_button(
|
||||
__('WMI Explore'),
|
||||
'wmi_explore',
|
||||
false,
|
||||
['class' => 'sub next']
|
||||
);
|
||||
echo '</div><br>';
|
||||
|
||||
if ($wmiexplore && $fail) {
|
||||
|
@ -365,23 +503,25 @@ echo '</form>';
|
|||
|
||||
if ($wmiexplore && !$fail) {
|
||||
echo '<br><span id ="none_text" style="display: none;">'.__('None').'</span>';
|
||||
echo "<form method='post' action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente
|
||||
&tab=agent_wizard&wizard_section=wmi_explorer&id_agente=$id_agent'>";
|
||||
echo '<span id="form_interfaces">';
|
||||
|
||||
html_print_input_hidden('create_modules', 1);
|
||||
html_print_input_hidden('ip_target', $ip_target);
|
||||
// Host
|
||||
// Host.
|
||||
html_print_input_hidden('plugin_user', $plugin_user);
|
||||
// User
|
||||
// User.
|
||||
html_print_input_hidden('plugin_pass', $plugin_pass);
|
||||
// Password
|
||||
// Password.
|
||||
html_print_input_hidden('tcp_send', $tcp_send);
|
||||
// Namespace
|
||||
// Namespace.
|
||||
html_print_input_hidden('server_to_exec', $server_to_exec);
|
||||
|
||||
$table->width = '100%';
|
||||
|
||||
// Mode selector
|
||||
// Mode selector.
|
||||
$modes = [];
|
||||
$modes['services'] = __('Services');
|
||||
$modes['processes'] = __('Processes');
|
||||
|
@ -406,7 +546,7 @@ if ($wmiexplore && !$fail) {
|
|||
$table->data[1][2] = '<b>'.__('Modules').'</b>';
|
||||
$table->cellstyle[1][2] = 'text-align: center;';
|
||||
|
||||
// Components list
|
||||
// Components list.
|
||||
$table->data[2][0] = '<div class="wizard_mode_form wizard_mode_components">';
|
||||
$table->data[2][0] .= __('Filter by group').'<br>';
|
||||
$table->data[2][0] .= html_print_select(
|
||||
|
@ -439,7 +579,7 @@ if ($wmiexplore && !$fail) {
|
|||
);
|
||||
$table->data[2][0] .= '</div>';
|
||||
|
||||
// Services list
|
||||
// Services list.
|
||||
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_services">';
|
||||
$table->data[2][0] .= html_print_select(
|
||||
$services,
|
||||
|
@ -456,8 +596,7 @@ if ($wmiexplore && !$fail) {
|
|||
'width: 300px;'
|
||||
);
|
||||
$table->data[2][0] .= '</div>';
|
||||
|
||||
// Processes list
|
||||
// Processes list.
|
||||
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_processes">';
|
||||
$table->data[2][0] .= html_print_select(
|
||||
$processes,
|
||||
|
@ -474,11 +613,13 @@ if ($wmiexplore && !$fail) {
|
|||
'width: 300px;'
|
||||
);
|
||||
$table->data[2][0] .= '</div>';
|
||||
$table->data[2][0] .= '<span id="no_component" class="invisible error wizard_mode_form wizard_mode_components">';
|
||||
$table->data[2][0] .= '<span id="no_component"
|
||||
class="invisible error wizard_mode_form wizard_mode_components">';
|
||||
|
||||
$table->data[2][0] .= __('No component was found');
|
||||
$table->data[2][0] .= '</span>';
|
||||
|
||||
// Disks list
|
||||
// Disks list.
|
||||
$table->data[2][0] .= '<div class="wizard_mode_form wizard_mode_disks">';
|
||||
$table->data[2][0] .= html_print_select(
|
||||
$disks,
|
||||
|
@ -498,27 +639,79 @@ if ($wmiexplore && !$fail) {
|
|||
$table->cellstyle[2][0] = 'vertical-align: bottom; text-align: center;';
|
||||
|
||||
|
||||
// Components arrow
|
||||
$table->data[2][1] = '<div class="wizard_mode_form wizard_mode_components wizard_mode_components_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>';
|
||||
// Services arrow
|
||||
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_services wizard_mode_services_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>';
|
||||
// Processes arrow
|
||||
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_processes wizard_mode_processes_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>';
|
||||
// Disks arrow
|
||||
$table->data[2][1] .= '<div class="wizard_mode_form wizard_mode_disks wizard_mode_disks_arrow clickable">'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'</div>';
|
||||
// Components arrow.
|
||||
$table->data[2][1] = '<div
|
||||
class="wizard_mode_form wizard_mode_components wizard_mode_components_arrow clickable">
|
||||
'.html_print_image(
|
||||
'images/darrowright.png',
|
||||
true,
|
||||
['title' => __('Add to modules list')]
|
||||
).'</div>';
|
||||
// Services arrow.
|
||||
$table->data[2][1] .= '<div
|
||||
class="wizard_mode_form wizard_mode_services wizard_mode_services_arrow clickable">
|
||||
'.html_print_image(
|
||||
'images/darrowright.png',
|
||||
true,
|
||||
['title' => __('Add to modules list')]
|
||||
).'</div>';
|
||||
// Processes arrow.
|
||||
$table->data[2][1] .= '<div
|
||||
class="wizard_mode_form wizard_mode_processes wizard_mode_processes_arrow clickable">
|
||||
'.html_print_image(
|
||||
'images/darrowright.png',
|
||||
true,
|
||||
['title' => __('Add to modules list')]
|
||||
).'</div>';
|
||||
// Disks arrow.
|
||||
$table->data[2][1] .= '<div
|
||||
class="wizard_mode_form wizard_mode_disks wizard_mode_disks_arrow clickable">
|
||||
'.html_print_image(
|
||||
'images/darrowright.png',
|
||||
true,
|
||||
['title' => __('Add to modules list')]
|
||||
).'</div>';
|
||||
|
||||
|
||||
$table->data[2][1] .= '<br><br><div class="wizard_mode_delete_arrow clickable">'.html_print_image('images/cross.png', true, ['title' => __('Remove from modules list')]).'</div>';
|
||||
$table->data[2][1] .= '<br><br>
|
||||
<div class="wizard_mode_delete_arrow clickable">
|
||||
'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
['title' => __('Remove from modules list')]
|
||||
).'</div>';
|
||||
$table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;';
|
||||
|
||||
$table->data[2][2] = html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px; height: 100%;');
|
||||
$table->data[2][2] .= html_print_input_hidden('agent', $id_agent, true);
|
||||
$table->data[2][2] = html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:300px; height: 100%;'
|
||||
);
|
||||
$table->data[2][2] .= html_print_input_hidden(
|
||||
'agent',
|
||||
$id_agent,
|
||||
true
|
||||
);
|
||||
$table->cellstyle[2][2] = 'vertical-align: top; text-align: center;';
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
echo "<div style='text-align:right; width:".$table->width."'>";
|
||||
html_print_submit_button(__('Create modules'), 'create_modules_btn', false, ['class' => 'sub add']);
|
||||
html_print_submit_button(
|
||||
__('Create modules'),
|
||||
'create_modules_btn',
|
||||
false,
|
||||
['class' => 'sub add']
|
||||
);
|
||||
echo '</div>';
|
||||
unset($table);
|
||||
|
||||
|
@ -650,5 +843,4 @@ $(document).ready (function () {
|
|||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
</script>
|
|
@ -486,6 +486,7 @@ if ($id_agente) {
|
|||
$agent_wizard['active'] = false;
|
||||
}
|
||||
|
||||
|
||||
$total_incidents = agents_get_count_incidents($id_agente);
|
||||
|
||||
// Incident tab.
|
||||
|
@ -546,6 +547,7 @@ if ($id_agente) {
|
|||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -696,25 +698,28 @@ if ($id_agente) {
|
|||
break;
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
agents_get_alias($id_agente),
|
||||
'images/setup.png',
|
||||
false,
|
||||
$help_header,
|
||||
true,
|
||||
$onheader,
|
||||
false,
|
||||
'',
|
||||
$config['item_title_size_text'],
|
||||
'',
|
||||
ui_print_breadcrums(
|
||||
[
|
||||
__('Resources'),
|
||||
__('Manage agents'),
|
||||
'<span class="breadcrumb_active">'.$tab_name.'</span>',
|
||||
]
|
||||
)
|
||||
);
|
||||
$pure = get_parameter('pure', 0);
|
||||
if (!$pure) {
|
||||
ui_print_page_header(
|
||||
agents_get_alias($id_agente),
|
||||
'images/setup.png',
|
||||
false,
|
||||
$help_header,
|
||||
true,
|
||||
$onheader,
|
||||
false,
|
||||
'',
|
||||
$config['item_title_size_text'],
|
||||
'',
|
||||
ui_print_breadcrums(
|
||||
[
|
||||
__('Resources'),
|
||||
__('Manage agents'),
|
||||
'<span class="breadcrumb_active">'.$tab_name.'</span>',
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Create agent.
|
||||
ui_print_page_header(
|
||||
|
@ -1330,7 +1335,7 @@ if ($update_module || $create_module) {
|
|||
// Change double quotes by single.
|
||||
$snmp_oid = preg_replace('/"/', ''', $snmp_oid);
|
||||
|
||||
if (empty($snmp_oid)) {
|
||||
if (empty($snmp_oid) === true) {
|
||||
// The user did not set any OID manually but did a SNMP walk.
|
||||
$snmp_oid = (string) get_parameter('select_snmp_oid');
|
||||
}
|
||||
|
@ -1339,18 +1344,30 @@ if ($update_module || $create_module) {
|
|||
// New support for snmp v3.
|
||||
$tcp_send = (string) get_parameter('snmp_version');
|
||||
$plugin_user = (string) get_parameter('snmp3_auth_user');
|
||||
$plugin_pass = io_input_password((string) get_parameter('snmp3_auth_pass'));
|
||||
$plugin_pass = io_input_password(
|
||||
(string) get_parameter('snmp3_auth_pass')
|
||||
);
|
||||
$plugin_parameter = (string) get_parameter('snmp3_auth_method');
|
||||
|
||||
$custom_string_1 = (string) get_parameter('snmp3_privacy_method');
|
||||
$custom_string_2 = io_input_password((string) get_parameter('snmp3_privacy_pass'));
|
||||
$custom_string_2 = io_input_password(
|
||||
(string) get_parameter('snmp3_privacy_pass')
|
||||
);
|
||||
$custom_string_3 = (string) get_parameter('snmp3_security_level');
|
||||
} else if ($id_module_type >= 34 && $id_module_type <= 37) {
|
||||
$tcp_send = (string) get_parameter('command_text');
|
||||
$custom_string_1 = (string) get_parameter(
|
||||
'command_credential_identifier'
|
||||
);
|
||||
$custom_string_2 = (string) get_parameter('command_os');
|
||||
} else {
|
||||
$plugin_user = (string) get_parameter('plugin_user');
|
||||
if (get_parameter('id_module_component_type') == 7) {
|
||||
$plugin_pass = (int) get_parameter('plugin_pass');
|
||||
} else {
|
||||
$plugin_pass = io_input_password((string) get_parameter('plugin_pass'));
|
||||
$plugin_pass = io_input_password(
|
||||
(string) get_parameter('plugin_pass')
|
||||
);
|
||||
}
|
||||
|
||||
$plugin_parameter = (string) get_parameter('plugin_parameter');
|
||||
|
@ -1382,8 +1399,8 @@ if ($update_module || $create_module) {
|
|||
$ff_event_normal = (int) get_parameter('ff_event_normal');
|
||||
$ff_event_warning = (int) get_parameter('ff_event_warning');
|
||||
$ff_event_critical = (int) get_parameter('ff_event_critical');
|
||||
$ff_type = (int) get_parameter('ff_type');
|
||||
$each_ff = (int) get_parameter('each_ff');
|
||||
$ff_type = (int) get_parameter('ff_type', $module['ff_type']);
|
||||
$each_ff = (int) get_parameter('each_ff', $module['each_ff']);
|
||||
$ff_timeout = (int) get_parameter('ff_timeout');
|
||||
$unit = (string) get_parameter('unit');
|
||||
$id_tag = (array) get_parameter('id_tag_selected');
|
||||
|
@ -2266,6 +2283,10 @@ if ($updateGIS) {
|
|||
// -----------------------------------
|
||||
// Load page depending on tab selected
|
||||
// -----------------------------------
|
||||
if ($_SESSION['create_module'] && $config['welcome_state'] == 1) {
|
||||
$edit_module = true;
|
||||
}
|
||||
|
||||
switch ($tab) {
|
||||
case 'main':
|
||||
include 'agent_manager.php';
|
||||
|
|
|
@ -126,7 +126,7 @@ if ($fields) {
|
|||
$table->size[3] = '8%';
|
||||
$table->data = [];
|
||||
} else {
|
||||
include_once $config['homedir'].'/general/firts_task/fields_manager.php';
|
||||
include_once $config['homedir'].'/general/first_task/fields_manager.php';
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// Load global vars
|
||||
check_login();
|
||||
|
||||
// Take some parameters (GET)
|
||||
// Take some parameters (GET).
|
||||
$offset = (int) get_parameter('offset');
|
||||
$group_id = (int) get_parameter('group_id');
|
||||
$ag_group = get_parameter('ag_group_refresh', -1);
|
||||
|
@ -47,10 +47,10 @@ require_once 'include/functions_users.php';
|
|||
|
||||
$search = get_parameter('search', '');
|
||||
|
||||
// Prepare the tab system to the future
|
||||
// Prepare the tab system to the future.
|
||||
$tab = 'view';
|
||||
|
||||
// Setup tab
|
||||
// Setup tab.
|
||||
$viewtab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente">'.html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>';
|
||||
|
||||
$viewtab['operation'] = true;
|
||||
|
@ -59,10 +59,10 @@ $viewtab['active'] = false;
|
|||
|
||||
$onheader = ['view' => $viewtab];
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(__('Agents defined in %s', get_product_name()), 'images/agent_mc.png', false, '', true, $onheader);
|
||||
|
||||
// Perform actions
|
||||
// Perform actions.
|
||||
$agent_to_delete = (int) get_parameter('borrar_agente');
|
||||
$enable_agent = (int) get_parameter('enable_agent');
|
||||
$disable_agent = (int) get_parameter('disable_agent');
|
||||
|
@ -99,7 +99,7 @@ if ($agent_to_delete) {
|
|||
ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.'));
|
||||
|
||||
if (enterprise_installed()) {
|
||||
// Check if the remote config file still exist
|
||||
// Check if the remote config file still exist.
|
||||
if (isset($config['remote_config'])) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
if (enterprise_hook('config_agents_has_remote_configuration', [$id_agente])) {
|
||||
|
@ -114,7 +114,7 @@ if ($enable_agent) {
|
|||
$alias = agents_get_alias($enable_agent);
|
||||
|
||||
if ($result) {
|
||||
// Update the agent from the metaconsole cache
|
||||
// Update the agent from the metaconsole cache.
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
$values = ['disabled' => 0];
|
||||
enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]);
|
||||
|
@ -136,7 +136,7 @@ if ($disable_agent) {
|
|||
$alias = agents_get_alias($disable_agent);
|
||||
|
||||
if ($result) {
|
||||
// Update the agent from the metaconsole cache
|
||||
// Update the agent from the metaconsole cache.
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
$values = ['disabled' => 1];
|
||||
enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]);
|
||||
|
@ -223,6 +223,10 @@ switch ($config['dbtype']) {
|
|||
case 'oracle':
|
||||
$order_collation = '';
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
$selected = true;
|
||||
|
@ -252,6 +256,10 @@ switch ($sortField) {
|
|||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -274,6 +282,10 @@ switch ($sortField) {
|
|||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -296,6 +308,10 @@ switch ($sortField) {
|
|||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -318,6 +334,10 @@ switch ($sortField) {
|
|||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -378,7 +398,7 @@ if ($os != 0) {
|
|||
}
|
||||
|
||||
$user_groups_to_sql = '';
|
||||
// Show only selected groups
|
||||
// Show only selected groups.
|
||||
if ($ag_group > 0) {
|
||||
$ag_groups = [];
|
||||
$ag_groups = (array) $ag_group;
|
||||
|
@ -388,7 +408,7 @@ if ($ag_group > 0) {
|
|||
|
||||
$user_groups_to_sql = implode(',', $ag_groups);
|
||||
} else {
|
||||
// Concatenate AW and AD permisions to get all the possible groups where the user can manage
|
||||
// Concatenate AW and AD permisions to get all the possible groups where the user can manage.
|
||||
$user_groupsAW = users_get_groups($config['id_user'], 'AW');
|
||||
$user_groupsAD = users_get_groups($config['id_user'], 'AD');
|
||||
|
||||
|
@ -431,24 +451,25 @@ $sql = sprintf(
|
|||
|
||||
$agents = db_get_all_rows_sql($sql);
|
||||
|
||||
// Delete rnum row generated by oracle_recode_query() function
|
||||
// Delete rnum row generated by oracle_recode_query() function.
|
||||
if (($config['dbtype'] == 'oracle') && ($agents !== false)) {
|
||||
for ($i = 0; $i < count($agents); $i++) {
|
||||
unset($agents[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare pagination
|
||||
// Prepare pagination.
|
||||
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
|
||||
|
||||
if ($agents !== false) {
|
||||
// Urls to sort the table.
|
||||
// Agent name size and description for Chinese and Japanese languages are adjusted
|
||||
$agent_font_size = '7';
|
||||
$description_font_size = '6.5';
|
||||
if ($config['language'] == 'ja' || $config['language'] == 'zh_CN' || $own_info['language'] == 'ja' || $own_info['language'] == 'zh_CN') {
|
||||
$agent_font_size = '15';
|
||||
$description_font_size = '11';
|
||||
if ($config['language'] == 'ja'
|
||||
|| $config['language'] == 'zh_CN'
|
||||
|| $own_info['language'] == 'ja'
|
||||
|| $own_info['language'] == 'zh_CN'
|
||||
) {
|
||||
// Adds a custom font size for Japanese and Chinese language.
|
||||
$custom_font_size = 'custom_font_size';
|
||||
}
|
||||
|
||||
$url_up_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled';
|
||||
|
@ -476,21 +497,21 @@ if ($agents !== false) {
|
|||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
foreach ($agents as $agent) {
|
||||
// Begin Update tagente.remote 0/1 with remote agent function return
|
||||
// Begin Update tagente.remote 0/1 with remote agent function return.
|
||||
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
|
||||
db_process_sql_update('tagente', ['remote' => 1], 'id_agente = '.$agent['id_agente'].'');
|
||||
} else {
|
||||
db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].'');
|
||||
}
|
||||
|
||||
// End Update tagente.remote 0/1 with remote agent function return
|
||||
// End Update tagente.remote 0/1 with remote agent function return.
|
||||
$all_groups = agents_get_all_groups_agent($agent['id_agente'], $agent['id_grupo']);
|
||||
$check_aw = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW');
|
||||
$check_ad = check_acl_one_of_groups($config['id_user'], $all_groups, 'AD');
|
||||
|
||||
$cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']);
|
||||
|
||||
// Do not show the agent if there is not enough permissions
|
||||
// Do not show the agent if there is not enough permissions.
|
||||
if (!$check_aw && !$check_ad) {
|
||||
continue;
|
||||
}
|
||||
|
@ -512,7 +533,7 @@ if ($agents !== false) {
|
|||
|
||||
$rowPair = !$rowPair;
|
||||
$iterator++;
|
||||
// Agent name
|
||||
// Agent name.
|
||||
echo "<tr class='$rowclass'><td class='$tdcolor' width='40%'>";
|
||||
if ($agent['disabled']) {
|
||||
echo '<em>';
|
||||
|
@ -537,7 +558,7 @@ if ($agents !== false) {
|
|||
} else {
|
||||
echo '<a alt ='.$agent['nombre']." href='index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=$main_tab&
|
||||
id_agente=".$agent['id_agente']."'>".'<span style="font-size: '.$agent_font_size.'pt" title="'.$agent['nombre'].'">'.$agent['alias'].'</span>'.'</a>';
|
||||
id_agente=".$agent['id_agente']."'>".'<span class="'.$custom_font_size.' title ="'.$agent['nombre'].'">'.$agent['alias'].'</span>'.'</a>';
|
||||
}
|
||||
|
||||
echo '</strong>';
|
||||
|
@ -617,12 +638,12 @@ if ($agents !== false) {
|
|||
|
||||
echo '</td>';
|
||||
|
||||
// Operating System icon
|
||||
// Operating System icon.
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>";
|
||||
ui_print_os_icon($agent['id_os'], false);
|
||||
echo '</td>';
|
||||
|
||||
// Type agent (Networt, Software or Satellite)
|
||||
// Type agent (Networt, Software or Satellite).
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>";
|
||||
echo ui_print_type_agent_icon(
|
||||
$agent['id_os'],
|
||||
|
@ -634,10 +655,12 @@ if ($agents !== false) {
|
|||
echo '</td>';
|
||||
|
||||
|
||||
// Group icon and name
|
||||
// Group icon and name.
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>".ui_print_group_icon($agent['id_grupo'], true).'</td>';
|
||||
// Description
|
||||
echo "<td class='".$tdcolor."f9'>".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[…]', 'font-size: '.$description_font_size.'pt;').'</td>';
|
||||
|
||||
// Description.
|
||||
echo "<td class='".$tdcolor."f9'><span class='".$custom_font_size."'>".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[…]').'</span></td>';
|
||||
|
||||
// Action
|
||||
// When there is only one element in page it's necesary go back page.
|
||||
if ((count($agents) == 1) && ($offset >= $config['block_size'])) {
|
||||
|
@ -695,7 +718,7 @@ if ($agents !== false) {
|
|||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
// Create agent button
|
||||
// Create agent button.
|
||||
echo '<div style="text-align: right;">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
html_print_input_hidden('new_agent', 1);
|
||||
|
|
|
@ -842,7 +842,9 @@ foreach ($modules as $module) {
|
|||
$module['str_warning'],
|
||||
$module['max_critical'],
|
||||
$module['min_critical'],
|
||||
$module['str_critical']
|
||||
$module['str_critical'],
|
||||
$module['warning_inverse'],
|
||||
$module['critical_inverse']
|
||||
);
|
||||
} else {
|
||||
$data[7] = '';
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Modules
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
require_once 'include/functions_network_components.php';
|
||||
enterprise_include_once('include/functions_local_components.php');
|
||||
|
||||
|
@ -19,18 +35,65 @@ if (is_ajax()) {
|
|||
$snmp_walk = (bool) get_parameter('snmp_walk');
|
||||
$get_module_component = (bool) get_parameter('get_module_component');
|
||||
$get_module_components = (bool) get_parameter('get_module_components');
|
||||
$get_module_local_components = (bool) get_parameter('get_module_local_components');
|
||||
$get_module_local_component = (bool) get_parameter('get_module_local_component');
|
||||
$get_module_local_components = (bool) get_parameter(
|
||||
'get_module_local_components'
|
||||
);
|
||||
$get_module_local_component = (bool) get_parameter(
|
||||
'get_module_local_component'
|
||||
);
|
||||
|
||||
if ($get_module_component) {
|
||||
$id_component = (int) get_parameter('id_module_component');
|
||||
|
||||
$component = db_get_row('tnetwork_component', 'id_nc', $id_component);
|
||||
|
||||
$component['throw_unknown_events'] = network_components_is_disable_type_event($id_component, EVENTS_GOING_UNKNOWN);
|
||||
$component['throw_unknown_events'] = network_components_is_disable_type_event(
|
||||
$id_component,
|
||||
EVENTS_GOING_UNKNOWN
|
||||
);
|
||||
|
||||
// Decrypt passwords in the component.
|
||||
$component['plugin_pass'] = io_output_password($component['plugin_pass']);
|
||||
$component['plugin_pass'] = io_output_password(
|
||||
$component['plugin_pass']
|
||||
);
|
||||
|
||||
if ($component['type'] >= 15
|
||||
&& $component['type'] <= 18
|
||||
) {
|
||||
// New support for snmp v3.
|
||||
$component['snmp_version'] = $component['tcp_send'];
|
||||
$component['snmp3_auth_user'] = io_safe_output(
|
||||
$component['plugin_user']
|
||||
);
|
||||
// Must use io_output_password.
|
||||
$component['snmp3_auth_pass'] = io_safe_output(
|
||||
$component['plugin_pass']
|
||||
);
|
||||
$component['snmp3_auth_method'] = io_safe_output(
|
||||
$component['plugin_parameter']
|
||||
);
|
||||
$component['snmp3_privacy_method'] = io_safe_output(
|
||||
$component['custom_string_1']
|
||||
);
|
||||
$component['snmp3_privacy_pass'] = io_safe_output(
|
||||
$component['custom_string_2']
|
||||
);
|
||||
$component['snmp3_security_level'] = io_safe_output(
|
||||
$component['custom_string_3']
|
||||
);
|
||||
} else if ($component['type'] >= 34
|
||||
&& $component['type'] <= 37
|
||||
) {
|
||||
$component['command_text'] = io_safe_output(
|
||||
$component['tcp_send']
|
||||
);
|
||||
$component['command_credential_identifier'] = io_safe_output(
|
||||
$component['custom_string_1']
|
||||
);
|
||||
$component['command_os'] = io_safe_output(
|
||||
$component['custom_string_2']
|
||||
);
|
||||
}
|
||||
|
||||
$component['str_warning'] = io_safe_output($component['str_warning']);
|
||||
$component['str_critical'] = io_safe_output($component['str_critical']);
|
||||
|
@ -83,33 +146,29 @@ if (is_ajax()) {
|
|||
|
||||
$component = db_get_row('tlocal_component', 'id', $id_component);
|
||||
foreach ($component as $index => $element) {
|
||||
$component[$index] = html_entity_decode($element, ENT_QUOTES, 'UTF-8');
|
||||
$component[$index] = html_entity_decode(
|
||||
$element,
|
||||
ENT_QUOTES,
|
||||
'UTF-8'
|
||||
);
|
||||
}
|
||||
|
||||
$typeName = local_components_parse_module_extract_value('module_type', $component['data']);
|
||||
$typeName = local_components_parse_module_extract_value(
|
||||
'module_type',
|
||||
$component['data']
|
||||
);
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$component['type'] = db_get_value_sql(
|
||||
'
|
||||
SELECT id_tipo
|
||||
FROM ttipo_modulo
|
||||
WHERE nombre LIKE "'.$typeName.'"'
|
||||
);
|
||||
break;
|
||||
$component['type'] = db_get_value_sql(
|
||||
'
|
||||
SELECT id_tipo
|
||||
FROM ttipo_modulo
|
||||
WHERE nombre LIKE "'.$typeName.'"'
|
||||
);
|
||||
|
||||
case 'postgresql':
|
||||
case 'oracle':
|
||||
$component['type'] = db_get_value_sql(
|
||||
'
|
||||
SELECT id_tipo
|
||||
FROM ttipo_modulo
|
||||
WHERE nombre LIKE \''.$typeName.'\''
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
$component['throw_unknown_events'] = !local_components_is_disable_type_event($id_component, EVENTS_GOING_UNKNOWN);
|
||||
$component['throw_unknown_events'] = !local_components_is_disable_type_event(
|
||||
$id_component,
|
||||
EVENTS_GOING_UNKNOWN
|
||||
);
|
||||
|
||||
echo io_json_mb_encode($component);
|
||||
return;
|
||||
|
@ -136,7 +195,9 @@ if (is_ajax()) {
|
|||
$snmp3_auth_method = get_parameter('snmp3_auth_method');
|
||||
$snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass'));
|
||||
$snmp3_privacy_method = get_parameter('snmp3_privacy_method');
|
||||
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass'));
|
||||
$snmp3_privacy_pass = io_safe_output(
|
||||
get_parameter('snmp3_privacy_pass')
|
||||
);
|
||||
$snmp_port = get_parameter('snmp_port');
|
||||
|
||||
$snmpwalk = get_snmpwalk(
|
||||
|
@ -177,7 +238,7 @@ require_once 'include/functions_exportserver.php';
|
|||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
|
||||
// Reading a module
|
||||
// Reading a module.
|
||||
if ($id_agent_module) {
|
||||
$module = modules_get_agentmodule($id_agent_module);
|
||||
$moduletype = $module['id_modulo'];
|
||||
|
@ -202,19 +263,25 @@ if ($id_agent_module) {
|
|||
$snmp_community = $module['snmp_community'];
|
||||
$snmp_oid = $module['snmp_oid'];
|
||||
|
||||
// New support for snmp v3
|
||||
// New support for snmp v3.
|
||||
$snmp_version = $module['tcp_send'];
|
||||
$snmp3_auth_user = $module['plugin_user'];
|
||||
$snmp3_auth_pass = io_output_password($module['plugin_pass']);
|
||||
|
||||
// Auth method could be MD5 or SHA
|
||||
// Auth method could be MD5 or SHA.
|
||||
$snmp3_auth_method = $module['plugin_parameter'];
|
||||
|
||||
// Privacy method could be DES or AES
|
||||
// Privacy method could be DES or AES.
|
||||
$snmp3_privacy_method = $module['custom_string_1'];
|
||||
$snmp3_privacy_pass = io_output_password($module['custom_string_2']);
|
||||
|
||||
// Security level Could be noAuthNoPriv | authNoPriv | authPriv
|
||||
// For Remote cmd fields are reused:
|
||||
// tcp_send, custom_string_1, custom_string_2.
|
||||
$command_text = $module['tcp_send'];
|
||||
$command_credential_identifier = $module['custom_string_1'];
|
||||
$command_os = $module['custom_string_2'];
|
||||
|
||||
// Security level Could be noAuthNoPriv | authNoPriv | authPriv.
|
||||
$snmp3_security_level = $module['custom_string_3'];
|
||||
|
||||
$ip_target = $module['ip_target'];
|
||||
|
@ -265,39 +332,39 @@ if ($id_agent_module) {
|
|||
$id_category = $module['id_category'];
|
||||
|
||||
$cron_interval = explode(' ', $module['cron_interval']);
|
||||
if (isset($cron_interval[4])) {
|
||||
if (isset($cron_interval[4]) === true) {
|
||||
$minute_from = $cron_interval[0];
|
||||
$minute = explode('-', $minute_from);
|
||||
$minute_from = $minute[0];
|
||||
if (isset($minute[1])) {
|
||||
if (isset($minute[1]) === true) {
|
||||
$minute_to = $minute[1];
|
||||
}
|
||||
|
||||
$hour_from = $cron_interval[1];
|
||||
$h = explode('-', $hour_from);
|
||||
$hour_from = $h[0];
|
||||
if (isset($h[1])) {
|
||||
if (isset($h[1]) === true) {
|
||||
$hour_to = $h[1];
|
||||
}
|
||||
|
||||
$mday_from = $cron_interval[2];
|
||||
$md = explode('-', $mday_from);
|
||||
$mday_from = $md[0];
|
||||
if (isset($md[1])) {
|
||||
if (isset($md[1]) === true) {
|
||||
$mday_to = $md[1];
|
||||
}
|
||||
|
||||
$month_from = $cron_interval[3];
|
||||
$m = explode('-', $month_from);
|
||||
$month_from = $m[0];
|
||||
if (isset($m[1])) {
|
||||
if (isset($m[1]) === true) {
|
||||
$month_to = $m[1];
|
||||
}
|
||||
|
||||
$wday_from = $cron_interval[4];
|
||||
$wd = explode('-', $wday_from);
|
||||
$wday_from = $wd[0];
|
||||
if (isset($wd[1])) {
|
||||
if (isset($wd[1]) === true) {
|
||||
$wday_to = $wd[1];
|
||||
}
|
||||
} else {
|
||||
|
@ -315,14 +382,20 @@ if ($id_agent_module) {
|
|||
}
|
||||
|
||||
$module_macros = null;
|
||||
if (isset($module['module_macros'])) {
|
||||
$module_macros = json_decode(base64_decode($module['module_macros']), true);
|
||||
if (isset($module['module_macros']) === true) {
|
||||
$module_macros = json_decode(
|
||||
base64_decode($module['module_macros']),
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (!isset($moduletype)) {
|
||||
if (isset($moduletype) === false) {
|
||||
$moduletype = (string) get_parameter('moduletype');
|
||||
if ($_SESSION['create_module'] && $config['welcome_state'] == 1) {
|
||||
$moduletype = 'networkserver';
|
||||
}
|
||||
|
||||
// Clean up specific network modules fields
|
||||
// Clean up specific network modules fields.
|
||||
$name = '';
|
||||
$description = '';
|
||||
$id_module_group = 1;
|
||||
|
@ -374,7 +447,7 @@ if ($id_agent_module) {
|
|||
$str_critical = '';
|
||||
$ff_event = 0;
|
||||
|
||||
// New support for snmp v3
|
||||
// New support for snmp v3.
|
||||
$snmp_version = 1;
|
||||
$snmp3_auth_user = '';
|
||||
$snmp3_auth_pass = '';
|
||||
|
@ -383,6 +456,11 @@ if ($id_agent_module) {
|
|||
$snmp3_privacy_pass = '';
|
||||
$snmp3_security_level = '';
|
||||
|
||||
// For Remote CMD.
|
||||
$command_text = '';
|
||||
$command_credential_identifier = '';
|
||||
$command_os = '';
|
||||
|
||||
$critical_instructions = '';
|
||||
$warning_instructions = '';
|
||||
$unknown_instructions = '';
|
||||
|
@ -418,7 +496,9 @@ if ($id_agent_module) {
|
|||
}
|
||||
}
|
||||
|
||||
$is_function_policies = enterprise_include_once('include/functions_policies.php');
|
||||
$is_function_policies = enterprise_include_once(
|
||||
'include/functions_policies.php'
|
||||
);
|
||||
|
||||
if ($is_function_policies !== ENTERPRISE_NOT_HOOK) {
|
||||
$relink_policy = get_parameter('relink_policy', 0);
|
||||
|
@ -428,19 +508,32 @@ if ($is_function_policies !== ENTERPRISE_NOT_HOOK) {
|
|||
$policy_info = policies_info_module_policy($id_agent_module);
|
||||
$policy_id = $policy_info['id_policy'];
|
||||
|
||||
if ($relink_policy && policies_get_policy_queue_status($policy_id) == STATUS_IN_QUEUE_APPLYING) {
|
||||
ui_print_error_message(__('This policy is applying and cannot be modified'));
|
||||
if ($relink_policy
|
||||
&& policies_get_policy_queue_status($policy_id) == STATUS_IN_QUEUE_APPLYING
|
||||
) {
|
||||
ui_print_error_message(
|
||||
__('This policy is applying and cannot be modified')
|
||||
);
|
||||
} else {
|
||||
$result = policies_relink_module($id_agent_module);
|
||||
ui_print_result_message($result, __('Module will be linked in the next application'));
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Module will be linked in the next application')
|
||||
);
|
||||
|
||||
db_pandora_audit('Agent management', 'Re-link module '.$id_agent_module);
|
||||
db_pandora_audit(
|
||||
'Agent management',
|
||||
'Re-link module '.$id_agent_module
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($unlink_policy) {
|
||||
$result = policies_unlink_module($id_agent_module);
|
||||
ui_print_result_message($result, __('Module will be unlinked in the next application'));
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Module will be unlinked in the next application')
|
||||
);
|
||||
|
||||
db_pandora_audit('Agent management', 'Unlink module '.$id_agent_module);
|
||||
}
|
||||
|
@ -452,7 +545,7 @@ $remote_conf = false;
|
|||
|
||||
if ($__code_from !== 'policies') {
|
||||
// Only check in the module editor.
|
||||
// Check ACL tags
|
||||
// Check ACL tags.
|
||||
$tag_acl = true;
|
||||
|
||||
// If edit a existing module.
|
||||
|
@ -479,12 +572,12 @@ switch ($moduletype) {
|
|||
$remote_conf = false;
|
||||
if (enterprise_installed()) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
$remote_conf = enterprise_hook('config_agents_has_remote_configuration', [$id_agente]);
|
||||
$remote_conf = enterprise_hook(
|
||||
'config_agents_has_remote_configuration',
|
||||
[$id_agente]
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Categories is an array containing the allowed module types
|
||||
(generic_data, generic_string, etc) from ttipo_modulo (field categoria) */
|
||||
$categories = [
|
||||
0,
|
||||
1,
|
||||
|
@ -503,12 +596,16 @@ switch ($moduletype) {
|
|||
'config_agents_get_module_from_conf',
|
||||
[
|
||||
$id_agente,
|
||||
io_safe_output(modules_get_agentmodule_name($id_agent_module)),
|
||||
io_safe_output(
|
||||
modules_get_agentmodule_name($id_agent_module)
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
enterprise_include('godmode/agentes/module_manager_editor_data.php');
|
||||
enterprise_include(
|
||||
'godmode/agentes/module_manager_editor_data.php'
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -520,6 +617,10 @@ switch ($moduletype) {
|
|||
4,
|
||||
5,
|
||||
];
|
||||
if (enterprise_installed()) {
|
||||
$categories[] = 10;
|
||||
}
|
||||
|
||||
include 'module_manager_editor_common.php';
|
||||
include 'module_manager_editor_network.php';
|
||||
break;
|
||||
|
@ -562,9 +663,12 @@ switch ($moduletype) {
|
|||
include 'module_manager_editor_wmi.php';
|
||||
break;
|
||||
|
||||
// WARNING: type 7 is reserved on enterprise
|
||||
// WARNING: type 7 is reserved on enterprise.
|
||||
default:
|
||||
if (enterprise_include('godmode/agentes/module_manager_editor.php') === ENTERPRISE_NOT_HOOK) {
|
||||
if (enterprise_include(
|
||||
'godmode/agentes/module_manager_editor.php'
|
||||
) === ENTERPRISE_NOT_HOOK
|
||||
) {
|
||||
ui_print_error_message(sprintf(__('Invalid module type')));
|
||||
return;
|
||||
}
|
||||
|
@ -580,7 +684,7 @@ if ($config['enterprise_installed'] && $id_agent_module) {
|
|||
|
||||
echo '<h3 id="message" class="error invisible"></h3>';
|
||||
|
||||
// TODO: Change to the ui_print_error system
|
||||
// TODO: Change to the ui_print_error system.
|
||||
echo '<form method="post" id="module_form">';
|
||||
|
||||
ui_toggle(
|
||||
|
@ -602,12 +706,18 @@ ui_toggle(
|
|||
|
||||
if ($moduletype != 13) {
|
||||
ui_toggle(
|
||||
html_print_table($table_new_relations, true).html_print_table($table_relations, true),
|
||||
html_print_table(
|
||||
$table_new_relations,
|
||||
true
|
||||
).html_print_table(
|
||||
$table_relations,
|
||||
true
|
||||
),
|
||||
__('Module relations')
|
||||
);
|
||||
}
|
||||
|
||||
// Submit
|
||||
// Submit.
|
||||
echo '<div class="action-buttons" style="width: '.$table_simple->width.'">';
|
||||
if ($id_agent_module) {
|
||||
html_print_submit_button(
|
||||
|
@ -659,38 +769,84 @@ ui_require_javascript_file('pandora_modules');
|
|||
<script language="javascript">
|
||||
/* <![CDATA[ */
|
||||
var no_name_lang =`
|
||||
<?php echo ui_print_info_message(['no_close' => true, 'message' => __('No module name provided') ]); ?>
|
||||
<?php
|
||||
echo ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('No module name provided'),
|
||||
]
|
||||
);
|
||||
?>
|
||||
`;
|
||||
var no_target_lang =`
|
||||
<?php echo ui_print_info_message(['no_close' => true, 'message' => __('No target IP provided') ]); ?>
|
||||
<?php
|
||||
echo ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('No target IP provided'),
|
||||
]
|
||||
);
|
||||
?>
|
||||
`;
|
||||
var no_oid_lang =`
|
||||
<?php echo ui_print_info_message(['no_close' => true, 'message' => __('No SNMP OID provided') ]); ?>
|
||||
<?php
|
||||
echo ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('No SNMP OID provided'),
|
||||
]
|
||||
);
|
||||
?>
|
||||
`;
|
||||
var no_prediction_module_lang =`
|
||||
<?php echo ui_print_info_message(['no_close' => true, 'message' => __('No module to predict') ]); ?>
|
||||
<?php
|
||||
echo ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('No module to predict'),
|
||||
]
|
||||
);
|
||||
?>
|
||||
`;
|
||||
var no_plugin_lang =`
|
||||
<?php echo ui_print_info_message(['no_close' => true, 'message' => __('No plug-in provided') ]); ?>
|
||||
<?php
|
||||
echo ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('No plug-in provided'),
|
||||
]
|
||||
);
|
||||
?>
|
||||
`;
|
||||
var no_execute_test_from =`
|
||||
<?php echo ui_print_info_message(['no_close' => true, 'message' => __('No server provided') ]); ?>
|
||||
<?php
|
||||
echo ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('No server provided'),
|
||||
]
|
||||
);
|
||||
?>
|
||||
`;
|
||||
|
||||
$(document).ready (function () {
|
||||
configure_modules_form ();
|
||||
|
||||
$("#module_form").submit(function() {
|
||||
if (typeof(check_remote_conf) != 'undefined') {
|
||||
if (typeof(check_remote_conf) != 'undefined') {
|
||||
if (check_remote_conf) {
|
||||
//Check the name
|
||||
//Check the name.
|
||||
name = $("#text-name").val();
|
||||
remote_config = $("#textarea_configuration_data").val();
|
||||
|
||||
regexp_name = new RegExp('module_name\\s*' + name.replace(/([^0-9A-Za-z_])/g, "\\$1") +"\n");
|
||||
|
||||
|
||||
regexp_name = new RegExp(
|
||||
'module_name\\s*' + name.replace(/([^0-9A-Za-z_])/g,
|
||||
"\\$1"
|
||||
) +"\n"
|
||||
);
|
||||
|
||||
regexp_plugin = new RegExp('^module_plugin\\s*');
|
||||
|
||||
|
||||
if (remote_config == '' || remote_config.match(regexp_name) ||
|
||||
remote_config.match(regexp_plugin) ||
|
||||
$("#id_module_type").val()==100 ||
|
||||
|
@ -698,15 +854,15 @@ $(document).ready (function () {
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
alert("<?php echo __('Error, The field name and name in module_name in data configuration are different.'); ?>");
|
||||
alert ("<?php echo __('Error, The field name and name in module_name in data configuration are different.'); ?>");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
function checkKeepaliveModule() {
|
||||
// keepalive modules have id = 100
|
||||
if ($("#id_module_type").val()==100 ||
|
||||
|
@ -720,11 +876,10 @@ $(document).ready (function () {
|
|||
$("#simple-configuration_data").show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
checkKeepaliveModule();
|
||||
|
||||
|
||||
$("#id_module_type").change (function () {
|
||||
checkKeepaliveModule();
|
||||
});
|
||||
|
@ -741,11 +896,15 @@ function handleFileSelect() {
|
|||
err_msg_2 = "<?php echo __('Couldn`t find the fileinput element.'); ?>";
|
||||
err_msg_3 = "<?php echo __('This browser doesn`t seem to support the files property of file inputs.'); ?>";
|
||||
err_msg_4 = "<?php echo __('Please select a file before clicking Load'); ?>";
|
||||
|
||||
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
|
||||
|
||||
if (!window.File ||
|
||||
!window.FileReader ||
|
||||
!window.FileList ||
|
||||
!window.Blob
|
||||
) {
|
||||
$('#mssg_error_div').append(err_msg_1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
input = document.getElementById('file-file_html_text');
|
||||
|
||||
|
@ -756,7 +915,7 @@ function handleFileSelect() {
|
|||
$('#mssg_error_div').append(err_msg_3);
|
||||
}
|
||||
else if (!input.files[0]) {
|
||||
$('#mssg_error_div').append(err_msg_4);
|
||||
$('#mssg_error_div').append(err_msg_4);
|
||||
}
|
||||
else {
|
||||
file = input.files[0];
|
||||
|
@ -767,7 +926,9 @@ function handleFileSelect() {
|
|||
}
|
||||
|
||||
function receivedText() {
|
||||
document.getElementById('textarea_custom_string_1').appendChild(document.createTextNode(fr.result));
|
||||
}
|
||||
document
|
||||
.getElementById('textarea_custom_string_1')
|
||||
.appendChild(document.createTextNode(fr.result));
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -132,7 +132,7 @@ function add_component_selection($id_network_component_type)
|
|||
require_once 'include/functions_network_components.php';
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
|
||||
// If code comes from policies disable export select
|
||||
// If code comes from policies disable export select.
|
||||
global $__code_from;
|
||||
|
||||
$disabledBecauseInPolicy = false;
|
||||
|
@ -209,8 +209,7 @@ $table_simple->data[0][1] = html_print_input_text_extended(
|
|||
$largeClassDisabledBecauseInPolicy,
|
||||
true
|
||||
);
|
||||
// $table_simple->data[0][1] = html_print_input_text ('name',
|
||||
// io_safe_output($name), '', 45, 100, true, $disabledBecauseInPolicy);
|
||||
|
||||
if (!empty($id_agent_module) && isset($id_agente)) {
|
||||
$table_simple->data[0][1] .= ' <b>'.__('ID').'</b> '.$id_agent_module.' ';
|
||||
|
||||
|
@ -237,7 +236,13 @@ if ($policy_link != 0) {
|
|||
}
|
||||
|
||||
$table_simple->data[0][2] = __('Disabled');
|
||||
$table_simple->data[0][2] .= html_print_checkbox('disabled', 1, $disabled, true, $disabled_enable);
|
||||
$table_simple->data[0][2] .= html_print_checkbox(
|
||||
'disabled',
|
||||
1,
|
||||
$disabled,
|
||||
true,
|
||||
$disabled_enable
|
||||
);
|
||||
$table_simple->data[0][3] = __('Module group');
|
||||
$table_simple->data[0][3] .= html_print_select_from_sql(
|
||||
'SELECT id_mg, name FROM tmodule_group ORDER BY name',
|
||||
|
@ -260,12 +265,18 @@ if ((isset($id_agent_module) && $id_agent_module) || $id_policy_module != 0) {
|
|||
|
||||
$in_policy = strstr($page, 'policy_modules');
|
||||
if (!$in_policy) {
|
||||
// Cannot select the current module to be itself parent
|
||||
$module_parent_filter = $id_agent_module ? ['tagente_modulo.id_agente_modulo' => "<>$id_agent_module"] : '';
|
||||
// Cannot select the current module to be itself parent.
|
||||
$module_parent_filter = ($id_agent_module) ? ['tagente_modulo.id_agente_modulo' => "<>$id_agent_module"] : '';
|
||||
$table_simple->data[1][0] = __('Module parent');
|
||||
$modules_can_be_parent = agents_get_modules($id_agente, false, $module_parent_filter);
|
||||
// If the user cannot have access to parent module, only print the name
|
||||
if ($parent_module_id != 0 && !in_array($parent_module_id, array_keys($modules_can_be_parent))) {
|
||||
$modules_can_be_parent = agents_get_modules(
|
||||
$id_agente,
|
||||
false,
|
||||
$module_parent_filter
|
||||
);
|
||||
// If the user cannot have access to parent module, only print the name.
|
||||
if ($parent_module_id != 0
|
||||
&& !in_array($parent_module_id, array_keys($modules_can_be_parent))
|
||||
) {
|
||||
$table_simple->data[1][1] = db_get_value(
|
||||
'nombre',
|
||||
'tagente_modulo',
|
||||
|
@ -305,7 +316,11 @@ if (!$edit) {
|
|||
}
|
||||
|
||||
$table_simple->data[2][1] = '<em>'.modules_get_moduletype_description($id_module_type).' ('.$type_names_hash[$id_module_type].')</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_hidden('type_names', base64_encode(io_json_mb_encode($type_names_hash)), true);
|
||||
$table_simple->data[2][1] .= html_print_input_hidden(
|
||||
'type_names',
|
||||
base64_encode(io_json_mb_encode($type_names_hash)),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
if (isset($id_module_type)) {
|
||||
$idModuleType = $id_module_type;
|
||||
|
@ -313,20 +328,30 @@ if (!$edit) {
|
|||
$idModuleType = '';
|
||||
}
|
||||
|
||||
// Removed web analysis and log4x from select
|
||||
// Removed web analysis and log4x from select.
|
||||
$tipe_not_in = '24, 25';
|
||||
// TODO: FIX credential store for remote command in metaconsole.
|
||||
if (is_metaconsole()) {
|
||||
$tipe_not_in = '24, 25, 34, 35, 36, 37';
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'SELECT id_tipo, descripcion, nombre
|
||||
'SELECT id_tipo, descripcion, nombre, categoria
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria IN (%s) AND id_tipo NOT IN (24, 25)
|
||||
ORDER BY descripcion',
|
||||
implode(',', $categories)
|
||||
WHERE categoria IN (%s)
|
||||
AND id_tipo NOT IN (%s)
|
||||
ORDER BY id_tipo ASC',
|
||||
implode(',', $categories),
|
||||
$tipe_not_in
|
||||
);
|
||||
|
||||
$type_names = db_get_all_rows_sql($sql);
|
||||
|
||||
$type_names_hash = [];
|
||||
$type_description_hash = [];
|
||||
if (isset($type_names) && is_array($type_names)) {
|
||||
if (isset($type_names) === true
|
||||
&& is_array($type_names) === true
|
||||
) {
|
||||
foreach ($type_names as $tn) {
|
||||
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
|
||||
$type_description_hash[$tn['id_tipo']] = $tn['descripcion'];
|
||||
|
@ -342,7 +367,7 @@ if (!$edit) {
|
|||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
|
@ -350,8 +375,12 @@ if (!$edit) {
|
|||
100
|
||||
);
|
||||
|
||||
// Store the relation between id and name of the types on a hidden field
|
||||
$table_simple->data[2][1] .= html_print_input_hidden('type_names', base64_encode(io_json_mb_encode($type_names_hash)), true);
|
||||
// Store the relation between id and name of the types on a hidden field.
|
||||
$table_simple->data[2][1] .= html_print_input_hidden(
|
||||
'type_names',
|
||||
base64_encode(io_json_mb_encode($type_names_hash)),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($edit_module) {
|
||||
|
@ -380,15 +409,32 @@ if ($edit_module) {
|
|||
$help_header = 'webserver_module_tab';
|
||||
}
|
||||
|
||||
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_header, true);
|
||||
$table_simple->data[2][0] = __('Type').' ';
|
||||
$table_simple->data[2][0] .= ui_print_help_icon($help_header, true);
|
||||
}
|
||||
|
||||
if ($disabledBecauseInPolicy) {
|
||||
$table_simple->data[2][3] .= html_print_input_hidden('id_module_group', $id_module_group, true);
|
||||
$table_simple->data[2][3] .= html_print_input_hidden(
|
||||
'id_module_group',
|
||||
$id_module_group,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table_simple->data[3][0] = __('Dynamic Threshold Interval');
|
||||
$table_simple->data[3][1] = html_print_extended_select_for_time('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px', false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
|
||||
$table_simple->data[3][1] = html_print_extended_select_for_time(
|
||||
'dynamic_interval',
|
||||
$dynamic_interval,
|
||||
'',
|
||||
'None',
|
||||
'0',
|
||||
10,
|
||||
true,
|
||||
'width:150px',
|
||||
false,
|
||||
$classdisabledBecauseInPolicy,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image('images/cog.png', true, ['title' => __('Advanced options Dynamic Threshold')]).'</a>';
|
||||
if ($in_policy) {
|
||||
$table_simple->cellclass[2][2] = 'hide_dinamic';
|
||||
|
@ -1191,49 +1237,54 @@ $table_relations->data[-1][3] .= html_print_image('images/lock.png', true).'</a>
|
|||
$table_relations->data[-1][4] = '<a id="delete_relation_button" href="">';
|
||||
$table_relations->data[-1][4] .= html_print_image('images/cross.png', true).'</a>';
|
||||
|
||||
$module_relations = modules_get_relations(['id_module' => $id_agent_module]);
|
||||
if (!$module_relations) {
|
||||
$module_relations = [];
|
||||
}
|
||||
|
||||
$relations_count = 0;
|
||||
foreach ($module_relations as $key => $module_relation) {
|
||||
if ($module_relation['module_a'] == $id_agent_module) {
|
||||
$module_id = $module_relation['module_b'];
|
||||
$agent_id = modules_give_agent_id_from_module_id(
|
||||
$module_relation['module_b']
|
||||
);
|
||||
} else {
|
||||
$module_id = $module_relation['module_a'];
|
||||
$agent_id = modules_give_agent_id_from_module_id(
|
||||
$module_relation['module_a']
|
||||
);
|
||||
if ($id_agent_module) {
|
||||
$module_relations = modules_get_relations(['id_module' => $id_agent_module]);
|
||||
|
||||
if (!$module_relations) {
|
||||
$module_relations = [];
|
||||
}
|
||||
|
||||
$agent_name = ui_print_agent_name($agent_id, true);
|
||||
$relations_count = 0;
|
||||
foreach ($module_relations as $key => $module_relation) {
|
||||
if ($module_relation['module_a'] == $id_agent_module) {
|
||||
$module_id = $module_relation['module_b'];
|
||||
$agent_id = modules_give_agent_id_from_module_id(
|
||||
$module_relation['module_b']
|
||||
);
|
||||
} else {
|
||||
$module_id = $module_relation['module_a'];
|
||||
$agent_id = modules_give_agent_id_from_module_id(
|
||||
$module_relation['module_a']
|
||||
);
|
||||
}
|
||||
|
||||
$module_name = modules_get_agentmodule_name($module_id);
|
||||
if (empty($module_name) || $module_name == 'false') {
|
||||
$module_name = $module_id;
|
||||
$agent_name = ui_print_agent_name($agent_id, true);
|
||||
|
||||
$module_name = modules_get_agentmodule_name($module_id);
|
||||
if (empty($module_name) || $module_name == 'false') {
|
||||
$module_name = $module_id;
|
||||
}
|
||||
|
||||
if ($module_relation['disable_update']) {
|
||||
$disabled_update_class = '';
|
||||
} else {
|
||||
$disabled_update_class = 'alpha50';
|
||||
}
|
||||
|
||||
// Agent name.
|
||||
$table_relations->data[$relations_count][0] = $agent_name;
|
||||
// Module name.
|
||||
$table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text($module_name, 'module_medium', true, true, true, '[…]').'</a>';
|
||||
// Type.
|
||||
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
|
||||
// Lock relationship updates.
|
||||
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
|
||||
// Delete relationship.
|
||||
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
|
||||
$relations_count++;
|
||||
}
|
||||
|
||||
if ($module_relation['disable_update']) {
|
||||
$disabled_update_class = '';
|
||||
} else {
|
||||
$disabled_update_class = 'alpha50';
|
||||
}
|
||||
|
||||
// Agent name.
|
||||
$table_relations->data[$relations_count][0] = $agent_name;
|
||||
// Module name.
|
||||
$table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text($module_name, 'module_medium', true, true, true, '[…]').'</a>';
|
||||
// Type.
|
||||
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
|
||||
// Lock relationship updates.
|
||||
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
|
||||
// Delete relationship.
|
||||
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
|
||||
$relations_count++;
|
||||
}
|
||||
|
||||
html_print_input_hidden('module_relations_count', $relations_count);
|
||||
|
|
|
@ -1,30 +1,50 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_snmp_browser.php';
|
||||
$snmp_browser_path = is_metaconsole() ? '../../' : '';
|
||||
$snmp_browser_path = (is_metaconsole()) ? '../../' : '';
|
||||
$snmp_browser_path .= 'include/javascript/pandora_snmp_browser.js';
|
||||
echo "<script type='text/javascript' src='$snmp_browser_path'></script>";
|
||||
// This line does not run with the dinamic loader editor in policies.
|
||||
// ui_require_javascript_file ('pandora_snmp_browser');
|
||||
// WARNING REPEAT input hidden errors in console
|
||||
// Save some variables for javascript functions
|
||||
// html_print_input_hidden ('ajax_url', ui_get_full_url("ajax.php"), false);
|
||||
// html_print_input_hidden ('search_matches_translation', __("Search matches"), false);
|
||||
// Define a custom action to save the OID selected in the SNMP browser to the form
|
||||
html_print_input_hidden('custom_action', urlencode(base64_encode(' <a href="javascript:setOID()"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" style="vertical-align: middle;"></img></a>')), false);
|
||||
echo "<script type='text/javascript' src='".$snmp_browser_path."'></script>";
|
||||
|
||||
// Define a custom action to save the OID selected
|
||||
// in the SNMP browser to the form.
|
||||
html_print_input_hidden(
|
||||
'custom_action',
|
||||
urlencode(
|
||||
base64_encode(
|
||||
' <a href="javascript:setOID()"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" style="vertical-align: middle;"></img></a>'
|
||||
)
|
||||
),
|
||||
false
|
||||
);
|
||||
|
||||
$isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
|
||||
|
||||
|
@ -50,17 +70,15 @@ if (strstr($page, 'policy_modules') === false) {
|
|||
define('ID_NETWORK_COMPONENT_TYPE', 2);
|
||||
|
||||
if (empty($update_module_id)) {
|
||||
// Function in module_manager_editor_common.php
|
||||
// Function in module_manager_editor_common.php.
|
||||
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
|
||||
} else {
|
||||
// TODO: Print network component if available
|
||||
}
|
||||
|
||||
$extra_title = __('Network server module');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Target IP');
|
||||
// show agent_for defect;
|
||||
// Show agent_for defect.
|
||||
if ($page == 'enterprise/godmode/policies/policy_modules') {
|
||||
if ($ip_target != 'auto' && $ip_target != '') {
|
||||
$custom_ip_target = $ip_target;
|
||||
|
@ -100,7 +118,7 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
|
|||
$data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
|
||||
}
|
||||
|
||||
// In ICMP modules, port is not configurable
|
||||
// In ICMP modules, port is not configurable.
|
||||
if ($id_module_type >= 6 && $id_module_type <= 7) {
|
||||
$data[2] = '';
|
||||
$data[3] = '';
|
||||
|
@ -148,7 +166,15 @@ if (!$adopt) {
|
|||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
} else {
|
||||
$data[1] = html_print_input_text('snmp_community', $snmp_community, '', 15, 60, true, false);
|
||||
$data[1] = html_print_input_text(
|
||||
'snmp_community',
|
||||
$snmp_community,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
$data[2] = _('SNMP version');
|
||||
|
@ -213,8 +239,27 @@ $data[1] .= html_print_input_text(
|
|||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$data[1] .= '<span class="invisible" id="oid">';
|
||||
$data[1] .= html_print_select([], 'select_snmp_oid', $snmp_oid, '', '', 0, true, false, false, '', $disabledBecauseInPolicy);
|
||||
$data[1] .= html_print_image('images/edit.png', true, ['class' => 'invisible clickable', 'id' => 'edit_oid']);
|
||||
$data[1] .= html_print_select(
|
||||
[],
|
||||
'select_snmp_oid',
|
||||
$snmp_oid,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$data[1] .= html_print_image(
|
||||
'images/edit.png',
|
||||
true,
|
||||
[
|
||||
'class' => 'invisible clickable',
|
||||
'id' => 'edit_oid',
|
||||
]
|
||||
);
|
||||
$data[1] .= '</span>';
|
||||
$data[1] .= '</span><span class="right" style="width: 50%; text-align: right">';
|
||||
$data[1] .= html_print_button(
|
||||
|
@ -231,42 +276,50 @@ $table_simple->colspan['snmp_2'][1] = 3;
|
|||
|
||||
push_table_simple($data, 'snmp_2');
|
||||
|
||||
// Advanced stuff
|
||||
// Advanced stuff.
|
||||
$data = [];
|
||||
$data[0] = __('TCP send');
|
||||
$data[1] = html_print_textarea('tcp_send', 2, 65, $tcp_send, $disabledTextBecauseInPolicy, true, $largeclassdisabledBecauseInPolicy);
|
||||
$data[1] = html_print_textarea(
|
||||
'tcp_send',
|
||||
2,
|
||||
65,
|
||||
$tcp_send,
|
||||
$disabledTextBecauseInPolicy,
|
||||
true,
|
||||
$largeclassdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->colspan['tcp_send'][1] = 3;
|
||||
|
||||
push_table_simple($data, 'tcp_send');
|
||||
|
||||
$data[0] = __('TCP receive');
|
||||
$data[1] = html_print_textarea('tcp_rcv', 2, 65, $tcp_rcv, $disabledTextBecauseInPolicy, true, $largeclassdisabledBecauseInPolicy);
|
||||
$data[1] = html_print_textarea(
|
||||
'tcp_rcv',
|
||||
2,
|
||||
65,
|
||||
$tcp_rcv,
|
||||
$disabledTextBecauseInPolicy,
|
||||
true,
|
||||
$largeclassdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->colspan['tcp_receive'][1] = 3;
|
||||
|
||||
push_table_simple($data, 'tcp_receive');
|
||||
|
||||
if ($id_module_type < 8 || $id_module_type > 11) {
|
||||
// NOT TCP
|
||||
// NOT TCP.
|
||||
$table_simple->rowstyle['tcp_send'] = 'display: none;';
|
||||
$table_simple->rowstyle['tcp_receive'] = 'display: none;';
|
||||
}
|
||||
|
||||
if ($id_module_type < 15 || $id_module_type > 18) {
|
||||
// NOT SNMP
|
||||
// NOT SNMP.
|
||||
$table_simple->rowstyle['snmp_1'] = 'display: none';
|
||||
$table_simple->rowstyle['snmp_2'] = 'display: none';
|
||||
}
|
||||
|
||||
// For a policy
|
||||
if (!isset($id_agent_module)) {
|
||||
$snmp3_auth_user = '';
|
||||
$snmp3_auth_pass = '';
|
||||
$snmp_version = 1;
|
||||
$snmp3_privacy_method = '';
|
||||
$snmp3_privacy_pass = '';
|
||||
$snmp3_auth_method = '';
|
||||
$snmp3_security_level = '';
|
||||
} else if ($id_agent_module === false) {
|
||||
// For a policy.
|
||||
if (isset($id_agent_module) === false || $id_agent_module === false) {
|
||||
$snmp3_auth_user = '';
|
||||
$snmp3_auth_pass = '';
|
||||
$snmp_version = 1;
|
||||
|
@ -274,6 +327,9 @@ if (!isset($id_agent_module)) {
|
|||
$snmp3_privacy_pass = '';
|
||||
$snmp3_auth_method = '';
|
||||
$snmp3_security_level = '';
|
||||
$command_text = '';
|
||||
$command_os = 'inherited';
|
||||
$command_credential_identifier = '';
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
@ -333,7 +389,22 @@ push_table_simple($data, 'field_snmpv3_row2');
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Auth method');
|
||||
$data[1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'snmp3_auth_method', $snmp3_auth_method, '', '', '', true, false, false, '', $disabledBecauseInPolicy);
|
||||
$data[1] = html_print_select(
|
||||
[
|
||||
'MD5' => __('MD5'),
|
||||
'SHA' => __('SHA'),
|
||||
],
|
||||
'snmp3_auth_method',
|
||||
$snmp3_auth_method,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$data[2] = __('Security level');
|
||||
$data[3] = html_print_select(
|
||||
[
|
||||
|
@ -358,13 +429,84 @@ if ($snmp_version != 3) {
|
|||
|
||||
push_table_simple($data, 'field_snmpv3_row3');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Command');
|
||||
$data[1] = html_print_input_text_extended(
|
||||
'command_text',
|
||||
$command_text,
|
||||
'command_text',
|
||||
'',
|
||||
100,
|
||||
10000,
|
||||
$disabledBecauseInPolicy,
|
||||
'',
|
||||
$largeClassDisabledBecauseInPolicy,
|
||||
true
|
||||
);
|
||||
$table_simple->colspan['row-cmd-row-1'][1] = 3;
|
||||
push_table_simple($data, 'row-cmd-row-1');
|
||||
|
||||
require_once $config['homedir'].'/include/class/CredentialStore.class.php';
|
||||
$array_credential_identifier = CredentialStore::getKeys('CUSTOM');
|
||||
|
||||
$data[0] = __('Credential identifier');
|
||||
$data[1] = html_print_select(
|
||||
$array_credential_identifier,
|
||||
'command_credential_identifier',
|
||||
$command_credential_identifier,
|
||||
'',
|
||||
__('None'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$array_os = [
|
||||
'inherited' => __('Inherited'),
|
||||
'linux' => __('Linux'),
|
||||
'windows' => __('Windows'),
|
||||
];
|
||||
|
||||
$data[2] = __('Target OS');
|
||||
$data[3] = html_print_select(
|
||||
$array_os,
|
||||
'command_os',
|
||||
$command_os,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
push_table_simple($data, 'row-cmd-row-2');
|
||||
|
||||
if ($id_module_type !== 34
|
||||
&& $id_module_type !== 35
|
||||
&& $id_module_type !== 36
|
||||
&& $id_module_type !== 37
|
||||
) {
|
||||
$table_simple->rowstyle['row-cmd-row-1'] = 'display: none;';
|
||||
$table_simple->rowstyle['row-cmd-row-2'] = 'display: none;';
|
||||
}
|
||||
|
||||
snmp_browser_print_container(false, '100%', '60%', 'none');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("#id_module_type").change(function (){
|
||||
if ((this.value == "17") || (this.value == "18") || (this.value == "16") || (this.value == "15")) {
|
||||
if ((this.value == "17") ||
|
||||
(this.value == "18") ||
|
||||
(this.value == "16") ||
|
||||
(this.value == "15")
|
||||
) {
|
||||
if ($("#snmp_version").val() == "3"){
|
||||
$("#simple-field_snmpv3_row1").attr("style", "");
|
||||
$("#simple-field_snmpv3_row2").attr("style", "");
|
||||
|
@ -379,6 +521,18 @@ $(document).ready (function () {
|
|||
$("input[name=active_snmp_v3]").val(0);
|
||||
$("input[name=snmp_community]").removeAttr('disabled');
|
||||
}
|
||||
|
||||
if((this.value == "34") ||
|
||||
(this.value == "35") ||
|
||||
(this.value == "36") ||
|
||||
(this.value == "37")
|
||||
) {
|
||||
$("#simple-row-cmd-row-1").attr("style", "");
|
||||
$("#simple-row-cmd-row-2").attr("style", "");
|
||||
} else {
|
||||
$("#simple-row-cmd-row-1").css("display", "none");
|
||||
$("#simple-row-cmd-row-2").css("display", "none");
|
||||
}
|
||||
});
|
||||
|
||||
$("#snmp_version").change(function () {
|
||||
|
@ -397,27 +551,28 @@ $(document).ready (function () {
|
|||
$("input[name=snmp_community]").removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#select_snmp_oid").click (
|
||||
function () {
|
||||
$(this).css ("width", "auto");
|
||||
$(this).css ("min-width", "180px");
|
||||
});
|
||||
|
||||
|
||||
$("#select_snmp_oid").blur (function () {
|
||||
$(this).css ("width", "180px");
|
||||
});
|
||||
|
||||
|
||||
$("#id_module_type").click (
|
||||
function () {
|
||||
$(this).css ("width", "auto");
|
||||
$(this).css ("min-width", "180px");
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
$("#id_module_type").blur (function () {
|
||||
$(this).css ("width", "180px");
|
||||
});
|
||||
|
||||
|
||||
// Keep elements in the form and the SNMP browser synced
|
||||
$('#text-ip_target').keyup(function() {
|
||||
$('#text-target_ip').val($(this).val());
|
||||
|
@ -433,13 +588,12 @@ $(document).ready (function () {
|
|||
});
|
||||
$('#snmp_version').change(function() {
|
||||
$('#snmp_browser_version').val($(this).val());
|
||||
|
||||
// Display or collapse the SNMP browser's v3 options
|
||||
checkSNMPVersion ();
|
||||
});
|
||||
$('#snmp_browser_version').change(function() {
|
||||
$('#snmp_version').val($(this).val());
|
||||
|
||||
|
||||
// Display or collapse the SNMP v3 options in the main window
|
||||
if ($(this).val() == "3") {
|
||||
$("#simple-field_snmpv3_row1").attr("style", "");
|
||||
|
@ -498,10 +652,10 @@ $(document).ready (function () {
|
|||
}
|
||||
$('#ip_target').change(function() {
|
||||
if($(this).val() == 'custom') {
|
||||
$("#text-custom_ip_target").show();
|
||||
$("#text-custom_ip_target").show();
|
||||
}
|
||||
else{
|
||||
$("#text-custom_ip_target").hide();
|
||||
$("#text-custom_ip_target").hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -827,7 +827,7 @@ $table->data[5][1] = "
|
|||
</table>
|
||||
</div>';
|
||||
|
||||
echo '<form method="POST" action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor">';
|
||||
echo '<form method="POST" action="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor">';
|
||||
|
||||
if ($id_downtime > 0) {
|
||||
echo '<table width=100% border=0 cellpadding=4 >';
|
||||
|
@ -929,7 +929,7 @@ if ($id_downtime > 0) {
|
|||
$disabled_add_button = true;
|
||||
}
|
||||
|
||||
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
|
||||
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
|
||||
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;margin-right:15px;');
|
||||
|
||||
html_print_checkbox('recursion', 1, $recursion, false, false, '');
|
||||
|
@ -939,7 +939,7 @@ if ($id_downtime > 0) {
|
|||
echo '</form>';
|
||||
// Show available agents to include into downtime
|
||||
echo '<h4>'.__('Available agents').':</h4>';
|
||||
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
|
||||
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
|
||||
|
||||
echo html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, false, true, true, '', false, 'width: 180px;');
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ if ($id_downtime > 0) {
|
|||
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
|
||||
}
|
||||
|
||||
$data[5] .= '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
|
||||
$data[5] .= '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
|
||||
}
|
||||
|
||||
$table->data['agent_'.$downtime_agent['id_agente']] = $data;
|
||||
|
|
|
@ -352,12 +352,12 @@ if (!empty($groups)) {
|
|||
|
||||
// No downtimes cause the user has not anyone.
|
||||
if (!$downtimes && !$filter_performed) {
|
||||
include_once $config['homedir'].'/general/firts_task/planned_downtime.php';
|
||||
include_once $config['homedir'].'/general/first_task/planned_downtime.php';
|
||||
}
|
||||
// No downtimes cause the user performed a search.
|
||||
else if (!$downtimes) {
|
||||
// Filter form.
|
||||
echo "<form method='post' action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list'>";
|
||||
echo "<form method='post' action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>";
|
||||
html_print_table($table_form);
|
||||
echo '</form>';
|
||||
|
||||
|
@ -369,7 +369,7 @@ else if (!$downtimes) {
|
|||
// Create button.
|
||||
if ($write_permisson) {
|
||||
echo ' ';
|
||||
echo '<form method="post" action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
|
||||
echo '<form method="post" action="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
|
||||
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
}
|
||||
|
@ -378,11 +378,11 @@ else if (!$downtimes) {
|
|||
}
|
||||
// Has downtimes.
|
||||
else {
|
||||
echo "<form method='post' action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list'>";
|
||||
echo "<form method='post' action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>";
|
||||
html_print_table($table_form);
|
||||
echo '</form>';
|
||||
|
||||
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
|
||||
ui_pagination($downtimes_number, "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
|
||||
|
||||
// User groups with AR, AD or AW permission.
|
||||
$groupsAD = users_get_groups($config['id_user'], $access);
|
||||
|
@ -476,7 +476,7 @@ else {
|
|||
if (in_array($downtime['id_group'], $groupsAD)) {
|
||||
// Stop button
|
||||
if ($downtime['type_execution'] == 'once' && $downtime['executed'] == 1) {
|
||||
$data['stop'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]);
|
||||
$data['stop'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]);
|
||||
} else {
|
||||
$data['stop'] = '';
|
||||
}
|
||||
|
@ -484,12 +484,12 @@ else {
|
|||
// Edit & delete buttons.
|
||||
if ($downtime['executed'] == 0) {
|
||||
// Edit.
|
||||
$data['edit'] = '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
|
||||
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
|
||||
// Delete.
|
||||
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]);
|
||||
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]);
|
||||
} else if ($downtime['executed'] == 1 && $downtime['type_execution'] == 'once') {
|
||||
// Edit.
|
||||
$data['edit'] = '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
|
||||
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
|
||||
// Delete.
|
||||
$data['delete'] = __('N/A');
|
||||
} else {
|
||||
|
@ -515,7 +515,7 @@ else {
|
|||
}
|
||||
|
||||
html_print_table($table);
|
||||
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
ui_pagination($downtimes_number, "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
||||
// CSV export button.
|
||||
|
@ -532,7 +532,7 @@ else {
|
|||
// Create button.
|
||||
if ($write_permisson) {
|
||||
echo ' ';
|
||||
echo '<form method="post" action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
|
||||
echo '<form method="post" action="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
|
||||
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
}
|
||||
|
@ -559,7 +559,7 @@ $(document).ready (function () {
|
|||
|
||||
if (<?php echo json_encode($malformed_downtimes_exist); ?> && <?php echo json_encode($migrate_malformed == false); ?>) {
|
||||
if (confirm("<?php echo __('WARNING: There are malformed planned downtimes').'.\n'.__('Do you want to migrate automatically the malformed items?'); ?>")) {
|
||||
window.location.href = "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1";
|
||||
window.location.href = "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -184,9 +184,11 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
|||
}
|
||||
|
||||
ui_require_css_file('cluetip', 'include/styles/js/');
|
||||
ui_require_jquery_file('validate');
|
||||
ui_require_jquery_file('cluetip');
|
||||
ui_require_jquery_file('pandora.controls');
|
||||
ui_require_jquery_file('bgiframe');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
@ -201,7 +203,25 @@ $(document).ready (function () {
|
|||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
// Rule.
|
||||
$.validator.addMethod(
|
||||
"valueNotEquals",
|
||||
function(value, element, arg) {
|
||||
return arg != value;
|
||||
},
|
||||
"Value must not equal arg."
|
||||
);
|
||||
|
||||
// configure your validation
|
||||
$("form.add_alert_form").validate({
|
||||
rules: {
|
||||
id_agent_module: { valueNotEquals: "0" }
|
||||
},
|
||||
messages: {
|
||||
id_agent_module: { valueNotEquals: "Please select an item!" }
|
||||
}
|
||||
});
|
||||
$("select#template").change (function () {
|
||||
id = this.value;
|
||||
$a = $(this).siblings ("a.template_details");
|
||||
|
|
|
@ -140,14 +140,8 @@ $table->colspan[0][1] = 2;
|
|||
$table->data[1][0] = __('Group');
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
// Only display group "All" if user is administrator or has "PM" privileges
|
||||
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
||||
$display_all_group = true;
|
||||
} else {
|
||||
$display_all_group = false;
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_select_groups(false, 'LW', $display_all_group, 'group', $group, '', '', 0, true);
|
||||
$table->data[1][1] = html_print_select_groups(false, 'LW', true, 'group', $group, '', '', 0, true);
|
||||
$table->colspan[1][1] = 2;
|
||||
|
||||
$table->data[2][0] = __('Command');
|
||||
|
@ -173,9 +167,9 @@ $table->data[2][1] = html_print_select_from_sql(
|
|||
);
|
||||
$table->data[2][1] .= ' ';
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$table->data[2][1] .= html_print_image('images/add.png', true);
|
||||
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
||||
$table->data[2][1] .= __('Create Command');
|
||||
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
||||
$table->data[2][1] .= html_print_image('images/add.png', true);
|
||||
$table->data[2][1] .= '</a>';
|
||||
}
|
||||
|
||||
|
@ -320,18 +314,18 @@ $(document).ready (function () {
|
|||
original_command = data["command"];
|
||||
render_command_preview (original_command);
|
||||
command_description = data["description"];
|
||||
render_command_description(command_description);
|
||||
if (command_description != undefined) {
|
||||
render_command_description(command_description);
|
||||
} else {
|
||||
render_command_description('');
|
||||
|
||||
}
|
||||
|
||||
var max_fields = parseInt('<?php echo $config['max_macro_fields']; ?>');
|
||||
|
||||
// Change the selected group
|
||||
$("#group option").each(function(index, value) {
|
||||
var current_group = $(value).val();
|
||||
if (data.id_group != 0 && current_group != 0 && current_group != data.id_group) {
|
||||
$(value).hide();
|
||||
} else {
|
||||
$(value).show();
|
||||
}
|
||||
});
|
||||
if (data.id_group != 0 && $("#group").val() != data.id_group) {
|
||||
$("#group").val(0);
|
||||
|
|
|
@ -588,6 +588,18 @@ $table->data[23][1] = html_print_input_text('id_extra', $id_extra, '', 11, 255,
|
|||
$table->data[24][0] = '<b>'.__('Comment').'</b>';
|
||||
$table->data[24][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$table->data[25][0] = '<b>'.__('Id souce event').'</b>';
|
||||
$table->data[25][1] = html_print_input_text(
|
||||
'id_source_event',
|
||||
$id_source_event,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=edit_filter&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ if ($event_response_id > 0) {
|
|||
$event_response['modal_height'] = 0;
|
||||
$event_response['params'] = '';
|
||||
$event_response['server_to_exec'] = '';
|
||||
$event_response['command_timeout'] = 90;
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
|
@ -175,6 +176,11 @@ $data[3] = '<div id="server_to_exec_value" style="display:none;">'.html_print_se
|
|||
|
||||
$table->data[4] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = '<div id="command_timeout_label" style="display:none;" class="labels">'.__('Command timeout (s)');
|
||||
$data[1] = '<div id="command_timeout_value" style="display:none;">'.html_print_input_text('command_timeout', $event_response['command_timeout'], '', 4, 5, true);
|
||||
|
||||
$table->data[5] = $data;
|
||||
if ($event_response_id == 0) {
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=list&action=create_response&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
@ -214,11 +220,17 @@ $('#type').change(function() {
|
|||
$('#new_window').attr('disabled','disabled');
|
||||
$('#server_to_exec_label').css('display','');
|
||||
$('#server_to_exec_value').css('display','');
|
||||
$('#command_timeout_label').css('display','');
|
||||
$('#command_timeout_value').css('display','');
|
||||
|
||||
break;
|
||||
case 'url':
|
||||
$('#new_window').removeAttr('disabled');
|
||||
$('#server_to_exec_label').css('display','none');
|
||||
$('#server_to_exec_value').css('display','none');
|
||||
$('#command_timeout_label').css('display','none');
|
||||
$('#command_timeout_value').css('display','none');
|
||||
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -42,6 +42,7 @@ switch ($action) {
|
|||
$values['new_window'] = get_parameter('new_window');
|
||||
$values['params'] = get_parameter('params');
|
||||
$values['server_to_exec'] = get_parameter('server_to_exec');
|
||||
$values['command_timeout'] = get_parameter('command_timeout', 90);
|
||||
|
||||
$result = event_responses_create_response($values);
|
||||
|
||||
|
@ -65,6 +66,8 @@ switch ($action) {
|
|||
$values['params'] = get_parameter('params');
|
||||
$values['server_to_exec'] = get_parameter('server_to_exec');
|
||||
$response_id = get_parameter('id_response', 0);
|
||||
$values['command_timeout'] = get_parameter('command_timeout', '90');
|
||||
|
||||
|
||||
$result = event_responses_update_response($response_id, $values);
|
||||
|
||||
|
|
|
@ -59,8 +59,10 @@ if ($update_agents) {
|
|||
$values['id_grupo'] = get_parameter('group');
|
||||
}
|
||||
|
||||
if (get_parameter('interval', 0) != 0) {
|
||||
$values['intervalo'] = get_parameter('interval');
|
||||
if (!(get_parameter('interval_select') == -1 && empty(get_parameter('interval_text')))) {
|
||||
if (get_parameter('interval', 0) != 0) {
|
||||
$values['intervalo'] = get_parameter('interval');
|
||||
}
|
||||
}
|
||||
|
||||
if (get_parameter('id_os', '') != -1) {
|
||||
|
@ -199,7 +201,7 @@ if ($update_agents) {
|
|||
}
|
||||
|
||||
// Update the configuration files.
|
||||
if ($result && ($old_interval_value != $values['intervalo'])) {
|
||||
if ($result && ($old_interval_value != $values['intervalo']) && !empty($values['intervalo'])) {
|
||||
enterprise_hook(
|
||||
'config_agents_update_config_token',
|
||||
[
|
||||
|
@ -523,7 +525,7 @@ $table->data[1][1] = html_print_select_groups(false, 'AR', false, 'group', $grou
|
|||
|
||||
$table->data[2][0] = __('Interval');
|
||||
|
||||
$table->data[2][1] = html_print_extended_select_for_time('interval', 0, '', __('No change'), '0', 10, true, 'width: 150px');
|
||||
$table->data[2][1] = html_print_extended_select_for_time('interval', 0, '', __('No change'), '0', 10, true, 'width: 150px', false);
|
||||
|
||||
$table->data[3][0] = __('OS');
|
||||
$table->data[3][1] = html_print_select_from_sql(
|
||||
|
|
|
@ -1105,6 +1105,57 @@ $table->data['edit1'][1] = '<table width="100%">';
|
|||
// Store the macros in base64 into a hidden control to move between pages
|
||||
$table->data['edit21'][0] = html_print_input_hidden('macros', base64_encode($macros), true);
|
||||
|
||||
$table->colspan['edit23'][1] = 3;
|
||||
$table->data['edit23'][0] = __('Command');
|
||||
$table->data['edit23'][1] = html_print_input_text_extended(
|
||||
'tcp_send',
|
||||
'',
|
||||
'command_text',
|
||||
'',
|
||||
100,
|
||||
10000,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
require_once $config['homedir'].'/include/class/CredentialStore.class.php';
|
||||
$array_credential_identifier = CredentialStore::getKeys('CUSTOM');
|
||||
|
||||
$table->data['edit24'][0] = __('Credential identifier');
|
||||
$table->data['edit24'][1] = html_print_select(
|
||||
$array_credential_identifier,
|
||||
'custom_string_1',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$array_os = [
|
||||
'inherited' => __('Inherited'),
|
||||
'linux' => __('Linux'),
|
||||
'windows' => __('Windows'),
|
||||
];
|
||||
|
||||
$table->data['edit24'][2] = __('Target OS');
|
||||
$table->data['edit24'][3] = html_print_select(
|
||||
$array_os,
|
||||
'custom_string_2',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
''
|
||||
);
|
||||
|
||||
if (!empty($id_plugin)) {
|
||||
$preload = db_get_sql("SELECT description FROM tplugin WHERE id = $id_plugin");
|
||||
$preload = io_safe_output($preload);
|
||||
|
@ -1221,6 +1272,8 @@ $(document).ready (function () {
|
|||
"tr#delete_table-edit20, " +
|
||||
"tr#delete_table-edit21, " +
|
||||
"tr#delete_table-edit22, " +
|
||||
"tr#delete_table-edit23, " +
|
||||
"tr#delete_table-edit24, " +
|
||||
"tr#delete_table-edit15").hide ();
|
||||
|
||||
var params = {
|
||||
|
@ -1296,6 +1349,8 @@ $(document).ready (function () {
|
|||
"tr#delete_table-edit20, " +
|
||||
"tr#delete_table-edit21, " +
|
||||
"tr#delete_table-edit22, " +
|
||||
"tr#delete_table-edit23, " +
|
||||
"tr#delete_table-edit24, " +
|
||||
"tr#delete_table-edit15").show ();
|
||||
|
||||
switch($('#module_type').val()) {
|
||||
|
@ -1353,6 +1408,13 @@ $(document).ready (function () {
|
|||
$("#edit1-1-str,#edit1-3-str,#delete_table-edit15,#delete_table-edit3-2," +
|
||||
"#delete_table-edit3-3,#delete_table-edit35").hide();
|
||||
break;
|
||||
case '34':
|
||||
case '35':
|
||||
case '36':
|
||||
case '37':
|
||||
$("#edit1-1-min,#edit1-1-max,#edit1-3-min,#edit1-3-max").show();
|
||||
$("#edit1-1-str,#edit1-3-str,#delete_table-edit5").hide();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
@ -1391,6 +1453,8 @@ $(document).ready (function () {
|
|||
"tr#delete_table-edit20, " +
|
||||
"tr#delete_table-edit21, " +
|
||||
"tr#delete_table-edit22, " +
|
||||
"tr#delete_table-edit23, " +
|
||||
"tr#delete_table-edit24, " +
|
||||
"tr#delete_table-edit15").hide ();
|
||||
$('input[type=checkbox]').attr('checked', false);
|
||||
$('input[type=checkbox]').attr('disabled', true);
|
||||
|
@ -1447,6 +1511,8 @@ $(document).ready (function () {
|
|||
"tr#delete_table-edit20, " +
|
||||
"tr#delete_table-edit21, " +
|
||||
"tr#delete_table-edit22, " +
|
||||
"tr#delete_table-edit23, " +
|
||||
"tr#delete_table-edit24, " +
|
||||
"tr#delete_table-edit15").hide ();
|
||||
}
|
||||
}
|
||||
|
@ -1497,6 +1563,8 @@ $(document).ready (function () {
|
|||
"tr#delete_table-edit20, " +
|
||||
"tr#delete_table-edit21, " +
|
||||
"tr#delete_table-edit22, " +
|
||||
"tr#delete_table-edit23, " +
|
||||
"tr#delete_table-edit24, " +
|
||||
"tr#delete_table-edit15").show ();
|
||||
}
|
||||
else {
|
||||
|
@ -1528,6 +1596,8 @@ $(document).ready (function () {
|
|||
"tr#delete_table-edit20, " +
|
||||
"tr#delete_table-edit21, " +
|
||||
"tr#delete_table-edit22, " +
|
||||
"tr#delete_table-edit23, " +
|
||||
"tr#delete_table-edit24, " +
|
||||
"tr#delete_table-edit15").hide ();
|
||||
}
|
||||
}
|
||||
|
@ -1618,6 +1688,8 @@ $(document).ready (function () {
|
|||
"tr#delete_table-edit20, " +
|
||||
"tr#delete_table-edit21, " +
|
||||
"tr#delete_table-edit22, " +
|
||||
"tr#delete_table-edit23, " +
|
||||
"tr#delete_table-edit24, " +
|
||||
"tr#delete_table-edit15").hide ();
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
|
@ -1858,6 +1930,9 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
|||
'field_number',
|
||||
'tcp_send2',
|
||||
'plugin_parameter_text',
|
||||
'command_text',
|
||||
'command_credential_identifier',
|
||||
'command_os',
|
||||
];
|
||||
$values = [];
|
||||
|
||||
|
|
|
@ -21,27 +21,42 @@ require_once 'include/functions_menu.php';
|
|||
$menu_godmode = [];
|
||||
$menu_godmode['class'] = 'godmode';
|
||||
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
if (check_acl($config['id_user'], 0, 'AR')
|
||||
|| check_acl($config['id_user'], 0, 'AW')
|
||||
|| check_acl($config['id_user'], 0, 'RR')
|
||||
|| check_acl($config['id_user'], 0, 'RW')
|
||||
|| check_acl($config['id_user'], 0, 'PM')
|
||||
) {
|
||||
$sub = [];
|
||||
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Main');
|
||||
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Start');
|
||||
$sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery';
|
||||
|
||||
$sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
|
||||
$sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
|
||||
|
||||
$sub2 = [];
|
||||
$sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan');
|
||||
enterprise_hook('hostdevices_submenu');
|
||||
$sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan');
|
||||
$sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts');
|
||||
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
|
||||
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
|
||||
$sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2;
|
||||
if (check_acl($config['id_user'], 0, 'AW')
|
||||
|| check_acl($config['id_user'], 0, 'PM')
|
||||
) {
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
$sub2 = [];
|
||||
$sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan');
|
||||
enterprise_hook('hostdevices_submenu');
|
||||
$sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan');
|
||||
}
|
||||
|
||||
enterprise_hook('applications_menu');
|
||||
enterprise_hook('cloud_menu');
|
||||
enterprise_hook('console_task_menu');
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts');
|
||||
}
|
||||
|
||||
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
|
||||
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
|
||||
$sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2;
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
enterprise_hook('applications_menu');
|
||||
enterprise_hook('cloud_menu');
|
||||
enterprise_hook('console_task_menu');
|
||||
}
|
||||
|
||||
// Add to menu.
|
||||
$menu_godmode['discovery']['text'] = __('Discovery');
|
||||
|
@ -92,7 +107,7 @@ if (!empty($sub)) {
|
|||
}
|
||||
|
||||
$sub = [];
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sub['godmode/groups/group_list']['text'] = __('Manage agents groups');
|
||||
$sub['godmode/groups/group_list']['id'] = 'Manage agents groups';
|
||||
}
|
||||
|
@ -324,13 +339,15 @@ if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, '
|
|||
$sub = [];
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
// Audit //meter en extensiones
|
||||
// Audit //meter en extensiones.
|
||||
$sub['godmode/admin_access_logs']['text'] = __('System audit log');
|
||||
$sub['godmode/admin_access_logs']['id'] = 'System audit log';
|
||||
$sub['godmode/setup/links']['text'] = __('Links');
|
||||
$sub['godmode/setup/links']['id'] = 'Links';
|
||||
$sub['extras/pandora_diag']['text'] = __('Diagnostic info');
|
||||
$sub['extras/pandora_diag']['id'] = 'Diagnostic info';
|
||||
$sub['tools/diagnostics']['text'] = __('Diagnostic info');
|
||||
$sub['tools/diagnostics']['id'] = 'Diagnostic info';
|
||||
enterprise_hook('omnishell');
|
||||
|
||||
$sub['godmode/setup/news']['text'] = __('Site news');
|
||||
$sub['godmode/setup/news']['id'] = 'Site news';
|
||||
$sub['godmode/setup/file_manager']['text'] = __('File manager');
|
||||
|
@ -384,9 +401,6 @@ if (is_array($config['extensions'])) {
|
|||
if (strlen($extmenu['fatherId']) > 0) {
|
||||
if (array_key_exists('subfatherId', $extmenu)) {
|
||||
if (strlen($extmenu['subfatherId']) > 0) {
|
||||
if ($extmenu['name'] = 'DB schema check') {
|
||||
}
|
||||
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['text'] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['refr'] = 0;
|
||||
|
|
|
@ -1,17 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -32,7 +47,7 @@ require_once $config['homedir'].'/include/functions_categories.php';
|
|||
enterprise_include_once('meta/include/functions_components_meta.php');
|
||||
require_once $config['homedir'].'/include/functions_component_groups.php';
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
if (defined('METACONSOLE')) {
|
||||
components_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
|
@ -40,15 +55,6 @@ if (defined('METACONSOLE')) {
|
|||
$id_modulo = (int) get_parameter('id_component_type');
|
||||
$new_component = (bool) get_parameter('new_component');
|
||||
} else {
|
||||
/*
|
||||
Hello there! :)
|
||||
|
||||
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
|
||||
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
|
||||
|
||||
*/
|
||||
|
||||
$id_modulo = (int) get_parameter('id_component_type');
|
||||
$new_component = (bool) get_parameter('new_component');
|
||||
if ($id_modulo == 2 || $id_modulo == 4 || $id_modulo == 6) {
|
||||
|
@ -59,7 +65,6 @@ if (defined('METACONSOLE')) {
|
|||
$help_header = 'network_component_tab';
|
||||
}
|
||||
|
||||
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Network component management'),
|
||||
'',
|
||||
|
@ -73,7 +78,6 @@ if (defined('METACONSOLE')) {
|
|||
$sec = 'gmodules';
|
||||
}
|
||||
|
||||
|
||||
$type = (int) get_parameter('type');
|
||||
$name = (string) get_parameter('name');
|
||||
$description = (string) get_parameter('description');
|
||||
|
@ -120,7 +124,7 @@ $history_data = (bool) get_parameter('history_data');
|
|||
|
||||
// Don't read as (float) because it lost it's decimals when put into MySQL
|
||||
// where are very big and PHP uses scientific notation, p.e:
|
||||
// 1.23E-10 is 0.000000000123
|
||||
// 1.23E-10 is 0.000000000123.
|
||||
$post_process = (string) get_parameter('post_process', 0.0);
|
||||
|
||||
$unit = (string) get_parameter('unit');
|
||||
|
@ -151,9 +155,16 @@ $snmp3_auth_user = (string) io_safe_output(get_parameter('snmp3_auth_user'));
|
|||
$snmp3_auth_pass = io_input_password((string) get_parameter('snmp3_auth_pass'));
|
||||
$snmp3_auth_method = (string) get_parameter('snmp3_auth_method');
|
||||
$snmp3_privacy_method = (string) get_parameter('snmp3_privacy_method');
|
||||
$snmp3_privacy_pass = io_input_password((string) get_parameter('snmp3_privacy_pass'));
|
||||
$snmp3_privacy_pass = io_input_password(
|
||||
(string) get_parameter('snmp3_privacy_pass')
|
||||
);
|
||||
$snmp3_security_level = (string) get_parameter('snmp3_security_level');
|
||||
|
||||
$command_text = (string) get_parameter('command_text');
|
||||
$command_credential_identifier = (string) get_parameter(
|
||||
'command_credential_identifier'
|
||||
);
|
||||
$command_os = (string) get_parameter('command_os');
|
||||
|
||||
$throw_unknown_events = get_parameter('throw_unknown_events', false);
|
||||
// Set the event type that can show.
|
||||
|
@ -163,11 +174,19 @@ $disabled_types_event = json_encode($disabled_types_event);
|
|||
$create_component = (bool) get_parameter('create_component');
|
||||
$update_component = (bool) get_parameter('update_component');
|
||||
$delete_component = (bool) get_parameter('delete_component');
|
||||
$duplicate_network_component = (bool) get_parameter('duplicate_network_component');
|
||||
$duplicate_network_component = (bool) get_parameter(
|
||||
'duplicate_network_component'
|
||||
);
|
||||
$delete_multiple = (bool) get_parameter('delete_multiple');
|
||||
$multiple_delete = (bool) get_parameter('multiple_delete', 0);
|
||||
$create_network_from_module = (bool) get_parameter('create_network_from_module', 0);
|
||||
$create_network_from_snmp_browser = (bool) get_parameter('create_network_from_snmp_browser', 0);
|
||||
$create_network_from_module = (bool) get_parameter(
|
||||
'create_network_from_module',
|
||||
0
|
||||
);
|
||||
$create_network_from_snmp_browser = (bool) get_parameter(
|
||||
'create_network_from_snmp_browser',
|
||||
0
|
||||
);
|
||||
|
||||
if ($duplicate_network_component) {
|
||||
$source_id = (int) get_parameter('source_id');
|
||||
|
@ -182,18 +201,34 @@ if ($duplicate_network_component) {
|
|||
__('Could not be created')
|
||||
);
|
||||
|
||||
// List unset for jump the bug in the pagination (TODO) that the make another
|
||||
// copy for each pass into pages.
|
||||
// List unset for jump the bug in the pagination
|
||||
// that the make another copy for each pass into pages.
|
||||
unset($_GET['source_id']);
|
||||
unset($_GET['duplicate_network_component']);
|
||||
|
||||
$id = 0;
|
||||
}
|
||||
|
||||
$custom_string_1 = '';
|
||||
$custom_string_2 = '';
|
||||
$custom_string_3 = '';
|
||||
|
||||
if ($type >= 15 && $type <= 18) {
|
||||
// New support for snmp v3.
|
||||
$tcp_send = $snmp_version;
|
||||
$plugin_user = $snmp3_auth_user;
|
||||
$plugin_pass = $snmp3_auth_pass;
|
||||
$plugin_parameter = $snmp3_auth_method;
|
||||
$custom_string_1 = $snmp3_privacy_method;
|
||||
$custom_string_2 = $snmp3_privacy_pass;
|
||||
$custom_string_3 = $snmp3_security_level;
|
||||
} else if ($type >= 34 && $type <= 37) {
|
||||
$tcp_send = $command_text;
|
||||
$custom_string_1 = $command_credential_identifier;
|
||||
$custom_string_2 = $command_os;
|
||||
}
|
||||
|
||||
if ($create_component) {
|
||||
$custom_string_1 = '';
|
||||
$custom_string_2 = '';
|
||||
$custom_string_3 = '';
|
||||
$name_check = db_get_value(
|
||||
'name',
|
||||
'tnetwork_component',
|
||||
|
@ -201,25 +236,6 @@ if ($create_component) {
|
|||
$name
|
||||
);
|
||||
|
||||
// remote_snmp = 15
|
||||
// remote_snmp_proc = 18
|
||||
if ($type >= 15 && $type <= 18) {
|
||||
// New support for snmp v3
|
||||
$tcp_send = $snmp_version;
|
||||
$plugin_user = $snmp3_auth_user;
|
||||
$plugin_pass = $snmp3_auth_pass;
|
||||
$plugin_parameter = $snmp3_auth_method;
|
||||
$custom_string_1 = $snmp3_privacy_method;
|
||||
$custom_string_2 = $snmp3_privacy_pass;
|
||||
$custom_string_3 = $snmp3_security_level;
|
||||
$name_check = db_get_value(
|
||||
'name',
|
||||
'tnetwork_component',
|
||||
'name',
|
||||
$name
|
||||
);
|
||||
}
|
||||
|
||||
if ($name && !$name_check) {
|
||||
$id = network_components_create_network_component(
|
||||
$name,
|
||||
|
@ -283,13 +299,16 @@ if ($create_component) {
|
|||
}
|
||||
|
||||
if ($id === false || !$id) {
|
||||
db_pandora_audit('Module management', 'Fail try to create network component');
|
||||
db_pandora_audit(
|
||||
'Module management',
|
||||
'Fail try to create network component'
|
||||
);
|
||||
ui_print_error_message(__('Could not be created'));
|
||||
include_once 'godmode/modules/manage_network_components_form.php';
|
||||
return;
|
||||
}
|
||||
|
||||
db_pandora_audit('Module management', "Create network component #$id");
|
||||
db_pandora_audit('Module management', 'Create network component #'.$id);
|
||||
ui_print_success_message(__('Created successfully'));
|
||||
$id = 0;
|
||||
}
|
||||
|
@ -297,23 +316,6 @@ if ($create_component) {
|
|||
if ($update_component) {
|
||||
$id = (int) get_parameter('id');
|
||||
|
||||
$custom_string_1 = '';
|
||||
$custom_string_2 = '';
|
||||
$custom_string_3 = '';
|
||||
|
||||
// $name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
|
||||
if ($type >= 15 && $type <= 18) {
|
||||
// New support for snmp v3
|
||||
$tcp_send = $snmp_version;
|
||||
$plugin_user = $snmp3_auth_user;
|
||||
$plugin_pass = $snmp3_auth_pass;
|
||||
$plugin_parameter = $snmp3_auth_method;
|
||||
$custom_string_1 = $snmp3_privacy_method;
|
||||
$custom_string_2 = $snmp3_privacy_pass;
|
||||
$custom_string_3 = $snmp3_security_level;
|
||||
// $name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
|
||||
}
|
||||
|
||||
if (!empty($name)) {
|
||||
$result = network_components_update_network_component(
|
||||
$id,
|
||||
|
@ -380,14 +382,14 @@ if ($update_component) {
|
|||
if ($result === false || !$result) {
|
||||
db_pandora_audit(
|
||||
'Module management',
|
||||
"Fail try to update network component #$id"
|
||||
'Fail try to update network component #'.$id
|
||||
);
|
||||
ui_print_error_message(__('Could not be updated'));
|
||||
include_once 'godmode/modules/manage_network_components_form.php';
|
||||
return;
|
||||
}
|
||||
|
||||
db_pandora_audit('Module management', "Update network component #$id");
|
||||
db_pandora_audit('Module management', 'Update network component #'.$id);
|
||||
ui_print_success_message(__('Updated successfully'));
|
||||
|
||||
$id = 0;
|
||||
|
@ -401,12 +403,12 @@ if ($delete_component) {
|
|||
if ($result) {
|
||||
db_pandora_audit(
|
||||
'Module management',
|
||||
"Delete network component #$id"
|
||||
'Delete network component #'.$id
|
||||
);
|
||||
} else {
|
||||
db_pandora_audit(
|
||||
'Module management',
|
||||
"Fail try to delete network component #$id"
|
||||
'Fail try to delete network component #'.$id
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -433,12 +435,12 @@ if ($multiple_delete) {
|
|||
if ($result) {
|
||||
db_pandora_audit(
|
||||
'Module management',
|
||||
"Multiple delete network component: $str_ids"
|
||||
'Multiple delete network component:'.$str_ids
|
||||
);
|
||||
} else {
|
||||
db_pandora_audit(
|
||||
'Module management',
|
||||
"Fail try to delete network component: $str_ids"
|
||||
'Fail try to delete network component:'.$str_ids
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -451,7 +453,10 @@ if ($multiple_delete) {
|
|||
$id = 0;
|
||||
}
|
||||
|
||||
if ($id || $new_component || $create_network_from_module || $create_network_from_snmp_browser) {
|
||||
if ($id || $new_component
|
||||
|| $create_network_from_module
|
||||
|| $create_network_from_snmp_browser
|
||||
) {
|
||||
include_once $config['homedir'].'/godmode/modules/manage_network_components_form.php';
|
||||
return;
|
||||
}
|
||||
|
@ -540,7 +545,7 @@ if ($component_groups === false) {
|
|||
foreach ($component_groups as $component_group_key => $component_group_val) {
|
||||
$num_components = db_get_num_rows(
|
||||
'SELECT id_nc
|
||||
FROM tnetwork_component
|
||||
FROM tnetwork_component
|
||||
WHERE id_group = '.$component_group_key
|
||||
);
|
||||
|
||||
|
@ -551,14 +556,14 @@ foreach ($component_groups as $component_group_key => $component_group_val) {
|
|||
if ($childs !== false) {
|
||||
foreach ($childs as $child) {
|
||||
$num_components_childs += db_get_num_rows(
|
||||
'SELECT id
|
||||
FROM tlocal_component
|
||||
'SELECT id
|
||||
FROM tlocal_component
|
||||
WHERE id_network_component_group = '.$child['id_sg']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Only show component groups with local components
|
||||
// Only show component groups with local components.
|
||||
if ($num_components == 0 && $num_components_childs == 0) {
|
||||
unset($component_groups[$component_group_key]);
|
||||
}
|
||||
|
@ -622,7 +627,11 @@ if ($search_string != '') {
|
|||
$filter[] = '(name LIKE '."'%".$search_string."%'".'OR description LIKE '."'%".$search_string."%'".'OR tcp_send LIKE '."'%".$search_string."%'".'OR tcp_rcv LIKE '."'%".$search_string."%'".')';
|
||||
}
|
||||
|
||||
$total_components = network_components_get_network_components(false, $filter, 'COUNT(*) AS total');
|
||||
$total_components = network_components_get_network_components(
|
||||
false,
|
||||
$filter,
|
||||
'COUNT(*) AS total'
|
||||
);
|
||||
$total_components = $total_components[0]['total'];
|
||||
ui_pagination($total_components, $url);
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
|
@ -651,7 +660,13 @@ unset($table);
|
|||
$table->width = '100%';
|
||||
$table->head = [];
|
||||
$table->class = 'info_table';
|
||||
$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->head['checkbox'] = html_print_checkbox(
|
||||
'all_delete',
|
||||
0,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
);
|
||||
$table->head[0] = __('Module name');
|
||||
$table->head[1] = __('Type');
|
||||
$table->head[3] = __('Description');
|
||||
|
@ -669,12 +684,21 @@ foreach ($components as $component) {
|
|||
$data = [];
|
||||
|
||||
if ($component['max'] == $component['min'] && $component['max'] == 0) {
|
||||
$component['max'] = $component['min'] = __('N/A');
|
||||
$component['max'] = __('N/A');
|
||||
$component['min'] = __('N/A');
|
||||
}
|
||||
|
||||
$data['checkbox'] = html_print_checkbox_extended('delete_multiple[]', $component['id_nc'], false, false, '', 'class="check_delete"', true);
|
||||
$data['checkbox'] = html_print_checkbox_extended(
|
||||
'delete_multiple[]',
|
||||
$component['id_nc'],
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'class="check_delete"',
|
||||
true
|
||||
);
|
||||
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&'.'sec2=godmode/modules/manage_network_components&'.'id='.$component['id_nc'].'&pure='.$pure.'">';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'">';
|
||||
$data[0] .= io_safe_output($component['name']);
|
||||
$data[0] .= '</a>';
|
||||
$data[1] = ui_print_moduletype_icon($component['type'], true);
|
||||
|
@ -702,6 +726,10 @@ foreach ($components as $component) {
|
|||
['title' => __('Plug-in module')]
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
break;
|
||||
}
|
||||
|
||||
$data[3] = "<span style='font-size: 8px'>".mb_strimwidth(io_safe_output($component['description']), 0, 60, '...').'</span>';
|
||||
|
@ -719,13 +747,32 @@ if (isset($data)) {
|
|||
echo "<form method='post' action='index.php?sec=".$sec.'&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure='.$pure."'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table($table);
|
||||
ui_pagination($total_components, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
ui_pagination(
|
||||
$total_components,
|
||||
$url,
|
||||
0,
|
||||
0,
|
||||
false,
|
||||
'offset',
|
||||
true,
|
||||
'pagination-bottom'
|
||||
);
|
||||
echo "<div style='float: right; margin-left: 5px;'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
'class="sub delete"'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined network components') ]);
|
||||
ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('There are no defined network components'),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="'.$url.'">';
|
||||
|
@ -744,7 +791,12 @@ html_print_select(
|
|||
'',
|
||||
''
|
||||
);
|
||||
html_print_submit_button(__('Create'), 'crt', false, 'class="sub next" style="margin-left: 5px;"');
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'crt',
|
||||
false,
|
||||
'class="sub next" style="margin-left: 5px;"'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
|
@ -752,30 +804,33 @@ enterprise_hook('close_meta_frame');
|
|||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('[id^=checkbox-delete_multiple]').change(function(){
|
||||
if($(this).parent().parent().hasClass('checkselected')){
|
||||
$(this).parent().parent().removeClass('checkselected');
|
||||
}
|
||||
else{
|
||||
$(this).parent().parent().addClass('checkselected');
|
||||
$(this).parent().parent().addClass('checkselected');
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=checkbox-all_delete]').change(function(){
|
||||
$('[id^=checkbox-all_delete]').change(function(){
|
||||
if ($("#checkbox-all_delete").prop("checked")) {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
$('[id^=checkbox-delete_multiple]')
|
||||
.parent()
|
||||
.parent()
|
||||
.addClass('checkselected');
|
||||
$(".check_delete")
|
||||
.prop("checked", true);
|
||||
}
|
||||
else{
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
|
||||
$('[id^=checkbox-delete_multiple]')
|
||||
.parent()
|
||||
.parent()
|
||||
.removeClass('checkselected');
|
||||
$(".check_delete").prop("checked", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue