Merge branch 'develop' into '777-translations-dev'

# Conflicts:
#   pandora_console/godmode/update_manager/update_manager.offline.php
#   pandora_console/include/functions_update_manager.php
This commit is contained in:
artu30 2017-05-22 17:51:21 +02:00
commit a78b5cc60d
128 changed files with 34496 additions and 31646 deletions
pandora_agents
pandora_console

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

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

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.702, AIX version
# Version 7.0NG.703, 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.702
Version: 7.0NG.703-170522
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.702"
pandora_version="7.0NG.703-170522"
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.702, GNU/Linux
# Version 7.0NG.703, 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.702, FreeBSD Version
# Version 7.0NG.703, 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.702, HP-UX Version
# Version 7.0NG.703, 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.702, GNU/Linux
# Version 7.0NG.703, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com
@ -46,6 +46,12 @@ agent_name_cmd __rand__
#Parent agent_name
#parent_agent_name caprica
# By default, agent takes machine alias
#agent_alias
# To define agent alias by specific command, define 'agent_alias_cmd'.
#agent_alias_cmd
# Agent description
#description This is a demo agent for Linux

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.702, GNU/Linux
# Version 7.0NG.703, 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.702, NetBSD Version
# Version 7.0NG.703, 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.702, Solaris Version
# Version 7.0NG.703, 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.702';
use constant AGENT_BUILD => '170425';
use constant AGENT_VERSION => '7.0NG.703';
use constant AGENT_BUILD => '170522';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -135,9 +135,10 @@ my %DefaultConf = (
'interval' => 300,
'debug' => 0,
'agent_name' => '',
'agent_alias' => hostname(),
'agent_alias' => '',
'ehorus_conf' => undef,
'agent_name_cmd' => '',
'agent_alias_cmd' => '',
'description' => '',
'group' => '',
'group_id' => undef,
@ -802,6 +803,23 @@ sub read_config (;$) {
# Module, plugin and collection definitions
parse_conf_modules(\@file);
# If agent_alias_cmd is defined, agent_alias is set by command result.
if ($Conf{'agent_alias'} eq '') {
if ($Conf{'agent_alias_cmd'} ne '') {
my $result = `$Conf{'agent_alias_cmd'}`;
# Use only the first line.
my ($temp_agent_alias, $remain2) = split(/\n/, $result);
chomp ($temp_agent_alias);
# Remove white spaces of the first and last.
$temp_agent_alias =~ s/^ *(.*?) *$/$1/;
$Conf{'agent_alias'} = $temp_agent_alias if ($temp_agent_alias ne '');
} else {
$Conf{'agent_alias'} = hostname();
}
}
# If agent_name_cmd is defined, agent_name is set by command result.
if ($Conf{'agent_name'} eq '') {

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.702
%define release 1
%define version 7.0NG.703
%define release 170522
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.702
%define release 1
%define version 7.0NG.703
%define release 170522
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

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

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2014 Artica Soluciones Tecnologicas
# Version 7.0NG.702
# Version 7.0NG.703
# 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.702}
{Pandora FMS Windows Agent v7.0NG.703}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{170425}
{170522}
ViewReadme
{Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No}
Windows,Executable
{<%AppName%>-Setup<%Ext%>}
{<%AppName%>-<%Version%>-Setup<%Ext%>}
Windows,FileDescription
{<%AppName%> <%Version%> Setup}

@ -368,7 +368,7 @@ Pandora_Module::getDataOutput (Pandora_Data *data) {
}
if (this->has_limits) {
if (value >= this->max || value <= this->min) {
if (value > this->max || value < this->min) {
pandoraLog ("The returned value was not in the interval on module %s",
this->module_name.c_str ());
throw Value_Error ();
@ -1789,5 +1789,9 @@ Pandora_Module::getIntensiveMatch () {
return this->intensive_match;
}
bool
Pandora_Module::getAsync () {
return this->async;
}

@ -91,7 +91,7 @@ namespace Pandora_Modules {
MODULE_TCPCHECK, /**< The module checks whether a tcp port is open */
MODULE_REGEXP, /**< The module searches a file for matches of a regular expression */
MODULE_PLUGIN, /**< Plugin */
MODULE_PING, /**< Ping module */
MODULE_PING, /**< Ping module */
MODULE_SNMPGET /**< SNMP get module */
} Module_Kind;
@ -238,6 +238,7 @@ namespace Pandora_Modules {
void setTimeout (int timeout);
int getTimeout ();
string getSave ();
bool getAsync ();
virtual string getXml ();

@ -52,6 +52,17 @@ Pandora_Module_Proc::Pandora_Module_Proc (string name, string process_name)
this->retries = 3;
this->start_delay = 5000;
this->retry_delay = 2000;
this->thread = 0;
}
/**
* Destroys a Pandora_Module_Service object.
*/
Pandora_Module_Proc::~Pandora_Module_Proc () {
// Close the thread if module is async
if (this->thread) {
TerminateThread(this->thread, 0);
}
}
string

@ -38,6 +38,7 @@ namespace Pandora_Modules {
int retry_delay;
public:
Pandora_Module_Proc (string name, string process_name);
~Pandora_Module_Proc ();
string getProcessName () const;
string getStartCommand () const;

@ -49,6 +49,16 @@ Pandora_Module_Service::Pandora_Module_Service (string name, string service_name
this->thread = 0;
this->watchdog = false;
}
/**
* Destroys a Pandora_Module_Service object.
*/
Pandora_Module_Service::~Pandora_Module_Service () {
// Close the thread if module is async
if (this->thread) {
TerminateThread(this->thread, 0);
}
}
string
Pandora_Module_Service::getServiceName () const {

@ -36,6 +36,7 @@ namespace Pandora_Modules {
bool watchdog;
public:
Pandora_Module_Service (string name, string service_name);
~Pandora_Module_Service ();
void run ();
string getServiceName () const;

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.702(Build 170425)")
#define PANDORA_VERSION ("7.0NG.703(Build 170522)")
string pandora_path;
string pandora_dir;

@ -228,6 +228,15 @@ Pandora::Pandora_Agent_Conf::setFile (string *all_conf){
key_values->push_back (kv);
continue;
}
/*Check if is a agent_alias_cmd"*/
pos = buffer.find("agent_alias_cmd");
if (pos != string::npos){
Key_Value kv;
kv.parseLineByPosition(buffer, 15);
key_values->push_back (kv);
continue;
}
/*Check if is a collection*/
pos = buffer.find("file_collection");

@ -76,6 +76,7 @@ Pandora_Windows_Service::setValues (const char * svc_name,
this->service_description = (char *) svc_description;
execution_number = 0;
this->modules = NULL;
this->broker_modules = NULL;
this->conf = NULL;
this->interval = 60000;
this->timestamp = 0;
@ -105,6 +106,10 @@ Pandora_Windows_Service::~Pandora_Windows_Service () {
if (this->modules != NULL) {
delete this->modules;
}
if (this->broker_modules != NULL) {
delete this->broker_modules;
}
pandoraLog ("Pandora agent stopped");
}
@ -136,10 +141,10 @@ Pandora_Windows_Service::pandora_init_broker (string file_conf) {
this->conf = Pandora::Pandora_Agent_Conf::getInstance ();
this->conf->setFile (file_conf);
if (this->modules != NULL) {
delete this->modules;
if (this->broker_modules != NULL) {
delete this->broker_modules;
}
this->modules = new Pandora_Module_List (file_conf);
this->broker_modules = new Pandora_Module_List (file_conf);
pandoraDebug ("Pandora broker agent started");
}
@ -208,9 +213,14 @@ Pandora_Windows_Service::check_broker_agents(string *all_conf){
void
Pandora_Windows_Service::pandora_init () {
pandora_init(true);
}
void
Pandora_Windows_Service::pandora_init (bool reload_modules) {
string conf_file, interval, debug, disable_logfile, intensive_interval, util_dir, path, env;
string udp_server_enabled, udp_server_port, udp_server_addr, udp_server_auth_addr;
string agent_name, agent_name_cmd, agent_alias, pandora_agent;
string agent_name, agent_name_cmd, agent_alias, agent_alias_cmd, pandora_agent;
string proxy_mode, server_ip;
string *all_conf;
int pos, num;
@ -224,7 +234,7 @@ Pandora_Windows_Service::pandora_init () {
this->conf = Pandora::Pandora_Agent_Conf::getInstance ();
this->conf->setFile (all_conf);
if (this->modules != NULL) {
if (this->modules != NULL && reload_modules) {
delete this->modules;
}
@ -255,9 +265,40 @@ Pandora_Windows_Service::pandora_init () {
this->setSleepTime (this->intensive_interval);
// Read modules
this->modules = new Pandora_Module_List (conf_file);
if (reload_modules) {
this->modules = new Pandora_Module_List (conf_file);
}
delete []all_conf;
// Get the agent alias.
agent_alias = conf->getValue ("agent_alias");
if (agent_alias == "") {
agent_alias_cmd = conf->getValue ("agent_alias_cmd");
if (agent_alias_cmd != "") {
agent_alias_cmd = "cmd.exe /c \"" + agent_alias_cmd + "\"";
static string temp_agent_alias = getAgentNameFromCmdExec(agent_alias_cmd);
// Delete new line and carriage return.
pos = temp_agent_alias.find("\n");
if(pos != string::npos) {
temp_agent_alias.erase(pos, temp_agent_alias.size () - pos);
}
pos = temp_agent_alias.find("\r");
if(pos != string::npos) {
temp_agent_alias.erase(pos, temp_agent_alias.size () - pos);
}
// Remove leading and trailing white spaces.
temp_agent_alias = trim(temp_agent_alias);
if (temp_agent_alias != "") {
agent_alias = temp_agent_alias;
}
} else {
agent_alias = Pandora_Windows_Info::getSystemName ();
}
}
this->conf->setValue("agent_alias", agent_alias);
// Get the agent name.
agent_name = conf->getValue ("agent_name");
if (agent_name == "") {
@ -299,13 +340,6 @@ Pandora_Windows_Service::pandora_init () {
this->conf->setValue("agent_name", agent_name);
}
// Get the agent alias.
agent_alias = conf->getValue ("agent_alias");
if (agent_alias == "") {
agent_alias = Pandora_Windows_Info::getSystemName ();
this->conf->setValue("agent_alias", agent_alias);
}
pandora_agent = "PANDORA_AGENT=" + agent_name;
putenv(pandora_agent.c_str());
@ -1834,19 +1868,19 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
server_addr = conf->getValue ("server_ip");
if (this->modules != NULL) {
this->modules->goFirst ();
if (this->broker_modules != NULL) {
this->broker_modules->goFirst ();
while (! this->modules->isLast ()) {
while (! this->broker_modules->isLast ()) {
Pandora_Module *module;
module = this->modules->getCurrentValue ();
module = this->broker_modules->getCurrentValue ();
/* Check preconditions */
if (module->evaluatePreconditions () == 0) {
pandoraDebug ("Preconditions not matched for module %s", module->getName ().c_str ());
module->setNoOutput ();
this->modules->goNext ();
this->broker_modules->goNext ();
continue;
}
@ -1854,15 +1888,23 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
if (module->checkCron (module->getInterval (), atoi (conf->getValue ("interval").c_str())) == 0) {
pandoraDebug ("Cron not matched for module %s", module->getName ().c_str ());
module->setNoOutput ();
this->modules->goNext ();
this->broker_modules->goNext ();
continue;
}
/* Check async */
if (module->getAsync()) {
pandoraDebug ("Forbidden async module %s in broker agents", module->getName ().c_str ());
module->setNoOutput ();
this->broker_modules->goNext ();
continue;
}
pandoraDebug ("Run %s", module->getName ().c_str ());
module->run ();
if (! module->hasOutput ()) {
module->setNoOutput ();
this->modules->goNext ();
this->broker_modules->goNext ();
continue;
}
@ -1875,7 +1917,7 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
intensive_match = module->evaluateIntensiveConditions ();
if (intensive_match == module->getIntensiveMatch () && module->getTimestamp () + module->getInterval () * this->interval_sec > this->run_time) {
module->setNoOutput ();
this->modules->goNext ();
this->broker_modules->goNext ();
continue;
}
module->setIntensiveMatch (intensive_match);
@ -1890,7 +1932,7 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
/* At least one module has data */
data_flag = 1;
this->modules->goNext ();
this->broker_modules->goNext ();
}
}
@ -1898,7 +1940,7 @@ Pandora_Windows_Service::pandora_run_broker (string config) {
// Send the XML
if (!server_addr.empty ()) {
this->sendXml (this->modules);
this->sendXml (this->broker_modules);
}
}
@ -2037,7 +2079,7 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
/* Reload the original configuration */
if (num != 0) {
pandora_init ();
pandora_init (false);
}
/* Reset time reference if necessary */

@ -42,6 +42,7 @@ namespace Pandora {
private:
Pandora_Agent_Conf *conf;
Pandora_Module_List *modules;
Pandora_Module_List *broker_modules;
long execution_number;
string agent_name;
string alias;
@ -98,6 +99,7 @@ namespace Pandora {
void pandora_run (int forced_run);
void pandora_run ();
void pandora_init ();
void pandora_init (bool reload_modules);
long interval;
long interval_sec;

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.702(Build 170425))"
VALUE "ProductVersion", "(7.0NG.703(Build 170522))"
VALUE "FileVersion", "1.0.0.0"
END
END

@ -1,10 +1,10 @@
package: pandorafms-console
Version: 7.0NG.702
Version: 7.0NG.703-170522
Architecture: all
Priority: optional
Section: admin
Installed-Size: 42112
Maintainer: Artica ST <deptec@artica.es>
Homepage: http://pandorafms.org/
Depends: php5, php5-snmp, php5-gd, php5-mysql, php-db, php5-xmlrpc, php-gettext, php5-curl, graphviz, dbconfig-common, php5-ldap, mysql-client | virtual-mysql-client
Depends: php5.6 | php5, php5.6-snmp | php5-snmp, php5.6-gd | php5-gd, php5.6-mysql | php5-mysql, php-db, php5.6-xmlrpc | php5-xmlrpc, php-gettext, php5.6-curl | php5-curl, graphviz, dbconfig-common, php5.6-ldap | php5-ldap, mysql-client | virtual-mysql-client
Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process.

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

@ -75,6 +75,8 @@ function mainAgentsModules() {
$modules_selected = (array)get_parameter('module', 0);
$update_item = (string)get_parameter('edit_item','');
$save_serialize = (int)get_parameter('save_serialize', 0);
$full_modules_selected = explode(";",get_parameter('full_modules_selected', 0));
$full_agents_id = explode(";",get_parameter('full_agents_id', 0));
if($save_serialize && $update_item == ''){
$unserialize_modules_selected = unserialize_in_temp($config['id_user']."_agent_module", true, 1);
@ -97,16 +99,40 @@ function mainAgentsModules() {
if($agents_id[0] != -1 ){
serialize_in_temp($agents_id, $config['id_user']."_agents", 1);
}
if ($config["pure"] == 0) {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
if($modules_selected[0] && $agents_id[0]){
$full_modules = urlencode(implode(";",$modules_selected));
$full_agents = urlencode(implode(";",$agents_id));
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
} else if($full_modules_selected[0] && $full_agents_id[0]){
$full_modules = urlencode(implode(";",$full_modules_selected));
$full_agents = urlencode(implode(";",$full_agents_id));
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
} else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
. "</a>";
}
}
else {
}
$groups = users_get_groups ();
//groups
@ -144,7 +170,7 @@ function mainAgentsModules() {
//modules
$all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false);
$filter_modules_label = '<b>'.__('Module').'</b>';
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, true, '', false, "min-width: 180px; max-width: 200px;");
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, "min-width: 180px; max-width: 200px;");
//update
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
@ -164,7 +190,19 @@ function mainAgentsModules() {
echo "</tr>";
echo "</table>";
} else {
$url =" index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh=$refr";
if ($full_agents_id[0]){
$full_modules = urlencode(implode(";",$full_modules_selected)) ;
$full_agents = urlencode(implode(";",$full_agents_id));
$url =" index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset
&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr&full_modules_selected=$full_modules
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m";
} else {
$url =" index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr";
}
// Floating menu - Start
echo '<div id="vc-controls" style="z-index: 999">';
@ -206,7 +244,9 @@ 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)).'">';
echo '<form method="post" action="'
. 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>";
@ -235,9 +275,14 @@ function mainAgentsModules() {
$agents = $agents_id;
}
else {
$agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents);
if($full_agents_id[0]){
$agents = $full_agents_id;
} else {
$agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents);
}
}
$filter_module_group = array('disabled' => 0);
@ -260,7 +305,6 @@ function mainAgentsModules() {
if($agents_id[0] != -1){
$all_modules = array();
foreach ($modules_selected as $key => $value) {
//$all_modules[$value] = io_safe_output(modules_get_agentmodule_name($value));
$name = modules_get_agentmodule_name($value);
$sql = "SELECT id_agente_modulo
FROM tagente_modulo
@ -277,14 +321,34 @@ function mainAgentsModules() {
}
}
else{
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, true);
if ($full_modules_selected[0]){
foreach ($full_modules_selected as $key => $value) {
$name = modules_get_agentmodule_name($value);
$sql = "SELECT id_agente_modulo
FROM tagente_modulo
WHERE nombre = '". $name ."';";
$result_sql = db_get_all_rows_sql($sql);
if(is_array($result_sql)){
foreach ($result_sql as $key => $value) {
$all_modules[$value['id_agente_modulo']] = io_safe_output($name);
}
}
// $all_modules[$value] = modules_get_agentmodule_name($value);
}
} else {
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, true);
}
}
$modules_by_name = array();
$name = '';
$cont = 0;
foreach ($all_modules as $key => $module) {
if ($module == $name) {
$modules_by_name[$cont-1]['id'][] = $key;
@ -494,7 +558,6 @@ function mainAgentsModules() {
echo "<td></td>";
}
}
echo "</tr>";
}
@ -509,7 +572,7 @@ function mainAgentsModules() {
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module has a warning status") . "</td></tr>";
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module has a normal status") . "</td></tr>";
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module has an unknown status") . "</td></tr>";
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NOTINIT . ";'></div></td><td>" . __("Cell turns grey when the module is in 'not initialize' status") . "</td></tr>";
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NOTINIT . ";'></div></td><td>" . __("Cell turns blue when the module is in 'not initialize' status") . "</td></tr>";
echo "</table>";
echo "</div>";
@ -562,6 +625,8 @@ $ignored_params['refresh']='';
var refr = <?php echo (int)$refr; ?>;
var pure = <?php echo (int) $config['pure']; ?>;
var href = "<?php echo ui_get_url_refresh ($ignored_params); ?>";
if (pure) {
var startCountDown = function (duration, cb) {
$('div.vc-countdown').countdown('destroy');
@ -593,6 +658,17 @@ $ignored_params['refresh']='';
}
else {
var agentes_id = $("#id_agents2").val();
var id_agentes = $.get("full_agents_id");
if (agentes_id === null && id_agentes !== null) {
id_agentes = id_agentes.split(";")
id_agentes.forEach(function(element) {
$("#id_agents2 option[value="+ element +"]").attr("selected",true);
});
selection_agent_module();
}
$('#refresh').change(function () {
$('#hidden-vc_refr').val($('#refresh option:selected').val());
});
@ -693,9 +769,34 @@ $ignored_params['refresh']='';
.html (value["nombre"]);
$("#module").append (option);
});
var id_modules = $.get("full_modules_selected");
if(id_modules !== null) {
id_modules = id_modules.split(";");
id_modules.forEach(function(element) {
$("#module option[value="+ element +"]").attr("selected",true);
});
}
}
},
"json"
);
}
(function($) {
$.get = function(key) {
key = key.replace(/[\[]/, '\\[');
key = key.replace(/[\]]/, '\\]');
var pattern = "[\\?&]" + key + "=([^&#]*)";
var regex = new RegExp(pattern);
var url = unescape(window.location.href);
var results = regex.exec(url);
if (results === null) {
return null;
} else {
return results[1];
}
}
})(jQuery);
</script>

@ -15,7 +15,7 @@ if(!enterprise_installed()){
$open=true;
}
$tipo = $_GET['message'];
$tipo = $_POST['message'];
echo "
<div class='modalheader'>
@ -185,7 +185,7 @@ echo "
</div>";
if($open){
echo "<div class='modalgobutton gopandora'>
<span class='modalokbuttontext'>About Enterprise</span>
<span class='modalgobuttontext'>About Enterprise</span>
</div>";
}

@ -32,7 +32,15 @@ if (!$config["MR"]) {
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">';
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_version, $config["MR"]));
if($current_package == 0){
$build_package_version = $build_version;
}
else{
$build_package_version = $current_package;
}
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_package_version, $config["MR"]));
echo '</a><br />';
echo '<a class="white footer">'. __('Page generated at') . ' '. date('F j, Y h:i a'); //Always use timestamp here

@ -83,12 +83,19 @@ echo '<div id="header_login">';
echo '<img src="images/custom_logo/pandora_logo_head_3.png" alt="pandora_console">';
}
echo '</div>';
echo '<div id="list_icon_docs_support"><ul>';
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="images/icono_docs.png" alt="docs pandora"></a></li>';
echo '<li>' . __('Docs') . '</li>';
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
echo '<li>' . __('Support') . '</li>';
echo '</ul></div>';
echo '<div id="list_icon_docs_support"><ul>';
echo '<li><a href="http://wiki.pandorafms.com/" target="_blank"><img src="images/icono_docs.png" alt="docs pandora"></a></li>';
echo '<li>' . __('Docs') . '</li>';
if (defined ('PANDORA_ENTERPRISE')) {
echo '<li id="li_margin_left"><a href="https://support.artica.es" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
} else {
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="images/icono_support.png" alt="support pandora"></a></li>';
}
echo '<li>' . __('Support') . '</li>';
echo '</ul></div>';
echo '</div>';
echo '<div class="container_login">';
@ -103,7 +110,7 @@ echo '<div class="login_page">';
html_print_image ("images/custom_logo_login/".$config['custom_logo_login'], false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
}
}
else if (defined ('PANDORA_ENTERPRISE')) {
else if (file_exists (ENTERPRISE_DIR . "/load_enterprise.php")) {
if (!isset ($config["custom_logo_login"])){
html_print_image ("enterprise/images/custom_logo_login/login_logo_v7.png", false, array ("class" => "login_logo", "alt" => "logo", "border" => 0, "title" => $logo_title), false, true);
@ -424,7 +431,6 @@ html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_laye
draggable: false,
modal: true,
width: 600,
height: 250,
overlay: {
opacity: 0.5,
background: "black"

@ -31,13 +31,14 @@ require_once ("../include/functions_html.php");
<?php
$id = get_parameter ('id');
$id_user = get_parameter ('id_user');
if (! isset($_SESSION['id_usuario'])) {
session_start();
session_write_close();
}
$user_language = get_user_language ($_SESSION['id_usuario']);
$user_language = get_user_language ($id_user);
if (file_exists ('../include/languages/'.$user_language.'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('../include/languages/'.$user_language.'.mo'));

@ -159,8 +159,7 @@ if ($create_agent) {
$intervalo = (string) get_parameter_post ("intervalo", SECONDS_5MINUTES);
$comentarios = (string) get_parameter_post ("comentarios", '');
$modo = (int) get_parameter_post ("modo");
$id_parent = (string) get_parameter_post ("id_parent",'');
$id_parent = (int) agents_get_agent_id ($id_parent);
$id_parent = (int) get_parameter_post ("id_agent_parent");
$server_name = (string) get_parameter_post ("server_name");
$id_os = (int) get_parameter_post ("id_os");
$disabled = (int) get_parameter_post ("disabled");
@ -690,8 +689,7 @@ if ($update_agent) { // if modified some agent paramenter
$id_os = (int) get_parameter_post ("id_os");
$disabled = (bool) get_parameter_post ("disabled");
$server_name = (string) get_parameter_post ("server_name", "");
$parent_name = (string) get_parameter_post ("id_parent");
$id_parent = (int) agents_get_agent_id ($parent_name);
$id_parent = (int) get_parameter_post ("id_agent_parent");
$custom_id = (string) get_parameter_post ("custom_id", "");
$cascade_protection = (int) get_parameter_post ("cascade_protection", 0);
$cascade_protection_module = (int) get_parameter ("cascade_protection_module", 0);

@ -99,6 +99,7 @@ if ($agent_to_delete) {
if ($enable_agent) {
$result = db_process_sql_update('tagente', array('disabled' => 0), array('id_agente' => $enable_agent));
$alias = agents_get_alias($enable_agent);
if ($result) {
// Update the agent from the metaconsole cache
@ -106,10 +107,10 @@ if ($enable_agent) {
$values = array('disabled' => 0);
enterprise_hook ('agent_update_from_cache', array($enable_agent, $values));
db_pandora_audit("Agent management", 'Enable ' . $enable_agent);
db_pandora_audit("Agent management", 'Enable ' . $alias);
}
else {
db_pandora_audit("Agent management", 'Fail to enable ' . $enable_agent);
db_pandora_audit("Agent management", 'Fail to enable ' . $alias);
}
ui_print_result_message ($result,
@ -118,6 +119,7 @@ if ($enable_agent) {
if ($disable_agent) {
$result = db_process_sql_update('tagente', array('disabled' => 1), array('id_agente' => $disable_agent));
$alias = agents_get_alias($disable_agent);
if ($result) {
// Update the agent from the metaconsole cache
@ -125,10 +127,10 @@ if ($disable_agent) {
$values = array('disabled' => 1);
enterprise_hook ('agent_update_from_cache', array($disable_agent, $values));
db_pandora_audit("Agent management", 'Disable ' . $disable_agent);
db_pandora_audit("Agent management", 'Disable ' . $alias);
}
else {
db_pandora_audit("Agent management", 'Fail to disable ' . $disable_agent);
db_pandora_audit("Agent management", 'Fail to disable ' . $alias);
}
ui_print_result_message ($result,

@ -274,7 +274,6 @@ $table_simple->data[3][2] .= html_print_input_text ('dynamic_max', $dynamic_max,
$table_simple->data[3][3] = '<span><em>'.__('Dynamic Threshold Two Tailed: ').'</em>';
$table_simple->data[3][3] .= html_print_checkbox ("dynamic_two_tailed", 1, $dynamic_two_tailed, true, $disabledBecauseInPolicy);
$table_simple->data[4][0] = __('Warning status').' ' . ui_print_help_icon ('warning_status', true);
if (!modules_is_string_type($id_module_type) || $edit) {
$table_simple->data[4][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
@ -882,6 +881,9 @@ $(document).ready (function () {
$('#dynamic_interval_select').change (function() {
disabled_status(disabledBecauseInPolicy);
});
$('#dynamic_interval').change (function() {
disabled_status(disabledBecauseInPolicy);
});
disabled_two_tailed(disabledBecauseInPolicy);
$('#checkbox-dynamic_two_tailed').change (function() {
@ -929,7 +931,7 @@ $(document).ready (function () {
//readonly and add class input
function disabled_status (disabledBecauseInPolicy) {
if($('#dynamic_interval_select').val() != 0){
if($('#dynamic_interval_select').val() != 0 && $('#dynamic_interval').val() != 0){
$('#text-min_warning').prop('readonly', true);
$('#text-min_warning').addClass('readonly');
$('#text-max_warning').prop('readonly', true);
@ -1206,18 +1208,19 @@ function validate_post_process() {
//function paint graph
function paint_graph_values(){
//Parse integrer
var min_w = parseInt($('#text-min_warning').val());
var min_w = parseFloat($('#text-min_warning').val());
if(min_w == '0.00'){ min_w = 0; }
var max_w = parseInt($('#text-max_warning').val());
var max_w = parseFloat($('#text-max_warning').val());
if(max_w == '0.00'){ max_w = 0; }
var min_c = parseInt($('#text-min_critical').val());
var min_c = parseFloat($('#text-min_critical').val());
if(min_c =='0.00'){ min_c = 0; }
var max_c = parseInt($('#text-max_critical').val());
var max_c = parseFloat($('#text-max_critical').val());
if(max_c =='0.00'){ max_c = 0; }
var inverse_w = $('input:checkbox[name=warning_inverse]:checked').val();
if(!inverse_w){ inverse_w = 0; }
var inverse_c = $('input:checkbox[name=critical_inverse]:checked').val();
if(!inverse_c){ inverse_c = 0; }
//inicialiced error
var error_w = 0;
var error_c = 0;
@ -1257,10 +1260,10 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
//if haven't errors
if (error_w == 0 && error_c == 0){
//parse element
min_w = parseInt(min_w);
min_c = parseInt(min_c);
max_w = parseInt(max_w);
max_c = parseInt(max_c);
min_w = parseFloat(min_w);
min_c = parseFloat(min_c);
max_w = parseFloat(max_w);
max_c = parseFloat(max_c);
//inicialize var
var range_min = 0;

@ -633,8 +633,6 @@ echo '</form>';
if ($id_downtime > 0) {
echo "<td valign=top style='width:300px;padding-left:20px;'>";
// Show available agents to include into downtime
echo '<h4>' . __('Available agents') . ':</h4>';
$filter_group = (int) get_parameter("filter_group", 0);
@ -707,7 +705,8 @@ if ($id_downtime > 0) {
echo "<br /><br />";
html_print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false);
echo "</form>";
// Show available agents to include into downtime
echo '<h4>' . __('Available agents') . ':</h4>';
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
echo html_print_select ($agents, "id_agents[]", -1, '', _("Any"), -2, false, true, true, '', false, 'width: 180px;');

@ -146,7 +146,7 @@ if (is_ajax ()) {
if (preg_match ("/^_html_editor_$/i", $field_value)) {
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
$editor_type_chkbx .= __('Basic') . "&nbsp;&nbsp;";
$editor_type_chkbx .= __('Basic') . ui_print_help_tip (__("For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>"), true);
$editor_type_chkbx .= html_print_radio_button_extended ('editor_type_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_value')", '', true);
$editor_type_chkbx .= "&nbsp;&nbsp;&nbsp;&nbsp;";
$editor_type_chkbx .= __('Advanced') . "&nbsp;&nbsp;";

@ -576,8 +576,9 @@ foreach ($simple_alerts as $alert) {
$own_groups = users_get_groups($config['id_user'], 'LM', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($own_groups));
$actions = alerts_get_alert_actions_filter(true, 'id_group IN (' . $filter_groups . ')');
if($filter_groups != null){
$actions = alerts_get_alert_actions_filter(true, 'id_group IN (' . $filter_groups . ')');
}
$data[2] .= '<div id="add_action-div-'.$alert['id'].'" style="display:none;text-align:left">';
$data[2] .= '<form id="add_action_form-'.$alert['id'] . '" method="post">';
$data[2] .= '<table class="databox_color" style="width:100%">';

@ -129,7 +129,8 @@ if (!$delete_template) {
alerts_meta_print_header ();
}
else {
ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/gm_alerts.png", false, "alerts_config", true);
//~ ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/gm_alerts.png", false, "alerts_config", true);
ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/gm_alerts.png", false, "", true);
}
}

@ -265,7 +265,7 @@ $(document).ready (function () {
name: "id",
value: this.value});
jQuery.get (<?php echo "'" . ui_get_full_url("ajax.php", false, false, false) . "'"; ?>,
jQuery.post (<?php echo "'" . ui_get_full_url("ajax.php", false, false, false) . "'"; ?>,
values,
function (data, status) {
original_command = js_html_entity_decode (data["command"]);
@ -274,6 +274,7 @@ $(document).ready (function () {
render_command_description(command_description);
var max_fields = parseInt('<?php echo $config["max_macro_fields"]; ?>');
for (i = 1; i <= max_fields; i++) {
var old_value = '';
var old_recovery_value = '';

@ -59,9 +59,12 @@ if ($a_template !== false) {
alerts_meta_print_header();
}
else {
//~ ui_print_page_header (__('Alerts') .
//~ ' &raquo; ' . __('Configure alert template'), "",
//~ false, "alerts_config", true);
ui_print_page_header (__('Alerts') .
' &raquo; ' . __('Configure alert template'), "",
false, "alerts_config", true);
false, "", true);
}
}
else {

@ -337,13 +337,13 @@ $next_row++;
//function paint graph
function paint_graph_values(){
//Parse integrer
var min_w = parseInt($('#text-min_warning').val());
var min_w = parseFloat($('#text-min_warning').val());
if(min_w == '0.00'){ min_w = 0; }
var max_w = parseInt($('#text-max_warning').val());
var max_w = parseFloat($('#text-max_warning').val());
if(max_w == '0.00'){ max_w = 0; }
var min_c = parseInt($('#text-min_critical').val());
var min_c = parseFloat($('#text-min_critical').val());
if(min_c =='0.00'){ min_c = 0; }
var max_c = parseInt($('#text-max_critical').val());
var max_c = parseFloat($('#text-max_critical').val());
if(max_c =='0.00'){ max_c = 0; }
var inverse_w = $('input:checkbox[name=warning_inverse]:checked').val();
if(!inverse_w){ inverse_w = 0; }
@ -388,10 +388,10 @@ $next_row++;
//if haven't errors
if (error_w == 0 && error_c == 0){
//parse element
min_w = parseInt(min_w);
min_c = parseInt(min_c);
max_w = parseInt(max_w);
max_c = parseInt(max_c);
min_w = parseFloat(min_w);
min_c = parseFloat(min_c);
max_w = parseFloat(max_w);
max_c = parseFloat(max_c);
//inicialize var
var range_min = 0;

@ -198,7 +198,7 @@ echo "</form>";
<script src="include/javascript/jquery.colorpicker.js"></script>
<script>
<script type="text/javascript">
$(document).ready (function () {
@ -257,6 +257,29 @@ $(document).ready (function () {
$('#preimageh').html($('#imagen').height());
}
}
else{
original_image=new Image();
original_image.src='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');
$('#preimagew').html(1024);
}
else{
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
else{
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
}
});
@ -281,6 +304,10 @@ $(document).ready (function () {
}
});
//Preload image size and activate auto image size changer when user click over a image in the selector
var size_changer_state = false;
$("#background").change(function() {
$('#imagen2').attr('src','images/console/background/'+$('#background').val());
@ -288,12 +315,21 @@ $(document).ready (function () {
$('#imagen2').show();
});
$("#background").mouseout(function() {
$('#imagen').attr('src','images/console/background/'+$('#background').val());
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
$('#preimagew').html($('#imagen').width());
$('#preimageh').html($('#imagen').height());
$("#background").click(function(){
if('<?php echo (get_parameter('action')=='edit'); ?>' == false){
size_changer_state = true;
}
});
$("#background").mouseout(function() {
if(size_changer_state){
$('#imagen').attr('src','images/console/background/'+$('#background').val());
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
$('#preimagew').html($('#imagen').width());
$('#preimageh').html($('#imagen').height());
size_changer_state = false;
}
});
$("#file-background_image").change(function(){

@ -1497,13 +1497,11 @@ function set_static_graph_status(idElement, image, status) {
set_static_graph_status(idElement, image, data);
if($('#'+idElement+' table').css('float') == 'right' || $('#'+idElement+ ' table').css('float') == 'left'){
$('#'+idElement+ ' img').css('margin-top', parseInt($('#'+idElement).css('height'))/2 - parseInt($('#'+idElement+ ' img').css('height'))/2);
$('#'+idElement+ ' img').css('margin-top', parseInt($('#'+idElement).css('height'))/2 - parseInt($('#'+idElement+ ' img').css('height'))/2);
}
else{
$('#'+idElement+ ' img').css('margin-left',parseInt($('#'+idElement).css('width'))/2 - parseInt($('#'+idElement+ ' img').css('width'))/2);
$('#'+idElement+ ' img').css('margin-left', parseInt($('#'+idElement).css('width'))/2 - parseInt($('#'+idElement+ ' img').css('width'))/2);
}
}
});
@ -1849,11 +1847,9 @@ function get_image_url(img_src) {
});
}
function set_color_line_status(lines, line, id_data, values) {
function set_color_line_status(lines, id_data, values) {
metaconsole = $("input[name='metaconsole']").val();
var parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_color_line"});
@ -1875,7 +1871,6 @@ function set_color_line_status(lines, line, id_data, values) {
"node_end": id_data,
"color": color };
lines.push(line);
refresh_lines(lines, 'background', true);
@ -2250,7 +2245,7 @@ function createItem(type, values, id_data) {
lines.push(line);
set_color_line_status(lines, line, id_data, values);
set_color_line_status(lines, id_data, values);
refresh_lines(lines, 'background', true);
}
@ -2446,7 +2441,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
if (typeof(values['parent']) != 'undefined' && values['parent'] > 0 ) {
if (!found) {
set_color_line_status(lines, line, idElement, values);
set_color_line_status(lines, idElement, values);
}
}
@ -2465,6 +2460,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
refresh_lines(lines, 'background', true);
break;
}
refresh_lines(lines, 'background', true);
draw_user_lines("", 0, 0, 0 , 0, 0, true);
}
@ -2601,9 +2597,19 @@ function updateDB(type, idElement , values, event) {
url: get_url_ajax(),
data: parameter,
type: "POST",
dataType: 'text',
dataType: 'json',
success: function (data) {
updateDB_visual(type, idElement , values, event, top, left);
if (data['correct']) {
if (data['new_line']) {
var line = {"id": idElement,
"node_begin": values['parent'],
"node_end": idElement,
"color": '#cccccc' };
lines.push(line);
}
updateDB_visual(type, idElement , values, event, top, left);
}
}
});
}

@ -78,7 +78,7 @@ else {
echo '<div id="frame_view" style="overflow: auto; margin: 0px auto; padding: 5px; ">';
}
echo '<div id="background" class="" style="top:0px;
margin: 0px auto;border: 1px lightgray solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;">';
margin: 0px auto;border: 1px lightgray solid; width: ' . $widthBackground . 'px; height: ' . $heightBackground . 'px;background-color: '.$visualConsole["background_color"].';">';
echo "<div id='background_grid'
style='position: absolute; display: none; overflow: hidden;
background: url(" . ui_get_full_url('images/console/background/white_boxed.jpg', false, false, false) . ");

@ -756,6 +756,26 @@ $table_other->data[$row][1] .= html_print_input_hidden ('interval_to_delete', ''
//----------------------------------------------------------------------
$row++;
$common_dividers = array(
";" => ";",
"," => ",",
"|" => "|");
$table_other->data[$row][0] = __('CSV divider');
if ($config['csv_divider'] != ";" && $config['csv_divider'] != "," && $config['csv_divider'] != "|") {
$table_other->data[$row][1] = html_print_input_text ('csv_divider', $config['csv_divider'], "", 20, 255, true);
$table_other->data[$row][1] .= '<a id="csv_divider_custom" onclick="javascript: edit_csv_divider();">' .
html_print_image('images/default_list.png', true, array('id' => 'select')) .
"</a>";
}
else {
$table_other->data[$row][1] = html_print_select ($common_dividers, 'csv_divider', $config['csv_divider'], "", '', '', true, false, false);
$table_other->data[$row][1] .= '<a id="csv_divider_custom" onclick="javascript: edit_csv_divider();">' .
html_print_image('images/pencil.png', true, array('id' => 'pencil')) .
"</a>";
}
$row++;
echo "<fieldset>";
echo "<legend>" . __('Other configuration') . "</legend>";
html_print_table ($table_other);
@ -792,6 +812,27 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
?>
<script language="javascript" type="text/javascript">
function edit_csv_divider () {
if ($("#csv_divider_custom img").attr("id") == "pencil") {
$("#csv_divider_custom img").attr("src", "images/default_list.png");
$("#csv_divider_custom img").attr("id", "select");
var value = $("#csv_divider").val();
$("#csv_divider").replaceWith("<input id='text-csv_divider' name='csv_divider' type='text'>");
$("#text-csv_divider").val(value);
}
else {
$("#csv_divider_custom img").attr("src", "images/pencil.png");
$("#csv_divider_custom img").attr("id", "pencil");
$("#text-csv_divider").replaceWith("<select id='csv_divider' name='csv_divider'>");
var o = new Option(";", ";");
var o1 = new Option(",", ",");
var o2 = new Option("|", "|");
$("#csv_divider").append(o);
$("#csv_divider").append(o1);
$("#csv_divider").append(o2);
}
}
// Juanma (07/05/2014) New feature: Custom front page for reports
function display_custom_report_front (show,table) {

@ -1394,10 +1394,7 @@ $(document).ready (function () {
name: "get_recovery_fields",
value: "0"
});
jQuery.get (
<?php
echo "'" . ui_get_full_url("ajax.php", false, false, false) . "'";
?>,
jQuery.post (<?php echo "'" . ui_get_full_url("ajax.php", false, false, false) . "'"; ?>,
values,
function (data, status) {
var max_fields = parseInt('<?php echo $config["max_macro_fields"]; ?>');

@ -41,7 +41,7 @@ $baseurl = ui_get_full_url(false, false, false, false);
var click_on_the_file_below_to_begin = "<?php echo __('Click on the file below to begin.'); ?>\n";
var updating = "<?php echo __('Updating'); ?>\n";
var package_updated_successfully = "<?php echo __('Package updated successfully.'); ?>\n";
var if_there_are_any_database_change = "<?php echo __('If there are any database change, it will be applied on the next login.'); ?>\n";
var if_there_are_any_database_change = "<?php echo __('If there are any database change, it will be applied.'); ?>\n";
var mr_available = "<?php echo __('Minor release available'); ?>\n";
var package_available = "<?php echo __('New package available'); ?>\n";
var mr_not_accepted = "<?php echo __('Minor release rejected. Changes will not apply.'); ?>\n";
@ -55,8 +55,8 @@ $baseurl = ui_get_full_url(false, false, false, false);
var package_error = "<?php echo __('Error in package updated'); ?>\n";
var bad_mr_file = "<?php echo __('Database MR version is inconsistent, do you want to apply the package?'); ?>\n";
var mr_available_header = "<?php echo __('There are db changes'); ?>\n";
var text1_mr_file = "<?php echo __('There are a new database changes available to apply. Do you want to start the DB update process?'); ?>\n";
var text2_mr_file = "<?php echo __('We recommend launch a '); ?>\n";
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 text1_package_file = "<?php echo __('There is a new update available'); ?>\n";
@ -81,4 +81,4 @@ $baseurl = ui_get_full_url(false, false, false, false);
<script type="text/javascript">
form_upload("<?php echo $baseurl; ?>");
</script>
</script>

@ -82,7 +82,7 @@ echo "<span class='loading' style='font-size:18pt;'>";
echo "<img src='images/wait.gif' />";
echo "</span><br><br>";
echo "<div><b>" . __('The last version of package installed is:') . "</b></div><br>";
echo "<div><b>" . __('The latest version of package installed is:') . "</b></div><br>";
echo "<div id='pkg_version' style='color:#82b92e;font-size:40pt;font-weight:bold;'>" . $current_package . "</div>";
echo "<div class='checking_package' style='font-size:18pt;width:100%; text-align: center; display: none;'>";
@ -147,7 +147,7 @@ var open = "<?php echo $open;?>";
if(open){
$(document).ready(function() {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message":"infomodal"},

@ -36,7 +36,7 @@ $buttons = array(
'offline' => array(
'active' => ($tab == 'offline') ? true : false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offline">' .
html_print_image ("images/box.disabled.png", true, array ("title" => __('Offline update manager'))) .'</a>'),
html_print_image ("images/box.png", true, array ("title" => __('Offline update manager'))) .'</a>'),
'online' => array(
'active' => ($tab == 'online') ? true : false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online">' .

@ -23,6 +23,7 @@ enterprise_hook('open_meta_frame');
include_once($config['homedir'] . "/include/functions_profile.php");
include_once($config['homedir'] . '/include/functions_users.php');
include_once ($config['homedir'] . '/include/functions_groups.php');
include_once ($config['homedir'] . '/include/functions_visual_map.php');
$meta = false;
if(enterprise_installed() && defined("METACONSOLE")) {
@ -30,6 +31,7 @@ if(enterprise_installed() && defined("METACONSOLE")) {
}
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
enterprise_include_once ('include/functions_dashboard.php');
//Add the columns for the enterprise Pandora edition.
$enterprise_include = false;
@ -129,6 +131,9 @@ if ($new_user && $config['admin_can_add_user']) {
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$user_info['id_skin'] = '';
}
$user_info['section'] = '';
$user_info['data_section'] = '';
//This attributes are inherited from global configuration
$user_info['block_size'] = $config["block_size"];
$user_info['flash_chart'] = $config["flash_charts"];
@ -158,12 +163,25 @@ if ($create_user) {
$values['comments'] = (string) get_parameter ('comments');
$values['is_admin'] = (int) get_parameter ('is_admin', 0);
$values['language'] = get_parameter ('language', 'default');
$dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', '');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$values['id_skin'] = (int) get_parameter ('skin', 0);
}
$values['block_size'] = (int) get_parameter ('block_size', $config["block_size"]);
$values['flash_chart'] = (int) get_parameter ('flash_charts', $config["flash_charts"]);
$values['section'] = get_parameter ('section');
if (($values['section'] == 'Event list') || ($values['section'] == 'Group view') || ($values['section'] == 'Alert detail') || ($values['section'] == 'Tactical view') || ($values['section'] == 'Default')) {
$values["data_section"] = '';
} else if ($values['section'] == 'Dashboard') {
$values["data_section"] = $dashboard;
} else if (io_safe_output($values['section']) == 'Visual console') {
$values["data_section"] = $visual_console;
} else if ($values['section'] == 'Other'){
$values["data_section"] = get_parameter ('data_section');
}
if (enterprise_installed()) {
$values['force_change_pass'] = 1;
$values['last_pass_change'] = date ("Y/m/d H:i:s", get_system_time());
@ -266,12 +284,27 @@ if ($update_user) {
$values['comments'] = (string) get_parameter ('comments');
$values['is_admin'] = get_parameter ('is_admin', 0 );
$values['language'] = (string) get_parameter ('language');
$dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', '');
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$values['id_skin'] = get_parameter ('skin', 0);
}
$values['block_size'] = get_parameter ('block_size', $config["block_size"]);
$values['flash_chart'] = get_parameter ('flash_charts', $config["flash_charts"]);
$values['section'] = get_parameter ('section');
if (($values['section'] == 'Event list') || ($values['section'] == 'Group view') || ($values['section'] == 'Alert detail') || ($values['section'] == 'Tactical view') || ($values['section'] == 'Default')) {
$values["data_section"] = '';
} else if ($values['section'] == 'Dashboard') {
$values["data_section"] = $dashboard;
} else if (io_safe_output($values['section']) == 'Visual console') {
$values["data_section"] = $visual_console;
} else if ($values['section'] == 'Other'){
$values["data_section"] = get_parameter ('data_section');
}
if(enterprise_installed() && defined('METACONSOLE')) {
$values['metaconsole_access'] = get_parameter ('metaconsole_access');
$values['metaconsole_agents_manager'] = get_parameter ('metaconsole_agents_manager', '0');
@ -282,6 +315,7 @@ if ($update_user) {
$values["strict_acl"] = (bool)get_parameter ('strict_acl', false);
$values["session_time"] = (int)get_parameter('session_time', 0);
$res1 = update_user ($id, $values);
if ($config['user_can_update_password']) {
@ -324,7 +358,8 @@ if ($update_user) {
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
' Is_admin: ' . $values['is_admin'] .
' Language: ' . $values['language'] .
' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart'];
' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart'] .
' Section: ' . $values['section'];
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$info .= ' Skin: ' . $values['id_skin'];
@ -512,15 +547,59 @@ if (!$meta) {
}
}
$table->data[11][0] = __('Interactive charts'). ' ' .ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true) ;
$table->data[11][0] = __('Interactive charts').' '.ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true) ;
$values = array(-1 => __('Use global conf'), 1 => __('Yes'), 0 => __('No'));
$table->data[11][1] = html_print_select($values, 'flash_charts',
$user_info["flash_chart"], '', '', -1, true, false, false);
$table->data[12][0] = __('Block size for pagination');
$table->data[12][1] = html_print_input_text ('block_size', $user_info["block_size"], '', 5, 5, true);
$table->data[12][0] = __('Home screen').
ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type sec=estado&sec2=operation/agentes/estado_agente to show agent detail view'), true);
$values = array (
'Default' =>__('Default'),
'Visual console'=>__('Visual console'),
'Event list'=>__('Event list'),
'Group view'=>__('Group view'),
'Tactical view'=>__('Tactical view'),
'Alert detail' => __('Alert detail'),
'Other'=>__('Other'));
if (enterprise_installed()) {
$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);
if (enterprise_installed()) {
$dashboards = dashboard_get_dashboards();
$dashboards_aux = array();
if ($dashboards === false) {
$dashboards = array('None'=>'None');
}
else {
foreach ($dashboards as $key => $dashboard) {
$dashboards_aux[$dashboard['name']] = $dashboard['name'];
}
}
$table->data[12][1] .= html_print_select ($dashboards_aux, 'dashboard', $user_info["data_section"], '', '', '', true);
}
$layouts = visual_map_get_user_layouts ($config['id_user'], true);
$layouts_aux = array();
if ($layouts === false) {
$layouts_aux = array('None'=>'None');
}
else {
foreach ($layouts as $layout) {
$layouts_aux[$layout] = $layout;
}
}
$table->data[12][1] .= html_print_select ($layouts_aux, 'visual_console', $user_info["data_section"], '', '', '', true);
$table->data[12][1] .= html_print_input_text ('data_section', $user_info["data_section"], '', 60, 255, true, false);
$table->data[13][0] = __('Block size for pagination');
$table->data[13][1] = html_print_input_text ('block_size', $user_info["block_size"], '', 5, 5, true);
if ($id == $config['id_user']) {
$table->data[12][1] .= html_print_input_hidden('quick_language_change', 1, true);
$table->data[13][1] .= html_print_input_hidden('quick_language_change', 1, true);
}
if (enterprise_installed() && defined('METACONSOLE')) {
@ -528,25 +607,25 @@ if (enterprise_installed() && defined('METACONSOLE')) {
if (isset($user_info["metaconsole_access"])) {
$user_info_metaconsole_access = $user_info["metaconsole_access"];
}
$table->data[12][0] = __('Metaconsole access'). ' ' .ui_print_help_icon ('meta_access', true);
$table->data[13][0] = __('Metaconsole access'). ' ' .ui_print_help_icon ('meta_access', true);
$metaconsole_accesses = array('basic' => __('Basic'),
'advanced' => __('Advanced'));
$table->data[12][1] = html_print_select($metaconsole_accesses,
$table->data[13][1] = html_print_select($metaconsole_accesses,
'metaconsole_access', $user_info_metaconsole_access,
'','',-1,true, false, false);
}
$table->data[13][0] = __('Not Login');
$table->data[13][0] .= ui_print_help_tip(__('The user with not login set only can access to API.'), true);
$table->data[13][1] = html_print_checkbox('not_login', 1, $user_info["not_login"], true);
$table->data[14][0] = __('Not Login');
$table->data[14][0] .= ui_print_help_tip(__('The user with not login set only can access to API.'), true);
$table->data[14][1] = html_print_checkbox('not_login', 1, $user_info["not_login"], true);
$table->data[14][0] = __('Strict ACL');
$table->data[14][0] .= ui_print_help_tip(__('With this option enabled, the user will can access to accurate information. It is not recommended for admin users because performance could be affected'), true);
$table->data[14][1] = html_print_checkbox('strict_acl', 1, $user_info["strict_acl"], true);
$table->data[15][0] = __('Strict ACL');
$table->data[15][0] .= ui_print_help_tip(__('With this option enabled, the user will can access to accurate information. It is not recommended for admin users because performance could be affected'), true);
$table->data[15][1] = html_print_checkbox('strict_acl', 1, $user_info["strict_acl"], true);
$table->data[15][0] = __('Session Time');
$table->data[15][0] .= ui_print_help_tip(__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'), true);
$table->data[15][1] = html_print_input_text ('session_time', $user_info["session_time"], '', 5, 5, true);
$table->data[16][0] = __('Session Time');
$table->data[16][0] .= ui_print_help_tip(__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'), true);
$table->data[16][1] = html_print_input_text ('session_time', $user_info["session_time"], '', 5, 5, true);
if($meta) {
enterprise_include('include/functions_metaconsole.php');
@ -738,6 +817,56 @@ $(document).ready (function () {
$('input:radio[name="is_admin"]').trigger('change');
$('#checkbox-metaconsole_agents_manager').trigger('change');
show_data_section();
});
function show_data_section () {
section = $("#section").val();
switch (section) {
case <?php echo "'" . 'Dashboard' . "'"; ?>:
$("#text-data_section").css("display", "none");
$("#dashboard").css("display", "");
$("#visual_console").css("display", "none");
break;
case <?php echo "'" . 'Visual console' . "'"; ?>:
$("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none");
$("#visual_console").css("display", "");
break;
case <?php echo "'" . 'Event list' . "'"; ?>:
$("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none");
$("#visual_console").css("display", "none");
break;
case <?php echo "'" . 'Group view' . "'"; ?>:
$("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none");
$("#visual_console").css("display", "none");
break;
case <?php echo "'" . 'Tactical view' . "'"; ?>:
$("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none");
$("#visual_console").css("display", "none");
break;
case <?php echo "'" . 'Alert detail' . "'"; ?>:
$("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none");
$("#visual_console").css("display", "none");
break;
case <?php echo "'" . 'Other' . "'"; ?>:
$("#text-data_section").css("display", "");
$("#dashboard").css("display", "none");
$("#visual_console").css("display", "none");
break;
case <?php echo "'" . 'Default' . "'"; ?>:
$("#text-data_section").css("display", "none");
$("#dashboard").css("display", "none");
$("#visual_console").css("display", "none");
break;
}
}
/* ]]> */
</script>

Binary file not shown.

After

(image error) Size: 12 KiB

Binary file not shown.

After

(image error) Size: 11 KiB

Binary file not shown.

After

(image error) Size: 235 B

Binary file not shown.

After

(image error) Size: 284 B

@ -616,10 +616,20 @@ switch ($action) {
}
}
$item_in_db = db_get_row_filter ('tlayout_data', array ('id' => $id_element));
if (($item_in_db['parent_item'] == 0) && ($values['parent_item'] != 0)) {
$new_line = 1;
}
$result = db_process_sql_update('tlayout_data', $values,
array('id' => $id_element));
echo (int)$result;
$return_val = array();
$return_val['correct'] = (int)$result;
$return_val['new_line'] = $new_line;
echo json_encode($return_val);
break;
}
break;

@ -22,8 +22,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC170425';
$pandora_version = 'v7.0NG.702';
$build_version = 'PC170522';
$pandora_version = 'v7.0NG.703';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();
@ -110,18 +110,6 @@ require_once ($ownDir . 'constants.php');
require_once ($ownDir . 'functions_db.php');
require_once ($ownDir . 'functions.php');
db_select_engine();
$config['dbconnection'] = db_connect();
if (! defined ('EXTENSIONS_DIR'))
define ('EXTENSIONS_DIR', 'extensions');
if (! defined ('ENTERPRISE_DIR'))
define ('ENTERPRISE_DIR', 'enterprise');
require_once ($ownDir. 'functions_config.php');
// We need a timezone BEFORE calling config_process_config.
// If not we will get ugly warnings. Set Europe/Madrid by default
// Later will be replaced by the good one.
@ -153,6 +141,18 @@ else{
}
}
db_select_engine();
$config['dbconnection'] = db_connect();
if (! defined ('EXTENSIONS_DIR'))
define ('EXTENSIONS_DIR', 'extensions');
if (! defined ('ENTERPRISE_DIR'))
define ('ENTERPRISE_DIR', 'enterprise');
require_once ($ownDir. 'functions_config.php');
date_default_timezone_set("Europe/Madrid");

@ -1990,9 +1990,32 @@ function get_os_name ($id_os) {
* @return array Dashboard name of the given user.
*/
function get_user_dashboards ($id_user) {
$sql = "SELECT name
FROM tdashboard
WHERE id_user="."'".$id_user."'";
if (users_is_admin($id_user)) {
$sql = "SELECT name
FROM tdashboard WHERE id_user = '" . $id_user ."' OR id_user = ''";
}
else {
$user_can_manage_all = users_can_manage_group_all('RR');
if ($user_can_manage_all) {
$sql = "SELECT name
FROM tdashboard WHERE id_user = '" . $id_user ."' OR id_user = ''";
}
else {
$user_groups = users_get_groups($id_user, "RR", false);
if (empty($user_groups)) {
return false;
}
$u_groups = array();
foreach ($user_groups as $id => $group_name) {
$u_groups[] = $id;
}
$sql = "SELECT name
FROM tdashboard
WHERE id_group IN (" . implode(",", $u_groups) . ") AND (id_user = '" . $id_user ."' OR id_user = '')";
}
}
return db_get_all_rows_sql ($sql);
}

@ -1836,6 +1836,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
continue;
$agent_name = agents_get_name($id_agent, "");
$agent_alias = io_safe_output(agents_get_alias($id_agent));
/* Check for deletion permissions */
$id_group = agents_get_agent_group ($id_agent);
@ -1943,6 +1944,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
if (enterprise_hook('config_agents_has_remote_configuration', array($id_agent))) {
$agent_name = agents_get_name($id_agent);
$agent_name = io_safe_output($agent_name);
$agent_alias = io_safe_output(agents_get_alias($id_agent));
$agent_md5 = md5 ($agent_name, false);
// Agent remote configuration editor
@ -1957,7 +1959,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
if ($error) {
db_pandora_audit( "Agent management",
"Error: Deleted agent '$agent_name', the error is in the delete conf or md5.");
"Error: Deleted agent '$agent_alias', the error is in the delete conf or md5.");
}
}
}
@ -1969,7 +1971,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
db_process_sql ("delete from ttag_module where id_agente_modulo in (select id_agente_modulo from tagente_modulo where id_agente = ".$id_agent.")");
db_pandora_audit( "Agent management",
"Deleted agent '$agent_name'");
"Deleted agent '$agent_alias'");
// Delete the agent from the metaconsole cache
enterprise_include_once('include/functions_agents.php');

@ -655,7 +655,10 @@ function config_update_config () {
$error_update[] = __('Custom report front') . ' - ' . __('First page');
if (!config_update_value ('custom_report_front_footer', get_parameter('custom_report_front_footer')))
$error_update[] = __('Custom report front') . ' - ' . __('Footer');
$error_update[] = __('Custom report front') . ' - ' . __('Footer');
if (!config_update_value ('csv_divider', (string) get_parameter('csv_divider', ';')))
$error_update[] = __('CSV divider');
break;
case 'net':
@ -1620,6 +1623,10 @@ function config_process_config () {
config_update_value ('classic_menu', 0);
}
if (!isset($config["csv_divider"])) {
config_update_value ('csv_divider', ";");
}
if (!isset($config['command_snapshot'])) {
config_update_value ('command_snapshot', 1);
}

@ -353,9 +353,12 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
elseif ($period < SECONDS_1MONTH) {
$time_format = "M \nd H\h";
}
else {
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M \nd H\h";
}
else {
$time_format = "M Y";
}
}
else {
// Set the title and time format
@ -371,9 +374,12 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
elseif ($period < SECONDS_1MONTH) {
$time_format = "M d H\h";
}
else {
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = "M Y";
}
}
$timestamp_short = date($time_format, $timestamp);
@ -1019,10 +1025,17 @@ function graphic_combined_module ($module_list, $weight_list, $period,
elseif ($temp_range <= SECONDS_1MONTH) {
$time_format = 'M d';
$time_format_2 = 'H\h';
}
else {
}
elseif ($temp_range <= SECONDS_1MONTH) {
$time_format = 'M d';
$time_format_2 = 'H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = 'M d';
$time_format_2 = 'H\h';
}
else {
$time_format = "M Y";
}
// Set variables
@ -2304,10 +2317,9 @@ function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value
require_once("include_graph_dependencies.php");
include_graphs_dependencies($config['homedir'].'/');
$src = ui_get_full_url(
"/include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar" .
"&width=".$width."&height=".$height."&progress=".$progress.
"&width=".$width."&homedir=".$config['homedir']."&height=".$height."&progress=".$progress.
"&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str .
"&title=".$title."&font=".$config['fontpath']."&value_text=". $value_text .
"&colorRGB=". $colorRGB, false, false, false
@ -3802,9 +3814,12 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
}
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = 'M d H\h';
$time_format = "M Y";
}
$timestamp_short = date($time_format, $timestamp);
@ -3925,8 +3940,11 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = 'M d H\h';
$time_format = "M Y";
}
// Flash chart
@ -4145,8 +4163,11 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit =
elseif ($period < SECONDS_1MONTH) {
$chart_time_format = 'M d H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$chart_time_format = "M d H\h";
}
else {
$chart_time_format = 'M d H\h';
$chart_time_format = "M Y";
}
// Calculate source indexes
@ -4271,8 +4292,11 @@ function graph_netflow_total_area ($data, $period, $width, $height, $unit = '',
elseif ($period < SECONDS_1MONTH) {
$chart_time_format = 'M d H\h';
}
else {
$chart_time_format = 'M d H\h';
elseif ($period < SECONDS_6MONTHS) {
$chart_time_format = "M d H\h";
}
else {
$chart_time_format = "M Y";
}
// Calculate min, max and avg values
@ -4567,8 +4591,11 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = 'M d H\h';
$time_format = "M Y";
}
$timestamp_short = date($time_format, $timestamp);
@ -4742,8 +4769,11 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu
elseif ($period < SECONDS_1MONTH) {
$time_format = 'M d H\h';
}
else {
$time_format = 'M d H\h';
elseif ($period < SECONDS_6MONTHS) {
$time_format = "M d H\h";
}
else {
$time_format = "M Y";
}
$legend = array();

@ -737,7 +737,7 @@ function html_print_extended_select_for_time ($name, $selected = '',
if (!is_user_admin($config['id_user'])) {
unset($fields[-1]);
$returnString = html_print_select ($fields, $name, $selected,"" . $script,
$returnString = html_print_select ($fields, $name . '_select', $selected,"" . $script,
$nothing, $nothing_value, true, false, false, '', false, 'font-size: xx-small;'.$select_style);
if ($return) {

@ -49,6 +49,9 @@ function menu_print_menu (&$menu) {
'') .
'>';
// Use $config because a global var is required because normal
// and godmode menu are painted separately
if (!isset($config['count_main_menu'])) $config['count_main_menu'] = 0;
foreach ($menu as $mainsec => $main) {
$extensionInMenuParameter = (string) get_parameter ('extension_in_menu','');
@ -369,6 +372,12 @@ function menu_print_menu (&$menu) {
$sub_title = '';
}
// Added a top on inline styles
$top = menu_calculate_top($config['count_main_menu'], $count_sub, $count_sub2);
if ($top !== 0) {
$display = rtrim($display, "'");
$display .= "top: " . $top . "px;'";
}
//Add submenu2 to submenu string
$submenu_output .= "<ul id='sub" . str_replace(' ','_',$sub["id"]) . "' class=submenu2 $display>";
$submenu_output .= $submenu2_list;
@ -419,10 +428,12 @@ function menu_print_menu (&$menu) {
$visible = false;
}
$output .= '<ul id="subicon_'.$id.'" class="submenu'.($visible ? '' : ' invisible').'">';
$top = menu_calculate_top($config["count_main_menu"], $count_sub);
$output .= '<ul id="subicon_'.$id.'" class="submenu'.($visible ? '' : ' invisible').'" style="top: ' . $top . 'px">';
$output .= $submenu_output;
$output .= '</ul>';
}
$config["count_main_menu"]++;
$output .= '</li>';
echo $output;
$menu_selected = false;
@ -718,4 +729,31 @@ function menu_sec3_in_sec2($sec,$sec2,$sec3) {
return false;
}
// Positionate the menu element. Added a negative top.
// 35px is the height of a menu item
function menu_calculate_top($level1, $level2, $level3 = false) {
$level2--;
if ($level3 !== false) {
// If level3 is set, the position is calculated like box is in the center.
// wiouth considering level2 box can be moved.
$level3--;
$total = $level1 + $level3;
$comp = $level3;
} else {
$total = $level1 + $level2;
$comp = $level2;
}
// Positionate in the middle
if ($total > 12 && (($total < 18) || (($level1 - $comp) <= 4))) {
return - ( floor($comp/2) * 35);
}
// Positionate in the bottom
if ($total >= 18) {
return - $comp * 35;
}
// return 0 by default
return 0;
}
?>

@ -1068,6 +1068,8 @@ function ui_print_alert_template_example ($id_alert_template, $return = false, $
* @return string The help tip
*/
function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = "images/help.png") {
global $config;
if (empty($home_url))
$home_url = "";
@ -1078,7 +1080,7 @@ function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image =
$output = html_print_image ($image, true,
array ("class" => "img_help",
"title" => __('Help'),
"onclick" => "open_help ('" . $help_id . "','" . $home_url . "')"));
"onclick" => "open_help ('" . $help_id . "','" . $home_url . "','" . $config['id_user'] . "')"));
if (!$return)
echo $output;
@ -1638,20 +1640,12 @@ function ui_pagination ($count, $url = false, $offset = 0,
}
$number_of_pages = ceil($count / $pagination);
//~ html_debug_print('number_of_pages');
//~ html_debug_print($number_of_pages);
$actual_page = floor($offset / $pagination);
//~ html_debug_print('actual_page');
//~ html_debug_print($actual_page);
$ini_page = floor($actual_page / $block_limit) * $block_limit;
//~ html_debug_print('ini_page');
//~ html_debug_print($ini_page);
$end_page = $ini_page + $block_limit - 1;
if ($end_page > $number_of_pages) {
$end_page = $number_of_pages - 1;
}
//~ html_debug_print('end_page');
//~ html_debug_print($end_page);
$output = "<div class='pagination $other_class'>";
@ -2907,6 +2901,11 @@ function ui_print_agent_autocomplete_input($parameters) {
if (isset($parameters['input_id_server_value'])) {
$input_id_server_value = $parameters['input_id_server_value'];
}
$from_ux_transaction = ''; //Default value
if (isset($parameters['from_ux'])) {
$from_ux_transaction = $parameters['from_ux'];
}
$metaconsole_enabled = false; //Default value
@ -2994,10 +2993,39 @@ function ui_print_agent_autocomplete_input($parameters) {
if (isset($parameters['javascript_name_function_select'])) {
$javascript_name_function_select = $parameters['javascript_name_function_select'];
}
$javascript_code_function_select = '
if ($from_ux_transaction != "") {
$javascript_code_function_select = '
function function_select_' . $input_name . '(agent_name) {
console.log(agent_name);
$("#' . $selectbox_id . '").empty();
var inputs = [];
inputs.push ("id_agent=" + $("#' . $hidden_input_idagent_id . '").val());
inputs.push ("get_agent_transactions=1");
inputs.push ("page=enterprise/include/ajax/ux_transaction.ajax");
jQuery.ajax ({
data: inputs.join ("&"),
type: "POST",
url: action="' . $javascript_ajax_page . '",
dataType: "json",
success: function (data) {
if (data) {
$("#' . $selectbox_id . '").append ($("<option value=0>None</option>"));
jQuery.each (data, function (id, value) {
$("#' . $selectbox_id . '").append ($("<option value=" + id + ">" + value + "</option>"));
});
}
}
});
return false;
}
';
}
else {
$javascript_code_function_select = '
function function_select_' . $input_name . '(agent_name) {
$("#' . $selectbox_id . '").empty ();
@ -3058,6 +3086,8 @@ function ui_print_agent_autocomplete_input($parameters) {
return false;
}
';
}
if (isset($parameters['javascript_code_function_select'])) {
$javascript_code_function_select = $parameters['javascript_code_function_select'];
}

@ -355,8 +355,8 @@ function update_manager_check_online_free_packages ($is_ajax=true) {
var package_error = "<?php echo __('Error in package updated'); ?>\n";
var bad_mr_file = "<?php echo __('Database MR version is inconsistent, do you want to apply the package?'); ?>\n";
var mr_available_header = "<?php echo __('There are db changes'); ?>\n";
var text1_mr_file = "<?php echo __('There are a new database changes available to apply. Do you want to start the DB update process?'); ?>\n";
var text2_mr_file = "<?php echo __('We recommend launch a '); ?>\n";
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 text1_package_file = "<?php echo __('There is a new update available'); ?>\n";
@ -892,4 +892,4 @@ function update_manger_set_deleted_message ($message_id) {
//Mark as read too
update_manger_set_read_message ($message_id, 1);
}
?>
?>

@ -1182,7 +1182,9 @@ function visual_map_print_item($mode = "read", $layoutData,
else if($layoutData['label_position']=='right'){
$imgpos = 'float:left';
}
$varsize = getimagesize($img);
if ($width == 0 || $height == 0) {
if($varsize[0] > 150 || $varsize[1] > 150){
echo html_print_image($img, true,

@ -40,6 +40,11 @@ else $graph_type = '';
ob_start ();
if (!empty($graph_type)) {
$homedir = $_GET['homedir'];
if ($homedir != null) {
$config['homedir'] = $homedir;
}
include_once($homeurl . 'include/functions.php');
include_once($homeurl . 'include/functions_html.php');

@ -1414,33 +1414,29 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
tickColor: background_color,
markings: markings,
color: legend_color
},
xaxes: [ {
axisLabelFontSizePixels: font_size,
axisLabelUseCanvas: false,
axisLabel: xaxisname,
tickFormatter: xFormatter,
//~ minTickSize: steps,
color: '',
font: font
} ],
yaxes: [ {
tickFormatter: yFormatter,
color: ''
},
{
// align if we are to the right
alignTicksWithAxis: 1,
position: 'right',
font: font
//tickFormatter: dFormatter
} ]
,
},
xaxes: [{
axisLabelFontSizePixels: font_size,
axisLabelUseCanvas: false,
axisLabel: xaxisname,
tickFormatter: xFormatter,
labelHeight: 50,
color: '',
font: font
}],
yaxes: [{
tickFormatter: yFormatter,
color: '',
alignTicksWithAxis: 1,
position: 'left',
font: font,
reserveSpace: true,
}],
legend: {
position: 'se',
container: $('#legend_' + graph_id),
labelFormatter: lFormatter
}
}
};
if (vconsole) {
options.grid['hoverable'] = false;
@ -1761,18 +1757,19 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
if (labels[v] == undefined) {
return '';
}
return '<div class='+font+' style="font-size:'+font_size+'pt !important;">'+labels[v]+'</div>';
extra_css = '';
return '<div class='+font+' style="font-size:'+font_size+'pt; margin-top:15px;'+extra_css+'">'+labels[v]+'</div>';
}
function yFormatter(v, axis) {
axis.datamin = 0;
var formatted = number_format(v,force_integer,unit);
return '<div class='+font+' style="font-size:'+font_size+'pt !important;">'+formatted+'</div>';
return '<div class='+font+' style="font-size:'+font_size+'pt;">'+formatted+'</div>';
}
function lFormatter(v, item) {
return '<div style="font-size:'+font_size+'pt !important;">'+v+'</div>';
return '<div style="font-size:'+font_size+'pt;">'+v+'</div>';
// Prepared to turn series with a checkbox
//return '<div style=color:;font-size:'+font_size+'pt><input type="checkbox" id="' + graph_id + '_' + item.id +'" checked="checked" class="check_serie_'+graph_id+'">'+v+'</div>';
}
@ -1919,16 +1916,14 @@ function adjust_menu(graph_id, plot, parent_height, width) {
menu_height = $('#menu_'+graph_id).height();
}
offset_between_graph_and_div_graph_container = $('#' + graph_id).offset().top -
$('#' + graph_id).parent().offset().top;
$('#menu_' + graph_id)
.css('top',
((offset_between_graph_and_div_graph_container - menu_height - 5) + 'px'));
offset = $('#' + graph_id)[0].offsetTop;
console.log(offset);
$('#menu_' + graph_id).css('top', ((offset) + 'px'));
//$('#legend_' + graph_id).css('width',plot.width());
$('#menu_' + graph_id)
.css('left',width - $('#menu_'+graph_id).width());
//~ $('#menu_' + graph_id).css('left', $('#'+graph_id)[0].offsetWidth);
$('#menu_' + graph_id).show();
}

@ -278,4 +278,35 @@ function d3_gauges($chart_data, $width, $height, $color, $legend,
return $output;
}
function ux_console_phases_donut ($phases, $id, $return = false) {
global $config;
foreach ($phases as $i => $phase) {
$phases[$i]['phase_name'] = io_safe_output($phase['phase_name']);
}
if (is_array($phases))
$phases = json_encode($phases);
$recipient_name = "phases_donut_" . $id;
$recipient_name_to_js = "#phases_donut_" . $id;
$output = "<div id=" . $recipient_name . " style='overflow: hidden;'></div>";
$output .= include_javascript_d3(true);
$output .= "<style type=\"text/css\">
path {
stroke: #fff;
fill-rule: evenodd;
}
</style>";
$output .= "<script language=\"javascript\" type=\"text/javascript\">
print_phases_donut('" . $recipient_name_to_js . "', " . $phases . ");
</script>";
if (!$return)
echo $output;
return $output;
}
?>

@ -203,7 +203,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
}
// Parent layer
$return = "<div class='parent_graph' style='width: " . $width . "px; " . $background_style . "'>";
$return = "<div class='parent_graph' style='width: " . ($width) . "px; " . $background_style . "'>";
// Set some containers to legend, graph, timestamp tooltip, etc.
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:$font_size"."pt !important;'></p>";
@ -242,12 +242,18 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
}
$menu_width = 25 * $nbuttons + 15;
if ( $dashboard == false AND $vconsole == false) {
$return .= "<div id='menu_$graph_id' class='menu_graph' " .
$return .= "<div id='geneal_menu_$graph_id' class='menu_graph' style='
width: 30px;
height: 250px;
left: " . $width . "px;
position: absolute;
top: 0px;
background-color: white;'>";
$return .= "<div id='menu_$graph_id' " .
"style='display: none; " .
"text-align: center; " .
"width: " . $menu_width . "px; ".
"border-bottom: 0px; " .
"padding: 4px 4px 4px 4px;margin-bottom:5px;'>
"text-align: center;" .
"position: relative;".
"border-bottom: 0px;'>
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross_grey.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";
if ($threshold) {
$return .= " <a href='javascript:'><img id='menu_threshold_$graph_id' src='".$homeurl."images/chart_curve_threshold.png' alt='".__('Warning and Critical thresholds')."' title='".__('Warning and Critical thresholds')."'></a>";
@ -261,6 +267,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
//$return .= " <a href='javascript:'><img id='menu_export_json_$graph_id' src='".$homeurl."images/json.png' alt='".__('Export to JSON')."' title='".__('Export to JSON')."'></a>";
$return .= "</div>";
$return .= "</div>";
}
}
$return .= html_print_input_hidden('line_width_graph', $config['custom_graph_width'], true);
@ -275,7 +282,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$height = 1;
}
if (!$dashboard && !$vconsole)
$return .= "<div id='overview_$graph_id' class='overview_graph' style='display: none; margin-left:0px; margin-top:20px; width: ".$width."px; height: ".$height ."px;'></div>";
$return .= "<div id='overview_$graph_id' class='overview_graph' style='display: none; margin-left:0px; margin-top:20px; margin-bottom:50px; width: ".$width."px; height: ".$height ."px;'></div>";
if ($water_mark != '') {
$return .= "<div id='watermark_$graph_id' style='display:none; position:absolute;'><img id='watermark_image_$graph_id' src='$water_mark'></div>";

@ -1326,4 +1326,168 @@ function Gauge(placeholderName, configuration, font)
// initialization
this.configure(configuration);
}
function print_phases_donut (recipient, phases) {
var svg = d3.select(recipient)
.append("svg")
.attr("width", 600)
.attr("height", 300)
.append("g");
svg.append("g")
.attr("class", "slices");
svg.append("g")
.attr("class", "labels");
svg.append("g")
.attr("class", "lines");
var width = 550,
height = 300,
radius = Math.min(width, height) / 2;
var pie = d3.layout.pie()
.sort(null)
.value(function(d) {
return parseFloat(d.label2);
});
var arc = d3.svg.arc()
.outerRadius(radius * 0.8)
.innerRadius(radius * 0.4);
var outerArc = d3.svg.arc()
.innerRadius(radius * 0.9)
.outerRadius(radius * 0.9);
svg.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
var key = function(d){ return d.data.label; };
function phasesData (){
return phases.map(function(phase){
return { label: phase_name(phase, 1), label2: phase_name(phase, 2), value: phase.status }
});
}
function phase_name (phase, index) {
if (index == 1) {
return phase.phase_name;
}
else {
return phase.phase_time;
}
}
print_phases(phasesData());
function print_phases(data) {
/* ------- PIE SLICES -------*/
var slice = svg.select(".slices").selectAll("path.slice")
.data(pie(data), key);
slice.enter()
.insert("path")
.style("fill", function(d) {
if (d.data.value == 0) {
return "#80BA27";
}
else {
return "#FC4444";
}
})
.attr("class", "slice");
slice
.transition().duration(0)
.attrTween("d", function(d) {
this._current = this._current || d;
var interpolate = d3.interpolate(this._current, d);
this._current = interpolate(0);
return function(t) {
return arc(interpolate(t));
};
});
slice.exit()
.remove();
/* ------- TEXT LABELS -------*/
var text = svg.select(".labels").selectAll("text")
.data(pie(data), key);
text.enter()
.append("text")
.append("tspan")
.attr("dy", ".1em")
.text(function(d) {
return d.data.label;
})
.style("font-family", "Verdana")
.style("font-size", "10px")
.append("tspan")
.attr("dy", "1.4em")
.attr("dx", "-6em")
.text(function(d) {
return d.data.label2 + "ms";
})
.style("font-family", "Verdana")
.style("font-size", "10px");
function midAngle(d){
return d.startAngle + (d.endAngle - d.startAngle)/2;
}
text.transition().duration(0)
.attrTween("transform", function(d) {
this._current = this._current || d;
var interpolate = d3.interpolate(this._current, d);
this._current = interpolate(0);
return function(t) {
var d2 = interpolate(t);
var pos = outerArc.centroid(d2);
pos[0] = radius * (midAngle(d2) < Math.PI ? 1 : -1);
return "translate("+ pos +")";
};
})
.styleTween("text-anchor", function(d){
this._current = this._current || d;
var interpolate = d3.interpolate(this._current, d);
this._current = interpolate(0);
return function(t) {
var d2 = interpolate(t);
return midAngle(d2) < Math.PI ? "start":"end";
};
});
text.exit()
.remove();
/* ------- SLICE TO TEXT POLYLINES -------*/
var polyline = svg.select(".lines").selectAll("polyline")
.data(pie(data), key);
polyline.enter()
.append("polyline");
polyline.transition().duration(0)
.attrTween("points", function(d){
this._current = this._current || d;
var interpolate = d3.interpolate(this._current, d);
this._current = interpolate(0);
return function(t) {
var d2 = interpolate(t);
var pos = outerArc.centroid(d2);
pos[0] = radius * 0.95 * (midAngle(d2) < Math.PI ? 1 : -1);
return [arc.centroid(d2), outerArc.centroid(d2), pos];
};
})
.style("stroke", "black")
.style("opacity", ".3")
.style("stroke-width", "2px")
.style("fill", "none");
polyline.exit()
.remove();
}
}

@ -36,9 +36,11 @@ function clippy_extension_cron_send_email() {
'intro' => '<table>' .
'<tr>' .
'<td class="context_help_body">' .
'<div style="word-break: break-word;">' .
__('The configuration of email for the task email is in the file:') . '<br />' .
'&lt;www&gt;/pandora_console/enterprise/extensions/cron/email_config.php <br />' .
__('Please check if the email configuration is correct.') .
'</div>' .
'</td>' .
'</tr>' .
'</table>'

@ -31,6 +31,7 @@ Apart from the defined module macros, the following macros are also available:
<li>_agentdescription_ : Description of the agent who fired alert.</li>
<li>_agentgroup_ : Agent group name.</li>
<li>_agentstatus_ : Current status of the agent.</li>
<li>_agentos_: Agent's operative system.</li>
<li>_address_ : Address of the agent that fired the alert.</li>
<li>_timestamp_ : Time when the alert was fired (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_ : Timezone name that _timestamp_ represents in.</li>

@ -61,6 +61,7 @@ Besides the defined module macros, the following macros are available:
<li>_moduletags_: URLs associated to the modules tags.</li>
<li>_alert_critical_instructions_: Instructions for CRITICAL status contained in the module.</li>
<li>_alert_warning_instructions_: Instructions for WARNING status contained in the module.</li>
<li>_alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.</li>
<li>_modulegraph_<i>n</i>h_: (>=6.0) (Only for alerts that use the command <i>eMail</i>)
Returns an image encoded in base64 of a modules graph with a period of <i>n</i> hours (eg. _modulegraph_24h_).
A correct setup of the connection between the server and the console's API is required.

@ -1,11 +1,31 @@
<h1>Cascade protection</h1>
<h1 style='text-align:center;'>Cascade protection</h1>
<br>
<?php html_print_image("images/help/cascade_protection_ilustration.png", false); ?>
<h2>Agent cascade protection</h2>
<hr>
<div style='text-align:center;'>
<?php html_print_image("images/help/cascade_protection_agent.png", false); ?>
</div>
<br>
<p>
This option should be assigned to avoid an “alert storm” that can come in because a group of agents are unreachable. This type of behaviour occurs when an intermediary device, like for example a router, is down and all devices behind it, therefore, cannot be reached. Probably these devices arent down and chances indicate that theyre working with another router in HA mode. But, if nothing is done, its likely for Pandora FMS to think that theyre down since they cant be tested using a Remote ICMP Proc test (a Ping check).
<br><br>
When you enable <i>cascade protection</i> for an agent, this means that if any of its parents has a CRITICAL alert fired, then the agents alerts WILL NOT BE fired. If the agent's parent has a module in CRITICAL or several alerts with less criticality than CRITICAL, alerts from the agent will be fired as normal if needed. Cascade protection checks parent alerts with CRITICAL priority, including the correlated alerts assigned to the parent.
When you enable <i>cascade protection</i> for an agent, this means that if any of its parents has a CRITICAL alert fired, then the agents alerts <strong>WILL NOT BE</strong> fired. If the agent's parent has a module in CRITICAL or several alerts with less criticality than CRITICAL, alerts from the agent will be fired as normal if needed. Cascade protection checks parent alerts with CRITICAL priority, including the correlated alerts assigned to the parent.
<br><br>
If you want to use an advanced cascade protection system, just use correlation among successive parents, and just enable Cascade Protection for the children.
</p>
<br>
<h2>Module cascade protection</h2>
<hr>
<div style='text-align:center;'>
<?php html_print_image("images/help/cascade_protection_module.png", false); ?>
<br>
</div>
<p>
This option should be assigned to avoid an “alert storm” that can come in because a group of agents are unreachable. This type of behaviour occurs when an intermediary device, like for example a router, is down and all devices behind it, therefore, cannot be reached. Probably these devices arent down and chances indicate that theyre working with another router in HA mode. But, if nothing is done, its likely for Pandora FMS to think that theyre down since they cant be tested using a Remote ICMP Proc test (a Ping check).
<br><br>
When you enable <i>cascade protection</i> for an module, this means that if this parent agent module has a CRITICAL alert fired, then agent alerts <strong>WILL NOT BE</strong> fired.
<br><br>
If you want to use an advanced cascade protection system, just use correlation among successive parents, and just enable Cascade Protection for the children.
</p>

@ -34,6 +34,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
<li>_agentgroup_ : Nombre del grupo del agente.</li>
<li>_agentstatus_ : Estado actual del agente.</li>
<li>_address_: Dirección del agente que disparó la alerta.</li>
<li>_agentos_: Sistema operativo del agente.</li>
<li>_timestamp_: Hora y fecha en que se disparó la alerta.</li>
<li>_timezone_: Area Nombre _timestamp_ que representa en.</li>
<li>_data_: Dato que hizo que la alerta se disparase.</li>

@ -61,6 +61,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
<li>_moduletags_: URLs asociadas a los tags de módulos.</li>
<li>_alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.</li>
<li>_alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.</li>
<li>_alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.</li>
<li>_modulegraph_<i>n</i>h_: (>=6.0) (Solo para alertas que usen el comando <i>eMail</i>)
Devuelve una imagen codificada en base64 de una gráfica del módulo con un período de <i>n</i> horas (eg. _modulegraph_24h_).
Requiere de una configuración correcta de la conexión del servidor a la consola vía api,

@ -1,17 +1,31 @@
<h1>Protección en Cascada</h1>
<h1 style='text-align:center;'>Protección en Cascada</h1>
<br>
<?php html_print_image("images/help/cascade_protection_ilustration.png", false); ?>
<h2>Protección en cascada por agente</h2>
<hr>
<div style='text-align:center;'>
<?php html_print_image("images/help/cascade_protection_agent.png", false); ?>
</div>
<br>
<p>
Esta opción se designa para evitar una "tormenta" de alertas que entren porque un grupo de agentes son inalcanzables. Este tipo de comportamiento ocurre cuando un dispositivo intermedio, como por ejemplo un router, está caido, y todos los dispositivos que están tras él no se pueden alcanzar. Probablemente estos dispositivos no estén caídos e incluso estos dispositivos estén trabajando junto con otro router, en modo HA. Pero si no hace nada, probablemente Pandora FMS piense que estén caídos porque no los pueden testar con un Remote ICMP Proc Test (un ping).
<br><br>
Cuando habilite <i>cascade protection</i> en un agente, esto significa que si cualquiera de sus padres tiene una alerta CRÍTICA disparada, entonces las alertas del agente NO SERÁN disparadas. Si el padre del agente tiene un módulo en CRITICAL o varias alertas con menor criticidad que CRITICAL, las alertas del agente serán disparadas si deben hacerlo. La protección en cascada comprueba las alertas padre con criticidad CRITICAL, incluyendo las alertas de correlación asignadas al padre.
Cuando habilite <i>cascade protection</i> en un agente, esto significa que si cualquiera de sus padres tiene una alerta CRÍTICA disparada, entonces las alertas del agente <strong>NO SERÁN</strong> disparadas. Si el padre del agente tiene un módulo en CRITICAL o varias alertas con menor criticidad que CRITICAL, las alertas del agente serán disparadas si deben hacerlo. La protección en cascada comprueba las alertas padre con criticidad CRITICAL, incluyendo las alertas de correlación asignadas al padre.
<br><br>
Si quiere usar un sistema avanzado de protección en cascada, sólo tiene que usar correlación entre padres sucesivos, y que sólo habilite la Protección en Cascada en los hijos.
</p>
<br>
<h2>Protección en cascada por módulo</h2>
<hr>
<div style='text-align:center;'>
<?php html_print_image("images/help/cascade_protection_module.png", false); ?>
</div>
<br>
<p>
Esta opción se designa para evitar una "tormenta" de alertas que entren porque un grupo de agentes son inalcanzables. Este tipo de comportamiento ocurre cuando un dispositivo intermedio, como por ejemplo un router, está caido, y todos los dispositivos que están tras él no se pueden alcanzar. Probablemente estos dispositivos no estén caídos e incluso estos dispositivos estén trabajando junto con otro router, en modo HA. Pero si no hace nada, probablemente Pandora FMS piense que estén caídos porque no los pueden testar con un Remote ICMP Proc Test (un ping).
<br><br>
Cuando habilite <i>cascade protection</i> en un módulo de un agente, esto significa que si este módulo del agente padre tiene una alerta CRÍTICA disparada, entonces las alertas del agente <strong>NO SERÁN</strong> disparadas.
<br><br>
Si quiere usar un sistema avanzado de protección en cascada, sólo tiene que usar correlación entre padres sucesivos, y que sólo habilite la Protección en Cascada en los hijos.
</p>

@ -31,6 +31,7 @@ email アクションを設定するには、_field1_ (送信先アドレス)、
<li>_agentdescription_ : 発生したアラートの説明</li>
<li>_agentgroup_ : エージェントグループ名</li>
<li>_agentstatus : エージェントの現在の状態</li>
<li>_agentos_: Agent's operative system</li>
<li>_address_ : アラートが発生したエージェントのアドレス</li>
<li>_timestamp_ : アラートが発生した日時 (yy-mm-dd hh:mm:ss).</li>
<li>_timezone_: _timestamp_ で使用されるタイムゾーン名.</li>

@ -60,6 +60,7 @@
<li>_moduletags_ : モジュールタグに関連付けられた URL。</li>
<li>_alert_critical_instructions_: モジュールの障害状態時手順。</li>
<li>_alert_warning_instructions_: モジュールの警告状態時手順。</li>
<li>_alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.</li>
<li>_modulegraph_<i>n</i>h_: (>=6.0) (<i>eMail</i>コマンドを使うアラートのみ)
n で示す期間の base64 でエンコードされたモジュールグラフを返します。(: _modulegraph_24h_) サーバとコンソールの API の設定が正しくできている必要があります。この設定は、サーバの設定ファイルで行います。 </li>
</ul>

@ -33,7 +33,7 @@
$(document).ready (function () {
$("a#show_messages_dialog").click (function () {
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{"page": "operation/messages/message_list"},
function (data, status) {
$("#dialog_messages").hide ()
@ -60,7 +60,7 @@ $(document).ready (function () {
$("a.show_systemalert_dialog").click (function () {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{"page": "operation/system_alert"},
function (data, status) {
$("#alert_messages").hide ()
@ -75,9 +75,11 @@ $(document).ready (function () {
$("a.modalpopup").click (function () {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.get ("ajax.php",
{"page": "general/alert_enterprise",
"message":$(this).attr("id")},
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message": $(this).attr("id")
},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
@ -93,10 +95,11 @@ $(document).ready (function () {
$(".publienterprise").click (function () {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message":$(this).attr("id")},
"page": "general/alert_enterprise",
"message": $(this).attr("id")
},
function (data, status) {
$("#alert_messages").hide ()
.empty ()
@ -112,10 +115,11 @@ $(document).ready (function () {
$(".publienterprisehide").click (function () {
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{
"page": "general/alert_enterprise",
"message":$(this).attr("id")},
"page": "general/alert_enterprise",
"message": $(this).attr("id")
},
function (data, status) {
$("#alert_messages").hide ()
.empty ()

@ -22,8 +22,8 @@ function winopeng_var (url, wid, width, height) {
status = wid;
}
function open_help (help_id, home_url) {
open (home_url+"general/pandora_help.php?id="+help_id, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0");
function open_help (help_id, home_url, id_user) {
open (home_url+"general/pandora_help.php?id="+help_id+"&id_user="+id_user, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0");
}
/**

@ -17,7 +17,6 @@
* @param editor Boolean variable to set other css selector in editor (when true).
*/
function draw_line (line, id_div) {
selector = '';
//Check if the global var resize_map is defined
@ -38,17 +37,40 @@ function draw_line (line, id_div) {
have_node_begin_img = $('#' + line['node_begin'] + " img").length;
have_node_end_img = $('#' + line['node_end'] + " img").length;
if (have_node_begin_img) {
var img_pos_begin = $('#' + line['node_begin'] + " img").position();
var img_margin_left_begin = $('#' + line['node_begin'] + " img").css("margin-left");
var img_margin_left_begin_aux = img_margin_left_begin.split("px");
img_margin_left_begin = parseFloat(img_margin_left_begin_aux[0]);
var img_margin_top_begin = $('#' + line['node_begin'] + " img").css("margin-top");
var img_margin_top_begin_aux = img_margin_top_begin.split("px");
img_margin_top_begin = parseFloat(img_margin_top_begin_aux[0]);
}
if (have_node_end_img) {
var img_pos_end = $('#' + line['node_end'] + " img").position();
var img_margin_left_end = $('#' + line['node_end'] + " img").css("margin-left");
var img_margin_left_end_aux = img_margin_left_end.split("px");
img_margin_left_end = parseFloat(img_margin_left_end_aux[0]);
var img_margin_top_end = $('#' + line['node_end'] + " img").css("margin-top");
var img_margin_top_end_aux = img_margin_top_end.split("px");
img_margin_top_end = parseFloat(img_margin_top_end_aux[0]);
}
if (line['x1']) {
x1 = line['x'];
}
else {
if (have_node_begin_img) {
width = $('#' + line['node_begin'] + " img").width();
x1 = parseInt($('#' + line['node_begin']).css (selector + 'left')) + (width / 2) + img_pos_begin.left + img_margin_left_begin;
}
else {
width = $('#' + line['node_begin']).width();
x1 = parseInt($('#' + line['node_begin']).css (selector + 'left')) + (width / 2);
}
x1 = parseInt($('#' + line['node_begin']).css (selector + 'left')) + (width / 2);
}
if (line['y1']) {
@ -57,11 +79,12 @@ function draw_line (line, id_div) {
else {
if (have_node_begin_img) {
height = parseInt($('#' + line['node_begin'] + " img").css('height'));
y1 = parseInt($('#' + line['node_begin']).css (selector + 'top')) + (height / 2) + img_pos_begin.top + img_margin_top_begin;
}
else {
height = $('#' + line['node_begin']).height();
y1 = parseInt($('#' + line['node_begin']).css (selector + 'top')) + (height / 2);
}
y1 = parseInt($('#' + line['node_begin']).css (selector + 'top')) + (height / 2);
}
if (line['x2']) {
@ -70,11 +93,12 @@ function draw_line (line, id_div) {
else {
if (have_node_end_img) {
width = $('#' + line['node_end'] + " img").width();
x2 = parseInt($('#' + line['node_end']).css (selector + 'left')) + (width / 2) + img_pos_end.left + img_margin_left_end;
}
else {
width = $('#' + line['node_end']).width();
x2 = parseInt($('#' + line['node_end']).css (selector + 'left')) + (width / 2);
}
x2 = parseInt($('#' + line['node_end']).css (selector + 'left')) + (width / 2);
}
if (line['y2']) {
@ -83,11 +107,12 @@ function draw_line (line, id_div) {
else {
if (have_node_end_img) {
height = parseInt($('#' + line['node_end'] + " img").css('height'));
y2 = parseInt($('#' + line['node_end']).css (selector + 'top')) + (height / 2) + img_pos_end.top + img_margin_top_end;
}
else {
height = $('#' + line['node_end']).height();
y2 = parseInt($('#' + line['node_end']).css (selector + 'top')) + (height / 2);
}
y2 = parseInt($('#' + line['node_end']).css (selector + 'top')) + (height / 2);
}

BIN
pandora_console/include/languages/en_GB.mo Executable file → Normal file

Binary file not shown.

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