Merge branch 'develop' into 1407-No-se-puede-quitar-icono-de-objeto-Visual-consoles-2
Conflicts: pandora_console/godmode/reporting/visual_console_builder.editor.js
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, AIX version
|
||||
# Version 7.0NG.714, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, FreeBSD Version
|
||||
# Version 7.0NG.714, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, HP-UX Version
|
||||
# Version 7.0NG.714, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, GNU/Linux
|
||||
# Version 7.0NG.714, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, GNU/Linux
|
||||
# Version 7.0NG.714, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, Solaris Version
|
||||
# Version 7.0NG.714, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2010 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.713
|
||||
# Version 7.0NG.714
|
||||
|
||||
# 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.713, AIX version
|
||||
# Version 7.0NG.714, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.713
|
||||
# Version 7.0NG.714
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.713, HPUX Version
|
||||
# Version 7.0NG.714, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713
|
||||
# Version 7.0NG.714
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713
|
||||
# Version 7.0NG.714
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713
|
||||
# Version 7.0NG.714
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.713, Solaris version
|
||||
# Version 7.0NG.714, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, AIX version
|
||||
# Version 7.0NG.714, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.713-171009
|
||||
Version: 7.0NG.714-171030
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.713-171009"
|
||||
pandora_version="7.0NG.714-171030"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, GNU/Linux
|
||||
# Version 7.0NG.714, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, FreeBSD Version
|
||||
# Version 7.0NG.714, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, HP-UX Version
|
||||
# Version 7.0NG.714, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, GNU/Linux
|
||||
# Version 7.0NG.714, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, GNU/Linux
|
||||
# Version 7.0NG.714, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, NetBSD Version
|
||||
# Version 7.0NG.714, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.713, Solaris Version
|
||||
# Version 7.0NG.714, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -40,8 +40,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.713';
|
||||
use constant AGENT_BUILD => '171009';
|
||||
use constant AGENT_VERSION => '7.0NG.714';
|
||||
use constant AGENT_BUILD => '171030';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -1363,7 +1363,7 @@ sub md5 {
|
|||
# Append bit /* bit, not byte */ length of unpadded message as 64-bit
|
||||
# little-endian integer to message.
|
||||
$msg .= unpack ("B32", pack ("V", $bit_len));
|
||||
$msg .= unpack ("B32", pack ("V", $bit_len >> 32));
|
||||
$msg .= unpack ("B32", pack ("V", ($bit_len >> 16) >> 16));
|
||||
|
||||
# Process the message in successive 512-bit chunks.
|
||||
for (my $i = 0; $i < length ($msg); $i += 512) {
|
||||
|
@ -1579,6 +1579,9 @@ sub guess_os_version ($) {
|
|||
# AIX
|
||||
} elsif ($os eq 'aix') {
|
||||
$os_version = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/);
|
||||
# Darwin
|
||||
} elsif ($os eq 'darwin') {
|
||||
$os_version = `defaults read loginwindow SystemVersionStampAsString`;
|
||||
# Windows
|
||||
} elsif ($os =~ /win/i) {
|
||||
$os_version = `ver`;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.713
|
||||
%define release 171009
|
||||
%define version 7.0NG.714
|
||||
%define release 171030
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -24,7 +24,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
|
|||
Requires: fileutils textutils unzip
|
||||
Requires: util-linux procps grep
|
||||
Requires: /sbin/ip /bin/awk
|
||||
Requires: perl perl(Sys::Syslog) perl(IO::Socket::SSL)
|
||||
Requires: perl perl(Sys::Syslog)
|
||||
# Required by plugins
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
AutoReq: 0
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.713
|
||||
%define release 171009
|
||||
%define version 7.0NG.714
|
||||
%define release 171030
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -67,6 +67,7 @@ then
|
|||
fi
|
||||
|
||||
%post
|
||||
mkdir -p /var/log/pandora
|
||||
chown pandora:root /var/log/pandora
|
||||
if [ ! -d /etc/pandora ] ; then
|
||||
mkdir -p /etc/pandora
|
||||
|
@ -91,6 +92,9 @@ if [ ! -e /etc/pandora/collections ]; then
|
|||
fi
|
||||
cp -aRf /usr/share/pandora_agent/pandora_agent_logrotate /etc/logrotate.d/pandora_agent
|
||||
|
||||
# Enable the service on SystemD
|
||||
systemctl enable pandora_agent_daemon.service
|
||||
|
||||
mkdir -p /var/spool/pandora/data_out
|
||||
chkconfig pandora_agent_daemon on
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.713"
|
||||
PI_BUILD="171009"
|
||||
PI_VERSION="7.0NG.714"
|
||||
PI_BUILD="171030"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -3,7 +3,7 @@ if DEBUG
|
|||
PandoraAgent_SOURCES = misc/pandora_file.cc modules/pandora_data.cc modules/pandora_module_factory.cc modules/pandora_module.cc modules/pandora_module_list.cc modules/pandora_module_plugin.cc modules/pandora_module_inventory.cc modules/pandora_module_freememory.cc modules/pandora_module_exec.cc modules/pandora_module_perfcounter.cc modules/pandora_module_proc.cc modules/pandora_module_tcpcheck.cc modules/pandora_module_freememory_percent.cc modules/pandora_module_freedisk.cc modules/pandora_module_freedisk_percent.cc modules/pandora_module_logevent.cc modules/pandora_module_service.cc modules/pandora_module_cpuusage.cc modules/pandora_module_wmiquery.cc modules/pandora_module_regexp.cc modules/pandora_module_ping.cc modules/pandora_module_snmpget.cc udp_server/udp_server.cc main.cc pandora_strutils.cc pandora.cc windows_service.cc pandora_agent_conf.cc windows/pandora_windows_info.cc windows/pandora_wmi.cc pandora_windows_service.cc misc/md5.c misc/sha256.cc windows/wmi/disphelper.c ssh/libssh2/channel.c ssh/libssh2/mac.c ssh/libssh2/session.c ssh/libssh2/comp.c ssh/libssh2/misc.c ssh/libssh2/sftp.c ssh/libssh2/crypt.c ssh/libssh2/packet.c ssh/libssh2/userauth.c ssh/libssh2/hostkey.c ssh/libssh2/publickey.c ssh/libssh2/kex.c ssh/libssh2/scp.c ssh/pandora_ssh_client.cc ssh/pandora_ssh_test.cc ftp/pandora_ftp_client.cc ftp/pandora_ftp_test.cc debug_new.cpp
|
||||
PandoraAgent_CXXFLAGS=-g -O0
|
||||
else
|
||||
PandoraAgent_SOURCES = misc/pandora_file.cc modules/pandora_data.cc modules/pandora_module_factory.cc modules/pandora_module.cc modules/pandora_module_list.cc modules/pandora_module_plugin.cc modules/pandora_module_inventory.cc modules/pandora_module_freememory.cc modules/pandora_module_exec.cc modules/pandora_module_perfcounter.cc modules/pandora_module_proc.cc modules/pandora_module_tcpcheck.cc modules/pandora_module_freememory_percent.cc modules/pandora_module_freedisk.cc modules/pandora_module_freedisk_percent.cc modules/pandora_module_logevent.cc modules/pandora_module_service.cc modules/pandora_module_cpuusage.cc modules/pandora_module_wmiquery.cc modules/pandora_module_regexp.cc modules/pandora_module_ping.cc modules/pandora_module_snmpget.cc udp_server/udp_server.cc main.cc pandora_strutils.cc pandora.cc windows_service.cc pandora_agent_conf.cc windows/pandora_windows_info.cc windows/pandora_wmi.cc pandora_windows_service.cc misc/md5.c misc/sha256.cc windows/wmi/disphelper.c ssh/libssh2/channel.c ssh/libssh2/mac.c ssh/libssh2/session.c ssh/libssh2/comp.c ssh/libssh2/misc.c ssh/libssh2/sftp.c ssh/libssh2/crypt.c ssh/libssh2/packet.c ssh/libssh2/userauth.c ssh/libssh2/hostkey.c ssh/libssh2/publickey.c ssh/libssh2/kex.c ssh/libssh2/scp.c ssh/pandora_ssh_client.cc ssh/pandora_ssh_test.cc ftp/pandora_ftp_client.cc ftp/pandora_ftp_test.cc
|
||||
PandoraAgent_SOURCES = misc/pandora_file.cc modules/pandora_data.cc modules/pandora_module_factory.cc modules/pandora_module.cc modules/pandora_module_list.cc modules/pandora_module_plugin.cc modules/pandora_module_inventory.cc modules/pandora_module_freememory.cc modules/pandora_module_exec.cc modules/pandora_module_perfcounter.cc modules/pandora_module_proc.cc modules/pandora_module_tcpcheck.cc modules/pandora_module_freememory_percent.cc modules/pandora_module_freedisk.cc modules/pandora_module_freedisk_percent.cc modules/pandora_module_logevent.cc modules/pandora_module_logchannel.cc modules/pandora_module_service.cc modules/pandora_module_cpuusage.cc modules/pandora_module_wmiquery.cc modules/pandora_module_regexp.cc modules/pandora_module_ping.cc modules/pandora_module_snmpget.cc udp_server/udp_server.cc main.cc pandora_strutils.cc pandora.cc windows_service.cc pandora_agent_conf.cc windows/pandora_windows_info.cc windows/pandora_wmi.cc pandora_windows_service.cc misc/md5.c misc/sha256.cc windows/wmi/disphelper.c ssh/libssh2/channel.c ssh/libssh2/mac.c ssh/libssh2/session.c ssh/libssh2/comp.c ssh/libssh2/misc.c ssh/libssh2/sftp.c ssh/libssh2/crypt.c ssh/libssh2/packet.c ssh/libssh2/userauth.c ssh/libssh2/hostkey.c ssh/libssh2/publickey.c ssh/libssh2/kex.c ssh/libssh2/scp.c ssh/pandora_ssh_client.cc ssh/pandora_ssh_test.cc ftp/pandora_ftp_client.cc ftp/pandora_ftp_test.cc
|
||||
PandoraAgent_CXXFLAGS=-O2
|
||||
endif
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2014 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.713
|
||||
# Version 7.0NG.714
|
||||
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.713}
|
||||
{Pandora FMS Windows Agent v7.0NG.714}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{171009}
|
||||
{171030}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -248,7 +248,9 @@ Pandora_Module::parseModuleKindFromString (string kind) {
|
|||
} else if (kind == module_inventory_str) {
|
||||
return MODULE_INVENTORY;
|
||||
} else if (kind == module_logevent_str) {
|
||||
return MODULE_LOGEVENT;
|
||||
return MODULE_LOGEVENT;
|
||||
} else if (kind == module_logchannel_str) {
|
||||
return MODULE_LOGCHANNEL;
|
||||
} else if (kind == module_wmiquery_str) {
|
||||
return MODULE_WMIQUERY;
|
||||
} else if (kind == module_perfcounter_str) {
|
||||
|
|
|
@ -86,6 +86,7 @@ namespace Pandora_Modules {
|
|||
MODULE_FREEMEMORY_PERCENT, /**< The module checks the amount of
|
||||
* freememory in the system */
|
||||
MODULE_LOGEVENT, /**< The module checks for log events */
|
||||
MODULE_LOGCHANNEL, /**< The module checks for log events on channel using XML functions*/
|
||||
MODULE_WMIQUERY, /**< The module runs WQL queries */
|
||||
MODULE_PERFCOUNTER, /**< The module reads performance counters */
|
||||
MODULE_TCPCHECK, /**< The module checks whether a tcp port is open */
|
||||
|
@ -126,6 +127,7 @@ namespace Pandora_Modules {
|
|||
const string module_cpuusage_str = "module_cpuusage";
|
||||
const string module_inventory_str = "module_inventory";
|
||||
const string module_logevent_str = "module_logevent";
|
||||
const string module_logchannel_str = "module_logchannel";
|
||||
const string module_wmiquery_str = "module_wmiquery";
|
||||
const string module_perfcounter_str = "module_perfcounter";
|
||||
const string module_tcpcheck_str = "module_tcpcheck";
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "pandora_module_cpuusage.h"
|
||||
#include "pandora_module_inventory.h"
|
||||
#include "pandora_module_logevent.h"
|
||||
#include "pandora_module_logchannel.h"
|
||||
#include "pandora_module_wmiquery.h"
|
||||
#include "pandora_module_perfcounter.h"
|
||||
#include "pandora_module_tcpcheck.h"
|
||||
|
@ -69,6 +70,7 @@ using namespace Pandora_Strutils;
|
|||
#define TOKEN_MIN_FF_EVENT ("module_min_ff_event ")
|
||||
#define TOKEN_DESCRIPTION ("module_description ")
|
||||
#define TOKEN_LOGEVENT ("module_logevent")
|
||||
#define TOKEN_LOGCHANNEL ("module_logchannel")
|
||||
#define TOKEN_SOURCE ("module_source ")
|
||||
#define TOKEN_EVENTTYPE ("module_eventtype ")
|
||||
#define TOKEN_EVENTCODE ("module_eventcode ")
|
||||
|
@ -121,6 +123,7 @@ using namespace Pandora_Strutils;
|
|||
#define TOKEN_MACRO ("module_macro")
|
||||
#define TOKEN_NATIVE_ENCODING ("module_native_encoding")
|
||||
#define TOKEN_ALERT_TEMPLATE ("module_alert_template")
|
||||
#define TOKEN_USER_SESSION ("module_user_session ")
|
||||
|
||||
string
|
||||
parseLine (string line, string token) {
|
||||
|
@ -157,8 +160,9 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
string module_freedisk_percent, module_freememory_percent;
|
||||
string module_dsn, module_freememory;
|
||||
string module_logevent, module_source, module_eventtype, module_eventcode;
|
||||
string module_logchannel;
|
||||
string module_pattern, module_application, module_async;
|
||||
string module_watchdog, module_start_command;
|
||||
string module_watchdog, module_start_command, module_user_session;
|
||||
string module_wmiquery, module_wmicolumn;
|
||||
string module_retries, module_startdelay, module_retrydelay;
|
||||
string module_perfcounter, module_tcpcheck;
|
||||
|
@ -195,6 +199,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
module_proc = "";
|
||||
module_service = "";
|
||||
module_logevent = "";
|
||||
module_logchannel = "";
|
||||
module_source = "";
|
||||
module_eventtype = "";
|
||||
module_eventcode = "";
|
||||
|
@ -253,6 +258,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
module_ff_interval = "";
|
||||
module_native_encoding = "";
|
||||
module_alert_template = "";
|
||||
module_user_session = "";
|
||||
macro = "";
|
||||
|
||||
stringtok (tokens, definition, "\n");
|
||||
|
@ -342,6 +348,9 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
if (module_logevent == "") {
|
||||
module_logevent = parseLine (line, TOKEN_LOGEVENT);
|
||||
}
|
||||
if (module_logchannel == "") {
|
||||
module_logchannel = parseLine (line, TOKEN_LOGCHANNEL);
|
||||
}
|
||||
if (module_source == "") {
|
||||
module_source = parseLine (line, TOKEN_SOURCE);
|
||||
}
|
||||
|
@ -507,6 +516,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
if (module_alert_template == "") {
|
||||
module_alert_template = parseLine (line, TOKEN_ALERT_TEMPLATE);
|
||||
module_alert_template.erase (0,1);
|
||||
}
|
||||
|
||||
if (module_user_session == "") {
|
||||
module_user_session = parseLine (line, TOKEN_USER_SESSION);
|
||||
}
|
||||
|
||||
if (macro == "") {
|
||||
|
@ -724,6 +737,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
}
|
||||
}
|
||||
|
||||
if (module_logchannel != "") {
|
||||
pos_macro = module_logchannel.find(macro_name);
|
||||
if (pos_macro != string::npos){
|
||||
module_logchannel.replace(pos_macro, macro_name.size(), macro_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (module_source != "") {
|
||||
pos_macro = module_source.find(macro_name);
|
||||
if (pos_macro != string::npos){
|
||||
|
@ -1085,6 +1105,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
module_alert_template.replace(pos_macro, macro_name.size(), macro_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (module_user_session != "") {
|
||||
pos_macro = module_user_session.find(macro_name);
|
||||
if (pos_macro != string::npos){
|
||||
module_user_session.replace(pos_macro, macro_name.size(), macro_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1121,6 +1148,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
module_proc->setRetries (atoi(module_retries.c_str ()));
|
||||
module_proc->setStartDelay (atoi(module_startdelay.c_str ()));
|
||||
module_proc->setRetryDelay (atoi(module_retrydelay.c_str ()));
|
||||
module_proc->setUserSession (is_enabled(module_user_session));
|
||||
}
|
||||
}
|
||||
} else if (module_service != "") {
|
||||
|
@ -1142,7 +1170,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
try {
|
||||
char buffer[100];
|
||||
unsigned long memory = Pandora_Wmi::getDiskFreeSpace(module_freedisk_percent);
|
||||
if (sprintf(buffer, "Free memory %s %dMB",
|
||||
if (sprintf(buffer, "Free space on drive %s %dMB",
|
||||
module_freedisk_percent.c_str(), memory) > 0) {
|
||||
module->setDescription(buffer);
|
||||
}
|
||||
|
@ -1173,6 +1201,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||
module_eventcode,
|
||||
module_pattern,
|
||||
module_application);
|
||||
}
|
||||
else if (module_logchannel != "") {
|
||||
module = new Pandora_Module_Logchannel (module_name,
|
||||
module_source,
|
||||
module_eventtype,
|
||||
module_eventcode,
|
||||
module_pattern);
|
||||
} else if (module_wmiquery != "") {
|
||||
module = new Pandora_Module_WMIQuery (module_name,
|
||||
module_wmiquery, module_wmicolumn);
|
||||
|
|
|
@ -30,12 +30,13 @@
|
|||
#include "pandora_module_cpuusage.h"
|
||||
#include "pandora_module_inventory.h"
|
||||
#include "pandora_module_logevent.h"
|
||||
#include "pandora_module_logchannel.h"
|
||||
#include "pandora_module_wmiquery.h"
|
||||
#include "pandora_module_perfcounter.h"
|
||||
#include "pandora_module_tcpcheck.h"
|
||||
#include "pandora_module_regexp.h"
|
||||
#include "pandora_module_plugin.h"
|
||||
#include "pandora_module_ping.h"
|
||||
#include "pandora_module_ping.h"
|
||||
#include "pandora_module_snmpget.h"
|
||||
#include <fstream>
|
||||
|
||||
|
@ -226,12 +227,13 @@ Pandora_Modules::Pandora_Module_List::parseModuleDefinition (string definition)
|
|||
Pandora_Module_Freememory *module_freememory;
|
||||
Pandora_Module_Freememory_Percent *module_freememory_percent;
|
||||
Pandora_Module_Logevent *module_logevent;
|
||||
Pandora_Module_Logchannel *module_logchannel;
|
||||
Pandora_Module_WMIQuery *module_wmiquery;
|
||||
Pandora_Module_Perfcounter *module_perfcounter;
|
||||
Pandora_Module_Tcpcheck *module_tcpcheck;
|
||||
Pandora_Module_Regexp *module_regexp;
|
||||
Pandora_Module_Plugin *module_plugin;
|
||||
Pandora_Module_Ping *module_ping;
|
||||
Pandora_Module_Ping *module_ping;
|
||||
Pandora_Module_SNMPGet *module_snmpget;
|
||||
|
||||
module = Pandora_Module_Factory::getModuleFromDefinition (definition);
|
||||
|
@ -288,6 +290,10 @@ Pandora_Modules::Pandora_Module_List::parseModuleDefinition (string definition)
|
|||
module_logevent = (Pandora_Module_Logevent *) module;
|
||||
modules->push_back (module_logevent);
|
||||
break;
|
||||
case MODULE_LOGCHANNEL:
|
||||
module_logchannel = (Pandora_Module_Logchannel *) module;
|
||||
modules->push_back (module_logchannel);
|
||||
break;
|
||||
case MODULE_WMIQUERY:
|
||||
module_wmiquery = (Pandora_Module_WMIQuery *) module;
|
||||
modules->push_back (module_wmiquery);
|
||||
|
@ -315,7 +321,7 @@ Pandora_Modules::Pandora_Module_List::parseModuleDefinition (string definition)
|
|||
case MODULE_SNMPGET:
|
||||
module_snmpget = (Pandora_Module_SNMPGet *) module;
|
||||
modules->push_back (module_snmpget);
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,582 @@
|
|||
/* Pandora logchannel module. This module checks for log events that match a given
|
||||
pattern using XML functions provided by wevtapi.
|
||||
|
||||
Copyright (C) 2017 Artica ST.
|
||||
Written by Fermin Hernandez.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
|
||||
#include "pandora_module_logchannel.h"
|
||||
#include "../windows/pandora_wmi.h"
|
||||
#include "../pandora_windows_service.h"
|
||||
#include "pandora_module_logchannel.h"
|
||||
#include "pandora_strutils.h"
|
||||
|
||||
using namespace Pandora;
|
||||
using namespace Pandora_Modules;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
// Pointers to Wevtapi.dll functions
|
||||
static HINSTANCE WINEVENT = NULL;
|
||||
static EvtQueryT EvtQueryF = NULL;
|
||||
static EvtNextT EvtNextF = NULL;
|
||||
static EvtSeekT EvtSeekF = NULL;
|
||||
static EvtCreateRenderContextT EvtCreateRenderContextF = NULL;
|
||||
static EvtRenderT EvtRenderF = NULL;
|
||||
static EvtCloseT EvtCloseF = NULL;
|
||||
static EvtFormatMessageT EvtFormatMessageF = NULL;
|
||||
static EvtOpenPublisherMetadataT EvtOpenPublisherMetadataF = NULL;
|
||||
static EvtCreateBookmarkT EvtCreateBookmarkF = NULL;
|
||||
static EvtUpdateBookmarkT EvtUpdateBookmarkF = NULL;
|
||||
|
||||
/**
|
||||
* Creates a Pandora_Module_Logchannel object.
|
||||
*
|
||||
* @param name Module name.
|
||||
* @param service_name Service internal name to check.
|
||||
*/
|
||||
Pandora_Module_Logchannel::Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern)
|
||||
: Pandora_Module (name) {
|
||||
int i;
|
||||
vector<wstring> query;
|
||||
vector<wstring>::iterator query_it;
|
||||
string upper_type = type;
|
||||
|
||||
// Convert the type string to uppercase
|
||||
for (i = 0; i < type.length(); i++) {
|
||||
upper_type[i] = toupper(type[i]);
|
||||
}
|
||||
|
||||
// Set the type filter
|
||||
int type_number = -1;
|
||||
if (upper_type.compare("ERROR") == 0) {
|
||||
type_number = EVENTLOG_ERROR_TYPE;
|
||||
} else if (upper_type.compare("WARNING") == 0) {
|
||||
type_number = EVENTLOG_WARNING_TYPE;
|
||||
} else if (upper_type.compare("INFORMATION") == 0) {
|
||||
type_number = EVENTLOG_INFORMATION_TYPE;
|
||||
} else if (upper_type.compare("AUDIT SUCCESS") == 0) {
|
||||
type_number = EVENTLOG_AUDIT_SUCCESS;
|
||||
} else if (upper_type.compare("AUDIT FAILURE") == 0) {
|
||||
type_number = EVENTLOG_AUDIT_FAILURE;
|
||||
}
|
||||
// Append type to log query
|
||||
if (type_number != -1) {
|
||||
wstringstream ss;
|
||||
ss << L"*[System[Level='" << type_number << L"']]";
|
||||
query.push_back(ss.str());
|
||||
}
|
||||
|
||||
// Set the id
|
||||
int id_number = strtoul (id.c_str (), NULL, 0);
|
||||
if (id_number != 0) {
|
||||
wstringstream ss;
|
||||
ss << L"*[System[EventID='" << id_number << L"']]";
|
||||
query.push_back(ss.str());
|
||||
}
|
||||
|
||||
// Fill the filter
|
||||
if (query.size() == 0) {
|
||||
this->filter = L"*";
|
||||
} else {
|
||||
int i = 0;
|
||||
// Add filters with and
|
||||
wstring item_query;
|
||||
while (query.size() > 1) {
|
||||
item_query = query.back();
|
||||
query.pop_back();
|
||||
this->filter += item_query + L" and ";
|
||||
}
|
||||
// Append the last value without the and
|
||||
item_query = query.back();
|
||||
this->filter += item_query;
|
||||
}
|
||||
|
||||
this->source = source;
|
||||
this->pattern = pattern;
|
||||
if (! pattern.empty ()) {
|
||||
// Compile the regular expression
|
||||
if (regcomp (&this->regexp, pattern.c_str (), REG_EXTENDED) != 0) {
|
||||
pandoraLog ("Invalid regular expression %s", pattern.c_str ());
|
||||
}
|
||||
}
|
||||
this->bookmark_xml = L"";
|
||||
this->setKind (module_logchannel_str);
|
||||
|
||||
// Load Wevtapi.dll and some functions
|
||||
if (WINEVENT == NULL) {
|
||||
WINEVENT = LoadLibrary("Wevtapi.dll");
|
||||
if (WINEVENT == NULL) {
|
||||
|
||||
// Log to the bedug log, since this is not an error
|
||||
pandoraLog ("Library Wevtapi.dll not available");
|
||||
return;
|
||||
}
|
||||
|
||||
EvtQueryF = (EvtQueryT) GetProcAddress (WINEVENT, "EvtQuery");
|
||||
if (EvtQueryF == NULL) {
|
||||
pandoraLog ("Error loading function EvtQuery from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtNextF = (EvtNextT) GetProcAddress (WINEVENT, "EvtNext");
|
||||
if (EvtNextF == NULL) {
|
||||
pandoraLog ("Error loading function EvtNext from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtSeekF = (EvtSeekT) GetProcAddress (WINEVENT, "EvtSeek");
|
||||
if (EvtSeekF == NULL) {
|
||||
pandoraLog ("Error loading function EvtSeek from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtCreateRenderContextF = (EvtCreateRenderContextT) GetProcAddress (WINEVENT, "EvtCreateRenderContext");
|
||||
if (EvtCreateRenderContextF == NULL) {
|
||||
pandoraLog ("Error loading function EvtCreateRenderContext from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtRenderF = (EvtRenderT) GetProcAddress (WINEVENT, "EvtRender");
|
||||
if (EvtRenderF == NULL) {
|
||||
pandoraLog ("Error loading function EvtRender from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtCloseF = (EvtCloseT) GetProcAddress (WINEVENT, "EvtClose");
|
||||
if (EvtCloseF == NULL) {
|
||||
pandoraLog ("Error loading function EvtClose from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtFormatMessageF = (EvtFormatMessageT) GetProcAddress (WINEVENT, "EvtFormatMessage");
|
||||
if (EvtFormatMessageF == NULL) {
|
||||
pandoraLog ("Error loading function EvtFormatMessage from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtOpenPublisherMetadataF = (EvtOpenPublisherMetadataT) GetProcAddress (WINEVENT, "EvtOpenPublisherMetadata");
|
||||
if (EvtOpenPublisherMetadataF == NULL) {
|
||||
pandoraLog ("Error loading function EvtOpenPublisherMetadata from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtCreateBookmarkF = (EvtCreateBookmarkT) GetProcAddress (WINEVENT, "EvtCreateBookmark");
|
||||
if (EvtCreateBookmarkF == NULL) {
|
||||
pandoraLog ("Error loading function EvtCreateBookmark from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
EvtUpdateBookmarkF = (EvtUpdateBookmarkT) GetProcAddress (WINEVENT, "EvtUpdateBookmark");
|
||||
if (EvtUpdateBookmarkF == NULL) {
|
||||
pandoraLog ("Error loading function EvtUpdateBookmark from Wevtapi.dll");
|
||||
FreeLibrary (WINEVENT);
|
||||
WINEVENT = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Pandora_Module_Logchannel::run () {
|
||||
list<LogChannelList> event_list;
|
||||
list<LogChannelList>::iterator event;
|
||||
SYSTEMTIME system_time;
|
||||
|
||||
// Run
|
||||
try {
|
||||
Pandora_Module::run ();
|
||||
} catch (Interval_Not_Fulfilled e) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize log event query
|
||||
this->initializeLogChannel();
|
||||
|
||||
// Read events on a list
|
||||
this->getLogEvents (event_list);
|
||||
|
||||
// Return if no data stored on list
|
||||
if (event_list.size () < 1) return;
|
||||
|
||||
for (event = event_list.begin (); event != event_list.end(); ++event) {
|
||||
// Store the data
|
||||
this->setOutput (event->message, &(event->timestamp));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill the first bookmark of events.
|
||||
*/
|
||||
void
|
||||
Pandora_Module_Logchannel::initializeLogChannel () {
|
||||
EVT_HANDLE hEvents[1];
|
||||
EVT_HANDLE hResults;
|
||||
EVT_HANDLE hBookmark;
|
||||
DWORD dwReturned = 0;
|
||||
|
||||
// Check whether the first bookmark is set
|
||||
if (!this->bookmark_xml.empty()) return;
|
||||
|
||||
// Open the event log with a query
|
||||
hResults = EvtQueryF (
|
||||
NULL,
|
||||
strAnsiToUnicode (this->source.c_str()).c_str(),
|
||||
this->filter.c_str(),
|
||||
EvtOpenChannelPath | EvtQueryForwardDirection
|
||||
);
|
||||
if (hResults == NULL) {
|
||||
pandoraDebug ("Could not open event log channel. Error: '%d'", GetLastError());
|
||||
return;
|
||||
}
|
||||
|
||||
// Put the events on the last event
|
||||
if (!EvtSeekF(hResults, 0, NULL, 0, EvtSeekRelativeToLast)) {
|
||||
pandoraDebug("Cannot positionate the event at first. 'Error %d'.", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
return;
|
||||
}
|
||||
// Read next event to positionate the bookmark
|
||||
if (!EvtNextF(hResults, 1, hEvents, INFINITE, 0, &dwReturned)) {
|
||||
if (GetLastError() != ERROR_NO_MORE_ITEMS) {
|
||||
pandoraDebug ("EvtNext (initializeLogChannel) error: %d", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// If no events read, do not use bookmark to read all events
|
||||
if (dwReturned == 0) {
|
||||
pandoraDebug("No events found positionating bookmark.");
|
||||
EvtCloseF(hResults);
|
||||
return;
|
||||
}
|
||||
// Create the bookmar
|
||||
pandoraDebug("Creating bookmark to channel %s", this->source.c_str());
|
||||
hBookmark = EvtCreateBookmarkF(NULL);
|
||||
if (hBookmark == NULL) {
|
||||
pandoraDebug("EvtCreateBookmark (initializeLogChannel) failed %d", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hEvents[0]);
|
||||
return;
|
||||
}
|
||||
if (!EvtUpdateBookmarkF(hBookmark, hEvents[0])) {
|
||||
pandoraDebug("EvtUpdateBookmarkF (initializeLogChannel) failed %d", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hEvents[0]);
|
||||
EvtCloseF(hBookmark);
|
||||
return;
|
||||
}
|
||||
// Save the bookmark like an XML.
|
||||
this->updateBookmarkXML(hBookmark);
|
||||
|
||||
// Clean tasks
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
EvtCloseF(hEvents[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the bookmark XML. Returns false if fails
|
||||
*/
|
||||
bool
|
||||
Pandora_Module_Logchannel::updateBookmarkXML (EVT_HANDLE hBookmark) {
|
||||
LPWSTR pBookmarkXml = NULL;
|
||||
DWORD dwBufferSize = 0;
|
||||
DWORD dwBufferUsed = 0;
|
||||
DWORD dwPropertyCount = 0;
|
||||
DWORD status = 0;
|
||||
|
||||
if (!EvtRenderF(NULL, hBookmark, EvtRenderBookmark, dwBufferSize, pBookmarkXml, &dwBufferUsed, &dwPropertyCount)){
|
||||
if (ERROR_INSUFFICIENT_BUFFER == (status = GetLastError())){
|
||||
dwBufferSize = dwBufferUsed;
|
||||
pBookmarkXml = (LPWSTR)malloc(dwBufferSize);
|
||||
if (pBookmarkXml){
|
||||
EvtRenderF(NULL, hBookmark, EvtRenderBookmark, dwBufferSize, pBookmarkXml, &dwBufferUsed, &dwPropertyCount);
|
||||
}
|
||||
else{
|
||||
pandoraDebug("Error loading the bookmark. Cannot load enough memory");
|
||||
this->cleanBookmark();
|
||||
free(pBookmarkXml);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (ERROR_SUCCESS != (status = GetLastError())){
|
||||
pandoraDebug("EvtRender (updateBookmarkXML) failed with %d\n", GetLastError());
|
||||
this->cleanBookmark();
|
||||
free(pBookmarkXml);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this->bookmark_xml = pBookmarkXml;
|
||||
free(pBookmarkXml);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean the bookmark XML.
|
||||
*/
|
||||
void
|
||||
Pandora_Module_Logchannel::cleanBookmark () {
|
||||
this->bookmark_xml = L"";
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads available events from the event log.
|
||||
*/
|
||||
void
|
||||
Pandora_Module_Logchannel::getLogEvents (list<LogChannelList> &event_list) {
|
||||
EVT_HANDLE hResults = NULL;
|
||||
EVT_HANDLE hBookmark = NULL;
|
||||
EVT_HANDLE hEvents[1];
|
||||
EVT_HANDLE hContext = NULL;
|
||||
PEVT_VARIANT pRenderedValues = NULL;
|
||||
EVT_HANDLE hProviderMetadata = NULL;
|
||||
LPWSTR pwsMessage = NULL;
|
||||
LPWSTR ppValues[] = {L"Event/System/Provider/@Name", L"Event/System/TimeCreated/@SystemTime"};
|
||||
DWORD count = sizeof(ppValues)/sizeof(LPWSTR);
|
||||
DWORD dwReturned = 0;
|
||||
DWORD dwBufferSize = 0;
|
||||
DWORD dwBufferUsed = 0;
|
||||
DWORD dwPropertyCount = 0;
|
||||
DWORD status = ERROR_SUCCESS;
|
||||
SYSTEMTIME eventTime;
|
||||
FILETIME lft, ft;
|
||||
bool update_bookmark = false;
|
||||
|
||||
// An empty bookmark XML means that log cannot be open
|
||||
if (this->bookmark_xml.empty()) return;
|
||||
|
||||
// Open the event log with a query
|
||||
hResults = EvtQueryF (
|
||||
NULL,
|
||||
strAnsiToUnicode (this->source.c_str()).c_str(),
|
||||
this->filter.c_str(),
|
||||
EvtOpenChannelPath | EvtQueryForwardDirection
|
||||
);
|
||||
if (hResults == NULL) {
|
||||
pandoraDebug ("Could not open event log channel '%s'. Error: '%d'", this->source.c_str(), GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
|
||||
// Seek on the bookmark
|
||||
hBookmark = EvtCreateBookmarkF(this->bookmark_xml.c_str());
|
||||
if (hBookmark == NULL) {
|
||||
pandoraDebug("Cannot read the string bookmark. Error: %d.", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
if (!EvtSeekF(hResults, 1, hBookmark, 0, EvtSeekRelativeToBookmark)) {
|
||||
pandoraDebug("Cannot positionate the event at bookmark. Error %d.", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
|
||||
// Read events one by one
|
||||
hEvents[0] = NULL;
|
||||
while (EvtNextF(hResults, 1, hEvents, INFINITE, 0, &dwReturned)) {
|
||||
hContext = EvtCreateRenderContextF(count, (LPCWSTR*)ppValues, EvtRenderContextValues);
|
||||
if (NULL == hContext) {
|
||||
pandoraDebug ("EvtCreateRenderContext error: %d", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
EvtCloseF(hEvents[0]);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
|
||||
// Reinitialize the buffers
|
||||
dwBufferSize = 0;
|
||||
dwBufferUsed = 0;
|
||||
if (! EvtRenderF(hContext, hEvents[0], EvtRenderEventValues, dwBufferSize, pRenderedValues, &dwBufferUsed, &dwPropertyCount)) {
|
||||
if ((status = GetLastError()) == ERROR_INSUFFICIENT_BUFFER) {
|
||||
dwBufferSize = dwBufferUsed;
|
||||
pRenderedValues = (PEVT_VARIANT)malloc(dwBufferSize);
|
||||
if (pRenderedValues) {
|
||||
EvtRenderF(hContext, hEvents[0], EvtRenderEventValues, dwBufferSize, pRenderedValues, &dwBufferUsed, &dwPropertyCount);
|
||||
}
|
||||
else {
|
||||
pandoraDebug ("EvtRender error: %d", status);
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
EvtCloseF(hEvents[0]);
|
||||
EvtCloseF(hContext);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((status = GetLastError()) != ERROR_SUCCESS) {
|
||||
pandoraDebug ("EvtRender error getting buffer size: %d", status);
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
EvtCloseF(hEvents[0]);
|
||||
EvtCloseF(hContext);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the SYSTEMTIME of log
|
||||
ULONGLONG ullTimeStamp = pRenderedValues[1].FileTimeVal;
|
||||
ft.dwHighDateTime = (DWORD)((ullTimeStamp >> 32) & 0xFFFFFFFF);
|
||||
ft.dwLowDateTime = (DWORD)(ullTimeStamp & 0xFFFFFFFF);
|
||||
// Time format conversions
|
||||
if (!FileTimeToLocalFileTime(&ft, &lft)){
|
||||
pandoraDebug("UTC FILETIME to LOCAL FILETIME error: %d.", GetLastError());
|
||||
} else if (!FileTimeToSystemTime(&lft, &eventTime)){
|
||||
pandoraDebug("FILETIME to SYSTEMTIME error: %d.", GetLastError());
|
||||
}
|
||||
|
||||
// Get the handle to the provider's metadata that contains the message strings
|
||||
hProviderMetadata = EvtOpenPublisherMetadataF(NULL, pRenderedValues[0].StringVal, NULL, 0, 0);
|
||||
if (hProviderMetadata == NULL) {
|
||||
pandoraDebug ("EvtOpenPublisherMetadata error: %d", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
EvtCloseF(hEvents[0]);
|
||||
EvtCloseF(hContext);
|
||||
free(pRenderedValues);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
|
||||
// Read the event message
|
||||
pwsMessage = GetMessageString(hProviderMetadata, hEvents[0], EvtFormatMessageEvent);
|
||||
if (pwsMessage == NULL) {
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
EvtCloseF(hEvents[0]);
|
||||
EvtCloseF(hContext);
|
||||
free(pRenderedValues);
|
||||
EvtCloseF(hProviderMetadata);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the regex and save the message if pass the regex
|
||||
if (this->pattern.empty () || regexec (&this->regexp, strUnicodeToAnsi(pwsMessage).c_str (), 0, NULL, 0) == 0){
|
||||
// Save the event message
|
||||
LogChannelList event_item;
|
||||
event_item.message = strUnicodeToAnsi(pwsMessage);
|
||||
event_item.timestamp= eventTime;
|
||||
event_list.push_back (event_item);
|
||||
}
|
||||
|
||||
// Clean up some used vars
|
||||
EvtCloseF(hContext);
|
||||
free(pRenderedValues);
|
||||
EvtCloseF(hProviderMetadata);
|
||||
free(pwsMessage);
|
||||
|
||||
// Update the bookmark
|
||||
if (!EvtUpdateBookmarkF(hBookmark, hEvents[0])) {
|
||||
pandoraDebug("EvtUpdateBookmarkF (getLogEvents) failed %d", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
EvtCloseF(hEvents[0]);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
|
||||
// Cleanup current event and read the next log
|
||||
EvtCloseF(hEvents[0]);
|
||||
hEvents[0] = NULL;
|
||||
|
||||
// Information token to update bookmark
|
||||
update_bookmark = true;
|
||||
}
|
||||
status = GetLastError();
|
||||
if (status != ERROR_NO_MORE_ITEMS) {
|
||||
pandoraDebug ("EvtNext getLogEvents error: %d", GetLastError());
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
this->cleanBookmark();
|
||||
return;
|
||||
}
|
||||
|
||||
// Update bookmark if there is new events
|
||||
if (update_bookmark) this->updateBookmarkXML(hBookmark);
|
||||
|
||||
// Clean handlers
|
||||
EvtCloseF(hResults);
|
||||
EvtCloseF(hBookmark);
|
||||
}
|
||||
|
||||
// Gets the specified message string from the event. If the event does not
|
||||
// contain the specified message, the function returns NULL.
|
||||
// See http://msdn.microsoft.com/en-us/library/windows/desktop/dd996923(v=vs.85).aspx
|
||||
LPWSTR
|
||||
Pandora_Module_Logchannel::GetMessageString(EVT_HANDLE hMetadata, EVT_HANDLE hEvent, EVT_FORMAT_MESSAGE_FLAGS FormatId) {
|
||||
LPWSTR pBuffer = NULL;
|
||||
DWORD dwBufferSize = 0;
|
||||
DWORD dwBufferUsed = 0;
|
||||
DWORD status = 0;
|
||||
|
||||
if (!EvtFormatMessageF(hMetadata, hEvent, 0, 0, NULL, FormatId, dwBufferSize, pBuffer, &dwBufferUsed)) {
|
||||
status = GetLastError();
|
||||
if (ERROR_INSUFFICIENT_BUFFER == status) {
|
||||
// An event can contain one or more keywords. The function returns keywords
|
||||
// as a list of keyword strings. To process the list, you need to know the
|
||||
// size of the buffer, so you know when you have read the last string, or you
|
||||
// can terminate the list of strings with a second null terminator character
|
||||
// as this example does.
|
||||
if ((EvtFormatMessageKeyword == FormatId)) {
|
||||
pBuffer[dwBufferSize-1] = L'\0';
|
||||
}
|
||||
else {
|
||||
dwBufferSize = dwBufferUsed;
|
||||
}
|
||||
pBuffer = (LPWSTR)malloc(dwBufferSize * sizeof(WCHAR));
|
||||
|
||||
if (pBuffer) {
|
||||
EvtFormatMessageF(hMetadata, hEvent, 0, 0, NULL, FormatId, dwBufferSize, pBuffer, &dwBufferUsed);
|
||||
|
||||
// Add the second null terminator character.
|
||||
if ((EvtFormatMessageKeyword == FormatId)) {
|
||||
pBuffer[dwBufferUsed-1] = L'\0';
|
||||
}
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pandoraDebug ("EvtFormatMessage error: %d", status);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return pBuffer;
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
/* Pandora logchannel module. This module checks for log events that match a given
|
||||
pattern using XML functions provided by wevtapi.
|
||||
|
||||
Copyright (C) 2017 Artica ST.
|
||||
Written by Fermin Hernandez.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PANDORA_MODULE_LOGCHANNEL_H__
|
||||
#define __PANDORA_MODULE_LOGCHANNEL_H__
|
||||
|
||||
#include "pandora_module.h"
|
||||
#include "boost/regex.h"
|
||||
#include "../windows/winevt.h"
|
||||
|
||||
// Log event read buffer size
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
// Types for pointers to Wevtapi.dll functions
|
||||
typedef EVT_HANDLE WINAPI (*EvtQueryT) (EVT_HANDLE Session, LPCWSTR Path, LPCWSTR Query, DWORD Flags);
|
||||
typedef WINBOOL WINAPI (*EvtNextT) (EVT_HANDLE ResultSet, DWORD EventArraySize, EVT_HANDLE* EventArray, DWORD Timeout, DWORD Flags, PDWORD Returned);
|
||||
typedef WINBOOL WINAPI (*EvtSeekT) (EVT_HANDLE ResultSet, LONGLONG Position, EVT_HANDLE Bookmark, DWORD Timeout, DWORD Flags);
|
||||
typedef EVT_HANDLE WINAPI (*EvtCreateRenderContextT) (DWORD ValuePathsCount, LPCWSTR *ValuePaths, DWORD Flags);
|
||||
typedef WINBOOL WINAPI (*EvtRenderT) (EVT_HANDLE Context, EVT_HANDLE Fragment, DWORD Flags, DWORD BufferSize, PVOID Buffer, PDWORD BufferUsed, PDWORD PropertyCount);
|
||||
typedef WINBOOL WINAPI (*EvtCloseT) (EVT_HANDLE Object);
|
||||
typedef WINBOOL WINAPI (*EvtFormatMessageT) (EVT_HANDLE PublisherMetadata, EVT_HANDLE Event, DWORD MessageId, DWORD ValueCount, PEVT_VARIANT Values, DWORD Flags, DWORD BufferSize, LPWSTR Buffer, PDWORD BufferUsed);
|
||||
typedef EVT_HANDLE WINAPI (*EvtOpenPublisherMetadataT) (EVT_HANDLE Session, LPCWSTR PublisherIdentity, LPCWSTR LogFilePath, LCID Locale, DWORD Flags);
|
||||
typedef EVT_HANDLE WINAPI (*EvtCreateBookmarkT) (LPCWSTR BookmarkXml);
|
||||
typedef WINBOOL WINAPI (*EvtUpdateBookmarkT) (EVT_HANDLE Bookmark, EVT_HANDLE Event);
|
||||
|
||||
namespace Pandora_Modules {
|
||||
|
||||
/**
|
||||
* This module checks for log events that match a given
|
||||
* pattern. Events can be filtered by source and type.
|
||||
*/
|
||||
|
||||
class Pandora_Module_Logchannel : public Pandora_Module {
|
||||
struct LogChannelList {
|
||||
string message;
|
||||
SYSTEMTIME timestamp;
|
||||
};
|
||||
private:
|
||||
regex_t regexp;
|
||||
string source;
|
||||
string pattern;
|
||||
wstring filter;
|
||||
wstring bookmark_xml;
|
||||
HANDLE messages_dll;
|
||||
|
||||
void initializeLogChannel ();
|
||||
bool updateBookmarkXML (EVT_HANDLE hBookmark);
|
||||
void getLogEvents (list<LogChannelList> &event_list);
|
||||
void cleanBookmark ();
|
||||
LPWSTR GetMessageString(EVT_HANDLE hMetadata, EVT_HANDLE hEvent, EVT_FORMAT_MESSAGE_FLAGS FormatId);
|
||||
|
||||
public:
|
||||
Pandora_Module_Logchannel (string name, string source, string type, string id, string pattern);
|
||||
void run ();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -48,6 +48,7 @@ Pandora_Module_Proc::Pandora_Module_Proc (string name, string process_name)
|
|||
this->setKind (module_proc_str);
|
||||
|
||||
this->watchdog = false;
|
||||
this->user_session = false;
|
||||
this->start_command = "";
|
||||
this->retries = 3;
|
||||
this->start_delay = 5000;
|
||||
|
@ -95,6 +96,11 @@ Pandora_Module_Proc::getRetryDelay () const {
|
|||
return this->retry_delay;
|
||||
}
|
||||
|
||||
bool
|
||||
Pandora_Module_Proc::getUserSession () const {
|
||||
return this->user_session;
|
||||
}
|
||||
|
||||
void
|
||||
Pandora_Module_Proc::setWatchdog (bool watchdog) {
|
||||
this->watchdog = watchdog;
|
||||
|
@ -131,6 +137,11 @@ Pandora_Module_Proc::setRetryDelay (int mseconds) {
|
|||
this->retry_delay = mseconds;
|
||||
}
|
||||
|
||||
void
|
||||
Pandora_Module_Proc::setUserSession (bool usession) {
|
||||
this->user_session = usession;
|
||||
}
|
||||
|
||||
void
|
||||
async_run (Pandora_Module_Proc *module) {
|
||||
HANDLE *processes = NULL;
|
||||
|
@ -156,7 +167,7 @@ async_run (Pandora_Module_Proc *module) {
|
|||
}
|
||||
|
||||
Sleep (module->getRetryDelay ());
|
||||
Pandora_Wmi::runProgram (module->getStartCommand ());
|
||||
Pandora_Wmi::runProgram (module->getStartCommand (), NULL, module->getUserSession());
|
||||
Sleep (module->getStartDelay ());
|
||||
counter++;
|
||||
continue;
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace Pandora_Modules {
|
|||
string process_name;
|
||||
HANDLE thread;
|
||||
bool watchdog;
|
||||
bool user_session;
|
||||
string start_command;
|
||||
int retries;
|
||||
int start_delay;
|
||||
|
@ -46,12 +47,14 @@ namespace Pandora_Modules {
|
|||
int getRetries () const;
|
||||
int getStartDelay () const;
|
||||
int getRetryDelay () const;
|
||||
bool getUserSession () const;
|
||||
|
||||
void setWatchdog (bool watchdog);
|
||||
void setStartCommand (string command);
|
||||
void setRetries (int retries);
|
||||
void setStartDelay (int mseconds);
|
||||
void setRetryDelay (int mseconds);
|
||||
void setUserSession (bool usession);
|
||||
|
||||
void run ();
|
||||
};
|
||||
|
|
|
@ -124,7 +124,6 @@ async_run (Pandora_Module_Service *module) {
|
|||
// If time out and polling,
|
||||
// check the service status actively
|
||||
if (result == WAIT_TIMEOUT && polling) {
|
||||
pandoraLog("Timeout. Polling");
|
||||
module->execute_async_service(prev_res, module, modules);
|
||||
}
|
||||
continue;
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.713(Build 171009)")
|
||||
#define PANDORA_VERSION ("7.0NG.714(Build 171030)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.713(Build 171009))"
|
||||
VALUE "ProductVersion", "(7.0NG.714(Build 171030))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -369,16 +369,16 @@ Pandora_Wmi::getOSName () {
|
|||
dhGetValue (L"%s", &name, quickfix,
|
||||
L".Caption");
|
||||
|
||||
if (name != NULL) {
|
||||
// Remove the (R) character.
|
||||
for (int i = 0; i < strlen(name); i++) {
|
||||
if ((unsigned char)name[i] == 0xAE) {
|
||||
name[i] = ' ';
|
||||
}
|
||||
}
|
||||
ret = name;
|
||||
dhFreeString (name);
|
||||
}
|
||||
if (name != NULL) {
|
||||
// Remove the (R) character.
|
||||
for (int i = 0; i < strlen(name); i++) {
|
||||
if ((unsigned char)name[i] == 0xAE) {
|
||||
name[i] = ' ';
|
||||
}
|
||||
}
|
||||
ret = name;
|
||||
dhFreeString (name);
|
||||
}
|
||||
|
||||
} NEXT_THROW (quickfix);
|
||||
} catch (string errstr) {
|
||||
|
@ -411,12 +411,12 @@ Pandora_Wmi::getOSVersion () {
|
|||
L".CSDVersion");
|
||||
|
||||
if (version != NULL) {
|
||||
// Remove the (R) character.
|
||||
for (int i = 0; i < strlen(version); i++) {
|
||||
if ((unsigned char)version[i] == 0xAE) {
|
||||
version[i] = ' ';
|
||||
}
|
||||
}
|
||||
// Remove the (R) character.
|
||||
for (int i = 0; i < strlen(version); i++) {
|
||||
if ((unsigned char)version[i] == 0xAE) {
|
||||
version[i] = ' ';
|
||||
}
|
||||
}
|
||||
ret = version;
|
||||
dhFreeString (version);
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ Pandora_Wmi::getSystemName () {
|
|||
* @param flags Process creation flags
|
||||
*/
|
||||
bool
|
||||
Pandora_Wmi::runProgram (string command, DWORD flags) {
|
||||
Pandora_Wmi::runProgram (string command, DWORD flags, BOOL user_session) {
|
||||
PROCESS_INFORMATION process_info;
|
||||
STARTUPINFO startup_info;
|
||||
bool success;
|
||||
|
@ -514,11 +514,75 @@ Pandora_Wmi::runProgram (string command, DWORD flags) {
|
|||
startup_info.cb = sizeof (startup_info);
|
||||
ZeroMemory (&process_info, sizeof (process_info));
|
||||
|
||||
pandoraDebug ("Start process \"%s\".", command.c_str ());
|
||||
cmd = strdup (command.c_str ());
|
||||
success = CreateProcess (NULL, cmd, NULL, NULL, FALSE, flags,
|
||||
NULL, NULL, &startup_info, &process_info);
|
||||
pandoraFree (cmd);
|
||||
if (user_session) {
|
||||
DWORD sessionId = WTSGetActiveConsoleSessionId();
|
||||
startup_info.cb = sizeof(STARTUPINFO);
|
||||
startup_info.hStdError = 0;
|
||||
startup_info.hStdInput = 0;
|
||||
startup_info.hStdOutput = 0;
|
||||
if (
|
||||
startup_info.hStdError != 0
|
||||
|| startup_info.hStdInput != 0
|
||||
|| startup_info.hStdOutput != 0
|
||||
) {
|
||||
startup_info.dwFlags |= STARTF_USESTDHANDLES;
|
||||
}
|
||||
|
||||
HANDLE procHandle = GetCurrentProcess();
|
||||
HANDLE token, userToken;
|
||||
|
||||
// Tray to open the process
|
||||
if (OpenProcessToken(procHandle, TOKEN_DUPLICATE, &token) == 0) {
|
||||
pandoraDebug ("Open Process Token fails with error %d.", GetLastError());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Duplicate token
|
||||
if (DuplicateTokenEx(token,
|
||||
MAXIMUM_ALLOWED,
|
||||
0,
|
||||
SecurityImpersonation,
|
||||
TokenPrimary,
|
||||
&userToken) == 0) {
|
||||
pandoraDebug ("Duplicate token fails with error %d.", GetLastError());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set Token Information
|
||||
if (SetTokenInformation(userToken,
|
||||
(TOKEN_INFORMATION_CLASS)TokenSessionId,
|
||||
&sessionId,
|
||||
sizeof(sessionId)) == 0) {
|
||||
// Error 1314 will be thrown if agent is not running as service.
|
||||
if (GetLastError() != 1314) {
|
||||
pandoraDebug ("Set token information fails with error %d.", GetLastError());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
LPSTR command_exec = (LPSTR)command.c_str();
|
||||
|
||||
// Create Process As User
|
||||
// Changed inherit and command
|
||||
success = CreateProcessAsUser(
|
||||
userToken,
|
||||
0,
|
||||
command_exec,
|
||||
0,
|
||||
0,
|
||||
FALSE,
|
||||
flags,
|
||||
0,
|
||||
NULL,
|
||||
&startup_info,
|
||||
&process_info);
|
||||
} else {
|
||||
pandoraDebug ("Start process \"%s\".", command.c_str ());
|
||||
cmd = strdup (command.c_str ());
|
||||
success = CreateProcess (NULL, cmd, NULL, NULL, FALSE, flags,
|
||||
NULL, NULL, &startup_info, &process_info);
|
||||
pandoraFree (cmd);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
pandoraDebug ("The process \"%s\" was started.", command.c_str ());
|
||||
|
@ -949,7 +1013,7 @@ getIPs(VARIANT *ip_array){
|
|||
if (V_VT(&pvArray[i]) == VT_BSTR) {
|
||||
if (i > 0) {
|
||||
ret += " , ";
|
||||
}
|
||||
}
|
||||
LPSTR szStringA;
|
||||
ret += Pandora_Strutils::strUnicodeToAnsi( V_BSTR(&pvArray[i]));
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Pandora_Wmi {
|
|||
string getOSBuild ();
|
||||
string getSystemName ();
|
||||
string getSystemAddress ();
|
||||
bool runProgram (string command, DWORD flags = 0);
|
||||
bool runProgram (string command, DWORD flags = 0, BOOL user_session = false);
|
||||
bool startService (string service_name);
|
||||
bool stopService (string service_name);
|
||||
void runWMIQuery (string wmi_query,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.713-171009
|
||||
Version: 7.0NG.714-171030
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.713-171009"
|
||||
pandora_version="7.0NG.714-171030"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -66,11 +66,14 @@ function mainAgentsModules() {
|
|||
$modulegroup = get_parameter('modulegroup', 0);
|
||||
$refr = get_parameter('refresh', 0); // By default 30 seconds
|
||||
|
||||
$recursion = get_parameter('recursion', 0);
|
||||
$group_id = (int)get_parameter('group_id', 0);
|
||||
$offset = (int)get_parameter('offset', 0);
|
||||
$hor_offset = (int)get_parameter('hor_offset', 0);
|
||||
$block = $config['block_size'];
|
||||
if(get_parameter('modulegroup') != null){
|
||||
$agents_id = (array)get_parameter('id_agents2', -1);
|
||||
}
|
||||
$selection_a_m = (int)get_parameter('selection_agent_module');
|
||||
$modules_selected = (array)get_parameter('module', 0);
|
||||
$update_item = (string)get_parameter('edit_item','');
|
||||
|
@ -139,6 +142,8 @@ function mainAgentsModules() {
|
|||
$filter_groups_label = '<b>'.__('Group').'</b>';
|
||||
$filter_groups = html_print_select_groups(false, "AR", true, 'group_id', $group_id, '', '', '', true, false, true, '', false , 'width: auto;');
|
||||
|
||||
$filter_recursion_label = '<b>'.__('Recursion').'</b>';
|
||||
$filter_recursion = html_print_checkbox('recursion', 1, 0, true);
|
||||
//groups module
|
||||
$filter_module_groups_label = '<b>'.__('Module group').'</b>';
|
||||
$filter_module_groups = html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
|
||||
|
@ -245,12 +250,12 @@ function mainAgentsModules() {
|
|||
|
||||
if($config['pure'] != 1){
|
||||
echo '<form method="post" action="'
|
||||
. ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
||||
. ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
||||
|
||||
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
|
||||
echo "<tr>";
|
||||
echo "<td>" . $filter_groups_label . "</td>";
|
||||
echo "<td>" . $filter_groups . "</td>";
|
||||
echo "<td>" . $filter_groups ." ". $filter_recursion_label . $filter_recursion. "</td>";
|
||||
echo "<td></td>";
|
||||
echo "<td></td>";
|
||||
echo "<td>" . $filter_module_groups_label . "</td>";
|
||||
|
@ -375,9 +380,14 @@ function mainAgentsModules() {
|
|||
}
|
||||
|
||||
if ($group_id > 0) {
|
||||
$filter_groups['id_grupo'] = $group_id;
|
||||
if($recursion){
|
||||
$filter_groups['id_grupo'] = array_merge($group_id,
|
||||
groups_get_id_recursive($group_id, true));
|
||||
}
|
||||
else{
|
||||
$filter_groups['id_grupo'] = $group_id;
|
||||
}
|
||||
}
|
||||
|
||||
$agents = agents_get_agents ($filter_groups);
|
||||
$nagents = count($agents);
|
||||
|
||||
|
@ -675,12 +685,14 @@ $ignored_params['refresh']='';
|
|||
}
|
||||
|
||||
$("#group_id").change (function () {
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : this.value,
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_"
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents2").html('');
|
||||
|
@ -699,7 +711,34 @@ $ignored_params['refresh']='';
|
|||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
$("#checkbox-recursion").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : $("#group_id").val(),
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente"])
|
||||
.html (value["alias"]);
|
||||
$("#id_agents").append (option);
|
||||
$("#id_agents2").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#modulegroup").change (function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
|
|
|
@ -1,15 +1,3 @@
|
|||
|
||||
START TRANSACTION;
|
||||
|
||||
UPDATE `talert_commands`
|
||||
SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:
_field1_ as destination email address, and
_field2_ as subject for message. 
_field3_ as text of message. 
_field4_ as content type (text/plain or html/text).',
|
||||
`fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]',
|
||||
`fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]'
|
||||
WHERE id=1;
|
||||
|
||||
UPDATE `talert_actions`
|
||||
SET `field4` = 'text/html',
|
||||
`field4_recovery` = 'text/html'
|
||||
WHERE id = 1;
|
||||
|
||||
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
|
||||
COMMIT;
|
|
@ -1150,10 +1150,10 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
|
|||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 4);
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 7);
|
||||
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
|
||||
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '708');
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '714');
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tplanned_downtime_agents`
|
||||
|
@ -1183,6 +1183,7 @@ ALTER TABLE tusuario ADD COLUMN `id_filter` int(10) UNSIGNED NULL DEFAULT NULL;
|
|||
ALTER TABLE tusuario ADD CONSTRAINT `fk_id_filter` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter(`id_filter`) ON DELETE SET NULL;
|
||||
ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default '0';
|
||||
alter table tusuario add autorefresh_white_list text not null default '';
|
||||
ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL default '30';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
|
|
|
@ -191,7 +191,7 @@ config_check();
|
|||
$_GET['refr'] = null;
|
||||
}
|
||||
|
||||
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
|
||||
$select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
|
||||
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
|
||||
|
||||
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
|
||||
|
@ -389,7 +389,15 @@ config_check();
|
|||
$("#combo_refr").toggle ();
|
||||
$("#combo_refr").css('padding-right', '9px');
|
||||
href = $("a.autorefresh").attr ("href");
|
||||
$(document).attr ("location", href + "30");
|
||||
<?php
|
||||
if($select[0]['time_autorefresh']){
|
||||
?>
|
||||
var refresh = '<?php echo $select[0]["time_autorefresh"] ?>';
|
||||
$(document).attr ("location", href + refresh);
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ $order_collation = "";
|
|||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$order_collation = "";
|
||||
//$order_collation = "COLLATE utf8_general_ci";
|
||||
$order_collation = "COLLATE utf8_general_ci";
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
|
@ -540,10 +540,6 @@ if ($agents !== false) {
|
|||
}
|
||||
echo '<span class="left">';
|
||||
echo "<strong>";
|
||||
if ($agent['quiet']) {
|
||||
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
|
||||
echo " ";
|
||||
}
|
||||
|
||||
if (check_acl ($config["id_user"], $agent["id_grupo"], "AW")) {
|
||||
$main_tab = 'main';
|
||||
|
@ -562,8 +558,10 @@ if ($agents !== false) {
|
|||
"</a>";
|
||||
echo "</strong>";
|
||||
|
||||
$in_planned_downtime = db_get_value_filter('id', 'tplanned_downtime_agents', array('id_agent' => $agent["id_agente"]));
|
||||
|
||||
$in_planned_downtime = db_get_sql('SELECT executed FROM tplanned_downtime
|
||||
INNER JOIN tplanned_downtime_agents ON tplanned_downtime.id = tplanned_downtime_agents.id_downtime
|
||||
WHERE tplanned_downtime_agents.id_agent = '. $agent["id_agente"] . ' AND tplanned_downtime.executed = 1');
|
||||
|
||||
if ($agent["disabled"]) {
|
||||
ui_print_help_tip(__('Disabled'));
|
||||
|
||||
|
@ -571,6 +569,11 @@ if ($agents !== false) {
|
|||
echo "</em>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($agent['quiet']) {
|
||||
echo " ";
|
||||
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
|
||||
}
|
||||
|
||||
if ($in_planned_downtime) {
|
||||
ui_print_help_tip (__('Agent in planned downtime'), false, 'images/minireloj-16.png');
|
||||
|
|
|
@ -45,10 +45,10 @@ echo "<tr><td class='datos' style='width:20%; font-weight: bold;'>";
|
|||
echo __('Search') . ' ' .
|
||||
html_print_input_text ('search_string', $search_string, '', 15, 255, true);
|
||||
echo "</td>";
|
||||
echo "<td class='datos' style='width:20%'>";
|
||||
echo "<td class='datos' style='width:10%'>";
|
||||
html_print_submit_button (__('Filter'), 'filter', false, 'class="sub search"');
|
||||
echo "</td>";
|
||||
echo "<td class='datos' style='width:20%'></td>";
|
||||
echo "<td class='datos' style='width:10%'></td>";
|
||||
echo '</form>';
|
||||
// Check if there is at least one server of each type available to assign that
|
||||
// kind of modules. If not, do not show server type in combo
|
||||
|
@ -119,7 +119,7 @@ if (($policy_page) || (isset($agent))) {
|
|||
// Create module/type combo
|
||||
echo '<form id="create_module_type" method="post" action="'.$url.'">';
|
||||
if (!$policy_page) {
|
||||
echo '<td class="datos" style="font-weight: bold;">';
|
||||
echo '<td class="datos" style="font-weight: bold; width:20%;">';
|
||||
echo __('Show in hierachy mode');
|
||||
if ($checked == "true") {
|
||||
$checked = true;
|
||||
|
@ -130,12 +130,12 @@ if (($policy_page) || (isset($agent))) {
|
|||
html_print_checkbox ('status_hierachy_mode', "", $checked, false, false, "onChange=change_mod_filter();");
|
||||
echo '</td>';
|
||||
}
|
||||
echo '<td class="datos" style="font-weight: bold;">';
|
||||
echo '<td class="datos" style="font-weight: bold; width:20%;">';
|
||||
echo __("Type");
|
||||
html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' );
|
||||
html_print_input_hidden ('edit_module', 1);
|
||||
echo '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<td class="datos" style="width:10%;">';
|
||||
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
|
|
@ -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="350" height="200" style="padding:40px; padding-left: 100px; margin-bottom: 60px;"> </svg>';
|
||||
$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->colspan[4][2] = 2;
|
||||
$table_simple->rowspan[4][2] = 3;
|
||||
}
|
||||
|
@ -1323,8 +1323,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
|
|||
.attr("id", "legend_normal")
|
||||
.attr("x", 72)
|
||||
.attr("y", -30)
|
||||
.attr("width", 10)
|
||||
.attr("height", 10)
|
||||
.attr("width", '10px')
|
||||
.attr("height", '10px')
|
||||
.style("fill", "#82B92E");
|
||||
|
||||
//legend Warning text
|
||||
|
@ -1343,8 +1343,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
|
|||
.attr("id", "legend_warning")
|
||||
.attr("x", 168)
|
||||
.attr("y", -30)
|
||||
.attr("width", 10)
|
||||
.attr("height", 10)
|
||||
.attr("width", '10px')
|
||||
.attr("height", '10px')
|
||||
.style("fill", "#ffd731");
|
||||
|
||||
//legend Critical text
|
||||
|
@ -1363,8 +1363,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
|
|||
.attr("id", "legend_critical")
|
||||
.attr("x", 258)
|
||||
.attr("y", -30)
|
||||
.attr("width", 10)
|
||||
.attr("height", 10)
|
||||
.attr("width", '10px')
|
||||
.attr("height", '10px')
|
||||
.style("fill", "#fc4444");
|
||||
|
||||
//styles for number and axes
|
||||
|
@ -1382,8 +1382,8 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
|
|||
.attr("id", "warning_rect")
|
||||
.attr("x", 3)
|
||||
.attr("y", 0)
|
||||
.attr("width", 300)
|
||||
.attr("height", 200)
|
||||
.attr("width", '300px')
|
||||
.attr("height", '200px')
|
||||
.style("fill", "#82B92E");
|
||||
|
||||
//controls the inverse warning
|
||||
|
|
|
@ -165,26 +165,8 @@ if (is_ajax ()) {
|
|||
$rfield = $editor_type_chkbx;
|
||||
$rfield .= html_print_textarea ('field'.$i.'_recovery_value', 1, 1, '', 'class="fields_recovery"', true);
|
||||
}
|
||||
elseif(preg_match ("/^_content_type_$/i", $field_value)){
|
||||
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
|
||||
$editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true);
|
||||
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/plain', '', '', false, '', '', true);
|
||||
$editor_type_chkbx .= " ";
|
||||
$editor_type_chkbx .= __('Text/html') . " ";
|
||||
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/html', '', 'text/html', false, '', '', true);
|
||||
$editor_type_chkbx .= "</small></b></div>";
|
||||
$ffield = $editor_type_chkbx;
|
||||
|
||||
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
|
||||
$editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true);
|
||||
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/plain', '', '', false, '', '', true);
|
||||
$editor_type_chkbx .= " ";
|
||||
$editor_type_chkbx .= __('Text/html') . " ";
|
||||
$editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true);
|
||||
$editor_type_chkbx .= "</small></b></div>";
|
||||
$rfield = $editor_type_chkbx;
|
||||
// Select type
|
||||
}else {
|
||||
else {
|
||||
$fields_value_select = array();
|
||||
$fv = explode(';', $field_value);
|
||||
|
||||
|
|
|
@ -305,33 +305,8 @@ $(document).ready (function () {
|
|||
// Replace the old column with the new
|
||||
$table_macros_field.replaceWith(field_row);
|
||||
if (old_value != '' || old_recovery_value != '') {
|
||||
var inputType = $("[name=field" + i + "_value]").attr('type')
|
||||
if (inputType == 'radio') {
|
||||
if(old_value == 'text/plain'){
|
||||
if ($("[name=field" + i + "_value]").val() == 'text/plain') {
|
||||
$("[name=field" + i + "_value]").attr('checked','checked');
|
||||
}
|
||||
}
|
||||
else{
|
||||
if($("[name=field" + i + "_value]").val() == 'text/html') {
|
||||
$("[name=field" + i + "_value]").attr('checked','checked');
|
||||
}
|
||||
}
|
||||
if(old_recovery_value == 'text/plain'){
|
||||
if ($("[name=field" + i + "_recovery_value]").val() == 'text/plain') {
|
||||
$("[name=field" + i + "_recovery_value]").attr('checked','checked');
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($("[name=field" + i + "_recovery_value]").val() == 'text/html') {
|
||||
$("[name=field" + i + "_recovery_value]").attr('checked','checked');
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("[name=field" + i + "_value]").val(old_value);
|
||||
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
|
||||
}
|
||||
$("[name=field" + i + "_value]").val(old_value);
|
||||
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
|
||||
}
|
||||
else {
|
||||
$("[name=field" + i + "_value]")
|
||||
|
|
|
@ -600,7 +600,7 @@ $(document).ready (function () {
|
|||
var params = {
|
||||
"page" : "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json" : 1,
|
||||
"get_id_and_name" : 1,
|
||||
"get_distinct_name" : 1,
|
||||
"indexed" : 0,
|
||||
"privilege" : "AW"
|
||||
};
|
||||
|
@ -799,7 +799,6 @@ $(document).ready (function () {
|
|||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_modules"].agents[i].selected = false;
|
||||
document.forms["form_modules"].agents[0].selected = false;
|
||||
}
|
||||
}
|
||||
|
@ -815,7 +814,6 @@ $(document).ready (function () {
|
|||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_modules"].module[i].selected = false;
|
||||
document.forms["form_modules"].module[0].selected = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -741,7 +741,7 @@ $(document).ready (function () {
|
|||
var params = {
|
||||
"page" : "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json" : 1,
|
||||
"get_id_and_name" : 1,
|
||||
"get_distinct_name" : 1,
|
||||
"indexed" : 0
|
||||
};
|
||||
|
||||
|
@ -1098,7 +1098,6 @@ $(document).ready (function () {
|
|||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_edit"].agents[i].selected = false;
|
||||
document.forms["form_edit"].agents[0].selected = false;
|
||||
}
|
||||
}
|
||||
|
@ -1114,7 +1113,6 @@ $(document).ready (function () {
|
|||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_edit"].module[i].selected = false;
|
||||
document.forms["form_edit"].module[0].selected = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -304,17 +304,16 @@ if (check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0,
|
|||
$sub["godmode/setup/news"]["id"] = 'Site news';
|
||||
$sub["godmode/setup/file_manager"]["text"] = __('File manager');
|
||||
$sub["godmode/setup/file_manager"]["id"] = 'File manager';
|
||||
}
|
||||
|
||||
if (is_user_admin($config['id_user'])) {
|
||||
$sub["gdbman"]["text"] = __('Admin tools');
|
||||
$sub["gdbman"]["id"] = 'DB maintenance';
|
||||
$sub["gdbman"]["type"] = "direct";
|
||||
$sub["gdbman"]["subtype"] = "nolink";
|
||||
|
||||
$sub2 = array ();
|
||||
if(is_user_admin($config['id_user'])){
|
||||
$sub["extensions/db_status"]["text"] = __('DB Schema Check');
|
||||
$sub["extensions/db_status"]["id"] = 'DB Schema Check';
|
||||
$sub["extensions/db_status"]["sec"] = "gbman";
|
||||
$sub["extensions/dbmanager"]["text"] = __('DB Interface');
|
||||
$sub["extensions/dbmanager"]["id"] = 'DB Interface';
|
||||
$sub["extensions/dbmanager"]["sec"] = "gbman";
|
||||
}
|
||||
|
||||
$sub["gdbman"]["sub2"] = $sub2;
|
||||
}
|
||||
|
||||
$menu_godmode["gextensions"]["sub"] = $sub;
|
||||
|
@ -337,14 +336,10 @@ if (is_array ($config['extensions'])) {
|
|||
continue;
|
||||
}
|
||||
|
||||
$extmenu = $extension['godmode_menu'];
|
||||
|
||||
if ($extmenu["name"] == 'DB interface' && !is_user_admin($config['id_user'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($extmenu["name"] == 'DB Schema check' && !is_user_admin($config['id_user'])) {
|
||||
continue;
|
||||
if($extension['godmode_menu']['name'] != 'DB Schema check' && $extension['godmode_menu']['name'] != 'DB interface'){
|
||||
$extmenu = $extension['godmode_menu'];
|
||||
}
|
||||
|
||||
//Check the ACL for this user
|
||||
|
@ -363,6 +358,9 @@ if (is_array ($config['extensions'])) {
|
|||
if (strlen($extmenu['fatherId']) > 0) {
|
||||
if (array_key_exists('subfatherId',$extmenu)) {
|
||||
if (strlen($extmenu['subfatherId']) > 0) {
|
||||
if($extmenu['name'] = "DB schema check"){
|
||||
|
||||
}
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["text"] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["id"] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]["refr"] = 0;
|
||||
|
|
|
@ -473,8 +473,8 @@ $next_row++;
|
|||
.attr("id", "legend_normal")
|
||||
.attr("x", 72)
|
||||
.attr("y", -30)
|
||||
.attr("width", 10)
|
||||
.attr("height", 10)
|
||||
.attr("width", '10px')
|
||||
.attr("height", '10px')
|
||||
.style("fill", "#82B92E");
|
||||
|
||||
//legend Warning text
|
||||
|
|
|
@ -46,6 +46,9 @@ $delete_layout = (bool) get_parameter ('delete_layout');
|
|||
$refr = (int) get_parameter('refr', $config['vc_refr']);
|
||||
$offset = (int) get_parameter('offset', 0);
|
||||
$pagination = (int) get_parameter ("pagination", $config["block_size"]);
|
||||
$search = (string) get_parameter("search","");
|
||||
$ag_group = (int)get_parameter("ag_group",0);
|
||||
$recursion = get_parameter("recursion",0);
|
||||
|
||||
if ($delete_layout || $copy_layout) {
|
||||
// Visual console required
|
||||
|
@ -199,6 +202,50 @@ if ($delete_layout || $copy_layout) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($ag_group > 0) {
|
||||
|
||||
$ag_groups = array();
|
||||
$ag_groups = (array)$ag_group;
|
||||
if ($recursion) {
|
||||
$ag_groups = groups_get_id_recursive($ag_group, true);
|
||||
}
|
||||
}
|
||||
|
||||
echo "<table class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
|
||||
<tr>";
|
||||
if(!is_metaconsole()){
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=network&sec2=godmode/reporting/map_builder'>";
|
||||
} else {
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=screen&sec2=screens/screens&action=visualmap'>";
|
||||
}
|
||||
|
||||
echo "<td style='width:33%;'>";
|
||||
echo __('Search') . ' ';
|
||||
html_print_input_text ("search", $search, '', 50);
|
||||
|
||||
echo "</td>";
|
||||
echo "<td style='width:25%;'>";
|
||||
|
||||
echo __('Group') . ' ';
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "AW"))
|
||||
$return_all_group = false;
|
||||
else
|
||||
$return_all_group = true;
|
||||
html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
|
||||
|
||||
echo "<td style='width:25%;'>";
|
||||
echo __('Group Recursion') . ' ';
|
||||
html_print_checkbox ("recursion", 1, $recursion, false, false, 'this.form.submit()');
|
||||
|
||||
echo "</td><td style='width:22%;'>";
|
||||
echo "<input name='search_visual_console' type='submit' class='sub search' value='".__('Search')."'>";
|
||||
echo "</form>";
|
||||
echo "</td>";
|
||||
echo "</tr></table>";
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
|
@ -228,31 +275,69 @@ $table->align[4] = 'left';
|
|||
// or has "VR" privileges, otherwise show only maps of user group
|
||||
$filters['offset'] = $offset;
|
||||
$filters['limit'] = $pagination;
|
||||
if(!empty($search)){
|
||||
$filters['name'] = io_safe_input($search);
|
||||
}
|
||||
|
||||
if($ag_group){
|
||||
$filters['group'] = array_flip($ag_groups);
|
||||
}
|
||||
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
if (!defined('METACONSOLE')) {
|
||||
$url = 'index.php?sec=network&sec2=godmode/reporting/map_builder&pagination='.$pagination;
|
||||
$url = 'index.php?sec=network&sec2=godmode/reporting/map_builder&recursion='.$recursion.'&ag_group='.$ag_group.'&search='.$search.'&pagination='.$pagination;
|
||||
}
|
||||
else {
|
||||
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pagination='.$pagination;
|
||||
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&recursion='.$recursion.'&ag_group='.$ag_group.'&search='.$search.'&pagination='.$pagination;
|
||||
}
|
||||
if ($own_info['is_admin'] || $vconsoles_read) {
|
||||
$maps = visual_map_get_user_layouts (0,false,$filters);
|
||||
$total_maps = count(visual_map_get_user_layouts());
|
||||
if($ag_group){
|
||||
$maps = visual_map_get_user_layouts (0,false,$filters,false);
|
||||
unset($filters['offset']);
|
||||
unset($filters['limit']);
|
||||
$total_maps = count(visual_map_get_user_layouts(0,false,$filters,false));
|
||||
}else{
|
||||
$maps = visual_map_get_user_layouts (0,false,$filters);
|
||||
unset($filters['offset']);
|
||||
unset($filters['limit']);
|
||||
$total_maps = count(visual_map_get_user_layouts(0,false,$filters));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$maps = visual_map_get_user_layouts ($config['id_user'], false,
|
||||
$filters, false);
|
||||
unset($filters['offset']);
|
||||
unset($filters['limit']);
|
||||
$total_maps = count(visual_map_get_user_layouts ($config['id_user'], false,
|
||||
false, false));
|
||||
$filters, false));
|
||||
}
|
||||
if (!$maps && !is_metaconsole()) {
|
||||
require_once ($config['homedir'] . "/general/firts_task/map_builder.php");
|
||||
$total = count(visual_map_get_user_layouts ($config['id_user'], false,
|
||||
false, false));
|
||||
if(!$total){
|
||||
require_once ($config['homedir'] . "/general/firts_task/map_builder.php");
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
array(
|
||||
'no_close'=>false,
|
||||
'message'=> __('No available data to show')));
|
||||
}
|
||||
}
|
||||
elseif (!$maps && is_metaconsole()) {
|
||||
ui_print_info_message(
|
||||
array(
|
||||
'no_close'=>true,
|
||||
'message'=> __('There are no visual console defined yet.')));
|
||||
$total = count(visual_map_get_user_layouts ($config['id_user'], false,
|
||||
false, false));
|
||||
if(!$total){
|
||||
ui_print_info_message(
|
||||
array(
|
||||
'no_close'=>true,
|
||||
'message'=> __('There are no visual console defined yet.')));
|
||||
}else{
|
||||
ui_print_info_message(
|
||||
array(
|
||||
'no_close'=>false,
|
||||
'message'=> __('No available data to show')));
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
ui_pagination ($total_maps, $url, $offset, $pagination);
|
||||
|
|
|
@ -911,6 +911,9 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
elseif(check_acl ($config['id_user'], 0, "RM"))
|
||||
html_print_select_groups($config['id_user'],
|
||||
"RM", true, 'combo_group', $group, '');
|
||||
|
||||
echo " ".__('Recursion').html_print_checkbox('recursion', 1, 0, true);
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -2001,7 +2004,38 @@ $(document).ready (function () {
|
|||
"get_agents_group_json" : 1,
|
||||
"id_group" : this.value,
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_"
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents").html('');
|
||||
$("#id_agents2").html('');
|
||||
$("#module").html('');
|
||||
jQuery.each (data, function (id, value) {
|
||||
// Remove keys_prefix from the index
|
||||
id = id.substring(1);
|
||||
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value["id_agente"])
|
||||
.html (value["alias"]);
|
||||
$("#id_agents").append (option);
|
||||
$("#id_agents2").append (option);
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
$("#checkbox-recursion").change (
|
||||
function () {
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "operation/agentes/ver_agente",
|
||||
"get_agents_group_json" : 1,
|
||||
"id_group" : $("#combo_group").val(),
|
||||
"privilege" : "AW",
|
||||
"keys_prefix" : "_",
|
||||
"recursion" : $('#checkbox-recursion').is(':checked')
|
||||
},
|
||||
function (data, status) {
|
||||
$("#id_agents").html('');
|
||||
|
|
|
@ -1,3 +1,37 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
function check_all_checkboxes() {
|
||||
if ($("input[name=all_delete]").prop("checked")) {
|
||||
$(".check_delete").prop("checked", true);
|
||||
$('.check_delete').each(function(){
|
||||
$('.massive_report_form_elements').prop("disabled", false);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(".check_delete").prop("checked", false);
|
||||
$('.check_delete').each(function(){
|
||||
$('.massive_report_form_elements').prop("disabled", true);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
$('.check_delete').click(function(){
|
||||
$('.check_delete').each(function(){
|
||||
if($(this).prop( "checked" )){
|
||||
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
|
||||
}
|
||||
else{
|
||||
$('#hidden-id_report_'+$(this).val()).prop("disabled", true);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
|
@ -564,7 +598,8 @@ switch ($action) {
|
|||
$next++;
|
||||
if(!defined('METACONSOLE'))
|
||||
$table->head[$next] = '<span title="Operations">' .
|
||||
__('Op.') . '</span>';
|
||||
__('Op.') . '</span>'.html_print_checkbox('all_delete', 0, false, true, false,
|
||||
'check_all_checkboxes();');
|
||||
|
||||
//$table->size = array ();
|
||||
$table->size[$next] = '10%';
|
||||
|
@ -703,9 +738,13 @@ switch ($action) {
|
|||
$data[$next] .= '<form method="post" style="display:inline;" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
$data[$next] .= html_print_input_hidden ('id_report', $report['id_report'], true);
|
||||
$data[$next] .= html_print_input_hidden ('action','delete_report', true);
|
||||
$data[$next] .= html_print_input_image ('delete', 'images/cross.png', 1, '',
|
||||
$data[$next] .= html_print_input_image ('delete', 'images/cross.png', 1, 'margin-right: 10px;',
|
||||
true, array ('title' => __('Delete')));
|
||||
|
||||
$data[$next] .= html_print_checkbox_extended ('massive_report_check', $report['id_report'], false, false, '', 'class="check_delete"', true);
|
||||
|
||||
$data[$next] .= '</form>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -733,8 +772,19 @@ switch ($action) {
|
|||
else
|
||||
echo '<div class="action-buttons" style="width: 100%;">';
|
||||
html_print_submit_button (__('Create report'), 'create', false, 'class="sub next"');
|
||||
echo "</div>";
|
||||
|
||||
echo "</form>";
|
||||
echo '<form style="display:inline;" id="massive_report_form" method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=delete">';
|
||||
|
||||
foreach ($reports as $report) {
|
||||
echo '<input class="massive_report_form_elements" id="hidden-id_report_'.$report['id_report'].'" name="id_report[]" type="hidden" disabled value="'.$report['id_report'].'">';
|
||||
}
|
||||
|
||||
echo '<input id="hidden-action" name="action" type="hidden" value="delete_report">';
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete" style="margin-left:5px;"');
|
||||
echo '</form>';
|
||||
echo "</div>";
|
||||
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
@ -2059,3 +2109,4 @@ switch ($activeTab) {
|
|||
|
||||
enterprise_hook('close_meta_frame');
|
||||
?>
|
||||
|
||||
|
|
|
@ -201,7 +201,23 @@ echo "</form>";
|
|||
<script type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
var metaconsole = null;
|
||||
function is_metaconsole() {
|
||||
if (metaconsole === null)
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
if (metaconsole != 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
url_hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
$("#modsize").click(function(event){
|
||||
event.preventDefault();
|
||||
|
||||
|
@ -260,7 +276,7 @@ $(document).ready (function () {
|
|||
}
|
||||
else{
|
||||
original_image=new Image();
|
||||
original_image.src='images/console/background/'+$('#background').val();
|
||||
original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
|
||||
if (parseInt(original_image.width) < 1024){
|
||||
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
|
||||
$('input[name=width]').val('1024');
|
||||
|
@ -310,7 +326,7 @@ $(document).ready (function () {
|
|||
var size_changer_state = false;
|
||||
|
||||
$("#background").change(function() {
|
||||
$('#imagen2').attr('src','images/console/background/'+$('#background').val());
|
||||
$('#imagen2').attr('src', url_hack_metaconsole + 'images/console/background/'+$('#background').val());
|
||||
$('#imagen2').width(230);
|
||||
$('#imagen2').show();
|
||||
});
|
||||
|
@ -323,7 +339,7 @@ $(document).ready (function () {
|
|||
|
||||
$("#background").mouseout(function() {
|
||||
if(size_changer_state){
|
||||
$('#imagen').attr('src','images/console/background/'+$('#background').val());
|
||||
$('#imagen').attr('src',url_hack_metaconsole + 'images/console/background/'+$('#background').val());
|
||||
$('input[name=width]').val($('#imagen').width());
|
||||
$('input[name=height]').val($('#imagen').height());
|
||||
$('#preimagew').html($('#imagen').width());
|
||||
|
|
|
@ -128,23 +128,17 @@ function visual_map_main() {
|
|||
|
||||
// Begin - Background label color changer
|
||||
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).bind("contextmenu", function(e) {
|
||||
e.preventDefault();
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).bind('mousewheel', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
if($( "#text-label_ifr" ).contents().find( "body" ).css('background-color') == 'rgb(211, 211, 211)'){
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).css('background-color','white');
|
||||
}
|
||||
else{
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).css('background-color','lightgray');
|
||||
}
|
||||
});
|
||||
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).mousedown(function(e){
|
||||
if(e.which == 3)
|
||||
{
|
||||
if($( "#text-label_ifr" ).contents().find( "body" ).css('background-color') == 'rgb(211, 211, 211)'){
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).css('background-color','white');
|
||||
}
|
||||
else{
|
||||
$( "#text-label_ifr" ).contents().find( "body" ).css('background-color','lightgray');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// End - Background label color changer
|
||||
|
||||
$('#radiobtn0001').click(function(){
|
||||
|
@ -384,6 +378,12 @@ function update_button_palette_callback() {
|
|||
if (values['type_percentile'] == 'bubble') {
|
||||
setPercentileBubble(idItem, values);
|
||||
}
|
||||
else if (values['type_percentile'] == 'circular_progress_bar') {
|
||||
setPercentileCircular(idItem, values);
|
||||
}
|
||||
else if (values['type_percentile'] == 'interior_circular_progress_bar') {
|
||||
setPercentileInteriorCircular(idItem, values);
|
||||
}
|
||||
else {
|
||||
setPercentileBar(idItem, values);
|
||||
}
|
||||
|
@ -425,6 +425,17 @@ function update_button_palette_callback() {
|
|||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
setModuleGraph(idItem);
|
||||
break;
|
||||
case 'bars_graph':
|
||||
if($('input[name=width_percentile]').val() == ''){
|
||||
alert('Undefined width');
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#text_" + idItem).html(values['label']);
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
|
||||
setBarsGraph(idItem, values);
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
if($('input[name=width]').val() == ''){
|
||||
alert('Undefined width');
|
||||
|
@ -439,14 +450,12 @@ function update_button_palette_callback() {
|
|||
|
||||
setEventsBar(idItem, values);
|
||||
break;
|
||||
case 'donut_graph':
|
||||
$("#image_" + idItem).attr("src", "images/spinner.gif");
|
||||
|
||||
setDonutsGraph(idItem, values);
|
||||
break;
|
||||
case 'simple_value':
|
||||
//checkpoint
|
||||
// if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' ||
|
||||
// $('#text-label_ifr').contents().find('#tinymce').html() == '_VALUE_')
|
||||
// && $('#data_image_check').html() != 'On'){
|
||||
// alert('_VALUE_ exactly value is only enable for data image. Please change label text or select a data image module.');
|
||||
// return;
|
||||
// }
|
||||
$("#" + idItem).html(values['label']);
|
||||
if( (values['label'].replace( /<.*?>/g, '' ) != '_VALUE_')
|
||||
&& (values['label'].replace( /<.*?>/g, '' ) != '(_VALUE_)') ){
|
||||
|
@ -461,12 +470,7 @@ function update_button_palette_callback() {
|
|||
$("#" + idItem).html(
|
||||
'<table><tbody><tr><td></td></tr><tr><td><span style="" id="text_21" class="text">'+values["label"]+'</span></td></tr><tr><td></td></tr></tbody></table>'
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
//$("#simplevalue_" + idItem)
|
||||
//.html($('<img></img>').attr('src', "images/spinner.gif"));
|
||||
setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']);
|
||||
break;
|
||||
case 'label':
|
||||
|
@ -625,6 +629,7 @@ function readFields() {
|
|||
}
|
||||
}
|
||||
values['height'] = $("input[name=height]").val();
|
||||
values['bars_graph_type'] = $("select[name=bars_graph_type]").val();
|
||||
values['parent'] = $("select[name=parent]").val();
|
||||
values['map_linked'] = $("select[name=map_linked]").val();
|
||||
values['width_percentile'] = $("input[name=width_percentile]").val();
|
||||
|
@ -632,8 +637,12 @@ function readFields() {
|
|||
values['width_module_graph'] = $("input[name=width_module_graph]").val();
|
||||
values['height_module_graph'] = $("input[name=height_module_graph]").val();
|
||||
values['event_max_time_row'] = $("select[name=event_max_time_row]").val();
|
||||
values['type_percentile'] = $("input[name=type_percentile]:checked").val();
|
||||
values['value_show'] = $("input[name=value_show]:checked").val();
|
||||
values['type_percentile'] = $("select[name=type_percentile]").val();
|
||||
values['percentile_color'] = $("input[name=percentile_color]").val();
|
||||
values['percentile_label_color'] = $("input[name=percentile_label_color]").val();
|
||||
values['percentile_label'] = $("input[name=percentile_label]").val();
|
||||
values['value_show'] = $("select[name=value_show]").val();
|
||||
|
||||
values['enable_link'] = $("input[name=enable_link]").is(':checked') ? 1 : 0;
|
||||
values['id_group'] = $("select[name=group]").val();
|
||||
values['id_custom_graph'] = parseInt(
|
||||
|
@ -708,8 +717,10 @@ function create_button_palette_callback() {
|
|||
alert($("#message_alert_no_agent").html());
|
||||
validate = false;
|
||||
}
|
||||
if ((values['module'] == 0)) {
|
||||
alert($("#message_alert_no_module").html());
|
||||
break;
|
||||
case 'donut_graph':
|
||||
if ((values['agent'] == '')) {
|
||||
alert($("#message_alert_no_agent").html());
|
||||
validate = false;
|
||||
}
|
||||
break;
|
||||
|
@ -780,6 +791,16 @@ function create_button_palette_callback() {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 'bars_graph':
|
||||
if ((values['agent'] == '')) {
|
||||
alert($("#message_alert_no_agent").html());
|
||||
validate = false;
|
||||
}
|
||||
if ((values['module'] == 0)) {
|
||||
alert($("#message_alert_no_module").html());
|
||||
validate = false;
|
||||
}
|
||||
break;
|
||||
case 'simple_value':
|
||||
if ((values['agent'] == '')) {
|
||||
alert($("#message_alert_no_agent").html());
|
||||
|
@ -981,6 +1002,7 @@ function toggle_item_palette() {
|
|||
|
||||
activeToolboxButton('static_graph', true);
|
||||
activeToolboxButton('module_graph', true);
|
||||
activeToolboxButton('bars_graph', true);
|
||||
activeToolboxButton('simple_value', true);
|
||||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
|
@ -989,6 +1011,7 @@ function toggle_item_palette() {
|
|||
activeToolboxButton('box_item', true);
|
||||
activeToolboxButton('line_item', true);
|
||||
activeToolboxButton('auto_sla_graph', true);
|
||||
activeToolboxButton('donut_graph', true);
|
||||
|
||||
if (typeof(enterprise_activeToolboxButton) == 'function') {
|
||||
enterprise_activeToolboxButton(true);
|
||||
|
@ -1008,7 +1031,9 @@ function toggle_item_palette() {
|
|||
|
||||
activeToolboxButton('static_graph', false);
|
||||
activeToolboxButton('module_graph', false);
|
||||
activeToolboxButton('bars_graph', false);
|
||||
activeToolboxButton('auto_sla_graph', false);
|
||||
activeToolboxButton('donut_graph', false);
|
||||
activeToolboxButton('simple_value', false);
|
||||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
|
@ -1281,16 +1306,21 @@ function loadFieldsFromDB(item) {
|
|||
$("input[name=width_module_graph]").val(val);
|
||||
if (key == 'height_module_graph')
|
||||
$("input[name=height_module_graph]").val(val);
|
||||
|
||||
if (key == 'type_percentile') {
|
||||
if (val == 'percentile') {
|
||||
$("input[name=type_percentile][value=percentile]")
|
||||
.attr("checked", "checked");
|
||||
}
|
||||
else {
|
||||
$("input[name=type_percentile][value=bubble]")
|
||||
.attr("checked", "checked");
|
||||
}
|
||||
if (key == 'bars_graph_type')
|
||||
$("select[name=bars_graph_type]").val(val);
|
||||
if (key == 'type_percentile')
|
||||
$("select[name=type_percentile]").val(val);
|
||||
if (key == 'percentile_label')
|
||||
$("input[name=percentile_label]").val(val);
|
||||
if (key == 'percentile_color') {
|
||||
$("input[name=percentile_color]").val(val);
|
||||
$("#percentile_item_row_5 .ColorPickerDivSample")
|
||||
.css('background-color', val);
|
||||
}
|
||||
if (key == 'percentile_label_color') {
|
||||
$("input[name=percentile_label_color]").val(val);
|
||||
$("#percentile_item_row_6 .ColorPickerDivSample")
|
||||
.css('background-color', val);
|
||||
}
|
||||
|
||||
if (key == 'value_show') {
|
||||
|
@ -1526,6 +1556,15 @@ function hiddenFields(item) {
|
|||
$("#percentile_item_row_4").css('display', 'none');
|
||||
$("#percentile_item_row_4." + item).css('display', '');
|
||||
|
||||
$("#percentile_item_row_5").css('display', 'none');
|
||||
$("#percentile_item_row_5." + item).css('display', '');
|
||||
|
||||
$("#percentile_item_row_6").css('display', 'none');
|
||||
$("#percentile_item_row_6." + item).css('display', '');
|
||||
|
||||
$("#percentile_bar_row_7").css('display', 'none');
|
||||
$("#percentile_bar_row_7." + item).css('display', '');
|
||||
|
||||
$("#period_row").css('display', 'none');
|
||||
$("#period_row." + item).css('display', '');
|
||||
|
||||
|
@ -1541,6 +1580,9 @@ function hiddenFields(item) {
|
|||
$("#module_graph_size_row").css('display', 'none');
|
||||
$("#module_graph_size_row." + item).css('display', '');
|
||||
|
||||
$("#bars_graph_type").css('display', 'none');
|
||||
$("#bars_graph_type." + item).css('display', '');
|
||||
|
||||
$("#background_color").css('display', 'none');
|
||||
$("#background_color." + item).css('display', '');
|
||||
|
||||
|
@ -1615,6 +1657,11 @@ function cleanFields(item) {
|
|||
$("input[name='fill_color']").val('#ffffff');
|
||||
$("input[name='line_width']").val(3);
|
||||
$("input[name='line_color']").val('#000000');
|
||||
$("select[name=type_percentile]").val('');
|
||||
$("input[name=percentile_color]").val('');
|
||||
$("input[name=percentile_label_color]").val('');
|
||||
$("input[name=percentile_label]").val('');
|
||||
$(".ColorPickerDivSample").css('background-color', '#FFF');
|
||||
|
||||
|
||||
$("#preview").empty();
|
||||
|
@ -1757,6 +1804,60 @@ function set_image(type, idElement, image) {
|
|||
});
|
||||
}
|
||||
|
||||
function setBarsGraph(id_data, values) {
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
url_hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
width_percentile = values['width_percentile'];
|
||||
|
||||
parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "get_module_type_string"});
|
||||
parameter.push ({name: "id_agent", value: values['id_agent']});
|
||||
parameter.push ({name: "module", value: values['module']});
|
||||
parameter.push ({name: "id_element", value: id_data});
|
||||
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
||||
jQuery.ajax({
|
||||
url: get_url_ajax(),
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data['no_data'] == true) {
|
||||
if (values['width_percentile'] == "0") {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras-no.png');
|
||||
}
|
||||
else {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras-no.png');
|
||||
$("#" + id_data + " img").css('width', width_percentile + 'px');
|
||||
$("#" + id_data + " img").css('height', width_percentile + 'px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras.png');
|
||||
|
||||
if (values['width_percentile'] == "0") {
|
||||
// Image size
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('width', width_percentile+'px');
|
||||
$("#" + id_data + " img").css('height', width_percentile+'px');
|
||||
}
|
||||
}
|
||||
|
||||
if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){
|
||||
$('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2);
|
||||
}
|
||||
else{
|
||||
$('#'+id_data+ ' img').css('margin-left', parseInt($('#'+id_data).css('width'))/2 - parseInt($('#'+id_data+ ' img').css('width'))/2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setModuleGraph(id_data) {
|
||||
var parameter = Array();
|
||||
|
||||
|
@ -1932,7 +2033,7 @@ function setPercentileBar(id_data, values) {
|
|||
|
||||
$("#"+ id_data).attr('src', img);
|
||||
|
||||
$("#" + id_data + " img").attr('src', 'images/console/signes/percentil.png');
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/percentil.png');
|
||||
if($('#text-width_percentile').val() == 0){
|
||||
$("#" + id_data + " img").css('width', '130px');
|
||||
}
|
||||
|
@ -1955,6 +2056,142 @@ function setPercentileBar(id_data, values) {
|
|||
});
|
||||
}
|
||||
|
||||
function setPercentileCircular (id_data, values) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
url_hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
max_percentile = values['max_percentile'];
|
||||
width_percentile = values['width_percentile'];
|
||||
|
||||
var parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "get_module_value"});
|
||||
parameter.push ({name: "id_element", value: id_data});
|
||||
parameter.push ({name: "value_show", value: values['value_show']});
|
||||
parameter.push ({name: "id_visual_console",
|
||||
value: id_visual_console});
|
||||
jQuery.ajax({
|
||||
url: get_url_ajax(),
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
module_value = data['value'];
|
||||
max_percentile = data['max_percentile'];
|
||||
width_percentile = data['width_percentile'];
|
||||
unit_text = false;
|
||||
|
||||
if ((data['unit_text'] != false) || typeof(data['unit_text']) != 'boolean') {
|
||||
unit_text = data['unit_text'];
|
||||
}
|
||||
|
||||
colorRGB = data['colorRGB'];
|
||||
|
||||
if ( max_percentile > 0)
|
||||
var percentile = Math.round(module_value / max_percentile * 100);
|
||||
else
|
||||
var percentile = 100;
|
||||
|
||||
if (unit_text == false && typeof(unit_text) == 'boolean') {
|
||||
value_text = percentile + "%";
|
||||
}
|
||||
else {
|
||||
value_text = module_value + " " + unit_text;
|
||||
}
|
||||
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/circular-progress-bar.png');
|
||||
if($('#text-width_percentile').val() == 0){
|
||||
$("#" + id_data + " img").css('width', '130px');
|
||||
$("#" + id_data + " img").css('height', '130px');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('width', $('#text-width_percentile').val()+'px');
|
||||
$("#" + id_data + " img").css('height', $('#text-width_percentile').val()+'px');
|
||||
}
|
||||
|
||||
if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){
|
||||
$('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2);
|
||||
}
|
||||
else{
|
||||
$('#'+id_data+ ' img').css('margin-left',parseInt($('#'+id_data).css('width'))/2 - parseInt($('#'+id_data+ ' img').css('width'))/2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setPercentileInteriorCircular (id_data, values) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
url_hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
max_percentile = values['max_percentile'];
|
||||
width_percentile = values['width_percentile'];
|
||||
|
||||
var parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "get_module_value"});
|
||||
parameter.push ({name: "id_element", value: id_data});
|
||||
parameter.push ({name: "value_show", value: values['value_show']});
|
||||
parameter.push ({name: "id_visual_console",
|
||||
value: id_visual_console});
|
||||
jQuery.ajax({
|
||||
url: get_url_ajax(),
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
module_value = data['value'];
|
||||
max_percentile = data['max_percentile'];
|
||||
width_percentile = data['width_percentile'];
|
||||
unit_text = false;
|
||||
|
||||
if ((data['unit_text'] != false) || typeof(data['unit_text']) != 'boolean') {
|
||||
unit_text = data['unit_text'];
|
||||
}
|
||||
|
||||
colorRGB = data['colorRGB'];
|
||||
|
||||
if ( max_percentile > 0)
|
||||
var percentile = Math.round(module_value / max_percentile * 100);
|
||||
else
|
||||
var percentile = 100;
|
||||
|
||||
if (unit_text == false && typeof(unit_text) == 'boolean') {
|
||||
value_text = percentile + "%";
|
||||
}
|
||||
else {
|
||||
value_text = module_value + " " + unit_text;
|
||||
}
|
||||
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/circular-progress-bar-interior.png');
|
||||
if($('#text-width_percentile').val() == 0){
|
||||
$("#" + id_data + " img").css('width', '130px');
|
||||
$("#" + id_data + " img").css('height', '130px');
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('width', $('#text-width_percentile').val()+'px');
|
||||
$("#" + id_data + " img").css('height', $('#text-width_percentile').val()+'px');
|
||||
}
|
||||
|
||||
if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){
|
||||
$('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2);
|
||||
}
|
||||
else{
|
||||
$('#'+id_data+ ' img').css('margin-left',parseInt($('#'+id_data).css('width'))/2 - parseInt($('#'+id_data+ ' img').css('width'))/2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setEventsBar(id_data, values) {
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
|
@ -2004,6 +2241,53 @@ function setEventsBar(id_data, values) {
|
|||
});
|
||||
}
|
||||
|
||||
function setDonutsGraph (id_data, values) {
|
||||
var url_hack_metaconsole = '';
|
||||
if (is_metaconsole()) {
|
||||
url_hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
width_percentile = values['width_percentile'];
|
||||
|
||||
parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
parameter.push ({name: "action", value: "get_module_type_string"});
|
||||
parameter.push ({name: "id_agent", value: values['id_agent']});
|
||||
parameter.push ({name: "module", value: values['module']});
|
||||
parameter.push ({name: "id_element", value: id_data});
|
||||
parameter.push ({name: "id_visual_console", value: id_visual_console});
|
||||
jQuery.ajax({
|
||||
url: get_url_ajax(),
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data['no_data'] == true) {
|
||||
if (values['width'] == "0") {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/wrong_donut_graph.png');
|
||||
}
|
||||
else {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/wrong_donut_graph.png');
|
||||
$("#" + id_data + " img").css('width', width_percentile + 'px');
|
||||
$("#" + id_data + " img").css('height', width_percentile + 'px');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/donut-graph.png');
|
||||
|
||||
if($('#text-width').val() == 0 || $('#text-height').val() == 0){
|
||||
// Image size
|
||||
}
|
||||
else{
|
||||
$("#" + id_data + " img").css('width', $('#text-width_percentile').val()+'px');
|
||||
$("#" + id_data + " img").css('height', $('#text-width_percentile').val()+'px');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setPercentileBubble(id_data, values) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
|
@ -2055,7 +2339,7 @@ function setPercentileBubble(id_data, values) {
|
|||
|
||||
$("#image_" + id_data).attr('src', img);
|
||||
|
||||
$("#" + id_data + " img").attr('src', 'images/console/signes/percentil_bubble.png');
|
||||
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/percentil_bubble.png');
|
||||
|
||||
|
||||
if($('#text-width_percentile').val() == 0){
|
||||
|
@ -2362,6 +2646,16 @@ function createItem(type, values, id_data) {
|
|||
|
||||
setEventsBar(id_data, values);
|
||||
break;
|
||||
case 'donut_graph':
|
||||
var sizeStyle = '';
|
||||
var imageSize = '';
|
||||
item = $('<div id="' + id_data + '" class="item donut_graph" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
setDonutsGraph(id_data, values);
|
||||
break;
|
||||
case 'percentile_bar':
|
||||
case 'percentile_item':
|
||||
var sizeStyle = '';
|
||||
|
@ -2403,9 +2697,77 @@ function createItem(type, values, id_data) {
|
|||
|
||||
setPercentileBar(id_data, values);
|
||||
}
|
||||
else if (values['type_percentile'] == 'circular_progress_bar') {
|
||||
if(values['label_position'] == 'up'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'down'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
}
|
||||
else if(values['label_position'] == 'right'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" style="float:left;" />' +
|
||||
'<table style="float:left;height:'+values['height']+'px"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
}
|
||||
else if(values['label_position'] == 'left'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" style="float:right;"/>' +
|
||||
'<table style="float:left;height:'+values['height']+'px"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
setPercentileCircular(id_data, values);
|
||||
}
|
||||
else if (values['type_percentile'] == 'interior_circular_progress_bar') {
|
||||
if(values['label_position'] == 'up'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'down'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
}
|
||||
else if(values['label_position'] == 'right'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" style="float:left;" />' +
|
||||
'<table style="float:left;height:'+values['height']+'px"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
}
|
||||
else if(values['label_position'] == 'left'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" style="float:right;"/>' +
|
||||
'<table style="float:left;height:'+values['height']+'px"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
setPercentileInteriorCircular(id_data, values);
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
if(values['label_position'] == 'up'){
|
||||
item = $('<div id="' + id_data + '" class="item percentile_item" style="text-align: left; position: absolute; display: inline-block; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
|
@ -2473,6 +2835,42 @@ function createItem(type, values, id_data) {
|
|||
|
||||
setModuleGraph(id_data);
|
||||
break;
|
||||
case 'bars_graph':
|
||||
sizeStyle = '';
|
||||
imageSize = '';
|
||||
|
||||
if(values['label_position'] == 'up'){
|
||||
item = $('<div id="' + id_data + '" class="item module_graph" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'down'){
|
||||
item = $('<div id="' + id_data + '" class="item module_graph" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'left'){
|
||||
item = $('<div id="' + id_data + '" class="item module_graph" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img style="float:right" class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table style="float:left;height:'+values['height_module_graph']+'px;"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
else if(values['label_position'] == 'right'){
|
||||
item = $('<div id="' + id_data + '" class="item module_graph" style="text-align: left; position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
|
||||
'<img style="float:left" class="image" id="image_' + id_data + '" src="images/spinner.gif" />' +
|
||||
'<table style="float:right;height:'+values['height_module_graph']+'px;"><tr><td></td></tr><tr><td><span id="text_' + id_data + '" class="text">' + values['label'] + '</span></td></tr><tr><td></td></tr></table>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
setBarsGraph(id_data, values);
|
||||
break;
|
||||
case 'simple_value':
|
||||
sizeStyle = '';
|
||||
imageSize = '';
|
||||
|
@ -2692,7 +3090,9 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
|||
case 'label':
|
||||
case 'icon':
|
||||
case 'module_graph':
|
||||
case 'bars_graph':
|
||||
case 'auto_sla_graph':
|
||||
case 'donut_graph':
|
||||
if (type == 'simple_value') {
|
||||
setModuleValue(idElement,
|
||||
values.process_simple_value,
|
||||
|
@ -2913,9 +3313,6 @@ function updateDB(type, idElement , values, event) {
|
|||
}
|
||||
|
||||
function copyDB(idItem) {
|
||||
|
||||
console.log(idItem);
|
||||
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
|
||||
parameter = Array();
|
||||
|
@ -3107,6 +3504,15 @@ function eventsItems(drag) {
|
|||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('donut_graph')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'donut_graph';
|
||||
idItem = $(divParent).attr('id');
|
||||
activeToolboxButton('copy_item', true);
|
||||
activeToolboxButton('edit_item', true);
|
||||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('group_item')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'group_item';
|
||||
|
@ -3134,6 +3540,15 @@ function eventsItems(drag) {
|
|||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('bars_graph')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'bars_graph';
|
||||
idItem = $(divParent).attr('id');
|
||||
activeToolboxButton('copy_item', true);
|
||||
activeToolboxButton('edit_item', true);
|
||||
activeToolboxButton('delete_item', true);
|
||||
activeToolboxButton('show_grid', false);
|
||||
}
|
||||
if ($(divParent).hasClass('simple_value')) {
|
||||
creationItem = null;
|
||||
selectedItem = 'simple_value';
|
||||
|
@ -3307,6 +3722,9 @@ function eventsItems(drag) {
|
|||
if ($(event.target).hasClass('auto_sla_graph')) {
|
||||
selectedItem = 'auto_sla_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('donut_graph')) {
|
||||
selectedItem = 'donut_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('group_item')) {
|
||||
selectedItem = 'group_item';
|
||||
}
|
||||
|
@ -3316,6 +3734,9 @@ function eventsItems(drag) {
|
|||
if ($(event.target).hasClass('module_graph')) {
|
||||
selectedItem = 'module_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('bars_graph')) {
|
||||
selectedItem = 'bars_graph';
|
||||
}
|
||||
if ($(event.target).hasClass('simple_value')) {
|
||||
selectedItem = 'simple_value';
|
||||
}
|
||||
|
@ -3371,8 +3792,6 @@ function eventsItems(drag) {
|
|||
}
|
||||
}
|
||||
else{
|
||||
console.log('Dragstart');
|
||||
|
||||
multiDragStart(event);
|
||||
|
||||
}
|
||||
|
@ -3389,8 +3808,6 @@ function eventsItems(drag) {
|
|||
updateDB(selectedItem, idItem, values, 'dragstop');
|
||||
}
|
||||
else{
|
||||
|
||||
console.log('Dragstop');
|
||||
multidragStop(event);
|
||||
}
|
||||
});
|
||||
|
@ -3478,10 +3895,6 @@ function eventsItems(drag) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log('Drag');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3627,10 +4040,18 @@ function click_button_toolbox(id) {
|
|||
toolbuttonActive = creationItem = 'module_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'bars_graph':
|
||||
toolbuttonActive = creationItem = 'bars_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'auto_sla_graph':
|
||||
toolbuttonActive = creationItem = 'auto_sla_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'donut_graph':
|
||||
toolbuttonActive = creationItem = 'donut_graph';
|
||||
toggle_item_palette();
|
||||
break;
|
||||
case 'simple_value':
|
||||
toolbuttonActive = creationItem = 'simple_value';
|
||||
toggle_item_palette();
|
||||
|
@ -3682,12 +4103,14 @@ function click_button_toolbox(id) {
|
|||
activeToolboxButton('static_graph', false);
|
||||
activeToolboxButton('percentile_item', false);
|
||||
activeToolboxButton('module_graph', false);
|
||||
activeToolboxButton('bars_graph', false);
|
||||
activeToolboxButton('simple_value', false);
|
||||
activeToolboxButton('label', false);
|
||||
activeToolboxButton('icon', false);
|
||||
activeToolboxButton('service', false);
|
||||
activeToolboxButton('group_item', false);
|
||||
activeToolboxButton('auto_sla_graph', false);
|
||||
activeToolboxButton('donut_graph', false);
|
||||
activeToolboxButton('copy_item', false);
|
||||
activeToolboxButton('edit_item', false);
|
||||
activeToolboxButton('delete_item', false);
|
||||
|
@ -3713,11 +4136,13 @@ function click_button_toolbox(id) {
|
|||
activeToolboxButton('static_graph', true);
|
||||
activeToolboxButton('percentile_item', true);
|
||||
activeToolboxButton('module_graph', true);
|
||||
activeToolboxButton('bars_graph', true);
|
||||
activeToolboxButton('simple_value', true);
|
||||
activeToolboxButton('label', true);
|
||||
activeToolboxButton('icon', true);
|
||||
activeToolboxButton('group_item', true);
|
||||
activeToolboxButton('auto_sla_graph', true);
|
||||
activeToolboxButton('donut_graph', true);
|
||||
}
|
||||
break;
|
||||
case 'save_visualmap':
|
||||
|
|
|
@ -196,11 +196,18 @@ ui_require_javascript_file ('encode_decode_base64');
|
|||
"10pt=.visual_font_size_10pt, " +
|
||||
"12pt=.visual_font_size_12pt, " +
|
||||
"14pt=.visual_font_size_14pt, " +
|
||||
"18pt=.visual_font_size_18pt, " +
|
||||
"24pt=.visual_font_size_24pt, " +
|
||||
"28pt=.visual_font_size_28pt, " +
|
||||
"36pt=.visual_font_size_36pt, " +
|
||||
"48pt=.visual_font_size_48pt, " +
|
||||
"60pt=.visual_font_size_60pt, " +
|
||||
"72pt=.visual_font_size_72pt, " +
|
||||
"84pt=.visual_font_size_84pt, " +
|
||||
"96pt=.visual_font_size_96pt, " +
|
||||
"116pt=.visual_font_size_116pt, " +
|
||||
"128pt=.visual_font_size_128pt, " +
|
||||
"140pt=.visual_font_size_140pt, " +
|
||||
"154pt=.visual_font_size_154pt, " +
|
||||
"196pt=.visual_font_size_196pt",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
|
|
|
@ -602,11 +602,18 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
|||
"10pt=.visual_font_size_10pt, " +
|
||||
"12pt=.visual_font_size_12pt, " +
|
||||
"14pt=.visual_font_size_14pt, " +
|
||||
"18pt=.visual_font_size_18pt, " +
|
||||
"24pt=.visual_font_size_24pt, " +
|
||||
"28pt=.visual_font_size_28pt, " +
|
||||
"36pt=.visual_font_size_36pt, " +
|
||||
"48pt=.visual_font_size_48pt, " +
|
||||
"60pt=.visual_font_size_60pt, " +
|
||||
"72pt=.visual_font_size_72pt, " +
|
||||
"84pt=.visual_font_size_84pt, " +
|
||||
"96pt=.visual_font_size_96pt, " +
|
||||
"116pt=.visual_font_size_116pt, " +
|
||||
"128pt=.visual_font_size_128pt, " +
|
||||
"140pt=.visual_font_size_140pt, " +
|
||||
"154pt=.visual_font_size_154pt, " +
|
||||
"196pt=.visual_font_size_196pt",
|
||||
theme_advanced_toolbar_location : "top",
|
||||
|
|
|
@ -205,11 +205,7 @@ switch ($activeTab) {
|
|||
|
||||
// If the background is changed the size is reseted
|
||||
$background_now = $visualConsole['background'];
|
||||
/*if ($background_now != $background && $background) {
|
||||
$sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background);
|
||||
$values['width'] = $sizeBackground[0];
|
||||
$values['height'] = $sizeBackground[1];
|
||||
}*/
|
||||
|
||||
$values['width'] = $width;
|
||||
$values['height'] = $height;
|
||||
switch ($action) {
|
||||
|
@ -237,33 +233,31 @@ switch ($activeTab) {
|
|||
break;
|
||||
|
||||
case 'save':
|
||||
if (!defined('METACONSOLE')) {
|
||||
if ($values['name'] != "" && $values['background'])
|
||||
$idVisualConsole = db_process_sql_insert('tlayout', $values);
|
||||
else
|
||||
$idVisualConsole = false;
|
||||
if ($values['name'] != "" && $values['background'])
|
||||
$idVisualConsole = db_process_sql_insert('tlayout', $values);
|
||||
else
|
||||
$idVisualConsole = false;
|
||||
|
||||
if ($idVisualConsole !== false) {
|
||||
db_pandora_audit( "Visual console builder", "Create visual console #$idVisualConsole");
|
||||
$action = 'edit';
|
||||
$statusProcessInDB = array('flag' => true,
|
||||
'message' => ui_print_success_message(__('Successfully created.'), '', true));
|
||||
|
||||
if ($idVisualConsole !== false) {
|
||||
db_pandora_audit( "Visual console builder", "Create visual console #$idVisualConsole");
|
||||
$action = 'edit';
|
||||
$statusProcessInDB = array('flag' => true,
|
||||
'message' => ui_print_success_message(__('Successfully created.'), '', true));
|
||||
|
||||
// Return the updated visual console
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
// Update the ACL
|
||||
//$vconsole_read = $vconsole_read_new;
|
||||
$vconsole_write = $vconsole_write_new;
|
||||
$vconsole_manage = $vconsole_manage_new;
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Visual console builder", "Fail try to create visual console");
|
||||
$statusProcessInDB = array('flag' => false,
|
||||
'message' => ui_print_error_message(__('Could not be created.'), '', true));
|
||||
}
|
||||
// Return the updated visual console
|
||||
$visualConsole = db_get_row_filter('tlayout',
|
||||
array('id' => $idVisualConsole));
|
||||
// Update the ACL
|
||||
//$vconsole_read = $vconsole_read_new;
|
||||
$vconsole_write = $vconsole_write_new;
|
||||
$vconsole_manage = $vconsole_manage_new;
|
||||
}
|
||||
break;
|
||||
else {
|
||||
db_pandora_audit( "Visual console builder", "Fail try to create visual console");
|
||||
$statusProcessInDB = array('flag' => false,
|
||||
'message' => ui_print_error_message(__('Could not be created.'), '', true));
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ $table->data["staticgraph_modulegraph"][1] .= ' ' .
|
|||
'leaguegothic' => 'League Gothic'
|
||||
);
|
||||
|
||||
$fonts = array('4pt' => '4pt','6pt' => '6pt','8pt' => '8pt','10pt' => '10pt','12pt' => '12pt','14pt' => '14pt','24pt' => '24pt','36pt' => '36pt','72pt' => '72pt','96pt' => '96pt','128pt' => '128pt','154pt' => '154pt','196pt' => '196pt');
|
||||
$fonts = array('4pt' => '4pt','6pt' => '6pt','8pt' => '8pt','10pt' => '10pt','12pt' => '12pt','14pt' => '14pt','18pt' => '18pt','24pt' => '24pt','28pt' => '28pt','36pt' => '36pt','48pt' => '48pt','60pt' => '60pt','72pt' => '72pt','84pt' => '84pt','96pt' => '96pt','116pt' => '116pt','128pt' => '128pt','140pt' => '140pt','154pt' => '154pt','196pt' => '196pt');
|
||||
|
||||
/*
|
||||
$fontf = array('andale mono,times' => 'Andale Mono',
|
||||
|
|
|
@ -313,7 +313,7 @@ foreach ($listIcons as $index => $value)
|
|||
$table_gis->data[$row][0] = __('Default icon in GIS') .
|
||||
ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true);
|
||||
$table_gis->data[$row][1] = html_print_select($arraySelectIcon,
|
||||
"gis_default_icon", $config["gis_default_icon"], "", __('None'),
|
||||
"gis_default_icon", $config["gis_default_icon"], "", __('Agent icon group'),
|
||||
'', true);
|
||||
$table_gis->data[$row][1] .= " " .
|
||||
html_print_button(__("View"), 'gis_icon_preview', false, '', '', true);
|
||||
|
@ -934,6 +934,23 @@ tinyMCE.init({
|
|||
});
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
var comfort = 0;
|
||||
|
||||
if(comfort == 0){
|
||||
$(':input,:radio,:checkbox,:file').change(function(){
|
||||
$('#submit-update_button').css({'position':'fixed','right':'80px','bottom':'55px'});
|
||||
var comfort = 1;
|
||||
});
|
||||
|
||||
$("*").keydown(function(){
|
||||
$('#submit-update_button').css({'position':'fixed','right':'80px','bottom':'55px'});
|
||||
var comfort = 1;
|
||||
});
|
||||
|
||||
$('#form_setup').after('<br>');
|
||||
}
|
||||
|
||||
$("#form_setup #text-graph_color1").attachColorPicker();
|
||||
$("#form_setup #text-graph_color2").attachColorPicker();
|
||||
$("#form_setup #text-graph_color3").attachColorPicker();
|
||||
|
|
|
@ -58,7 +58,14 @@ $baseurl = ui_get_full_url(false, false, false, false);
|
|||
var text1_mr_file = "<?php echo __('There are new database changes available to apply. Do you want to start the DB update process?'); ?>\n";
|
||||
var text2_mr_file = "<?php echo __('We recommend launching '); ?>\n";
|
||||
var text3_mr_file = "<?php echo __('planned downtime'); ?>\n";
|
||||
var text4_mr_file = "<?php echo __(' to this process'); ?>\n";
|
||||
var text4_mr_file = "<?php
|
||||
if($config['language'] == 'es'){
|
||||
echo __(' to this process').'<br><br><a style=\"font-size:10pt;font-style:italic;\" target=\"blank\" href=\"http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29\">'.__('About minor release update').'</a>';
|
||||
}
|
||||
else{
|
||||
echo __(' to this process').'<br><br><a style=\"font-size:10pt;font-style:italic;\" target=\"blank\" href=\"http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29\">'.__('About minor release update').'</a>';
|
||||
}
|
||||
?>";
|
||||
var text1_package_file = "<?php echo __('There is a new update available'); ?>\n";
|
||||
var text2_package_file = "<?php echo __('There is a new update available to apply. Do you want to start the update process?'); ?>\n";
|
||||
var applying_mr = "<?php echo __('Applying DB MR'); ?>\n";
|
||||
|
|
|
@ -565,7 +565,7 @@ $values = array (
|
|||
'Tactical view'=>__('Tactical view'),
|
||||
'Alert detail' => __('Alert detail'),
|
||||
'Other'=>__('Other'));
|
||||
if (enterprise_installed()) {
|
||||
if (enterprise_installed() && !is_metaconsole()) {
|
||||
$values['Dashboard'] = __('Dashboard');
|
||||
}
|
||||
$table->data[12][1] = html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false);
|
||||
|
|
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 504 B |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 497 B |
Before Width: | Height: | Size: 497 B After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 497 B |
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 503 B |
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 729 B |
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 746 B After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 746 B |
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 655 B |
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 1.4 KiB |