Merge branch 'develop' into '412-consola-visual-Módulo-imagen'

# Conflicts:
#   pandora_console/godmode/reporting/visual_console_builder.editor.js
This commit is contained in:
Enrique Camargo 2017-07-17 10:39:20 +02:00
commit 1e7fbc443e
134 changed files with 49131 additions and 41247 deletions
index.pot
pandora_agents
pandora_console

View File

@ -127094,7 +127094,7 @@ msgstr ""
#: ../../Documentos/Pandoras/pandorafms_develop/pandora_console/godmode/setup/setup_ehorus.php:87
#: ../../Documentos/COPIA SEG/godmode/setup/setup_ehorus.php:87
#: ../../code/pandorafms/pandora_console/godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr ""
#: ../../Documentos/Pandoras/pandorafms_develop/pandora_console/godmode/setup/setup_ehorus.php:92

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.705-170613
Version: 7.0NG.707-170717
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,8 +40,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.705';
use constant AGENT_BUILD => '170613';
use constant AGENT_VERSION => '7.0NG.707';
use constant AGENT_BUILD => '170717';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.705
%define release 170613
%define version 7.0NG.707
%define release 170717
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.705
%define release 170613
%define version 7.0NG.707
%define release 170717
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -1,17 +1,20 @@
#!/usr/bin/perl
###############################################################################
########################################################################
# Pandora FMS - Remote Event Tool (via WEB API)
###############################################################################
########################################################################
# Copyright (c) 2013 Artica Soluciones Tecnologicas S.L
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 2
###############################################################################
########################################################################
# Includes list
use strict;
use LWP::Simple;
use MIME::Base64;
use lib '/usr/lib/perl5';
use PandoraFMS::Tools;
# Init
tool_api_init();
@ -19,72 +22,76 @@ tool_api_init();
# Main
tool_api_main();
##############################################################################
########################################################################
# Print a help screen and exit.
##############################################################################
########################################################################
sub help_screen{
print "Options to create event:
\t$0 -p <path_to_consoleAPI> -create event <options>
\t$0 -p <path_to_consoleAPI> -u <credentials> -create_event <options>
Where options:\n
-u <credentials>
-create_event
-name <event_name> : Free text
-group <id_group> : Group ID (use 0 for 'all')
-type <event_type> : unknown, alert_fired, alert_recovered, alert_ceased
alert_manual_validation, system, error, new_agent
configuration_change, going_unknown, going_down_critical,
going_down_warning, going_up_normal
-u <credentials> : API credentials separated by comma: <api_pass>,<user>,<pass>
-name <event_name> : Free text
-group <id_group> : Group ID (use 0 for 'all')
-agent : Agent ID
Optional parameters:
[-agent <id_agent>] : Agent ID
[-user <id_user>] : User comment (use in combination with -comment option)
[-status <status>] : 0 New, 1 Validated, 2 In process
[-am <id_agent_module>] : ID Agent Module linked to event
[-alert <id_alert_am>] : ID Alert Module linked to event
[-criticity <criticity>] : 0 Maintance, 1 Informative, 2 Normal,
3 Warning, 4 Crit, 5 Minor, 6 Major
[-status <status>] : 0 New, 1 Validated, 2 In process
[-user <id_user>] : User comment (use in combination with -comment option)
[-type <event_type>] : unknown, alert_fired, alert_recovered, alert_ceased
alert_manual_validation, system, error, new_agent
configuration_change, going_unknown, going_down_critical,
going_down_warning, going_up_normal
[-severity <severity>] : 0 Maintance,
1 Informative,
2 Normal,
3 Warning,
4 Crit,
5 Minor,
6 Major
[-am <id_agent_module>] : ID Agent Module linked to event
[-alert <id_alert_am>] : ID Alert Module linked to event
[-c_instructions <critical_instructions>]
[-w_instructions <warning_instructions>]
[-u_instructions <unknown_instructions>]
[-user_comment <comment>]
[-owner_user <owner event>] : Use the login name, not the descriptive
[-source <source>] : (By default 'Pandora')
[-tag <tags>] : Tag (must exist in the system to be imported)
[-custom_data <custom_data>]: Custom data has to be in JSON format. Example: -custom_data \'{\"test1\" : \"t1\", \"test2\": \"2\"}\'
[-id_extra <id extra>] : Id extra
[-agent_name <Agent name>] : Agent name, Not to be confused with the alias.
[-force_create_agent<0 o 1>]: Force the creation of agent through an event this will create when it is 1.
[-server_id <server_id>] : The pandora node server_id\n\n";
[-comment <user_comment>] : Free text for comment
[-tag <tags>] : Tag (must exist in the system to be imported)
[-source <source>] : (By default 'Pandora')
[-c_instructions <critical_instructions>]
[-w_instructions <warning_instructions>]
[-u_instructions <unknown_instructions>]
[-owner <owner_user>] : Use the login name, not the descriptive \n\n";
print "Credential/API syntax: \n\n\t";
print "<credentials>: API credentials separated by comma: <api_pass>,<user>,<pass>\n\n";
print "Example of event generation:\n\n";
print "\t$0 -p http://192.168.70.160/pandora_console/include/api.php -u pot12,admin,pandora \
\t-create_event -name \"Sample event executed from commandline\" -group 2 -type \"system\" -agent 2 \
\t-user \"admin\" -status 0 -am 0 -alert 9 -criticity 3 -comment \"User comments\" -tag \"tags\" \
\t-source \"Commandline\" -c_instructions \"Critical instructions\" \
\t-w_instructions \"Warning instructions\" -u_instructions \"Unknown instructions\" -owner \"other\" ";
print "\n\nOptions to validate event: \n\n\t";
print "$0 -p <path_to_consoleAPI> -u <credentials> -validate_event <options> -id <id_event>\n\n";
print "Sample of event validation: \n\n\t";
print "$0 -p http://localhost/pandora/include/api.php -u pot12,admin,pandora -validate_event -id 234";
print "\n\n\n";
exit;
print "\t./pandora_revent.pl -p http://localhost/pandora_console/include/api.php -u 1234,admin,pandora \
\t-create_event -name \"SampleEvent\" -group 2 -agent 189 -status 0 -user \"admin\" -type \"system\" \
\t-severity 3 -am 0 -alert 9 -c_instructions \"Critical instructions\" -w_instructions \"Warning instructions\" \
\t-u_instructions \"Unknown instructions\" -id_extra \"id extra\" -agent_name \"agent name\" -source \"Commandline\" -tag \"Tags\"";
print "\n\n\nOptions to validate event: \n\n\t";
print "$0 -p <path_to_consoleAPI> -u <credentials> -validate_event <options> -id <id_event>\n\n";
print "Sample of event validation: \n\n\t";
print "$0 -p http://localhost/pandora/include/api.php -u pot12,admin,pandora -validate_event -id 234";
print "\n\n\n";
exit;
}
##############################################################################
# Init screen
##############################################################################
sub tool_api_init () {
print "\nPandora FMS Remote Event Tool Copyright (c) 2015 Artica ST\n";
print "\nPandora FMS Remote Event Tool Copyright (c) 2013-2015 Artica ST\n";
print "This program is Free Software, licensed under the terms of GPL License v2\n";
print "You can download latest versions and documentation at http://www.pandorafms.org\n\n";
if ($#ARGV < 0) {
help_screen();
}
@ -92,14 +99,14 @@ sub tool_api_init () {
if (($ARGV[0] eq '-h') || ($ARGV[0] eq '-help')) {
help_screen();
}
}
###############################################################################
###############################################################################
########################################################################
########################################################################
# MAIN
###############################################################################
###############################################################################
########################################################################
########################################################################
sub tool_api_main () {
@ -114,33 +121,37 @@ sub tool_api_main () {
my $db_pass;
my @db_info;
my $id_agent;
my $agent_name;
my $id_user = '';
my $status = '';
my $id_agent_module = '';
my $module_name = '';
my $id_alert_am = '';
my $criticity = '';
my $severity = '';
my $user_comment = '';
my $tags = '';
my $source = '';
my $id_extra = '';
my $critical_instructions = '';
my $warning_instructions = '';
my $unknown_instructions = '';
my $id_extra = '';
my $agent_name = '';
my $force_create_agent = 0;
my $owner_user = '';
my $id_event;
my $option = $ARGV[4];
my $call_api;
my $custom_data = "";
my $server_id = 0;
#~ help or api path (required)
if ($ARGV[0] eq '-h') {
print "HELP!\n";
help_screen();
} elsif ($ARGV[0] ne '-p') {
}
elsif ($ARGV[0] ne '-p') {
print "[ERROR] Missing API path! Read help info:\n\n";
help_screen ();
} else {
}
else {
$api_path = $ARGV[1];
}
@ -152,105 +163,149 @@ sub tool_api_main () {
if ($#db_info < 2) {
print "[ERROR] Invalid database credentials! Read help info:\n\n";
help_screen();
} else {
}
else {
$api_pass = $db_info[0];
$db_user = $db_info[1];
$db_pass = $db_info[2];
}
} else {
}
else {
print "[ERROR] Missing database credentials! Read help info:\n\n";
help_screen ();
}
if ($ARGV[4] eq '-create_event') {
#~ event name (required)
if ($ARGV[5] ne '-name') {
print "[ERROR] Missing event name! Read help info:\n\n";
help_screen ();
} else {
$event_name = $ARGV[6];
}
#~ id group (required)
if ($ARGV[7] ne '-group') {
print "[ERROR] Missing event group! Read help info:\n\n";
help_screen ();
} else {
$id_group = $ARGV[8];
}
#~ id group (required)
if ($ARGV[9] ne '-type') {
print "[ERROR] Missing event type! Read help info:\n\n";
help_screen ();
} else {
$event_type = $ARGV[10];
}
# -agent_name, -module_name and -extra are not supported by api. Maybe in the future
my $i = 0;
foreach (@ARGV) {
my $line = $_;
#-----------DEBUG----------------------------
#print("i " . $i . " line " . $line . "\n");
if ($line eq '-agent') {
$id_agent = $ARGV[$i+1];
$id_agent = $ARGV[$i + 1];
}
if ($line eq '-agent_name') {
$agent_name = $ARGV[$i+1];
if ($line eq '-group') {
$id_group = $ARGV[$i + 1];
}
if ($line eq '-name') {
$event_name = $ARGV[$i + 1];
}
if ($line eq '-type') {
$event_type = $ARGV[$i + 1];
}
if ($line eq '-user') {
$id_user = $ARGV[$i+1];
$id_user = $ARGV[$i + 1];
}
if ($line eq '-status') {
$status = $ARGV[$i+1];
$status = $ARGV[$i + 1];
}
if ($line eq '-am') {
$id_agent_module = $ARGV[$i+1];
}
if ($line eq '-module_name') {
$module_name = $ARGV[$i+1];
$id_agent_module = $ARGV[$i + 1];
}
if ($line eq '-alert') {
$id_alert_am = $ARGV[$i+1];
$id_alert_am = $ARGV[$i + 1];
}
if ($line eq '-criticity') {
$criticity = $ARGV[$i+1];
}
if ($line eq '-comment') {
$user_comment = $ARGV[$i+1];
if ($line eq '-severity') {
$severity = $ARGV[$i + 1];
}
if ($line eq '-tag') {
$tags = $ARGV[$i+1];
$tags = $ARGV[$i + 1];
}
if ($line eq '-source') {
$source = $ARGV[$i+1];
}
if ($line eq '-extra') {
$id_extra = $ARGV[$i+1];
$source = $ARGV[$i + 1];
}
if ($line eq '-c_instructions') {
$critical_instructions = $ARGV[$i+1];
$critical_instructions = $ARGV[$i + 1];
$critical_instructions = uri_encode($critical_instructions);
}
if ($line eq '-w_instructions') {
$warning_instructions = $ARGV[$i+1];
$warning_instructions = $ARGV[$i + 1];
$warning_instructions = uri_encode($warning_instructions);
}
if ($line eq '-u_instructions') {
$unknown_instructions = $ARGV[$i+1];
$unknown_instructions = $ARGV[$i + 1];
$unknown_instructions = uri_encode($unknown_instructions);
}
if ($line eq '-owner') {
$owner_user = $ARGV[$i+1];
if ($line eq '-id_extra') {
$id_extra = $ARGV[$i + 1];
}
if ($line eq '-agent_name') {
$agent_name = $ARGV[$i + 1];
}
if ($line eq '-force_create_agent') {
$force_create_agent = $ARGV[$i + 1];
}
if ($line eq '-user_comment') {
$user_comment = $ARGV[$i + 1];
}
if ($line eq '-owner_user') {
$owner_user = $ARGV[$i + 1];
}
if ($line eq '-custom_data') {
$custom_data = $ARGV[$i + 1];
$custom_data = encode_base64($custom_data, '');
}
if ($line eq '-server_id') {
$server_id = $ARGV[$i + 1];
}
$i++;
}
$data_event .= $event_name.",".$id_group.",".$id_agent.",".$status.",".$id_user.",".$event_type.",".$criticity.",".$id_agent_module.",".$id_alert_am.",".$critical_instructions.",".$warning_instructions.",".$unknown_instructions.",".$user_comment.",".$owner_user.",".$source.",".$tags.",";
$call_api = $api_path.'?op=set&op2=create_event&id='.$event_name.'&other='.$data_event.'&other_mode=url_encode_separator_,&apipass='.$api_pass.'&user='.$db_user.'&pass='.$db_pass;
if ($event_name eq "") {
print "[ERROR] Missing id agent! Read help info:\n\n";
help_screen ();
}
if ($id_group eq "") {
print "[ERROR] Missing event group! Read help info:\n\n";
help_screen ();
}
if ($id_agent eq "" && $agent_name eq "") {
print "[ERROR] Missing id agent! and agent_name Read help info:\n\n";
help_screen ();
}
$data_event = $event_name .
"|" . $id_group .
"|" . $id_agent .
"|" . $status .
"|" . $id_user .
"|" . $event_type .
"|" . $severity .
"|" . $id_agent_module .
"|" . $id_alert_am .
"|" . $critical_instructions .
"|" . $warning_instructions .
"|" . $unknown_instructions .
"|" . $user_comment .
"|" . $owner_user .
"|" . $source .
"|" . $tags .
"|" . $custom_data .
"|" . $server_id .
"|" . $id_extra .
"|" . $agent_name .
"|" . $force_create_agent;
} elsif ($ARGV[4] eq '-validate_event') {
#~ id event(required)
$call_api = $api_path . '?' .
'op=set&' .
'op2=create_event&' .
'other=' . $data_event .'&' .
'other_mode=url_encode_separator_|&' .
'apipass=' . $api_pass . '&' .
'user=' . $db_user . '&' .
'pass=' . $db_pass;
}
elsif ($ARGV[4] eq '-validate_event') {
#~ id event(required)
if ($ARGV[5] ne '-id') {
print "[ERROR] Missing id event! Read help info:\n\n";
help_screen ();
} else {
}
else {
$id_event = $ARGV[6];
}
@ -258,8 +313,8 @@ sub tool_api_main () {
}
my @args = @ARGV;
my $ltotal=$#args;
my $ltotal=$#args;
if ($ltotal < 0) {
print "[ERROR] No valid arguments. Read help info:\n\n";
help_screen ();
@ -272,15 +327,17 @@ sub tool_api_main () {
if ($content eq undef) {
print "[ERROR] Not respond or bad syntax. Read help info:\n\n";
help_screen();
} else {
}
else {
print "Event ID: $content";
}
} elsif ($option eq '-validate_event') {
}
elsif ($option eq '-validate_event') {
print "[RESULT] $content";
}
}
print "\nExiting!\n\n";
exit;
print "\nExiting!\n\n";
exit;
}

View File

@ -48,7 +48,7 @@ else
my $onlyexclude = 1;
# Store all "ext" fstypes in @lines array
my @lines = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1":"\$2":"\$(NF-1)":"\$NF}' | grep -i "adfs\\|affs\\|autofs\\|btrfs\\|cifs\\|coda\\|coherent\\|efs\\|ext\\|hfs\\|hfsplus\\|hpfs\\|jfs\\|minix\\|msdos\\|ncpfs\\|nfs\\|nfs4\\|ntfs\\|proc\\|qnx4\\|reiserfs\\|smbfs\\|sysv\\|ubifs\\|udf\\|ufs\\|umsdos\\|usbfs\\|vfat\\|xenix\\|xfs\\|xiafs"`;
my @lines = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1";"\$2";"\$(NF-1)";"\$NF}' | grep -i "adfs\\|affs\\|autofs\\|btrfs\\|cifs\\|coda\\|coherent\\|efs\\|ext\\|hfs\\|hfsplus\\|hpfs\\|jfs\\|minix\\|msdos\\|ncpfs\\|nfs\\|nfs4\\|ntfs\\|proc\\|qnx4\\|reiserfs\\|smbfs\\|sysv\\|ubifs\\|udf\\|ufs\\|umsdos\\|usbfs\\|vfat\\|xenix\\|xfs\\|xiafs"`;
chomp (@lines);
@ -61,7 +61,7 @@ else
}
else
{
my @linesmanual = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1":"\$2":"\$(NF-1)":"\$NF}' | grep -i $fs`;
my @linesmanual = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1";"\$2";"\$(NF-1)";"\$NF}' | grep -i $fs`;
chomp (@linesmanual);
@ -76,7 +76,7 @@ else
foreach (@lines)
{
my ($filesystem, $fstype, $used_space, $mount_point) = split /:/,$_;
my ($filesystem, $fstype, $used_space, $mount_point) = split /;/,$_;
if (defined ($filesystems{$mount_point}) || (!defined ($excluded_filesystems{$mount_point})))
{

View File

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

View File

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

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.705(Build 170613)")
#define PANDORA_VERSION ("7.0NG.707(Build 170717)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.705(Build 170613))"
VALUE "ProductVersion", "(7.0NG.707(Build 170717))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.705-170613
Version: 7.0NG.707-170717
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -60,9 +60,31 @@ function mainAgentsAlerts() {
}
$updated_time = $updated_info;
$create_alert = (int)get_parameter ("create_alert",0);
if($create_alert){
$template2 = get_parameter("template");
$module_action_threshold = get_parameter("module_action_threshold");
$id_alert = alerts_create_alert_agent_module ($create_alert, $template2);
if ($id_alert !== false) {
$action_select = get_parameter("action_select",0);
if ($action_select != 0) {
$values = array();
$values['fires_min'] = 0;
$values['fires_max'] = 0;
$values['module_action_threshold'] =
(int)get_parameter ('module_action_threshold');
alerts_add_alert_agent_module_action ($id_alert, $action_select, $values);
}
}
}
$refr = get_parameter('refr', 30); // By default 30 seconds
$show_modules = (bool) get_parameter ("show_modules",0);
$group_id = get_parameter('group_id', 0);
$offset = get_parameter('offset', 0);
$hor_offset = get_parameter('hor_offset', 0);
@ -70,10 +92,12 @@ function mainAgentsAlerts() {
$groups = users_get_groups ();
$filter_groups = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => 0, 'hor_offset' => 0)).'">';
$filter_groups .= '<b>'.__('Group').'</b>';
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, 'this.form.submit()', '', '', true, false, true, '', false , 'width: 100px; margin-right: 10px;; margin-top: 5px;');
$filter_groups .= '</form>';
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, false, '', '', true, false, true, '', false , 'margin-right: 10px; margin-top: 5px;');
$check = '<b>'.__('Show modules without alerts').'</b>';
$check .= html_print_checkbox('slides_ids[]', $d['id'], $show_modules, true, false, '', true);
$comborefr = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => 0, 'hor_offset' => 0)).'">';
$comborefr .= '<b>'.__('Refresh').'</b>';
@ -87,12 +111,12 @@ function mainAgentsAlerts() {
$comborefr .= "</form>";
if ($config["pure"] == 0) {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_alerts&amp;pure=1&amp;offset='.$offset.'&group_id='.$group_id.'">'
$fullscreen['text'] = '<a href="'.ui_get_url_refresh(array ('pure' => 1)).'">'
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
}
else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_alerts&amp;refr=0&amp;offset='.$offset.'&group_id='.$group_id.'">'
$fullscreen['text'] = '<a href="'.ui_get_url_refresh(array ('pure' => 0)).'">'
. html_print_image ("images/normal_screen.png", true, array ("title" => __('Back to normal mode')))
. "</a>";
$config['refr'] = $refr;
@ -113,161 +137,288 @@ function mainAgentsAlerts() {
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo "<tr>";
echo "<td>" . $filter_groups . "</td>";
echo "<td>" . $check . "</td>";
if ($config['pure'] == 1)
echo "<td>" . $comborefr . "</td>";
echo "<td> <strong>" . __("Full screen") . "</strong>" . $fullscreen['text'] . "</td>";
echo "</tr>";
echo "</table>";
$filter = array ('offset' => (int) $offset,
'limit' => (int) $config['block_size']);
$filter_count = array();
if ($group_id > 0) {
$filter['id_grupo'] = $group_id;
$filter_count['id_grupo'] = $group_id;
}
// Get the id of all agents with alerts
$sql = 'SELECT DISTINCT(id_agente)
FROM tagente_modulo
WHERE id_agente_modulo IN
(SELECT id_agent_module
FROM talert_template_modules)';
$agents_with_alerts_raw = db_get_all_rows_sql($sql);
if ($agents_with_alerts_raw === false) {
$agents_with_alerts_raw = array();
}
$agents_with_alerts = array();
foreach ($agents_with_alerts_raw as $awar) {
$agents_with_alerts[] = $awar['id_agente'];
}
$filter['id_agente'] = $agents_with_alerts;
$filter_count['id_agente'] = $agents_with_alerts;
$agents = agents_get_agents ($filter);
$nagents = count(agents_get_agents ($filter_count));
if ($agents == false) {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no agents with alerts') ) );
return;
}
$all_alerts = agents_get_alerts_simple ();
if($config["pure"] == 1) {
$block = count($all_alerts);
}
$templates = array();
$agent_alerts = array();
foreach ($all_alerts as $alert) {
$templates[$alert['id_alert_template']] = '';
$agent_alerts[$alert['agent_name']][$alert['id_alert_template']][] = $alert;
}
// Prepare pagination
ui_pagination ($nagents);
echo '<table class="databox data" cellpadding="0" cellspacing="0" border="0" width=100%>';
echo "<th width='140px' >".__("Agents")." / ".__("Alert templates")."</th>";
if ($hor_offset > 0) {
$new_hor_offset = $hor_offset-$block;
echo "<th width='20px' style='' rowspan='".($nagents+1)."'>
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&refr=0&hor_offset=".
$new_hor_offset."&offset=".$offset."&group_id=".$group_id."'>".
html_print_image("images/darrowleft.png",true, array('title' => __('Previous templates')))."</a> </th>";
}
$templates_raw = array();
if (!empty($templates)) {
$sql = sprintf('SELECT id, name
FROM talert_templates
WHERE id IN (%s)',implode(',',array_keys($templates)));
if($show_modules){
$templates_raw = db_get_all_rows_sql($sql);
}
if (empty($templates_raw))
$templates_raw = array();
$alerts = array();
$ntemplates = 0;
foreach ($templates_raw as $temp) {
if (isset($templates[$temp['id']]) && $templates[$temp['id']] == '') {
$ntemplates++;
if ($ntemplates <= $hor_offset || $ntemplates > ($hor_offset+$block)) {
continue;
if($group_id > 0){
$grupo = " AND tagente.id_grupo = $group_id";
} else {
$grupo ='';
}
$offset_modules = get_parameter ("offset",0);
$sql_count = "SELECT COUNT(tagente_modulo.nombre) FROM tagente_modulo
INNER JOIN tagente ON tagente.id_agente = tagente_modulo.id_agente
WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules)
$grupo";
$count_agent_module = db_get_all_rows_sql($sql_count);
$sql = "SELECT tagente.alias, tagente_modulo.nombre,
tagente_modulo.id_agente_modulo FROM tagente_modulo
INNER JOIN tagente ON tagente.id_agente = tagente_modulo.id_agente
WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules)
$grupo LIMIT 20 OFFSET $offset_modules";
$agent_modules = db_get_all_rows_sql($sql);
ui_pagination ($count_agent_module[0]['COUNT(tagente_modulo.nombre)'],
ui_get_url_refresh(),0,0,false,'offset',true,'',
'',false,'alerts_modules');
$table->width = '100%';
$table->class = "databox data";
$table->id = "table_agent_module";
$table->data = array ();
$table->head[0] = __('Agents');
$table->head[1] = __('Modules');
$table->head[2] = __('Actions');
$table->style[0]= 'width: 25%;';
$table->style[1]= 'width: 33%;';
$table->style[2]= 'width: 33%;';
foreach($agent_modules as $agent_module) {
$data[0] = io_safe_output($agent_module['alias']);
$data[1] = io_safe_output($agent_module['nombre']);
$uniqid = $agent_module['id_agente_modulo'];
$data[2] = "<a title='".__('Create alert')."' href='javascript:show_add_alerts(\"$uniqid\")'>".html_print_image('images/add_mc.png', true)."</a>";
array_push ($table->data, $data);
$table2->width = '100%';
$table2->id = "table_add_alert";
$table2->class = 'databox filters';
$table2->data = array ();
// $data[0] =
$table2->data[0][0] = __('Actions');
$groups_user = users_get_groups($config["id_user"]);
if (!empty($groups_user)) {
$groups = implode(',', array_keys($groups_user));
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
$actions = db_get_all_rows_sql($sql);
}
$table2->data[0][1] = html_print_select(
index_array($actions, 'id', 'name'), 'action_select', '', '',
__('Default action'), '0', true, '', true, '', false,
'width: 250px;');
$table2->data[0][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
$table2->data[0][1] .= __('Number of alerts match from').' ';
$table2->data[0][1] .= html_print_input_text ('fires_min', '', '', 4, 10, true);
$table2->data[0][1] .= ' ' . __('to') . ' ';
$table2->data[0][1] .= html_print_input_text ('fires_max', '', '', 4, 10, true);
$table2->data[0][1] .= ui_print_help_icon ("alert-matches", true,
ui_get_full_url(false, false, false, false));
$table2->data[0][1] .= '</span>';
if (check_acl ($config['id_user'], 0, "LM")) {
$table2->data[0][1] .= '<a style="margin-left:5px;" href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table2->data[0][1] .= html_print_image ('images/add.png', true);
$table2->data[0][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Action').'</span>';
$table2->data[0][1] .= '</a>';
}
$table2->data[1][0] = __('Template');
$own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$templates = alerts_get_alert_templates (false, array ('id', 'name'));
else {
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates (array ('id_group IN (' . $filter_groups . ')'), array ('id', 'name'));
}
$table2->data[1][1] = html_print_select (index_array ($templates, 'id', 'name'),
'template', '', '', __('Select'), 0, true, false, true, '', false, 'width: 250px;');
$table2->data[1][1] .= ' <a class="template_details invisible" href="#">' .
html_print_image("images/zoom.png", true, array("class" => 'img_help')) . '</a>';
if (check_acl ($config['id_user'], 0, "LM")) {
$table2->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
$table2->data[1][1] .= html_print_image ('images/add.png', true);
$table2->data[1][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Template').'</span>';
$table2->data[1][1] .= '</a>';
}
$table2->data[2][0] = __('Threshold');
$table2->data[2][1] = html_print_input_text ('module_action_threshold', '0', '', 5, 7, true);
$table2->data[2][1] .= ' ' . __('seconds') . ui_print_help_icon ('action_threshold', true);
$content2 = '<form class="add_alert_form" method="post">';
$content2 .= html_print_table($table2,true);
$content2 .= '<div class="action-buttons" style="width: '.$table2->width.'">';
$content2 .= html_print_submit_button (__('Add alert'), 'add', false, 'class="sub wand"',true);
$content2 .= html_print_input_hidden ('create_alert', $uniqid,true);
$content2 .= '</div></form>';
$module_name = ui_print_truncate_text(io_safe_output($agent_module['nombre']), 40, false, true, false, '&hellip;', false);
echo '<div id="add_alerts_dialog_'.$uniqid.'" title="'.__('Agent').': '.$agent_module['alias'].' / '.__('module').': '.$module_name.'" style="display:none">'.$content2.'</div>';
}
html_print_table($table);
} else {
$filter = array ('offset' => (int) $offset,
'limit' => (int) $config['block_size']);
$filter_count = array();
if ($group_id > 0) {
$filter['id_grupo'] = $group_id;
$filter_count['id_grupo'] = $group_id;
}
// Get the id of all agents with alerts
$sql = 'SELECT DISTINCT(id_agente)
FROM tagente_modulo
WHERE id_agente_modulo IN
(SELECT id_agent_module
FROM talert_template_modules)';
$agents_with_alerts_raw = db_get_all_rows_sql($sql);
if ($agents_with_alerts_raw === false) {
$agents_with_alerts_raw = array();
}
$agents_with_alerts = array();
foreach ($agents_with_alerts_raw as $awar) {
$agents_with_alerts[] = $awar['id_agente'];
}
$filter['id_agente'] = $agents_with_alerts;
$filter_count['id_agente'] = $agents_with_alerts;
$agents = agents_get_agents ($filter);
$nagents = count(agents_get_agents ($filter_count));
if ($agents == false) {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no agents with alerts') ) );
return;
}
$all_alerts = agents_get_alerts_simple ();
if($config["pure"] == 1) {
$block = count($all_alerts);
}
$templates = array();
$agent_alerts = array();
foreach ($all_alerts as $alert) {
$templates[$alert['id_alert_template']] = '';
$agent_alerts[$alert['agent_name']][$alert['id_alert_template']][] = $alert;
}
// Prepare pagination
ui_pagination ($nagents,false,0,0,false,'offset',true,'',
'',array('count' => '', 'offset' => 'offset_param'),'alerts_agents');
echo '<table class="databox data" cellpadding="0" cellspacing="0" border="0" width=100%>';
echo "<th width='140px' >".__("Agents")." / ".__("Alert templates")."</th>";
if ($hor_offset > 0) {
$new_hor_offset = $hor_offset-$block;
echo "<th width='20px' style='' rowspan='".($nagents+1)."'>
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&refr=0&hor_offset=".
$new_hor_offset."&offset=".$offset."&group_id=".$group_id."'>".
html_print_image("images/darrowleft.png",true, array('title' => __('Previous templates')))."</a> </th>";
}
$templates_raw = array();
if (!empty($templates)) {
$sql = sprintf('SELECT id, name
FROM talert_templates
WHERE id IN (%s)',implode(',',array_keys($templates)));
$templates_raw = db_get_all_rows_sql($sql);
}
if (empty($templates_raw))
$templates_raw = array();
$alerts = array();
$ntemplates = 0;
foreach ($templates_raw as $temp) {
if (isset($templates[$temp['id']]) && $templates[$temp['id']] == '') {
$ntemplates++;
if ($ntemplates <= $hor_offset || $ntemplates > ($hor_offset+$block)) {
continue;
}
$templates[$temp['id']] = $temp['name'];
}
$templates[$temp['id']] = $temp['name'];
}
}
foreach ($templates as $tid => $tname) {
if ($tname == '') {
continue;
}
echo '<th width="20px" >'. io_safe_output($tname) . html_print_image('images/information_alerts.png', true, array('title' => io_safe_output($tname),'style' => 'margin-left:5px' )) ."</th>";
}
if (($hor_offset + $block) < $ntemplates) {
$new_hor_offset = $hor_offset+$block;
echo "<th width='20px' style='' rowspan='".($nagents+1)."'>
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&hor_offset=".$new_hor_offset."&offset=".
$offset."&group_id=".$group_id."'>".html_print_image("images/darrowright.png",true, array('title' => __('More templates')))."</a> </th>";
}
foreach ($agents as $agent) {
$alias = db_get_row ('tagente', 'id_agente', $agent['id_agente']);
echo '<tr>';
// Name of the agent
echo '<td style="font-weight:bold;">'.$alias['alias'].'</td>';
// Alerts of the agent
$anyfired = false;
foreach ($templates as $tid => $tname) {
if ($tname == '') {
continue;
}
if (isset($agent_alerts[$agent['nombre']][$tid])) {
foreach($agent_alerts[$agent['nombre']][$tid] as $alert) {
if($alert["times_fired"] > 0) {
$anyfired = true;
}
}
$cellstyle = '';
if($anyfired) {
$cellstyle = 'background:'.COL_ALERTFIRED.';';
}
echo '<td style=";'.$cellstyle.'"> ';
$uniqid = uniqid();
echo "<div>";
echo count($agent_alerts[$agent['nombre']][$tid])." ".__('Alerts')." ";
echo "<a href='javascript:show_alerts_details(\"$uniqid\")'>".html_print_image('images/zoom.png', true)."</a>";
echo "</div>";
print_alerts_summary_modal_window($uniqid, $agent_alerts[$agent['nombre']][$tid]);
}
else {
echo '<td style="text-align:center"> ';
}
echo '</td>';
echo '<th width="20px" >'. io_safe_output($tname) . html_print_image('images/information_alerts.png', true, array('title' => io_safe_output($tname),'style' => 'margin-left:5px' )) ."</th>";
}
echo '</tr>';
if (($hor_offset + $block) < $ntemplates) {
$new_hor_offset = $hor_offset+$block;
echo "<th width='20px' style='' rowspan='".($nagents+1)."'>
<a href='index.php?sec=extensions&sec2=extensions/agents_alerts&hor_offset=".$new_hor_offset."&offset=".
$offset."&group_id=".$group_id."'>".html_print_image("images/darrowright.png",true, array('title' => __('More templates')))."</a> </th>";
}
foreach ($agents as $agent) {
$alias = db_get_row ('tagente', 'id_agente', $agent['id_agente']);
echo '<tr>';
// Name of the agent
echo '<td style="font-weight:bold;">'.$alias['alias'].'</td>';
// Alerts of the agent
$anyfired = false;
foreach ($templates as $tid => $tname) {
if ($tname == '') {
continue;
}
if (isset($agent_alerts[$agent['nombre']][$tid])) {
foreach($agent_alerts[$agent['nombre']][$tid] as $alert) {
if($alert["times_fired"] > 0) {
$anyfired = true;
}
}
$cellstyle = '';
if($anyfired) {
$cellstyle = 'background:'.COL_ALERTFIRED.';';
}
echo '<td style=";'.$cellstyle.'"> ';
$uniqid = uniqid();
echo "<div>";
echo count($agent_alerts[$agent['nombre']][$tid])." ".__('Alerts')." ";
echo "<a href='javascript:show_alerts_details(\"$uniqid\")'>".html_print_image('images/zoom.png', true)."</a>";
echo "</div>";
print_alerts_summary_modal_window($uniqid, $agent_alerts[$agent['nombre']][$tid]);
}
else {
echo '<td style="text-align:center"> ';
}
echo '</td>';
}
echo '</tr>';
}
echo '</table>';
}
echo '</table>';
}
// Print the modal window for the summary of each alerts group
@ -366,4 +517,40 @@ ui_require_jquery_file('pandora');
}
});
}
function show_add_alerts(id) {
$("#add_alerts_dialog_"+id).dialog({
resizable: true,
draggable: true,
modal: true,
height: 235,
width: 600,
overlay: {
opacity: 0.5,
background: "black"
}
});
}
// checkbox-slides_ids
$(document).ready(function () {
$('#checkbox-slides_ids').click(function(){
if ($('#checkbox-slides_ids').prop('checked')){
var url = location.href.replace("&show_modules=true", "");
location.href = url+"&show_modules=true";
} else {
var url = location.href.replace("&show_modules=true", "");
var re = /&offset=\d*/g;
location.href = url.replace(re, "");
}
});
$('#group_id').change(function(){
var regx = /&group_id=\d*/g;
var url = location.href.replace(regx, "");
location.href = url+"&group_id="+$("#group_id").val();
});
});
</script>

View File

@ -127,7 +127,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
ui_print_error_message(
__('Unsuccessful installed tables into the testing DB'));
}
else {
else {/*
if (enterprise_installed()) {
$install_tables_enterprise =
extension_db_status_execute_sql_file(
@ -139,7 +139,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
__('Unsuccessful installed enterprise tables into the testing DB'));
}
}
*/
extension_db_check_tables_differences(
$connection_test,
$connection_system,
@ -159,6 +159,7 @@ function extension_db_check_tables_differences($connection_test,
global $config;
// --------- Check the tables --------------------------------------
mysql_select_db($db_name_test, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test);
@ -170,9 +171,8 @@ function extension_db_check_tables_differences($connection_test,
//~ $tables_test = array_merge($tables_test,
//~ extension_db_status_extension_tables());
mysql_select_db($db_name_system, $connection_system);
$result = mysql_query("SHOW TABLES", $connection_system);
mysql_select_db($db_name_system, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test);
$tables_system = array();
while ($row = mysql_fetch_array ($result)) {
$tables_system[] = $row[0];
@ -227,8 +227,8 @@ function extension_db_check_tables_differences($connection_test,
mysql_select_db($db_name_system, $connection_system);
$result = mysql_query("EXPLAIN " . $table, $connection_system);
mysql_select_db($db_name_system, $connection_test);
$result = mysql_query("EXPLAIN " . $table, $connection_test);
$fields_system = array();
if (!empty($result)) {
while ($row = mysql_fetch_array ($result)) {

View File

@ -38,7 +38,7 @@ function createXMLData($agent, $agentModule, $time, $data) {
io_safe_output($agent['os_version']), $agent['intervalo'],
io_safe_output($agent['agent_version']), $time,
io_safe_output($agent['nombre']),
io_safe_output($agent['alias']), $agent['timezone_offset'],
$agent['timezone_offset'],
io_safe_output($agentModule['nombre']), io_safe_output($agentModule['descripcion']), modules_get_type_name($agentModule['id_tipo_modulo']), $data);

View File

@ -39,10 +39,9 @@ function view_logfile ($file_name) {
echo "<h2>$file_name (" . __("File is too large than PHP memory allocated in the system.") . ")</h2>";
echo "<h2>" . __("The preview file is imposible.") . "</h2>";
}
else if ($file_size > 512000) {
$data = file_get_contents ($file_name, false, NULL, $file_size - 512000);
echo "<h2>$file_name (".__("File is too large (> 500KB)").")</h2>";
else if ($file_size > ($config['max_log_size'] * 1000)) {
$data = file_get_contents ($file_name, false, NULL, $file_size - ($config['max_log_size'] * 1000));
echo "<h2>$file_name (".format_numeric(filesize ($file_name)/1024)." KB) </h2>";
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo "... ";
echo $data;
@ -68,10 +67,11 @@ function pandoralogs_extension_main () {
return;
}
ui_print_page_header (__("System logfile viewer"), "images/extensions.png", false, "", true, "" );
echo "<p>" . __('This tool is used just to view your Pandora FMS system logfiles directly from console') . "</p>";
echo "<p>" . __('You can control the size information to show in general setup (Log size limit in view extension), actually ') . $config['max_log_size'] * 1000 . "B" . "</p>";
$logs_directory = (!empty($config["server_log_dir"])) ? io_safe_output($config["server_log_dir"]) : "/var/log/pandora";

View File

@ -0,0 +1,24 @@
START TRANSACTION;
SET @st_oum706 = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'treport_content' AND table_schema = DATABASE() AND column_name = 'historical_db') > 0,
"SELECT 1",
"ALTER TABLE treport_content ADD COLUMN historical_db tinyint(1) UNSIGNED NOT NULL default 0"
));
PREPARE pr_oum706 FROM @st_oum706;
EXECUTE pr_oum706;
DEALLOCATE PREPARE pr_oum706;
SET @st_oum706 = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tpolicy_modules' AND table_schema = DATABASE() AND column_name = 'ip_target') > 0,
"SELECT 1",
"ALTER TABLE tpolicy_modules ADD COLUMN ip_target varchar(100) default ''"
));
PREPARE pr_oum706 FROM @st_oum706;
EXECUTE pr_oum706;
DEALLOCATE PREPARE pr_oum706;
COMMIT;

View File

@ -0,0 +1,5 @@
START TRANSACTION;
ALTER TABLE tagent_custom_fields ADD is_password_type tinyint(1) NOT NULL DEFAULT 0;
COMMIT;

View File

@ -710,6 +710,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`module_names` TEXT,
`module_free_text` TEXT,
`each_agent` tinyint(1) default 1,
`historical_db` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
@ -1219,6 +1220,7 @@ ALTER TABLE tlayout_data ADD `label_position` varchar(50) NOT NULL default 'down
-- Table `tagent_custom_fields`
-- ---------------------------------------------------------------------
INSERT INTO `tagent_custom_fields` (`name`) VALUES ('eHorusID');
ALTER TABLE tagent_custom_fields ADD `is_password_type` tinyint(1) NOT NULL DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tagente_modulo` Fixed problems with blank space

View File

@ -32,13 +32,18 @@ if (!$config["MR"]) {
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">';
if($current_package == 0){
$build_package_version = $build_version;
}
else{
$build_package_version = $current_package;
if(enterprise_installed()){
enterprise_include_once("../include/functions_update_manager.php");
}
$current_package = update_manager_get_current_package();
if($current_package == 0){
$build_package_version = $build_version;
}
else{
$build_package_version = $current_package;
}
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_package_version, $config["MR"]));

View File

@ -119,7 +119,7 @@ $(document).ready (function () {
// Update config['skip_login_help_dialog'] to don't display more this message
if (skip_login_help) {
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{"page": "general/login_help_dialog",
"skip_login_help": 1},
function (data) {}

View File

@ -49,7 +49,6 @@ if (is_ajax()) {
$not_return = get_parameter ('not_return', 0);
$reset_initial_wizard = get_parameter ('reset_initial_wizard', 0);
if ($reset_initial_wizard) {
config_update_value ('initial_wizard', 0);
}

View File

@ -71,12 +71,13 @@ if (!empty($config['login_background'])) {
echo '<div id="login_body" ' . $login_body_style . '>';
echo '<div id="header_login">';
echo '<div id="icon_custom_pandora">';
if (defined ('PANDORA_ENTERPRISE')) {
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
if(isset ($config['custom_logo'])){
echo '<img src="enterprise/images/custom_logo/' . $config['custom_logo'] .'" alt="pandora_console">';
}
else{
echo '<img src="images/custom_logo/logo_login_consola.png" alt="pandora_console">';
echo '<img src="images/custom_logo/pandora_logo_head_4.png" alt="pandora_console">';
}
}
else{
@ -87,7 +88,7 @@ echo '<div id="header_login">';
echo '<div id="list_icon_docs_support"><ul>';
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="images/icono_docs.png" alt="docs pandora"></a></li>';
echo '<li>' . __('Docs') . '</li>';
if (defined ('PANDORA_ENTERPRISE')) {
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
echo '<li id="li_margin_left"><a href="https://support.artica.es" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
} else {
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
@ -135,7 +136,7 @@ echo '<div class="login_page">';
case 'login':
if (!empty ($page) && !empty ($sec)) {
foreach ($_POST as $key => $value) {
html_print_input_hidden ($key, $value);
html_print_input_hidden (io_safe_input($key), $value);
}
}
if ($config['auth'] == 'saml') {
@ -191,7 +192,7 @@ echo '<div class="login_page">';
case 'double_auth':
if (!empty ($page) && !empty ($sec)) {
foreach ($_POST as $key => $value) {
html_print_input_hidden ($key, $value);
html_print_input_hidden (io_safe_input($key), $value);
}
}
echo '<div class="login_nick">';
@ -233,7 +234,7 @@ echo '<div class="login_page">';
echo '<div class="login_data">';
echo '<div class ="text_banner_login">';
echo '<div><span class="span1">';
if(defined ('PANDORA_ENTERPRISE')){
if(file_exists (ENTERPRISE_DIR . "/load_enterprise.php")){
if($config['custom_title1_login']){
echo strtoupper(io_safe_output($config['custom_title1_login']));
}
@ -246,7 +247,7 @@ echo '<div class="login_page">';
}
echo '</span></div>';
echo '<div><span class="span2">';
if(defined ('PANDORA_ENTERPRISE')){
if(file_exists (ENTERPRISE_DIR . "/load_enterprise.php")){
if($config['custom_title2_login']){
echo strtoupper(io_safe_output($config['custom_title2_login']));
}
@ -260,7 +261,7 @@ echo '<div class="login_page">';
echo '</span></div>';
echo '</div>';
echo '<div class ="img_banner_login">';
if (defined ('PANDORA_ENTERPRISE')) {
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
if(isset($config['custom_splash_login'])){
html_print_image ("enterprise/images/custom_splash_login/".$config['custom_splash_login'], false, array ( "alt" => "splash", "border" => 0, "title" => $splash_title), false, true);
}

View File

@ -460,8 +460,14 @@ foreach ($fields as $field) {
$custom_value = '';
}
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'],
2, 65, $custom_value, 'style="min-height: 30px; width:96%;"', true);
if ($field['is_password_type']) {
$data[1] = html_print_input_text_extended ('customvalue_' . $field['id_field'], $custom_value, 'customvalue_' . $field['id_field'], '',
30, 100, $view_mode, '', '', true, true);
}
else {
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'],
2, 65, $custom_value, 'style="min-height: 30px; width:96%;"', true);
}
array_push ($table->data, $data);
}

View File

@ -885,8 +885,12 @@ if ($update_module || $create_module) {
// 1.23E-10 is 0.000000000123
$post_process = (string) get_parameter ('post_process', 0.0);
//$prediction_module = 0;
if(get_parameter ('prediction_module')){
$prediction_module = 1;
}
else{
$prediction_module = 0;
}
$max_timeout = (int) get_parameter ('max_timeout');
$max_retries = (int) get_parameter ('max_retries');
$min = (int) get_parameter_post ("min");

View File

@ -27,12 +27,14 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
$id_field = (int) get_parameter ('id_field', 0);
$name = (string) get_parameter ('name', '');
$display_on_front = (bool) get_parameter ('display_on_front', 0);
$is_password_type = (bool) get_parameter ('is_password_type', 0);
// Header
if ($id_field) {
$field = db_get_row_filter('tagent_custom_fields',array('id_field' => $id_field));
$name = $field['name'];
$display_on_front = $field['display_on_front'];
$is_password_type = $field['is_password_type'];
ui_print_page_header (__("Update agent custom field"), "images/custom_field.png", false, "", true, "");
}
else {
@ -48,8 +50,11 @@ $table->data = array ();
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text ('name', $name, '', 35, 100, true);
$table->data[0][2] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->data[0][3] = html_print_checkbox ('display_on_front', 1, $display_on_front, true);
$table->data[0][2] = __('Pass type').ui_print_help_tip (__('The fields with pass type enabled will be displayed like html input type pass in html'), true);
$table->data[0][3] = html_print_checkbox ('is_password_type', 1, $is_password_type, true);
$table->data[0][4] = __('Display on front').ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->data[0][5] = html_print_checkbox ('display_on_front', 1, $display_on_front, true);
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
html_print_table ($table);

View File

@ -36,6 +36,7 @@ $delete_field = (bool) get_parameter ('delete_field');
$id_field = (int) get_parameter ('id_field', 0);
$name = (string) get_parameter ('name', '');
$display_on_front = (int) get_parameter ('display_on_front', 0);
$is_password_type = (int) get_parameter ('is_password_type', 0);
/* Create field */
if ($create_field) {
@ -48,7 +49,8 @@ if ($create_field) {
}
else {
$result = db_process_sql_insert('tagent_custom_fields',
array('name' => $name, 'display_on_front' => $display_on_front));
array('name' => $name, 'display_on_front' => $display_on_front,
'is_password_type' => $is_password_type));
ui_print_success_message(__('Field successfully created'));
}
}
@ -57,7 +59,7 @@ if ($create_field) {
if ($update_field) {
/*Check if name field is empty*/
if ( $name != "") {
$values = array('name' => $name, 'display_on_front' => $display_on_front);
$values = array('name' => $name, 'display_on_front' => $display_on_front, 'is_password_type' => $is_password_type);
$result = db_process_sql_update('tagent_custom_fields', $values, array('id_field' => $id_field));
}

View File

@ -150,7 +150,7 @@ if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "AW"))
$return_all_group = false;
else
$return_all_group = true;
html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false, 'width:100px;');
html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
echo "<td>";
echo __('Show Agents') . '&nbsp;';

View File

@ -148,7 +148,7 @@ $table_simple->colspan[6][1] = 3;
$table_simple->data[0][0] = __('Name');
$table_simple->data[0][1] = html_print_input_text_extended ('name',
io_safe_output($name), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
io_safe_input(html_entity_decode($name)), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
//$table_simple->data[0][1] = html_print_input_text ('name',
// io_safe_output($name), '', 45, 100, true, $disabledBecauseInPolicy);

View File

@ -698,7 +698,7 @@ if ($id_downtime > 0) {
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;width:180px;max-width:180px;margin-right:15px;');
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;margin-right:15px;');
html_print_checkbox ("recursion", 1, $recursion, false, false, '');
echo __('Recursion') . '&nbsp;';

View File

@ -32,7 +32,7 @@ $id_alert = get_parameter ("id_alert", 0); // ID given as parameter
$alert = alerts_get_alert_agent_module($id_alert);
$template = alerts_get_alert_template ($alert['id_alert_template']);
$actions = alerts_get_alert_agent_module_actions ($id_alert);
$agent_name = modules_get_agentmodule_agent_name ($alert['id_agent_module']);
$agent_alias = modules_get_agentmodule_agent_alias ($alert['id_agent_module']);
$agent = modules_get_agentmodule_agent ($alert['id_agent_module']);
$module_name = modules_get_agentmodule_name ($alert['id_agent_module']);
@ -65,7 +65,7 @@ $table_details->data[] = $data;
$data[0] = __('Agent');
$data[1] ='<a style=" font-size: 7pt;" href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent.
'" title="'.$agent_name.'"><b><span style=" font-size: 7pt;">'.$agent_name.'</span></b></a>';
'" title="'.$agent_alias.'"><b><span style=" font-size: 7pt;">'.$agent_alias.'</span></b></a>';
$table_details->data[] = $data;
$data[0] = __('Module');

View File

@ -456,7 +456,13 @@ foreach ($fields as $field) {
$custom_value = '';
}
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
if ($field['is_password_type']) {
$data[1] = html_print_input_text_extended ('customvalue_' . $field['id_field'], $custom_value, 'customvalue_' . $field['id_field'], '',
30, 100, $view_mode, '', '', true, true);
}
else {
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
}
array_push ($table->data, $data);
}

View File

@ -496,7 +496,7 @@ $table->data['edit3'][0] = __('Post process') .
ui_print_help_icon ('postprocess', true);
$table->data['edit3'][1] = html_print_extended_select_for_post_process('post_process',
0, '', 0, '', false, true, 'width:150px;', true);
-1, '','', 0, false, true, 'width:150px;', true, false, 1);
$table->data['edit3'][2] = __('SMNP community');
$table->data['edit3'][3] = html_print_input_text ('snmp_community', '',
@ -1153,6 +1153,11 @@ function process_manage_edit ($module_name, $agents_select = null) {
$values['plugin_pass'] = io_input_password($value);
}
break;
case 'post_process':
if($value !== '-1'){
$values['post_process'] = $value;
}
break;
default:
if ($value != '') {
$values[$field] = $value;

View File

@ -63,13 +63,13 @@ if (is_ajax()) {
}
if ($get_agents) {
$sql = "SELECT ta.id_agente, ta.nombre AS agent_name,
$sql = "SELECT ta.id_agente, ta.alias AS agent_alias,
tam.nombre AS module_name
FROM tagente ta
INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente
AND tam.id_plugin = $plugin_id
ORDER BY ta.nombre, tam.nombre";
ORDER BY ta.alias, tam.nombre";
$result = db_get_all_rows_sql($sql);
if (empty($result)) $result = array();
@ -78,7 +78,7 @@ if (is_ajax()) {
$current_element = array();
foreach ($result as $key => $value) {
$id = (int) $value['id_agente'];
$name = $value['agent_name'];
$name = io_safe_output($value['agent_alias']);
$module_name = $value['module_name'];
if (!empty($current_element) && $current_element['id'] !== $id) {

View File

@ -430,7 +430,7 @@ switch ($action) {
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = "<b>". __("Group") . "</b>";
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, 'width:150px', false, false, 'id_grupo', $strict_user). '<br>';
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, "", false, false, 'id_grupo', $strict_user). '<br>';
$table_aux->data[0][2] = "<b>". __("Free text for search: ") . ui_print_help_tip(
__('Search by report name or description, list matches.'),true) . "</b>";

View File

@ -84,6 +84,7 @@ function visual_map_main() {
//Fixed to wait the load of images.
$(window).load(function() {
$('#module').change(function(){
var txt = $("#module").val();
if(selectedItem == 'simple_value' || creationItem == 'simple_value'){
@ -122,6 +123,27 @@ function visual_map_main() {
}
});
// Begin - Background label color changer
$( "#text-label_ifr" ).contents().find( "body" ).bind("contextmenu", function(e) {
e.preventDefault();
});
$( "#text-label_ifr" ).contents().find( "body" ).mousedown(function(e){
if(e.which == 3)
{
if($( "#text-label_ifr" ).contents().find( "body" ).css('background-color') == 'rgb(211, 211, 211)'){
$( "#text-label_ifr" ).contents().find( "body" ).css('background-color','white');
}
else{
$( "#text-label_ifr" ).contents().find( "body" ).css('background-color','lightgray');
}
}
});
// End - Background label color changer
$('#radiobtn0001').click(function(){
$("#custom_graph option[value=0]").prop("selected", true);
@ -549,6 +571,9 @@ function readFields() {
values['process_simple_value'] = $("select[name=process_value]").val();
values['background'] = $("#background_image").val();
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period").val();
if (values['period'] == null) {
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period_select").val();
}
values['width'] = $("input[name=width]").val();
values['width_data_image'] = $("#data_image_width").val();
if(values['width_data_image'] != 0){
@ -606,14 +631,14 @@ function create_button_palette_callback() {
var validate = true;
switch (creationItem) {
case 'box_item':
if (($("input[name='width_box']").val() == '')) {
alert('Undefined width');
validate = false;
}
if (($("input[name='height_box']").val() == '')) {
alert('Undefined height');
validate = false;
}
if (($("input[name='width_box']").val() == '')) {
alert('Undefined width');
validate = false;
}
if (($("input[name='height_box']").val() == '')) {
alert('Undefined height');
validate = false;
}
break;
case 'group_item':
case 'static_graph':
@ -673,7 +698,7 @@ function create_button_palette_callback() {
validate = false;
}
break;
case 'module_graph':
case 'module_graph':
if (values['width_module_graph'] == '') {
alert('Undefined width');
validate = false;
@ -996,7 +1021,8 @@ function toggle_item_palette() {
});
$( "#text-label_ifr" ).contents().find( "p" ).css("line-height",$('#lineheight').val());
$( "#text-label_ifr" ).contents().find( "span" ).css("line-height",$('#lineheight').val());
$( "#text-label_ifr" ).contents().find( "span" ).css("line-height",$('#lineheight').val());
$( "#text-label_ifr" ).contents().find( "body" ).css("background","lightgray");
}
@ -1569,7 +1595,6 @@ function set_static_graph_status(idElement, image, status) {
data: parameter,
success: function (data) {
set_static_graph_status(idElement, image, data);
if($('#'+idElement+' table').css('float') == 'right' || $('#'+idElement+ ' table').css('float') == 'left'){
$('#'+idElement+ ' img').css('margin-top', parseInt($('#'+idElement).css('height'))/2 - parseInt($('#'+idElement+ ' img').css('height'))/2);
}
@ -1605,7 +1630,6 @@ function set_static_graph_status(idElement, image, status) {
suffix = ".png";
break;
}
set_image("image", idElement, image + suffix);
}
@ -2079,6 +2103,10 @@ function createItem(type, values, id_data) {
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$image.attr('width', '70')
.attr('height', '70');
}
else{
$image.attr('width', $('#preview > img')[0].naturalWidth)
.attr('height', $('#preview > img')[0].naturalHeight);
}
}
else {

View File

@ -51,7 +51,8 @@ if (is_ajax ()) {
$row['control'] = __('Yes').'&nbsp;'.html_print_radio_button('fallback_local_auth', 1, '', $config['fallback_local_auth'], true).'&nbsp;&nbsp;';
$row['control'] .= __('No').'&nbsp;'.html_print_radio_button('fallback_local_auth', 0, '', $config['fallback_local_auth'], true);
$table->data['fallback_local_auth'] = $row;
if (enterprise_installed()) {
// Autocreate remote users
$row = array();
$row['name'] = __('Autocreate remote users');
@ -59,8 +60,7 @@ if (is_ajax ()) {
$row['control'] .= __('No').'&nbsp;'.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true);
$table->data['autocreate_remote_users'] = $row;
if (enterprise_installed()) {
add_enterprise_auth_autocreate_profiles($table, $type_auth);
add_enterprise_auth_autocreate_profiles($table, $type_auth);
}
}

View File

@ -84,7 +84,7 @@ $table_remote->data['ehorus_pass'] = $row;
$row = array();
$row['name'] = __('API Hostname');
$row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true);
$row['control'] .= ui_print_help_tip(__('Hostname of the eHorus API') . '. ' . __('Without protocol and port') . '. ' . __('e.g., switch.ehorus.com'), true);
$row['control'] .= ui_print_help_tip(__('Hostname of the eHorus API') . '. ' . __('Without protocol and port') . '. ' . __('e.g., portal.ehorus.com'), true);
$table_remote->data['ehorus_hostname'] = $row;
// Directory port

View File

@ -188,6 +188,10 @@ $table->data[32][0] = __('Server logs directory') . ui_print_help_tip (__("Direc
$table->data[32][1] = html_print_input_text ('server_log_dir',
$config["server_log_dir"], '', 50, 255, true);
$table->data[33][0] = __('Log size limit in system logs viewer extension') . ui_print_help_tip (__("Maximun size to show in system log extension."), true);
$table->data[33][1] = html_print_input_text ('max_log_size',
$config["max_log_size"], '', 10, 255, true) . html_print_label(" x1000", "max_log_size", true);
$modes_tutorial = array(
'full' => __('Full mode'),
'on_demand' => __('On demand'),
@ -200,23 +204,23 @@ $table->data['tutorial_mode'][1] =
$config["tutorial_mode"], '', '', 0, true);
$config["past_planned_downtimes"] = isset($config["past_planned_downtimes"]) ? $config["past_planned_downtimes"] : 1;
$table->data[33][0] = __('Allow create planned downtimes in the past') .
$table->data[34][0] = __('Allow create planned downtimes in the past') .
ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
$table->data[33][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('past_planned_downtimes', 1, '', $config["past_planned_downtimes"], true).'&nbsp;&nbsp;';
$table->data[33][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('past_planned_downtimes', 0, '', $config["past_planned_downtimes"], true);
$table->data[34][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('past_planned_downtimes', 1, '', $config["past_planned_downtimes"], true).'&nbsp;&nbsp;';
$table->data[34][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('past_planned_downtimes', 0, '', $config["past_planned_downtimes"], true);
$table->data[34][0] = __('Limit parameters massive') .
$table->data[35][0] = __('Limit parameters massive') .
ui_print_help_tip(__('Your PHP environment is setted with %d max_input_vars. Maybe you must not set this value with upper values.', ini_get("max_input_vars")), true);
$table->data[34][1] = html_print_input_text('limit_parameters_massive',
$table->data[35][1] = html_print_input_text('limit_parameters_massive',
$config['limit_parameters_massive'], '', 10, 10, true);
$table->data[35][0] = __('Include agents manually disabled');
$table->data[35][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('include_agents', 1, '', $config["include_agents"], true).'&nbsp;&nbsp;';
$table->data[35][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('include_agents', 0, '', $config["include_agents"], true);
$table->data[36][0] = __('Include agents manually disabled');
$table->data[36][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('include_agents', 1, '', $config["include_agents"], true).'&nbsp;&nbsp;';
$table->data[36][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('include_agents', 0, '', $config["include_agents"], true);
$table->data[36][0] = __('audit log directory') .
$table->data[37][0] = __('audit log directory') .
ui_print_help_tip (__("Directory where audit log is stored."), true);
$table->data[36][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true);
$table->data[37][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';

View File

@ -221,8 +221,6 @@ if (($filter_group == 0) && ($filter_search == '')) {
$table = new stdClass();
$table->width = '100%';
$table->class = "databox filters";
if(defined('METACONSOLE'))
$table->class = "databox_filters";
$table->rowclass[0] = '';
$table->data[0][0] = '<b>' . __('Group') . '</b>';
$table->data[0][1] = html_print_select_groups(false, "AR", true,
@ -496,3 +494,10 @@ echo '</div>';
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready (function () {
console.log('sknknan');
// text-filter_search
});
</script>

Binary file not shown.

After

(image error) Size: 2.2 KiB

View File

@ -503,15 +503,27 @@ if ($table_events) {
require_once ("include/functions_graph.php");
$id_agente = (int)get_parameter('id_agente', 0);
$all_events_24h = (int)get_parameter('all_events_24h', 0);
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config["id_user"]);
$tags_condition = tags_get_acl_tags($config['id_user'],
array_keys($groups), 'ER', 'event_condition', 'AND');
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%',
false, $id_agente,true);
echo '<div id="div_all_events_24h">';
echo '<label><b>' . __('Show all Events 24h') . '</b></label>';
echo html_print_checkbox('all_events_24h', $all_events_24h, $all_events_24h, true, false, '', true);
echo '</div>';
$date_subtract_day = time() - (24 * 60 * 60);
if($all_events_24h){
events_print_event_table ("utimestamp > $date_subtract_day", 200, '100%',
false, $id_agente,true);
}
else{
events_print_event_table ("estado <> 1 $tags_condition", 200, '100%',
false, $id_agente,true);
}
}
if ($get_list_events_agents) {

View File

@ -254,7 +254,9 @@ if ($get_module_detail) {
$id_type_web_content_string = db_get_value('id_tipo',
'ttipo_modulo', 'nombre', 'web_content_string');
$post_process = db_get_value_filter('post_process','tagente_modulo',array('id_agente_modulo' => $module_id));
foreach ($result as $row) {
$data = array ();
@ -266,21 +268,16 @@ if ($get_module_detail) {
foreach ($columns as $col => $attr) {
if ($attr[1] != "modules_format_data") {
$data[] = date('d F Y h:i:s A', $row['utimestamp']);
}
elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
// Its a single-data, multiline data (data snapshot) ?
// Detect string data with \n and convert to <br>'s
$datos = $row[$attr[0]];
//$datos = preg_replace ('/\n/i','<br>',$row[$attr[0]]);
//$datos = preg_replace ('/\s/i','&nbsp;',$datos);
// Because this *SHIT* of print_table monster, I cannot format properly this cells
// so, eat this, motherfucker :))
$datos = io_safe_input($datos);
$datos = preg_replace("/\n/", "</br></br>", $datos);
// I dont why, but using index (value) method, data is automatically converted to html entities ¿?
$data[] = $datos;
@ -288,7 +285,6 @@ if ($get_module_detail) {
elseif ($is_web_content_string) {
//Fixed the goliat sends the strings from web
//without HTML entities
$data[] = io_safe_input($row[$attr[0]]);
}
else {
@ -299,16 +295,19 @@ if ($get_module_detail) {
$data[] = io_safe_input($row[$attr[0]]);
}
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
//~ $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
//~ $data[] = (double) $row[$attr[0]];
switch($row['module_type']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$data[] = human_milliseconds_to_string($row['data']);
else
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0'){
if($post_process > 0){
$data[] = human_milliseconds_to_string($row['data'] / $post_process);
} else {
$data[] = human_milliseconds_to_string($row['data']);
}
}else{
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
}
break;
default:
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
@ -320,17 +319,12 @@ if ($get_module_detail) {
$data[] = 'No data';
}
else {
if(is_snapshot_data($row[$attr[0]])){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
}
else{
$data[] = $row[$attr[0]];
}
if(is_snapshot_data($row[$attr[0]])){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
}
else{
$data[] = $row[$attr[0]];
}
}
}
}
@ -970,10 +964,16 @@ if ($list_modules) {
switch($module['id_tipo_modulo']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$salida = human_milliseconds_to_string($module['datos']);
else
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0'){
if($module['post_process']>0){
$salida = human_milliseconds_to_string($module['datos'] / $module['post_process']);
} else {
$salida = human_milliseconds_to_string($module['datos']);
}
} else {
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
}
break;
default:
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
@ -986,16 +986,20 @@ if ($list_modules) {
switch($module['id_tipo_modulo']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$salida = human_milliseconds_to_string($module['datos']);
else
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0'){
if($module['post_process']>0){
$salida = human_milliseconds_to_string($module['datos'] / $module['post_process']);
} else {
$salida = human_milliseconds_to_string($module['datos']);
}
} else {
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
}
break;
default:
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
break;
}
//~ $salida = (number_format($module["datos"], $config['graph_precision']));
}
// Show units ONLY in numeric data types
if (isset($module["unit"])) {

View File

@ -0,0 +1,126 @@
<?php
//Pandora FMS- http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2017 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 Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
include_once($config['homedir'] . "/include/functions_config.php");
include_once($config['homedir'] . "/include/functions_snmp_browser.php");
require_once ($config['homedir'] . '/include/functions_network_components.php');
global $config;
if(is_ajax()){
ob_clean();
$action = (string) get_parameter ("action", "");
$target_ip = (string) get_parameter ("target_ip", '');
$community = (string) get_parameter ("community", '');
$snmp_version = (string) get_parameter ("snmp_browser_version", '');
$snmp3_auth_user = get_parameter('snmp3_browser_auth_user');
$snmp3_security_level = get_parameter('snmp3_browser_security_level');
$snmp3_auth_method = get_parameter('snmp3_browser_auth_method');
$snmp3_auth_pass = get_parameter('snmp3_browser_auth_pass');
$snmp3_privacy_method = get_parameter('snmp3_browser_privacy_method');
$snmp3_privacy_pass = get_parameter('snmp3_browser_privacy_pass');
$targets_oids = get_parameter ("oids", "");
$targets_oids = explode(",", $targets_oids);
$custom_action = get_parameter ("custom_action", "");
if ($custom_action != "") {
$custom_action = urldecode (base64_decode ($custom_action));
}
if($action == 'create_modules_snmp'){
$fail_modules = array();
foreach ($targets_oids as $key => $target_oid) {
$oid = snmp_browser_get_oid ($target_ip, $community,
htmlspecialchars_decode($target_oid), $snmp_version, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass);
$name_check = db_get_value ('name', 'tnetwork_component',
'name', $oid['oid']);
if(empty($oid['description'])) {
$description = '';
} else {
$description = io_safe_input($oid['description']);
}
if(!$name_check){
$id = network_components_create_network_component ($oid['oid'],17,1,
array ('description' => $description,
'module_interval' => 300,
'max' => 0,
'min' => 0,
'tcp_send' => $snmp_version,
'tcp_rcv' => '',
'tcp_port' => 0,
'snmp_oid' => $oid['numeric_oid'],
'snmp_community' => $community,
'id_module_group' => 3,
'id_modulo' => 2,
'id_plugin' => 0,
'plugin_user' => '',
'plugin_pass' => '',
'plugin_parameter' => '',
'macros' => '',
'max_timeout' => 0,
'max_retries' => 0,
'history_data' => '',
'dynamic_interval' => 0,
'dynamic_max' => 0,
'dynamic_min' => 0,
'dynamic_two_tailed' => 0,
'min_warning' => 0,
'max_warning' => 0,
'str_warning' => '',
'min_critical' => 0,
'max_critical' => 0,
'str_critical' => '',
'min_ff_event' => 0,
'custom_string_1' => '',
'custom_string_2' => '',
'custom_string_3' => '',
'post_process' => 0,
'unit' => '',
'wizard_level' => 'nowizard',
'macros' => '',
'critical_instructions' => '',
'warning_instructions' => '',
'unknown_instructions' => '',
'critical_inverse' => 0,
'warning_inverse' => 0,
'id_category' => 0,
'tags' => '',
'disabled_types_event' => '{"going_unknown":1}',
'min_ff_event_normal' => 0,
'min_ff_event_warning' => 0,
'min_ff_event_critical' => 0,
'each_ff' => 0));
}
if(empty($id)) {
array_push($fail_modules,$name_check);
}
}
}
echo json_encode($fail_modules);
return;
}
?>

View File

@ -22,8 +22,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC170613';
$pandora_version = 'v7.0NG.705';
$build_version = 'PC170717';
$pandora_version = 'v7.0NG.707';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -467,6 +467,7 @@ define("OPTION_SINGLE_SELECT_TIME", 7);
define("OPTION_CUSTOM_INPUT", 8);
define("OPTION_AGENT_AUTOCOMPLETE", 9);
define("OPTION_SELECT_MULTISELECTION", 10);
define("OPTION_COLOR_PICKER", 11);
/* Transactional map constants */
define("NODE_TYPE", 0);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -37,6 +37,12 @@ div.term-container div.terminal {
-webkit-transform: rotate(360deg);
}
}
.button-color-animate {
color: #337ab7;
-webkit-transition: color 2000ms linear;
-ms-transition: color 2000ms linear;
transition: color 2000ms linear;
}
@-moz-keyframes spin {
from {
transform: scale(1) rotate(0deg);

View File

@ -61,7 +61,7 @@
position: absolute;
opacity: 0;
left: -9999em;
top: -9999em;
top: 0;
width: 0;
height: 0;
z-index: -10;
@ -71,7 +71,22 @@
resize: none;
}
.terminal .terminal-cursor {
.terminal a {
color: inherit;
text-decoration: none;
}
.terminal a:hover {
cursor: pointer;
text-decoration: underline;
}
.terminal a.xterm-invalid-link:hover {
cursor: text;
text-decoration: none;
}
.terminal.focus:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar) .terminal-cursor {
background-color: #fff;
color: #000;
}
@ -82,19 +97,41 @@
background-color: transparent;
}
.terminal.focus .terminal-cursor.blinking {
animation: blink-cursor 1.2s infinite step-end;
.terminal:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus.xterm-cursor-blink-on .terminal-cursor {
background-color: transparent;
color: inherit;
}
@keyframes blink-cursor {
0% {
background-color: #fff;
color: #000;
}
50% {
background-color: transparent;
color: #FFF;
}
.terminal.xterm-cursor-style-bar .terminal-cursor,
.terminal.xterm-cursor-style-underline .terminal-cursor {
position: relative;
}
.terminal.xterm-cursor-style-bar .terminal-cursor::before,
.terminal.xterm-cursor-style-underline .terminal-cursor::before {
content: "";
display: block;
position: absolute;
background-color: #fff;
}
.terminal.xterm-cursor-style-bar .terminal-cursor::before {
top: 0;
bottom: 0;
left: 0;
width: 1px;
}
.terminal.xterm-cursor-style-underline .terminal-cursor::before {
bottom: 0;
left: 0;
right: 0;
height: 1px;
}
.terminal.xterm-cursor-style-bar.focus.xterm-cursor-blink.xterm-cursor-blink-on .terminal-cursor::before,
.terminal.xterm-cursor-style-underline.focus.xterm-cursor-blink.xterm-cursor-blink-on .terminal-cursor::before {
background-color: transparent;
}
.terminal.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before,
.terminal.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before {
background-color: #fff;
}
.terminal .composition-view {
@ -116,6 +153,10 @@
overflow-y: scroll;
}
.terminal .xterm-wide-char {
display: inline-block;
}
.terminal .xterm-rows {
position: absolute;
left: 0;

View File

@ -1796,6 +1796,26 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
$id_group = (int) $id_group;
}
if($_SESSION['check_acl'] != null){
if (empty ($_SESSION['check_acl']))
return 0;
$result = 0;
$acl_column = get_acl_column($access);
foreach ($_SESSION['check_acl'] as $row) {
// For each profile for this pair of group and user do...
if (isset($row[$acl_column])) {
$result += $row[$acl_column];
}
}
if ($result >= 1) {
return 1;
}
return 0;
}
$parents_id = array($id_group);
if ($id_group != 0 && $onlyOneGroup !== true) {
$group = db_get_row_filter('tgrupo', array('id_grupo' => $id_group));
@ -1844,8 +1864,13 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
OR tusuario_perfil.id_grupo = 0)", $id_user, implode(', ', $parents_id));
}
$rowdup = db_get_all_rows_sql ($query);
$_SESSION['check_acl'] = $rowdup;
if (empty ($rowdup))
return 0;

View File

@ -1282,7 +1282,7 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) {
switch ($config["dbtype"]) {
case "mysql":
$sql1 = 'SELECT name
FROM tserver WHERE name LIKE "' . $nameServer . '"';
FROM tserver WHERE BINARY name LIKE "' . $nameServer . '"';
break;
case "postgresql":
case "oracle":
@ -1382,9 +1382,20 @@ function api_set_create_custom_field($t1, $t2, $other, $returnType) {
returnError('error_parameter', 'Custom field display flag required');
return;
}
$is_password_type = 0;
if ($other['data'][2] != '') {
$is_password_type = $other['data'][2];
}
else {
returnError('error_parameter', 'Custom field is password type required');
return;
}
$result = db_process_sql_insert('tagent_custom_fields',
array('name' => $name, 'display_on_front' => $display_front));
array('name' => $name, 'display_on_front' => $display_front,
'is_password_type' => $is_password_type));
$data['type'] = "string";
$data["data"] = $result;
@ -8832,7 +8843,7 @@ function api_set_create_tag ($id, $trash1, $other, $returnType) {
//http://127.0.0.1/pandora_console/include/api.php?op=set&op2=create_event&id=name_event&other=2|system|3|admin|2|1|10|0|comments||Pandora||critical_inst|warning_inst|unknown_inst|other||&other_mode=url_encode_separator_|&apipass=1234&user=admin&pass=pandora
function api_set_create_event($id, $trash1, $other, $returnType) {
if ($other['type'] == 'string') {
returnError('error_parameter', 'Error in the parameters.');
return;
@ -8856,12 +8867,47 @@ function api_set_create_event($id, $trash1, $other, $returnType) {
returnError('error_parameter', 'Group ID required.');
return;
}
$error_msg ='';
if ($other['data'][2] != '') {
$values['id_agente'] = $other['data'][2];
$id_agent_exist = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][2]);
if($id_agent_exist){
$values['id_agente'] = $other['data'][2];
}
else{
$error_msg = 'id_not_exist';
}
}
else {
returnError('error_parameter', 'Agent ID required.');
if($other['data'][19] != ''){
$values['id_agente'] = db_get_value('id_agente', 'tagente', 'nombre', $other['data'][19]);
if(!$values['id_agente']){
if($other['data'][20] == 1){
$values['id_agente'] = db_process_sql_insert ('tagente',
array ( 'nombre' => $other['data'][19],
'id_grupo' => $other['data'][1],
'alias' => $other['data'][19] )
);
}
else{
$error_msg = 'name_not_exist';
}
}
}
else {
$error_msg = 'none';
}
}
if($error_msg != ''){
if($error_msg == 'id_not_exist'){
returnError('error_parameter', 'Agent ID does not exist.');
}
elseif($error_msg == 'name_not_exist'){
returnError('error_parameter', 'Agent Name does not exist.');
}
elseif($error_msg == 'none'){
returnError('error_parameter', 'Agent ID or name required.');
}
return;
}
@ -8950,7 +8996,19 @@ function api_set_create_event($id, $trash1, $other, $returnType) {
else {
$values['server_id'] = 0;
}
if ($other['data'][18] != '') {
$values['id_extra'] = $other['data'][18];
$sql_validation = 'SELECT id_evento FROM tevento where estado=0 and id_extra ="'. $other['data'][18] .'";';
$validation = db_get_all_rows_sql($sql_validation);
if($validation){
foreach ($validation as $val) {
api_set_validate_event_by_id($val['id_evento']);
}
}
}
else {
$values['id_extra'] = '';
}
$return = events_create_event(
$values['event'], $values['id_grupo'], $values['id_agente'],
$values['status'], $values['id_usuario'],
@ -8960,7 +9018,7 @@ function api_set_create_event($id, $trash1, $other, $returnType) {
$values['warning_instructions'],
$values['unknown_instructions'], $values['source'],
$values['tags'], $values['custom_data'],
$values['server_id']);
$values['server_id'], $values['id_extra']);
if ($other['data'][12] != '') { //user comments
if ($return !== false) { //event successfully created
@ -9127,12 +9185,10 @@ function api_get_netflow_get_summary ($discard_1, $discard_2, $params) {
//http://localhost/pandora_console/include/api.php?op=set&op2=validate_event_by_id&id=23&apipass=1234&user=admin&pass=pandora
function api_set_validate_event_by_id ($id, $trash1, $trash2, $returnType) {
global $config;
$data['type'] = 'string';
$check_id = db_get_value('id_evento', 'tevento', 'id_evento', $id);
if ($check_id) { //event exists
$status = db_get_value('estado', 'tevento', 'id_evento', $id);
if ($status == 1) { //event already validated
$data['data'] = "Event already validated";

View File

@ -194,6 +194,8 @@ function config_update_config () {
$error_update[] = __('Command Snapshot');
if (!config_update_value ('server_log_dir', get_parameter('server_log_dir')))
$error_update[] = __('Server logs directory');
if (!config_update_value ('max_log_size', get_parameter('max_log_size')))
$error_update[] = __('Log size limit in system logs viewer extension');
if (!config_update_value ('tutorial_mode', get_parameter('tutorial_mode')))
$error_update[] = __('Tutorial mode');
if (!config_update_value ('past_planned_downtimes', get_parameter('past_planned_downtimes')))
@ -1597,6 +1599,10 @@ function config_process_config () {
if (!isset($config['server_log_dir'])) {
config_update_value ('server_log_dir', "");
}
if (!isset($config['max_log_size'])) {
config_update_value ('max_log_size', 512);
}
if (!isset($config['show_group_name'])) {
config_update_value ('show_group_name', 0);
@ -1743,7 +1749,7 @@ function config_process_config () {
config_update_value('ehorus_custom_field', 'eHorusID');
}
if (!isset($config['ehorus_hostname'])) {
config_update_value('ehorus_hostname', 'switch.ehorus.com');
config_update_value('ehorus_hostname', 'portal.ehorus.com');
}
if (!isset($config['ehorus_port'])) {
config_update_value('ehorus_port', 18080);

View File

@ -26,7 +26,13 @@ function cron_update_module_interval ($module_id, $cron) {
return;
}
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . cron_next_execution ($cron) . ' WHERE id_agente_modulo = ' . (int) $module_id);
if($cron == "* * * * *"){
$module_interval = db_get_value_filter('module_interval','tagente_modulo',array("id_agente_modulo" => $module_id));
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . $module_interval . ' WHERE id_agente_modulo = ' . (int) $module_id);
} else {
return db_process_sql ('UPDATE tagente_estado SET current_interval = ' . cron_next_execution ($cron) . ' WHERE id_agente_modulo = ' . (int) $module_id);
}
}

View File

@ -164,7 +164,7 @@ function custom_graphs_print($id_graph, $height, $width, $period,
$background_color = 'white', $modules_param = array(), $homeurl = '',
$name_list = array(), $unit_list = array(), $show_last = true,
$show_max = true, $show_min = true, $show_avg = true, $ttl = 1,
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false) {
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false,$id_widget_dashboard=false) {
global $config;
@ -260,7 +260,8 @@ function custom_graphs_print($id_graph, $height, $width, $period,
$dashboard,
$vconsole,
$percentil,
$from_interface);
$from_interface,
$id_widget_dashboard);
if ($return)
return $output;

View File

@ -703,7 +703,7 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
$id_user = "", $event_type = "unknown", $priority = 0,
$id_agent_module = 0, $id_aam = 0, $critical_instructions = '',
$warning_instructions = '', $unknown_instructions = '',
$source="Pandora", $tags="", $custom_data="", $server_id = 0) {
$source="Pandora", $tags="", $custom_data="", $server_id = 0, $id_extra ="") {
global $config;
@ -719,15 +719,15 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
event_type, criticity, id_agentmodule, id_alert_am,
critical_instructions, warning_instructions,
unknown_instructions, source, tags, custom_data,
server_id)
server_id, id_extra)
VALUES (%d, %d, "%s", NOW(), %d, UNIX_TIMESTAMP(NOW()),
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s",
"%s", "%s", %d)',
"%s", "%s", %d, "%s")',
$id_agent, $id_group, $event, $status, $id_user,
$event_type, $priority, $id_agent_module, $id_aam,
$critical_instructions, $warning_instructions,
$unknown_instructions, $source, $tags, $custom_data,
$server_id);
$server_id, $id_extra);
break;
case "postgresql":
$sql = sprintf ('
@ -736,16 +736,16 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
event_type, criticity, id_agentmodule, id_alert_am,
critical_instructions, warning_instructions,
unknown_instructions, source, tags, custom_data,
server_id)
server_id, id_extra)
VALUES (%d, %d, "%s", NOW(), %d,
ceil(date_part(\'epoch\', CURRENT_TIMESTAMP)), "%s",
"%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s",
"%s", %d)',
"%s", %d, "%s")',
$id_agent, $id_group, $event, $status, $id_user,
$event_type, $priority, $id_agent_module, $id_aam,
$critical_instructions, $warning_instructions,
$unknown_instructions, $source, $tags, $custom_data,
$server_id);
$server_id, $id_extra);
break;
case "oracle":
$sql = sprintf ('
@ -754,15 +754,15 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
event_type, criticity, id_agentmodule, id_alert_am,
critical_instructions, warning_instructions,
unknown_instructions, source, tags, custom_data,
server_id)
server_id, id_extra)
VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s",
"%s", "%s", %d)',
"%s", "%s", %d, "%s")',
$id_agent, $id_group, $event, $status, $id_user,
$event_type, $priority, $id_agent_module, $id_aam,
$critical_instructions, $warning_instructions,
$unknown_instructions, $source, $tags, $custom_data,
$server_id);
$server_id, $id_extra);
break;
}
}
@ -774,13 +774,13 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
timestamp, estado, utimestamp, id_usuario,
event_type, criticity, id_agentmodule, id_alert_am,
critical_instructions, warning_instructions,
unknown_instructions, source, tags, custom_data)
unknown_instructions, source, tags, custom_data, id_extra)
VALUES (%d, %d, "%s", NOW(), %d, UNIX_TIMESTAMP(NOW()),
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s")',
"%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s")',
$id_agent, $id_group, $event, $status, $id_user,
$event_type, $priority, $id_agent_module, $id_aam,
$critical_instructions, $warning_instructions,
$unknown_instructions, $source, $tags, $custom_data);
$unknown_instructions, $source, $tags, $custom_data, $id_extra);
break;
case "postgresql":
$sql = sprintf ('
@ -788,14 +788,14 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
timestamp, estado, utimestamp, id_usuario,
event_type, criticity, id_agentmodule, id_alert_am,
critical_instructions, warning_instructions,
unknown_instructions, source, tags, custom_data)
unknown_instructions, source, tags, custom_data, id_extra)
VALUES (%d, %d, "%s", NOW(), %d,
ceil(date_part(\'epoch\', CURRENT_TIMESTAMP)), "%s",
"%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s")',
"%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s")',
$id_agent, $id_group, $event, $status, $id_user,
$event_type, $priority, $id_agent_module, $id_aam,
$critical_instructions, $warning_instructions,
$unknown_instructions, $source, $tags, $custom_data);
$unknown_instructions, $source, $tags, $custom_data, $id_extra);
break;
case "oracle":
$sql = sprintf ("
@ -803,13 +803,13 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0,
timestamp, estado, utimestamp, id_usuario,
event_type, criticity, id_agentmodule, id_alert_am,
critical_instructions, warning_instructions,
unknown_instructions, source, tags, custom_data)
unknown_instructions, source, tags, custom_data, id_extra)
VALUES (%d, %d, '%s', CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP,
'%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s')",
'%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
$id_agent, $id_group, $event, $status, $id_user,
$event_type, $priority, $id_agent_module, $id_aam,
$critical_instructions, $warning_instructions,
$unknown_instructions, $source, $tags, $custom_data);
$unknown_instructions, $source, $tags, $custom_data, $id_extra);
break;
}
}
@ -3394,9 +3394,9 @@ function events_sql_events_grouped_agents($id_agent, $server_id = -1,
$sql_post .= " AND (utimestamp <= " . $udate_to . ")";
}
}
//Search by tag
if (!empty($tag_with)) {
if (!empty($tag_with) && (io_safe_output($tag_with) != "[]") && (io_safe_output($tag_with) != "[\"0\"]")) {
$sql_post .= ' AND ( ';
$first = true;
foreach ($tag_with as $id_tag) {
@ -3406,7 +3406,7 @@ function events_sql_events_grouped_agents($id_agent, $server_id = -1,
}
$sql_post .= ' ) ';
}
if (!empty($tag_without)) {
if (!empty($tag_without) && (io_safe_output($tag_without) != "[]") && (io_safe_output($tag_with) != "[\"0\"]")) {
$sql_post .= ' AND ( ';
$first = true;
foreach ($tag_without as $id_tag) {

View File

@ -368,6 +368,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
}
}
}
EventZoomEnd(null,map.zoom);
}
});
}
@ -396,7 +397,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
}
?>
}
last_time_of_data = Math.round(new Date().getTime() / 1000); //Unixtimestamp
//Test if the user change the refresh time.
@ -405,11 +406,16 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
oldRefreshAjaxIntervalSeconds = refreshAjaxIntervalSeconds;
}
EventZoomEnd(null,map.zoom);
}
$(document).ready (
function () {
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
EventZoomEnd(null,map.zoom);
}
);
</script>

View File

@ -256,7 +256,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
for ($i = 0; $i <= $resolution; $i++) {
$timestamp = $datelimit + ($interval * $i);
if ($fullscale && $resolution > 250) {
if ($fullscale && ($resolution > ($config['graph_res'] * 50))) {
$timestamp = $data[$i]['utimestamp'];
}
@ -360,7 +360,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
$time_format = "M \nd H\h";
}
else {
$time_format = "M Y";
$time_format = "Y M \nd H\h";
}
}
else {
@ -381,7 +381,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
$time_format = "M d H\h";
}
else {
$time_format = "M Y";
$time_format = "Y M d H\h";
}
}
@ -579,11 +579,46 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
}
else {
$data = db_get_all_rows_filter ('tagente_datos',
array ('id_agente_modulo' => (int)$agent_module_id,
"utimestamp > $datelimit",
"utimestamp < $date",
'order' => 'utimestamp ASC'),
array ('datos', 'utimestamp'), 'AND', $search_in_history_db);
array ('id_agente_modulo' => (int)$agent_module_id,
"utimestamp > $datelimit",
"utimestamp < $date",
'order' => 'utimestamp ASC'),
array ('datos', 'utimestamp'), 'AND', false);
if ($search_in_history_db) {
$cache = false;
$history = false;
$sql = "SELECT datos, utimestamp FROM tagente_datos WHERE id_agente_modulo = " . (int)$agent_module_id .
" AND utimestamp > " . $datelimit . " AND utimestamp < " . $date .
" ORDER BY utimestamp ASC";
// Connect to the history DB
if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) {
$config['history_db_connection'] = db_connect($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false);
}
if ($config['history_db_connection'] !== false) {
$history = mysql_db_process_sql ($sql, 'affected_rows', $config['history_db_connection'], false);
}
if ($history === false) {
$history = array ();
}
$new_data = array();
$last_timestamp = 0;
foreach($history as $h) {
$new_data[] = $h;
$last_timestamp = $h['utimestamp'];
}
foreach($data as $d) {
if ($d['utimestamp'] > $last_timestamp) {
$new_data[] = $d;
$last_timestamp = $d['utimestamp'];
}
}
$data = $new_data;
}
}
// Get module warning_min and critical_min
@ -832,7 +867,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$only_image = false, $homeurl = '', $ttl = 1, $projection = false,
$adapt_key = '', $compare = false, $show_unknown = false,
$menu = true, $backgroundColor = 'white', $percentil = null,
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false) {
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false,
$id_widget_dashboard = false) {
global $config;
global $graphic_type;
@ -897,8 +933,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$date, $unit, $baseline, $return_data, $show_title,
$projection, $adapt_key, $compare, '', '', $show_unknown,
$percentil, $dashboard, $vconsole, $type_graph, $fullscale);
if ($return_data) {
return $data_returned;
}
@ -949,6 +984,13 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
}
else {
// Color commented not to restrict serie colors
if($id_widget_dashboard){
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
$color['min']['color'] = $opcion['min'];
$color['sum']['color'] = $opcion['avg'];
$color['max']['color'] = $opcion['max'];
}
return
area_graph($flash_chart, $chart, $width, $height, $color,
$legend, $long_index,
@ -1035,7 +1077,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$prediction_period = false, $background_color = 'white',
$name_list = array(), $unit_list = array(), $show_last = true, $show_max = true,
$show_min = true, $show_avg = true, $labels = array(), $dashboard = false,
$vconsole = false, $percentil = null, $from_interface = false) {
$vconsole = false, $percentil = null, $from_interface = false, $id_widget_dashboard=false) {
global $config;
global $graphic_type;
@ -1072,7 +1114,8 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$time_format_2 = 'H\h';
}
else {
$time_format = "M Y";
$time_format = "Y M d";
$time_format_2 = 'H\h';
}
// Set variables
@ -1090,7 +1133,6 @@ function graphic_combined_module ($module_list, $weight_list, $period,
while ($in_range) {
$timestamp_f = graph_get_formatted_date($j, $time_format, $time_format_2);
//$timestamp_f = date('d M Y H:i:s', $j);
$before_projection[$timestamp_f] = 0;
if ($j > $date) {
@ -1870,6 +1912,15 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$color[15] = array('border' => '#000000',
'color' => COL_GRAPH13,
'alpha' => CHART_DEFAULT_ALPHA);
if($id_widget_dashboard){
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
foreach ($module_list as $key => $value) {
if(!empty($opcion[$value])){
$color[$key]['color'] = $opcion[$value];
}
}
}
$threshold_data = array();
@ -3419,7 +3470,12 @@ function graph_custom_sql_graph ($id, $width, $height,
global $config;
$report_content = db_get_row ('treport_content', 'id_rc', $id);
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$id);
if($id != null){
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$id);
}
else{
$historical_db = $content['historical_db'];
}
if ($report_content["external_source"] != "") {
$sql = io_safe_output ($report_content["external_source"]);
}
@ -3868,7 +3924,9 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
$timestamp_short = date($time_format, $timestamp);
$long_index[$timestamp_short] = date(
html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp);
$timestamp = $timestamp_short;
if (!$fullscale) {
$timestamp = $timestamp_short;
}
/////////////////////////////////////////////////////////////////
if ($total > $max_value) {
@ -4207,7 +4265,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit =
$chart_time_format = "M d H\h";
}
else {
$chart_time_format = "M Y";
$chart_time_format = "Y M d H\h";
}
// Calculate source indexes
@ -4336,7 +4394,7 @@ function graph_netflow_total_area ($data, $period, $width, $height, $unit = '',
$chart_time_format = "M d H\h";
}
else {
$chart_time_format = "M Y";
$chart_time_format = "Y M d H\h";
}
// Calculate min, max and avg values
@ -4635,7 +4693,7 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
$time_format = "M d H\h";
}
else {
$time_format = "M Y";
$time_format = "Y M d H\h";
}
$timestamp_short = date($time_format, $timestamp);
@ -4813,7 +4871,7 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
$time_format = "M d H\h";
}
else {
$time_format = "M Y";
$time_format = "Y M d H\h";
}
$legend = array();

View File

@ -609,7 +609,7 @@ function html_print_select_from_sql ($sql, $name, $selected = '',
function html_print_extended_select_for_post_process($name, $selected = '',
$script = '', $nothing = '', $nothing_value = '0', $size = false,
$return = false, $select_style = false, $unique_name = true,
$disabled = false) {
$disabled = false, $no_change = 0) {
global $config;
@ -617,6 +617,10 @@ function html_print_extended_select_for_post_process($name, $selected = '',
$fields = post_process_get_custom_values();
if($no_change != 0){
$fields[-1] = __('No change');
}
$selected_float = (float)$selected;
$found = false;

View File

@ -1722,7 +1722,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period,
break;
//log4x
case 24:
$sql = sprintf ("SELECT datos AS data, utimestamp
$sql = sprintf ("SELECT message AS data, utimestamp
FROM tagente_datos_log4x
WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d

View File

@ -122,7 +122,16 @@ function networkmap_process_networkmap($id = 0) {
null,
$old_mode);
$filename_dot = sys_get_temp_dir() . "/networkmap_" . $filter;
switch (PHP_OS) {
case "WIN32":
case "WINNT":
case "Windows":
$filename_dot = sys_get_temp_dir() . "\\networkmap_" . $filter;
break;
default:
$filename_dot = sys_get_temp_dir() . "/networkmap_" . $filter;
break;
}
if ($simple) {
$filename_dot .= "_simple";
@ -133,12 +142,23 @@ function networkmap_process_networkmap($id = 0) {
$filename_dot .= "_" . $id . ".dot";
file_put_contents($filename_dot, $graph);
$filename_plain = sys_get_temp_dir() . "/plain.txt";
$cmd = "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
switch (PHP_OS) {
case "WIN32":
case "WINNT":
case "Windows":
$filename_plain = sys_get_temp_dir() . "\\plain.txt";
$cmd = io_safe_output($config['graphviz_bin_dir'] . "\\$filter.exe -Tplain -o " . $filename_plain . " " .
$filename_dot);
break;
default:
$filename_plain = sys_get_temp_dir() . "/plain.txt";
$cmd = "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
break;
}
system ($cmd);
unlink($filename_dot);
@ -146,6 +166,8 @@ function networkmap_process_networkmap($id = 0) {
$nodes = networkmap_loadfile($id, $filename_plain,
$relation_nodes, $graph);
unlink($filename_plain);
//Set the position of modules
foreach ($nodes as $key => $node) {
if ($node['type'] == 'module') {
@ -246,8 +268,6 @@ function networkmap_process_networkmap($id = 0) {
db_process_sql_update('tmap',
array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y']),
array('id' => $id));
unlink($filename_plain);
}
return $nodes_and_relations;

View File

@ -128,6 +128,26 @@ function reporting_make_reporting_data($report = null, $id_report,
$content['period'] = $period;
}
if(defined('METACONSOLE')){
if (is_array($content['id_agent'])) {
$new_array = array();
foreach ($content['id_agent'] as $key => $value) {
$meta_id = explode("|",$value);
array_push($new_array,$meta_id[1]);
}
$content['id_agent'] = $new_array;
}
else {
$meta_id = explode("|",$content['id_agent']);
if ($meta_id[1] != null) {
$content['id_agent'] = array();
$content['id_agent'] = $meta_id[1];
}
}
}
$content['style'] = json_decode(io_safe_output($content['style']), true);
if(isset($content['style']['name_label'])){
//Add macros name
@ -147,7 +167,18 @@ function reporting_make_reporting_data($report = null, $id_report,
}
}
$content['name'] = reporting_label_macro($items_label, $content['style']['name_label']);
if(sizeof($content['id_agent']) != 1){
$content['style']['name_label'] = str_replace("_agent_",sizeof($content['id_agent']).__(' agents'),$content['style']['name_label']);
}
if(sizeof($content['id_agent_module']) != 1){
$content['style']['name_label'] = str_replace("_module_",sizeof($content['id_agent_module']).__(' modules'),$content['style']['name_label']);
}
$content['name'] = reporting_label_macro($items_label, $content['style']['name_label']);
if ($metaconsole_on) {
//Restore db connection
@ -3940,9 +3971,12 @@ function reporting_sql($report, $content) {
$header = explode('|', $content['header_definition']);
$return['header'] = $header;
}
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$content['id_rc']);
if($content['id_rc'] != null){
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$content['id_rc']);
}
else{
$historical_db = $content['historical_db'];
}
$result = db_get_all_rows_sql($sql,$historical_db);
if ($result !== false) {
@ -4339,6 +4373,20 @@ function reporting_advanced_sla ($id_agent_module, $time_from = null, $time_to =
$max_value = null;
$min_value = null;
}
if ( (!isset($min_value)) && (!isset($max_value)) ) {
if ( ($agentmodule_info["id_tipo_modulo"] == "2") // generic_proc
|| ($agentmodule_info["id_tipo_modulo"] == "6") // remote_icmp_proc
|| ($agentmodule_info["id_tipo_modulo"] == "9") // remote_tcp_proc
|| ($agentmodule_info["id_tipo_modulo"] == "18") // remote_snmp_proc
|| ($agentmodule_info["id_tipo_modulo"] == "21") // async_proc
|| ($agentmodule_info["id_tipo_modulo"] == "31") ) { // web_proc
// Boolean values are OK if they're different from 0
$max_value = 0;
$min_value = 0;
$inverse_interval = 1;
}
}
}
// By default show last day
@ -5763,17 +5811,12 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
require_once ($config["homedir"] . '/include/functions_graph.php');
if ($type_report == 'automatic_graph') {
// Do none
}
else {
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
@ -5816,9 +5859,17 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
array_push ($weights, $graph_item["weight"]);
if (in_array('label',$content['style'])) {
if (defined('METACONSOLE')) {
$item = array('type' => 'custom_graph',
'id_agent' =>$content['id_agent'],
'id_agent_module'=>$graph_item['id_agent_module']);
}
else {
$item = array('type' => 'custom_graph',
'id_agent' =>modules_get_agentmodule_agent($graph_item['id_agent_module']),
'id_agent_module'=>$graph_item['id_agent_module']);
}
$label = reporting_label_macro($item, $content['style']['label']);
$labels[$graph_item['id_agent_module']] = $label;
}
@ -5838,6 +5889,13 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
$height = 50;
}
}
if (defined('METACONSOLE')) {
$modules_new = array();
foreach ($modules as $mod) {
$modules_new[] = $mod['module'];
}
$modules = $modules_new;
}
switch ($type) {
case 'dinamic':
@ -10234,7 +10292,6 @@ function reporting_get_agentmodule_sla_working_timestamp ($period, $date_end, $w
}
function reporting_label_macro ($item, $label) {
switch ($item['type']) {
case 'event_report_agent':
case 'alert_report_agent':
@ -10260,6 +10317,7 @@ function reporting_label_macro ($item, $label) {
$label = str_replace("_address_", $agent_name, $label);
}
break;
case 'automatic_graph':
case 'simple_graph':
case 'module_histogram_graph':
case 'custom_graph':
@ -10313,4 +10371,4 @@ function reporting_label_macro ($item, $label) {
return $label;
}
?>
?>

View File

@ -279,4 +279,111 @@ function snmp_update_translation($oid, $new_oid, $description, $post_process) {
}
}
}
/*
* Print the event filter tag cloud (enterprise feature)
* @param $filter_resume: Array with the active filters
* @param $filter_refs: Array of all arrays to humanize some tags
*/
function print_snmp_tags_active_filters ($filter_resume = array()) {
global $config;
$tags_set = array();
// Alert
if (isset($filter_resume['filter_fired'])) {
array_push ($tags_set, array(
'title' => __('Alert'),
'value' => $filter_resume['filter_fired']
));
}
// Severity
if (isset($filter_resume['filter_severity'])) {
array_push ($tags_set, array(
'title' => __('Severity'),
'value' => $filter_resume['filter_severity']
));
}
// Pagination
if ($filter_resume['pagination'] == "") {
$filter_resume['pagination'] = $config["block_size"];
}
array_push ($tags_set, array(
'title' => __('Pagination'),
'value' => $filter_resume['pagination']
));
// Free search
if (isset($filter_resume['free_search_string']) && $filter_resume['free_search_string'] != "") {
array_push ($tags_set, array(
'title' => __('Search'),
'value' => $filter_resume['free_search_string']
));
}
// Status
if (isset($filter_resume['filter_status']) && $filter_resume['filter_status'] != "") {
array_push ($tags_set, array(
'title' => __('Status'),
'value' => $filter_resume['filter_status']
));
}
// Group by
if (isset($filter_resume['group_by'])) {
if ($filter_resume['group_by'] == 0) {
array_push ($tags_set, array(
'title' => __('Group by Enterprise String / IP'),
'value' => __('No')
));
}
else {
array_push ($tags_set, array(
'title' => __('Group by Enterprise String / IP'),
'value' => __('Yes')
));
}
}
// Date from
if (isset($filter_resume['date_from_trap']) && $filter_resume['date_from_trap'] != "") {
if (isset($filter_resume['time_from_trap']) && $filter_resume['time_from_trap'] != "") {
array_push ($tags_set, array(
'title' => __('From'),
'value' => $filter_resume['date_from_trap'] . " " . $filter_resume['time_from_trap']
));
}
else {
array_push ($tags_set, array(
'title' => __('From'),
'value' => $filter_resume['date_from_trap']
));
}
}
// Date to
if (isset($filter_resume['date_to_trap']) && $filter_resume['date_to_trap'] != "") {
if (isset($filter_resume['time_to_trap']) && $filter_resume['time_to_trap'] != "") {
array_push ($tags_set, array(
'title' => __('To'),
'value' => $filter_resume['date_to_trap'] . " " . $filter_resume['time_to_trap']
));
}
else {
array_push ($tags_set, array(
'title' => __('To'),
'value' => $filter_resume['date_to_trap']
));
}
}
// Trap type
if (isset($filter_resume['trap_type'])) {
array_push ($tags_set, array(
'title' => __('Trap type'),
'value' => $filter_resume['trap_type']
));
}
$title = '';
if(!$config['pure']){
$title = isset($filter_resume['title'])
? __('Active filter') . " (" . $filter_resume['title'] . ")"
: __('Active filters');
}
if (sizeof($filter_resume) > 0) ui_print_tags_view($title, $tags_set);
}
?>

View File

@ -116,7 +116,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a
echo "</a>";
}
echo '&nbsp;<span>' . $level . '</span>';
echo html_print_checkbox("create_$sub_id", 0, false, true, false, '') .'&nbsp;<span>' . $level . '</span>';
if (isset ($sub_level['__VALUE__'])) {
echo '<span class="value" style="display: none;">&nbsp;=&nbsp;' . $sub_level['__VALUE__'] . '</span>';
}
@ -618,3 +618,137 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
}
?>
<script type="text/javascript">
$(document).ready(function () {
$('input[name*=create_network_component]').click(function () {
var id_check = $('#ul_0').find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
if($(this).is(':checked')){
return this.id;
}
} }).get();
$('input[name*=create_network_component]').removeClass("sub add");
$('input[name*=create_network_component]').addClass("sub spinn");
var target_ip = $('#text-target_ip').val();
var community = $('#text-community').val();
var snmp_version = $('#snmp_browser_version').val();
var snmp3_auth_user = $('#text-snmp3_browser_auth_user').val();
var snmp3_security_level = $('#snmp3_browser_security_level').val();
var snmp3_auth_method = $('#snmp3_browser_auth_method').val();
var snmp3_auth_pass = $('#password-snmp3_browser_auth_pass').val();
var snmp3_privacy_method = $('#snmp3_browser_privacy_method').val();
var snmp3_privacy_pass = $('#password-snmp3_browser_privacy_pass').val();
var custom_action = $('#hidden-custom_action').val();
if (custom_action == undefined) {
custom_action = '';
}
var oids = [];
id_check.forEach(function(product, index) {
var oid = $("#"+product).siblings('a').attr('href');
if(oid.indexOf('javascript: snmpGet("')!=-1) {
oid = oid.replace('javascript: snmpGet("',"");
oid = oid.replace('");',"");
oids.push(oid);
}
});
// Prepare the AJAX call
var params = [
"target_ip=" + target_ip,
"community=" + community,
"oids=" + oids,
"snmp_browser_version=" + snmp_version,
"snmp3_browser_auth_user=" + snmp3_auth_user,
"snmp3_browser_security_level=" + snmp3_security_level,
"snmp3_browser_auth_method=" + snmp3_auth_method,
"snmp3_browser_auth_pass=" + snmp3_auth_pass,
"snmp3_browser_privacy_method=" + snmp3_privacy_method,
"snmp3_browser_privacy_pass=" + snmp3_privacy_pass,
"action=" + "create_modules_snmp",
"custom_action=" + custom_action,
"page=include/ajax/snmp_browser.ajax"
];
$.ajax({
type: "GET",
url: "ajax.php",
data: params.join ("&"),
dataType: "json",
success: function(data) {
$('input[name*=create_network_component]').removeClass("sub spinn");
$('input[name*=create_network_component]').addClass("sub add");
if(data.length !== 0){
$('#error_text').text("");
data.forEach( function(valor, indice, array) {
console.log(valor);
$('#error_text').append('<br/>'+ valor );
});
$("#dialog_error")
.dialog({
resizable: true,
draggable: true,
modal: true,
height: 300,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
}
});
} else {
$("#dialog_success")
.dialog({
resizable: true,
draggable: true,
modal: true,
height: 250,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
}
});
}
}
});
});
$('input[id^=checkbox-create]').change(function () {
if ($(this).is(':checked') ) {
$('input[name*=create_network_component]').show();
var id_input = $(this).attr("id");
id_input = id_input.split("checkbox-create_");
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
return this.id;
} }).get();
checks.forEach(function(product, index) {
$("#"+product).prop('checked', "true");
});
} else {
var id_input = $(this).attr("id");
id_input = id_input.split("checkbox-create_");
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
return this.id;
} }).get();
checks.forEach(function(product, index) {
$("#"+product).prop('checked', false);
});
}
});
});
</script>

View File

@ -1585,6 +1585,7 @@ function ui_process_page_body ($string, $bitfield) {
* @param bool $return Whether to return or print this
* @param string $offset_name The name of parameter for the offset.
* @param bool $print_total_items Show the text with the total items. By default true.
* @param string $set_id Set id of div.
*
* @return string The pagination div or nothing if no pagination needs to be done
*/
@ -1592,7 +1593,7 @@ function ui_pagination ($count, $url = false, $offset = 0,
$pagination = 0, $return = false, $offset_name = 'offset',
$print_total_items = true, $other_class = '',
$script = "",
$parameter_script = array('count' => '', 'offset' => 'offset_param')) {
$parameter_script = array('count' => '', 'offset' => 'offset_param'), $set_id = '') {
global $config;
@ -1613,16 +1614,22 @@ function ui_pagination ($count, $url = false, $offset = 0,
$url = ui_get_url_refresh (array ($offset_name => false));
}
if(!empty($set_id)){
$set_id= " id = '$set_id'";
}
// Pagination links for users include delete, create and other params, now not use these params, and not retry the previous action when go to pagination link.
$remove = array("user_del","disable_user","delete_user");
$finalUrl = $config['homeurl'].'?';
foreach($_GET as $index => $get){
if(!in_array($index, $remove)){
$finalUrl .= $index.'='.$get.'&';
$url = explode("&",$url);
$finalUrl = array();
foreach ($url as $key => $value) {
if(strpos($value, $remove[0]) === false && strpos($value, $remove[1]) === false && strpos($value, $remove[2]) === false){
array_push($finalUrl,$value);
}
}
$url = $finalUrl;
$url = implode("&",$finalUrl);
/*
URL passed render links with some parameter
@ -1635,7 +1642,7 @@ function ui_pagination ($count, $url = false, $offset = 0,
if ($count <= $pagination) {
if ($print_total_items) {
$output = "<div class='pagination $other_class'>";
$output = "<div class='pagination $other_class' $set_id>";
//Show the count of items
$output .= sprintf(__('Total items: %s'), $count);
// End div and layout
@ -1659,7 +1666,7 @@ function ui_pagination ($count, $url = false, $offset = 0,
}
$output = "<div class='pagination $other_class'>";
$output = "<div class='pagination $other_class' $set_id>";
//Show the count of items
if ($print_total_items) {

View File

@ -186,7 +186,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
</div>
</td>
<td align="left" style="">' .
html_print_input_text('label', '', '', 20, 200, true) . '</td>';
html_print_input_text('label', '', '', 20, 200, true) . '
<span id="advice_label" style="font-style:italic;z-index:3;display:inline;margin-top:0px;float:right;margin-right:100px;">
'.__("Click right mouse button to change the background color of the label editor").'
</span>
</td>';
$form_items['image_row'] = array();

View File

@ -138,6 +138,7 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
var baseLayer = null;
map.events.on({"zoomend": EventZoomEnd});
map.events.on({"mouseup": EventZoomEnd});
//Define the maps layer
for (var baselayerIndex in objBaseLayers) {
@ -224,10 +225,18 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
.transform(map.displayProjection, map.getProjectionObject());
map.setCenter (lonLat, initial_zoom);
}
function EventZoomEnd (evt) {
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
function EventZoomEnd (evt,zoom = map.zoom) {
if(evt == null){
var actual_zoom = (zoom < 6) ? 6 : zoom;
}
else{
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
}
var max_width_marker = 38;
var max_zoom_map = map.numZoomLevels;
var max_font_size = 15;
@ -258,7 +267,6 @@ function EventZoomEnd (evt) {
var new_width_marker = (actual_zoom * max_width_marker) / max_zoom_map;
var new_height_marker = (actual_zoom * max_width_marker) / max_zoom_map;
console.log(feature);
feature.style.fontSize = '' + actual_font_size + ' !important';
feature.style.graphicHeight = new_height_marker;
feature.style.graphicWidth = new_width_marker;
@ -280,6 +288,7 @@ function EventZoomEnd (evt) {
function changeShowStatus(newShowStatus) {
statusShow = newShowStatus;
hideAgentsStatus();
EventZoomEnd(null,map.zoom);
js_refreshParentLines();
}

View File

@ -1237,7 +1237,8 @@ function install_free_package_prev_step(package, version, homeurl) {
}
},
{
"Cancel": function () {
text:cancel_button,
click: function () {
$(this).dialog("close");
$("<div id='cancel_mr' class='dialog ui-dialog-content' title='" + mr_available + "'></div>").dialog ({

View File

@ -16385,7 +16385,7 @@ msgid "Without protocol and port"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:92

View File

@ -16547,7 +16547,7 @@ msgid "Without protocol and port"
msgstr "Without protocol and port"
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr "e.g., switch.eHorus.com"
#: ../../godmode/setup/setup_ehorus.php:92

View File

@ -16978,8 +16978,8 @@ msgid "Without protocol and port"
msgstr "Sin protocolo y puerto"
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgstr "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr "e.g., portal.ehorus.com"
#: ../../godmode/setup/setup_ehorus.php:92
msgid "API Port"

View File

@ -17215,7 +17215,7 @@ msgid "Without protocol and port"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr ""
#: ../../godmode/setup/setup_ehorus.php:92

View File

@ -16299,8 +16299,8 @@ msgid "Without protocol and port"
msgstr "プロトコルとポート番号は含みません"
#: ../../godmode/setup/setup_ehorus.php:87
msgid "e.g., switch.ehorus.com"
msgstr "例: switch.ehorus.com"
msgid "e.g., portal.ehorus.com"
msgstr "例: portal.ehorus.com"
#: ../../godmode/setup/setup_ehorus.php:92
msgid "API Port"

View File

@ -656,7 +656,7 @@ input.sub[disabled] {
input.next, input.upd, input.ok, input.wand, input.delete, input.cog,
input.target, input.search, input.copy, input.add, input.graph,
input.percentile, input.binary, input.camera, input.config,
input.cancel, input.default, input.filter, input.pdf {
input.cancel, input.default, input.filter, input.pdf,input.spinn {
padding-right: 30px;
height: 23px;
@ -741,6 +741,9 @@ input.pdf:disabled {
input.camera {
background-image: url(../../images/input_camera.png) !important;
}
input.spinn {
background-image: url(../../images/spinner_green.gif) !important;
}
#toolbox #auto_save {
padding-top: 5px;
@ -4151,4 +4154,9 @@ div#footer_help{
/*center ui dialog center*/
.ui-dialog-titlebar .ui-icon-closethick {
margin-top: -5px !important;
}
/*view-agents lastest events for this agent*/
#div_all_events_24h{
padding: 4px;
}

View File

@ -351,7 +351,7 @@ if (! isset ($config['id_user'])) {
if (($nick_in_db != false) && ((!is_user_admin($nick)
|| $config['enable_pass_policy_admin']))
&& (defined('PANDORA_ENTERPRISE'))
&& (file_exists (ENTERPRISE_DIR . "/load_enterprise.php"))
&& ($config['enable_pass_policy'])) {
include_once(ENTERPRISE_DIR . "/include/auth/mysql.php");
@ -523,12 +523,12 @@ if (! isset ($config['id_user'])) {
else { //login wrong
$blocked = false;
if ((!is_user_admin($nick) || $config['enable_pass_policy_admin']) && defined('PANDORA_ENTERPRISE')) {
if ((!is_user_admin($nick) || $config['enable_pass_policy_admin']) && file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
$blocked = login_check_blocked($nick);
}
if (!$blocked) {
if (defined('PANDORA_ENTERPRISE')) {
if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
login_check_failed($nick); //Checks failed attempts
}
$login_failed = true;
@ -1113,11 +1113,11 @@ require('include/php_to_js_values.php');
function first_time_identification () {
run_identification_wizard (-1, -1, 1);
}
var times_fired_register_wizard = 0;
function run_identification_wizard (register, newsletter , return_button) {
if (times_fired_register_wizard) {
$(".ui-dialog-titlebar-close").show();
//Reset some values
@ -1147,10 +1147,9 @@ require('include/php_to_js_values.php');
$("#login_accept_register").dialog('open');
}
else {
$(".ui-dialog-titlebar-close").show();
$("#container").append('<div class="id_wizard"></div>');
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{"page": "general/login_identification_wizard",
"not_return": 1,
"force_register": register,

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