Merge branch 'develop' into '1014-Aparece-el-agent-name-en-lugar-del-alias-en-la-consola-SNMP-dev'

# Conflicts:
#   pandora_console/operation/snmpconsole/snmp_view.php
This commit is contained in:
vgilc 2017-07-13 11:59:19 +02:00
commit cc9191b676
112 changed files with 48469 additions and 41180 deletions

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-170615
Version: 7.0NG.707-170713
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-170615"
pandora_version="7.0NG.707-170713"
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 => '170615';
use constant AGENT_VERSION => '7.0NG.707';
use constant AGENT_BUILD => '170713';
# 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 170615
%define version 7.0NG.707
%define release 170713
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 170615
%define version 7.0NG.707
%define release 170713
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="170615"
PI_VERSION="7.0NG.707"
PI_BUILD="170713"
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

@ -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
{170615}
{170713}
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 170615)")
#define PANDORA_VERSION ("7.0NG.707(Build 170713)")
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 170615))"
VALUE "ProductVersion", "(7.0NG.707(Build 170713))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.705-170615
Version: 7.0NG.707-170713
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-170615"
pandora_version="7.0NG.707-170713"
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

@ -1,25 +1,24 @@
START TRANSACTION;
DROP PROCEDURE IF EXISTS addcol_oum706;
delimiter '//'
CREATE PROCEDURE addcol_oum706() BEGIN
IF NOT EXISTS (
SELECT * FROM information_schema.columns WHERE table_name='treport_content' AND column_name='historical_db'
) THEN
ALTER TABLE treport_content ADD COLUMN historical_db tinyint(1) UNSIGNED NOT NULL default 0;
END IF;
IF NOT EXISTS (
SELECT * FROM information_schema.columns WHERE table_name='tpolicy_modules' AND column_name='ip_target'
) THEN
ALTER TABLE tpolicy_modules ADD COLUMN ip_target varchar(100) default '';
END IF;
END;
//
delimiter ';'
CALL addcol_oum706();
DROP PROCEDURE addcol_oum706;
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

@ -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;

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

@ -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

@ -886,7 +886,7 @@ if ($update_module || $create_module) {
$post_process = (string) get_parameter ('post_process', 0.0);
if(get_parameter ('prediction_module')){
$prediction_module = get_parameter ('prediction_module');
$prediction_module = 1;
}
else{
$prediction_module = 0;

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

@ -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

@ -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

@ -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,28 @@ function visual_map_main() {
//Fixed to wait the load of images.
$(window).load(function() {
// 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);
});
@ -488,6 +510,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['height'] = $("input[name=height]").val();
values['parent'] = $("select[name=parent]").val();
@ -541,14 +566,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':
@ -608,7 +633,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;
@ -930,7 +955,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");
}
}

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

@ -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>

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

@ -268,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;
@ -290,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 {
@ -301,9 +295,6 @@ 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);
@ -328,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]];
}
}
}
}

View File

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

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

@ -8843,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;
@ -8867,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;
}
@ -8961,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'],
@ -8971,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
@ -9138,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

@ -1749,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

@ -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

@ -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
@ -1072,7 +1107,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 +1126,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) {
@ -3419,7 +3454,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 +3908,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 +4249,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 +4378,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 +4677,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 +4855,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

@ -148,8 +148,9 @@ function networkmap_process_networkmap($id = 0) {
case "WINNT":
case "Windows":
$filename_plain = sys_get_temp_dir() . "\\plain.txt";
$cmd = $config['graphviz_win'] . "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
$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";
@ -157,7 +158,7 @@ function networkmap_process_networkmap($id = 0) {
$filename_dot;
break;
}
system ($cmd);
unlink($filename_dot);
@ -165,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') {
@ -265,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

@ -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

@ -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

@ -4151,4 +4151,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;

View File

@ -70,8 +70,8 @@
<body>
<div style='height: 10px'>
<?php
$version = '7.0NG.705';
$build = '170615';
$version = '7.0NG.707';
$build = '170713';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -168,7 +168,7 @@ echo __('Group') . '&nbsp;';
$groups = users_get_groups (false, $access);
html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false, 'width:150px');
html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false);
echo '</td><td style="white-space:nowrap;">';

View File

@ -238,7 +238,7 @@ if (empty($export_btn) || $show_form) {
$table->data[0][1] = html_print_select_groups($config['id_user'],
"RR", users_can_manage_group_all(), "group", $group, '', '', 0, true, false, true,
'w130', false);
'', false);
//Agent selector
$table->data[1][0] = '<b>'.__('Source agent').'</b>';

View File

@ -141,9 +141,29 @@ $result = db_get_all_rows_sql ($sql, true);
if ($result === false) {
ui_print_empty_data( __('This agent doesn\'t have any GIS data.') );
$sql2 = sprintf ("
SELECT current_longitude AS longitude, current_latitude AS latitude, current_altitude AS altitude,
start_timestamp, description, number_of_packages, manual_placement
FROM tgis_data_status
WHERE tagente_id_agente = %d
ORDER BY start_timestamp DESC
LIMIT %d OFFSET %d", $agentId, $config['block_size'], (int)get_parameter ('offset'));
$result2 = db_get_all_rows_sql ($sql2, true);
if ($result2 === false) {
ui_print_empty_data( __('This agent doesn\'t have any GIS data.') );
} else {
$result2[0]['end_timestamp'] = date('Y-m-d H:i:s');
$result = $result2;
}
}
else {
if ($result !== false) {
if(!$countData){
$countData = 1;
}
ui_pagination ($countData, false) ;
$table->data = array();
foreach ($result as $key => $row) {

View File

@ -150,7 +150,10 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$avg_only = $show_other;
}
$period = get_parameter ("period", SECONDS_1DAY);
$period = get_parameter ("period");
if ($period == "") {
$period = get_parameter ("period_select", SECONDS_1DAY);
}
$id = get_parameter ("id", 0);
$width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH);
$height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT);

View File

@ -35,11 +35,15 @@ ui_toggle(
?>
<script type="text/javascript">
$(document).ready(function() {
events_table(0);
});
function events_table(all_events_24h){
var parameters = {};
parameters["table_events"] = 1;
parameters["id_agente"] = <?php echo $id_agente; ?>;
parameters["page"] = "include/ajax/events";
parameters["all_events_24h"] = all_events_24h;
jQuery.ajax ({
data: parameters,
@ -49,7 +53,17 @@ ui_toggle(
success: function (data) {
$("#event_list").empty();
$("#event_list").html(data);
$('#checkbox-all_events_24h').on('change',function(){
if( $('#checkbox-all_events_24h').is(":checked") ){
$('#checkbox-all_events_24h').val(1);
}
else{
$('#checkbox-all_events_24h').val(0);
}
all_events_24h = $('#checkbox-all_events_24h').val();
events_table(all_events_24h);
});
}
});
});
}
</script>

View File

@ -290,7 +290,7 @@ $table->style[4] = 'font-weight: bold;';
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups($config['id_user'], 'AR',
true, 'ag_group', $ag_group, '', '', '0', true, false,
false, 'w130', false, 'width:150px;', false, false,
false, '', false, '', false, false,
'id_grupo', false);
$fields = array ();

View File

@ -613,7 +613,7 @@ $data = array();
$data[0] = __('Group') . $jump;
$data[0] .= html_print_select_groups($config["id_user"], $access, true,
'id_group', $id_group, '', '', 0, true, false, false, 'w130', false, false, false, false, 'id_grupo', $strict_user). $jump;
'id_group', $id_group, '', '', 0, true, false, false, '', false, false, false, false, 'id_grupo', $strict_user). $jump;
//**********************************************************************
// TODO
// This code is disabled for to enabled in Pandora 5.1

View File

@ -77,7 +77,7 @@ $table->style[1] = 'font-weight: bold; vertical-align: top;';
$table->style[2] = 'font-weight: bold; vertical-align: top;';
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true, false, true, '', false, 'width:120px;') . '<br />' . '<br />';
$table->data[0][1] = html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true, false, true, '', false, 'max-width:200px;') . '<br />' . '<br />';
$table->data[0][2] = __('Type');
$table->data[0][3] = html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '<br />' .
@ -276,6 +276,9 @@ $(document).ready (function () {
setInterval("check_event()", (10 * 1000)); //10 seconds between ajax request
$("#table1").css("background-color", "#fff");
$("#table2").css("background-color", "#fff");
group_width = $("#group").width();
$("#id_agents").width(group_width + 9);
});
</script>

View File

@ -347,7 +347,7 @@ echo '<form method="post" action="' . $config['homeurl'] .
}
else {
echo "<td style='font-weight:bold;'>" . __('Dst Ip'). ui_print_help_tip (__("Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249"), true) . "</td>";
echo "<td colspan='2'>" . html_print_input_text ('ip_dst', $filter['ip_dst'], false, 30, 80, true) . "</td>";
echo "<td>" . html_print_input_text ('ip_dst', $filter['ip_dst'], false, 30, 80, true) . "</td>";
}
if ($netflow_disable_custom_lvfilters) {
@ -356,7 +356,7 @@ echo '<form method="post" action="' . $config['homeurl'] .
}
else {
echo "<td style='font-weight:bold;'>" . __('Src Ip'). ui_print_help_tip (__("Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249"), true) . "</td>";
echo "<td colspan='2'>" . html_print_input_text ('ip_src', $filter['ip_src'], false, 30, 80, true) . "</td>";
echo "<td>" . html_print_input_text ('ip_src', $filter['ip_src'], false, 30, 80, true) . "</td>";
}
echo "</tr>";
@ -368,7 +368,7 @@ echo '<form method="post" action="' . $config['homeurl'] .
}
else {
echo "<td style='font-weight:bold;'>" . __('Dst Port'). ui_print_help_tip (__("Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22"), true) . "</td>";
echo "<td colspan='2'>" . html_print_input_text ('dst_port', $filter['dst_port'], false, 30, 80, true) . "</td>";
echo "<td>" . html_print_input_text ('dst_port', $filter['dst_port'], false, 30, 80, true) . "</td>";
}
if ($netflow_disable_custom_lvfilters) {
@ -377,7 +377,7 @@ echo '<form method="post" action="' . $config['homeurl'] .
}
else {
echo "<td style='font-weight:bold;'>" . __('Src Port') . ui_print_help_tip (__("Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22"), true) . "</td>";
echo "<td colspan='2'>" . html_print_input_text ('src_port', $filter['src_port'], false, 30, 80, true) . "</td>";
echo "<td>" . html_print_input_text ('src_port', $filter['src_port'], false, 30, 80, true) . "</td>";
}
echo "</tr>";
@ -397,21 +397,19 @@ echo '<form method="post" action="' . $config['homeurl'] .
echo "<td>" . '<b>' . __('Aggregate by') . '</b>' . ui_print_help_icon ('aggregate_by', true) . "</td>";
$aggregate_list = array();
$aggregate_list = array ('none' => __('None'), 'proto' => __('Protocol'), 'srcip' =>__('Src Ip Address'), 'dstip' =>__('Dst Ip Address'), 'srcport' =>__('Src Port'), 'dstport' =>__('Dst Port') );
echo "<td colspan='2'>" . html_print_select ($aggregate_list, "aggregate", $filter['aggregate'], '', '', 0, true, false, true, '', false) . "</td>";
echo "<td>" . html_print_select ($aggregate_list, "aggregate", $filter['aggregate'], '', '', 0, true, false, true, '', false) . "</td>";
echo "<td>" . '<b>'.__('Router ip').'</b>' . "</td>";
echo "<td colspan='2'>" . html_print_input_text ('router_ip', $filter['router_ip'], false, 30, 80, true) . "</td>";
echo "<td>" . html_print_input_text ('router_ip', $filter['router_ip'], false, 30, 80, true) . "</td>";
echo "<td>" . '<b>'.__('Output format').'</b>' . "</td>";
$show_output = array ('bytes' => __('Bytes'), 'bytespersecond' => __('Bytes per second'), 'kilobytes' => __('Kilobytes'), 'megabytes' => __('Megabytes'), 'kilobytespersecond' => __('Kilobytes per second'), 'megabytespersecond' => __('Megabytes per second'));
echo "<td colspan='2'>" . html_print_select ($show_output, 'output', $filter['output'], '', '', 0, true, false, true, '', false) . "</td>";
echo "<td>" . html_print_select ($show_output, 'output', $filter['output'], '', '', 0, true, false, true, '', false) . "</td>";
echo "</tr>";
echo "</table>";
//echo "<br />";
echo "<table class='' width='100%' style='border: 0px; text-align:right;'><tr><td>";
echo html_print_submit_button (__('Draw'), 'draw_button', false, 'class="sub upd"',true) ;
@ -437,9 +435,9 @@ if ($draw != '') {
}
// Draw the netflow chart
else {
echo netflow_draw_item ($start_date, $end_date,
$interval_length, $chart_type, $filter,
$max_aggregates, $connection_name, 'HTML', $address_resolution);
echo netflow_draw_item ($start_date, $end_date,
$interval_length, $chart_type, $filter,
$max_aggregates, $connection_name, 'HTML', $address_resolution);
}
}

View File

@ -194,7 +194,7 @@ $severities = get_priorities ();
$alerted = array (__('Not fired'), __('Fired'));
foreach ($all_traps as $trap) {
$agent = agents_get_agent_with_ip ($trap['source']);
$agents[$trap["source"]] = $agent !== false ? $agent["nombre"] : $trap["source"];
$agents[$trap["source"]] = $agent !== false ? ($agent["alias"] ? $agent["alias"] : $agent["nombre"]) : $trap["source"];
$oid = enterprise_hook ('get_oid', array ($trap));
if ($oid === ENTERPRISE_NOT_HOOK) {
$oid = $trap["oid"];

View File

@ -245,11 +245,12 @@ $ignored_params['refr'] = '';
//cb();
url = js_html_entity_decode( href ) + duration;
//$(document).attr ("location", url);
$.get(window.location.href.replace("render_view","pure_ajax"), function(respuestaSolicitud){
$.post(window.location.href.replace("refr=300","refr="+new_count), function(respuestaSolicitud){
$('#background_<?php echo $id_layout; ?>').html(respuestaSolicitud);
startCountDown(refr, false);
});
}
$("#main_pure").css('background-color','<?php echo $layout['background_color']; ?>');
}
});
}
@ -260,6 +261,7 @@ $ignored_params['refr'] = '';
$('select#refr').change(function (event) {
refr = Number.parseInt(event.target.value, 10);
new_count = event.target.value;
startCountDown(refr, false);
});
}
@ -284,8 +286,13 @@ $ignored_params['refr'] = '';
$(this).css('margin-left','');
}
else {
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
if(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2 < 0){
$(this).css('margin-left','');
$(this).css('margin-top','');
} else {
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
}
});

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.705
%define release 170615
%define version 7.0NG.707
%define release 170713
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.705
%define release 170615
%define version 7.0NG.707
%define release 170713
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.705"
PI_VERSION="7.0NG.707"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -2696,6 +2696,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;

View File

@ -112,7 +112,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('MR', 3),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '705'),
('current_package_enterprise', '707'),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}');
UNLOCK TABLES;

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.705-170615
Version: 7.0NG.707-170713
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-170615"
pandora_version="7.0NG.707-170713"
package_cpan=0
package_pandora=1

View File

@ -102,8 +102,7 @@ sub pandora_startup () {
$Config{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [\%Config, $Config{"encryption_passphrase"}]);
# Update the agent cache.
enterprise_hook('update_agent_cache', [\%Config, $DBH]) if ($Config{'node_metaconsole'} == 1);
threads->create('enterprise_hook', ('update_agent_cache', [\%Config]))->detach() if ($Config{'node_metaconsole'} == 1);
pandora_audit (\%Config, 'Pandora FMS Server Daemon starting', 'SYSTEM', 'System', $DBH);
# Load servers

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