Merge branch 'develop' into 'ent-4876-pandora_ui.js'
# Conflicts: # pandora_console/include/javascript/pandora.js
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, 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.740, 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.740, 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.740, 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.740, 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.740, 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.740
|
||||
# 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
|
||||
|
@ -325,6 +325,11 @@ install () {
|
||||
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
|
||||
chmod 755 $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.740, 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.740
|
||||
# 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.740, HPUX Version
|
||||
# Version 7.0NG.741, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740
|
||||
# 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.740
|
||||
# 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.740
|
||||
# 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.740, Solaris version
|
||||
# Version 7.0NG.741, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.740, 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.740-191121
|
||||
Version: 7.0NG.741-191127
|
||||
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.740-191121"
|
||||
pandora_version="7.0NG.741-191127"
|
||||
|
||||
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.740, 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.740, 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.740, 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.740, 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.740, 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.740, 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.740, 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.740';
|
||||
use constant AGENT_BUILD => '191121';
|
||||
use constant AGENT_VERSION => '7.0NG.741';
|
||||
use constant AGENT_BUILD => '191127';
|
||||
|
||||
# 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.
|
||||
################################################################################
|
||||
@ -777,6 +897,20 @@ sub read_config (;$) {
|
||||
|
||||
#Configuration token
|
||||
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.740
|
||||
%define release 191121
|
||||
%define version 7.0NG.741
|
||||
%define release 191127
|
||||
|
||||
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.740
|
||||
%define release 191121
|
||||
%define version 7.0NG.741
|
||||
%define release 191127
|
||||
|
||||
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.740"
|
||||
PI_BUILD="191121"
|
||||
PI_VERSION="7.0NG.741"
|
||||
PI_BUILD="191127"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
@ -401,6 +401,11 @@ install () {
|
||||
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
|
||||
echo "Copying tentacle server to $PANDORA_BASE$TENTACLE_SERVER"
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2017 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.740
|
||||
# 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.740}
|
||||
{Pandora FMS Windows Agent v7.0NG.741}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{191121}
|
||||
{191127}
|
||||
|
||||
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.740(Build 191121)")
|
||||
#define PANDORA_VERSION ("7.0NG.741(Build 191127)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -1918,18 +1918,21 @@ Pandora_Windows_Service::pandora_run_broker (string config, long executions) {
|
||||
}
|
||||
|
||||
/* Evaluate intensive conditions */
|
||||
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;
|
||||
}
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
}
|
||||
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
}
|
||||
|
||||
/* Evaluate module conditions */
|
||||
module->evaluateConditions ();
|
||||
|
||||
@ -2038,18 +2041,21 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
|
||||
}
|
||||
|
||||
/* Evaluate intensive conditions */
|
||||
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;
|
||||
}
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
|
||||
if (module->getTimestamp () + module->getInterval () * this->interval_sec <= this->run_time) {
|
||||
module->setTimestamp (this->run_time);
|
||||
}
|
||||
|
||||
module->setIntensiveMatch (intensive_match);
|
||||
}
|
||||
|
||||
/* Evaluate module conditions */
|
||||
module->evaluateConditions ();
|
||||
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.740(Build 191121))"
|
||||
VALUE "ProductVersion", "(7.0NG.741(Build 191127))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.740-191121
|
||||
Version: 7.0NG.741-191127
|
||||
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.740-191121"
|
||||
pandora_version="7.0NG.741-191127"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -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>
|
||||
|
@ -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>';
|
||||
|
@ -218,7 +218,8 @@ function quickShell()
|
||||
if (empty($config['gotty_user']) === false
|
||||
&& empty($config['gotty_pass']) === false
|
||||
) {
|
||||
$auth_str = $config['gotty_user'].':'.$config['gotty_pass'];
|
||||
$auth_str = io_safe_output($config['gotty_user']);
|
||||
$auth_str .= ':'.io_output_password($config['gotty_pass']);
|
||||
$gotty_url = $auth_str.'@'.$host.':'.$port;
|
||||
}
|
||||
|
||||
@ -381,7 +382,12 @@ function quickShellSettings()
|
||||
}
|
||||
|
||||
// Interface.
|
||||
ui_print_page_header(__('QuickShell settings'));
|
||||
ui_print_page_header(
|
||||
__('QuickShell settings'),
|
||||
'',
|
||||
false,
|
||||
'quickshell_settings'
|
||||
);
|
||||
|
||||
if ($changes > 0) {
|
||||
$msg = __('%d Updated', $changes);
|
||||
@ -441,6 +447,10 @@ function quickShellSettings()
|
||||
'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'),
|
||||
@ -463,6 +473,8 @@ function quickShellSettings()
|
||||
'value' => io_output_password($config['gotty_pass']),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'type' => 'hidden',
|
||||
|
@ -16,6 +16,79 @@ INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `ma
|
||||
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;
|
||||
|
@ -579,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`
|
||||
@ -627,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`
|
||||
-- -----------------------------------------------------
|
||||
@ -931,6 +967,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`
|
||||
@ -1291,13 +1328,13 @@ ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT '';
|
||||
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', 33);
|
||||
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', '741');
|
||||
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';
|
||||
@ -1358,6 +1395,7 @@ 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;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
@ -1906,6 +1944,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`
|
||||
@ -2357,7 +2396,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,
|
||||
@ -2411,6 +2450,38 @@ CREATE TABLE `tdeployment_hosts` (
|
||||
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`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -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">
|
56
pandora_console/general/first_task/omnishell.php
Normal file
@ -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">
|
@ -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">
|
77
pandora_console/general/sap_view.php
Normal file
@ -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();
|
||||
}
|
@ -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,6 +698,8 @@ if ($id_agente) {
|
||||
break;
|
||||
}
|
||||
|
||||
$pure = get_parameter('pure', 0);
|
||||
if (!$pure) {
|
||||
ui_print_page_header(
|
||||
agents_get_alias($id_agente),
|
||||
'images/setup.png',
|
||||
@ -715,6 +719,7 @@ if ($id_agente) {
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Create agent.
|
||||
ui_print_page_header(
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -352,7 +352,7 @@ 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) {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -28,7 +28,7 @@ if (check_acl($config['id_user'], 0, 'AR')
|
||||
|| 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';
|
||||
@ -346,6 +346,8 @@ if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, '
|
||||
$sub['godmode/setup/links']['id'] = 'Links';
|
||||
$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');
|
||||
|
@ -337,7 +337,7 @@ $table_aux = new stdClass();
|
||||
|
||||
echo '</div>';
|
||||
} else {
|
||||
include_once $config['homedir'].'/general/firts_task/custom_graphs.php';
|
||||
include_once $config['homedir'].'/general/first_task/custom_graphs.php';
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -395,7 +395,7 @@ if ($own_info['is_admin'] || $vconsoles_read) {
|
||||
if (!$maps && !is_metaconsole()) {
|
||||
$total = count(visual_map_get_user_layouts($config['id_user'], false, false, false));
|
||||
if (!$total) {
|
||||
include_once $config['homedir'].'/general/firts_task/map_builder.php';
|
||||
include_once $config['homedir'].'/general/first_task/map_builder.php';
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
[
|
||||
|
@ -54,7 +54,7 @@ function get_wiz_class($str)
|
||||
__('Discovery'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'discovery',
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
|
@ -154,7 +154,7 @@ foreach ($servers as $server) {
|
||||
if ($server['type'] == 'recon') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/firts_task/icono_grande_reconserver.png',
|
||||
'images/first_task/icono_grande_reconserver.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Manage Discovery tasks'),
|
||||
|
@ -304,7 +304,7 @@ if (!empty($result)) {
|
||||
} else if ($filter_performed) {
|
||||
echo $filter_form;
|
||||
} else {
|
||||
include $config['homedir'].'/general/firts_task/tags.php';
|
||||
include $config['homedir'].'/general/first_task/tags.php';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ class DiscoveryTaskList extends Wizard
|
||||
$ret2 = $this->showList();
|
||||
|
||||
if ($ret === false && $ret2 === false) {
|
||||
include_once $config['homedir'].'/general/firts_task/recon_view.php';
|
||||
include_once $config['homedir'].'/general/first_task/recon_view.php';
|
||||
} else {
|
||||
$form = [
|
||||
'form' => [
|
||||
@ -773,6 +773,9 @@ class DiscoveryTaskList extends Wizard
|
||||
case DISCOVERY_CLOUD_AWS_RDS:
|
||||
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&sub=rds&page=0';
|
||||
|
||||
case DISCOVERY_APP_SAP:
|
||||
return 'wiz=app&mode=SAP&page=0';
|
||||
|
||||
default:
|
||||
if ($task['description'] == 'console_task') {
|
||||
return 'wiz=ctask';
|
||||
|
@ -436,11 +436,15 @@ class Wizard
|
||||
*
|
||||
* @param array $input Definition of target block to be printed.
|
||||
* @param boolean $return Return as string or direct output.
|
||||
* @param boolean $direct Avoid encapsulation if input print is direct.
|
||||
*
|
||||
* @return string HTML content.
|
||||
*/
|
||||
public function printBlock(array $input, bool $return=false, bool $not_direct=false)
|
||||
{
|
||||
public function printBlock(
|
||||
array $input,
|
||||
bool $return=false,
|
||||
bool $direct=false
|
||||
) {
|
||||
$output = '';
|
||||
if ($input['hidden'] == 1) {
|
||||
$class = ' hidden';
|
||||
@ -453,7 +457,8 @@ class Wizard
|
||||
}
|
||||
|
||||
if (is_array($input['block_content']) === true) {
|
||||
$not_direct = (bool) $input['direct'];
|
||||
$direct = (bool) $input['direct'];
|
||||
$toggle = (bool) $input['toggle'];
|
||||
|
||||
// Print independent block of inputs.
|
||||
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
|
||||
@ -462,17 +467,44 @@ class Wizard
|
||||
$output .= '<'.$input['wrapper'].' id="'.$input['block_id'].'" class="'.$class.'">';
|
||||
}
|
||||
|
||||
if (!$not_direct) {
|
||||
if (!$direct) {
|
||||
// Avoid encapsulation if input is direct => 1.
|
||||
$output .= '<ul class="wizard '.$input['block_class'].'">';
|
||||
}
|
||||
|
||||
foreach ($input['block_content'] as $input) {
|
||||
$output .= $this->printBlock($input, $return, (bool) $not_direct);
|
||||
$html = '';
|
||||
|
||||
foreach ($input['block_content'] as $in) {
|
||||
$html .= $this->printBlock(
|
||||
$in,
|
||||
$return,
|
||||
(bool) $direct
|
||||
);
|
||||
}
|
||||
|
||||
if ($toggle === true) {
|
||||
$output .= ui_print_toggle(
|
||||
[
|
||||
'name' => (isset($input['toggle_name']) ? $input['toggle_name'] : 'toggle_'.uniqid()),
|
||||
'content' => $html,
|
||||
'title' => $input['toggle_title'],
|
||||
'id' => $input['toggle_id'],
|
||||
'hidden_default' => $input['toggle_hidden_default'],
|
||||
'return' => (isset($input['toggle_return']) ? $input['toggle_return'] : true),
|
||||
'toggle_class' => $input['toggle_toggle_class'],
|
||||
'main_class' => $input['toggle_main_class'],
|
||||
'container_class' => $input['toggle_container_class'],
|
||||
'img_a' => $input['toggle_img_a'],
|
||||
'img_b' => $input['toggle_img_b'],
|
||||
'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : true),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$output .= $html;
|
||||
}
|
||||
|
||||
// Close block.
|
||||
if (!$not_direct) {
|
||||
if (!$direct) {
|
||||
$output .= '</ul>';
|
||||
}
|
||||
|
||||
@ -482,8 +514,10 @@ class Wizard
|
||||
|
||||
$output .= '</li>';
|
||||
} else {
|
||||
if ($input['arguments']['type'] != 'hidden') {
|
||||
if (!$not_direct) {
|
||||
if ($input['arguments']['type'] != 'hidden'
|
||||
&& $input['arguments']['type'] != 'hidden_extended'
|
||||
) {
|
||||
if (!$direct) {
|
||||
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
|
||||
}
|
||||
|
||||
@ -491,7 +525,7 @@ class Wizard
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
// Allow dynamic content.
|
||||
$output .= $input['extra'];
|
||||
if (!$not_direct) {
|
||||
if (!$direct) {
|
||||
$output .= '</li>';
|
||||
}
|
||||
} else {
|
||||
@ -540,7 +574,9 @@ class Wizard
|
||||
|
||||
$output .= '</ul></li>';
|
||||
} else {
|
||||
if ($input['arguments']['type'] != 'hidden') {
|
||||
if ($input['arguments']['type'] != 'hidden'
|
||||
&& $input['arguments']['type'] != 'hidden_extended'
|
||||
) {
|
||||
if ($input['arguments']['inline'] != 'true') {
|
||||
$output .= '<div class="edit_discovery_input">';
|
||||
} else {
|
||||
@ -643,7 +679,9 @@ class Wizard
|
||||
|
||||
$output .= '</ul></li>';
|
||||
} else {
|
||||
if ($input['arguments']['type'] != 'hidden') {
|
||||
if ($input['arguments']['type'] != 'hidden'
|
||||
&& $input['arguments']['type'] != 'hidden_extended'
|
||||
) {
|
||||
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
|
||||
$output .= '<label>'.$input['label'].'</label>';
|
||||
$output .= $this->printInput($input['arguments']);
|
||||
@ -799,15 +837,18 @@ class Wizard
|
||||
$first_block_printed = true;
|
||||
}
|
||||
|
||||
$output .= '<div class="edit_discovery_info" style="'.$row['style'].'">';
|
||||
$output .= '<div class="edit_discovery_info '.$row['class'].'" style="'.$row['style'].'">';
|
||||
|
||||
foreach ($row['columns'] as $column) {
|
||||
$width = isset($column['width']) ? 'width: '.$column['width'].';' : 'width: 100%;';
|
||||
$padding_left = isset($column['padding-left']) ? 'padding-left: '.$column['padding-left'].';' : 'padding-left: 0;';
|
||||
$padding_right = isset($column['padding-right']) ? 'padding-right: '.$column['padding-right'].';' : 'padding-right: 0;';
|
||||
$extra_styles = isset($column['style']) ? $column['style'] : '';
|
||||
$class = isset($column['class']) ? $column['class'] : '';
|
||||
|
||||
$output .= '<div style="'.$width.$padding_left.$padding_right.$extra_styles.'">';
|
||||
$output .= '<div class="'.$class.'" ';
|
||||
$output .= ' style="'.$width.$padding_left.$padding_right;
|
||||
$output .= $extra_styles.'">';
|
||||
|
||||
foreach ($column['inputs'] as $input) {
|
||||
if (is_array($input)) {
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
pandora_console/images/first_task/omnishell.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
BIN
pandora_console/images/sap_icon.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
pandora_console/images/sortable.png
Normal file
After Width: | Height: | Size: 344 B |
@ -84,7 +84,7 @@ $delete_event = get_parameter('delete_event', 0);
|
||||
$get_event_filters = get_parameter('get_event_filters', 0);
|
||||
$get_comments = get_parameter('get_comments', 0);
|
||||
$get_events_fired = (bool) get_parameter('get_events_fired');
|
||||
|
||||
$get_id_source_event = get_parameter('get_id_source_event');
|
||||
if ($get_comments) {
|
||||
$event = get_parameter('event', false);
|
||||
$filter = get_parameter('filter', false);
|
||||
@ -253,7 +253,7 @@ if ($save_event_filter) {
|
||||
$values['source'] = get_parameter('source');
|
||||
$values['id_extra'] = get_parameter('id_extra');
|
||||
$values['user_comment'] = get_parameter('user_comment');
|
||||
|
||||
$values['id_source_event'] = get_parameter('id_source_event');
|
||||
$exists = (bool) db_get_value_filter(
|
||||
'id_filter',
|
||||
'tevent_filter',
|
||||
@ -300,6 +300,7 @@ if ($update_event_filter) {
|
||||
$values['source'] = get_parameter('source');
|
||||
$values['id_extra'] = get_parameter('id_extra');
|
||||
$values['user_comment'] = get_parameter('user_comment');
|
||||
$values['id_source_event'] = get_parameter('id_source_event');
|
||||
|
||||
if (io_safe_output($values['tag_with']) == '["0"]') {
|
||||
$values['tag_with'] = '[]';
|
||||
@ -465,6 +466,8 @@ function load_form_filter() {
|
||||
$("#text-id_extra").val(val);
|
||||
if (i == 'user_comment')
|
||||
$("#text-user_comment").val(val);
|
||||
if (i == 'id_source_event')
|
||||
$("#text-id_source_event").val(val);
|
||||
});
|
||||
reorder_tags_inputs();
|
||||
// Update the info with the loaded filter
|
||||
@ -685,7 +688,8 @@ function save_new_filter() {
|
||||
"date_to": $("#text-date_to").val(),
|
||||
"source": $("#text-source").val(),
|
||||
"id_extra": $("#text-id_extra").val(),
|
||||
"user_comment": $("#text-user_comment").val()
|
||||
"user_comment": $("#text-user_comment").val(),
|
||||
"id_source_event": $("#text-id_source_event").val()
|
||||
},
|
||||
function (data) {
|
||||
$("#info_box").hide();
|
||||
@ -754,7 +758,9 @@ function save_update_filter() {
|
||||
"date_to": $("#text-date_to").val(),
|
||||
"source": $("#text-source").val(),
|
||||
"id_extra": $("#text-id_extra").val(),
|
||||
"user_comment": $("#text-user_comment").val()
|
||||
"user_comment": $("#text-user_comment").val(),
|
||||
"id_source_event": $("#text-id_source_event").val()
|
||||
|
||||
},
|
||||
function (data) {
|
||||
$(".info_box").hide();
|
||||
|
@ -432,7 +432,7 @@ class CredentialStore extends Wizard
|
||||
return $return;
|
||||
}
|
||||
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
@ -866,6 +866,7 @@ class CredentialStore extends Wizard
|
||||
'CUSTOM' => __('Custom'),
|
||||
'AWS' => __('Aws'),
|
||||
'AZURE' => __('Azure'),
|
||||
'SAP' => __('SAP'),
|
||||
// 'GOOGLE' => __('Google'),
|
||||
],
|
||||
'selected' => (isset($values['product']) ? $values['product'] : 'CUSTOM'),
|
||||
@ -900,6 +901,7 @@ class CredentialStore extends Wizard
|
||||
case 'GOOGLE':
|
||||
// Need further investigation.
|
||||
case 'CUSTOM':
|
||||
case 'SAP':
|
||||
$user_label = __('Account ID');
|
||||
$pass_label = __('Password');
|
||||
$extra1 = false;
|
||||
@ -1038,6 +1040,11 @@ class CredentialStore extends Wizard
|
||||
$('#div-extra_2 label').text('<?php echo __('Subscription id'); ?>');
|
||||
$('#div-extra_1').show();
|
||||
$('#div-extra_2').show();
|
||||
} else if ($('#product :selected').val() == "SAP") {
|
||||
$('#div-username label').text('<?php echo __('Account ID.'); ?>');
|
||||
$('#div-password label').text('<?php echo __('Password'); ?>');
|
||||
$('#div-extra_1').hide();
|
||||
$('#div-extra_2').hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,10 @@ class Diagnostics extends Wizard
|
||||
// Check access.
|
||||
check_login();
|
||||
|
||||
$this->url = ui_get_full_url(
|
||||
'index.php?sec=gextensions&sec2=tools/diagnostics'
|
||||
);
|
||||
|
||||
$this->ajaxController = $page;
|
||||
$this->pdf = $pdf;
|
||||
$this->product_name = io_safe_output(get_product_name());
|
||||
@ -123,15 +127,34 @@ class Diagnostics extends Wizard
|
||||
{
|
||||
global $config;
|
||||
|
||||
if ($this->pdf === true) {
|
||||
$this->exportPDF();
|
||||
exit;
|
||||
}
|
||||
|
||||
ui_require_css_file('diagnostics');
|
||||
|
||||
$pdf_url = $this->url.'&pdf=true';
|
||||
$pdf_img = html_print_image(
|
||||
'images/pdf.png',
|
||||
true,
|
||||
['title' => __('Export to PDF')]
|
||||
);
|
||||
$header_buttons = [
|
||||
'csv' => [
|
||||
'active' => false,
|
||||
'text' => '<a target="_new" href="'.$pdf_url.'">'.$pdf_img.'</a>',
|
||||
],
|
||||
];
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('%s Diagnostic tool', $this->product_name),
|
||||
'images/gm_massive_operations.png',
|
||||
false,
|
||||
'diagnostic_tool_tab',
|
||||
true
|
||||
true,
|
||||
$header_buttons
|
||||
);
|
||||
|
||||
// Print all Methods Diagnostic Info.
|
||||
@ -2080,6 +2103,11 @@ class Diagnostics extends Wizard
|
||||
enterprise_include_once('/include/class/Pdf.class.php');
|
||||
$mpdf = new Pdf([]);
|
||||
|
||||
// Ignore pending HTML outputs.
|
||||
while (@ob_end_clean()) {
|
||||
$ignore_me;
|
||||
}
|
||||
|
||||
// ADD style.
|
||||
$mpdf->addStyle($config['homedir'].'/include/styles/diagnostics.css');
|
||||
|
||||
@ -2112,6 +2140,8 @@ class Diagnostics extends Wizard
|
||||
|
||||
// Write html filename.
|
||||
$mpdf->writePDFfile($filename);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
@ -93,12 +93,13 @@ class HelpFeedBack extends Wizard
|
||||
ui_require_css_File('discovery');
|
||||
ui_require_css_file('help_feedback');
|
||||
|
||||
$help_url = get_parameter('url', null);
|
||||
$help_url = get_parameter('b', null);
|
||||
$help_url = base64_decode($help_url);
|
||||
if ($help_url === null) {
|
||||
echo __('Page not found');
|
||||
} else {
|
||||
?>
|
||||
<iframe width="100%" height="100%" frameBorder="0"
|
||||
<iframe width="100%" height="100%" frameBorder="0" id="h_Viewer"
|
||||
src="<?php echo $help_url; ?>">
|
||||
<?php echo __('Browser not compatible.'); ?>
|
||||
</iframe>
|
||||
@ -143,7 +144,7 @@ class HelpFeedBack extends Wizard
|
||||
'block_content' => [
|
||||
[
|
||||
'arguments' => [
|
||||
'label' => __('Sugesstion'),
|
||||
'label' => __('Suggestion'),
|
||||
'type' => 'radio_button',
|
||||
'attributes' => 'class="btn"',
|
||||
'name' => 'suggestion',
|
||||
@ -154,7 +155,7 @@ class HelpFeedBack extends Wizard
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'label' => __('Something is not quite right'),
|
||||
'label' => __('Something is wrong'),
|
||||
'type' => 'radio_button',
|
||||
'attributes' => 'class="btn"',
|
||||
'name' => 'report',
|
||||
|
@ -20,8 +20,8 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC191121';
|
||||
$pandora_version = 'v7.0NG.740';
|
||||
$build_version = 'PC191127';
|
||||
$pandora_version = 'v7.0NG.741';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
@ -537,7 +537,7 @@ define('NODE_GENERIC', 3);
|
||||
define('STATUS_OK', 0);
|
||||
define('STATUS_ERROR', 1);
|
||||
|
||||
// Maps (new networkmaps and new visualmaps).
|
||||
// Maps new networkmaps and new visualmaps.
|
||||
define('MAP_TYPE_NETWORKMAP', 0);
|
||||
define('MAP_TYPE_VISUALMAP', 1);
|
||||
|
||||
@ -590,6 +590,7 @@ define('DISCOVERY_CLOUD_AWS_EC2', 6);
|
||||
define('DISCOVERY_CLOUD_AWS_RDS', 7);
|
||||
define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8);
|
||||
define('DISCOVERY_DEPLOY_AGENTS', 9);
|
||||
define('DISCOVERY_APP_SAP', 10);
|
||||
|
||||
|
||||
// Discovery types matching definition.
|
||||
|