Merge remote-tracking branch 'origin/develop' into 2221-Actualizacion_de_Pandora_a_version_7_de_PHP
Conflicts: pandora_console/extras/mr/22.sql pandora_console/include/chart_generator.php pandora_console/include/functions_graph.php pandora_console/include/functions_reporting.php pandora_console/include/functions_reporting_html.php pandora_console/include/graphs/fgraph.php
This commit is contained in:
commit
0b0bad8a73
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.727, AIX version
|
||||
# Version 7.0NG.728, 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.727, FreeBSD Version
|
||||
# Version 7.0NG.728, 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.727, HP-UX Version
|
||||
# Version 7.0NG.728, 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.727, GNU/Linux
|
||||
# Version 7.0NG.728, 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.727, GNU/Linux
|
||||
# Version 7.0NG.728, 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.727, Solaris Version
|
||||
# Version 7.0NG.728, 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.727
|
||||
# Version 7.0NG.728
|
||||
|
||||
# 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.727, AIX version
|
||||
# Version 7.0NG.728, 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.727
|
||||
# Version 7.0NG.728
|
||||
# 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.727, HPUX Version
|
||||
# Version 7.0NG.728, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.727
|
||||
# Version 7.0NG.728
|
||||
# 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.727
|
||||
# Version 7.0NG.728
|
||||
# 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.727
|
||||
# Version 7.0NG.728
|
||||
# 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.727, Solaris version
|
||||
# Version 7.0NG.728, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.727, AIX version
|
||||
# Version 7.0NG.728, 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.727-181022
|
||||
Version: 7.0NG.728-181025
|
||||
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.727-181022"
|
||||
pandora_version="7.0NG.728-181025"
|
||||
|
||||
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.727, GNU/Linux
|
||||
# Version 7.0NG.728, 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.727, FreeBSD Version
|
||||
# Version 7.0NG.728, 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.727, HP-UX Version
|
||||
# Version 7.0NG.728, 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.727, GNU/Linux
|
||||
# Version 7.0NG.728, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.727, GNU/Linux
|
||||
# Version 7.0NG.728, 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.727, NetBSD Version
|
||||
# Version 7.0NG.728, 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.727, Solaris Version
|
||||
# Version 7.0NG.728, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -41,8 +41,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.727';
|
||||
use constant AGENT_BUILD => '181022';
|
||||
use constant AGENT_VERSION => '7.0NG.728';
|
||||
use constant AGENT_BUILD => '181025';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.727
|
||||
%define release 181022
|
||||
%define version 7.0NG.728
|
||||
%define release 181025
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -95,7 +95,7 @@ if [ ! -e /etc/pandora/plugins ]; then
|
|||
fi
|
||||
|
||||
if [ ! -e /etc/pandora/collections ]; then
|
||||
ln -s /usr/share/pandora_agent/collections /etc/pandora
|
||||
mkdir -p /etc/pandora/collections
|
||||
fi
|
||||
|
||||
mkdir -p /var/spool/pandora/data_out
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.727
|
||||
%define release 181022
|
||||
%define version 7.0NG.728
|
||||
%define release 181025
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -88,7 +88,7 @@ if [ ! -e /etc/pandora/plugins ]; then
|
|||
fi
|
||||
|
||||
if [ ! -e /etc/pandora/collections ]; then
|
||||
ln -s /usr/share/pandora_agent/collections /etc/pandora
|
||||
mkdir /etc/pandora/collections
|
||||
fi
|
||||
cp -aRf /usr/share/pandora_agent/pandora_agent_logrotate /etc/logrotate.d/pandora_agent
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.727"
|
||||
PI_BUILD="181022"
|
||||
PI_VERSION="7.0NG.728"
|
||||
PI_BUILD="181025"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -388,8 +388,8 @@ install () {
|
|||
|
||||
ln -s $PANDORA_BASE_REAL$PANDORA_HOME/plugins $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
echo "Copying Pandora FMS Agent collections to $PANDORA_BASE$PANDORA_HOME/collections..."
|
||||
cp -r collections $PANDORA_BASE$PANDORA_HOME
|
||||
echo "Creating the collections directory in to $PANDORA_BASE$PANDORA_HOME/collections..."
|
||||
mkdir -p $PANDORA_BASE$PANDORA_HOME/collections
|
||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/collections
|
||||
ln -s $PANDORA_BASE_REAL$PANDORA_HOME/collections $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2017 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.727
|
||||
# Version 7.0NG.728
|
||||
|
||||
# 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.727}
|
||||
{Pandora FMS Windows Agent v7.0NG.728}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{181022}
|
||||
{181025}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -227,7 +227,7 @@ int Cron::getResetValue (int position) {
|
|||
* @return false if should not execute
|
||||
*/
|
||||
bool Cron::shouldExecuteAt (time_t date) {
|
||||
return this->utimestamp < date;
|
||||
return this->utimestamp <= date;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.727(Build 181022)")
|
||||
#define PANDORA_VERSION ("7.0NG.728(Build 181025)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.727(Build 181022))"
|
||||
VALUE "ProductVersion", "(7.0NG.728(Build 181025))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.727-181022
|
||||
Version: 7.0NG.728-181025
|
||||
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.727-181022"
|
||||
pandora_version="7.0NG.728-181025"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -48,7 +48,7 @@ function createXMLData($agent, $agentModule, $time, $data) {
|
|||
$data
|
||||
);
|
||||
|
||||
$file_name = $config["remote_config"] . "/" . io_safe_output($agent["alias"]) . "." . str_replace($time, " ", "_") . ".data";
|
||||
$file_name = $config["remote_config"] . "/" . io_safe_output($agent["alias"]) . "." . strtotime($time) . ".data";
|
||||
return (bool) @file_put_contents($file_name, $xml);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ function mainInsertData() {
|
|||
$utimestamp = strtotime($date . " " . $time) - get_fixed_offset();
|
||||
$timestamp = date(DATE_FORMAT . " " . TIME_FORMAT, $utimestamp);
|
||||
$result = createXMLData($agent, $agentModule, $timestamp, $data);
|
||||
|
||||
|
||||
if ($result) {
|
||||
$done++;
|
||||
}
|
||||
|
|
|
@ -77,6 +77,15 @@ switch($graph) {
|
|||
if (count($data_array) > 1) {
|
||||
$data = $data_array[1];
|
||||
}
|
||||
// Redefine boolean data
|
||||
switch ($data) {
|
||||
case "up(1)":
|
||||
$data = 1;
|
||||
break;
|
||||
case "down(0)":
|
||||
$data = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -2,4 +2,6 @@ START TRANSACTION;
|
|||
|
||||
ALTER TABLE `tusuario` DROP COLUMN `flash_chart`;
|
||||
|
||||
COMMIT;
|
||||
ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -1741,6 +1741,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` (
|
|||
PRIMARY KEY(`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tlayout_template_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
|
|
@ -210,6 +210,7 @@ if (!empty($all_data)) {
|
|||
echo '<div id="activity">';
|
||||
|
||||
$table = new stdClass();
|
||||
$table->class = "databox data";
|
||||
$table->width = '100%'; //Don't specify px
|
||||
$table->data = array ();
|
||||
$table->size = array ();
|
||||
|
@ -274,7 +275,12 @@ if (!empty($all_data)) {
|
|||
. human_time_comparation($session['utimestamp'], 'tiny');
|
||||
$data[3] = $session_ip_origen;
|
||||
$description = str_replace(array(',', ', '), ', ', $session['descripcion']);
|
||||
$data[4] = '<div >' . io_safe_output($description) . '</div>';
|
||||
if(strlen($description)>100){
|
||||
$data[4] = '<div >' . io_safe_output(substr($description, 0, 150).'...') . '</div>';
|
||||
}
|
||||
else{
|
||||
$data[4] = '<div >' . io_safe_output($description) . '</div>';
|
||||
}
|
||||
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@ foreach ($result as $row) {
|
|||
$data[2] = ui_print_help_tip(date($config["date_format"], $row["utimestamp"]), true)
|
||||
. ui_print_timestamp($row["utimestamp"], true);
|
||||
$data[3] = $row["ip_origen"];
|
||||
$data[4] = $row["descripcion"];
|
||||
$data[4] = io_safe_output($row["descripcion"]);
|
||||
|
||||
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
|
||||
$data[5] = enterprise_hook("cell1EntepriseAudit", array($row["id_sesion"]));
|
||||
|
|
|
@ -541,7 +541,7 @@ if (!empty($interfaces_list)) {
|
|||
$table->data[0][1] = '';
|
||||
$table->data[0][2] = '<b>'.__('Modules').'</b>';
|
||||
|
||||
$table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px;');
|
||||
$table->data[1][0] = html_print_select ($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px; overflow: auto;');
|
||||
$table->data[1][1] = html_print_image('images/darrowright.png', true);
|
||||
$table->data[1][2] = html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;');
|
||||
$table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true);
|
||||
|
|
|
@ -1772,13 +1772,15 @@ if (!empty($duplicate_module)) { // DUPLICATE agent module !
|
|||
// =====================
|
||||
if ($enable_module) {
|
||||
$result = modules_change_disabled($enable_module, 0);
|
||||
|
||||
$modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$enable_module."");
|
||||
$modulo_nombre = $modulo_nombre['nombre'];
|
||||
|
||||
if ($result === NOERR) {
|
||||
enterprise_hook('config_agents_enable_module_conf', array($id_agente, $enable_module));
|
||||
db_pandora_audit("Module management", 'Enable ' . $enable_module);
|
||||
db_pandora_audit("Module management", 'Enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("Module management", 'Fail to enable ' . $enable_module);
|
||||
db_pandora_audit("Module management", 'Fail to enable #' . $enable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
|
@ -1787,13 +1789,15 @@ if ($enable_module) {
|
|||
|
||||
if ($disable_module) {
|
||||
$result = modules_change_disabled($disable_module, 1);
|
||||
|
||||
$modulo_nombre = db_get_row_sql("SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = ".$disable_module."");
|
||||
$modulo_nombre = $modulo_nombre['nombre'];
|
||||
|
||||
if ($result === NOERR) {
|
||||
enterprise_hook('config_agents_disable_module_conf', array($id_agente, $disable_module));
|
||||
db_pandora_audit("Module management", 'Disable ' . $disable_module);
|
||||
db_pandora_audit("Module management", 'Disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("Module management", 'Fail to disable ' . $disable_module);
|
||||
db_pandora_audit("Module management", 'Fail to disable #' . $disable_module . ' | ' . $modulo_nombre . ' | ' . $agent["alias"]);
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
|
|
|
@ -139,7 +139,7 @@ if (($policy_page) || (isset($agent))) {
|
|||
echo '</td>';
|
||||
}
|
||||
echo '<td class="datos" style="font-weight: bold; width:20%;">';
|
||||
echo __("Type");
|
||||
echo __("<p>Type</p>");
|
||||
html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' );
|
||||
html_print_input_hidden ('edit_module', 1);
|
||||
echo '</td>';
|
||||
|
@ -607,7 +607,7 @@ foreach ($modules as $module) {
|
|||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK)
|
||||
$table->colspan[$i - 1][0] = 10;
|
||||
else
|
||||
$table->colspan[$i - 1][0] = 8;
|
||||
$table->colspan[$i - 1][0] = 9;
|
||||
|
||||
$data = array ();
|
||||
}
|
||||
|
|
|
@ -34,6 +34,11 @@ if (is_ajax ()) {
|
|||
|
||||
// Decrypt passwords in the component.
|
||||
$component['plugin_pass'] = io_output_password($component['plugin_pass']);
|
||||
|
||||
$component['str_warning'] = io_safe_output($component['str_warning']);
|
||||
$component['str_critical'] = io_safe_output($component['str_critical']);
|
||||
$component['warning_inverse'] = (bool)$component['warning_inverse'];
|
||||
$component['critical_inverse'] = (bool)$component['critical_inverse'];
|
||||
|
||||
echo io_json_mb_encode ($component);
|
||||
return;
|
||||
|
|
|
@ -179,9 +179,23 @@ if ($create_action) {
|
|||
db_pandora_audit("Command management", "Fail try to create alert action", false, false);
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
|
||||
/* Show errors */
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be created');
|
||||
}
|
||||
|
||||
if ($name == "") {
|
||||
$messageAction = __('No name specified');
|
||||
}
|
||||
|
||||
if ($id_alert_command == "") {
|
||||
$messageAction = __('No command specified');
|
||||
}
|
||||
|
||||
$messageAction = ui_print_result_message ($result,
|
||||
__('Successfully created'),
|
||||
__('Could not be created'));
|
||||
$messageAction);
|
||||
}
|
||||
|
||||
if ($update_action) {
|
||||
|
|
|
@ -307,9 +307,22 @@ if ($create_command) {
|
|||
db_pandora_audit("Command management", "Fail try to create alert command", false, false);
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
/* Show errors */
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be created');
|
||||
}
|
||||
|
||||
if ($name == "") {
|
||||
$messageAction = __('No name specified');
|
||||
}
|
||||
|
||||
if ($command == "") {
|
||||
$messageAction = __('No command specified');
|
||||
}
|
||||
|
||||
$messageAction = ui_print_result_message ($result,
|
||||
__('Successfully created'),
|
||||
__('Could not be created'));
|
||||
$messageAction);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -126,9 +126,24 @@ if ($create_alert) {
|
|||
"Fail Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'");
|
||||
}
|
||||
|
||||
$messageAction = ui_print_result_message ($id,
|
||||
__('Successfully created'), __('Could not be created'), '', true);
|
||||
|
||||
/* Show errors */
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be created');
|
||||
}
|
||||
|
||||
if ($id_alert_template == "") {
|
||||
$messageAction = __('No template specified');
|
||||
}
|
||||
|
||||
if ($id_agent_module == "") {
|
||||
$messageAction = __('No module specified');
|
||||
}
|
||||
|
||||
$messageAction = ui_print_result_message ($id,
|
||||
__('Successfully created'), $messageAction, '', true);
|
||||
|
||||
|
||||
if ($id !== false) {
|
||||
$action_select = get_parameter('action_select');
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@ if ($create_special_day) {
|
|||
$date_check = db_get_value_filter ('date', 'talert_special_days', $filter);
|
||||
if ($date_check == $date) {
|
||||
$result = '';
|
||||
$messageAction = __('Could not be created, it already exists');
|
||||
}
|
||||
else {
|
||||
$result = alerts_create_alert_special_day ($date, $same_day, $values);
|
||||
|
@ -149,10 +150,16 @@ if ($create_special_day) {
|
|||
else {
|
||||
db_pandora_audit("Command management", "Fail try to create special day", false, false);
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
|
||||
|
||||
/* Show errors */
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be created');
|
||||
}
|
||||
|
||||
$messageAction = ui_print_result_message ($result,
|
||||
__('Successfully created'),
|
||||
__('Could not be created'));
|
||||
$messageAction);
|
||||
}
|
||||
|
||||
if ($update_special_day) {
|
||||
|
@ -194,6 +201,7 @@ if ($update_special_day) {
|
|||
$date_check = db_get_value_filter ('date', 'talert_special_days', $filter);
|
||||
if ($date_check == $date) {
|
||||
$result = '';
|
||||
$messageAction = __('Could not be updated, it already exists');
|
||||
}
|
||||
else {
|
||||
$result = alerts_update_alert_special_day ($id, $values);
|
||||
|
@ -213,9 +221,15 @@ if ($update_special_day) {
|
|||
db_pandora_audit("Command management", "Fail to update special day " . $id, false, false);
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
|
||||
/* Show errors */
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be updated');
|
||||
}
|
||||
|
||||
$messageAction = ui_print_result_message ($result,
|
||||
__('Successfully updated'),
|
||||
__('Could not be updated'));
|
||||
$messageAction);
|
||||
}
|
||||
|
||||
if ($delete_special_day) {
|
||||
|
|
|
@ -428,9 +428,21 @@ if ($create_template) {
|
|||
json_encode($values));
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
|
||||
/* Show errors */
|
||||
if (!isset($messageAction)) {
|
||||
$messageAction = __('Could not be created');
|
||||
}
|
||||
|
||||
if ($name == "") {
|
||||
$messageAction = __('No template name specified');
|
||||
}
|
||||
|
||||
$messageAction = ui_print_result_message ($result,
|
||||
__('Successfully created'),
|
||||
__('Could not be created'));
|
||||
$messageAction);
|
||||
|
||||
|
||||
/* Go to previous step in case of error */
|
||||
if ($result === false)
|
||||
$step = $step - 1;
|
||||
|
|
|
@ -274,7 +274,7 @@ $table->data['form_modules_1'][1] = html_print_select ($types, 'module_type', ''
|
|||
'width:100%');
|
||||
$table->data['form_modules_1'][3] = __('Select all modules of this type') . ' ' .
|
||||
html_print_checkbox_extended("force_type", 'type', '', '', false,
|
||||
'', 'style="margin-right: 40px;"', true);
|
||||
'style="margin-right: 40px;"', true, '');
|
||||
|
||||
$modules = array ();
|
||||
if ($module_type != '') {
|
||||
|
|
|
@ -271,7 +271,7 @@ $table->data['form_modules_1'][1] = html_print_select ($types,
|
|||
|
||||
$table->data['form_modules_1'][3] = __('Select all modules of this type') . ' ' .
|
||||
html_print_checkbox_extended ("force_type", 'type', '', '', false,
|
||||
'', 'style="margin-right: 40px;"', true);
|
||||
'style="margin-right: 40px;"', true, '');
|
||||
|
||||
$modules = array ();
|
||||
if ($module_type != '') {
|
||||
|
|
|
@ -125,7 +125,7 @@ $table->data[4][1] .= html_print_input_text ('max_warning', $max_warning,
|
|||
'', 5, 15, true) . '</span>';
|
||||
$table->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').' </em> ';
|
||||
$table->data[4][1] .= html_print_input_text ('str_warning', $str_warning,
|
||||
'', 5, 15, true) . '</span>';
|
||||
'', 5, 64, true) . '</span>';
|
||||
$table->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true);
|
||||
|
||||
|
@ -142,7 +142,7 @@ $table->data[5][1] .= html_print_input_text ('max_critical', $max_critical,
|
|||
'', 5, 15, true) . '</span>';
|
||||
$table->data[5][1] .= '<span id="string_critical"><em>'.__('Str.').' </em> ';
|
||||
$table->data[5][1] .= html_print_input_text ('str_critical', $str_critical,
|
||||
'', 5, 15, true) . '</span>';
|
||||
'', 5, 64, true) . '</span>';
|
||||
$table->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table->data[5][1] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
||||
|
||||
|
|
|
@ -195,7 +195,8 @@ if ($add_module) {
|
|||
"')");
|
||||
|
||||
if (count($id_agent_modules) > 0 && $id_agent_modules != '') {
|
||||
$order = db_get_row_sql("SELECT `field_order` from tgraph_source ORDER BY `field_order` DESC");
|
||||
$order = db_get_row_sql("SELECT `field_order` from tgraph_source WHERE id_graph=$id_graph ORDER BY `field_order` DESC");
|
||||
|
||||
$order = $order['field_order'];
|
||||
foreach($id_agent_modules as $id_agent_module){
|
||||
$order++;
|
||||
|
@ -207,8 +208,13 @@ if ($add_module) {
|
|||
}
|
||||
|
||||
if ($delete_module) {
|
||||
$id_graph = get_parameter('id');
|
||||
|
||||
$deleteGraph = get_parameter('delete');
|
||||
$order_val = db_get_value('field_order', 'tgraph_source', 'id_gs', $deleteGraph);
|
||||
$result = db_process_sql_delete('tgraph_source', array('id_gs' => $deleteGraph));
|
||||
db_process_sql ('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val);
|
||||
|
||||
}
|
||||
|
||||
if ($change_weight) {
|
||||
|
|
|
@ -222,7 +222,7 @@ $table->data[36][0] = __('Include agents manually disabled');
|
|||
$table->data[36][1] = __('Yes').' '.html_print_radio_button ('include_agents', 1, '', $config["include_agents"], true).' ';
|
||||
$table->data[36][1] .= __('No').' '.html_print_radio_button ('include_agents', 0, '', $config["include_agents"], true);
|
||||
|
||||
$table->data[37][0] = __('audit log directory') .
|
||||
$table->data[37][0] = __('Audit log directory') .
|
||||
ui_print_help_tip (__("Directory where audit log is stored."), true);
|
||||
$table->data[37][1] = html_print_input_text ('auditdir', io_safe_output($config["auditdir"]), '', 30, 100, true);
|
||||
|
||||
|
|
|
@ -83,13 +83,8 @@ $table_behaviour->data[$row][1] = html_print_checkbox('paginate_module', 1,
|
|||
$row++;
|
||||
|
||||
$table_behaviour->data[$row][0] = __('Display data of proc modules in other format');
|
||||
$table_behaviour->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('render_proc', 1, '',
|
||||
$config["render_proc"], true) .
|
||||
' ';
|
||||
$table_behaviour->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('render_proc', 0, '',
|
||||
$config["render_proc"], true);
|
||||
$table_behaviour->data[$row][1] = html_print_checkbox('render_proc', 1,
|
||||
$config['render_proc'], true);
|
||||
$row++;
|
||||
|
||||
$table_behaviour->data[$row][0] = __('Display text proc modules have state is ok');
|
||||
|
@ -103,13 +98,8 @@ $row++;
|
|||
//Daniel maya 02/06/2016 Display menu with click --INI
|
||||
$table_behaviour->data[$row][0] = __('Click to display lateral menus').
|
||||
ui_print_help_tip(__('When enabled, the lateral menus are shown when left clicking them, instead of hovering over them'), true);
|
||||
$table_behaviour->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('click_display', 1, '',
|
||||
$config["click_display"], true) .
|
||||
' ';
|
||||
$table_behaviour->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('click_display', 0, '',
|
||||
$config["click_display"], true);
|
||||
$table_behaviour->data[$row][1] = html_print_checkbox('click_display', 1,
|
||||
$config['click_display'], true);
|
||||
$row++;
|
||||
//Daniel maya 02/06/2016 Display menu with click --END
|
||||
|
||||
|
@ -126,13 +116,8 @@ if (enterprise_installed()) {
|
|||
|
||||
$table_behaviour->data[$row][0] = __('Classic menu mode').
|
||||
ui_print_help_tip(__('Text menu options always visible, don\'t hide'), true);
|
||||
$table_behaviour->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('classic_menu', 1, '',
|
||||
$config["classic_menu"], true) .
|
||||
' ';
|
||||
$table_behaviour->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('classic_menu', 0, '',
|
||||
$config["classic_menu"], true);
|
||||
$table_behaviour->data[$row][1] = html_print_checkbox('classic_menu', 1,
|
||||
$config['classic_menu'], true);
|
||||
$row++;
|
||||
|
||||
echo "<fieldset>";
|
||||
|
@ -398,41 +383,31 @@ if(enterprise_installed()) {
|
|||
$row++;
|
||||
}
|
||||
|
||||
$table_styles->data[$row][0] = __('Disable logo in graphs');
|
||||
$table_styles->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button_extended ('fixed_graph', 1, '', $config["fixed_graph"], $open, '','',true) .
|
||||
' ';
|
||||
if (enterprise_installed()){
|
||||
$table_styles->data[$row][0] = __('Disable logo in graphs');
|
||||
$table_styles->data[$row][1] = html_print_checkbox('fixed_graph', 1,
|
||||
$config['fixed_graph'], true);
|
||||
$row++;
|
||||
}
|
||||
|
||||
/* Hello there! :)
|
||||
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
|
||||
*/
|
||||
|
||||
$table_styles->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button_extended ('fixed_graph', 0, '', $config["fixed_graph"], $open, '','',true, $open,'visualmodal');
|
||||
$row++;
|
||||
|
||||
$table_styles->data[$row][0] = __('Disable helps');
|
||||
$table_styles->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('disable_help', 1, '', $config["disable_help"], true) .
|
||||
' ';
|
||||
$table_styles->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('disable_help', 0, '', $config["disable_help"], true);
|
||||
$table_styles->data[$row][1] = html_print_checkbox('disable_help', 1,
|
||||
$config['disable_help'], true);
|
||||
$row++;
|
||||
|
||||
$table_styles->data[$row][0] = __('Fixed header');
|
||||
$table_styles->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('fixed_header', 1, '', $config["fixed_header"], true) .
|
||||
' ';
|
||||
$table_styles->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('fixed_header', 0, '', $config["fixed_header"], true);
|
||||
$table_styles->data[$row][1] = html_print_checkbox('fixed_header', 1,
|
||||
$config['fixed_header'], true);
|
||||
$row++;
|
||||
|
||||
$table_styles->data[$row][0] = __('Fixed menu');
|
||||
$table_styles->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('fixed_menu', 1, '', $config["fixed_menu"], true) .
|
||||
' ';
|
||||
$table_styles->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true);
|
||||
$table_styles->data[$row][1] = html_print_checkbox('fixed_menu', 1,
|
||||
$config['fixed_menu'], true);
|
||||
$row++;
|
||||
|
||||
// For 5.1 Autohidden menu feature
|
||||
|
@ -441,11 +416,8 @@ $table_styles->data['autohidden'][1] = html_print_checkbox('autohidden_menu',
|
|||
1, $config['autohidden_menu'], true);
|
||||
|
||||
$table_styles->data[$row][0] = __('Visual effects and animation');
|
||||
$table_styles->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('visual_animation', 1, '', $config["visual_animation"], true) .
|
||||
' ';
|
||||
$table_styles->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('visual_animation', 0, '', $config["visual_animation"], true);
|
||||
$table_styles->data[$row][1] = html_print_checkbox('visual_animation', 1,
|
||||
$config['visual_animation'], true);
|
||||
|
||||
echo "<fieldset>";
|
||||
echo "<legend>" . __('Style configuration') . "</legend>";
|
||||
|
@ -465,10 +437,8 @@ $table_gis->data = array ();
|
|||
|
||||
$table_gis->data[$row][0] = __('GIS Labels') .
|
||||
ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true);
|
||||
$table_gis->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).' ';
|
||||
$table_gis->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true);
|
||||
$table_gis->data[$row][1] = html_print_checkbox('gis_label', 1,
|
||||
$config['gis_label'], true);
|
||||
$row++;
|
||||
|
||||
$listIcons = gis_get_array_list_icons();
|
||||
|
@ -558,10 +528,8 @@ $row++;
|
|||
|
||||
$table_font->data[$row][0] = __('Show unit along with value in reports') .
|
||||
ui_print_help_tip(__('This enabling this, max, min and avg values will be shown with units.'), true);
|
||||
$table_font->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('simple_module_value', 1, '', $config["simple_module_value"], true).' ';
|
||||
$table_font->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('simple_module_value', 0, '', $config["simple_module_value"], true);
|
||||
$table_font->data[$row][1] = html_print_checkbox('simple_module_value', 1,
|
||||
$config['simple_module_value'], true);
|
||||
$row++;
|
||||
|
||||
echo "<fieldset>";
|
||||
|
@ -647,8 +615,8 @@ $table_chars->data[$row][1] = html_print_input_text ('custom_graph_width',
|
|||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Use round corners');
|
||||
$table_chars->data[$row][1] = __('Yes').' '.html_print_radio_button ('round_corner', 1, '', $config["round_corner"], true).' ';
|
||||
$table_chars->data[$row][1] .= __('No').' '.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
|
||||
$table_chars->data[$row][1] = html_print_checkbox('round_corner', 1,
|
||||
$config['round_corner'], true);
|
||||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Type of module charts');
|
||||
|
@ -876,14 +844,8 @@ $table_other->data['custom_report_front-footer'][1] = html_print_textarea('custo
|
|||
|
||||
|
||||
$table_other->data[$row][0] = __('Show QR Code icon in the header');
|
||||
$table_other->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('show_qr_code_header', 1, '',
|
||||
$config["show_qr_code_header"], true) .
|
||||
' ';
|
||||
$table_other->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('show_qr_code_header', 0, '',
|
||||
$config["show_qr_code_header"], true);
|
||||
|
||||
$table_other->data[$row][1] = html_print_checkbox('show_qr_code_header', 1,
|
||||
$config['show_qr_code_header'], true);
|
||||
$row++;
|
||||
|
||||
$table_other->data[$row][0] = __('Custom graphviz directory') .
|
||||
|
@ -903,13 +865,8 @@ $row++;
|
|||
$table_other->data[$row][0] = __('Show only the group name');
|
||||
$table_other->data[$row][0] .= ui_print_help_tip(
|
||||
__('Show the group name instead the group icon.'), true);
|
||||
$table_other->data[$row][1] = __('Yes') . ' ' .
|
||||
html_print_radio_button ('show_group_name', 1, '',
|
||||
$config["show_group_name"], true) .
|
||||
' ';
|
||||
$table_other->data[$row][1] .= __('No') . ' ' .
|
||||
html_print_radio_button ('show_group_name', 0, '',
|
||||
$config["show_group_name"], true);
|
||||
html_print_checkbox('show_group_name', 1,
|
||||
$config['show_group_name'], true);
|
||||
$row++;
|
||||
|
||||
$table_other->data[$row][0] = __('Date format string') . ui_print_help_icon("date_format", true);
|
||||
|
|
|
@ -153,6 +153,8 @@ if ($create_user) {
|
|||
}
|
||||
if (html_print_csrf_error()) return;
|
||||
|
||||
$user_is_admin = (int) get_parameter ('is_admin', 0);
|
||||
|
||||
$values = array ();
|
||||
$values['id_user'] = (string) get_parameter ('id_user');
|
||||
$values['fullname'] = (string) get_parameter ('fullname');
|
||||
|
@ -163,7 +165,7 @@ if ($create_user) {
|
|||
$values['email'] = (string) get_parameter ('email');
|
||||
$values['phone'] = (string) get_parameter ('phone');
|
||||
$values['comments'] = (string) get_parameter ('comments');
|
||||
$values['is_admin'] = (int) get_parameter ('is_admin', 0);
|
||||
$values['is_admin'] = $user_is_admin;
|
||||
$values['language'] = get_parameter ('language', 'default');
|
||||
$values['timezone'] = (string) get_parameter('timezone');
|
||||
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
|
||||
|
@ -191,9 +193,9 @@ if ($create_user) {
|
|||
$values['last_pass_change'] = date ("Y/m/d H:i:s", get_system_time());
|
||||
if(defined('METACONSOLE')) {
|
||||
$values['metaconsole_access'] = get_parameter ('metaconsole_access', 'basic');
|
||||
$values['metaconsole_agents_manager'] = get_parameter ('metaconsole_agents_manager', '0');
|
||||
$values['metaconsole_agents_manager'] = ($user_is_admin == 1 ? 1 : get_parameter ('metaconsole_agents_manager', '0'));
|
||||
$values['metaconsole_assigned_server'] = get_parameter ('metaconsole_assigned_server', '');
|
||||
$values['metaconsole_access_node'] = get_parameter ('metaconsole_access_node', '0');
|
||||
$values['metaconsole_access_node'] = ($user_is_admin == 1 ? 1 : get_parameter ('metaconsole_access_node', '0'));
|
||||
}
|
||||
}
|
||||
$values["not_login"] = (bool)get_parameter ('not_login', false);
|
||||
|
@ -718,12 +720,11 @@ $(document).ready (function () {
|
|||
$('input:radio[name="is_admin"]').change(function() {
|
||||
if($('#radiobtn0002').prop('checked')) {
|
||||
$('#user_configuration_table-metaconsole_agents_manager').show();
|
||||
$('#user_configuration_table-metaconsole_assigned_server').show();
|
||||
$('#user_configuration_table-metaconsole_access_node').show();
|
||||
}
|
||||
else {
|
||||
$('#user_configuration_table-metaconsole_agents_manager').hide();
|
||||
$('#user_configuration_table-metaconsole_assigned_server').hide();
|
||||
$('#user_configuration_table-metaconsole_assigned_server').show();
|
||||
$('#user_configuration_table-metaconsole_access_node').hide();
|
||||
}
|
||||
});
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 274 B |
Binary file not shown.
After Width: | Height: | Size: 397 B |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -38,6 +38,9 @@ $get_event_name = (bool) get_parameter ('get_event_name');
|
|||
$meta = get_parameter ('meta', 0);
|
||||
$history = get_parameter ('history', 0);
|
||||
$table_events = get_parameter('table_events', 0);
|
||||
$total_events = (bool)get_parameter('total_events');
|
||||
$total_event_graph = (bool)get_parameter('total_event_graph');
|
||||
$graphic_event_group = (bool)get_parameter('graphic_event_group');
|
||||
|
||||
if ($get_event_name) {
|
||||
$event_id = get_parameter ('event_id');
|
||||
|
@ -605,4 +608,37 @@ if ($get_list_events_agents) {
|
|||
echo $returned_list;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($total_events) {
|
||||
global $config;
|
||||
|
||||
$sql_count_event = 'SELECT SQL_NO_CACHE COUNT(id_evento) FROM tevento ';
|
||||
if ($config['event_view_hr']) {
|
||||
$sql_count_event .= 'WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - ' . $config['event_view_hr'] * SECONDS_1HOUR . ')';
|
||||
}
|
||||
|
||||
$system_events = db_get_value_sql($sql_count_event);
|
||||
echo $system_events;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($total_event_graph) {
|
||||
global $config;
|
||||
|
||||
require_once($config["homedir"] . '/include/functions_graph.php');
|
||||
|
||||
$prueba = grafico_eventos_total("", 280, 150, false, true);
|
||||
echo $prueba;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($graphic_event_group) {
|
||||
global $config;
|
||||
|
||||
require_once($config["homedir"] . '/include/functions_graph.php');
|
||||
|
||||
$prueba = grafico_eventos_grupo(280, 150, "", false, true);
|
||||
echo $prueba;
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC181022';
|
||||
$pandora_version = 'v7.0NG.727';
|
||||
$build_version = 'PC181025';
|
||||
$pandora_version = 'v7.0NG.728';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null) {
|
||||
function mysql_connect_db($host = null, $db = null, $user = null, $pass = null, $port = null, $charset = "utf8") {
|
||||
global $config;
|
||||
|
||||
if ($host === null)
|
||||
|
@ -42,6 +42,8 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null,
|
|||
}
|
||||
db_change_cache_id ($db, $host);
|
||||
|
||||
mysqli_set_charset($connect_id, $charset);
|
||||
|
||||
mysqli_select_db($connect_id, $db);
|
||||
}
|
||||
else {
|
||||
|
@ -52,6 +54,8 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null,
|
|||
|
||||
db_change_cache_id ($db, $host);
|
||||
|
||||
@mysql_set_charset($connect_id, $charset);
|
||||
|
||||
mysql_select_db($db, $connect_id);
|
||||
}
|
||||
|
||||
|
@ -1198,47 +1202,6 @@ function mysql_db_get_type_field_table($table, $field) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the element count of a table.
|
||||
*
|
||||
* @param string $sql SQL query to get the element count.
|
||||
*
|
||||
* @return int Return the number of elements in the table.
|
||||
*/
|
||||
function mysql_db_get_table_count($sql, $search_history_db = false) {
|
||||
global $config;
|
||||
|
||||
$history_count = 0;
|
||||
$count = mysql_db_get_value_sql ($sql);
|
||||
if ($count === false) {
|
||||
$count = 0;
|
||||
}
|
||||
|
||||
// Search the history DB for matches
|
||||
if ($search_history_db && $config['history_db_enabled'] == 1) {
|
||||
|
||||
// Connect to the history DB
|
||||
if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) {
|
||||
if ($config["mysqli"]) {
|
||||
$config['history_db_connection'] = mysqli_connect_db ($config['history_db_host'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_name'], $config['history_db_port'], false);
|
||||
}
|
||||
else {
|
||||
$config['history_db_connection'] = mysql_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false);
|
||||
}
|
||||
}
|
||||
if ($config['history_db_connection'] !== false) {
|
||||
$history_count = mysql_db_get_value_sql ($sql, $config['history_db_connection']);
|
||||
if ($history_count === false) {
|
||||
$history_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$count += $history_count;
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
function mysql_get_fields($table) {
|
||||
global $config;
|
||||
|
||||
|
|
|
@ -1476,42 +1476,6 @@ function oracle_list_all_field_table($table_name, $return_mode = 'array') {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the element count of a table.
|
||||
*
|
||||
* @param string $sql SQL query to get the element count.
|
||||
*
|
||||
* @return int Return the number of elements in the table.
|
||||
*/
|
||||
function oracle_db_get_table_count($sql, $search_history_db = false) {
|
||||
global $config;
|
||||
|
||||
$history_count = 0;
|
||||
$count = oracle_db_get_value_sql ($sql);
|
||||
if ($count === false) {
|
||||
$count = 0;
|
||||
}
|
||||
|
||||
// Search the history DB for matches
|
||||
if ($search_history_db && $config['history_db_enabled'] == 1) {
|
||||
|
||||
// Connect to the history DB
|
||||
if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) {
|
||||
$config['history_db_connection'] = oracle_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false);
|
||||
}
|
||||
if ($config['history_db_connection'] !== false) {
|
||||
$history_count = oracle_db_get_value_sql ($sql, $config['history_db_connection']);
|
||||
if ($history_count === false) {
|
||||
$history_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$count += $history_count;
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a file with an oracle schema sentences.
|
||||
* Based on the function which installs the pandoradb.sql schema.
|
||||
|
|
|
@ -1055,40 +1055,5 @@ function postgresql_db_get_type_field_table($table, $field) {
|
|||
return pg_field_type($result, $field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the element count of a table.
|
||||
*
|
||||
* @param string $sql SQL query to get the element count.
|
||||
*
|
||||
* @return int Return the number of elements in the table.
|
||||
*/
|
||||
function postgresql_db_get_table_count($sql, $search_history_db = false) {
|
||||
global $config;
|
||||
|
||||
$history_count = 0;
|
||||
$count = postgresql_db_get_value_sql ($sql);
|
||||
if ($count === false) {
|
||||
$count = 0;
|
||||
}
|
||||
|
||||
// Search the history DB for matches
|
||||
if ($search_history_db && $config['history_db_enabled'] == 1) {
|
||||
|
||||
// Connect to the history DB
|
||||
if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) {
|
||||
$config['history_db_connection'] = postgresql_connect_db ($config['history_db_host'], $config['history_db_name'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_port'], false);
|
||||
}
|
||||
if ($config['history_db_connection'] !== false) {
|
||||
$history_count = postgresql_db_get_value_sql ($sql, $config['history_db_connection']);
|
||||
if ($history_count === false) {
|
||||
$history_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$count += $history_count;
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1369,10 +1369,11 @@ function is_metaconsole() {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_management_allowed() {
|
||||
function is_management_allowed($hkey = '') {
|
||||
global $config;
|
||||
return ( (is_metaconsole() && $config["centralized_management"])
|
||||
|| (!is_metaconsole() && !$config["centralized_management"]));
|
||||
|| (!is_metaconsole() && !$config["centralized_management"])
|
||||
|| (!is_metaconsole() && $config["centralized_management"]) && $hkey == hash('sha256', db_get_value ('value', 'tupdate_settings', 'token', 'customer_key')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3128,16 +3129,23 @@ function series_type_graph_array($data, $show_elements_graph){
|
|||
if (isset($show_elements_graph['labels']) &&
|
||||
is_array($show_elements_graph['labels']) &&
|
||||
(count($show_elements_graph['labels']) > 0)){
|
||||
$name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']] . ' ' ;
|
||||
if ($show_elements_graph['unit'])
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': ';
|
||||
else
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': ';
|
||||
}
|
||||
else{
|
||||
if(strpos($key, 'baseline') !== false){
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' .
|
||||
$value['module_name'] . ' Baseline ';
|
||||
if ($show_elements_graph['unit'])
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .'Baseline ';
|
||||
else
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . 'Baseline ';
|
||||
}
|
||||
else{
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' .
|
||||
$value['module_name'] . ': ';
|
||||
if ($show_elements_graph['unit'])
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': ';
|
||||
else
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': ';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3173,6 +3181,11 @@ function series_type_graph_array($data, $show_elements_graph){
|
|||
!$show_elements_graph['fullscale'] && strpos($key, 'max') !== false){
|
||||
$data_return['series_type'][$key] = $type_graph;
|
||||
|
||||
if ($show_elements_graph['unit'])
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': ';
|
||||
else
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': ';
|
||||
|
||||
$data_return['legend'][$key] = $name_legend;
|
||||
if($show_elements_graph['type_mode_graph']){
|
||||
$data_return['legend'][$key] .=
|
||||
|
@ -3234,6 +3247,10 @@ function series_type_graph_array($data, $show_elements_graph){
|
|||
__('Percentil') . ' ' .
|
||||
$config['percentil'] .
|
||||
'º ' . __('of module') . ' ';
|
||||
if ($show_elements_graph['unit'])
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ' / ' . __('Unit ') . ' ' . $show_elements_graph['unit'] .': ';
|
||||
else
|
||||
$name_legend = $data_return['legend'][$key] = $value['agent_alias'] . ' / ' . $value['module_name'] . ': ';
|
||||
$data_return['legend'][$key] .= $name_legend;
|
||||
$data_return['legend'][$key] .= remove_right_zeros(
|
||||
number_format(
|
||||
|
|
|
@ -28,13 +28,14 @@ require_once($config['homedir'] . '/include/functions_users.php');
|
|||
*
|
||||
* @param int $id_agent The agent id.
|
||||
* @param boolean $show_disabled Show the agent found althought it is disabled. By default false.
|
||||
* @param boolean $force_meta
|
||||
*
|
||||
* @return boolean The result to check if the agent is in the DB.
|
||||
*/
|
||||
function agents_check_agent_exists($id_agent, $show_disabled = true) {
|
||||
function agents_check_agent_exists($id_agent, $show_disabled = true, $force_meta = false) {
|
||||
$agent = db_get_value_filter(
|
||||
'id_agente',
|
||||
'tagente',
|
||||
$force_meta ? 'tmetaconsole_agent' : 'tagente',
|
||||
array('id_agente' => $id_agent, 'disabled' => !$show_disabled)
|
||||
);
|
||||
|
||||
|
@ -2729,17 +2730,18 @@ function agents_count_agents_filter ($filter = array(), $access = "AR") {
|
|||
*
|
||||
* @param int Id agent
|
||||
* @param string ACL access bit
|
||||
* @param boolean $force_meta
|
||||
*
|
||||
* @return True if user has access, false if user has not permissions and
|
||||
* null if id agent does not exist
|
||||
*/
|
||||
function agents_check_access_agent ($id_agent, $access = "AR") {
|
||||
function agents_check_access_agent ($id_agent, $access = "AR", $force_meta = false) {
|
||||
global $config;
|
||||
|
||||
if (users_access_to_agent($id_agent, $access)) return true;
|
||||
if (users_access_to_agent($id_agent, $access, false, $force_meta)) return true;
|
||||
|
||||
// If agent exist return false
|
||||
if (agents_check_agent_exists($id_agent)) return false;
|
||||
if (agents_check_agent_exists($id_agent, true, $force_meta)) return false;
|
||||
// Return null otherwise
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ include_once($config['homedir'] . "/include/functions_network_components.php");
|
|||
include_once($config['homedir'] . "/include/functions_netflow.php");
|
||||
include_once($config['homedir'] . "/include/functions_servers.php");
|
||||
include_once($config['homedir'] . "/include/functions_planned_downtimes.php");
|
||||
include_once($config['homedir'] . "/include/functions_db.php");
|
||||
enterprise_include_once ('include/functions_local_components.php');
|
||||
enterprise_include_once ('include/functions_events.php');
|
||||
enterprise_include_once ('include/functions_agents.php');
|
||||
|
@ -100,7 +99,7 @@ function returnError($typeError, $returnType = 'string') {
|
|||
break;
|
||||
default:
|
||||
returnData("string",
|
||||
array('type' => 'string', 'data' => __($typeError)));
|
||||
array('type' => 'string', 'data' => __($returnType)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -9278,18 +9277,27 @@ function api_get_agent_id($trash1, $trash2, $data, $returnType) {
|
|||
* Agent alias for a given id
|
||||
*
|
||||
* @param int $id_agent
|
||||
* @param int $id_node Only for metaconsole
|
||||
* @param $thrash1 Don't use.
|
||||
* @param $returnType
|
||||
*
|
||||
**/
|
||||
// http://localhost/pandora_console/include/api.php?op=get&op2=agent_name&id=1&apipass=1234&user=admin&pass=pandora
|
||||
function api_get_agent_alias($id_agent, $trash1, $trash2, $returnType) {
|
||||
if (defined ('METACONSOLE')) {
|
||||
return;
|
||||
// http://localhost/pandora_console/include/api.php?op=get&op2=agent_alias&id=1&apipass=1234&user=admin&pass=pandora
|
||||
// http://localhost/pandora_console/enterprise/meta/include/api.php?op=get&op2=agent_alias&id=1&id2=1&apipass=1234&user=admin&pass=pandora
|
||||
function api_get_agent_alias($id_agent, $id_node, $trash1, $returnType) {
|
||||
$table_agent_alias = 'tagente';
|
||||
$force_meta=false;
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$table_agent_alias = 'tmetaconsole_agent';
|
||||
$force_meta = true;
|
||||
$id_agent = db_get_value_sql("SELECT id_agente FROM tmetaconsole_agent WHERE id_tagente = $id_agent AND id_tmetaconsole_setup = $id_node");
|
||||
}
|
||||
|
||||
if (!util_api_check_agent_and_print_error($id_agent, $returnType)) return;
|
||||
if (!util_api_check_agent_and_print_error($id_agent, $returnType, 'AR', $force_meta)) return;
|
||||
|
||||
$sql = sprintf('SELECT alias
|
||||
FROM tagente
|
||||
FROM ' . $table_agent_alias . '
|
||||
WHERE id_agente = %d', $id_agent);
|
||||
$value = db_get_value_sql($sql);
|
||||
|
||||
|
@ -9521,8 +9529,11 @@ function api_set_create_event($id, $trash1, $other, $returnType) {
|
|||
return;
|
||||
}
|
||||
$id_agent = $agent_cache['id_tagente'];
|
||||
|
||||
}
|
||||
|
||||
$values['id_agente'] = $id_agent;
|
||||
|
||||
if (!util_api_check_agent_and_print_error($id_agent, 'string', 'AR')) {
|
||||
if (is_metaconsole()) metaconsole_restore_db();
|
||||
return;
|
||||
|
@ -11302,6 +11313,7 @@ function api_get_cluster_status($id_cluster, $trash1, $trash2, $returnType) {
|
|||
|
||||
if ($value === false) {
|
||||
returnError('id_not_found', $returnType);
|
||||
return;
|
||||
}
|
||||
|
||||
$data = array('type' => 'string', 'data' => $value);
|
||||
|
@ -11319,6 +11331,7 @@ function api_get_cluster_id_by_name($cluster_name, $trash1, $trash2, $returnType
|
|||
$value = cluster_get_id_by_name($cluster_name);
|
||||
if(($value === false) || ($value === null)){
|
||||
returnError('id_not_found', $returnType);
|
||||
return;
|
||||
}
|
||||
|
||||
$cluster_group = clusters_get_group($value);
|
||||
|
@ -11473,10 +11486,10 @@ function api_get_cluster_items ($cluster_id){
|
|||
// AUX FUNCTIONS
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
function util_api_check_agent_and_print_error($id_agent, $returnType, $access = "AR") {
|
||||
function util_api_check_agent_and_print_error($id_agent, $returnType, $access = "AR", $force_meta = false) {
|
||||
global $config;
|
||||
|
||||
$check_agent = agents_check_access_agent($id_agent, $access);
|
||||
$check_agent = agents_check_access_agent($id_agent, $access, $force_meta);
|
||||
if ($check_agent === true) return true;
|
||||
|
||||
if ($check_agent === false || !check_acl($config['id_user'], 0, $access)) {
|
||||
|
@ -11488,282 +11501,8 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access =
|
|||
return false;
|
||||
}
|
||||
|
||||
function api_get_user_info($thrash1, $thrash2, $other, $returnType) {
|
||||
if (defined ('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$separator = ';';
|
||||
|
||||
$other = json_decode(base64_decode($other['data']),true);
|
||||
|
||||
$sql = 'select * from tusuario where id_user = "'.$other[0]['id_user'].'" and password = "'.$other[0]['password'].'"';
|
||||
|
||||
$user_info = db_get_all_rows_sql($sql);
|
||||
|
||||
if (count($user_info) > 0 and $user_info !== false) {
|
||||
$data = array('type' => 'array', 'data' => $user_info);
|
||||
returnData($returnType, $data, $separator);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
This function receives different parameters to process one of these actions the logging process in our application from the records in the audit of pandora fms, to avoid concurrent access of administrator users, and optionally to prohibit access to non-administrator users:
|
||||
|
||||
Parameter 0
|
||||
|
||||
The User ID that attempts the action is used to check the status of the application for access.
|
||||
|
||||
Parameter 1
|
||||
|
||||
Login, logout, exclude, browse.
|
||||
|
||||
These requests receive a response that we can treat as we consider, this function only sends answers, does not perform any action in your application, you must customize them.
|
||||
|
||||
Login action: free (register our access), taken, denied (if you are not an administrator user and parameter four is set to 1, register the expulsion).
|
||||
|
||||
Browse action: It has the same answers as login, but does not register anything in the audit.
|
||||
|
||||
Logout action: It records the deslogeo but does not send a response.
|
||||
|
||||
All other actions do not return a response,
|
||||
|
||||
Parameter 2
|
||||
|
||||
IP address of the application is also used to check the status of the application for access.
|
||||
|
||||
Parameter 3
|
||||
|
||||
Name of the application, it is also used to check the status of the application for access.
|
||||
|
||||
Parameter 4
|
||||
|
||||
If you mark 1 you will avoid the access to the non-administrators users, returning the response `denied' and registering that expulsion in the audit of pandora fms.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function api_set_access_process($thrash1, $thrash2, $other, $returnType) {
|
||||
if (defined ('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$other['data'] = explode('|',$other['data']);
|
||||
|
||||
$sql = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario != "'.$other['data'][0].'" order by utimestamp DESC limit 1';
|
||||
$audit_concurrence = db_get_all_rows_sql($sql);
|
||||
$sql_user = 'select id_usuario,utimestamp from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logon%" and id_usuario IN (select id_user from tusuario where is_admin = 1) and id_usuario = "'.$other['data'][0].'" order by utimestamp DESC limit 1';
|
||||
$audit_concurrence_user = db_get_all_rows_sql($sql_user);
|
||||
$sql2 = 'select id_usuario,utimestamp,accion from tsesion where descripcion like "%'.$other['data'][2].'%" and accion like "%'.$other['data'][3].' Logoff%" and id_usuario = "'.$audit_concurrence[0]['id_usuario'].'" order by utimestamp DESC limit 1';
|
||||
$audit_concurrence_2 = db_get_all_rows_sql($sql2);
|
||||
|
||||
//The user trying to log in is an administrator
|
||||
if(users_is_admin($other['data'][0])){
|
||||
//The admin user is trying to login
|
||||
if($other['data'][1] == 'login'){
|
||||
// Check if there is an administrator user logged in prior to our last login
|
||||
if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){
|
||||
// Check if the administrator user logged in later to us has unlogged and left the node free
|
||||
if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){
|
||||
// The administrator user logged in later has not yet unlogged
|
||||
returnData('string', array('type' => 'string', 'data' => 'taken'));
|
||||
}
|
||||
else{
|
||||
// The administrator user logged in later has already unlogged
|
||||
returnData('string', array('type' => 'string', 'data' => 'free'));
|
||||
}
|
||||
}
|
||||
else{
|
||||
// There is no administrator user who has logged in since then to log us in.
|
||||
db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]);
|
||||
returnData('string', array('type' => 'string', 'data' => 'free'));
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($other['data'][1] == 'logout') {
|
||||
// The administrator user wants to log out
|
||||
db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]);
|
||||
}
|
||||
elseif ($other['data'][1] == 'exclude') {
|
||||
// The administrator user has ejected another administrator user who was logged in
|
||||
db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]);
|
||||
db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2] , $audit_concurrence[0]['id_usuario']);
|
||||
|
||||
}
|
||||
//The admin user is trying to browse
|
||||
elseif ($other['data'][1] == 'browse') {
|
||||
// Check if there is an administrator user logged in prior to our last login
|
||||
if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_user[0]['utimestamp']){
|
||||
// Check if the administrator user logged in later to us has unlogged and left the node free
|
||||
if($audit_concurrence[0]['utimestamp'] > $audit_concurrence_2[0]['utimestamp']){
|
||||
// The administrator user logged in later has not yet unlogged
|
||||
returnData('string', array('type' => 'string', 'data' => $audit_concurrence[0]['id_usuario']));
|
||||
}
|
||||
else{
|
||||
// The administrator user logged in later has already unlogged
|
||||
returnData('string', array('type' => 'string', 'data' => 'free'));
|
||||
}
|
||||
}
|
||||
else{
|
||||
// There is no administrator user who has logged in since then to log us in.
|
||||
returnData('string', array('type' => 'string', 'data' => 'free'));
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($other['data'][1] == 'cancelled'){
|
||||
//The administrator user tries to log in having another administrator logged in, but instead of expelling him he cancels his log in.
|
||||
db_pandora_audit($other['data'][3].' cancelled access', 'Cancelled access in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]);
|
||||
returnData('string', array('type' => 'string', 'data' => 'cancelled'));
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
if($other['data'][4] == 1){
|
||||
//The user trying to log in is not an administrator and is not allowed no admin access
|
||||
db_pandora_audit($other['data'][3].' denied access', 'Denied access to non-admin user '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]);
|
||||
returnData('string', array('type' => 'string', 'data' => 'denied'));
|
||||
}
|
||||
else{
|
||||
//The user trying to log in is not an administrator and is allowed no admin access
|
||||
if($other['data'][1] == 'login'){
|
||||
//The user trying to login is not admin, can enter without concurrent use filter
|
||||
db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2] , $other['data'][0]);
|
||||
returnData('string', array('type' => 'string', 'data' => 'free'));
|
||||
|
||||
}
|
||||
elseif ($other['data'][1] == 'logout') {
|
||||
//The user trying to logoff is not admin
|
||||
db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]);
|
||||
}
|
||||
elseif ($other['data'][1] == 'browse'){
|
||||
//The user trying to browse in an app page is not admin, can enter without concurrent use filter
|
||||
returnData('string', array('type' => 'string', 'data' => 'free'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function api_get_traps($thrash1, $thrash2, $other, $returnType) {
|
||||
|
||||
if (defined ('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$other['data'] = explode('|',$other['data']);
|
||||
|
||||
$other['data'][1] = date("Y-m-d H:i:s",$other['data'][1]);
|
||||
|
||||
$sql = 'SELECT * from ttrap where timestamp >= "'.$other['data'][1].'"';
|
||||
|
||||
// $sql = 'SELECT * from ttrap where source = "'.$other['data'][0].'" and timestamp >= "'.$other['data'][1].'"';
|
||||
|
||||
if($other['data'][4]){
|
||||
$other['data'][4] = date("Y-m-d H:i:s",$other['data'][4]);
|
||||
$sql .= ' and timestamp <= "'.$other['data'][4].'"';
|
||||
}
|
||||
|
||||
if($other['data'][2]){
|
||||
$sql .= ' limit '.$other['data'][2];
|
||||
}
|
||||
|
||||
if($other['data'][3]){
|
||||
$sql .= ' offset '.$other['data'][3];
|
||||
}
|
||||
|
||||
if($other['data'][5]){
|
||||
$sql .= ' and status = 0';
|
||||
}
|
||||
|
||||
if(sizeof($other['data']) == 0){
|
||||
$sql = 'SELECT * from ttrap';
|
||||
}
|
||||
|
||||
|
||||
$traps = db_get_all_rows_sql($sql);
|
||||
|
||||
if($other['data'][6]){
|
||||
|
||||
foreach ($traps as $key => $value) {
|
||||
|
||||
if(!strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'false'){
|
||||
unset($traps[$key]);
|
||||
}
|
||||
|
||||
if(strpos($value['oid_custom'],$other['data'][6]) && $other['data'][7] == 'true'){
|
||||
unset($traps[$key]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$traps_json = json_encode($traps);
|
||||
|
||||
if (count($traps) > 0 and $traps !== false) {
|
||||
returnData('string', array('type' => 'string', 'data' => $traps_json));
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function api_set_validate_traps ($id, $thrash2, $other, $thrash3) {
|
||||
|
||||
if (defined ('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if($id == 'all'){
|
||||
$result = db_process_sql_update('ttrap',array('status' => 1));
|
||||
}
|
||||
else{
|
||||
$result = db_process_sql_update('ttrap',
|
||||
array('status' => 1), array('id_trap' => $id));
|
||||
}
|
||||
|
||||
if (is_error($result)) {
|
||||
// TODO: Improve the error returning more info
|
||||
returnError('error_update_trap', __('Error in trap update.'));
|
||||
}
|
||||
else {
|
||||
returnData('string',
|
||||
array('type' => 'string',
|
||||
'data' => __('Validated traps.')));
|
||||
}
|
||||
}
|
||||
|
||||
function api_set_delete_traps ($id, $thrash2, $other, $thrash3) {
|
||||
|
||||
if (defined ('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if($id == 'all'){
|
||||
$result = db_process_sql ('delete from ttrap');
|
||||
}
|
||||
else{
|
||||
$result = db_process_sql_delete('ttrap',array('id_trap' => $id));
|
||||
}
|
||||
|
||||
if (is_error($result)) {
|
||||
// TODO: Improve the error returning more info
|
||||
returnError('error_delete_trap', __('Error in trap delete.'));
|
||||
}
|
||||
else {
|
||||
returnData('string',
|
||||
array('type' => 'string',
|
||||
'data' => __('Deleted traps.')));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -43,13 +43,13 @@ function db_select_engine() {
|
|||
}
|
||||
}
|
||||
|
||||
function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true) {
|
||||
function db_connect($host = null, $db = null, $user = null, $pass = null, $port = null, $critical = true, $charset = "utf8") {
|
||||
global $config;
|
||||
static $error = 0;
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$return = mysql_connect_db($host, $db, $user, $pass, $port);
|
||||
$return = mysql_connect_db($host, $db, $user, $pass, $port, $charset);
|
||||
break;
|
||||
case "postgresql":
|
||||
$return = postgresql_connect_db($host, $db, $user, $pass, $port);
|
||||
|
@ -1656,28 +1656,12 @@ function db_get_type_field_table($table, $field) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the element count of a table.
|
||||
* Get the columns of a table.
|
||||
*
|
||||
* @param string $sql SQL query to get the element count.
|
||||
* @param string $table table to retrieve columns.
|
||||
*
|
||||
* @return int Return the number of elements in the table.
|
||||
* @return array with column names.
|
||||
*/
|
||||
function db_get_table_count($table, $search_history_db = false) {
|
||||
global $config;
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
return mysql_db_get_table_count($table, $search_history_db);
|
||||
break;
|
||||
case "postgresql":
|
||||
return postgresql_db_get_table_count($table, $search_history_db);
|
||||
break;
|
||||
case "oracle":
|
||||
return oracle_db_get_table_count($table, $search_history_db);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function db_get_fields($table) {
|
||||
global $config;
|
||||
|
||||
|
|
|
@ -850,25 +850,14 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
|
|||
if ($filter == '') {
|
||||
$filter = '1 = 1';
|
||||
}
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$sql = sprintf ("SELECT DISTINCT tevento.*
|
||||
FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent
|
||||
WHERE %s %s
|
||||
ORDER BY utimestamp DESC LIMIT %d", $agent_condition, $filter, $limit);
|
||||
break;
|
||||
case "oracle":
|
||||
$sql = sprintf ("SELECT *
|
||||
FROM tevento
|
||||
WHERE %s %s AND rownum <= %d
|
||||
ORDER BY utimestamp DESC", $agent_condition, $filter, $limit);
|
||||
break;
|
||||
}
|
||||
|
||||
$sql = sprintf ("SELECT DISTINCT tevento.*
|
||||
FROM tevento LEFT JOIN tagent_secondary_group tasg ON tevento.id_agente = tasg.id_agent
|
||||
WHERE %s %s
|
||||
ORDER BY utimestamp DESC LIMIT %d", $agent_condition, $filter, $limit);
|
||||
|
||||
$result = db_get_all_rows_sql ($sql);
|
||||
|
||||
|
||||
if ($result === false) {
|
||||
if ($return) {
|
||||
$returned = ui_print_info_message (__('No events'), '', true);
|
||||
|
@ -997,8 +986,6 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
|
|||
|
||||
$data[4] = "<a class='$myclass' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$event["id_agente"]."'>".
|
||||
agents_get_alias($event["id_agente"]). "</A>";
|
||||
|
||||
// ui_print_agent_name ($event["id_agente"], true, 25, '', true);
|
||||
// for System or SNMP generated alerts
|
||||
}
|
||||
elseif ($event["event_type"] == "system") {
|
||||
|
@ -1162,7 +1149,7 @@ function events_print_type_description ($type, $return = false) {
|
|||
break;
|
||||
case "going_down_critical":
|
||||
case "going_up_critical": //This is to be backwards compatible
|
||||
$output .= __('Going down to critical state');
|
||||
$output .= __('Going up to critical state');
|
||||
break;
|
||||
case "going_up_normal":
|
||||
case "going_down_normal": //This is to be backwards compatible
|
||||
|
@ -1863,15 +1850,20 @@ function events_get_response_target($event_id, $response_id, $server_id, $histor
|
|||
// Substitute each macro
|
||||
if (strpos($target, '_agent_address_') !== false) {
|
||||
if ($meta) {
|
||||
$server = metaconsole_get_connection_by_id ($server_id);
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
|
||||
$target = str_replace('_agent_address_', $event['id_agente'], $target);
|
||||
|
||||
if($meta) {
|
||||
metaconsole_restore_db_force();
|
||||
$agente_table_name = 'tmetaconsole_agent';
|
||||
$filter = array(
|
||||
'id_tagente' => $event['id_agente'],
|
||||
'id_tmetaconsole_setup' => $server_id
|
||||
);
|
||||
} else {
|
||||
$agente_table_name = 'tagente';
|
||||
$filter = array('id_agente' => $event['id_agente']);
|
||||
}
|
||||
|
||||
$ip = db_get_value_filter('direccion', $agente_table_name, $filter);
|
||||
// If agent has not an ip, display N/A
|
||||
if ($ip === false) $ip = __('N/A');
|
||||
$target = str_replace('_agent_address_', $ip, $target);
|
||||
}
|
||||
if (strpos($target, '_agent_id_') !== false) {
|
||||
$target = str_replace('_agent_id_', $event['id_agente'], $target);
|
||||
|
@ -2677,13 +2669,14 @@ function events_page_comments ($event, $childrens_ids = array()) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) {
|
||||
$comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%;"', true);
|
||||
|
||||
if (((tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) && $config["show_events_in_local"] == false || $config["event_replication"] == false) {
|
||||
$comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea("comment", 3, 10, '', 'style="min-height: 15px; width: 100%; disabled"', true);
|
||||
|
||||
$comments_form .= '<br><div style="text-align:right;">'.html_print_button(__('Add comment'),'comment_button',false,'event_comment();','class="sub next"',true).'</div><br></div>';
|
||||
}
|
||||
else {
|
||||
$comments_form = '';
|
||||
$comments_form = ui_print_message(__( 'If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.'));
|
||||
}
|
||||
|
||||
$comments = '<div id="extended_event_comments_page" class="extended_event_pages">'.$comments_form.html_print_table($table_comments, true).'</div>';
|
||||
|
|
|
@ -2188,19 +2188,26 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re
|
|||
|
||||
if ($data_agents == false) {
|
||||
$groups = implode(',', array_keys(users_get_groups(false, 'AR', false)));
|
||||
$p_table = "tagente";
|
||||
$s_table = "tagent_secondary_group";
|
||||
if (is_metaconsole()) {
|
||||
$p_table = "tmetaconsole_agent";
|
||||
$s_table = "tmetaconsole_agent_secondary_group";
|
||||
}
|
||||
$data = db_get_row_sql(sprintf('SELECT
|
||||
SUM(critical_count) AS Critical,
|
||||
SUM(warning_count) AS Warning,
|
||||
SUM(normal_count) AS Normal,
|
||||
SUM(unknown_count) AS Unknown
|
||||
%s
|
||||
FROM tagente ta LEFT JOIN tagent_secondary_group tasg
|
||||
FROM %s ta LEFT JOIN %s tasg
|
||||
ON ta.id_agente = tasg.id_agent
|
||||
WHERE
|
||||
ta.disabled = 0 AND
|
||||
%s
|
||||
(ta.id_grupo IN (%s) OR tasg.id_group IN (%s))',
|
||||
$show_not_init ? ', SUM(notinit_count) "Not init"' : '',
|
||||
$p_table, $s_table,
|
||||
empty($id_agent) ? '' : "ta.id_agente = $id_agent AND",
|
||||
$groups,
|
||||
$groups
|
||||
|
@ -2765,10 +2772,8 @@ function graph_events_validated($width = 300, $height = 200, $extra_filters = ar
|
|||
* @param integer width pie graph width
|
||||
* @param integer height pie graph height
|
||||
* @param string url
|
||||
* @param bool if the graph required is or not for metaconsole
|
||||
* @param bool if the graph required is or not for history table
|
||||
*/
|
||||
function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = false, $history = false, $noWaterMark = true) {
|
||||
function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $noWaterMark = true, $time_limit = false) {
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
|
@ -2798,26 +2803,17 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta =
|
|||
$url = str_replace(
|
||||
'SELECT_id_agente_modulo', 'SELECT id_agente_modulo', $url);
|
||||
|
||||
|
||||
// Choose the table where search if metaconsole or not
|
||||
if ($meta) {
|
||||
if ($history) {
|
||||
$event_table = 'tmetaconsole_event_history';
|
||||
}
|
||||
else {
|
||||
$event_table = 'tmetaconsole_event';
|
||||
}
|
||||
$field_extra = ', agent_name';
|
||||
$groupby_extra = ', server_id';
|
||||
}
|
||||
else {
|
||||
$event_table = 'tevento';
|
||||
$field_extra = '';
|
||||
$groupby_extra = '';
|
||||
}
|
||||
$event_table = 'tevento';
|
||||
$field_extra = '';
|
||||
$groupby_extra = '';
|
||||
|
||||
// Add tags condition to filter
|
||||
$tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND');
|
||||
|
||||
if ($time_limit && $config['event_view_hr']) {
|
||||
$tags_condition .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " .
|
||||
$config['event_view_hr'] * SECONDS_1HOUR . ")";
|
||||
}
|
||||
|
||||
//This will give the distinct id_agente, give the id_grupo that goes
|
||||
//with it and then the number of times it occured. GROUP BY statement
|
||||
|
@ -2851,13 +2847,8 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta =
|
|||
$system_events += $row["count"];
|
||||
}
|
||||
else {
|
||||
if ($meta) {
|
||||
$name = mb_substr (io_safe_output($row['agent_name']), 0, 25)." (".$row["count"].")";
|
||||
}
|
||||
else {
|
||||
$alias = agents_get_alias($row["id_agente"]);
|
||||
$name = mb_substr($alias, 0, 25)." #".$row["id_agente"]." (".$row["count"].")";
|
||||
}
|
||||
$alias = agents_get_alias($row["id_agente"]);
|
||||
$name = mb_substr($alias, 0, 25)." #".$row["id_agente"]." (".$row["count"].")";
|
||||
$data[$name] = $row["count"];
|
||||
}
|
||||
}
|
||||
|
@ -2868,14 +2859,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta =
|
|||
$name = __('SYSTEM')." (".$system_events.")";
|
||||
$data[$name] = $system_events;
|
||||
}
|
||||
|
||||
/*
|
||||
if ($other_events > 0) {
|
||||
$name = __('Other')." (".$other_events.")";
|
||||
$data[$name] = $other_events;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// Sort the data
|
||||
arsort($data);
|
||||
if ($noWaterMark) {
|
||||
|
@ -2898,7 +2882,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta =
|
|||
*
|
||||
* @param string filter Filter for query in DB
|
||||
*/
|
||||
function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWaterMark = true) {
|
||||
function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWaterMark = true, $time_limit = false) {
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
|
@ -2907,23 +2891,25 @@ function grafico_eventos_total($filter = "", $width = 320, $height = 200, $noWat
|
|||
// Add tags condition to filter
|
||||
$tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND');
|
||||
$filter .= $tags_condition;
|
||||
|
||||
if ($time_limit && $config['event_view_hr']) {
|
||||
$filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . $config['event_view_hr'] * SECONDS_1HOUR . ")";
|
||||
}
|
||||
|
||||
$data = array ();
|
||||
$legend = array ();
|
||||
$total = 0;
|
||||
|
||||
$where = '';
|
||||
|
||||
$where = "WHERE 1=1";
|
||||
if (!users_is_admin()) {
|
||||
$where = 'WHERE event_type NOT IN (\'recon_host_detected\', \'system\',\'error\', \'new_agent\', \'configuration_change\')';
|
||||
}
|
||||
|
||||
|
||||
$sql = sprintf("SELECT criticity, COUNT(id_evento) events
|
||||
FROM tevento
|
||||
LEFT JOIN tagent_secondary_group tasg
|
||||
ON tevento.id_agente = tasg.id_agent
|
||||
%s %s
|
||||
GROUP BY criticity ORDER BY events DESC", $where , $filter);
|
||||
|
||||
$criticities = db_get_all_rows_sql ($sql, false, false);
|
||||
|
||||
if (empty($criticities)) {
|
||||
|
@ -3150,9 +3136,9 @@ function graph_custom_sql_graph ($id, $width, $height,
|
|||
$ttl,
|
||||
$homeurl,
|
||||
"white",
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
"c1c1c1"
|
||||
"#c1c1c1"
|
||||
);
|
||||
break;
|
||||
case 'sql_graph_hbar': // horizontal bar
|
||||
|
@ -3173,7 +3159,7 @@ function graph_custom_sql_graph ($id, $width, $height,
|
|||
$ttl,
|
||||
$homeurl,
|
||||
'white',
|
||||
'c1c1c1'
|
||||
'#c1c1c1'
|
||||
);
|
||||
break;
|
||||
case 'sql_graph_pie': // Pie
|
||||
|
|
|
@ -666,6 +666,7 @@ function planned_downtimes_stop ($downtime) {
|
|||
function planned_downtimes_created ($values) {
|
||||
global $config;
|
||||
|
||||
$check_group = (bool) db_get_value ('id_grupo', 'tgrupo', 'id_grupo', $values['id_group']);
|
||||
$check = (bool) db_get_value ('name', 'tplanned_downtime', 'name', $values['name']);
|
||||
|
||||
$datetime_from = strtotime ($values['once_date_from'] . ' ' . $values['once_time_from']);
|
||||
|
@ -702,6 +703,11 @@ function planned_downtimes_created ($values) {
|
|||
'message' => __('Not created. Error inserting data') . ". "
|
||||
. __('The end day must be higher than the start day'));
|
||||
}
|
||||
else if (!$check_group && $values['id_group'] != 0) {
|
||||
return array('return' => false,
|
||||
'message' => __('Not created. Error inserting data') . ". "
|
||||
. __('Group not exist'));
|
||||
}
|
||||
else {
|
||||
if (trim(io_safe_output($values['name'])) != '') {
|
||||
if (!$check) {
|
||||
|
|
|
@ -9802,7 +9802,7 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_
|
|||
return (float) (100 - ($bad_period / $period_reduced) * 100);
|
||||
}
|
||||
|
||||
function reporting_get_stats_servers($tiny = true) {
|
||||
function reporting_get_stats_servers() {
|
||||
global $config;
|
||||
|
||||
$server_performance = servers_get_performance();
|
||||
|
@ -9838,21 +9838,20 @@ function reporting_get_stats_servers($tiny = true) {
|
|||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
|
||||
if ($tiny) {
|
||||
if (isset($server_performance ["total_network_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/network.png', true, array('title' => __('Remote modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_remote_modules"]) . '</span>';
|
||||
$tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_network_modules"]) . '</span>';
|
||||
|
||||
/* Hello there! :)
|
||||
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
|
||||
*/
|
||||
|
||||
$tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["remote_modules_rate"], 2) . '</span>';
|
||||
$tdata[2] = '<span class="med_data">' .
|
||||
format_numeric($server_performance["network_modules_rate"], 2) .
|
||||
'</span>';
|
||||
|
||||
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
if($server_performance ["total_remote_modules"]>10000 && !enterprise_installed()){
|
||||
$tdata[4] = "<div id='agentsmodal' class='publienterprise' title='Community version' style='text-align:left;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>";
|
||||
$tdata[4] = "<div id='remotemodulesmodal' class='publienterprise' title='Community version' style='text-align:left;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>";
|
||||
}
|
||||
else{
|
||||
$tdata[4] = ' ';
|
||||
|
@ -9861,134 +9860,105 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
else {
|
||||
if (isset($server_performance ["total_network_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/network.png', true, array('title' => __('Network modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_network_modules"]) . '</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' .
|
||||
format_numeric($server_performance["network_modules_rate"], 2) .
|
||||
'</span>';
|
||||
|
||||
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
if($server_performance ["total_remote_modules"]>10000 && !enterprise_installed()){
|
||||
$tdata[4] = "<div id='remotemodulesmodal' class='publienterprise' title='Community version' style='text-align:left;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>";
|
||||
}
|
||||
else{
|
||||
$tdata[4] = ' ';
|
||||
}
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
if (isset($server_performance ["total_plugin_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_plugin_modules"]) . '</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["plugin_modules_rate"], 2) . '</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
if (isset($server_performance ["total_prediction_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_prediction_modules"]) . '</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["prediction_modules_rate"], 2) . '</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
if (isset($server_performance ["total_wmi_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_wmi_modules"]) . '</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["wmi_modules_rate"], 2) . '</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
if (isset($server_performance ["total_web_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' .
|
||||
format_numeric($server_performance ["total_web_modules"]) .
|
||||
'</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' .
|
||||
format_numeric($server_performance ["web_modules_rate"], 2) .
|
||||
'</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
|
||||
if (isset($server_performance ["total_plugin_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = '<hr style="border: 0; height: 1px; background: #DDD">';
|
||||
$table_srv->colspan[count($table_srv->data)][0] = 4;
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
$tdata[0] = html_print_image('images/plugin.png', true, array('title' => __('Plugin modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_plugin_modules"]) . '</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["plugin_modules_rate"], 2) . '</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$system_events = db_get_value_sql(
|
||||
'SELECT SQL_NO_CACHE COUNT(id_evento)
|
||||
FROM tevento');
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$system_events = db_get_value_sql(
|
||||
'SELECT COUNT(id_evento)
|
||||
FROM tevento');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/lightning_go.png', true,
|
||||
array('title' => __('Total events'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' .
|
||||
format_numeric($system_events) . '</span>';
|
||||
|
||||
/* Hello there! :)
|
||||
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
|
||||
*/
|
||||
|
||||
if($system_events > 50000 && !enterprise_installed()){
|
||||
$tdata[2] = "<div id='monitoreventsmodal' class='publienterprise' title='Community version' style='text-align:left'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>";
|
||||
}
|
||||
|
||||
else{
|
||||
$tdata[3] = " ";
|
||||
}
|
||||
$table_srv->colspan[count($table_srv->data)][1] = 2;
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
if (isset($server_performance ["total_prediction_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/chart_bar.png', true, array('title' => __('Prediction modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_prediction_modules"]) . '</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["prediction_modules_rate"], 2) . '</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
if (isset($server_performance ["total_wmi_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/wmi.png', true, array('title' => __('WMI modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' . format_numeric($server_performance ["total_wmi_modules"]) . '</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' . format_numeric($server_performance ["wmi_modules_rate"], 2) . '</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
if (isset($server_performance ["total_web_modules"])) {
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/world.png', true, array('title' => __('Web modules'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data">' .
|
||||
format_numeric($server_performance ["total_web_modules"]) .
|
||||
'</span>';
|
||||
|
||||
$tdata[2] = '<span class="med_data">' .
|
||||
format_numeric($server_performance ["web_modules_rate"], 2) .
|
||||
'</span>';
|
||||
$tdata[3] = html_print_image('images/module.png', true, array('title' => __('Ratio') . ': ' . __('Modules by second'), 'width' => '16px')) . '/sec </span>';
|
||||
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
}
|
||||
|
||||
$tdata = array();
|
||||
$tdata[0] = '<hr style="border: 0; height: 1px; background: #DDD">';
|
||||
$table_srv->colspan[count($table_srv->data)][0] = 4;
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/lightning_go.png', true,
|
||||
array('title' => __('Total events'), 'width' => '25px'));
|
||||
$tdata[1] = '<span class="big_data" id="total_events">' .
|
||||
html_print_image('images/spinner.gif',true) . '</span>';
|
||||
|
||||
/* Hello there! :)
|
||||
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
|
||||
*/
|
||||
|
||||
if($system_events > 50000 && !enterprise_installed()){
|
||||
$tdata[2] = "<div id='monitoreventsmodal' class='publienterprise' title='Community version' style='text-align:left'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>";
|
||||
} else {
|
||||
$tdata[3] = " ";
|
||||
}
|
||||
$table_srv->colspan[count($table_srv->data)][1] = 2;
|
||||
$table_srv->rowclass[] = '';
|
||||
$table_srv->data[] = $tdata;
|
||||
|
||||
$output = '<fieldset class="databox tactical_set">
|
||||
<legend>' .
|
||||
__('Server performance') .
|
||||
'</legend>' .
|
||||
html_print_table($table_srv, true) . '</fieldset>';
|
||||
|
||||
|
||||
$output .= '<script type="text/javascript">';
|
||||
$output .= '$(document).ready(function () {';
|
||||
$output .= 'var parameters = {};';
|
||||
$output .= 'parameters["page"] = "include/ajax/events";';
|
||||
$output .= 'parameters["total_events"] = 1;';
|
||||
|
||||
$output .= '$.ajax({type: "GET",url: "ajax.php",data: parameters,';
|
||||
$output .= 'success: function(data) {';
|
||||
$output .= '$("#total_events").text(data);';
|
||||
$output .= '}';
|
||||
$output .= '});';
|
||||
$output .= '});';
|
||||
$output .= '</script>';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ function reporting_html_SLA($table, $item, $mini) {
|
|||
}
|
||||
}
|
||||
|
||||
if(isset($item['data'])){
|
||||
if(!(!isset($item['data']) && $hide_notinit_agent == 1)) {
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '99%';
|
||||
|
||||
|
@ -473,12 +473,22 @@ function reporting_html_SLA($table, $item, $mini) {
|
|||
foreach ($item['data'] as $sla) {
|
||||
if(isset($sla)){
|
||||
$the_first_men_time = get_agent_first_time(io_safe_output($sla['agent']));
|
||||
if (!$hide_notinit_agent) {
|
||||
//first_table
|
||||
$row = array();
|
||||
$row[] = $sla['agent'];
|
||||
$row[] = $sla['module'];
|
||||
|
||||
//first_table
|
||||
$row = array();
|
||||
$row[] = $sla['agent'];
|
||||
$row[] = $sla['module'];
|
||||
|
||||
if(is_numeric($sla['dinamic_text'])){
|
||||
$row[] = sla_truncate($sla['max'], $config['graph_precision']) . " / " .
|
||||
sla_truncate($sla['min'], $config['graph_precision']);
|
||||
}
|
||||
else{
|
||||
$row[] = $sla['dinamic_text'];
|
||||
}
|
||||
$row[] = round($sla['sla_limit'], 2) . "%";
|
||||
|
||||
if (!$hide_notinit_agent) {
|
||||
if(is_numeric($sla['dinamic_text'])){
|
||||
$row[] = sla_truncate($sla['max'], $config['graph_precision']) . " / " .
|
||||
sla_truncate($sla['min'], $config['graph_precision']);
|
||||
|
@ -647,6 +657,12 @@ function reporting_html_SLA($table, $item, $mini) {
|
|||
$table->colspan['checks_global']['cell'] = 2;
|
||||
$table->data['checks_global']['cell'] = html_print_table($table3, true);
|
||||
}
|
||||
else {
|
||||
$table->colspan['error']['cell'] = 3;
|
||||
$table->data['error']['cell'] =
|
||||
__('There are no Agent/Modules defined');
|
||||
}
|
||||
|
||||
if (!empty($item['charts'])) {
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '99%';
|
||||
|
@ -2321,7 +2337,7 @@ function reporting_html_availability(&$table, $item) {
|
|||
|
||||
global $config;
|
||||
|
||||
if (!empty($item["data"])) {
|
||||
if (!empty($item["data"]) || $hide_notinit_agent !=1) {
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '99%';
|
||||
$table1->data = array ();
|
||||
|
|
|
@ -468,8 +468,6 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
|
|||
enterprise_include_once ('meta/include/functions_ui_meta.php');
|
||||
include_graphs_dependencies();
|
||||
|
||||
$strict_user = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']);
|
||||
|
||||
$is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente));
|
||||
|
||||
if ($is_extra === ENTERPRISE_NOT_HOOK) {
|
||||
|
@ -483,9 +481,13 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
|
|||
return;
|
||||
}
|
||||
|
||||
// Get the agent info
|
||||
$agent = db_get_row ("tagente", "id_agente", $id_agente);
|
||||
|
||||
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) {
|
||||
if ($agent == false) return;
|
||||
|
||||
// Check all groups
|
||||
$groups = agents_get_all_groups_agent($id_agente, $agent["id_grupo"], is_metaconsole());
|
||||
if (! check_acl_one_of_groups ($config["id_user"], $groups, "AR") && ! check_acl_one_of_groups ($config["id_user"], $groups, "AW") && !$is_extra) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Agent General Information");
|
||||
require_once ("general/noaccess.php");
|
||||
|
@ -522,7 +524,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
|
|||
$hashdata = $user.$pwd_deserialiced['auth_token'];
|
||||
|
||||
$hashdata = md5($hashdata);
|
||||
$url = $server_data["server_url"] . "/index.php?" .
|
||||
$url = "//" . $server_data["server_url"] . "/index.php?" .
|
||||
"sec=estado&" .
|
||||
"sec2=operation/agentes/ver_agente&" .
|
||||
"id_agente=" . $agent["id_agente"] . "&" .
|
||||
|
@ -608,7 +610,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
|
|||
$go_to_agent = '<div style="text-align: right;">';
|
||||
|
||||
if($agent["id_os"] != 100){
|
||||
$go_to_agent .= '<a target=_blank href="' . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">';
|
||||
$go_to_agent .= '<a target=_blank href="' . "//" . $console_url . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$url_hash.'">';
|
||||
$go_to_agent .= html_print_submit_button (__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true);
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -1961,6 +1961,23 @@ function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png', $is
|
|||
echo $output;
|
||||
}
|
||||
|
||||
function ui_print_help_tip_border ($text, $return = false, $img = 'images/tip_border.png', $is_relative = false) {
|
||||
$output =
|
||||
'<a href="javascript:" class="tip" >' .
|
||||
html_print_image (
|
||||
$img,
|
||||
true,
|
||||
array('title' => $text),
|
||||
false,
|
||||
$is_relative && is_metaconsole()
|
||||
) .
|
||||
'</a>';
|
||||
|
||||
if ($return)
|
||||
return $output;
|
||||
echo $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Powerful debug function that also shows a backtrace.
|
||||
*
|
||||
|
|
|
@ -476,20 +476,20 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||
$form_items['background_row_2']['items'] = array('background', 'datos');
|
||||
$form_items['background_row_2']['html'] = '<td align="left">' .
|
||||
__('Original Size') . '</td>
|
||||
<td align="left">' . html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub"', true) . '</td>';
|
||||
<td align="left">' . html_print_button(__('Apply'), 'original_false', false, "setAspectRatioBackground('original')", 'class="sub vs_button_ghost"', true) . '</td>';
|
||||
|
||||
|
||||
$form_items['background_row_3'] = array();
|
||||
$form_items['background_row_3']['items'] = array('background', 'datos');
|
||||
$form_items['background_row_3']['html'] = '<td align="left">' .
|
||||
__('Aspect ratio') . '</td>
|
||||
<td align="left">' . html_print_button(__('Width proportional'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub"', true) . '</td>';
|
||||
<td align="left">' . html_print_button(__('Proportional Width'), 'original_false', false, "setAspectRatioBackground('width')", 'class="sub vs_button_ghost"', true) . '</td>';
|
||||
|
||||
|
||||
$form_items['background_row_4'] = array();
|
||||
$form_items['background_row_4']['items'] = array('background', 'datos');
|
||||
$form_items['background_row_4']['html'] = '<td align="left"></td>
|
||||
<td align="left">' . html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub"', true) . '</td>';
|
||||
<td align="left">' . html_print_button(__('Height proportional'), 'original_false', false, "setAspectRatioBackground('height')", 'class="sub vs_button_ghost"', true) . '</td>';
|
||||
|
||||
|
||||
$form_items['percentile_bar_row_1'] = array();
|
||||
|
|
|
@ -2236,17 +2236,25 @@ function pandoraFlotArea( graph_id, values, legend,
|
|||
}
|
||||
|
||||
$('#overview_' + graph_id).css('display', 'none');
|
||||
|
||||
|
||||
if (menu) {
|
||||
var parent_height;
|
||||
$('#menu_overview_' + graph_id).click(function() {
|
||||
$('#overview_' + graph_id).toggle();
|
||||
});
|
||||
|
||||
$("#menu_export_csv_"+graph_id)
|
||||
.click(function (event) {
|
||||
event.preventDefault();
|
||||
$("#menu_export_csv_"+graph_id).click(function (e) {
|
||||
e.preventDefault();
|
||||
plot.exportDataCSV();
|
||||
var es_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
||||
if(es_firefox){
|
||||
$("#dialog").css('visibility', 'visible').dialog();
|
||||
}
|
||||
delete data_base[0].threshold;
|
||||
plot = $.plot($('#' + graph_id), data_base,
|
||||
$.extend(true, {}, options, {
|
||||
legend: { show: true }
|
||||
}));
|
||||
});
|
||||
|
||||
$('#menu_threshold_' + graph_id).click(function() {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;">
|
||||
<h3>Validate</h3>
|
||||
<?php html_print_image("images/tick.png", false, array("title" => "Validated event", "alt" => "Validated event", "width" => '10', "height" => '10')); ?> - Validated event<br>
|
||||
<?php html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?> - Event not validated
|
||||
<?php //html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?><div style="width: 10px;height: 10px; display: inline-block;"></div> - Event not validated
|
||||
</div>
|
||||
|
||||
<div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;">
|
||||
|
@ -27,7 +27,8 @@
|
|||
<h3>Actions</h3>
|
||||
<?php html_print_image("images/ok.png", false, array("title" => "Validate event", "alt" => "Validate event")); ?> - Validate event<br>
|
||||
<?php html_print_image("images/cross.png", false, array("title" => "Delete event", "alt" => "Delete event")); ?> - Delete event<br>
|
||||
<?php html_print_image("images/page_lightning.png", false, array("title" => "Create incident from event", "alt" => "Create incident from event")); ?> - Create incident from event
|
||||
<?php html_print_image("images/eye.png", false, array("title" => "Show more", "alt" => "Show more")); ?> - Show more<br>
|
||||
<?php html_print_image("images/hourglass.png", false, array("title" => "In progress", "alt" => "In progress")); ?> - In progress
|
||||
</div>
|
||||
|
||||
<div style="clear: both;"> </div>
|
||||
|
|
|
@ -30,43 +30,43 @@
|
|||
This macros can be used in module alerts.
|
||||
</p>
|
||||
|
||||
<h2>Si el módulo es de tipo analisis de módulo web:</h2>
|
||||
<h2>IF THE MODULE IS A WEB MODULE ANALYSIS TYPE: </h2>
|
||||
|
||||
<p>
|
||||
Las macros dinámicas tendrán un formato especial que empieza por @ y tendrán estas posibles sustituciones:
|
||||
Dynamic macros will have a special format starting with @ and will have these possible substitutions:
|
||||
</p>
|
||||
<ol>
|
||||
<li style="font-family: 'lato-bolder'; font-size: 12pt;">
|
||||
@DATE_FORMAT (fecha/hora actual con formato definido por el usuario)
|
||||
@DATE_FORMAT (current date/time with user-defined format)
|
||||
</li>
|
||||
<li style="font-family: 'lato-bolder'; font-size: 12pt;">
|
||||
@DATE_FORMAT_nh (horas)
|
||||
@DATE_FORMAT_nh (hours)
|
||||
</li>
|
||||
<li style="font-family: 'lato-bolder'; font-size: 12pt;">
|
||||
@DATE_FORMAT_nm (minutos)
|
||||
@DATE_FORMAT_nm (minutes)
|
||||
</li>
|
||||
<li style="font-family: 'lato-bolder'; font-size: 12pt;">
|
||||
@DATE_FORMAT_nd (días)
|
||||
@DATE_FORMAT_nd (days)
|
||||
</li>
|
||||
<li style="font-family: 'lato-bolder'; font-size: 12pt;">
|
||||
@DATE_FORMAT_ns (segundos)
|
||||
@DATE_FORMAT_ns (seconds)
|
||||
</li>
|
||||
<li style="font-family: 'lato-bolder'; font-size: 12pt;">
|
||||
@DATE_FORMAT_nM (mes)
|
||||
@DATE_FORMAT_nM (month)
|
||||
</li>
|
||||
<li style="font-family: 'lato-bolder'; font-size: 12pt;">
|
||||
@DATE_FORMAT_nY (años)
|
||||
@DATE_FORMAT_nY (years)
|
||||
</li>
|
||||
</ol>
|
||||
<p>
|
||||
Donde “n” puede ser un numero sin signo (positivo) o negativo.
|
||||
Where "n" can be a number without a sign (positive) or negative.
|
||||
</p>
|
||||
<p>
|
||||
Y FORMAT sigue el standard de strftime de perl:
|
||||
And FORMAT follows the standard of perl's strftime:
|
||||
http://search.cpan.org/~dexter/POSIX-strftime-GNU-0.02/lib/POSIX/strftime/GNU.pm
|
||||
</p>
|
||||
<p>
|
||||
Ejemplos:
|
||||
Examples:
|
||||
</p>
|
||||
<pre>
|
||||
@DATE_%Y-%m-%d %H:%M:%S
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;">
|
||||
<h3>Validar</h3>
|
||||
<?php html_print_image("images/tick.png", false, array("title" => "Validated event", "alt" => "Validated event", "width" => '10', "height" => '10')); ?> - Validar evento<br>
|
||||
<?php html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?> - Evento no validado
|
||||
<?php //html_print_image("images/cross.png", false, array("title" => "Event not validated", "alt" => "Event not validated", "width" => '10', "height" => '10')); ?><div style="width: 10px;height: 10px; display: inline-block;"></div> - Evento no validado
|
||||
</div>
|
||||
|
||||
<div style="padding-left: 30px; width: 150px; float: left; line-height: 17px;">
|
||||
|
@ -27,7 +27,8 @@
|
|||
<h3>Acciones</h3>
|
||||
<?php html_print_image("images/ok.png", false, array("title" => "Validate event", "alt" => "Validate event")); ?> - Validar evento<br>
|
||||
<?php html_print_image("images/cross.png", false, array("title" => "Delete event", "alt" => "Delete event")); ?> - Borrar evento<br>
|
||||
<?php html_print_image("images/page_lightning.png", false, array("title" => "Create incident from event", "alt" => "Create incident from event")); ?> - Crear incidente del evento
|
||||
<?php html_print_image("images/eye.png", false, array("title" => "Mostrar más", "alt" => "Mostrar más")); ?> - Mostrar más<br>
|
||||
<?php html_print_image("images/hourglass.png", false, array("title" => "En progreso", "alt" => "En progreso")); ?> - En progreso
|
||||
</div>
|
||||
|
||||
<div style="clear: both;"> </div>
|
||||
|
|
|
@ -87,15 +87,16 @@ function inner_minimap_box(param_x, param_y) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function set_center(id) {
|
||||
pos_x = (width_svg / 2) - translation[0];
|
||||
pos_y = (height_svg / 2) - translation[1];
|
||||
function set_center(id, event) {
|
||||
pos_x = (width_svg / 2) - (translation[0] / scale);
|
||||
pos_y = (height_svg / 2) - (translation[1] / scale);
|
||||
|
||||
var params = [];
|
||||
params.push("set_center=1");
|
||||
params.push("id=" + id);
|
||||
params.push("x=" + pos_x);
|
||||
params.push("y=" + pos_y);
|
||||
params.push("scale=" + scale);
|
||||
params.push("page=operation/agentes/pandora_networkmap.view");
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
|
@ -2720,7 +2721,7 @@ function init_graph(parameter_object) {
|
|||
}
|
||||
window.scale_minimap = 4.2;
|
||||
window.translation = [0, 0];
|
||||
window.scale = 0.5;
|
||||
window.scale = (typeof (z_dash) != "undefined") ? z_dash : 0.5;
|
||||
window.node_radius = 40;
|
||||
if (typeof (parameter_object.node_radius) != "undefined") {
|
||||
window.node_radius = parameter_object.node_radius;
|
||||
|
|
|
@ -91,8 +91,8 @@ function configure_modules_form () {
|
|||
$("#text-ff_event").attr ("value", 0);
|
||||
$("#text-post_process").attr("value", 0);
|
||||
$("#text-unit").attr("value", '');
|
||||
$("#text-critical_inverse").attr ("value", 0);
|
||||
$("#text-warning_inverse").attr ("value", 0);
|
||||
$("#checkbox-critical_inverse").attr ("value", 0);
|
||||
$("#checkbox-warning_inverse").attr ("value", 0);
|
||||
$("#textarea_critical_instructions").attr ("value", '');
|
||||
$("#textarea_warning_instructions").attr ("value", '');
|
||||
$("#textarea_unknown_instructions").attr ("value", '');
|
||||
|
@ -138,8 +138,8 @@ function configure_modules_form () {
|
|||
$("#checkbox-history_data").check ();
|
||||
else
|
||||
$("#checkbox-history_data").uncheck ();
|
||||
|
||||
$("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]);
|
||||
|
||||
$("#dynamic_interval_select").val (data["dynamic_interval"]);
|
||||
$("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]);
|
||||
$("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]);
|
||||
|
||||
|
@ -157,8 +157,8 @@ function configure_modules_form () {
|
|||
$("#text-ff_event").attr ("value", (data["min_ff_event"] == 0) ? 0 : data["min_ff_event"]);
|
||||
$("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]);
|
||||
$("#text-unit").attr("value", (data["unit"] == '') ? '' : data["unit"])
|
||||
$("#text-critical_inverse").attr ("value", (data["critical_inverse"] == 0) ? 0 : data["critical_inverse"]);
|
||||
$("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]);
|
||||
$("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]);
|
||||
$("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]);
|
||||
$("#component_loading").hide ();
|
||||
$("#id_module_type").change ();
|
||||
if ($("#id_category").is("select")) {
|
||||
|
@ -300,7 +300,7 @@ function configure_modules_form () {
|
|||
else
|
||||
$("#checkbox-history_data").uncheck ();
|
||||
|
||||
$("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]);
|
||||
$("#dynamic_interval_select").val (data["dynamic_interval"]);
|
||||
$("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]);
|
||||
$("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]);
|
||||
|
||||
|
@ -322,8 +322,8 @@ function configure_modules_form () {
|
|||
$("#text-ff_event_critical").attr ("value", (data["min_ff_event_critical"] == 0) ? 0 : data["min_ff_event_critical"]);
|
||||
$("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]);
|
||||
$("#text-unit").attr("value", (data["unit"] == '') ? '' : data["unit"]);
|
||||
$("#text-critical_inverse").attr ("value", (data["critical_inverse"] == 0) ? 0 : data["critical_inverse"]);
|
||||
$("#text-warning_inverse").attr ("value", (data["warning_inverse"] == 0) ? 0 : data["warning_inverse"]);
|
||||
$("#checkbox-critical_inverse").prop ("checked", data["critical_inverse"]);
|
||||
$("#checkbox-warning_inverse").prop ("checked", data["warning_inverse"]);
|
||||
$("#component_loading").hide ();
|
||||
$("#id_module_type").change ();
|
||||
if ($("#id_category").is("select")) {
|
||||
|
|
|
@ -653,6 +653,15 @@ input.sub[disabled] {
|
|||
cursor: default;
|
||||
}
|
||||
|
||||
input.vs_button_ghost{
|
||||
background-color: transparent !important;
|
||||
border: 1px solid #82b92e;
|
||||
color: #82b92e !important;
|
||||
text-align: center;
|
||||
padding: 4px 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
input.next, input.upd, input.ok, input.wand, input.delete, input.cog,
|
||||
input.target, input.search, input.copy, input.add, input.graph,
|
||||
input.percentile, input.binary, input.camera, input.config,
|
||||
|
@ -1393,6 +1402,37 @@ table.databox {
|
|||
color: #222 !important;
|
||||
}
|
||||
|
||||
.databox.data>tbody>tr>td:first-child{
|
||||
border-left: 1px solid #e2e2e2;
|
||||
}
|
||||
|
||||
.databox.data>tbody>tr:last-child>td:first-child{
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.databox.data>tbody>tr>td:last-child {
|
||||
border-right: 1px solid #e2e2e2;
|
||||
}
|
||||
|
||||
.databox.data>tbody>tr:last-child >td:last-child {
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.databox.data>thead>tr:first-child>th:first-child {
|
||||
border-left: 1px solid #e2e2e2;
|
||||
border-top-left-radius: 4px;
|
||||
border-color: #373737;
|
||||
}
|
||||
|
||||
.databox.data>thead>tr:first-child>th:last-child {
|
||||
border-right: 1px solid #e2e2e2;
|
||||
border-top-right-radius: 4px;
|
||||
border-color: #373737;
|
||||
}
|
||||
.databox.data{
|
||||
border: none;
|
||||
}
|
||||
|
||||
.tabletitle {
|
||||
color: #333;
|
||||
}
|
||||
|
|
|
@ -1057,6 +1057,7 @@ else {
|
|||
$_GET['sec2'] = 'general/logon_ok';
|
||||
break;
|
||||
case 'Dashboard':
|
||||
$dashboard_from_main_page = 1;
|
||||
$id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url);
|
||||
$str = 'sec=reporting&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard;
|
||||
parse_str($str, $res);
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
<body>
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.727';
|
||||
$build = '181022';
|
||||
$version = '7.0NG.728';
|
||||
$build = '181025';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -228,12 +228,8 @@ class User {
|
|||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
|
||||
if ($system->getConfig('metaconsole'))
|
||||
$logo_image = html_print_image (ui_get_mobile_login_icon(),
|
||||
true, array ("alt" => "logo", "border" => 0));
|
||||
else
|
||||
$logo_image = html_print_image (ui_get_mobile_login_icon(),
|
||||
true, array ("alt" => "logo", "border" => 0),false, false, false, true);
|
||||
$logo_image = html_print_image (ui_get_mobile_login_icon(),
|
||||
true, array ("alt" => "logo", "border" => 0), false, false, false, true);
|
||||
|
||||
$ui->contentAddHtml('<div style="text-align: center;" class="login_logo">' .
|
||||
$logo_image . '</div>');
|
||||
|
@ -292,7 +288,7 @@ class User {
|
|||
$ui->beginContent();
|
||||
$ui->contentAddHtml('<div style="text-align: center;" class="login_logo">' .
|
||||
html_print_image (ui_get_mobile_login_icon(),
|
||||
true, array ("alt" => "logo", "border" => 0)) .
|
||||
true, array ("alt" => "logo", "border" => 0), false, false, false, true) .
|
||||
'</div>');
|
||||
$ui->contentAddHtml('<div id="login_container">');
|
||||
$ui->beginForm();
|
||||
|
|
|
@ -28,6 +28,7 @@ class Tactical {
|
|||
else {
|
||||
$this->correct_acl = false;
|
||||
}
|
||||
include_javascript_dependencies_flot_graph();
|
||||
}
|
||||
|
||||
public function show() {
|
||||
|
|
|
@ -623,7 +623,7 @@ foreach ($agents as $agent) {
|
|||
$data[0] = '<div class="left_' . $agent["id_agente"] . '">';
|
||||
$data[0] .= '<span>';
|
||||
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'"> <span style="font-size: 7pt;font-weight:bold" title ="' . $agent["nombre"]. '">'.$agent["alias"].'</span></a>';
|
||||
$data[0] .= '<a href="index.php?sec=view&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'"> <span style="font-size: 7pt;font-weight:bold" title ="' . $agent["nombre"]. '">'.$agent["alias"].'</span></a>';
|
||||
$data[0] .= '</span>';
|
||||
|
||||
if ($agent['quiet']) {
|
||||
|
@ -642,7 +642,7 @@ foreach ($agents as $agent) {
|
|||
$data[0] .= '<a href="index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id='.$cluster['id'].'">'.__('View').'</a>';
|
||||
}
|
||||
else{
|
||||
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'">'.__('View').'</a>';
|
||||
$data[0] .= '<a href="index.php?sec=view&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'">'.__('View').'</a>';
|
||||
}
|
||||
|
||||
if (check_acl ($config['id_user'], $agent["id_grupo"], "AW")) {
|
||||
|
|
|
@ -246,7 +246,7 @@ if (!empty($result_groups)) {
|
|||
$link = "<a href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "'>";
|
||||
} else {
|
||||
$deep = groups_get_group_deep ($data['_id_']);
|
||||
$link = "<a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>";
|
||||
$link = "<a href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>";
|
||||
}
|
||||
|
||||
$group_name = "<b><span style='font-size: 7.5pt'>" . ui_print_truncate_text($data['_name_'], 50) . "</span></b>";
|
||||
|
@ -279,7 +279,7 @@ if (!empty($result_groups)) {
|
|||
href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "'>";
|
||||
} else {
|
||||
$link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;'
|
||||
href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>";
|
||||
href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>";
|
||||
}
|
||||
if ($data["_id_"] == 0) {
|
||||
echo $link . $total_agentes . "</a>";
|
||||
|
@ -296,7 +296,7 @@ if (!empty($result_groups)) {
|
|||
href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_UNKNOWN ."'>";
|
||||
} else {
|
||||
$link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;'
|
||||
href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_UNKNOWN ."'>";
|
||||
href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_UNKNOWN ."'>";
|
||||
}
|
||||
if (($data["_id_"] == 0) && ($agents_unknown != 0)) {
|
||||
echo $link . $agents_unknown . "</a>";
|
||||
|
@ -313,7 +313,7 @@ if (!empty($result_groups)) {
|
|||
href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_NOT_INIT ."'>";
|
||||
} else {
|
||||
$link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;'
|
||||
href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_NOT_INIT ."'>";
|
||||
href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_NOT_INIT ."'>";
|
||||
}
|
||||
if (($data["_id_"] == 0) && ($agents_notinit != 0)) {
|
||||
echo $link . $agents_notinit . "</a>";
|
||||
|
@ -331,7 +331,7 @@ if (!empty($result_groups)) {
|
|||
href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']. "&status=" . AGENT_STATUS_CRITICAL ."'>";
|
||||
} else {
|
||||
$link = "<a class='group_view_data $color_class' style='font-weight: bold; font-size: 18px; text-align: center;'
|
||||
href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_CRITICAL ."'>";
|
||||
href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."&status=" . AGENT_STATUS_CRITICAL ."'>";
|
||||
}
|
||||
if (($data["_id_"] == 0) && ($agents_critical != 0)) {
|
||||
echo $link . $agents_critical . "</a>";
|
||||
|
|
|
@ -221,11 +221,10 @@ else {
|
|||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text ('name', $name, '', 30,
|
||||
100,true);
|
||||
$table->data[1][0] = __('Group');
|
||||
|
||||
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = html_print_select_groups($config['id_user'], "AR",
|
||||
true, 'id_group', $idGroup, '', '', '', true);
|
||||
true, 'id_group', $id_group, '', '', '', true);
|
||||
|
||||
$table->data[2][0] = __('Node radius');
|
||||
$table->data[2][1] = html_print_input_text ('node_radius', $node_radius, '', 2,
|
||||
|
|
|
@ -511,9 +511,16 @@ if (is_ajax ()) {
|
|||
$id = (int)get_parameter('id', 0);
|
||||
$x = (int)get_parameter('x', 0);
|
||||
$y = (int)get_parameter('y', 0);
|
||||
$scale = (float)get_parameter('scale', 0);
|
||||
|
||||
$networkmap = db_get_row('tmap', 'id', $id);
|
||||
|
||||
$array_filter = json_decode($networkmap['filter']);
|
||||
if (isset($array_filter->z_dash)) {
|
||||
$array_filter->z_dash = number_format($scale,2);
|
||||
}
|
||||
$filter = json_encode($array_filter);
|
||||
|
||||
// ACL for the network map
|
||||
// $networkmap_read = check_acl ($config['id_user'], $networkmap['id_group'], "MR");
|
||||
$networkmap_write = check_acl ($config['id_user'], $networkmap['id_group'], "MW");
|
||||
|
@ -529,7 +536,7 @@ if (is_ajax ()) {
|
|||
$networkmap['center_x'] = $x;
|
||||
$networkmap['center_y'] = $y;
|
||||
db_process_sql_update('tmap',
|
||||
array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y']),
|
||||
array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y'], 'filter' => $filter),
|
||||
array('id' => $id));
|
||||
|
||||
$return = array();
|
||||
|
|
|
@ -97,8 +97,11 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
</script>
|
||||
</head>
|
||||
<body bgcolor="#ffffff" style='background:#ffffff;'>
|
||||
|
||||
<?php
|
||||
|
||||
echo"<div id='dialog' title='".__('CSV Export Information')."' style='visibility:hidden;'>";
|
||||
echo"<p>" . __('The CSV export has been successful.') . "</p>";
|
||||
echo"</div>";
|
||||
// Module id
|
||||
$id = (int) get_parameter ("id", 0);
|
||||
// Agent id
|
||||
|
|
|
@ -163,7 +163,7 @@ $table->rowclass[] = '';
|
|||
// Server performance
|
||||
// ---------------------------------------------------------------------
|
||||
if ($is_admin) {
|
||||
$table->data[4][0] = reporting_get_stats_servers(false);
|
||||
$table->data[4][0] = reporting_get_stats_servers();
|
||||
$table->rowclass[] = '';
|
||||
}
|
||||
|
||||
|
@ -183,6 +183,11 @@ if (check_acl($config['id_user'],0,'ER')) {
|
|||
if (!empty($tags_condition)) {
|
||||
$event_filter .= " AND ($tags_condition)";
|
||||
}
|
||||
|
||||
if ($config['event_view_hr']) {
|
||||
$event_filter .= " AND utimestamp > (UNIX_TIMESTAMP(NOW()) - " . $config['event_view_hr'] * SECONDS_1HOUR . ")";
|
||||
}
|
||||
|
||||
$events = events_print_event_table ($event_filter, 10, "100%",true,false,true);
|
||||
ui_toggle($events, __('Latest events'),false,false);
|
||||
}
|
||||
|
@ -196,20 +201,44 @@ if ($is_admin) {
|
|||
|
||||
}
|
||||
$out = '<table cellpadding=0 cellspacing=0 class="databox pies" style="margin-top:15px;" width=100%><tr><td>';
|
||||
$out .= '<fieldset class="databox tactical_set">
|
||||
$out .= '<fieldset class="databox tactical_set" id="total_event_graph">
|
||||
<legend>' .
|
||||
__('Event graph') .
|
||||
'</legend>' .
|
||||
grafico_eventos_total("", 280, 150, false) . '</fieldset>';
|
||||
html_print_image('images/spinner.gif',true,array('id' => 'spinner_total_event_graph')) . '</fieldset>';
|
||||
$out .="</td><td>";
|
||||
$out .= '<fieldset class="databox tactical_set">
|
||||
$out .= '<fieldset class="databox tactical_set" id="graphic_event_group">
|
||||
<legend>' .
|
||||
__('Event graph by agent') .
|
||||
'</legend>' .
|
||||
grafico_eventos_grupo(280, 150, "", false, false, false) . '</fieldset>';
|
||||
html_print_image('images/spinner.gif', true, array('id' => 'spinner_graphic_event_group')) . '</fieldset>';
|
||||
$out .= '</td></tr></table>';
|
||||
echo $out;
|
||||
|
||||
echo '</td>';
|
||||
echo '</tr></table>';
|
||||
?>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var parameters = {};
|
||||
parameters["page"] = "include/ajax/events";
|
||||
parameters["total_event_graph"] = 1;
|
||||
|
||||
$.ajax({type: "GET",url: "ajax.php",data: parameters,
|
||||
success: function(data) {
|
||||
$("#spinner_total_event_graph").hide();
|
||||
$("#total_event_graph").append(data);
|
||||
}
|
||||
});
|
||||
|
||||
delete parameters["total_event_graph"];
|
||||
parameters["graphic_event_group"] = 1;
|
||||
|
||||
$.ajax({type: "GET",url: "ajax.php",data: parameters,
|
||||
success: function(data) {
|
||||
$("#spinner_graphic_event_group").hide();
|
||||
$("#graphic_event_group").append(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -68,14 +68,18 @@ if (is_ajax ()) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
$groups_orig = users_get_groups(false, $privilege);
|
||||
$groups_orig = users_get_groups(false, $privilege, false);
|
||||
$groups = array_keys($groups_orig);
|
||||
}
|
||||
|
||||
|
||||
// Build filter
|
||||
$filter = array();
|
||||
$filter['id_grupo'] = $groups;
|
||||
|
||||
// Group filter (primary and secondary)
|
||||
$filter[] = "(" .db_format_array_where_clause_sql(
|
||||
array('id_grupo' => $groups, 'id_group' => $groups),
|
||||
'OR'
|
||||
) . ")";
|
||||
|
||||
if (!empty($id_os))
|
||||
$filter['id_os'] = $id_os;
|
||||
if (!empty($agent_name))
|
||||
|
@ -158,12 +162,17 @@ if (is_ajax ()) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
$filter['group'] = 'id_agente';
|
||||
|
||||
// Build fields
|
||||
$fields = array('id_agente', 'alias');
|
||||
|
||||
// Perform search
|
||||
$agents = db_get_all_rows_filter('tagente', $filter, $fields);
|
||||
$agents = db_get_all_rows_filter(
|
||||
'tagente LEFT JOIN tagent_secondary_group ON id_agente=id_agent',
|
||||
$filter,
|
||||
$fields
|
||||
);
|
||||
if (empty($agents)) $agents = array();
|
||||
|
||||
foreach ($agents as $k => $v) {
|
||||
|
|
|
@ -680,7 +680,14 @@ else {
|
|||
}
|
||||
$comments_help_tip = "";
|
||||
if (!empty($event_user_comment_str)) {
|
||||
$comments_help_tip = ui_print_help_tip($event_user_comment_str, true);
|
||||
|
||||
if($myclass == 'datos_yellow'){
|
||||
$comments_help_tip = ui_print_help_tip_border($event_user_comment_str, true);
|
||||
}
|
||||
else{
|
||||
$comments_help_tip = ui_print_help_tip($event_user_comment_str, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$data[$i] = '<span id="comment_header_' . $event['id_evento'] . '">' . $comments_help_tip . '</span>';
|
||||
|
|
|
@ -50,7 +50,7 @@ if (is_ajax()) {
|
|||
else {
|
||||
snmp_browser_print_tree ($snmp_tree);
|
||||
echo html_print_submit_button(__('Create network components'),'create_network_component',
|
||||
false, array('style' => 'display: none; position: fixed; bottom: 55px; right: 80px;', 'class' => 'sub add'), true);
|
||||
false, array('style' => 'display: none; position: absolute; bottom: 0px; right: 35px;', 'class' => 'sub add'), true);
|
||||
|
||||
echo '<div id="dialog_error" style="display: none" title="Network components">';
|
||||
echo "<div>";
|
||||
|
|
|
@ -708,50 +708,61 @@ $table->head = array ();
|
|||
$table->size = array ();
|
||||
$table->data = array ();
|
||||
$table->align = array ();
|
||||
$table->headstyle = array ();
|
||||
|
||||
$table->head[0] = __('Status');
|
||||
$table->align[0] = "center";
|
||||
$table->size[0] = '5%';
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
|
||||
$table->head[1] = __('SNMP Agent');
|
||||
$table->align[1] = "center";
|
||||
$table->size[1] = '15%';
|
||||
$table->headstyle[1] = 'text-align: center';
|
||||
|
||||
$table->head[2] = __('Enterprise String');
|
||||
$table->align[2] = "center";
|
||||
$table->size[2] = '18%';
|
||||
$table->headstyle[2] = 'text-align: center';
|
||||
|
||||
if ($group_by) {
|
||||
$table->head[3] = __('Count');
|
||||
$table->align[3] = "center";
|
||||
$table->size[3] = '5%';
|
||||
$table->headstyle[3] = 'text-align: center';
|
||||
}
|
||||
|
||||
$table->head[4] = __('Trap subtype');
|
||||
$table->align[4] = "center";
|
||||
$table->size[4] = '10%';
|
||||
$table->headstyle[4] = 'text-align: center';
|
||||
|
||||
$table->head[5] = __('User ID');
|
||||
$table->align[5] = "center";
|
||||
$table->size[5] = '10%';
|
||||
$table->headstyle[5] = 'text-align: center';
|
||||
|
||||
$table->head[6] = __('Timestamp');
|
||||
$table->align[6] = "center";
|
||||
$table->size[6] = '10%';
|
||||
$table->headstyle[6] = 'text-align: center';
|
||||
|
||||
$table->head[7] = __('Alert');
|
||||
$table->align[7] = "center";
|
||||
$table->size[7] = '5%';
|
||||
$table->headstyle[7] = 'text-align: center';
|
||||
|
||||
$table->head[8] = __('Action');
|
||||
$table->align[8] = "center";
|
||||
$table->size[8] = '10%';
|
||||
$table->headstyle[8] = 'text-align: center';
|
||||
|
||||
$table->head[9] = html_print_checkbox_extended ("allbox", 1, false,
|
||||
false, "javascript:CheckAll();",
|
||||
'class="chk" title="'.__('All').'"', true);
|
||||
$table->align[9] = "center";
|
||||
$table->size[9] = '5%';
|
||||
$table->headstyle[9] = 'text-align: center';
|
||||
|
||||
$table->style[8] = "background: #F3F3F3; color: #111 !important;";
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue