Merge branch 'develop' into 1278-extension-vmware-ext-4456-y-4479

This commit is contained in:
fbsanchez 2017-12-04 16:12:43 +01:00
commit acfccd37ae
949 changed files with 33577 additions and 1194 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.715, AIX version
# Version 7.0NG.716, 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.715, FreeBSD Version
# Version 7.0NG.716, 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.715, HP-UX Version
# Version 7.0NG.716, 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.715, GNU/Linux
# Version 7.0NG.716, 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.715, GNU/Linux
# Version 7.0NG.716, 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.715, Solaris Version
# Version 7.0NG.716, 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.715
# Version 7.0NG.716
# 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.715, AIX version
# Version 7.0NG.716, 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.715
# Version 7.0NG.716
# 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.715, HPUX Version
# Version 7.0NG.716, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.715
# Version 7.0NG.716
# 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.715
# Version 7.0NG.716
# 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.715
# Version 7.0NG.716
# 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.715, Solaris version
# Version 7.0NG.716, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.715, AIX version
# Version 7.0NG.716, 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.715-171122
Version: 7.0NG.716-171204
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.715-171122"
pandora_version="7.0NG.716-171204"
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.715, GNU/Linux
# Version 7.0NG.716, 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.715, FreeBSD Version
# Version 7.0NG.716, 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.715, HP-UX Version
# Version 7.0NG.716, 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.715, GNU/Linux
# Version 7.0NG.716, 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.715, GNU/Linux
# Version 7.0NG.716, 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.715, NetBSD Version
# Version 7.0NG.716, 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.715, Solaris Version
# Version 7.0NG.716, 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.715';
use constant AGENT_BUILD => '171122';
use constant AGENT_VERSION => '7.0NG.716';
use constant AGENT_BUILD => '171204';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -1244,7 +1244,11 @@ sub check_collections () {
# Delete old collections if there are no broker agents
if ($BrokerEnabled == 0) {
opendir (DIR, "$ConfDir/collections") || return;
if(!opendir (DIR, "$ConfDir/collections")){
log_message ('Collection', "Could not open dir $ConfDir/collections");
return;
}
while (defined (my $file_name = readdir(DIR))) {
next if ($file_name eq '.' || $file_name eq '..');
@ -1252,8 +1256,14 @@ sub check_collections () {
$file_name =~ s/\.md5$//;
if (! defined ($Collections{$file_name})) {
rmrf ("$ConfDir/collections/$file_name");
unlink ("$ConfDir/collections/$file_name.md5");
if(opendir (DIR_check, "$ConfDir/collections/$file_name")){
closedir (DIR_check);
rmrf ("$ConfDir/collections/$file_name");
unlink ("$ConfDir/collections/$file_name.md5");
}
else {
log_message ('Collection', "Could not open dir $ConfDir/collections/$file_name");
}
}
}
closedir (DIR);
@ -1272,7 +1282,11 @@ sub check_collections () {
# Get remote md5
error ("File '$Conf{'temporal'}/$collection_md5_file' already exists as a symlink and could not be removed: $!.") if (-l "$Conf{'temporal'}/$collection_md5_file" && !unlink("$Conf{'temporal'}/$collection_md5_file"));
next unless (recv_file ($collection_md5_file, $Conf{'server_path_md5'}) == 0);
if(recv_file ($collection_md5_file, $Conf{'server_path_md5'}) != 0){
log_message ('Collection', "Could not write $collection_md5_file on " . $Conf{'server_path_md5'});
next;
}
open (MD5_FILE, "< $Conf{'temporal'}/$collection_md5_file") || error ("Could not open file '$Conf{'temporal'}/$collection_md5_file' for reading: $!.");
my $remote_collection_md5 = <MD5_FILE>;
close (MD5_FILE);
@ -1284,13 +1298,20 @@ sub check_collections () {
$local_collection_md5 = <MD5_FILE>;
close MD5_FILE;
}
else{
log_message ('Collection', "Could not open dir $ConfDir/collections/$collection_md5_file");
next;
}
# Check for changes
$local_collection_md5 = $remote_collection_md5 unless defined ($local_collection_md5);
next if ($local_collection_md5 eq $remote_collection_md5);
# Download and unzip
next unless (recv_file ($collection_file, $Conf{'server_path_zip'}) == 0);
if(recv_file ($collection_md5_file, $Conf{'server_path_md5'}) != 0){
log_message ('Collection', "Could not write $collection_file on " . $Conf{'server_path_zip'});
next;
}
rmrf ("$ConfDir/collections/$collection");
`unzip -d "$ConfDir/collections/$collection" "$Conf{'temporal'}/$collection_file" 2>$DevNull`;
unlink ("$Conf{'temporal'}/$collection_file");

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.715
%define release 171122
%define version 7.0NG.716
%define release 171204
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.715
%define release 171122
%define version 7.0NG.716
%define release 171204
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.715"
PI_BUILD="171122"
PI_VERSION="7.0NG.716"
PI_BUILD="171204"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2014 Artica Soluciones Tecnologicas
# Version 7.0NG.715
# (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.716
# 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
@ -21,6 +21,13 @@ server_ip $ServerIP$
server_path /var/spool/pandora/data_in
temporal "%ProgramFiles%\pandora_agent\temp"
# Group assigned for this agent (descriptive, p.e: Servers)
group $GroupName$
# If set to 1 allows the agent to be configured via the web console
# (only works on enterprise version). Set to 0 to disable it
remote_config 0
#include "C:\Archivos de programa\pandora_agent\pandora_agent_alt.conf"
#broker_agent name_agent
@ -43,15 +50,10 @@ agent_name_cmd __rand__
# address: Enforce to server a ip address to this agent
# You can also try to detect the first IP using "auto", for example
address auto
# or setting a fixed IP address, like for example:
#address 192.168.36.73
# Group assigned for this agent (descriptive, p.e: Servers)
group Servers
# This limits operation if temporal dir has not enough free disk.
#temporal_min_size 1024
@ -80,10 +82,6 @@ server_port 41121
# Debug mode renames XML in the temp folder and continues running
# debug 1
# If set to 1 allows the agent to be configured via the web console
# (only works on enterprise version). Set to 0 to disable it
remote_config 0
# XML encoding (ISO-8859-1 by default). Most windows servers experience problems when you set to UTF-8. Other special codepages may be specified here.
#encoding ISO-8859-1
@ -102,6 +100,10 @@ xml_buffer 1
# Agent mode: Learn (default), No-learn, Autodisable
# agent_mode autodisable
# EHorus configuration file default full path.
#It try to find the EKID and set it like a custom field.
ehorus_conf "C:\Program Files\ehorus_agent\ehorus_agent.conf"
# Secondary server configuration
# ==============================
@ -127,74 +129,166 @@ xml_buffer 1
#process_firefox_stop killall firefox
#service_messenger 1
###############################################
# Module Definition
# Check online documentation and module library at http://pandorafms.org
# =================
# Get Network information using Agent plugin
module_plugin cscript //B "%ProgramFiles%\Pandora_Agent\util\nettraffic.vbs"
# Get disk occupation (percent)
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent.vbs"
# External inventory plugin
module_begin
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\software_installed.vbs"
module_interval 288
# 288 x 5min = 24 hr, one execution per day, using module_interval <factor>
module_end
# CPU Load
# CPU Load using WMI
module_begin
module_name CPU Load
module_type generic_data
#module_wmiquery SELECT LoadPercentage FROM Win32_Processor
#module_wmicolumn LoadPercentage
module_cpuusage all
module_description CPU Load (%)
module_unit %
module_min_warning 80
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
module_wmicolumn LoadPercentage
module_max 100
module_min 0
module_description User CPU Usage (%)
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_unit %
module_group System
module_end
# Number processes
# Basic info about TCP Connection
module_begin
module_name Number processes
module_type generic_data
module_exec tasklist | gawk "NR > 3 {print$0}" | wc -l
module_description Number of processes running
module_min_warning 175
module_max_warning 249
module_min_critical 250
module_max_critical 300
module_name TCP_Connections
module_type generic_data
module_exec netstat -an | find /c /v "estab"
module_description Total number of TCP connections active
module_group Networking
module_end
# Example plugin to retrieve drive usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent_used.vbs"
# Example plugin to retrieve memory usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\mem_percent_used.vbs"
# Example plugin to retrieve network usage
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\network.vbs"
## Windows inventory module (This information will be displayed only in enterprise version)
## Please check the WMI is healthy before activate this functionality
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cpuinfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\moboinfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\diskdrives.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cdromdrives.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\videocardinfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\ifaces.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\monitors.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\printers.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\raminfo.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\software_installed.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\userslogged.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productkey.vbs"
#module_crontab * 12-15 * * 1
#module_end
#module_begin
#module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productID.vbs"
#module_crontab * 12-15 * * 1
#module_end
#########################################
# EXAMPLES #
#########################################
# Example: get Network information using Agent plugin
#module_plugin cscript //B "%ProgramFiles%\Pandora_Agent\util\nettraffic.vbs"
# External inventory plugin
#module_begin
#module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\software_installed.vbs"
#module_interval 288
## 288 x 5min = 24 hr, one execution per day, using module_interval <factor>
#module_end
# Free Memory
module_begin
module_name FreeMemory
module_type generic_data
module_freepercentmemory
module_unit %
module_description Free memory (%).
module_min_warning 21
module_max_warning 30
module_min_critical 0
module_max_critical 20
module_end
#module_begin
#module_name FreeMemory
#module_type generic_data
#module_freepercentmemory
#module_description Free memory (%).
#module_min_warning 21
#module_max_warning 30
#module_min_critical 0
#module_max_critical 20
#module_end
# Log events
#module_begin
#module_name System Events (TermService)
#module_type async_string
#module_logevent
#module_description Log Events coming from Terminal Service
#module_source System
#module_application TermService
#module_end
module_begin
module_name Security Events (Invalid Login)
module_type async_string
module_description Security log events for invalid login attempt
module_logevent
module_source Security
module_eventcode 529
module_end
#module_begin
#module_name Security Events (Invalid Login)
#module_type async_string
#module_description Security log events for invalid login attempt
#module_logevent
#module_source Security
#module_eventcode 529
#module_end
# Check if Dhcp service is enabled
#module_begin
#module_name DHCP Enabled
#module_type generic_proc
#module_service Dhcp
#module_description Check DCHP service enabled
#module_end
#Antivirus monitoring
#This modules checks the antivirus is running on your system, if there is and antivirus
@ -207,72 +301,51 @@ module_end
#module_description Last update for Antivirus Signature file
#module_end
## Windows inventory module (This information will be displayed only in enterprise version)
## Please check the WMI is healthy before activate this functionality
# Number processes
#module_begin
#module_name Number processes
#module_type generic_data
#module_exec tasklist | gawk "NR > 3 {print$0}" | wc -l
#module_description Number of processes running
#module_min_warning 175
#module_max_warning 249
#module_min_critical 250
#module_max_critical 300
#module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cpuinfo.vbs"
# module_crontab * 12-15 * * 1
# module_end
# Example plugin to retrieve drive usage
#module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df.vbs"
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\moboinfo.vbs"
# module_crontab * 12-15 * * 1
# module_end
# Free space on disk C: (%)
#module_begin
#module_name FreeDiskC
#module_type generic_data
#module_freepercentdisk C:
#module_description Free space on drive C: (%)
#module_min_warning 31
#module_max_warning 40
#module_min_critical 0
#module_max_critical 30
#module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\diskdrives.vbs"
# module_crontab * 12-15 * * 1
# module_end
# CPU usage percentage
#module_begin
#module_name CPUUse
#module_type generic_data
#module_cpuusage all
#module_description CPU# usage
#module_min_warning 70
#module_max_warning 90
#module_min_critical 91
#module_max_critical 100
#module_end
# Free space on disk D: (%)
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\cdromdrives.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\videocardinfo.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\ifaces.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\monitors.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\printers.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\raminfo.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\software_installed.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\userslogged.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productkey.vbs"
# module_crontab * 12-15 * * 1
# module_end
# module_begin
# module_plugin cscript.exe //B //t:20 "%PROGRAMFILES%\Pandora_Agent\util\productID.vbs"
# module_crontab * 12-15 * * 1
# module_name FreeDiskD
# module_type generic_data
# module_freepercentdisk D:
# module_description Free space on drive D: (%)
# module_end
## Plugin example for custom fields (version, architecture, IP, IPv6, MAC)
@ -281,10 +354,9 @@ module_end
# module_crontab * 12-15 * * 1
# module_end
# ----------------------------------------------------------------------------------------------------
# This samples below need to be reconfigured and uncommented. Please read documentation
# on how to setup pandora fms windows agent at http://wiki.pandorafms.com
# ----------------------------------------------------------------------------------------------------
# Example plugin to retrieve last 5 min events in log4x format
# module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\logevent_log4x.vbs" Aplicacion System 300
# Sample on how to get a value from registry
# This returns the last time user launch microsoft Windows update
#module_begin
@ -391,11 +463,11 @@ module_end
#module_description Postcondition test module
#module_end
#Example of when module_native_encoding is necessary
#Dont uncomment module_native_encoding tag to see the difference
# Example of native encoding.
#module_begin
#module_name Accent_example
#module_name Written Accent
#module_type generic_data_string
#module_exec echo Bordón
#module_native_encoding OEM
#module_end

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.715}
{Pandora FMS Windows Agent v7.0NG.716}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{171122}
{171204}
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.715(Build 171122)")
#define PANDORA_VERSION ("7.0NG.716(Build 171204)")
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.715(Build 171122))"
VALUE "ProductVersion", "(7.0NG.716(Build 171204))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.715-171122
Version: 7.0NG.716-171204
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.715-171122"
pandora_version="7.0NG.716-171204"
package_pear=0
package_pandora=1

View File

@ -259,80 +259,60 @@ function extension_db_check_tables_differences($connection_test,
$field_system = $fields_system[$name_field];
$diff = array_diff($field_test, $field_system);
if (!empty($diff)) {
foreach ($diff as $config_field => $value) {
switch ($config_field) {
case 'type':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set the type with %s.',
$name_field, $table, $value));
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $value . ";" .
'</pre>'
);
break;
case 'null':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be null: (%s).',
$name_field, $table, $value));
$info_message = "";
$error_message = "";
if($diff['type']){
$error_message .= "Unsuccessful the field ".$name_field." in the table ".$table." must be set the type with ".$diff['type']."<br>";
}
if($diff['null']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be null: (".$diff['null'].").<br>";
}
if($diff['default']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be set ".$diff['default']." as default value.<br>";
}
if($field_test['null'] == "YES" || !isset($field_test['null']) || $field_test['null'] == ""){
$null_defect = " NULL";
}
else{
$null_defect = " NOT NULL";
}
if(!isset($field_test['default']) || $field_test['default'] == ""){
$default_value = "";
}
else{
$default_value = " DEFAULT ".$field_test['default'];
}
if($diff['type'] || $diff['null'] || $diff['default']){
$info_message .= "ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . $null_defect . $default_value.";";
}
if($diff['key']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be set the key as defined in the SQL file.<br>";
$info_message .= "<br><br>Please check the SQL file for to know the kind of key needed.";
}
if($diff['extra']){
$error_message .= "Unsuccessful the field $name_field in the table $table must be set as defined in the SQL file.<br>";
$info_message .= "<br><br>Please check the SQL file for to know the kind of extra config needed.";
}
ui_print_error_message(
__($error_message));
if ($value == "YES") {
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . " NULL;" .
'</pre>'
);
}
else {
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . " NOT NULL;" .
'</pre>'
);
}
ui_print_info_message(
__($info_message));
break;
case 'key':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set the key as defined in the SQL file.',
$name_field, $table));
ui_print_info_message(
__('Please check the SQL file for to know the kind of key needed.'));
break;
case 'default':
if($field_test['null'] == "YES" || !isset($field_test['null']) || $field_test['null'] == ""){
$null_defect = " NULL";
}
else{
$null_defect = " NOT NULL";
}
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set %s as default value.',
$name_field, $table, $value));
ui_print_info_message(
__('You can execute this SQL query for to fix.') . "<br />" .
'<pre>' .
"ALTER TABLE " . $table . " MODIFY COLUMN " . $name_field . " " . $field_test['type'] . $null_defect . " DEFAULT " . $value . ";" .
'</pre>'
);
break;
case 'extra':
ui_print_error_message(
__('Unsuccessful the field %s in the table %s must be set as defined in the SQL file.',
$name_field, $table));
ui_print_info_message(
__('Please check the SQL file for to know the kind of extra config needed.'));
break;
}
}
}
}
}
}
if ($correct_fields) {
ui_print_success_message(
@ -366,4 +346,4 @@ function extension_db_status_execute_sql_file($url, $connection) {
extensions_add_godmode_function('extension_db_status');
extensions_add_godmode_menu_option(__('DB Schema check'), 'DM', 'gextensions', null, "v1r1", 'gdbman');
?>
?>

View File

@ -69,9 +69,9 @@ function pandoralogs_extension_main () {
ui_print_page_header (__("System logfile viewer"), "images/extensions.png", false, "", true, "" );
echo "<p>" . __('This tool is used just to view your Pandora FMS system logfiles directly from console') . "</p>";
echo "<p>" . __('Use this tool to view your Pandora FMS logfiles directly on the console') . "</p>";
echo "<p>" . __('You can control the size information to show in general setup (Log size limit in view extension), actually ') . $config['max_log_size'] * 1000 . "B" . "</p>";
echo "<p>" . __('You can choose the amount of information shown in general setup (Log size limit in system logs viewer extension), ' . $config['max_log_size'] * 1000 . 'B at the moment') . "</p>";
$logs_directory = (!empty($config["server_log_dir"])) ? io_safe_output($config["server_log_dir"]) : "/var/log/pandora";

View File

@ -0,0 +1,7 @@
START TRANSACTION;
ALTER TABLE tsnmp_filter ADD unified_filters_id int(10) NOT NULL DEFAULT 0;
ALTER TABLE treport_content_template ADD COLUMN hide_no_data tinyint(1) DEFAULT 0;
ALTER TABLE tgraph_source ADD COLUMN `order` int(10) NOT NULL default 0;
COMMIT;

View File

@ -728,6 +728,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`lapse_calc` tinyint(1) UNSIGNED NOT NULL default '0',
`lapse` int(11) UNSIGNED NOT NULL default '300',
`visual_format` tinyint(1) UNSIGNED NOT NULL default '0',
`hide_no_data` tinyint(1) default 0,
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
@ -1433,6 +1434,7 @@ ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default ''
-- ---------------------------------------------------------------------
ALTER TABLE tgraph_source ADD COLUMN id_server int(11) UNSIGNED NOT NULL default 0;
ALTER TABLE tgraph_source ADD COLUMN `order` int(10) NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `tserver_export_data`

View File

@ -388,6 +388,12 @@ config_check();
$do_refresh = false;
}
}
$new_dashboard = get_parameter('new_dashboard',0);
if ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard' && $new_dashboard) {
$do_refresh = false;
}
if ($do_refresh) {
?>

View File

@ -232,7 +232,7 @@ if ($create_agent) {
if ($id_agente !== false) {
// Create custom fields for this agent
foreach ($field_values as $key => $value) {
db_process_sql_insert ('tagent_custom_data',
$update_custom = db_process_sql_insert ('tagent_custom_data',
array('id_field' => $key, 'id_agent' => $id_agente,
'description' => $value));
}
@ -735,13 +735,17 @@ if ($update_agent) { // if modified some agent paramenter
if ($old_value === false) {
// Create custom field if not exist
db_process_sql_insert ('tagent_custom_data',
$update_custom = db_process_sql_insert ('tagent_custom_data',
array('id_field' => $key,'id_agent' => $id_agente, 'description' => $value));
}
else {
db_process_sql_update ('tagent_custom_data',
$update_custom = db_process_sql_update ('tagent_custom_data',
array('description' => $value),
array('id_field' => $key,'id_agent' => $id_agente));
if($update_custom == 1){
$update_custom_result = 1;
}
}
}
@ -799,14 +803,16 @@ if ($update_agent) { // if modified some agent paramenter
WHERE id_group = ".$group_old);
$result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente));
if ($result == false) {
if ($result == false && $update_custom_result == false) {
ui_print_error_message(
__('There was a problem updating the agent'));
}
else {
// Update the agent from the metaconsole cache
enterprise_include_once('include/functions_agents.php');
enterprise_hook ('agent_update_from_cache', array($id_agente, $values));
enterprise_hook ('agent_update_from_cache', array($id_agente, $values,$server_name));
if ($old_interval != $intervalo) {
enterprise_hook('config_agents_update_config_interval', array($id_agente, $intervalo));

View File

@ -24,6 +24,7 @@ $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none');
$recursion = (bool) get_parameter('recursion',false);
$disabled = get_parameter('disabled', 0);
$os = get_parameter('os', 0);
if ($ag_group == -1 )
$ag_group = (int) get_parameter ("ag_group", -1);
@ -66,6 +67,14 @@ $agent_to_delete = (int)get_parameter('borrar_agente');
$enable_agent = (int)get_parameter('enable_agent');
$disable_agent = (int)get_parameter('disable_agent');
if($disable_agent != 0){
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$disable_agent);
}
elseif ($enable_agent != 0) {
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$enable_agent);
}
$result = null;
if ($agent_to_delete) {
@ -105,7 +114,7 @@ if ($enable_agent) {
// Update the agent from the metaconsole cache
enterprise_include_once('include/functions_agents.php');
$values = array('disabled' => 0);
enterprise_hook ('agent_update_from_cache', array($enable_agent, $values));
enterprise_hook ('agent_update_from_cache', array($enable_agent, $values,$server_name));
db_pandora_audit("Agent management", 'Enable ' . $alias);
}
@ -125,7 +134,7 @@ if ($disable_agent) {
// Update the agent from the metaconsole cache
enterprise_include_once('include/functions_agents.php');
$values = array('disabled' => 1);
enterprise_hook ('agent_update_from_cache', array($disable_agent, $values));
enterprise_hook ('agent_update_from_cache', array($disable_agent, $values,$server_name));
db_pandora_audit("Agent management", 'Disable ' . $alias);
}
@ -163,6 +172,20 @@ html_print_select($fields,"disabled",$disabled,'this.form.submit()');
echo "</td>";
echo "<td>";
echo __('Operative System') . '&nbsp;';
$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.description from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os');
$fields = array();
foreach ($pre_fields as $key => $value) {
$fields[$value['id_os']] = $value['description'];
}
html_print_select($fields,"os",$os,'this.form.submit()','All',0);
echo "</td>";
echo "<td>";
echo __('Recursion') . '&nbsp;';
html_print_checkbox ("recursion", 1, $recursion, false, false, 'this.form.submit()');
@ -171,6 +194,8 @@ echo "</td><td>";
echo __('Search') . '&nbsp;';
html_print_input_text ("search", $search, '', 12);
echo ui_print_help_tip(__('Search filter by alias, name, description, IP address or custom fields content'), true);
echo "</td><td>";
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
echo "</form>";
@ -296,20 +321,26 @@ if ($search != "") {
}else{
$search_sql = " AND ( nombre " . $order_collation . "
LIKE LOWER('%$search%') OR alias " . $order_collation . "
LIKE LOWER('%$search%')) ";
LIKE LOWER('%$search%') OR comentarios " . $order_collation . " LIKE LOWER('%$search%')
OR EXISTS (SELECT * FROM tagent_custom_data
WHERE id_agent = id_agente AND description LIKE '%$search%'))";
}
}
if ($disabled == 1)
{
$search_sql = " AND disabled = ". $disabled . $search_sql;
$search_sql .= " AND disabled = ". $disabled . $search_sql;
}
else {
if ($disabled == 0) {
$search_sql = " AND disabled = 0" . $search_sql;
$search_sql .= " AND disabled = 0" . $search_sql;
}
}
if($os != 0){
$search_sql .= " AND id_os = " . $os;
}
// Show only selected groups
if ($ag_group > 0) {

View File

@ -291,7 +291,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table_simple->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true, $disabledBecauseInPolicy);
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[4][2] = '<svg id="svg_dinamic" width="350px" height="200px" style="padding:40px; padding-left: 100px; margin-bottom: 60px;"></svg>';
$table_simple->data[4][2] = '<svg id="svg_dinamic" width="800" height="300"> </svg>';
$table_simple->colspan[4][2] = 2;
$table_simple->rowspan[4][2] = 3;
}
@ -590,8 +590,7 @@ $table_advanced->colspan[10][1] = 6;
if (isset($id_agente) && $moduletype == MODULE_DATA) {
$has_remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]));
if ($has_remote_conf) {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
@ -600,8 +599,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
$table_advanced->colspan[12][1] = 6;
}
else {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, true);
$table_advanced->colspan[11][1] = 6;
@ -611,8 +609,7 @@ if (isset($id_agente) && $moduletype == MODULE_DATA) {
}
}
else {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][0] = __('Cron from') . ui_print_help_icon ('cron', true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
@ -1202,17 +1199,32 @@ function paint_graph_values(){
//inicialiced error
var error_w = 0;
var error_c = 0;
//messages legend
var legend_normal = '<?php echo __("Normal Status");?>';
var legend_warning = '<?php echo __("Warning Status");?>';
var legend_critical = '<?php echo __("Critical Status");?>';
//messages error
var message_error_warning = '<?php echo __("Please introduce a maximum warning higher than the minimun warning") ?>';
var message_error_critical = '<?php echo __("Please introduce a maximum critical higher than the minimun critical") ?>';
//if haven't error
if(max_w == 0 || max_w > min_w){
if(max_c == 0 || max_c > min_c){
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, error_w, error_c);
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w,
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
} else {
error_c = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c);
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
}
} else {
error_w = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c);
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
}
}

View File

@ -132,8 +132,8 @@ $form_filter .= "</tr>";
$form_filter .= "<tr>";
$form_filter .= "<td style='font-weight: bold;'>".__('Enabled / Disabled')."</td><td>";
$ed_list = array ();
$ed_list[0] = __('Enable');
$ed_list[1] = __('Disable');
$ed_list[0] = __('Enabled');
$ed_list[1] = __('Disabled');
$form_filter .= html_print_select ($ed_list, 'enabledisable', $enabledisable, '', __('All'), -1, true);
$form_filter .= "</td><td style='font-weight: bold;'>".__('Standby')."</td><td>";
$sb_list = array ();

View File

@ -30,15 +30,15 @@ $default = (int) get_parameter('default', 0);
if ($default != 0) {
$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
$fields_selected = explode (',', $event_fields);
//$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
$fields_selected = explode (',', $config['event_fields']);
}
else if ($update != '') {
$fields_selected = (array)get_parameter('fields_selected');
if ($fields_selected[0] == '') {
$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
$fields_selected = explode (',', $event_fields);
//$event_fields = io_safe_input('evento,id_agente,estado,timestamp');
$fields_selected = explode (',', $config['event_fields']);
}
else {
$event_fields = implode (',', $fields_selected);
@ -130,7 +130,7 @@ $event = array();
echo '<h3>'.__('Show event fields');
echo '&nbsp;<a href="index.php?sec=geventos&sec2=godmode/events/events&section=fields&default=1">';
html_print_image ('images/clean.png', false, array ('title' => __('Load default event fields'), 'onclick' => "if (! confirm ('" . __('Default event fields will be loaded. Do you want to continue?') ."')) return false"));
html_print_image ('images/clean.png', false, array ('title' => __('Load the fields from previous events'), 'onclick' => "if (! confirm ('" . __('Event fields will be loaded. Do you want to continue?') ."')) return false"));
echo '</a></h3>';
$table = new stdClass();

View File

@ -128,7 +128,7 @@ $table->data[4][1] .= html_print_input_text ('str_warning', $str_warning,
$table->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
$table->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true);
$table->data[4][2] = '<svg id="svg_dinamic" width="350" height="200" style="padding:40px; padding-left: 100px; margin-bottom: 60px;"> </svg>';
$table->data[4][2] = '<svg id="svg_dinamic" width="800" height="300"> </svg>';
$table->colspan[4][2] = 2;
$table->rowspan[4][2] = 3;
@ -349,20 +349,36 @@ $next_row++;
if(!inverse_w){ inverse_w = 0; }
var inverse_c = $('input:checkbox[name=critical_inverse]:checked').val();
if(!inverse_c){ inverse_c = 0; }
//inicialiced error
var error_w = 0;
var error_c = 0;
//messages legend
var legend_normal = '<?php echo __("Normal Status");?>';
var legend_warning = '<?php echo __("Warning Status");?>';
var legend_critical = '<?php echo __("Critical Status");?>';
//messages error
var message_error_warning = '<?php echo __("Please introduce a maximum warning higher than the minimun warning") ?>';
var message_error_critical = '<?php echo __("Please introduce a maximum critical higher than the minimun critical") ?>';
//if haven't error
if(max_w == 0 || max_w > min_w){
if(max_c == 0 || max_c > min_c){
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, error_w, error_c);
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w,
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
} else {
error_c = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c);
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
}
} else {
error_w = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c);
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
}
}

View File

@ -32,6 +32,7 @@ require_once($config['homedir'] . "/include/functions_modules.php");
require_once($config['homedir'] . "/include/functions_groups.php");
$editGraph = (bool) get_parameter('edit_graph', 0);
$action = get_parameter('action', '');
if (isset ($_GET["get_agent"])) {
$id_agent = $_POST["id_agent"];
@ -39,6 +40,122 @@ if (isset ($_GET["get_agent"])) {
$chunkdata = $_POST["chunk"];
}
switch ($action) {
case 'sort_items':
$resultOperationDB = null;
$position_to_sort = (int)get_parameter('position_to_sort', 1);
$ids_serialize = (string)get_parameter('ids_items_to_sort', '');
$move_to = (string)get_parameter('move_to', 'after');
$countItems = db_get_sql('
SELECT COUNT(id_gs)
FROM tgraph_source
WHERE id_graph = ' . $id_graph);
if (($countItems < $position_to_sort) || ($position_to_sort < 1)) {
$resultOperationDB = false;
}
else if (!empty($ids_serialize)) {
$ids = explode('|', $ids_serialize);
switch ($config["dbtype"]) {
case "mysql":
$items = db_get_all_rows_sql('
SELECT id_gs, `order`
FROM tgraph_source
WHERE id_graph = ' . $id_graph . '
ORDER BY `order`');
break;
}
if ($items === false) $items = array();
// Clean the repeated order values
$order_temp = 1;
foreach ($items as $item) {
switch ($config["dbtype"]) {
case "mysql":
db_process_sql_update('tgraph_source',
array('`order`' => $order_temp),
array('id_gs' => $item['id_rc']));
break;
}
$order_temp++;
}
switch ($config["dbtype"]) {
case "mysql":
$items = db_get_all_rows_sql('
SELECT id_gs, `order`
FROM tgraph_source
WHERE id_graph = ' . $id_graph . '
ORDER BY `order`');
break;
}
if ($items === false) $items = array();
$temp = array();
$temp = array();
foreach ($items as $item) {
//Remove the contents from the block to sort
if (array_search($item['id_gs'], $ids) === false) {
$temp[$item['order']] = $item['id_gs'];
}
}
$items = $temp;
$sorted_items = array();
foreach ($items as $pos => $id_unsort) {
if ($pos == $position_to_sort) {
if ($move_to == 'after') {
$sorted_items[] = $id_unsort;
}
foreach ($ids as $id) {
$sorted_items[] = $id;
}
if ($move_to != 'after') {
$sorted_items[] = $id_unsort;
}
}
else {
$sorted_items[] = $id_unsort;
}
}
$items = $sorted_items;
foreach ($items as $order => $id) {
switch ($config["dbtype"]) {
case "mysql":
db_process_sql_update('tgraph_source',
array('`order`' => ($order + 1)),
array('id_gs' => $id));
break;
}
}
$resultOperationDB = true;
}
else {
$resultOperationDB = false;
}
break;
}
if ($editGraph) {
$graphRows = db_get_all_rows_sql("SELECT t1.*,
(SELECT t3.alias
@ -49,7 +166,8 @@ if ($editGraph) {
WHERE t2.id_agente_modulo = t1.id_agent_module))
AS agent_name
FROM tgraph_source t1
WHERE t1.id_graph = " . $id_graph);
WHERE t1.id_graph = " . $id_graph . " order by `order`");
$position_array = array();
$module_array = array();
$weight_array = array();
$agent_array = array();
@ -65,6 +183,7 @@ if ($editGraph) {
$weight_array[] = $graphRow['weight'];
$label_array[] = $graphRow['label'];
$agent_array[] = $graphRow['agent_name'];
$position_array[] = $graphRow['order'];
}
$graphInTgraph = db_get_row_sql("SELECT * FROM tgraph WHERE id_graph = " . $id_graph);
@ -81,11 +200,13 @@ if ($editGraph) {
if (count($module_array) > 0) {
echo "<table width='100%' cellpadding=4 cellpadding=4 class='databox filters'>";
echo "<tr>
<th>".__('P.')."</th>
<th>".__('Agent')."</th>
<th>".__('Module')."</th>
<th>".__('Label')."</th>
<th>".__('Weight')."</th>
<th>".__('Delete')."</th>";
<th>".__('Delete')."</th>
<th>".__('Sort')."</th>";
$color = 0;
for ($a = 0; $a < count($module_array); $a++) {
// Calculate table line color
@ -98,7 +219,8 @@ if (count($module_array) > 0) {
$color = 1;
}
echo "<tr><td class='$tdcolor'>" . $agent_array[$a] . "</td>";
echo "<tr><td class='$tdcolor'>$position_array[$a]</td>";
echo "<td class='$tdcolor'>" . $agent_array[$a] . "</td>";
echo "<td class='$tdcolor'>";
echo modules_get_agentmodule_name ($module_array[$a])."</td>";
@ -126,11 +248,55 @@ if (count($module_array) > 0) {
echo "<td class='$tdcolor' align=''>";
echo "<a href='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&tab=graph_editor&delete_module=1&id=". $id_graph ."&delete=" . $idgs_array[$a] . "'>".html_print_image('images/cross.png', true, array ('title' => __('Delete')))."</a>";
echo "</td></tr>";
echo "</td>";
echo "<td>";
echo html_print_checkbox_extended('sorted_items[]', $idgs_array[$a], false, false, '', 'class="selected_check"', true);
echo "</td>";
echo "</tr>";
}
echo "</table>";
}
$table = new stdClass();
$table->width = '100%';
$table->colspan[0][0] = 3;
$table->size = array();
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
if (defined("METACONSOLE")) {
$table->class = "databox data";
$table->head[0] = __("Sort items");
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
}
else {
$table->data[0][0] = "<b>". __("Sort items") . "</b>";
}
$table->data[1][0] = __('Sort selected items from position: ');
$table->data[1][1] = html_print_select_style(
array('before' => __('Move before to'), 'after' => __('Move after to')), 'move_to',
'', '', '', '', 0, true);
$table->data[1][2] = html_print_input_text_extended('position_to_sort', 1,
'text-position_to_sort', '', 3, 10, false, "only_numbers('position_to_sort');", '', true);
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
$table->data[1][4] = html_print_input_hidden('action', 'sort_items', true);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id=".$id_graph."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
html_print_table($table);
echo "</form>";
echo "<br>";
//Configuration form
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&add_module=1&edit_graph=1&id=" . $id_graph . "'>";
@ -217,4 +383,28 @@ function filterByGroup(idGroup) {
"json"
);
}
function added_ids_sorted_items_to_hidden_input() {
var ids = '';
var first = true;
$("input.selected_check:checked").each(function(i, val) {
if (!first)
ids = ids + '|';
first = false;
ids = ids + $(val).val();
});
$("input[name='ids_items_to_sort']").val(ids);
if (ids == '') {
alert("<?php echo __("Please select any item to order");?>");
return false;
}
else {
return true;
}
}
</script>

View File

@ -1976,7 +1976,7 @@ function set_static_graph_status(idElement, image, status) {
data: parameter,
success: function (data) {
set_static_graph_status(idElement, image, data);
if(values['show_statistics'] == 1){
if(data['show_statistics'] == 1){
if($('#'+idElement+' table').css('float') == 'right' || $('#'+idElement+ ' table').css('float') == 'left'){
$('#'+idElement+ ' img').css('margin-top', parseInt($('#'+idElement).css('height'))/2 - parseInt($('#'+idElement+ ' img').css('height'))/2);
}

View File

@ -180,6 +180,7 @@ ui_require_javascript_file ('encode_decode_base64');
tinyMCE.init({
mode : "exact",
elements: "text-label",
convert_urls: false,
theme : "advanced",
<?php
if ($config['style'] == 'pandora_legacy') {

View File

@ -106,6 +106,18 @@ if (is_ajax ()) {
$row['name'] = __('Login attribute');
$row['control'] = html_print_input_text ('ldap_login_attr', $config['ldap_login_attr'], '', 60, 100, true);
$table->data['ldap_login_attr'] = $row;
// Admin LDAP login
$row = array();
$row['name'] = __('Admin LDAP login');
$row['control'] = html_print_input_text ('ldap_admin_login', $config['ldap_admin_login'], '', 60, 100, true);
$table->data['ldap_admin_login'] = $row;
// Admin LDAP password
$row = array();
$row['name'] = __('Admin LDAP password');
$row['control'] = html_print_input_password ('ldap_admin_pass', $config['ldap_admin_pass'], $alt = '', 60, 100, true);
$table->data['ldap_admin_pass'] = $row;
break;
case 'pandora':

View File

@ -28,6 +28,7 @@ $update_filter = (int) get_parameter ('update_filter', -2);
$delete_filter = (int) get_parameter ('delete_filter', -1);
$description = (string) get_parameter ('description', '');
$filter = (string) get_parameter ('filter', '');
$index_post = (int) get_parameter('index_post', 0);
// Create/update header
if ($edit_filter > -2) {
@ -44,9 +45,35 @@ else {// Overview header
// Create/update filter
if ($update_filter > -2) {
// UPDATE
if ($update_filter > -1) {
$values = array('description' => $description, 'filter' => $filter);
$result = db_process_sql_update('tsnmp_filter', $values, array('id_snmp_filter' => $update_filter));
$new_unified_id = (db_get_value_sql("SELECT unified_filters_id FROM tsnmp_filter WHERE id_snmp_filter = " . $update_filter));
$elements = get_parameter('elements', array());
$elements = explode(",", $elements);
foreach ($elements as $e) {
$filter = get_parameter('filter_' . $e);
$values = array('description' => $description, 'filter' => $filter, 'unified_filters_id' => $new_unified_id);
$result = db_process_sql_update('tsnmp_filter', $values, array('id_snmp_filter' => $e));
}
if (count($elements) == 1) {
$new_unified_id = (db_get_value_sql("SELECT MAX(unified_filters_id) FROM tsnmp_filter")) + 1;
$filter = get_parameter('filter_' . $elements[0]);
$values = array('description' => $description, 'filter' => $filter, 'unified_filters_id' => $new_unified_id);
$result = db_process_sql_update('tsnmp_filter', $values, array('id_snmp_filter' => $elements[0]));
}
for ($i = 1; $i < $index_post; $i++) {
$filter = get_parameter('filter_' . $i);
if ($filter != "") {
$values = array(
'description' => $description,
'filter' => $filter,
'unified_filters_id' => $new_unified_id);
$result = db_process_sql_insert('tsnmp_filter', $values);
}
}
if ($result === false) {
ui_print_error_message (__('There was a problem updating the filter'));
}
@ -54,11 +81,29 @@ if ($update_filter > -2) {
ui_print_success_message (__('Successfully updated'));
}
}
// CREATE
else {
$values = array(
'description' => $description,
'filter' => $filter);
$result = db_process_sql_insert('tsnmp_filter', $values);
$new_unified_id = (db_get_value_sql("SELECT MAX(unified_filters_id) FROM tsnmp_filter")) + 1;
if ($index_post == 1) {
$filter = get_parameter('filter_0');
$values = array(
'description' => $description,
'filter' => $filter,
'unified_filters_id' => 0);
$result = db_process_sql_insert('tsnmp_filter', $values);
}
else {
for ($i = 0; $i < $index_post; $i++) {
$filter = get_parameter('filter_' . $i);
$values = array(
'description' => $description,
'filter' => $filter,
'unified_filters_id' => $new_unified_id);
$result = db_process_sql_insert('tsnmp_filter', $values);
}
}
if ($result === false) {
ui_print_error_message (__('There was a problem creating the filter'));
}
@ -68,7 +113,15 @@ if ($update_filter > -2) {
}
}
else if ($delete_filter > -1) { // Delete
$result = db_process_sql_delete('tsnmp_filter', array('id_snmp_filter' => $delete_filter));
$unified_id_to_delete = (db_get_value_sql("SELECT unified_filters_id FROM tsnmp_filter WHERE id_snmp_filter = " . $delete_filter));
if ($unified_id_to_delete == 0) {
$result = db_process_sql_delete('tsnmp_filter', array('id_snmp_filter' => $delete_filter));
}
else {
$result = db_process_sql_delete('tsnmp_filter', array('unified_filters_id' => $unified_id_to_delete));
}
if ($result === false) {
ui_print_error_message (__('There was a problem deleting the filter'));
}
@ -88,19 +141,50 @@ if ($edit_filter > -1) {
// Create/update form
if ($edit_filter > -2) {
$index = $index_post;
$table->data = array ();
$table->id = 'filter_table';
$table->width = '100%';
$table->class = 'databox filters';
$table->data[0][0] = __('Description');
$table->data[0][1] = html_print_input_text ('description', $description, '', 60, 100, true);
$table->data[1][0] = __('Filter');
$table->data[1][1] = html_print_input_text ('filter', $filter, '', 60, 100, true);
$table->data[1][1] .= ui_print_help_tip (__("This field contains a substring, could be part of a IP address, a numeric OID, or a plain substring") . SEPARATOR_COLUMN, true);
if ($edit_filter > -1) {
$filters = db_get_all_rows_sql("SELECT * FROM tsnmp_filter WHERE unified_filters_id = (SELECT unified_filters_id FROM tsnmp_filter WHERE id_snmp_filter = " . $edit_filter . ")");
$j = 1;
foreach ($filters as $f) {
if ($j != 1) {
$table->data[$j][0] = "";
}
$table->data[$j][1] = html_print_input_text ('filter_' . $f['id_snmp_filter'], $f['filter'], '', 60, 100, true);
if ($j == 1) {
$table->data[$j][1] .= ui_print_help_tip (__("This field contains a substring, could be part of a IP address, a numeric OID, or a plain substring") . SEPARATOR_COLUMN, true);
}
else {
$table->data[$j][1] .= html_print_image('images/cross.png', true, array('id' => 'delete_filter_' . $f['id_snmp_filter'], 'alt' => __('Click to remove the filter')));
}
$j++;
$index++;
}
}
else {
$table->data[1][1] = html_print_input_text ('filter_' . $index, $filter, '', 60, 100, true);
$table->data[1][1] .= ui_print_help_tip (__("This field contains a substring, could be part of a IP address, a numeric OID, or a plain substring") . SEPARATOR_COLUMN, true);
}
$index++;
echo '<form action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters" method="post">';
html_print_input_hidden ('update_filter', $edit_filter);
html_print_input_hidden ('index_post', $index);
if ($edit_filter > -1) {
$filters_to_post = array();
foreach ($filters as $fil) {
$filters_to_post[] = $fil['id_snmp_filter'];
}
html_print_input_hidden ('elements', implode(",", $filters_to_post));
}
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_image('images/add.png', false, array('id' => 'add_filter', 'alt' => __('Click to add new filter'), 'title' => __('Click to add new filter'), 'style' => 'float:left;'));
if ($edit_filter > -1) {
html_print_submit_button (__('Update'), 'submit_button', false, 'class="sub upd"');
}
@ -112,13 +196,13 @@ if ($edit_filter > -2) {
// Overview
}
else {
$result = db_get_all_rows_in_table ("tsnmp_filter");
if ($result === false) {
$result = array ();
require_once ($config['homedir'] . "/general/firts_task/snmp_filters.php");
return;
$result_unified = db_get_all_rows_sql("SELECT DISTINCT(unified_filters_id) FROM tsnmp_filter ORDER BY unified_filters_id ASC");
$aglomerate_result = array();
foreach ($result_unified as $res) {
$aglomerate_result[$res['unified_filters_id']] = db_get_all_rows_sql("SELECT * FROM tsnmp_filter WHERE unified_filters_id = " . $res['unified_filters_id'] . " ORDER BY id_snmp_filter ASC");
}
$table->data = array ();
$table->head = array ();
$table->size = array ();
@ -133,16 +217,43 @@ else {
$table->head[2] = __('Action');
$table->size[2] = "50px";
$table->align[2] = 'center';
foreach ($result as $row) {
$data = array ();
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$row['id_snmp_filter'].'">' . $row['description'] . '</a>';
$data[1] = $row['filter'];
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$row['id_snmp_filter'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' .
'&nbsp;&nbsp;<a onclick="if (confirm(\'' . __('Are you sure?') . '\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$row['id_snmp_filter'].'">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))) . '</a>';
array_push ($table->data, $data);
foreach ($aglomerate_result as $ind => $row) {
if ($ind == 0) {
foreach ($row as $r) {
$data = array ();
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' . $r['description'] . '</a>';
$data[1] = $r['filter'];
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' .
'&nbsp;&nbsp;<a onclick="if (confirm(\'' . __('Are you sure?') . '\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))) . '</a>';
array_push ($table->data, $data);
}
}
else {
$ind2 = 0;
$compose_filter = array();
$compose_id = "";
$compose_action = "";
foreach ($row as $i => $r) {
if ($ind2 == 0) {
$compose_id = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' . $r['description'] . '</a>';
$compose_action = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '</a>' .
'&nbsp;&nbsp;<a onclick="if (confirm(\'' . __('Are you sure?') . '\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">' .
html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete'))) . '</a>';
$ind2++;
}
$compose_filter[] = $r['filter'];
}
$data = array ();
$data[0] = $compose_id;
$data[1] = implode(" AND ", $compose_filter);
$data[2] = $compose_action;
array_push ($table->data, $data);
}
}
if (!empty ($table->data)) {
@ -157,3 +268,45 @@ else {
echo '</form></div>';
}
?>
<script type="text/javascript">
var id = "<?php echo $index; ?>";
var homeurl = "<?php echo $config['homeurl']; ?>";
$(document).ready (function () {
$('#add_filter').click(function(e) {
$('#filter_table').append('<tr id="filter_table-' + id + '" style="" class="datos"><td id="filter_table-' + id + '-0" style="" class="datos "></td><td id="filter_table-' + id + '-1" style="" class="datos "><input type="text" name="filter_' + id + '" value="" id="text-filter_' + id + '" size="60" maxlength="100"><img src="' + homeurl + 'images/cross.png" onclick="delete_this_row(' + id + ');" data-title="Click to delete the filter" data-use_title_for_force_title="1" class="forced_title" alt="Click to delete the filter"></td></tr>');
id++;
$('#hidden-index_post').val(id);
});
$('[id^=delete_filter_]').click(function(e) {
var elem_id = this.id;
var id_array = elem_id.split("delete_filter_");
var id = id_array[1];
params = {};
params['page'] = "include/ajax/snmp.ajax";
params['delete_snmp_filter'] = 1;
params['filter_id'] = id;
jQuery.ajax ({
data: params,
type: "POST",
url: "ajax.php",
dataType: "html",
success: function(data){
var elem = $('#hidden-elements').val();
$('#hidden-elements').val(elem - 1);
$('#' + elem_id).parent().parent().remove();
}
});
});
});
function delete_this_row (id_row) {
$('#filter_table-' + id_row).remove();
}
</script>

View File

@ -236,6 +236,8 @@ if ($create_user) {
case "postgresql":
$result = create_user($id, $password_new, $values);
if ($result) {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
$res = save_pass_history($id, $password_new);
}
break;
@ -334,6 +336,8 @@ if ($update_user) {
else {
$res2 = update_user_password ($id, $password_new);
if ($res2) {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
$res3 = save_pass_history($id, $password_new);
}
ui_print_result_message ($res1 || $res2,
@ -345,6 +349,8 @@ if ($update_user) {
$res2 = update_user_password ($id, $password_new);
if ($res2) {
$res3 = save_pass_history($id, $password_new);
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password&#x20;change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
}
ui_print_result_message ($res1 || $res2,
__('User info successfully updated'),

View File

@ -76,11 +76,11 @@ switch ($sortField) {
switch ($sort) {
case 'up':
$selectLastConnectUp = $selected;
$order = array('field' => 'fullname', 'order' => 'ASC');
$order = array('field' => 'last_connect', 'order' => 'ASC');
break;
case 'down':
$selectLastConnectDown = $selected;
$order = array('field' => 'fullname', 'order' => 'DESC');
$order = array('field' => 'last_connect', 'order' => 'DESC');
break;
}
break;
@ -494,10 +494,4 @@ echo '</div>';
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready (function () {
console.log('sknknan');
// text-filter_search
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

View File

@ -123,12 +123,17 @@ if ($get_module_detail) {
$time_from = (string) get_parameter ('time_from', date ('h:iA'));
$date_to = (string) get_parameter ('date_to', date ('Y-m-j'));
$time_to = (string) get_parameter ('time_to', date ('h:iA'));
$freesearch = (string) get_parameter ('freesearch', '');
$free_checkbox = (bool) get_parameter ('free_checkbox', false);
$formtable->width = '98%';
$formtable->class = "databox";
$formtable->data = array ();
$formtable->size = array ();
$moduletype_name = modules_get_moduletype_name(
modules_get_agentmodule_type($module_id));
$periods = array(SECONDS_5MINUTES =>__('5 minutes'),
SECONDS_30MINUTES =>__('30 minutes'),
SECONDS_1HOUR =>__('1 hour'),
@ -175,10 +180,19 @@ if ($get_module_detail) {
$formtable->data[1][2] .= html_print_input_text('time_to', $time_to,
'', 9, 7, true);
html_print_table($formtable);
$freesearch_object = '';
if (preg_match("/_string/", $moduletype_name)) {
$formtable->data[2][0] = __('Free search') . ' ';
$formtable->data[2][1] = html_print_input_text ('freesearch', $freesearch, '', 20, null, true);
$formtable->data[2][2] = html_print_checkbox('free_checkbox', 1, $free_checkbox, true);
$formtable->data[2][2] .= ' ' . __('Exact phrase');
$freesearch_object = json_encode( array(
'value' => io_safe_output($freesearch),
'exact' => (bool)$free_checkbox
));
}
$moduletype_name = modules_get_moduletype_name(
modules_get_agentmodule_type($module_id));
html_print_table($formtable);
$offset = (int) get_parameter("offset");
$block_size = (int) $config["block_size"];
@ -222,10 +236,10 @@ if ($get_module_detail) {
}
$count = modules_get_agentmodule_data ($module_id, $period,
$date, true, $conexion);
$date, true, $conexion, 'ASC', $freesearch_object);
$module_data = modules_get_agentmodule_data ($module_id, $period,
$date, false, $conexion, 'DESC');
$date, false, $conexion, 'DESC', $freesearch_object);
if (empty($module_data)) {
$result = array();

View File

@ -20,6 +20,7 @@ require_once("include/functions_snmp.php");
$save_snmp_translation = (bool)get_parameter('save_snmp_translation', 0);
$delete_snmp_translation = (bool)get_parameter('delete_snmp_translation', 0);
$update_snmp_translation = (bool)get_parameter('update_snmp_translation', 0);
$delete_snmp_filter = (bool)get_parameter('delete_snmp_filter', 0);
/* skins image checks */
if ($save_snmp_translation) {
@ -56,4 +57,12 @@ if ($update_snmp_translation) {
return;
}
if ($delete_snmp_filter) {
$filter_id = get_parameter('filter_id');
html_debug($filter_id, true);
db_process_sql_delete('tsnmp_filter', array('id_snmp_filter' => $filter_id));
return;
}
?>

View File

@ -33,8 +33,6 @@ if(is_ajax()){
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_browser_privacy_pass'));
$targets_oids = get_parameter ("oids", "");
$targets_oids = explode(",", $targets_oids);
$custom_action = get_parameter ("custom_action", "");
if ($custom_action != "") {

View File

@ -17,8 +17,25 @@
if (is_ajax ()) {
global $config;
// Login check
check_login ();
enterprise_include_once("include/functions_dashboard.php");
$public_hash = get_parameter('hash', 0);
// Try to authenticate by hash on public dashboards
if ($public_hash == 0) {
// Login check
check_login();
} else {
$validate_hash = enterprise_hook(
'dasboard_validate_public_hash',
array($public_hash, 'tree_view')
);
if ($validate_hash === false || $validate_hash === ENTERPRISE_NOT_HOOK) {
db_pandora_audit("Invalid public hash", "Trying to access report builder");
require ("general/noaccess.php");
exit;
}
}
require_once($config['homedir'] . "/include/class/Tree.class.php");
enterprise_include_once("include/class/Tree.class.php");
@ -36,6 +53,10 @@ if (is_ajax ()) {
$rootID = get_parameter('rootID', -1);
$serverID = get_parameter('serverID', false);
$childrenMethod = get_parameter('childrenMethod', 'on_demand');
$hash = get_parameter('hash', false);
if ($hash !== false) {
enterprise_hook('dasboard_validate_public_hash', array($hash, 'tree_view'));
}
$default_filters = array(
'searchAgent' => '',

View File

@ -12,10 +12,30 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Login check
global $config;
check_login ();
enterprise_include_once ('include/functions_dashboard.php');
require_once('include/functions_visual_map.php');
enterprise_include_once('include/functions_visual_map.php');
$public_hash = get_parameter('hash', false);
$id_visual_console = get_parameter('id_visual_console', null);
// Try to authenticate by hash on public dashboards
if ($public_hash === false) {
// Login check
check_login();
} else {
$validate_hash = enterprise_hook(
'dasboard_validate_public_hash',
array($public_hash, $id_visual_console, 'visual_console')
);
if ($validate_hash === false || $validate_hash === ENTERPRISE_NOT_HOOK) {
db_pandora_audit("Invalid public hash", "Trying to access report builder");
require ("general/noaccess.php");
exit;
}
}
// Fix: IW was the old ACL to check for report editing, now is RW
if (! check_acl ($config['id_user'], 0, "VR")) {
@ -29,12 +49,6 @@ if (! check_acl ($config['id_user'], 0, "VR")) {
//Fix ajax to avoid include the file, 'functions_graph.php'.
$ajax = true;
require_once('include/functions_visual_map.php');
enterprise_include_once('include/functions_visual_map.php');
$id_visual_console = get_parameter('id_visual_console', null);
$render_map = (bool)get_parameter('render_map', false);
$graph_javascript = (bool)get_parameter('graph_javascript', false);

View File

@ -750,6 +750,7 @@ switch ($action) {
// Don't change the label because only change the positions
unset($values['label']);
unset($values['label_position']);
// Don't change this values when move
unset($values['id_agent']);
unset($values['id_agente_modulo']);
unset($values['enable_link']);

View File

@ -689,6 +689,20 @@ function ldap_process_user_login ($login, $password) {
}
}
$correct_admin_bind = true;
if ($config['ldap_admin_login'] != "" && $config['ldap_admin_pass'] != "") {
if (!@ldap_bind($ds, io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'])) {
$correct_admin_bind = false;
}
}
if (!$correct_admin_bind) {
$config["auth_error"] = 'Admin ldap connection fail';
@ldap_close ($ds);
return false;
}
$dc = io_safe_output($config["ldap_base_dn"]);
#Search group of this user it belong.
@ -768,8 +782,22 @@ function get_ldap_login_attr ($login) {
$id_user = $login;
switch ($config['ldap_login_user_attr']) {
case 'email':
case 'mail':
$dc = io_safe_output($config["ldap_base_dn"]);
$correct_admin_bind = true;
if ($config['ldap_admin_login'] != "" && $config['ldap_admin_pass'] != "") {
if (!@ldap_bind($ds, io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'])) {
$correct_admin_bind = false;
}
}
if (!$correct_admin_bind) {
$config["auth_error"] = 'Admin ldap connection fail';
@ldap_close ($ds);
return false;
}
$filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($id_user) . ")";
$justthese = array("mail");
@ -859,6 +887,20 @@ function prepare_permissions_groups_of_user_ldap ($id_user, $password,
$dc = io_safe_output($config["ldap_base_dn"]);
$correct_admin_bind = true;
if ($config['ldap_admin_login'] != "" && $config['ldap_admin_pass'] != "") {
if (!@ldap_bind($ds, io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'])) {
$correct_admin_bind = false;
}
}
if (!$correct_admin_bind) {
$config["auth_error"] = 'Admin ldap connection fail';
@ldap_close ($ds);
return false;
}
#Search group of this user it belong.
$filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($id_user) . ")";
$justthese = array("objectclass=group");
@ -968,7 +1010,7 @@ function prepare_permissions_groups_of_user_ldap ($id_user, $password,
if (!is_user ($id_user)) {
if (($config['ldap_login_user_attr'] != 'name') && ($config['ldap_login_user_attr'] != null)) {
switch ($config['ldap_login_user_attr']) {
case 'email':
case 'mail':
$filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($id_user) . ")";
$justthese = array("mail");

View File

@ -23,6 +23,7 @@ class Tree {
protected $filter = array();
protected $childrenMethod = "on_demand";
protected $userGroupsACL;
protected $userGroups;
protected $strictACL = false;
@ -36,45 +37,54 @@ class Tree {
$this->id = $id;
$this->rootID = !empty($rootID) ? $rootID : $id;
$this->serverID = $serverID;
$this->childrenMethod = $childrenMethod;
$this->access = $access;
$userGroups = users_get_groups(false, $this->access);
$this->childrenMethod = $childrenMethod;
$this->access = $access;
if (empty($userGroups))
$this->userGroups = false;
else
$this->userGroups = $userGroups;
$userGroupsACL = users_get_groups(false, $this->access);
$this->userGroupsACL = empty($userGroupsACL) ? false : $userGroupsACL;
$this->userGroups = $this->userGroupsACL;
global $config;
include_once($config['homedir']."/include/functions_servers.php");
include_once($config['homedir']."/include/functions_modules.php");
require_once($config['homedir']."/include/functions_tags.php");
if (is_metaconsole())
enterprise_include_once("meta/include/functions_ui_meta.php");
if (is_metaconsole()) enterprise_include_once("meta/include/functions_ui_meta.php");
$this->strictACL = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']);
$this->acltags = tags_get_user_module_and_tags($config['id_user'], $this->access);
}
public function setType($type) {
$this->type = $type;
}
public function setFilter($filter) {
// Filter the user groups
if (!empty($filter['groupID'])) {
$group_id = $filter['groupID'];
$this->userGroups = isset($this->userGroupsACL[$group_id])
? array($group_id => $this->userGroupsACL[$group_id])
: array();
}
else if (!empty($filter['searchGroup'])) {
$groups = db_get_all_rows_filter('tgrupo', array('nombre' => '%' . $filter['searchGroup'] . '%'));
// Save the groups which intersect
$userGroupsACL = $this->userGroupsACL;
$this->userGroups = array_reduce($groups, function ($userGroups, $group) use ($userGroupsACL) {
$group_id = $group['id_grupo'];
if (isset($userGroupsACL[$group_id])) {
$userGroups[$group_id] = $userGroupsACL[$group_id];
}
return $userGroups;
}, array());
}
else {
$this->userGroups = $this->userGroupsACL;
}
$this->filter = $filter;
}
public function isStrict () {
return $this->strictACL;
}
public function setStrict ($value) {
$this->strictACL = (bool) $value;
}
protected function getAgentStatusFilter ($status = -1) {
if ($status == -1)
$status = $this->filter['statusAgent'];
@ -323,7 +333,7 @@ class Tree {
case 'group':
// ACL Group
$user_groups_str = "-1";
$group_acl = "";
$group_filter = "";
if (!$this->strictACL) {
if (empty($this->userGroups)) {
return;
@ -338,7 +348,7 @@ class Tree {
// Asking for all groups.
else {
$user_groups_str = implode(",", array_keys($this->userGroups));
$group_acl = "AND ta.id_grupo IN ($user_groups_str)";
$group_filter = "AND ta.id_grupo IN ($user_groups_str)";
}
}
else {
@ -356,7 +366,7 @@ class Tree {
}
}
}
$group_acl = "AND ta.id_grupo IN ($user_groups_str)";
$group_filter = "AND ta.id_grupo IN ($user_groups_str)";
}
switch ($type) {
@ -390,7 +400,7 @@ class Tree {
$module_status_join
WHERE ta.disabled = 0
AND ta.id_grupo = $item_for_count
$group_acl
$group_filter
$agent_search_filter
$agent_status_filter";
$sql = $this->getAgentCountersSql($agent_table);
@ -411,7 +421,7 @@ class Tree {
FROM tmetaconsole_agent ta
WHERE ta.disabled = 0
AND ta.id_grupo = $item_for_count
$group_acl
$group_filter
$agent_search_filter
$agent_status_filter";
$sql = $this->getAgentCountersSql($agent_table);
@ -439,7 +449,7 @@ class Tree {
$module_status_join
WHERE ta.disabled = 0
AND ta.id_grupo = $rootID
$group_acl
$group_filter
$agent_search_filter
$agent_status_filter
GROUP BY $group_by_fields
@ -456,7 +466,7 @@ class Tree {
FROM tmetaconsole_agent ta
WHERE ta.disabled = 0
AND ta.id_grupo = $rootID
$group_acl
$group_filter
$agent_search_filter
$agent_status_filter
ORDER BY $order_fields";
@ -498,7 +508,7 @@ class Tree {
ON ta.disabled = 0
AND tam.id_agente = ta.id_agente
AND ta.id_grupo = $rootID
$group_acl
$group_filter
$agent_search_filter
$agent_status_filter
WHERE tam.disabled = 0
@ -1123,7 +1133,8 @@ class Tree {
if (empty($data))
return array();
if ($this->type == 'agent') {
// [26/10/2017] It seems the module hierarchy should be only available into the tree by group
if ($this->rootType == 'group' && $this->type == 'agent') {
$data = $this->getProcessedModules($data);
}

View File

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

View File

@ -55,6 +55,17 @@ function agents_get_agent_id_by_module_id ($id_agente_modulo) {
'id_agente_modulo', $id_agente_modulo);
}
/**
* Get agent id from an agent alias.
*
* @param string $alias Agent alias.
*
* @return int Id from the agent.
*/
function agents_get_agent_id_by_alias ($alias) {
return db_get_all_rows_sql ("SELECT id_agente FROM tagente WHERE upper(alias) LIKE upper('%$alias%')");
}
/**
* Creates an agent
*
@ -314,6 +325,13 @@ function agents_get_agents ($filter = false, $fields = false,
$search = '';
}
if (isset($filter['search_custom'])) {
$search_custom = $filter['search_custom'];
unset($filter['search_custom']);
} else {
$search_custom = '';
}
if (isset($filter['offset'])) {
$offset = $filter['offset'];
unset($filter['offset']);
@ -450,8 +468,8 @@ function agents_get_agents ($filter = false, $fields = false,
$sql_extra, $where, $where_nogroup, $status_sql, $search, $disabled);
}
else {
$where = sprintf('%s AND %s AND (%s) %s AND %s',
$where, $where_nogroup, $status_sql, $search, $disabled);
$where = sprintf('%s AND %s AND (%s) %s AND %s %s',
$where, $where_nogroup, $status_sql, $search, $disabled, $search_custom);
}
$sql = sprintf('SELECT %s
FROM tagente

View File

@ -1039,14 +1039,16 @@ function alerts_delete_alert_agent_module ($id_alert_agent_module, $filter = fal
$filter = array ();
if ($id_alert_agent_module)
$filter['id'] = $id_alert_agent_module;
// Get the modules of the fired alerts that will be deleted to update counts
$filter_get = $filter;
$filter_get['group'] = 'id_agent_module';
$filter_get['times_fired'] = '>0';
$fired_alert_modules = db_get_all_rows_filter('talert_template_modules', $filter_get, array('id_agent_module', 'COUNT(*) alerts'));
// Get the id agent to update the fired alert counts
$agent_id = false;
if (isset ($filter['id_agent_module'])){
$agent_id = modules_get_agentmodule_agent ($filter["id_agent_module"]);
}
else if (isset ($filter['id'])){
$alert = alerts_get_alert_agent_module($id_alert_agent_module);
$agent_id = modules_get_agentmodule_agent ($alert["id_agent_module"]);
}
/*
The deletion of actions from talert_template_module_actions,
@ -1054,6 +1056,11 @@ function alerts_delete_alert_agent_module ($id_alert_agent_module, $filter = fal
a foreing key and delete on cascade.
*/
if (@db_process_sql_delete ('talert_template_modules', $filter) !== false) {
// Update fired alert count on the agent
// It will only occur if is specified the alert id or the id_agent_module
if ($agent_id !== false) {
db_process_sql(sprintf('UPDATE tagente SET update_alert_count=1 WHERE id_agente = %d', $agent_id));
}
return true;
}

View File

@ -8531,7 +8531,7 @@ function api_set_enable_module ($agent_name, $module_name, $thrast3, $thrash4) {
* @param string $template_name Name of the alert template (for example, "Warning event")
* @param $thrash4 Don't use.
// http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=garfio&id2=Status&other=Warning%20condition
// http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert&id=c2cea5860613e363e25f4ba185b54fe28f869ff8a5e8bb46343288337c903531&id2=Status&other=Warning%20condition
*/
function api_set_disable_alert ($agent_name, $module_name, $template_name, $thrash4) {
@ -8543,11 +8543,53 @@ function api_set_disable_alert ($agent_name, $module_name, $template_name, $thra
$id_agent_module = db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('id_agente' => $id_agent, 'nombre' => $module_name));
$id_template = db_get_value_filter('id', 'talert_templates', array('name' => $template_name["data"]));
db_process_sql("UPDATE talert_template_modules
$result = db_process_sql("UPDATE talert_template_modules
SET disabled = 1
WHERE id_agent_module = $id_agent_module AND id_alert_template = $id_template");
returnData('string', array('type' => 'string', 'data' => "Correct alert disable"));
if ($result) {
returnData('string', array('type' => 'string', 'data' => "Correct alert disable"));
} else {
returnData('string', array('type' => 'string', 'data' => __('Error alert disable')));
}
}
/**
* Disable an alert with alias
*
* @param string $agent_alias Alias of agent (for example "myagent")
* @param string $module_name Name of the module (for example "Host alive")
* @param string $template_name Name of the alert template (for example, "Warning event")
* @param $thrash4 Don't use.
// http://localhost/pandora_console/include/api.php?op=set&op2=disable_alert_alias&id=garfio&id2=Status&other=Warning%20condition
*/
function api_set_disable_alert_alias ($agent_alias, $module_name, $template_name, $thrash4) {
if (defined ('METACONSOLE')) {
return;
}
$agent_id = agents_get_agent_id_by_alias($agent_alias);
$result = false;
foreach ($agent_id as $key => $id_agent) {
$id_agent_module = db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('id_agente' => $id_agent['id_agente'], 'nombre' => $module_name));
$id_template = db_get_value_filter('id', 'talert_templates', array('name' => $template_name["data"]));
$result = db_process_sql("UPDATE talert_template_modules
SET disabled = 1
WHERE id_agent_module = $id_agent_module AND id_alert_template = $id_template");
if ($result) {
returnData('string', array('type' => 'string', 'data' => "Correct alert disable"));
return;
}
}
if(!$result){
returnData('string', array('type' => 'string', 'data' => __('Error alert disable')));
}
}
/**

View File

@ -343,6 +343,10 @@ function config_update_config () {
$error_update[] = __('Base DN');
if (!config_update_value ('ldap_login_attr', get_parameter ('ldap_login_attr')))
$error_update[] = __('Login attribute');
if (!config_update_value ('ldap_admin_login', get_parameter ('ldap_admin_login')))
$error_update[] = __('Admin LDAP login');
if (!config_update_value ('ldap_admin_pass', get_parameter ('ldap_admin_pass')))
$error_update[] = __('Admin LDAP password');
if (!config_update_value ('fallback_local_auth', get_parameter ('fallback_local_auth')))
$error_update[] = __('Fallback to local authentication');
if (!config_update_value ('ldap_login_user_attr', get_parameter ('ldap_login_user_attr')))
@ -1358,6 +1362,14 @@ function config_process_config () {
if (!isset ($config['ldap_login_attr'])) {
config_update_value ( 'ldap_login_attr', 'uid');
}
if (!isset ($config['ldap_admin_login'])) {
config_update_value ( 'ldap_admin_login', '');
}
if (!isset ($config['ldap_admin_pass'])) {
config_update_value ( 'ldap_admin_pass', '');
}
if (!isset ($config['fallback_local_auth'])) {
config_update_value ( 'fallback_local_auth', '0');

View File

@ -30,24 +30,30 @@ function cron_update_module_interval ($module_id, $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);
return db_process_sql (
'UPDATE tagente_estado SET current_interval = ' .
cron_next_execution ($cron, $module_interval, $module_id) .
' WHERE id_agente_modulo = ' .
(int) $module_id)
;
}
}
// Get the number of seconds left to the next execution of the given cron entry.
function cron_next_execution ($cron) {
function cron_next_execution ($cron, $module_interval, $module_id) {
// Get day of the week and month from cron config
list ($minute, $hour, $mday, $month, $wday) = explode (" ", $cron);
// Get current time
$cur_time = time();
// Get last execution time
$last_execution = db_get_value('utimestamp', 'tagente_estado', 'id_agente_modulo', $module_id);
$cur_time = ($last_execution !== false) ? $last_execution : time();
// Any day of the way
if ($wday == '*') {
$nex_time = cron_next_execution_date ($cron, $cur_time);
$nex_time = cron_next_execution_date ($cron, $cur_time, $module_interval);
return $nex_time - $cur_time;
}
@ -55,7 +61,7 @@ function cron_next_execution ($cron) {
$count = 0;
$nex_time = $cur_time;
do {
$nex_time = cron_next_execution_date ($cron, $nex_time);
$nex_time = cron_next_execution_date ($cron, $nex_time, $module_interval);
$nex_time_wd = $nex_time;
list ($nex_mon, $nex_wday) = explode (" ", date ("m w", $nex_time_wd));
@ -80,90 +86,202 @@ function cron_next_execution ($cron) {
}
// Get the next execution date for the given cron entry in seconds since epoch.
function cron_next_execution_date ($cron, $cur_time = false) {
function cron_next_execution_date ($cron, $cur_time = false, $module_interval = 300) {
// Get cron configuration
list ($min, $hour, $mday, $mon, $wday) = explode (" ", $cron);
$cron_array = explode (" ", $cron);
// Months start from 0
if ($mon != '*') {
$mon -= 1;
if ($cron_array[3] != '*') {
$mon_s = cron_get_interval ($cron_array[3]);
if ($mon_s['up'] !== false) {
$cron_array[3] = $mon_s['down'] - 1 . "-" . $mon_s['up'] - 1;
} else {
$cron_array[3] = $mon_s['down'] - 1;
}
}
// Get current time
if ($cur_time === false) {
$cur_time = time();
}
list ($cur_min, $cur_hour, $cur_mday, $cur_mon, $cur_year) = explode (" ", date ("i H d m Y", $cur_time));
if ($cur_time === false) $cur_time = time();
$nex_time = $cur_time + $module_interval;
$nex_time_array = explode (" ", date ("i H d m Y", $nex_time));
if (cron_is_in_cron($cron_array, $nex_time_array)) return $nex_time;
// Get first next date candidate from cron configuration
$nex_min = $min;
$nex_hour = $hour;
$nex_mday = $mday;
$nex_mon = $mon;
$nex_year = $cur_year;
// Get first next date candidate from next cron configuration
// Initialize some vars
$prev_ovfl = false;
// Update minutes
$min_s = cron_get_interval ($cron_array[0]);
$nex_time_array[0] = ($min_s['down'] == '*') ? 0 : $min_s['down'];
// Replace wildcards
if ($min == '*') {
if ($hour != '*' || $mday != '*' || $wday != '*' || $mon != '*') {
$nex_min = 0;
}
else {
$nex_min = $cur_min;
$nex_time = cron_valid_date($nex_time_array);
if ($nex_time >= $cur_time) {
if (cron_is_in_cron($cron_array, $nex_time_array) && $nex_time) {
return $nex_time;
}
}
if ($hour == '*') {
if ($mday != '*' || $wday != '*' ||$mon != '*') {
$nex_hour = 0;
}
else {
$nex_hour = $cur_hour;
}
}
if ($mday == '*') {
if ($mon != '*') {
$nex_mday = 1;
}
else {
$nex_mday = $cur_mday;
}
}
if ($mon == '*') {
$nex_mon = $cur_mon;
}
// Find the next execution date
$count = 0;
do {
$next_time = mktime($nex_hour, $nex_min, 0, $nex_mon, $nex_mday, $nex_year);
if ($next_time > $cur_time) {
return $next_time;
}
if ($min == '*' && $hour == '*' && $wday == '*' && $mday == '*' && $mon == '*') {
list ($nex_min, $nex_hour, $nex_mday, $nex_mon, $nex_year) = explode (" ", date ("i H d m Y", $next_time + SECONDS_1MINUTE));
}
else if ($hour == '*' && $wday == '*' && $mday == '*' && $mon == '*') {
list ($nex_min, $nex_hour, $nex_mday, $nex_mon, $nex_year) = explode (" ", date ("i H d m Y", $next_time + SECONDS_1HOUR));
}
else if ($mday == '*' && $mon == '*') {
list ($nex_min, $nex_hour, $nex_mday, $nex_mon, $nex_year) = explode (" ", date ("i H d m Y", $next_time + SECONDS_1DAY));
}
else if ($mon == '*') {
$nex_mon = $nex_mon + 1;
if ($nex_mon > 11) {
$nex_mon = 0;
$nex_year++;
// Check if next hour is in cron
$nex_time_array[1]++;
$nex_time = cron_valid_date($nex_time_array);
if ($nex_time === false) {
// Update the month day if overflow
$prev_ovfl = true;
$nex_time_array[1] = 0;
$nex_time_array[2]++;
$nex_time = cron_valid_date($nex_time_array);
if ($nex_time === false) {
// Update the month if overflow
$nex_time_array[2] = 1;
$nex_time_array[3]++;
$nex_time = cron_valid_date($nex_time_array);
if ($nex_time === false) {
#Update the year if overflow
$nex_time_array[3] = 0;
$nex_time_array[4]++;
$nex_time = cron_valid_date($nex_time_array);
}
}
else {
$nex_year++;
}
$count++;
}
while ($count < SECONDS_1DAY);
// Check the hour
if (cron_is_in_cron($cron_array, $nex_time_array) && $nex_time) {
return $nex_time;
}
// Update the hour if fails
$hour_s = cron_get_interval ($cron_array[1]);
$nex_time_array[1] = ($hour_s['down'] == '*') ? 0 : $hour_s['down'];
// When an overflow is passed check the hour update again
if ($prev_ovfl) {
$nex_time = cron_valid_date($nex_time_array);
if (cron_is_in_cron($cron_array, $nex_time_array) && $nex_time) {
return $nex_time;
}
}
$prev_ovfl = false;
// Check if next day is in cron
$nex_time_array[2]++;
$nex_time = cron_valid_date($nex_time_array);
if ($nex_time === false) {
// Update the month if overflow
$prev_ovfl = true;
$nex_time_array[2] = 1;
$nex_time_array[3]++;
$nex_time = cron_valid_date($nex_time_array);
if ($nex_time === false) {
// Update the year if overflow
$nex_time_array[3] = 0;
$nex_time_array[4]++;
$nex_time = cron_valid_date($nex_time_array);
}
}
// Check the day
if (cron_is_in_cron($cron_array, $nex_time_array) && $nex_time) {
return $nex_time;
}
// Update the day if fails
$mday_s = cron_get_interval ($cron_array[2]);
$nex_time_array[2] = ($mday_s['down'] == '*') ? 1 : $mday_s['down'];
// When an overflow is passed check the hour update in the next execution
if ($prev_ovfl) {
$nex_time = cron_valid_date($nex_time_array);
if (cron_is_in_cron($cron_array, $nex_time_array) && $nex_time) {
return $nex_time;
}
}
$prev_ovfl = false;
// Check if next month is in cron
$nex_time_array[3]++;
$nex_time = cron_valid_date($nex_time_array);
if ($nex_time === false) {
#Update the year if overflow
$prev_ovfl = true;
$nex_time_array[3]++;
$nex_time = cron_valid_date($nex_time_array);
}
// Check the month
if (cron_is_in_cron($cron_array, $nex_time_array) && $nex_time) {
return $nex_time;
}
// Update the month if fails
$mon_s = cron_get_interval ($cron_array[3]);
$nex_time_array[3] = ($mon_s['down'] == '*') ? 0 : $mon_s['down'];
// When an overflow is passed check the hour update in the next execution
if ($prev_ovfl) {
$nex_time = cron_valid_date($nex_time_array);
if (cron_is_in_cron($cron_array, $nex_time_array) && $nex_time) {
return $nex_time;
}
}
// Update the year
$nex_time_array[4]++;
$nex_time = cron_valid_date($nex_time_array);
return ($nex_time !== false) ? $nex_time : $module_interval;
}
// Get an array with the cron interval
function cron_get_interval ($element) {
# Not a range
if (!preg_match('/(\d+)\-(\d+)/', $element, $capture)) {
return array(
'down' => $element,
'up' => false
);
}
return array(
'down' => $capture[1],
'up' => $capture[2]
);
}
// Returns if a date is in a cron. Recursive.
function cron_is_in_cron($elems_cron, $elems_curr_time) {
// Something went wrong, default to 5 minutes
return $cur_time + SECONDS_5MINUTES;
$elem_cron = array_shift($elems_cron);
$elem_curr_time = array_shift($elems_curr_time);
// If there is no elements means that is in cron
if ($elem_cron === null || $elem_curr_time === null) return true;
// Go to last element if current is a wild card
if ($elem_cron != '*') {
$elem_s = cron_get_interval($elem_cron);
// Check if there is no a range
if (($elem_s['up'] === false) && ($elem_s['down'] != $elem_curr_time)) {
return false;
}
// Check if there is on the range
if ($elem_s['up'] !== false) {
if ($elem_s['down'] < $elem_s['up']) {
if ($elem_curr_time < $elem_s['down'] || $elem_curr_time > $elem_s['up']){
return false;
}
} else {
if ($elem_curr_time > $elem_s['down'] || $elem_curr_time < $elem_s['up']){
return false;
}
}
}
}
return cron_is_in_cron($elems_cron, $elems_curr_time);
}
function cron_valid_date ($da) {
$st = sprintf("%04d:%02d:%02d %02d:%02d:00", $da[4], $da[3], $da[2], $da[1], $da[0]);
$time = strtotime($st);
return $time;
}
// Check if cron is properly constructed

View File

@ -81,7 +81,7 @@ function db_connect($host = null, $db = null, $user = null, $pass = null, $port
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
$login_screen = 'error_authconfig';
require($config['homedir'] . '/general/error_screen.php');
require($config['homedir'] . '../general/error_screen.php');
exit;
}
else if ($error == 0) {

View File

@ -1687,7 +1687,7 @@ function events_page_responses ($event, $childrens_ids = array()) {
$users[0]['id_user'] = $config['id_user'];
$users[0]['fullname'] = $user_name;
} else {
$users = groups_get_users($_user_groups, array('id_perfil' => $profiles_view_events), true, true);
$users = groups_get_users($_user_groups, array('id_perfil' => $profiles_view_events), true);
}
foreach($users as $u) {
@ -2080,7 +2080,7 @@ function events_page_details ($event, $server = "") {
}
else {
$module_group = db_get_value('name', 'tmodule_group', 'id_mg', $id_module_group);
$data[1] = '<a href="'.$serverstring . 'index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;status=-1&amp;modulegroup=' . $id_module_group . $hashstring.'">';
$data[1] = '<a href="'.$serverstring . 'index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;status=-1&amp;modulegroup=' . $id_module_group . $hashstring.'">';
$data[1] .= $module_group;
$data[1] .= '</a>';
}

View File

@ -151,7 +151,7 @@ if ($upload_file) {
check_login ();
if (! check_acl ($config['id_user'], 0, "PM")) {
if (! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", "Trying to access File manager");
require ("general/noaccess.php");
return;
@ -219,7 +219,7 @@ if ($create_text_file) {
check_login ();
if (! check_acl ($config['id_user'], 0, "PM")) {
if (! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", "Trying to access File manager");
require ("general/noaccess.php");
return;
@ -279,7 +279,7 @@ if ($upload_zip) {
check_login ();
if (! check_acl ($config['id_user'], 0, "PM")) {
if (! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", "Trying to access File manager");
require ("general/noaccess.php");
return;

View File

@ -1122,6 +1122,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
if(!$fullscale){
$time_format_2 = '';
$temp_range = $period;
$unit_list_aux = array();
if ($projection != false) {
if ($period < $prediction_period)
@ -1370,6 +1371,10 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$agent_id = agents_get_agent_id ($agent_name);
if(empty($unit_list)){
$unit_aux = modules_get_unit($agent_module_id);
array_push($unit_list_aux,$unit_aux);
}
//Get and process module name
$module_name = io_safe_output(
modules_get_agentmodule_name ($agent_module_id));
@ -1553,6 +1558,8 @@ function graphic_combined_module ($module_list, $weight_list, $period,
if (!empty($unit_list) && $units_number == $module_number && isset($unit_list[$i])) {
$unit = $unit_list[$i];
}else{
$unit = $unit_list_aux[$i];
}
if ($projection == false or ($projection != false and $i == 0)) {
@ -5802,17 +5809,47 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
$filter_module_group = (!empty($filter) && !empty($filter['module_group'])) ? $filter['module_group'] : false;
$groups = users_get_groups(false, "AR", false, true, (!empty($filter) && isset($filter['group']) ? $filter['group'] : null));
if ($filter['group'] != 0) {
$filter_subgroups = "";
if (!$filter['dont_show_subgroups']) {
$filter_subgroups = " || parent = " . $filter['group'];
}
$groups = db_get_all_rows_sql ("SELECT * FROM tgrupo where id_grupo = " . $filter['group'] . $filter_subgroups);
$groups_ax = array();
foreach ($groups as $g) {
$groups_ax[$g['id_grupo']] = $g;
}
$groups = $groups_ax;
}
else {
$groups = users_get_groups(false, "AR", false, true, (!empty($filter) && isset($filter['group']) ? $filter['group'] : null));
}
$data_groups = array();
if (!empty($groups)) {
$groups_aux = $groups;
$data_groups = groups_get_tree($groups);
$childrens = array();
$data_groups = groups_get_tree_good($groups, false, $childrens);
// When i want only one group
if (count($data_groups) > 1) {
foreach ($childrens as $id_c) {
unset($data_groups[$id_c]);
}
}
$data_groups_keys = array();
groups_get_tree_keys($data_groups, $data_groups_keys);
$groups_aux = null;
}
if (!empty($data_groups)) {
$filter = array('id_grupo' => array_keys($data_groups));
$filter = array('id_grupo' => array_keys($data_groups_keys));
$fields = array('id_agente', 'id_parent', 'id_grupo', 'alias');
$agents = agents_get_agents($filter, $fields);
@ -5850,6 +5887,7 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
$data_agents[$agent_id]['group'] = (int) $agents[$agent_id]['id_grupo'];
$data_agents[$agent_id]['type'] = 'agent';
$data_agents[$agent_id]['size'] = 30;
$data_agents[$agent_id]['show_name'] = true;
$data_agents[$agent_id]['children'] = array();
$tooltip_content = __('Agent') . ": <b>" . $data_agents[$agent_id]['name'] . "</b>";
@ -6022,6 +6060,7 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
$data_agents[$id]['name'] = io_safe_output($agent['alias']);
$data_agents[$id]['type'] = 'agent';
$data_agents[$id]['color'] = COL_NOTINIT;
$data_agents[$id]['show_name'] = true;
}
}
$agents = null;
@ -6029,7 +6068,6 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
}
function iterate_group_array ($groups, &$data_agents) {
$data = array();
foreach ($groups as $id => $group) {
@ -6066,8 +6104,8 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
$tooltip_content = html_print_image("images/groups_small/" . $group['icon'] . ".png", true) . "&nbsp;" . __('Group') . ": <b>" . $group_aux['name'] . "</b>";
$group_aux['tooltip_content'] = $tooltip_content;
if (!isset($group['children']))
$group_aux['children'] = array();
$group_aux['children'] = array();
if (!empty($group['children']))
$group_aux['children'] = iterate_group_array($group['children'], $data_agents);
@ -6075,7 +6113,7 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
if (!empty($agents))
$group_aux['children'] = array_merge($group_aux['children'], $agents);
$data[] = $group_aux;
}
@ -6090,14 +6128,15 @@ function graph_monitor_wheel ($width = 550, $height = 600, $filter = false) {
unset($agents[$id]);
}
}
if (!empty($valid_agents))
return $valid_agents;
else
return false;
}
$graph_data = array('name' => __('Main node'), 'children' => iterate_group_array($data_groups, $data_agents), 'color' => '#3F3F3F');
$graph_data = array('name' => __('Main node'), 'type' => 'center_node', 'children' => iterate_group_array($data_groups, $data_agents), 'color' => '#3F3F3F');
if (empty($graph_data['children']))
return fs_error_image();

View File

@ -538,7 +538,7 @@ function groups_get_groups_tree_recursive($groups, $trash = 0, $trash2 = 0) {
// If the user has ACLs on a gruop but not in his father,
// we consider it as a son of group "all"
if(!in_array($group['parent'], array_keys($groups))) {
if(!isset($groups[$group['parent']])) {
$group['parent'] = 0;
}
@ -633,61 +633,55 @@ function groups_get_id ($group_name, $returnAllGroup = false) {
* @param int $id_group The group id to look for
* @param mixed filter array
* @param bool True if users with all permissions in the group are retrieved
* @param bool Is id_group an array or not #Fix
*
* @return array An array with all the users or an empty array
*/
function groups_get_users ($id_group, $filter = false, $return_user_all = false, $_is_array = false) {
function groups_get_users ($id_group, $filter = false, $return_user_all = false) {
global $config;
if (! is_array ($filter))
$filter = array ();
$filter['id_grupo'] = $id_group;
$result_a = array();
// Juanma (05/05/2014) Fix: Check for number/array id_group variable
if ($_is_array && is_array($id_group) && !empty($id_group)) {
$result_a = db_get_all_rows_filter ("tusuario_perfil", $filter);
} else {
if (!is_array($id_group) && !empty($id_group)) {
$result_a = db_get_all_rows_filter ("tusuario_perfil", $filter);
if($return_user_all){
if (is_array($id_group)){
$filter['id_grupo'] = $id_group;
}
else{
$filter['id_grupo'][0] = $id_group;
}
array_push($filter['id_grupo'], 0);
}
$result_b = array();
if ($return_user_all) {
// The users of the group All (0) will be also returned
$filter['id_grupo'] = 0;
$result_b = db_get_all_rows_filter ("tusuario_perfil", $filter);
else{
$filter['id_grupo'] = $id_group;
}
if ($result_a == false && $result_b == false)
$result = false;
elseif ($result_a == false)
$result = $result_b;
elseif ($result_b == false)
$result = $result_a;
else
$result = array_merge($result_a, $result_b);
if ($result === false)
$query = "SELECT tu.*
FROM tusuario tu, tusuario_perfil tup
WHERE tup.id_usuario = tu.id_user" ;
if(is_array($filter)){
foreach ($filter as $key => $value) {
if($key != 'limit' && $key != 'order' &&
$key != 'offset' &&$key != 'group'){
$filter_array["tup.".$key] = $value;
}
else{
$filter_array[$key] = $value;
}
}
$clause_sql = mysql_db_format_array_where_clause_sql($filter_array,'AND',false);
if($clause_sql){
$query .= " AND " . $clause_sql;
}
}
$result = db_get_all_rows_sql($query);
if ($result === false){
return array ();
//This removes stale users from the list. This can happen if switched to another auth scheme
//(internal users still exist) or external auth has users removed/inactivated from the list (eg. LDAP)
$retval = array ();
foreach ($result as $key => $user) {
if (!is_user ($user)) {
unset ($result[$key]);
}
else {
array_push ($retval, get_user_info ($user));
}
}
return $retval;
return $result;
}
/**
@ -2241,6 +2235,9 @@ function groups_get_tree(&$groups, $parent = false) {
if (!empty($children)) {
$return[$id]['children'] = $children;
}
else {
$return[$id]['children'] = array();
}
}
else if ($parent && isset($group['parent']) && $group['parent'] == $parent) {
$return[$id] = $group;
@ -2250,6 +2247,9 @@ function groups_get_tree(&$groups, $parent = false) {
if (!empty($children)) {
$return[$id]['children'] = $children;
}
else {
$return[$id]['children'] = array();
}
}
else {
continue;
@ -2258,6 +2258,55 @@ function groups_get_tree(&$groups, $parent = false) {
return $return;
}
function groups_get_tree_good (&$groups, $parent = false, &$childs) {
$return = array();
foreach ($groups as $id => $group) {
if ($group['parent'] != 0) {
$childs[$id] = $id;
}
if ($parent === false && (!isset($group['parent']) || $group['parent'] == 0 || !in_array($group['parent'], $groups))) {
$return[$id] = $group;
//unset($groups[$id]);
$children = groups_get_tree_good($groups, $id);
if (!empty($children)) {
$return[$id]['children'] = $children;
}
else {
$return[$id]['children'] = array();
}
}
else if ($parent && isset($group['parent']) && $group['parent'] == $parent) {
$return[$id] = $group;
//unset($groups[$id]);
$children = groups_get_tree_good($groups, $id);
if (!empty($children)) {
$return[$id]['children'] = $children;
}
else {
$return[$id]['children'] = array();
}
}
else {
continue;
}
}
return $return;
}
function groups_get_tree_keys ($groups, &$group_keys) {
foreach ($groups as $id => $group) {
$group_keys[$id] = $id;
if (isset($group['children'])) {
groups_get_tree_keys($groups[$id]['children'], $group_keys);
}
}
}
function groups_get_all_hierarchy_group ($id_group, $hierarchy = array()) {
global $config;
@ -2289,6 +2338,8 @@ function groups_get_all_hierarchy_group ($id_group, $hierarchy = array()) {
return $hierarchy;
}
function group_get_data ($id_user = false, $user_strict = false, $acltags, $returnAllGroup = false, $mode = 'group', $agent_filter = array(), $module_filter = array()) {
global $config;
if ($id_user == false) {
@ -3036,4 +3087,5 @@ function groups_get_group_deep ($id_group) {
return $deep;
}
?>

View File

@ -235,12 +235,6 @@ function io_safe_output($value, $utf8 = true)
//Replace the html entitie of > for the char
$value = str_replace("&gt;", '>', $value);
//Revert html entities to chars
for ($i = 0; $i < 33; $i++) {
$value = str_ireplace("&#x" . dechex($i) . ";",
io_html_to_ascii(dechex($i)), $value);
}
if ($utf8) {
$value = html_entity_decode ($value, ENT_QUOTES, "UTF-8");
}

View File

@ -987,6 +987,28 @@ function modules_is_string($id_agentmodule) {
return modules_is_string_type($id_type);
}
/**
* Know if a module type is a boolean or not
*
* @param int $id_type Type id
*
* @return bool true if boolean. false if not
*/
function modules_is_boolean_type ($id_type) {
$type_name = modules_get_type_name($id_type);
return (bool)preg_match('/_proc$/', $type_name);
}
function modules_is_boolean($id_agentmodule) {
$id_type = db_get_value('id_tipo_modulo',
'tagente_modulo', 'id_agente_modulo',
(int) $id_agentmodule);
return modules_is_boolean_type($id_type);
}
/**
* Get the icon of a module type
*
@ -1716,11 +1738,19 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0)
* @param int Agent module id
* @param int Period of time to check (in seconds)
* @param int Top date to check the values. Default current time.
* @param
* @param
* @param string 'ASC' od 'DESC'
* @param string with a json with parameters to filter data
* string object:
* value: Text to search
* exact: Boolean. True if search exact phrase or false to content
*
* @return array The module value and the timestamp
*/
function modules_get_agentmodule_data ($id_agent_module, $period,
$date = 0, $trash=false, $conexion = false, $order = 'ASC') {
$date = 0, $trash=false, $conexion = false, $order = 'ASC',
$freesearch = '') {
global $config;
$module = db_get_row('tagente_modulo', 'id_agente_modulo',
@ -1742,12 +1772,28 @@ function modules_get_agentmodule_data ($id_agent_module, $period,
case 17:
//async_string
case 23:
$sql = sprintf ("SELECT datos AS data, utimestamp
FROM tagente_datos_string
WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date, $order);
// Free search is a json with value and exact modifier
$freesearch = json_decode($freesearch, true);
$freesearch_sql = '';
if (isset($freesearch['value']) && !empty($freesearch['value'])) {
$freesearch_sql = " AND datos ";
if ($freesearch['exact']){
$freesearch_sql .= "='" . $freesearch['value'] . "' ";
} else {
$freesearch_sql .= " LIKE '%" . $freesearch['value'] . "%' ";
}
}
$sql = sprintf (
"SELECT datos AS data, utimestamp FROM tagente_datos_string
WHERE id_agente_modulo = %d
%s
AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp %s",
$id_agent_module,
$freesearch_sql,
$datelimit, $date,
$order
);
break;
//log4x
case 24:

View File

@ -254,7 +254,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
$id_networkmap = 0, $show_snmp_modules = 0, $cut_names = true,
$relative = false, $text_filter = '', $ip_mask = null,
$dont_show_subgroups = false, $strict_user = false, $size_canvas = null,
$old_mode = false) {
$old_mode = false, $map_filter = array()) {
global $config;
$nooverlap = 1;
@ -361,7 +361,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0,
// Open Graph
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
$ranksep, $font_size, $size_canvas);
$ranksep, $font_size, $size_canvas, $map_filter);
// Parse agents
$nodes = array ();
@ -1396,7 +1396,7 @@ function networkmap_close_group () {
// Opens a graph definition
function networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
$ranksep, $font_size, $size_canvas) {
$ranksep, $font_size, $size_canvas, $map_filter = array()) {
global $config;
@ -1422,22 +1422,66 @@ function networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
if (!is_null($size_canvas)) {
$size = ($size_canvas['x'] / 100) . "," . ($size_canvas['y'] / 100);
}
// Graphviz custom values
if (isset($map_filter['node_sep'])) {
$node_sep = $map_filter['node_sep'];
}
else {
$node_sep = 0.25;
}
if (isset($map_filter['rank_sep'])) {
$rank_sep = $map_filter['rank_sep'];
}
else {
if ($layout == "radial") {
$rank_sep = 1.0;
}
else {
$rank_sep = 0.5;
}
}
if (isset($map_filter['mindist'])) {
$mindist = $map_filter['mindist'];
}
else {
$mindist = 1.0;
}
if (isset($map_filter['kval'])) {
$kval = $map_filter['kval'];
}
else {
$kval = 0.3;
}
// BEWARE: graphwiz DONT use single ('), you need double (")
$head = "graph networkmap { dpi=100; bgcolor=\"transparent\"; labeljust=l; margin=0; pad=\"0.75,0.75\";";
if ($nooverlap != '') {
$head .= "ranksep=\"4\";";
$head .= "overlap=\"false\";";
$head .= "outputorder=edgesfirst;";
}
if ($layout == 'flat' || $layout == 'spring1' || $layout == "spring2") {
if ($nooverlap != '') {
$head .= "overlap=\"scalexy\";";
}
if ($layout == 'flat') {
$head .= "ranksep=\"$rank_sep\";";
}
if ($layout == 'spring2') {
$head .= "K=\"$kval\";";
}
}
if ($layout == 'radial') {
$head .= "ranksep=\"$rank_sep\";";
}
if ($layout == 'circular') {
$head .= "mindist=\"$mindist\";";
}
$head .= "ratio=fill;";
$head .= "root=0;";
$head .= "nodesep=\"0.=2\";";
$head .= "nodesep=\"$node_sep\";";
$head .= "size=\"$size\";";
$head .= "\n";

View File

@ -231,7 +231,8 @@ function networkmap_process_networkmap($id = 0) {
$dont_show_subgroups,
false,
null,
$old_mode);
$old_mode,
$map_filter);
switch (PHP_OS) {
case "WIN32":
@ -476,6 +477,7 @@ function networkmap_db_node_to_js_node($node, &$count, &$count_item_holding_area
$item['py'] = (int)$node['y'];
$item['z'] = (int)$node['z'];
$item['state'] = $node['state'];
$item['deleted'] = $node['deleted'];
if ($item['state'] == 'holding_area') {
//40 = DEFAULT NODE RADIUS
//30 = for to align
@ -659,8 +661,10 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
$item['id_agent_start'] = (int)$id_source_agent;
$item['id_module_end'] = 0;
$item['id_agent_end'] = (int)$id_target_agent;
$item['link_color'] = "#999";
$item['target'] = -1;
$item['source'] = -1;
$item['deleted'] = $relation['deleted'];
if (enterprise_installed()) {
$target_and_source = array();
@ -713,14 +717,42 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
$agent2 = 0;
if (($relation['parent_type'] == 1) && ($relation['child_type'] == 1)) {
$mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_parent_source_data']));
$mod2_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_child_source_data']));
if (($mod1_status == AGENT_MODULE_STATUS_CRITICAL_BAD) || ($mod2_status == AGENT_MODULE_STATUS_CRITICAL_BAD)) {
$item['link_color'] = "#FC4444";
}
else if (($mod1_status == AGENT_MODULE_STATUS_WARNING) || ($mod2_status == AGENT_MODULE_STATUS_WARNING)) {
$item['link_color'] = "#FAD403";
}
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
$agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']);
}
else if ($relation['child_type'] == 1) {
$mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_child_source_data']));
if ($mod1_status == AGENT_MODULE_STATUS_CRITICAL_BAD) {
$item['link_color'] = "#FC4444";
}
else if ($mod1_status == AGENT_MODULE_STATUS_WARNING) {
$item['link_color'] = "#FAD403";
}
$agent = $relation['id_parent_source_data'];
$agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']);
}
else if ($relation['parent_type'] == 1) {
$mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_parent_source_data']));
if ($mod1_status == AGENT_MODULE_STATUS_CRITICAL_BAD) {
$item['link_color'] = "#FC4444";
}
else if ($mod1_status == AGENT_MODULE_STATUS_WARNING) {
$item['link_color'] = "#FAD403";
}
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
$agent2 = $relation['id_child_source_data'];
}
@ -858,7 +890,9 @@ function networkmap_write_js_array($id, $nodes_and_relations = array(), $map_das
$item = networkmap_db_node_to_js_node(
$node, $count, $count_item_holding_area);
if ($item['deleted']) {
continue;
}
echo "networkmap.nodes.push(" . json_encode($item) . ");\n";
$nodes_graph[$item['id']] = $item;
}
@ -874,6 +908,9 @@ function networkmap_write_js_array($id, $nodes_and_relations = array(), $map_das
$links_js = networkmap_links_to_js_links($relations, $nodes_graph);
foreach ($links_js as $link_js) {
if ($link_js['deleted']) {
continue;
}
if ($link_js['target'] == -1)
continue;
if ($link_js['source'] == -1)
@ -931,6 +968,12 @@ function networkmap_write_js_array($id, $nodes_and_relations = array(), $map_das
echo "var set_center_menu = '" . __('Set center') . "';\n";
echo "var refresh_menu = '" . __('Refresh') . "';\n";
echo "var refresh_holding_area_menu = '" . __('Refresh Holding area') . "';\n";
echo "var ok_button = '" . __('Proceed') . "';\n";
echo "var message_to_confirm = '" . __('Resetting the map will delete all customizations you have done, including manual relationships between elements, new items, etc.') . "';\n";
echo "var warning_message = '" . __('WARNING') . "';\n";
echo "var ok_button = '" . __('Proceed') . "';\n";
echo "var cancel_button = '" . __('Cancel') . "';\n";
echo "var restart_map_menu = '" . __('Restart map') . "';\n";
echo "var abort_relationship_interface = '" . __('Abort the interface relationship') . "';\n";
echo "var abort_relationship_menu = '" . __('Abort the action of set relationship') . "';\n";
@ -1476,7 +1519,6 @@ function show_networkmap($id = 0, $user_readonly = false, $nodes_and_relations =
}
.link {
stroke: #999;
stroke-opacity: .6;
}

36
pandora_console/include/functions_reporting.php Normal file → Executable file
View File

@ -127,7 +127,7 @@ function reporting_make_reporting_data($report = null, $id_report,
}
$metaconsole_on = is_metaconsole();
$index_content = 0;
foreach ($contents as $content) {
$server_name = $content['server_name'];
@ -519,29 +519,41 @@ function reporting_make_reporting_data($report = null, $id_report,
break;
case 'agent_detailed_event':
case 'event_report_agent':
$report['contents'][] = reporting_event_report_agent(
$report_control = reporting_event_report_agent(
$report,
$content,
$type,
$force_width_chart,
$force_height_chart);
if($report_control['total_events'] == 0 && $content['hide_no_data'] == 1){
continue;
}
$report['contents'][] = $report_control;
break;
case 'event_report_module':
$report['contents'][] = reporting_event_report_module(
$report_control = reporting_event_report_module(
$report,
$content,
$type,
$force_width_chart,
$force_height_chart,
$pdf);
if($report_control['total_events'] == 0 && $content['hide_no_data'] == 1){
continue;
}
$report['contents'][] = $report_control;
break;
case 'event_report_group':
$report['contents'][] = reporting_event_report_group(
$report_control = reporting_event_report_group(
$report,
$content,
$type,
$force_width_chart,
$force_height_chart);
if($report_control['total_events'] == 0 && $content['hide_no_data'] == 1){
continue;
}
$report['contents'][] = $report_control;
break;
case 'top_n':
$report['contents'][] = reporting_event_top_n(
@ -589,6 +601,7 @@ function reporting_make_reporting_data($report = null, $id_report,
$pdf);
break;
}
$index_content++;
}
return reporting_check_structure_report($report);
@ -3848,9 +3861,6 @@ function reporting_value($report, $content, $type,$pdf) {
$return['agent_name'] = $agent_name;
$return['module_name'] = $module_name;
html_debug($pdf,true);
html_debug($only_image,true);
if($pdf){
$only_image = 1;
}
@ -7763,19 +7773,19 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
if ($links === false) {
$urls = array();
$urls['monitor_critical'] = "index.php?" .
"sec=estado&amp;sec2=operation/agentes/status_monitor&amp;" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_CRITICAL_BAD . "&pure=" . $config['pure'];
$urls['monitor_warning'] = "index.php?" .
"sec=estado&amp;sec2=operation/agentes/status_monitor&amp;" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_WARNING . "&pure=" . $config['pure'];
$urls['monitor_ok'] = "index.php?" .
"sec=estado&amp;sec2=operation/agentes/status_monitor&amp;" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_NORMAL . "&pure=" . $config['pure'];
$urls['monitor_unknown'] = "index.php?" .
"sec=estado&amp;sec2=operation/agentes/status_monitor&amp;" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_UNKNOWN . "&pure=" . $config['pure'];
$urls['monitor_not_init'] = "index.php?" .
"sec=estado&amp;sec2=operation/agentes/status_monitor&amp;" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_NOT_INIT . "&pure=" . $config['pure'];
}
else {
@ -7875,7 +7885,7 @@ function reporting_get_stats_agents_monitors($data) {
else {
$urls = array();
$urls['total_agents'] = "index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60";
$urls['monitor_checks'] = "index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;refr=60&amp;status=-1";
$urls['monitor_checks'] = "index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;refr=60&amp;status=-1";
}
// Agents and modules table

View File

@ -725,35 +725,38 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
});
// Prepare the AJAX call
var params = [
"target_ip=" + target_ip,
"community=" + community,
"oids=" + oids,
"snmp_browser_version=" + snmp_version,
"snmp3_browser_auth_user=" + snmp3_auth_user,
"snmp3_browser_security_level=" + snmp3_security_level,
"snmp3_browser_auth_method=" + snmp3_auth_method,
"snmp3_browser_auth_pass=" + snmp3_auth_pass,
"snmp3_browser_privacy_method=" + snmp3_privacy_method,
"snmp3_browser_privacy_pass=" + snmp3_privacy_pass,
"action=" + "create_modules_snmp",
"custom_action=" + custom_action,
"page=include/ajax/snmp_browser.ajax"
];
var params = {};
params["target_ip"] = target_ip;
params["community"] = community;
params["oids"] = oids;
params["snmp_browser_version"] = snmp_version;
params["snmp3_browser_auth_user"] = snmp3_auth_user;
params["snmp3_browser_security_level"] = snmp3_security_level;
params["snmp3_browser_auth_method"] = snmp3_auth_method;
params["snmp3_browser_auth_pass"] = snmp3_auth_pass;
params["snmp3_browser_privacy_method"] = snmp3_privacy_method;
params["snmp3_browser_privacy_pass"] = snmp3_privacy_pass;
params["action"] = "create_modules_snmp";
params["custom_action"] = custom_action;
params["page"] = "include/ajax/snmp_browser.ajax";
$.ajax({
type: "GET",
url: "ajax.php",
data: params.join ("&"),
dataType: "json",
data: params,
dataType: "html",
success: function(data) {
var dato = data.replace(/[^]+(?=\[)/,"");
$('input[name*=create_network_component]').removeClass("sub spinn");
$('input[name*=create_network_component]').addClass("sub add");
if(data.length !== 0){
dato = JSON.parse(dato);
if(dato.length !== 0){
$('#error_text').text("");
data.forEach( function(valor, indice, array) {
console.log(valor);
dato.forEach( function(valor, indice, array) {
$('#error_text').append('<br/>'+ valor );
});
$("#dialog_error")

View File

@ -888,21 +888,24 @@ function users_get_user_users($id_user = false, $privilege = "AR",
global $config;
$user_groups = users_get_groups($id_user, $privilege, $returnAllGroup);
$user_users = array();
$array_user_group = array();
foreach ($user_groups as $id_user_group => $name_user_group) {
$group_users = groups_get_users($id_user_group, false, $returnAllGroup);
$array_user_group[] = $id_user_group;
}
$group_users = groups_get_users($array_user_group, false, $returnAllGroup);
foreach ($group_users as $gu) {
if (empty($fields)) {
$user_users[$gu['id_user']] = $gu['id_user'];
}
else {
$fields = (array)$fields;
foreach ($fields as $field) {
$user_users[$gu['id_user']][$field] = $gu[$field];
}
foreach ($group_users as $gu) {
if (empty($fields)) {
$user_users[$gu['id_user']] = $gu['id_user'];
}
else {
$fields = (array)$fields;
foreach ($fields as $field) {
$user_users[$gu['id_user']][$field] = $gu[$field];
}
}
}

View File

@ -450,7 +450,7 @@ function visual_map_print_item($mode = "read", $layoutData,
// Link to an module
if (empty($layoutData['id_metaconsole'])) {
$url = $config['homeurl'] .
'index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
'index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
}
else {
$url = ui_meta_get_url_console_child(
@ -621,7 +621,7 @@ function visual_map_print_item($mode = "read", $layoutData,
// Link to an module
if (empty($layoutData['id_metaconsole'])) {
$url = $config['homeurl'] .
'index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
'index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
}
else {
$url = ui_meta_get_url_console_child(
@ -670,11 +670,11 @@ function visual_map_print_item($mode = "read", $layoutData,
$url =
$server["server_url"] .
'/index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
'/index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
}
else {
$url =
$config['homeurl'].'/index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
$config['homeurl'].'/index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
}
}
else {
@ -738,7 +738,7 @@ function visual_map_print_item($mode = "read", $layoutData,
else {
if (empty($layoutData['id_metaconsole'])) {
$url = $config['homeurl'] .
'/index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
'/index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;id_module=' . $layoutData['id_agente_modulo'];
}
else {
$url = ui_meta_get_url_console_child(
@ -1600,8 +1600,12 @@ function visual_map_print_item($mode = "read", $layoutData,
if (!empty($unit_text))
$value .= " " . $unit_text;
$img_style_title .= " <br>" . __("Last value: ") .
$value;
// Hide value on boolean modules
if (!modules_is_boolean($layoutData['id_agente_modulo'])) {
$img_style_title .=
" <br>" . __("Last value: ")
. $value;
}
}
if(get_parameter('action') == 'edit'){

View File

@ -24,53 +24,66 @@ When it comes to creating the action these are the only 3 fields we can set. Wit
<p>
Apart from the defined module macros, the following macros are also available:
<ul>
<li>_field1_ : User defined field 1.</li>
<li>_field2_ : User defined field 2.</li>
<li>_field3_ : User defined field 3.</li>
<li>_agent_ : Name of the agent that fired the alert.</li>
<li>_agentdescription_ : Description of the agent who fired alert.</li>
<li>_agentgroup_ : Agent group name.</li>
<li>_agentstatus_ : Current status of the agent.</li>
<li>_agentos_: Agent's operative system.</li>
<li>_address_ : Address of the agent that fired the alert.</li>
<li>_all_address_ : All address of the agent that fired the alert.</li>
<li>_address_n_ : The address of the agent that corresponds to the position indicated in "n" e.g: address_1_ , address_2_</li>
<li>_timestamp_ : Time when the alert was fired (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_ : Timezone name that _timestamp_ represents in.</li>
<li>_data_ : Module data that caused the alert to fire.</li>
<li>_prevdata_ : Module data previus the alert to fire.</li>
<li>_alert_description_ : Alert description.</li>
<li>_alert_threshold_ : Alert threshold.</li>
<li>_alert_times_fired_ : Number of times the alert has been fired.</li>
<li>_module_ : Module name.</li>
<li>_modulegroup_ : Module group name.</li>
<li>_moduledescription_ : Description of the module who fired the alert.</li>
<li>_modulestatus_ : Status of the module.</li>
<li>_moduletags_ : Tags associated to the module.</li>
<li>_alert_name_ : Alert name.</li>
<li>_alert_priority_ : Numerical alert priority.</li>
<li>_alert_text_severity_ : Text alert severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_event_text_severity_ : (Only event alerts) Text event (who fire the alert) severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_event_id_ : (Only event alerts) Id of the event that fired the alert.</li>
<li>_id_agent_ : Id of agent, useful to build direct URL to redirect to a Pandora FMS console webpage.</li>
<li>_id_group_ : Id of agent group.</li>
<li>_id_module_ : Id of module.</li>
<li>_id_alert_ : Numerical ID of the alert (unique), used to correlate on third party software</li>
<li>_policy_ : Name of the policy the module belongs to (if applies).</li>
<li>_interval_ : Execution interval of the module. </li>
<li>_server_ip_ : Ip of server assigned to agent. </li>
<li>_server_name_ : Name of server assigned to agent. </li>
<li>_target_ip_ : IP address of the target of the module.</li>
<li>_target_port_ : Port number of the target of the module.</li>
<li>_plugin_parameters_ : Plug-in Parameters of the module.</li>
<li>_groupcontact_ : Group contact information. Configured when the group is created.</li>
<li>_groupother_ : Other information about the group. Configured when the group is created.</li>
<li>_email_tag_ : Emails associated to the module tags.</li>
<li>_alert_critical_instructions_: Instructions for CRITICAL status contained in the module.</li>
<li>_alert_warning_instructions_: Instructions for WARNING status contained in the module.</li>
<li>_alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.</li>
<li>_modulegraph_nh_: (Only for alerts that use the command eMail) Returns an image of a module graph with a period of n hours (eg. _modulegraph_24h_). A correct setup of the connection between the server and the console's api is required. This setup is done into the server's configuration file.</li>
<li>_homeurl_ : It is a link of the public URL this must be configured in the general options of the setup.</li>
<li>_address_: Address of the agent that triggered the alert.</li>
<li>_address_n_ : The address of the agent that corresponds to the position indicated in "n" e.g: address_1_ , address_2__</li>
<li>_agent_: Name of the agent that triggered the alert.</li>
<li>_agentcustomfield_n_: Agent custom field number n (eg. _agentcustomfield_9_).</li>
<li>_agentcustomid_: Agent custom ID.</li>
<li>_agentdescription_: Description of the agent that triggered the alert.</li>
<li>_agentgroup_ : Agent group name.</li>
<li>_agentos_: Agent's operative system.</li>
<li>_agentstatus_ : Current status of the agent.</li>
<li>_alert_critical_instructions_: Instructions for CRITICAL status contained in the module.</li>
<li>_alert_description_: Alert description.</li>
<li>_alert_name_: Alert name.</li>
<li>_alert_priority_: Alerts numeric priority.</li>
<li>_alert_text_severity_: Priority level, in text, for the alert (Maintenance, Informational, Normal Minor, Major, Critical).</li>
<li>_alert_threshold_: Alert threshold.</li>
<li>_alert_times_fired_: Number of times the alert has been triggered.</li>
<li>_alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.</li>
<li>_alert_warning_instructions_: Instructions for WARNING status contained in the module.</li>
<li>_all_address_ : All address of the agent that fired the alert.</li>
<li>_data_: Module data that caused the alert to fire.</li>
<li>_email_tag_: Emails associated to the modules tags.</li>
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
<li>_event_text_severity_: (Only event alerts) event text (that triggered the alert) severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_field1_: User defined field 1.</li>
<li>_field2_: User defined field 2.</li>
<li>_field3_: User defined field 3.</li>
<li>_field4_: User defined field 4.</li>
<li>_field5_: User defined field 5.</li>
<li>_field6_: User defined field 6.</li>
<li>_field7_: User defined field 7.</li>
<li>_field8_: User defined field 8.</li>
<li>_field9_: User defined field 9.</li>
<li>_field10_: User defined field 10.</li>
<li>_groupcontact_: Groups contact information. Configured when the group is created.</li>
<li>_groupcustomid_: Groups custom ID.</li>
<li>_groupother_: Other information about the group. Configured when the group is created.</li>
<li>_homeurl_ : It is a link of the public URL this must be configured in the general options of the setup.</li>
<li>_id_agent_: Agents ID, useful for building a direct URL that redirects to a Pandora FMS console webpage.</li>
<li>_id_alert_: Alerts numeric ID (unique), used to correlate the alert with third party software.</li>
<li>_id_group_ : Agent group ID.</li>
<li>_id_module_: The module's ID.</li>
<li>_interval_: Modules execution interval.</li>
<li>_module_: Module name.</li>
<li>_modulecustomid_: Module custom ID.</li>
<li>_moduledata_X_: Last data of module X (module name, cannot have white spaces).</li>
<li>_moduledescription_: Description of the module that triggered the alert.</li>
<li>_modulegraph_nh_: (>=6.0) (Only for alerts that use the command eMail) Returns an image encoded in base64 of a modules graph with a period of n hours (eg. _modulegraph_24h_). A correct setup of the connection between the server and the console's API is required. This setup is done on the server's configuration file.</li>
<li>_modulegraphth_nh_:Same operation as the previous macro only with the critical and warning thresholds of the module provided they are defined.</li>
<li>_modulegroup_: Modules group name.</li>
<li>_modulestatus_: Module status.</li>
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
<li>_name_tag_: Names of the tags related to the module.</li>
<li>_phone_tag_: Phone numbers related to the modules tags.</li>
<li>_plugin_parameters_: Modules Plugin parameters.</li>
<li>_policy_: Name of the policy that the module belongs to (if applies).</li>
<li>_prevdata_ : Module data previus the alert to fire.</li>
<li>_target_ip_: IP address for the modules target.</li>
<li>_target_port_: Port number for the modules target.</li>
<li>_timestamp_: Time and date on which the alert was triggered (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_: Timezone that is represented on _timestamp_.</li>
</ul>
<p>
</p>

View File

@ -9,6 +9,29 @@
Besides the defined module macros, the following macros are available:
</p>
<ul>
<li>_address_: Address of the agent that triggered the alert.</li>
<li>_address_n_ : The address of the agent that corresponds to the position indicated in "n" e.g: address_1_ , address_2__</li>
<li>_agent_: Name of the agent that triggered the alert.</li>
<li>_agentcustomfield_n_: Agent custom field number n (eg. _agentcustomfield_9_).</li>
<li>_agentcustomid_: Agent custom ID.</li>
<li>_agentdescription_: Description of the agent that triggered the alert.</li>
<li>_agentgroup_ : Agent group name.</li>
<li>_agentos_: Agent's operative system.</li>
<li>_agentstatus_ : Current status of the agent.</li>
<li>_alert_critical_instructions_: Instructions for CRITICAL status contained in the module.</li>
<li>_alert_description_: Alert description.</li>
<li>_alert_name_: Alert name.</li>
<li>_alert_priority_: Alerts numeric priority.</li>
<li>_alert_text_severity_: Priority level, in text, for the alert (Maintenance, Informational, Normal Minor, Major, Critical).</li>
<li>_alert_threshold_: Alert threshold.</li>
<li>_alert_times_fired_: Number of times the alert has been triggered.</li>
<li>_alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.</li>
<li>_alert_warning_instructions_: Instructions for WARNING status contained in the module.</li>
<li>_all_address_ : All address of the agent that fired the alert.</li>
<li>_data_: Module data that caused the alert to fire.</li>
<li>_email_tag_: Emails associated to the modules tags.</li>
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
<li>_event_text_severity_: (Only event alerts) event text (that triggered the alert) severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_field1_: User defined field 1.</li>
<li>_field2_: User defined field 2.</li>
<li>_field3_: User defined field 3.</li>
@ -19,57 +42,34 @@ Besides the defined module macros, the following macros are available:
<li>_field8_: User defined field 8.</li>
<li>_field9_: User defined field 9.</li>
<li>_field10_: User defined field 10.</li>
<li>_agent_: Name of the agent that triggered the alert.</li>
<li>_agentcustomfield_<i>n</i>_: Agent custom field number <i>n</i> (eg. _agentcustomfield_9_).</li>
<li>_agentcustomid_: Agent custom ID.</li>
<li>_agentdescription_: Description of the agent that triggered the alert.</li>
<li>_agentgroup_: Agents group name.</li>
<li>_agentstatus_: Current agent status.</li>
<li>_agentos_: Agent's operative system.</li>
<li>_address_: Address of the agent that triggered the alert.</li>
<li>_timestamp_: Time and date on which the alert was triggered (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_: Timezone that is represented on _timestamp_.</li>
<li>_data_: Module data that caused the alert to fire.</li>
<li>_prevdata_ : Module data previus the alert to fire.</li>
<li>_alert_description_: Alert description.</li>
<li>_alert_threshold_: Alert threshold.</li>
<li>_alert_times_fired_: Number of times the alert has been triggered.</li>
<li>_module_: Module name.</li>
<li>_modulecustomid_: Module custom ID.</li>
<li>_modulegroup_: Modules group name.</li>
<li>_moduledescription_: Description of the module that triggered the alert.</li>
<li>_modulestatus_: Module status.</li>
<li>_moduledata_X_: Last data of module X (module name, cannot have white spaces).</li>
<li>_alert_name_: Alert name.</li>
<li>_alert_priority_: Alerts numeric priority.</li>
<li>_alert_text_severity_: Priority level, in text, for the alert (Maintenance, Informational, Normal Minor, Major, Critical).</li>
<li>_event_text_severity_: (Only event alerts) Text event (which triggered the alert) severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
<li>_id_agent_: Agents ID, useful for building a direct URL that redirects to a Pandora FMS console webpage.</li>
<li>_id_group_ : Agent group ID.</li>
<li>_id_module_ : ID of module.</li>
<li>_id_alert_: Alerts numeric ID (unique), used to correlate the alert with third party software.</li>
<li>_policy_: Name of the policy that the module belongs to (if applies).</li>
<li>_interval_: Modules execution interval </li>
<li>_target_ip_: IP address for the modules target.</li>
<li>_target_port_: Port number for the modules target.</li>
<li>_plugin_parameters_: Modules Plugin parameters.</li>
<li>_server_ip_ : Ip of server assigned to agent. </li>
<li>_server_name_ : Name of server assigned to agent. </li>
<li>_groupcontact_: Groups contact information. Configured when the group is created.</li>
<li>_groupcustomid_: Groups custom ID.</li>
<li>_groupother_: Other information about the group. Configured when the group is created.</li>
<li>_homeurl_ : It is a link of the public URL this must be configured in the general options of the setup.</li>
<li>_id_agent_: Agents ID, useful for building a direct URL that redirects to a Pandora FMS console webpage.</li>
<li>_id_alert_: Alerts numeric ID (unique), used to correlate the alert with third party software.</li>
<li>_id_group_ : Agent group ID.</li>
<li>_id_module_: The module's ID.</li>
<li>_interval_: Modules execution interval.</li>
<li>_module_: Module name.</li>
<li>_modulecustomid_: Module custom ID.</li>
<li>_moduledata_X_: Last data of module X (module name, cannot have white spaces).</li>
<li>_moduledescription_: Description of the module that triggered the alert.</li>
<li>_modulegraph_nh_: (>=6.0) (Only for alerts that use the command eMail) Returns an image encoded in base64 of a modules graph with a period of n hours (eg. _modulegraph_24h_). A correct setup of the connection between the server and the console's API is required. This setup is done on the server's configuration file.</li>
<li>_modulegraphth_nh_:Same operation as the previous macro only with the critical and warning thresholds of the module provided they are defined.</li>
<li>_modulegroup_: Modules group name.</li>
<li>_modulestatus_: Module status.</li>
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
<li>_name_tag_: Names of the tags related to the module.</li>
<li>_email_tag_: Emails associated to the modules tags.</li>
<li>_phone_tag_: Phone numbers related to the modules tags.</li>
<li>_moduletags_: URLs associated to the modules tags.</li>
<li>_alert_critical_instructions_: Instructions for CRITICAL status contained in the module.</li>
<li>_alert_warning_instructions_: Instructions for WARNING status contained in the module.</li>
<li>_alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.</li>
<li>_modulegraph_<i>n</i>h_: (>=6.0) (Only for alerts that use the command <i>eMail</i>)
Returns an image encoded in base64 of a modules graph with a period of <i>n</i> hours (eg. _modulegraph_24h_).
A correct setup of the connection between the server and the console's API is required.
This setup is done on the server's configuration file.</li>
<li>_plugin_parameters_: Modules Plugin parameters.</li>
<li>_policy_: Name of the policy that the module belongs to (if applies).</li>
<li>_prevdata_ : Module data previus the alert to fire.</li>
<li>_target_ip_: IP address for the modules target.</li>
<li>_target_port_: Port number for the modules target.</li>
<li>_timestamp_: Time and date on which the alert was triggered (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_: Timezone that is represented on _timestamp_.</li>
</ul>
<p>

View File

@ -0,0 +1,45 @@
<?php
/**
* @package Include/help/en
*/
?>
<h1>Cron for server modules</h1>
Using the configuration parameter sets <b>Cron from</b> and <b>Cron to</b> makes
it possible for a module to run only for certain periods of time.
The way in which it is configured is similar to the syntax of
<a style="font-size:14px;" href="https://en.wikipedia.org/wiki/Cron">cron</a>.
Just as they appear in the Pandora console, each one of the parameters
has three options.
<h4>Cron from: any</h4>
The module will not have restrictions in that parameter. Whatever the value is
will be executed, and it is equivalent to the asterisk (*) in the cron nomenclature. In this
case <b>Cron to</b> is ignored.
<h4>Cron from: different from any. Cron to: any</h4>
The module will run only during the time in which the date matches that
parameter. It is equivalent to writingjust one number in cron nomenclature.
<h4>Cron from: different from any. Cron to: different from any</h4>
The module will run only during the time specified between <b>Cron from</b> and <b>Cron to</b>.
It is equivalent to writing number dash number (n-n) in cron nomenclature.
<h2>Agent interval</h2>
As long as cron conditions are met, the agent will run following
its execution interval.
<h2>Examples</h2>
<ul>
<li><i>* * * * *</i>: No cron configured.</li>
<li><i>15 20 * * *</i>: It will run every day at 20:15.</li>
<li><i>* 20 * * *</i>: It will run every day during the hour 20, that is, from 20:00 to 20:59.</li>
<li><i>* 8-19 * * *</i>: It will run everyday from 8:00 to 19:59.</li>
<li><i>15-45 * 1-16 * *</i>: It will run every first 16 days of the month every hour, from quarter past to quarter to.</li>
<li><i>* * * 5 *</i>: It will run only in May.</li>
<ul>

View File

@ -5,11 +5,12 @@
?>
<h1>Module definition</h1>
<p>
There are two modes for an agent:
There are three modes for an agent:
</p>
<ul>
<li><i>Learning mode:</i> all the modules sent by the agent are accepted. If modules are not defined, they will be automatically defined by the system. It is recommended to activate the agents in this mode and change it once the user is familiar with Pandora FMS.<br>From version 4.0.3, in this mode, Pandora console collect all the configuration specified by the agent configuration file the first time and thereafter any changes should be made through console, will not catch changes in config file.
</li>
<li><i>Learning mode:</i> All the modules sent by the agent are accepted. If modules are not defined, they will be automatically defined by the system. It is recommended to activate the agents in this mode and change it once the user is familiar with Pandora FMS.<br>From version 4.0.3, in this mode, Pandora console collect all the configuration specified by the agent configuration file the first time and thereafter any changes should be made through console, will not catch changes in config file.</li>
<br>
<li><i>Normal mode:</i> the modules in this mode must be configured manually. The self definition of the modules is not allowed in this mode.</li>
<li><i>Normal mode:</i> The modules in this mode must be configured manually. The self definition of the modules is not allowed in this mode.</li>
<br>
<li><i>Autodisable mode:</i> It behaves exactly the same as an agent in learning mode: when the first XML reaches it, the first agent is created and, on each report, if there are new modules they can also be added automatically. Nevertheless, when all modules from an agent that are in autodisable mode are also marked as unknown, the agent is automatically disabled. In any case, if the agent reports again, it gets enabled again on its own.</li>
</ul>

View File

@ -26,54 +26,66 @@ A la hora de crear la acción podemos definir únicamente estos 3 campos. Dentro
Además de las macros de módulo definidas, las siguientes macros están disponibles:
</p>
<ul>
<li>_field1_: Campo 1 definido por el usuario.</li>
<li>_field2_: Campo 2 definido por el usuario.</li>
<li>_field3_: Campo 3 definido por el usuario.</li>
<li>_agent_: Nombre del agente que disparó la alerta.</li>
<li>_agentdescription_ : Descripción del agente que disparó la alerta.</li>
<li>_agentgroup_ : Nombre del grupo del agente.</li>
<li>_agentstatus_ : Estado actual del agente.</li>
<li>_address_: Dirección del agente que disparó la alerta.</li>
<li>_all_address_ : Todas las direcciones del agente que disparo la alerta.</li>
<li>_address_n_ : La dirección del agente que corresponde a la posicion indicada en "n" ejemplo: address_1_ , address_2_</li>
<li>_agentos_: Sistema operativo del agente.</li>
<li>_timestamp_: Hora y fecha en que se disparó la alerta.</li>
<li>_timezone_: Area Nombre _timestamp_ que representa en.</li>
<li>_data_: Dato que hizo que la alerta se disparase.</li>
<li>_prevdata_: Dato previo antes de disparase la alerta.</li>
<li>_alert_description_: Descripción de la alerta.</li>
<li>_alert_threshold_: Umbral de la alerta.</li>
<li>_alert_times_fired_: Número de veces que se ha disparado la alerta.</li>
<li>_module_: Nombre del módulo</li>
<li>_modulegroup_ : Nombre del grupo del módulo.</li>
<li>_moduledescription_: Descripcion del modulo.</li>
<li>_modulestatus_ : Estado del módulo.</li>
<li>_moduletags_ : Etiquetas asociadas al módulo.</li>
<li>_alert_name_: Nombre de la alerta.</li>
<li>_alert_priority_: Prioridad numérica de la alerta.</li>
<li>_alert_text_severity_: Prioridad en texto de la alerta. (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
<li>_eventt_text_severity_: (Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta. (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
<li>_event_id_ : (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.</li>
<li>_id_group_ : Id del grupo de agente.</li>
<li>_id_module_ : ID del módulo.</li>
<li>_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.</li>
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
<li>_interval_ : Intervalo de la ejecución del módulo. </li>
<li>_target_ip_ : Dirección IP del objetivo del módulo.</li>
<li>_target_port_ : Puerto del objetivo del módulo.</li>
<li>_plugin_parameters_ : Parámetros del Plug-in del módulo.</li>
<li>_server_ip_ : Ip del servidor al que el agente está asignado. </li>
<li>_server_name_ : Nombre del servidor al que el agente está asignado. </li>
<li>_groupcontact_ : Información de contacto del grupo. Se configura al crear el grupo.</li>
<li>_groupother_ : Otra información sobre el grupo. Se configura al crear el grupo.</li>
<li>_email_tag_ : Emails asociados a los tags de módulos.</li>
<li>_alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.</li>
<li>_alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.</li>
<li>_alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.</li>
<li>_modulegraph_<i>n</i>h_: (Sólo para alertas que usen el comando eMail) Devuelve una imagen codificada en base64 de una gráfica del módulo con un período de n horas (eg. _modulegraph_24h_). Requiere de una configuración correcta de la conexión del servidor a la consola vía api, la cual se realiza en el fichero de configuración del servidor.</li>
<li>_modulegraphth_<i>n</i>h_:mismo funcionamiento que la macro anterior solo que con los umbrales critical y warning del modulo siempre que estos esten definidos</li>
<li>_homeurl_ : Es un link de la URL pública esta debe de estar configurada en las opciones generales del setup.</li>
<li>_address_: Dirección del agente que disparó la alerta.</li>
<li>_address_n_ : La dirección del agente que corresponde a la posicion indicada en "n" ejemplo: address_1_ , address_2_</li>
<li>_agent_: Nombre del agente que disparó la alerta.</li>
<li>_agentcustomfield_n_: Campo personalizado número <i>n</i> del agente (eg. _agentcustomfield_9_).</li>
<li>_agentcustomid_:ID personalizado del agente.</li>
<li>_agentdescription_: Descripción del agente que disparó la alerta.</li>
<li>_agentgroup_ : Nombre del grupo del agente.</li>
<li>_agentos_: Sistema operativo del agente.</li>
<li>_agentstatus_ : Estado actual del agente.</li>
<li>_alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.</li>
<li>_alert_description_: Descripción de la alerta.</li>
<li>_alert_name_: Nombre de la alerta.</li>
<li>_alert_priority_: Prioridad numérica de la alerta.</li>
<li>_alert_text_severity_: Prioridad en texto de la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_alert_threshold_: Umbral de la alerta.</li>
<li>_alert_times_fired_: Número de veces que se ha disparado la alerta.</li>
<li>_alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.</li>
<li>_alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.</li>
<li>_all_address_ : Todas las direcciones del agente que disparo la alerta.</li>
<li>_data_: Dato que hizo que la alerta se disparase.</li>
<li>_email_tag_: Emails asociados a los tags de módulos.</li>
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_event_text_severity_: (Solo alertas de evento) Texto del evento (que disparó la alerta) gravedad (Mantenimiento, Informativo, Normal Menor, Advertencia, Mayor, Crítico).</li>
<li>_field1_: Campo 1 definido por el usuario.</li>
<li>_field2_: Campo 2 definido por el usuario.</li>
<li>_field3_: Campo 3 definido por el usuario.</li>
<li>_field4_: Campo 4 definido por el usuario.</li>
<li>_field5_: Campo 5 definido por el usuario.</li>
<li>_field6_: Campo 6 definido por el usuario.</li>
<li>_field7_: Campo 7 definido por el usuario.</li>
<li>_field8_: Campo 8 definido por el usuario.</li>
<li>_field9_: Campo 9 definido por el usuario.</li>
<li>_field10_: Campo 10 definido por el usuario.</li>
<li>_groupcontact_: Información de contacto del grupo. Se configura al crear el grupo.</li>
<li>_groupcustomid_: ID personalizado del grupo.</li>
<li>_groupother_: Otra información sobre el grupo. Se configura al crear el grupo.</li>
<li>_homeurl_: Es un link de la URL pública esta debe de estar configurada en las opciones generales del setup.</li>
<li>_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.</li>
<li>_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.</li>
<li>_id_group_ : ID del grupo de agente.</li>
<li>_id_module_: ID del módulo.</li>
<li>_interval_: Intervalo de la ejecución del módulo.</li>
<li>_module_: Nombre del módulo.</li>
<li>_modulecustomid_: ID personalizado del módulo.</li>
<li>_moduledata_X_: Último dato del módulo X (nombre del módulo, no puede tener espacios).</li>
<li>_moduledescription_: Descripcion del modulo.</li>
<li>_modulegraph_nh_: (>=6.0) (Only for alerts that use the command eMail) Returns an image encoded in base64 of a modules graph with a period of n hours (eg. _modulegraph_24h_). A correct setup of the connection between the server and the console's API is required. This setup is done on the server's configuration file.</li>
<li>_modulegraphth_nh_: Misma operación que la macro anterior pero sólo con los umbrales crítico y de advertencia del módulo, en caso de que estén definidos.</li>
<li>_modulegroup_: Nombre del grupo del módulo.</li>
<li>_modulestatus_: Estado del módulo.</li>
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
<li>_name_tag_: Nombre de los tags asociados al módulo.</li>
<li>_phone_tag_: Teléfonos asociados a los tags de módulos.</li>
<li>_plugin_parameters_: Parámetros del Plug-in del módulo.</li>
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
<li>_prevdata_ : Dato previo antes de disparase la alerta.</li>
<li>_target_ip_: Dirección IP del objetivo del módulo.</li>
<li>_target_port_: Puerto del objetivo del módulo.</li>
<li>_timestamp_: Hora y fecha en que se disparó la alerta.</li>
<li>_timezone_: Area Nombre _timestamp_ que representa en.</li>
</ul>
<p>
Ejemplo: Error en el agente _agent_: _alert_description_

View File

@ -9,67 +9,68 @@
Además de las macros de módulo definidas, las siguientes macros están disponibles:
</p>
<ul>
<li>_field1_: Campo 1 definido por el usuario.</li>
<li>_field2_: Campo 2 definido por el usuario.</li>
<li>_field3_: Campo 3 definido por el usuario.</li>
<li>_field4_: Campo 4 definido por el usuario.</li>
<li>_field5_: Campo 5 definido por el usuario.</li>
<li>_field6_: Campo 6 definido por el usuario.</li>
<li>_field7_: Campo 7 definido por el usuario.</li>
<li>_field8_: Campo 8 definido por el usuario.</li>
<li>_field9_: Campo 9 definido por el usuario.</li>
<li>_field10_: Campo 10 definido por el usuario.</li>
<li>_agent_: Nombre del agente que disparó la alerta.</li>
<li>_agentcustomfield_<i>n</i>_: Campo personalizado número <i>n</i> del agente (eg. _agentcustomfield_9_). </li>
<li>_agentcustomid_: ID personalizado del agente. </li>
<li>_agentdescription_: Descripción del agente que disparó la alerta.</li>
<li>_agentgroup_: Nombre del grupo del agente.</li>
<li>_agentstatus_: Estado actual del agente.</li>
<li>_agentos_: Sistema operativo del agente.</li>
<li>_address_: Dirección del agente que disparó la alerta.</li>
<li>_timestamp_: Hora y fecha en que se disparó la alerta.</li>
<li>_timezone_: Area Nombre _timestamp_ que representa en.</li>
<li>_data_: Dato que hizo que la alerta se disparase.</li>
<li>_prevdata_: Dato previo antes de disparase la alerta.</li>
<li>_alert_description_: Descripción de la alerta.</li>
<li>_alert_threshold_: Umbral de la alerta.</li>
<li>_alert_times_fired_: Número de veces que se ha disparado la alerta.</li>
<li>_module_: Nombre del módulo.</li>
<li>_modulecustomid_: ID personalizado del módulo.</li>
<li>_modulegroup_: Nombre del grupo del módulo.</li>
<li>_moduledescription_: Descripcion del modulo.</li>
<li>_modulestatus_: Estado del módulo.</li>
<li>_moduledata_X_: Último dato del módulo X (nombre del módulo, no puede tener espacios).</li>
<li>_alert_name_: Nombre de la alerta.</li>
<li>_alert_priority_: Prioridad numérica de la alerta.</li>
<li>_alert_text_severity_: Prioridad en texto de la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_eventt_text_severity_: (Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.</li>
<li>_id_group_ : Id del grupo de agente.</li>
<li>_id_module_ : ID del módulo.</li>
<li>_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.</li>
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
<li>_interval_: Intervalo de la ejecución del módulo. </li>
<li>_target_ip_: Dirección IP del objetivo del módulo.</li>
<li>_target_port_: Puerto del objetivo del módulo.</li>
<li>_plugin_parameters_: Parámetros del plugin del módulo.</li>
<li>_server_ip_ : Ip del servidor al que el agente está asignado. </li>
<li>_server_name_ : Nombre del servidor al que el agente está asignado. </li>
<li>_groupcontact_: Información de contacto del grupo. Se configura al crear el grupo.</li>
<li>_groupcustomid_: ID personalizado del grupo.</li>
<li>_groupother_: Otra información sobre el grupo. Se configura al crear el grupo.</li>
<li>_name_tag_: Nombre de los tags asociados al módulo.</li>
<li>_email_tag_: Emails asociados a los tags de módulos.</li>
<li>_phone_tag_: Teléfonos asociados a los tags de módulos.</li>
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
<li>_alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.</li>
<li>_alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.</li>
<li>_alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.</li>
<li>_modulegraph_<i>n</i>h_: (>=6.0) (Solo para alertas que usen el comando <i>eMail</i>)
Devuelve una imagen codificada en base64 de una gráfica del módulo con un período de <i>n</i> horas (eg. _modulegraph_24h_).
Requiere de una configuración correcta de la conexión del servidor a la consola vía api,
la cual se realiza en el fichero de configuración del servidor.</li>
<li>_address_: Dirección del agente que disparó la alerta.</li>
<li>_address_n_ : La dirección del agente que corresponde a la posicion indicada en "n" ejemplo: address_1_ , address_2_</li>
<li>_agent_: Nombre del agente que disparó la alerta.</li>
<li>_agentcustomfield_n_: Campo personalizado número <i>n</i> del agente (eg. _agentcustomfield_9_).</li>
<li>_agentcustomid_:ID personalizado del agente.</li>
<li>_agentdescription_: Descripción del agente que disparó la alerta.</li>
<li>_agentgroup_ : Nombre del grupo del agente.</li>
<li>_agentos_: Sistema operativo del agente.</li>
<li>_agentstatus_ : Estado actual del agente.</li>
<li>_alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.</li>
<li>_alert_description_: Descripción de la alerta.</li>
<li>_alert_name_: Nombre de la alerta.</li>
<li>_alert_priority_: Prioridad numérica de la alerta.</li>
<li>_alert_text_severity_: Prioridad en texto de la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_alert_threshold_: Umbral de la alerta.</li>
<li>_alert_times_fired_: Número de veces que se ha disparado la alerta.</li>
<li>_alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.</li>
<li>_alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.</li>
<li>_all_address_ : Todas las direcciones del agente que disparo la alerta.</li>
<li>_data_: Dato que hizo que la alerta se disparase.</li>
<li>_email_tag_: Emails asociados a los tags de módulos.</li>
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_event_text_severity_: (Solo alertas de evento) Texto del evento (que disparó la alerta) de la gravedad (Mantenimiento, Informativo, Normal Menor, Advertencia, Mayor, Crítico).</li>
<li>_field1_: Campo 1 definido por el usuario.</li>
<li>_field2_: Campo 2 definido por el usuario.</li>
<li>_field3_: Campo 3 definido por el usuario.</li>
<li>_field4_: Campo 4 definido por el usuario.</li>
<li>_field5_: Campo 5 definido por el usuario.</li>
<li>_field6_: Campo 6 definido por el usuario.</li>
<li>_field7_: Campo 7 definido por el usuario.</li>
<li>_field8_: Campo 8 definido por el usuario.</li>
<li>_field9_: Campo 9 definido por el usuario.</li>
<li>_field10_: Campo 10 definido por el usuario.</li>
<li>_groupcontact_: Información de contacto del grupo. Se configura al crear el grupo.</li>
<li>_groupcustomid_: ID personalizado del grupo.</li>
<li>_groupother_: Otra información sobre el grupo. Se configura al crear el grupo.</li>
<li>_homeurl_: Es un link de la URL pública esta debe de estar configurada en las opciones generales del setup.</li>
<li>_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.</li>
<li>_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.</li>
<li>_id_group_ : ID del grupo de agente.</li>
<li>_id_module_: ID del módulo.</li>
<li>_interval_: Intervalo de la ejecución del módulo.</li>
<li>_module_: Nombre del módulo.</li>
<li>_modulecustomid_: ID personalizado del módulo.</li>
<li>_moduledata_X_: Último dato del módulo X (nombre del módulo, no puede tener espacios).</li>
<li>_moduledescription_: Descripcion del modulo.</li>
<li>_modulegraph_nh_: (>=6.0) (Solo para alertas que usen el comando <i>eMail</i>) Devuelve una imagen codificada en base64 de una gráfica del módulo con un período de <i>n</i> horas (eg. _modulegraph_24h_). Requiere de una configuración correcta de la conexión del servidor a la consola vía api, la cual se realiza en el fichero de configuración del servidor.</li>
<li>_modulegraphth_nh_: Misma operación que la macro anterior pero sólo con los umbrales crítico y de advertencia del módulo, en caso de que estén definidos.</li>
<li>_modulegroup_: Nombre del grupo del módulo.</li>
<li>_modulestatus_: Estado del módulo.</li>
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
<li>_name_tag_: Nombre de los tags asociados al módulo.</li>
<li>_phone_tag_: Teléfonos asociados a los tags de módulos.</li>
<li>_plugin_parameters_: Parámetros del Plug-in del módulo.</li>
<li>_policy_: Nombre de la política a la que pertenece el módulo (si aplica).</li>
<li>_prevdata_ : Dato previo antes de disparase la alerta.</li>
<li>_target_ip_: Dirección IP del objetivo del módulo.</li>
<li>_target_port_: Puerto del objetivo del módulo.</li>
<li>_timestamp_: Hora y fecha en que se disparó la alerta.</li>
<li>_timezone_: Area Nombre _timestamp_ que representa en.</li>
</ul>
<p>

View File

@ -0,0 +1,46 @@
<?php
/**
* @package Include/help/es
*/
?>
<h1>Cron para módulos de servidor</h1>
Mediante los grupos de parámetros de configuración <b>Cron desde</b> y <b>Cron hasta</b> se
puede hacer que un módulo solo se ejecute durante ciertos periodos de tiempo. El
modo en el que se configura es parecido a la sintaxis de
<a style="font-size:14px;" href="https://es.wikipedia.org/wiki/Cron_(Unix)">cron</a>.
Tal y como aparecen en la consola de Pandora, cada uno de los parámetros
tiene tres opciones.
<h4>Cron desde: cualquiera</h4>
El módulo no tendrá restricciones en ese parámetro. Se ejecutará cualquiera que
que sea el valor y equivale al asterisco (*) en la nomenclatura de cron. En este
caso se ignora <b>Cron desde</b>.
<h4>Cron desde: distinto de cualquiera. Cron hasta: cualquiera</h4>
El módulo se ejecutará solamente el tiempo en el que la fecha coincida con ese
parámetro. Equivale a escribir solamente un número en la nomenclatura de cron.
<h4>Cron desde: distinto de cualquiera. Cron hasta: distinto de cualquiera</h4>
El módulo se ejecutará entre el tiempo indicado en el <b>Cron desde</b> y el <b>Cron hasta</b>.
Equivale a escribir el número guión número (n-n) en la nomenclatura de cron.
<h2>Intervalo del agente</h2>
Mientras que se cumplan las condiciones de cron, el agente se ejecutará siguiendo
su intervalo de ejecución.
<h2>Ejemplos</h2>
<ul>
<li><i>* * * * *</i>: No hay cron configurado.</li>
<li><i>15 20 * * *</i>: Se ejecutará todos los días a las 20:15.</li>
<li><i>* 20 * * *</i>: Se ejecutará todos los días durante las 20 horas, es decir, entre las 20:00 y las 20:59.</li>
<li><i>* 8-19 * * *</i>: Se ejecutará todos los días entre las 8:00 y las 19:59.</li>
<li><i>15-45 * 1-16 * *</i>: Se ejecutará todos los primeros 16 días del mes a todas horas entre y cuarto y menos cuarto.</li>
<li><i>* * * 5 *</i>: Se ejecutará solamente en mayo.</li>
<ul>

View File

@ -6,10 +6,12 @@
<h1>Definición de módulo</h1>
<p>
Existen dos modos para un agente:
Existen tres modos para un agente:
</p>
<ul>
<li><i>Modo aprendizaje:</i> todos los módulos enviados por el agente se aceptan. Si los módulos no están definidos, el sistema los creará automáticamente. Se recomienda activar los agentes en este modo y cambiarlo una vez que se el operador se ha familiarizado con Pandora FMS. A partir de la versión 4.0.3, en este modo Pandora recogerá en consola toda la configuración indicada por el fichero de configuración del agente la primera vez y a partir de entonces todas las modificaciones se deberán realizar a través de consola, no cogerá cambios en el fichero de configuración.</li>
<li><i>Modo aprendizaje:</i>Si el XML recibido del agente software contiene nuevos módulos, éstos serán automáticamente creados. Este es el comportamiento por defecto.</li>
<br>
<li><i>Modo normal:</i> los módulos en este modo se deben configurar manualmente. No se permite la definición automática en este modo.</li>
<li><i>Modo normal:</i>No se crearán nuevos módulos que lleguen en el XML si no han sido declarados previamente en la consola.</li>
<br>
<li><i>Modo auto deshabilitado:</i>Similar al modo aprendizaje, en este modo, además, si todos los módulos pasan a estado desconocido el agente se deshabilitará automáticamente, pasando a habilitarse de nuevo si recibe nueva información.</li>
</ul>

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