Merge branch 'develop' into 'ent-2140-Faltan-OIDs-SNMP-Interface-Wizard'

Conflicts:
  pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php
This commit is contained in:
Tatiana Llorente 2019-07-16 11:57:36 +02:00
commit 0fbe7e0128
223 changed files with 10610 additions and 11359 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, AIX version
# Version 7.0NG.736, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, FreeBSD Version
# Version 7.0NG.736, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, HP-UX Version
# Version 7.0NG.736, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, GNU/Linux
# Version 7.0NG.736, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, GNU/Linux
# Version 7.0NG.736, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, Solaris Version
# Version 7.0NG.736, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.735
# Version 7.0NG.736
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.735, AIX version
# Version 7.0NG.736, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.735
# Version 7.0NG.736
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.735, HPUX Version
# Version 7.0NG.736, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735
# Version 7.0NG.736
# Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735
# Version 7.0NG.736
# Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735
# Version 7.0NG.736
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.735, Solaris version
# Version 7.0NG.736, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, AIX version
# Version 7.0NG.736, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.735-190625
Version: 7.0NG.736-190716
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.735-190625"
pandora_version="7.0NG.736-190716"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, GNU/Linux
# Version 7.0NG.736, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, FreeBSD Version
# Version 7.0NG.736, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, HP-UX Version
# Version 7.0NG.736, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, GNU/Linux
# Version 7.0NG.736, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, GNU/Linux
# Version 7.0NG.736, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, NetBSD Version
# Version 7.0NG.736, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.735, Solaris Version
# Version 7.0NG.736, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.735';
use constant AGENT_BUILD => '190625';
use constant AGENT_VERSION => '7.0NG.736';
use constant AGENT_BUILD => '190716';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.735
%define release 190625
%define version 7.0NG.736
%define release 190716
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.735
%define release 190625
%define version 7.0NG.736
%define release 190716
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.735
# Version 7.0NG.736
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.735}
{Pandora FMS Windows Agent v7.0NG.736}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190625}
{190716}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.735(Build 190625)")
#define PANDORA_VERSION ("7.0NG.736(Build 190716)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.735(Build 190625))"
VALUE "ProductVersion", "(7.0NG.736(Build 190716))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.735-190625
Version: 7.0NG.736-190716
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -1,17 +1,34 @@
<?php
/**
* Ajax handler.
*
* @category Ajax handler.
* @package Pandora FMS.
* @subpackage OpenSource.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
define('AJAX', true);
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Enable profiler for testing
if (!defined('__PAN_XHPROF__')) {
define('__PAN_XHPROF__', 0);
}
@ -56,7 +73,7 @@ if (isset($_GET['loginhash'])) {
$public_hash = get_parameter('hash', false);
// Check user
// Check user.
if ($public_hash == false) {
check_login();
} else {
@ -68,9 +85,9 @@ if ($public_hash == false) {
}
}
define('AJAX', true);
// Enterprise support
// Enterprise support.
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
include_once ENTERPRISE_DIR.'/load_enterprise.php';
}
@ -86,11 +103,9 @@ if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$config['relative_path'] = enterprise_hook('skins_set_image_skin_path', [$config['id_user']]);
}
if (isset($config['metaconsole'])) {
// Not cool way of know if we are executing from metaconsole or normal console
if ($config['metaconsole']) {
define('METACONSOLE', true);
}
if (is_metaconsole()) {
// Backward compatibility.
define('METACONSOLE', true);
}
if (file_exists($page)) {

View File

@ -69,7 +69,7 @@ function extension_db_status()
echo "<div style='text-align: right;'>";
html_print_input_hidden('db_status_execute', 1);
html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub"');
html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub next"');
echo '</div>';
echo '</form>';

View File

@ -270,6 +270,12 @@ function mainModuleGroups()
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
$table->width = '100%';
if ($config['style'] === 'pandora_black') {
$background_color = '#333';
} else {
$background_color = '#fff';
}
$head[0] = __('Groups');
$headstyle[0] = 'width: 20%; font-weight: bolder;';
foreach ($array_module_group as $key => $value) {
@ -314,7 +320,7 @@ function mainModuleGroups()
$data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>';
} else {
$data[$i][$j] = "<div style='background:white;".$cell_style."'>";
$data[$i][$j] = "<div style='background:".$background_color.';'.$cell_style."'>";
$data[$i][$j] .= 0;
$data[$i][$j] .= '</div>';
}
@ -323,7 +329,7 @@ function mainModuleGroups()
}
} else {
foreach ($value['gm'] as $k => $v) {
$data[$i][$j] = "<div style='background:white; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] = "<div style='background:".$background_color."; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] .= 0;
$data[$i][$j] .= '</div>';
$j++;

View File

@ -1,26 +1,60 @@
<?php
/**
* Net tools utils.
*
* @category Extensions
* @package Pandora FMS
* @subpackage NetTools
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Begin.
global $config;
// Requires.
require_once $config['homedir'].'/include/functions.php';
// This extension is usefull only if the agent has associated IP.
$id_agente = get_parameter('id_agente');
// This extension is usefull only if the agent has associated IP
$address = agents_get_address($id_agente);
if (!empty($address) || empty($id_agente)) {
extensions_add_opemode_tab_agent('network_tools', 'Network Tools', 'extensions/net_tools/nettool.png', 'main_net_tools', 'v1r1', 'AW');
extensions_add_opemode_tab_agent(
'network_tools',
'Network Tools',
'extensions/net_tools/nettool.png',
'main_net_tools',
'v1r1',
'AW'
);
}
/**
* Searchs for command.
*
* @param string $command Command.
*
* @return string Path.
*/
function whereis_the_command($command)
{
global $config;
@ -63,6 +97,9 @@ function whereis_the_command($command)
return $snmpget_path;
}
break;
default:
return null;
}
}
@ -87,85 +124,20 @@ function whereis_the_command($command)
}
function main_net_tools()
/**
* Execute net tools action.
*
* @param integer $operation Operation.
* @param string $ip Ip.
* @param string $community Community.
* @param string $snmp_version SNMP version.
*
* @return void
*/
function net_tools_execute($operation, $ip, $community, $snmp_version)
{
$id_agente = get_parameter('id_agente');
$principal_ip = db_get_sql("SELECT direccion FROM tagente WHERE id_agente = $id_agente");
$list_address = db_get_all_rows_sql('select id_a from taddress_agent where id_agent = '.$id_agente);
foreach ($list_address as $address) {
$ids[] = join(',', $address);
}
$ids_address = implode(',', $ids);
$ips = db_get_all_rows_sql('select ip from taddress where id_a in ('.$ids_address.')');
if ($ips == '') {
echo "<div class='error' style='margin-top:5px'>".__('The agent hasn\'t got IP').'</div>';
return;
}
echo "
<script type='text/javascript'>
function mostrarColumns(ValueSelect) {
value = ValueSelect.value;
if (value == 3) {
$('netToolTable').css('width','100%');
$('#snmpcolumn').show();
}
else {
$('netToolTable').css('width','100%');
$('#snmpcolumn').hide();
}
}
</script>";
echo '<div>';
echo "<form name='actionbox' method='post'>";
echo "<table class='databox filters' width=100% id=netToolTable>";
echo '<tr><td>';
echo __('Operation');
ui_print_help_tip(
__('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools')
);
echo '</td><td>';
echo "<select name='operation' onChange='mostrarColumns(this);'>";
echo "<option value='1'>".__('Traceroute');
echo "<option value='2'>".__('Ping host & Latency');
echo "<option value='3'>".__('SNMP Interface status');
echo "<option value='4'>".__('Basic TCP Port Scan');
echo "<option value='5'>".__('DiG/Whois Lookup');
echo '</select>';
echo '</td>';
echo '<td>';
echo __('IP address');
echo '</td><td>';
echo "<select name='select_ips'>";
foreach ($ips as $ip) {
if ($ip['ip'] == $principal_ip) {
echo "<option value='".$ip['ip']."' selected = 'selected'>".$ip['ip'];
} else {
echo "<option value='".$ip['ip']."'>".$ip['ip'];
}
}
echo '</select>';
echo '</td>';
echo "<td id='snmpcolumn' style=\"display:none;\">";
echo __('SNMP Community').'&nbsp;';
echo "<input name=community type=text value='public'>";
echo '</td><td>';
echo "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>";
echo '</td>';
echo '</tr></table>';
echo '</form>';
$operation = get_parameter('operation', 0);
$community = get_parameter('community', 'public');
$ip = get_parameter('select_ips');
if (!validate_address($ip)) {
ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
} else {
switch ($operation) {
case 1:
@ -175,7 +147,7 @@ function main_net_tools()
} else {
echo '<h3>'.__('Traceroute to ').$ip.'</h3>';
echo '<pre>';
echo system("$traceroute $ip");
echo system($traceroute.' '.$ip);
echo '</pre>';
}
break;
@ -187,7 +159,7 @@ function main_net_tools()
} else {
echo '<h3>'.__('Ping to %s', $ip).'</h3>';
echo '<pre>';
echo system("$ping -c 5 $ip");
echo system($ping.' -c 5 '.$ip);
echo '</pre>';
}
break;
@ -199,7 +171,7 @@ function main_net_tools()
} else {
echo '<h3>'.__('Basic TCP Scan on ').$ip.'</h3>';
echo '<pre>';
echo system("$nmap -F $ip");
echo system($nmap.' -F '.$ip);
echo '</pre>';
}
break;
@ -212,7 +184,7 @@ function main_net_tools()
ui_print_error_message(__('Dig executable does not exist.'));
} else {
echo '<pre>';
echo system("dig $ip");
echo system('dig '.$ip);
echo '</pre>';
}
@ -221,51 +193,227 @@ function main_net_tools()
ui_print_error_message(__('Whois executable does not exist.'));
} else {
echo '<pre>';
echo system("whois $ip");
echo system('whois '.$ip);
echo '</pre>';
}
break;
case 3:
$snmp_obj = [
'ip_target' => $ip,
'snmp_version' => $snmp_version,
'snmp_community' => $community,
'format' => '-Oqn',
];
$snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.3.0';
$result = get_h_snmpwalk($snmp_obj);
echo '<h3>'.__('SNMP information for ').$ip.'</h3>';
$snmpget = whereis_the_command('snmpget');
if (empty($snmpget)) {
ui_print_error_message(__('SNMPget executable does not exist.'));
echo '<h4>'.__('Uptime').'</h4>';
echo '<pre>';
if (empty($result)) {
ui_print_error_message(__('Target unreachable.'));
break;
} else {
echo '<h4>'.__('Uptime').'</h4>';
echo '<pre>';
echo exec("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.3.0 ");
echo '</pre>';
echo '<h4>'.__('Device info').'</h4>';
echo '<pre>';
echo system("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.1.0 ");
echo '</pre>';
echo '<h4>Interface Information</h4>';
echo '<table class=databox>';
echo '<tr><th>'.__('Interface');
echo '<th>'.__('Status');
$int_max = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.1.0 ");
for ($ax = 0; $ax < $int_max; $ax++) {
$interface = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.2.$ax ");
$estado = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.8.$ax ");
echo "<tr><td>$interface<td>$estado";
}
echo '</table>';
echo array_pop($result);
}
echo '</pre>';
echo '<h4>'.__('Device info').'</h4>';
echo '<pre>';
$snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.1.0';
$result = get_h_snmpwalk($snmp_obj);
if (empty($result)) {
ui_print_error_message(__('Target unreachable.'));
break;
} else {
echo array_pop($result);
}
echo '</pre>';
echo '<h4>Interface Information</h4>';
$table = new StdClass();
$table->class = 'databox';
$table->head = [];
$table->head[] = __('Interface');
$table->head[] = __('Status');
$i = 0;
$base_oid = '.1.3.6.1.2.1.2.2.1';
$idx_oids = '.1';
$names_oids = '.2';
$status_oids = '.8';
$snmp_obj['base_oid'] = $base_oid.$idx_oids;
$idx = get_h_snmpwalk($snmp_obj);
$snmp_obj['base_oid'] = $base_oid.$names_oids;
$names = get_h_snmpwalk($snmp_obj);
$snmp_obj['base_oid'] = $base_oid.$status_oids;
$statuses = get_h_snmpwalk($snmp_obj);
foreach ($idx as $k => $v) {
$index = str_replace($base_oid.$idx_oids, '', $k);
$name = $names[$base_oid.$names_oids.$index];
$status = $statuses[$base_oid.$status_oids.$index];
$table->data[$i][0] = $name;
$table->data[$i++][1] = $status;
}
html_print_table($table);
break;
default:
// Ignore.
break;
}
}
}
/**
* Main function.
*
* @return void
*/
function main_net_tools()
{
$operation = get_parameter('operation', 0);
$community = get_parameter('community', 'public');
$ip = get_parameter('select_ips');
$snmp_version = get_parameter('select_version');
// Show form.
$id_agente = get_parameter('id_agente', 0);
$principal_ip = db_get_sql(
sprintf(
'SELECT direccion FROM tagente WHERE id_agente = %d',
$id_agente
)
);
$list_address = db_get_all_rows_sql(
sprintf(
'SELECT id_a FROM taddress_agent WHERE id_agent = %d',
$id_agente
)
);
foreach ($list_address as $address) {
$ids[] = join(',', $address);
}
$ips = db_get_all_rows_sql(
sprintf(
'SELECT ip FROM taddress WHERE id_a IN (%s)',
join($ids)
)
);
if ($ips == '') {
echo "<div class='error' style='margin-top:5px'>".__('The agent hasn\'t got IP').'</div>';
return;
}
// Javascript.
?>
<script type='text/javascript'>
$(document).ready(function(){
mostrarColumns($('#operation :selected').val());
});
function mostrarColumns(value) {
if (value == 3) {
$('.snmpcolumn').show();
}
else {
$('.snmpcolumn').hide();
}
}
</script>
<?php
echo '<div>';
echo "<form name='actionbox' method='post'>";
echo "<table class='databox filters' width=100% id=netToolTable>";
echo '<tr><td>';
echo __('Operation');
ui_print_help_tip(
__('You can set the command path in the menu Administration -&gt; Extensions -&gt; Config Network Tools')
);
echo '</td><td>';
html_print_select(
[
1 => __('Traceroute'),
2 => __('Ping host & Latency'),
3 => __('SNMP Interface status'),
4 => __('Basic TCP Port Scan'),
5 => __('DiG/Whois Lookup'),
],
'operation',
$operation,
'mostrarColumns(this.value)',
__('Please select')
);
echo '</td>';
echo '<td>';
echo __('IP address');
echo '</td><td>';
$ips_for_select = array_reduce(
$ips,
function ($carry, $item) {
$carry[$item['ip']] = $item['ip'];
return $carry;
}
);
html_print_select(
$ips_for_select,
'select_ips',
$principal_ip
);
echo '</td>';
echo "<td class='snmpcolumn'>";
echo __('SNMP Version');
html_print_select(
[
'1' => 'v1',
'2c' => 'v2c',
],
'select_version',
$snmp_version
);
echo '</td><td class="snmpcolumn">';
echo __('SNMP Community').'&nbsp;';
html_print_input_text('community', $community);
echo '</td><td>';
echo "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>";
echo '</td>';
echo '</tr></table>';
echo '</form>';
if ($operation) {
// Execute form.
net_tools_execute($operation, $ip, $community, $snmp_version);
}
echo '</div>';
}
/**
* Add option.
*
* @return void
*/
function godmode_net_tools()
{
global $config;

View File

@ -173,7 +173,7 @@ function pandora_realtime_graphs()
$table->colspan[2]['snmp_oid'] = 2;
$data['snmp_ver'] = __('Version').'&nbsp;&nbsp;'.html_print_select($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true);
$data['snmp_ver'] .= '&nbsp;&nbsp;'.html_print_button(__('SNMP walk'), 'snmp_walk', false, 'javascript:realtimeGraphs.snmpBrowserWindow();', 'class="sub next"', true);
$data['snmp_ver'] .= '&nbsp;&nbsp;'.html_print_button(__('SNMP walk'), 'snmp_walk', false, 'javascript:snmpBrowserWindow();', 'class="sub next"', true);
$table->colspan[2]['snmp_ver'] = 2;
$table->data[] = $data;

View File

@ -10,7 +10,9 @@
var plot;
var plotOptions = {
legend: { container: $("#chartLegend") },
legend: {
container: $("#chartLegend")
},
xaxis: {
tickFormatter: function(timestamp, axis) {
var date = new Date(timestamp * 1000);
@ -131,47 +133,6 @@
resetDataPooling();
}
// Set the form OID to the value selected in the SNMP browser
function setOID() {
if ($("#snmp_browser_version").val() == "3") {
$("#text-snmp_oid").val($("#table1-0-1").text());
} else {
$("#text-snmp_oid").val($("#snmp_selected_oid").text());
}
// Close the SNMP browser
$(".ui-dialog-titlebar-close").trigger("click");
}
// Show the SNMP browser window
function snmpBrowserWindow() {
// Keep elements in the form and the SNMP browser synced
$("#text-target_ip").val($("#text-ip_target").val());
$("#text-community").val($("#text-snmp_community").val());
$("#snmp_browser_version").val($("#snmp_version").val());
$("#snmp3_browser_auth_user").val($("#snmp3_auth_user").val());
$("#snmp3_browser_security_level").val($("#snmp3_security_level").val());
$("#snmp3_browser_auth_method").val($("#snmp3_auth_method").val());
$("#snmp3_browser_auth_pass").val($("#snmp3_auth_pass").val());
$("#snmp3_browser_privacy_method").val($("#snmp3_privacy_method").val());
$("#snmp3_browser_privacy_pass").val($("#snmp3_privacy_pass").val());
$("#snmp_browser_container")
.show()
.dialog({
title: "",
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 920,
height: 500
});
}
function shortNumber(number) {
if (Math.round(number) != number) return number;
number = Number.parseInt(number);
@ -187,6 +148,7 @@
return number + " " + shorts[pos];
}
function roundToTwo(num) {
return +(Math.round(num + "e+2") + "e-2");
}

View File

@ -0,0 +1 @@
operation/servers/recon_view.php

View File

@ -1,6 +1,28 @@
START TRANSACTION;
ALTER TABLE `tmetaconsole_agent` ADD INDEX `id_tagente_idx` (`id_tagente`);
DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x';
CREATE TABLE IF NOT EXISTS `tcredential_store` (
`identifier` varchar(100) NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
`product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM',
`username` text,
`password` text,
`extra_1` text,
`extra_2` text,
PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tcredential_store` (`identifier`, `id_group`, `product`, `username`, `password`) VALUES ("imported_aws_account", 0, "AWS", (SELECT `value` FROM `tconfig` WHERE `token` = "aws_access_key_id" LIMIT 1), (SELECT `value` FROM `tconfig` WHERE `token` = "aws_secret_access_key" LIMIT 1));
DELETE FROM `tcredential_store` WHERE `username` IS NULL AND `password` IS NULL;
UPDATE `tagente` ta INNER JOIN `tagente` taa on ta.`id_parent` = taa.`id_agente` AND taa.`nombre` IN ("us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1") SET ta.nombre = md5(concat((SELECT `username` FROM `tcredential_store` WHERE `identifier` = "imported_aws_account" LIMIT 1), ta.`nombre`));
UPDATE `tagente` SET `nombre` = md5(concat((SELECT `username` FROM `tcredential_store` WHERE `identifier` = "imported_aws_account" LIMIT 1), `nombre`)) WHERE `nombre` IN ("Aws", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1");
UPDATE `trecon_task` SET `auth_strings` = "imported_aws_account" WHERE `type` IN (2,6,7);
COMMIT;

View File

@ -0,0 +1,13 @@
START TRANSACTION;
ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
COMMIT;

View File

@ -362,7 +362,7 @@ if ($console_mode == 1) {
true
);
echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<table id='diagnostic_info' width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
}

View File

@ -796,6 +796,8 @@ ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DE
ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
-- -----------------------------------------------------
-- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@ -1007,10 +1009,12 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`agent_version` varchar(100) default '',
`ultimo_contacto_remoto` datetime default '1970-01-01 00:00:00',
`disabled` tinyint(2) NOT NULL default '0',
`remote` tinyint(1) NOT NULL default '0',
`id_parent` int(10) unsigned default '0',
`custom_id` varchar(255) default '',
`server_name` varchar(100) default '',
`cascade_protection` tinyint(2) NOT NULL default '0',
`cascade_protection_module` int(10) unsigned default '0',
`timezone_offset` TINYINT(2) NULL DEFAULT '0' COMMENT 'number of hours of diference with the server timezone' ,
`icon_path` VARCHAR(127) NULL DEFAULT NULL COMMENT 'path in the server to the image of the icon representing the agent' ,
`update_gis_data` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and do not update it' ,
@ -1025,19 +1029,21 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`fired_count` bigint(20) NOT NULL default '0',
`update_module_count` tinyint(1) NOT NULL default '0',
`update_alert_count` tinyint(1) NOT NULL default '0',
`update_secondary_groups` tinyint(1) NOT NULL default '0',
`transactional_agent` tinyint(1) NOT NULL default '0',
`alias` varchar(600) BINARY NOT NULL default '',
`alias_as_name` tinyint(2) NOT NULL default '0',
`safe_mode_module` int(10) unsigned NOT NULL default '0',
`cps` int NOT NULL default 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),
KEY `id_tagente_idx` (`id_tagente`),
KEY `disabled` (`disabled`),
KEY `id_grupo` (`id_grupo`),
FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE tmetaconsole_agent ADD COLUMN `remote` tinyint(1) NOT NULL default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `cascade_protection_module` int(10) default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `transactional_agent` tinyint(1) NOT NULL default '0';
ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT '';
-- ---------------------------------------------------------------------
-- Table `ttransaction`
-- ---------------------------------------------------------------------
@ -1235,13 +1241,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 28);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 30);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '735');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '737');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
-- ---------------------------------------------------------------------
@ -1438,11 +1444,14 @@ ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1'
ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`
-- ---------------------------------------------------------------------
ALTER TABLE tmodule_relationship ADD COLUMN `id_server` varchar(100) NOT NULL DEFAULT '';
ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
-- ---------------------------------------------------------------------
-- Table `tpolicy_module`
@ -2192,3 +2201,21 @@ CREATE TABLE `tvisual_console_elements_cache` (
ON UPDATE CASCADE
) engine=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `tcredential_store`
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tcredential_store` (
`identifier` varchar(100) NOT NULL,
`id_group` mediumint(4) unsigned NOT NULL DEFAULT 0,
`product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM',
`username` text,
`password` text,
`extra_1` text,
`extra_2` text,
PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------------------------------------------------
-- Table `treport_content_sla_combined`
-- ---------------------------------------------------------------------
ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;

View File

@ -35,6 +35,7 @@ ui_require_css_file('firts_task');
</p>
<form action="index.php?sec=gservers&sec2=godmode/servers/discovery" method="post">
<input type="submit" class="button_task" value="<?php echo __('Discover'); ?>" />
<input type="hidden" name="discovery_hint" value="1"/>
</form>
</div>
</div>

View File

@ -376,6 +376,9 @@ if (isset($correct_reset_pass_process)) {
}
if (isset($login_failed)) {
$nick = get_parameter_post('nick');
$fails = db_get_value('failed_attempt', 'tusuario', 'id_user', $nick);
$attemps = ($config['number_attempts'] - $fails);
echo '<div id="login_failed" title="'.__('Login failed').'">';
echo '<div class="content_alert">';
echo '<div class="icon_message_alert">';
@ -386,6 +389,9 @@ if (isset($login_failed)) {
echo '<h1>'.__('ERROR').'</h1>';
echo '<p>'.$config['auth_error'].'</p>';
echo '</div>';
echo '<div class="text_message_alert">';
echo '<p><strong>Remaining attempts: '.$attemps.'</strong></p>';
echo '</div>';
echo '<div class="button_message_alert">';
html_print_submit_button('Ok', 'hide-login-error', false);
echo '</div>';
@ -680,5 +686,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
$("#final_process_correct").dialog('close');
});
});
/* ]]> */
</script>

View File

@ -0,0 +1,164 @@
<html>
<head>
<style>
#alert_messages_na{
z-index:2;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width:650px;
height: 400px;
background:white;
background-image:url('images/imagen-no-acceso.jpg');
background-repeat:no-repeat;
justify-content: center;
display: flex;
flex-direction: column;
box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
}
.modalheade{
text-align:center;
width:100%;
position:absolute;
top:0;
}
.modalheadertex{
color:#000;
font-family:Nunito;
line-height: 40px;
font-size: 23pt;
margin-bottom:30px;
}
.modalclose{
cursor:pointer;
display:inline;
float:right;
margin-right:10px;
margin-top:10px;
}
.modalconten{
color:black;
width:300px;
margin-left: 30px;
}
.modalcontenttex{
text-align:left;
color:black;
font-size: 11pt;
line-height:13pt;
margin-bottom:30px;
}
.modalokbutto{
cursor:pointer;
text-align:center;
display: inline-block;
padding: 6px 45px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalokbuttontex{
color:#82b92e;
font-family:Nunito;
font-size:13pt;
}
.modalgobutto{
cursor:pointer;
text-align:center;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalgobuttontex{
color:#82b92e;
font-family:Nunito;
font-size:10pt;
}
#opacidad{
position:fixed;
background:black;
opacity:0.6;
z-index:-1;
left:0px;
top:0px;
width:100%;
height:100%;
}
/*
.textodialog{
margin-left: 0px;
color:#333;
padding:20px;
font-size:9pt;
}
.cargatextodialog{
max-width:58.5%;
width:58.5%;
min-width:58.5%;
float:left;
margin-left: 0px;
font-size:18pt;
padding:20px;
text-align:center;
}
.cargatextodialog p, .cargatextodialog b, .cargatextodialog a{
font-size:18pt;
}
*/
</style>
</head>
<body>
<div id="alert_messages_na">
<div class='modalheade'>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>
</div>
<div class='modalconten'>
<div class='modalheadertex'>
<?php echo __("You don't have access to this page"); ?>
</div>
<div class='modalcontenttex'>
<?php
echo __('Access to this page is restricted to authorized users SAML only, please contact system administrator if you need assistance.');
echo '<br/> <br/>';
echo __('Please make sure you have SAML authentication properly configured. For more information the error to access this page are recorded in security logs of %s System Database', get_product_name());
?>
</div>
<div class='modalokbutto cerrar'>
<span class='modalokbuttontex'>OK</span>
</div>
</div>
</div>
<div id="opacidad"></div>
</body>
</html>
<script>
$(".cerrar").click(function(){
window.location=".";
});
$('div#page').css('background-color','#d3d3d3');
</script>

View File

@ -122,7 +122,6 @@ if (is_ajax()) {
exit();
}
ui_require_css_file('register');
$initial = isset($config['initial_wizard']) !== true
@ -150,26 +149,27 @@ if ($initial && users_is_admin()) {
);
}
if ($registration && users_is_admin()) {
// Prepare registration wizard, not launch. leave control to flow.
registration_wiz_modal(
false,
// Launch only if not being launch from 'initial'.
!$initial,
(($show_newsletter === true) ? 'force_run_newsletter()' : null)
);
} else {
if ($show_newsletter) {
// Show newsletter wizard for current user.
newsletter_wiz_modal(
if (!$config['disabled_newsletter']) {
if ($registration && users_is_admin()) {
// Prepare registration wizard, not launch. leave control to flow.
registration_wiz_modal(
false,
// Launch only if not being call from 'registration'.
!$registration && !$initial
// Launch only if not being launch from 'initial'.
!$initial,
(($show_newsletter === true) ? 'force_run_newsletter()' : null)
);
} else {
if ($show_newsletter) {
// Show newsletter wizard for current user.
newsletter_wiz_modal(
false,
// Launch only if not being call from 'registration'.
!$registration && !$initial
);
}
}
}
$newsletter = null;
?>

View File

@ -211,7 +211,7 @@ if (!$new_agent && $alias != '') {
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name" style="width: 40%;">';
if ($id_agente) {
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" disabled="true" value="'.$id_agente.'" />';
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" readonly value="'.$id_agente.'" />';
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
$table_agent_name .= html_print_image(
'images/zoom.png',
@ -787,7 +787,7 @@ $table_adv_options = '
'.$adv_secondary_groups_right.'
</div>
</div>
<div class="adv_right" >
<div class="agent_av_opt_right" >
'.$table_adv_parent.$table_adv_module_mode.$table_adv_cascade;
if ($new_agent) {
@ -798,7 +798,7 @@ if ($new_agent) {
$table_adv_options .= '</div>';
$table_adv_options .= '
<div class="adv_left" >
<div class="agent_av_opt_left" >
'.$table_adv_gis.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'
</div>';
@ -1172,6 +1172,19 @@ ui_require_jquery_file('bgiframe');
}
$(document).ready (function() {
var previous_primary_group_select;
$("#grupo").on('focus', function () {
previous_primary_group_select = this.value;
}).change(function() {
if ($("#secondary_groups_selected option[value="+$("#grupo").val()+"]").length) {
alert("<?php echo __('Secondary group cannot be primary too.'); ?>");
$("#grupo").val(previous_primary_group_select);
} else {
previous_primary_group_select = this.value;
}
});
$("select#id_os").pandoraSelectOS ();
var checked = $("#checkbox-cascade_protection").is(":checked");
@ -1220,7 +1233,7 @@ ui_require_jquery_file('bgiframe');
128,
128
);
$("#text-agente").prop('disabled', true);
$("#text-agente").prop('readonly', true);
});
</script>

View File

@ -23,7 +23,6 @@ $idAgent = (int) get_parameter('id_agente', 0);
$ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent);
check_login();
$ip_target = (string) get_parameter('ip_target', $ipAgent);
$use_agent = get_parameter('use_agent');
$snmp_community = (string) get_parameter('snmp_community', 'public');
@ -469,6 +468,9 @@ if (enterprise_installed()) {
if ($row['server_type'] != 13) {
$s_type = ' (Standard)';
} else {
// Check if satellite server has remote configuration enabled
$satellite_remote = config_agents_has_remote_configuration($id_agent);
$id_satellite = $row['id_server'];
$s_type = ' (Satellite)';
}
@ -477,7 +479,17 @@ if (enterprise_installed()) {
}
$table->data[1][2] = '<b>'.__('Server to execute command').'</b>';
$table->data[1][3] = html_print_select($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true);
$table->data[1][2] .= '<span id=satellite_remote_tip>'.ui_print_help_tip(__('In order to use remote executions you need to enable remote execution in satellite server'), true, 'images/tip_help.png', false, 'display:').'</span>';
$table->data[1][4] = html_print_select(
$servers_to_exec,
'server_to_exec',
$server_to_exec,
'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')
',
'',
'',
true
);
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
@ -624,8 +636,12 @@ ui_require_jquery_file('bgiframe');
/* <![CDATA[ */
$(document).ready (function () {
var inputActive = true;
$('#server_to_exec option').trigger('change');
$(document).data('text_for_module', $("#none_text").html());
$("#id_snmp").change(snmp_changed_by_multiple_snmp);
@ -707,5 +723,20 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
"json");
}
function satellite_remote_warn(id_satellite, remote)
{
if(!remote)
{
$('#server_to_exec option[value='+id_satellite+']').prop('disabled', true);
$('#satellite_remote_tip').removeAttr("style").show();
}
else
{
$('#satellite_remote_tip').removeAttr("style").hide();
}
}
/* ]]> */
</script>

View File

@ -1213,7 +1213,7 @@ if ($update_module || $create_module) {
$max_timeout = (int) get_parameter('max_timeout');
$max_retries = (int) get_parameter('max_retries');
$min = (int) get_parameter_post('min');
$min = (int) get_parameter('min');
$max = (int) get_parameter('max');
$interval = (int) get_parameter('module_interval', $intervalo);
$ff_interval = (int) get_parameter('module_ff_interval');
@ -1276,18 +1276,10 @@ if ($update_module || $create_module) {
$m_hide = $m['hide'];
}
if ($update_module) {
if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password(get_parameter($m['macro'], ''));
} else {
$macros[$k]['value'] = get_parameter($m['macro'], '');
}
if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password(get_parameter($m['macro'], ''));
} else {
if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password($macros_names[$k]);
} else {
$macros[$k]['value'] = $macros_names[$k];
}
$macros[$k]['value'] = get_parameter($m['macro'], '');
}
}

View File

@ -163,7 +163,7 @@ echo '<td>';
echo __('Group').'&nbsp;';
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && check_acl($config['id_user'], 0, 'AW')) {
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = false;
} else {
$return_all_group = true;
@ -680,7 +680,7 @@ if ($agents !== false) {
}
echo '</table>';
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset, 0, false, 'offset', true, 'pagination-bottom');
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
echo "<table width='100%'><tr><td align='right'>";
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]);

View File

@ -267,10 +267,10 @@ if ($id_agent_module) {
$cron_interval = explode(' ', $module['cron_interval']);
if (isset($cron_interval[4])) {
$minute_from = $cron_interval[0];
$min = explode('-', $minute_from);
$minute_from = $min[0];
if (isset($min[1])) {
$minute_to = $min[1];
$minute = explode('-', $minute_from);
$minute_from = $minute[0];
if (isset($minute[1])) {
$minute_to = $minute[1];
}
$hour_from = $cron_interval[1];

View File

@ -78,6 +78,13 @@ function push_table_advanced($row, $id=false)
function add_component_selection($id_network_component_type)
{
global $table_simple;
global $config;
if ($config['style'] === 'pandora_black') {
$background_row = 'background-color: #444';
} else {
$background_row = 'background-color: #cfcfcf';
}
$data = [];
$data[0] = __('Using module component').' ';
@ -116,7 +123,7 @@ function add_component_selection($id_network_component_type)
$data[1] .= '</span>';
$table_simple->colspan['module_component'][1] = 3;
$table_simple->rowstyle['module_component'] = 'background-color: #cfcfcf';
$table_simple->rowstyle['module_component'] = $background_row;
prepend_table_simple($data, 'module_component');
}
@ -134,7 +141,9 @@ $largeClassDisabledBecauseInPolicy = '';
$page = get_parameter('page', '');
if (strstr($page, 'policy_modules') === false && $id_agent_module) {
$in_policies_page = strstr($page, 'policy_modules');
if ($in_policies_page === false && $id_agent_module) {
if ($config['enterprise_installed']) {
if (policies_is_module_linked($id_agent_module) == 1) {
$disabledBecauseInPolicy = 1;
@ -243,6 +252,12 @@ $table_simple->data[0][3] .= html_print_select_from_sql(
$disabledBecauseInPolicy
);
if ((isset($id_agent_module) && $id_agent_module) || $id_policy_module != 0) {
$edit = false;
} else {
$edit = true;
}
$in_policy = strstr($page, 'policy_modules');
if (!$in_policy) {
// Cannot select the current module to be itself parent
@ -273,17 +288,6 @@ if (!$in_policy) {
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
$table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
if (isset($id_agent_module)) {
if ($id_agent_module) {
$edit = false;
} else {
$edit = true;
}
} else {
// Run into a policy
$edit = true;
}
if (!$edit) {
$sql = sprintf(
'SELECT id_tipo, nombre
@ -1101,9 +1105,8 @@ $macro_count++;
html_print_input_hidden('module_macro_count', $macro_count);
/*
Advanced form part */
// Add relationships
// Advanced form part.
// Add relationships.
$table_new_relations = new stdClass();
$table_new_relations->id = 'module_new_relations';
$table_new_relations->width = '100%';
@ -1114,7 +1117,8 @@ $table_new_relations->style[0] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[1] = 'width: 25%; text-align: center;';
$table_new_relations->style[2] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[3] = 'width: 25%; text-align: center;';
$table_new_relations->style[4] = 'width: 30%; text-align: center;';
$table_new_relations->style[4] = 'width: 10%; font-weight: bold;';
$table_new_relations->style[5] = 'width: 25%; text-align: center;';
$table_new_relations->data[0][0] = __('Agent');
$params = [];
@ -1128,10 +1132,35 @@ $params['javascript_function_action_after_select_js_call'] = 'change_modules_aut
$table_new_relations->data[0][1] = ui_print_agent_autocomplete_input($params);
$table_new_relations->data[0][2] = __('Module');
$table_new_relations->data[0][3] = "<div id='module_autocomplete'></div>";
$table_new_relations->data[0][4] = html_print_button(__('Add relationship'), 'add_relation', false, 'javascript: add_new_relation();', 'class="sub add"', true);
$table_new_relations->data[0][4] .= "&nbsp;&nbsp;<div id='add_relation_status' style='display: inline;'></div>";
// Relationship list
$array_rel_type = [];
$array_rel_type['direct'] = __('Direct');
$array_rel_type['failover'] = __('Failover');
$table_new_relations->data[0][4] = __('Rel. type');
$table_new_relations->data[0][5] = html_print_select(
$array_rel_type,
'relation_type',
'',
'',
'',
0,
true,
false,
true,
''
);
$table_new_relations->data[0][6] = html_print_button(
__('Add relationship'),
'add_relation',
false,
'javascript: add_new_relation();',
'class="sub add"',
true
);
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' style='display: inline;'></div>";
// Relationship list.
$table_relations = new stdClass();
$table_relations->id = 'module_relations';
$table_relations->width = '100%';
@ -1141,19 +1170,26 @@ $table_relations->data = [];
$table_relations->rowstyle = [];
$table_relations->rowstyle[-1] = 'display: none;';
$table_relations->style = [];
$table_relations->style[2] = 'width: 10%; text-align: center;';
$table_relations->style[3] = 'width: 10%; text-align: center;';
$table_relations->style[4] = 'width: 10%; text-align: center;';
$table_relations->head[0] = __('Agent');
$table_relations->head[1] = __('Module');
$table_relations->head[2] = __('Changes').ui_print_help_tip(__('Activate this to prevent the relation from being updated or deleted'), true);
$table_relations->head[3] = __('Delete');
$table_relations->head[2] = __('Type');
$table_relations->head[3] = __('Changes').ui_print_help_tip(
__('Activate this to prevent the relation from being updated or deleted'),
true
);
$table_relations->head[4] = __('Delete');
// Create an invisible row to use their html to add new rows
// Create an invisible row to use their html to add new rows.
$table_relations->data[-1][0] = '';
$table_relations->data[-1][1] = '';
$table_relations->data[-1][2] = '<a id="disable_updates_button" class="alpha50" href="">'.html_print_image('images/lock.png', true).'</a>';
$table_relations->data[-1][3] = '<a id="delete_relation_button" href="">'.html_print_image('images/cross.png', true).'</a>';
$table_relations->data[-1][2] = '';
$table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">';
$table_relations->data[-1][3] .= html_print_image('images/lock.png', true).'</a>';
$table_relations->data[-1][4] = '<a id="delete_relation_button" href="">';
$table_relations->data[-1][4] .= html_print_image('images/cross.png', true).'</a>';
$module_relations = modules_get_relations(['id_module' => $id_agent_module]);
if (!$module_relations) {
@ -1164,10 +1200,14 @@ $relations_count = 0;
foreach ($module_relations as $key => $module_relation) {
if ($module_relation['module_a'] == $id_agent_module) {
$module_id = $module_relation['module_b'];
$agent_id = modules_give_agent_id_from_module_id($module_relation['module_b']);
$agent_id = modules_give_agent_id_from_module_id(
$module_relation['module_b']
);
} else {
$module_id = $module_relation['module_a'];
$agent_id = modules_give_agent_id_from_module_id($module_relation['module_a']);
$agent_id = modules_give_agent_id_from_module_id(
$module_relation['module_a']
);
}
$agent_name = ui_print_agent_name($agent_id, true);
@ -1183,14 +1223,16 @@ foreach ($module_relations as $key => $module_relation) {
$disabled_update_class = 'alpha50';
}
// Agent name
// Agent name.
$table_relations->data[$relations_count][0] = $agent_name;
// Module name
// Module name.
$table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text($module_name, 'module_medium', true, true, true, '[&hellip;]').'</a>';
// Lock relationship updates
$table_relations->data[$relations_count][2] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
// Delete relationship
$table_relations->data[$relations_count][3] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
// Type.
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
// Lock relationship updates.
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
// Delete relationship.
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
$relations_count++;
}
@ -1198,7 +1240,6 @@ html_print_input_hidden('module_relations_count', $relations_count);
ui_require_jquery_file('json');
?>
<script type="text/javascript">
@ -1343,8 +1384,6 @@ $(document).ready (function () {
'width=800,height=600'
);
}
}
if(type_name_selected == 'web_data' ||
type_name_selected == 'web_proc' ||
@ -1365,8 +1404,6 @@ $(document).ready (function () {
'width=800,height=600'
);
}
}
}
@ -1386,7 +1423,7 @@ $(document).ready (function () {
$('#minmax_warning').hide();
$('#svg_dinamic').hide();
}
if (type_name_selected.match(/async/) == null) {
$('#ff_timeout').hide();
$('#ff_timeout_disable').show();
@ -1396,16 +1433,16 @@ $(document).ready (function () {
$('#ff_timeout_disable').hide();
}
});
$("#id_module_type").trigger('change');
// Prevent the form submission when the user hits the enter button from the relationship autocomplete inputs
$("#text-autocomplete_agent_name").keydown(function(event) {
if(event.keyCode == 13) { // key code 13 is the enter button
event.preventDefault();
}
});
//validate post_process. Change ',' by '.'
$("#submit-updbutton").click (function () {
validate_post_process();
@ -1512,7 +1549,6 @@ function advanced_option_dynamic() {
} else {
$('.hide_dinamic').show();
}
}
@ -1524,11 +1560,9 @@ function change_modules_autocomplete_input () {
var module_autocomplete = $("#module_autocomplete");
var load_icon = '<?php html_print_image('images/spinner.gif', false); ?>';
var error_icon = '<?php html_print_image('images/error_red.png', false); ?>';
if (!module_autocomplete.hasClass('working')) {
module_autocomplete.addClass('working');
module_autocomplete.html(load_icon);
$.ajax({
type: "POST",
url: "ajax.php",
@ -1563,22 +1597,26 @@ function change_modules_autocomplete_input () {
// Add a new relation
function add_new_relation () {
var module_a_id = parseInt($("#hidden-id_agent_module").val());
var module_b_id = parseInt($("#hidden-autocomplete_module_name_hidden").val());
var module_a_id = parseInt(
$("#hidden-id_agent_module").val()
);
var module_b_id = parseInt(
$("#hidden-autocomplete_module_name_hidden").val()
);
var module_b_name = $("#text-autocomplete_module_name").val();
var agent_b_name = $("#text-autocomplete_agent_name").val();
var relation_type = $("#relation_type").val();
var hiddenRow = $("#module_relations--1");
var button = $("#button-add_relation");
var iconPlaceholder = $("#add_relation_status");
var load_icon = '<?php html_print_image('images/spinner.gif', false, ['style' => 'vertical-align:middle;']); ?>';
var suc_icon = '<?php html_print_image('images/ok.png', false, ['style' => 'vertical-align:middle;']); ?>';
var error_icon = '<?php html_print_image('images/error_red.png', false, ['style' => 'vertical-align:middle;']); ?>';
if (!button.hasClass('working')) {
button.addClass('working');
iconPlaceholder.html(load_icon);
$.ajax({
type: "POST",
url: "ajax.php",
@ -1588,7 +1626,8 @@ function add_new_relation () {
add_module_relation: true,
id_module_a: module_a_id,
id_module_b: module_b_id,
name_module_b: module_b_name
name_module_b: module_b_name,
relation_type: relation_type
},
success: function (data) {
button.removeClass('working');
@ -1599,29 +1638,30 @@ function add_new_relation () {
else {
iconPlaceholder.html(suc_icon);
setTimeout( function() { iconPlaceholder.html(''); }, 2000);
// Add the new row
var relationsCount = parseInt($("#hidden-module_relations_count").val());
var rowClass = "datos";
if (relationsCount % 2 != 0) {
rowClass = "datos2";
}
var rowHTML = '<tr id="module_relations-' + relationsCount + '" class="' + rowClass + '">' +
'<td id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
'<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
'<td id="module_relations-' + relationsCount + '-2" style="width: 10%; text-align: center;">' +
'<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/lock.png', true); ?>' +
'</a>' +
'</td>' +
'<td id="module_relations-' + relationsCount + '-3" style="width: 10%; text-align: center;">' +
'<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/cross.png', true); ?>' +
'</a>' +
'</td>' +
'</tr>';
'<td id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
'<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
'<td id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' +
'<td id="module_relations-' + relationsCount + '-3" style="width: 10%; text-align: center;">' +
'<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/lock.png', true); ?>' +
'</a>' +
'</td>' +
'<td id="module_relations-' + relationsCount + '-4" style="width: 10%; text-align: center;">' +
'<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/cross.png', true); ?>' +
'</a>' +
'</td>' +
'</tr>';
$("#module_relations").find("tbody").append(rowHTML);
$("#hidden-module_relations_count").val(relationsCount + 1);

View File

@ -506,45 +506,5 @@ $(document).ready (function () {
});
});
// Show the SNMP browser window
function snmpBrowserWindow () {
// Keep elements in the form and the SNMP browser synced
$('#text-target_ip').val($('#text-ip_target').val());
$('#text-community').val($('#text-snmp_community').val());
$('#snmp_browser_version').val($('#snmp_version').val());
$('#text-snmp3_browser_auth_user').val($('#text-snmp3_auth_user').val());
$('#snmp3_browser_security_level').val($('#snmp3_security_level').val());
$('#snmp3_browser_auth_method').val($('#snmp3_auth_method').val());
$('#password-snmp3_browser_auth_pass').val($('#password-snmp3_auth_pass').val());
$('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val());
$('#password-snmp3_browser_privacy_pass').val($('#password-snmp3_privacy_pass').val());
$("#snmp_browser_container").show().dialog ({
title: '',
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 920,
height: 500
});
}
// Set the form OID to the value selected in the SNMP browser
function setOID () {
if($('#snmp_browser_version').val() == '3'){
$('#text-snmp_oid').val($('#table1-0-1').text());
} else {
$('#text-snmp_oid').val($('#snmp_selected_oid').text());
}
// Close the SNMP browser
$('.ui-dialog-titlebar-close').trigger('click');
}
</script>

View File

@ -52,7 +52,7 @@ if ($migrate_malformed) {
// Header.
ui_print_page_header(
__('Planned Downtime'),
__('Scheduled Downtime'),
'images/gm_monitoring.png',
false,
'planned_downtime',
@ -136,9 +136,6 @@ $table_form = new StdClass();
$table_form->class = 'databox filters';
$table_form->width = '100%';
$table_form->rowstyle = [];
$table_form->rowstyle[0] = 'background-color: #f9faf9;';
$table_form->rowstyle[1] = 'background-color: #f9faf9;';
$table_form->rowstyle[2] = 'background-color: #f9faf9;';
$table_form->data = [];
$row = [];

View File

@ -113,6 +113,8 @@ $fields_available['instructions'] = __('Instructions');
$fields_available['server_name'] = __('Server Name');
$fields_available['data'] = __('Data');
$fields_available['module_status'] = __('Module Status');
$fields_available['mini_severity'] = __('Severity mini');
// Remove fields already selected.
foreach ($fields_available as $key => $available) {
@ -124,7 +126,7 @@ foreach ($fields_available as $key => $available) {
$table->data[0][0] = '<b>'.__('Fields available').'</b>';
$table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px');
$table->data[1][1] = '<a href="javascript:">'.html_print_image(
'images/darrowright.png',
'images/darrowright_green.png',
true,
[
'id' => 'right',
@ -132,7 +134,7 @@ $table->data[1][1] = '<a href="javascript:">'.html_print_image(
]
).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
'images/darrowleft.png',
'images/darrowleft_green.png',
true,
[
'id' => 'left',

View File

@ -50,17 +50,10 @@ if (check_acl($config['id_user'], 0, 'PM')) {
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=responses&amp;pure='.$config['pure'].'">'.html_print_image('images/event_responses.png', true, ['title' => __('Event responses')]).'</a>',
];
if (!is_metaconsole()) {
$buttons['fields'] = [
'active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=fields&amp;pure='.$config['pure'].'">'.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'</a>',
];
} else {
$buttons['fields'] = [
'active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=event/custom_events&amp;section=fields&amp;pure='.$config['pure'].'">'.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'</a>',
];
}
$buttons['fields'] = [
'active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=fields&amp;pure='.$config['pure'].'">'.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'</a>',
];
}
switch ($section) {

View File

@ -0,0 +1,632 @@
<?php
/**
* Credentials management view.
*
* @category Credentials management
* @package Pandora FMS
* @subpackage Opensource
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
// Check access.
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access event viewer'
);
if (is_ajax()) {
return ['error' => 'noaccess'];
}
include 'general/noaccess.php';
return;
}
// Required files.
ui_require_css_file('credential_store');
require_once $config['homedir'].'/include/functions_credential_store.php';
require_once $config['homedir'].'/include/functions_io.php';
if (is_ajax()) {
$draw = get_parameter('draw', 0);
$filter = get_parameter('filter', []);
$get_key = get_parameter('get_key', 0);
$new_form = get_parameter('new_form', 0);
$new_key = get_parameter('new_key', 0);
$update_key = get_parameter('update_key', 0);
$delete_key = get_parameter('delete_key', 0);
if ($new_form) {
echo print_inputs();
exit;
}
if ($delete_key) {
$identifier = get_parameter('identifier', null);
if (empty($identifier)) {
ajax_msg('error', __('identifier cannot be empty'));
}
if (db_process_sql_delete(
'tcredential_store',
['identifier' => $identifier]
) === false
) {
ajax_msg('error', $config['dbconnection']->error, true);
} else {
ajax_msg('result', $identifier, true);
}
}
if ($update_key) {
$data = get_parameter('values', null);
if ($data === null || !is_array($data)) {
echo json_encode(['error' => __('Invalid parameters, please retry')]);
exit;
}
$values = [];
foreach ($data as $key => $value) {
if ($key == 'identifier') {
$identifier = base64_decode($value);
} else if ($key == 'product') {
$product = base64_decode($value);
} else {
$values[$key] = base64_decode($value);
}
}
if (empty($identifier)) {
ajax_msg('error', __('identifier cannot be empty'));
}
if (empty($product)) {
ajax_msg('error', __('product cannot be empty'));
}
if (db_process_sql_update(
'tcredential_store',
$values,
['identifier' => $identifier]
) === false
) {
ajax_msg('error', $config['dbconnection']->error);
} else {
ajax_msg('result', $identifier);
}
exit;
}
if ($new_key) {
$data = get_parameter('values', null);
if ($data === null || !is_array($data)) {
echo json_encode(['error' => __('Invalid parameters, please retry')]);
exit;
}
$values = [];
foreach ($data as $key => $value) {
$values[$key] = base64_decode($value);
if ($key == 'identifier') {
$values[$key] = preg_replace('/\s+/', '-', trim($values[$key]));
}
}
$identifier = $values['identifier'];
if (empty($identifier)) {
ajax_msg('error', __('identifier cannot be empty'));
}
if (empty($values['product'])) {
ajax_msg('error', __('product cannot be empty'));
}
if (db_process_sql_insert('tcredential_store', $values) === false) {
ajax_msg('error', $config['dbconnection']->error);
} else {
ajax_msg('result', $identifier);
}
exit;
}
if ($get_key) {
$identifier = get_parameter('identifier', null);
$key = get_key($identifier);
echo print_inputs($key);
exit;
}
if ($draw) {
// Datatables offset, limit and order.
$start = get_parameter('start', 0);
$length = get_parameter('length', $config['block_size']);
$order = get_datatable_order(true);
try {
ob_start();
$fields = [
'cs.*',
'tg.nombre as `group`',
];
// Retrieve data.
$data = credentials_get_all(
// Fields.
$fields,
// Filter.
$filter,
// Offset.
$start,
// Limit.
$length,
// Order.
$order['direction'],
// Sort field.
$order['field']
);
// Retrieve counter.
$count = credentials_get_all(
'count',
$filter
);
if ($data) {
$data = array_reduce(
$data,
function ($carry, $item) {
// Transforms array of arrays $data into an array
// of objects, making a post-process of certain fields.
$tmp = (object) $item;
$tmp->username = io_safe_output($tmp->username);
if (empty($tmp->group)) {
$tmp->group = __('All');
} else {
$tmp->group = io_safe_output($tmp->group);
}
$carry[] = $tmp;
return $carry;
}
);
}
// Datatables format: RecordsTotal && recordsfiltered.
echo json_encode(
[
'data' => $data,
'recordsTotal' => $count,
'recordsFiltered' => $count,
]
);
// Capture output.
$response = ob_get_clean();
} catch (Exception $e) {
return json_encode(['error' => $e->getMessage()]);
}
// If not valid, show error with issue.
json_decode($response);
if (json_last_error() == JSON_ERROR_NONE) {
// If valid dump.
echo $response;
} else {
echo json_encode(
['error' => $response]
);
}
exit;
}
exit;
}
// Datatables list.
try {
$columns = [
'group',
'identifier',
'product',
'username',
'options',
];
$column_names = [
__('Group'),
__('Identifier'),
__('Product'),
__('User'),
[
'text' => __('Options'),
'class' => 'action_buttons',
],
];
$table_id = 'keystore';
// Load datatables user interface.
ui_print_datatable(
[
'id' => $table_id,
'class' => 'info_table',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => 'godmode/groups/credential_store',
'ajax_postprocess' => 'process_datatables_item(item)',
'no_sortable_columns' => [-1],
'order' => [
'field' => 'identifier',
'direction' => 'asc',
],
'search_button_class' => 'sub filter float-right',
'form' => [
'inputs' => [
[
'label' => __('Group'),
'type' => 'select',
'id' => 'filter_id_group',
'name' => 'filter_id_group',
'options' => users_get_groups_for_select(
$config['id_user'],
'AR',
true,
true,
false
),
],
[
'label' => __('Free search'),
'type' => 'text',
'class' => 'mw250px',
'id' => 'free_search',
'name' => 'free_search',
],
],
],
]
);
} catch (Exception $e) {
echo $e->getMessage();
}
// Auxiliar div.
$new = '<div id="new_key" style="display: none"><form id="form_new">';
$new .= '</form></div>';
$details = '<div id="info_key" style="display: none"><form id="form_update">';
$details .= '</form></div>';
$aux = '<div id="aux" style="display: none"></div>';
echo $new.$details.$aux;
// Create button.
echo '<div class="w100p flex-content-right">';
html_print_submit_button(
__('Add key'),
'create',
false,
'class="sub next"'
);
echo '</div>';
?>
<script type="text/javascript">
function process_datatables_item(item) {
item.options = '<a href="javascript:" onclick="display_key(\'';
item.options += item.identifier;
item.options += '\')" ><?php echo html_print_image('images/eye.png', true, ['title' => __('Show')]); ?></a>';
item.options += '<a href="javascript:" onclick="delete_key(\'';
item.options += item.identifier;
item.options += '\')" ><?php echo html_print_image('images/cross.png', true, ['title' => __('Delete')]); ?></a>';
}
function handle_response(data) {
var title = "<?php echo __('Success'); ?>";
var text = '';
var failed = 0;
try {
data = JSON.parse(data);
text = data['result'];
} catch (err) {
title = "<?php echo __('Failed'); ?>";
text = err.message;
failed = 1;
}
if (!failed && data['error']) {
title = "<?php echo __('Failed'); ?>";
text = data['error'];
failed = 1;
}
$('#aux').empty();
$('#aux').html(text);
$('#aux').dialog({
width: 450,
position: {
my: 'center',
at: 'center',
of: window,
collision: 'fit'
},
title: title,
buttons: [
{
text: 'OK',
click: function(e) {
if (!failed) {
dt_<?php echo $table_id; ?>.draw(0);
$(".ui-dialog-content").dialog("close");
cleanupDOM();
} else {
$(this).dialog('close');
}
}
}
]
});
}
function delete_key(id) {
$('#aux').empty();
$('#aux').text('<?php echo __('Are you sure?'); ?>');
$('#aux').dialog({
title: '<?php echo __('Delete'); ?> ' + id,
buttons: [
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel',
text: '<?php echo __('Cancel'); ?>',
click: function(e) {
$(this).dialog('close');
cleanupDOM();
}
},
{
text: 'Delete',
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next',
click: function(e) {
$.ajax({
method: 'post',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
data: {
page: 'godmode/groups/credential_store',
delete_key: 1,
identifier: id
},
datatype: "json",
success: function (data) {
handle_response(data);
},
error: function(e) {
handle_response(e);
}
});
}
}
]
});
}
function display_key(id) {
$('#form_update').empty();
$('#form_update').html('Loading...');
$.ajax({
method: 'post',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
data: {
page: 'godmode/groups/credential_store',
get_key: 1,
identifier: id
},
success: function (data) {
$('#info_key').dialog({
width: 580,
height: 400,
position: {
my: 'center',
at: 'center',
of: window,
collision: 'fit'
},
title: id,
buttons: [
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel',
text: '<?php echo __('Cancel'); ?>',
click: function(e) {
$(this).dialog('close');
cleanupDOM();
}
},
{
text: 'Update',
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next',
click: function(e) {
var values = {};
$('#form_update :input').each(function() {
values[this.name] = btoa($(this).val());
});
$.ajax({
method: 'post',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
data: {
page: 'godmode/groups/credential_store',
update_key: 1,
values: values
},
datatype: "json",
success: function (data) {
handle_response(data);
},
error: function(e) {
handle_response(e);
}
});
}
}
]
});
$('#form_update').html(data);
}
})
}
function cleanupDOM() {
$('#div-identifier').empty();
$('#div-product').empty();
$('#div-username').empty();
$('#div-password').empty();
$('#div-extra_1').empty();
$('#div-extra_2').empty();
}
function calculate_inputs() {
if ($('#product :selected').val() == "CUSTOM") {
$('#div-username label').text('<?php echo __('Username'); ?>');
$('#div-password label').text('<?php echo __('Password'); ?>');
$('#div-extra_1 label').text('<?php echo __('Extra'); ?>');
$('#div-extra_2 label').text('<?php echo __('Extra (2)'); ?>');
$('#div-extra_1').show();
$('#div-extra_2').show();
} else if ($('#product :selected').val() == "AWS") {
$('#div-username label').text('<?php echo __('Access key ID'); ?>');
$('#div-password label').text('<?php echo __('Secret access key'); ?>');
$('#div-extra_1').hide();
$('#div-extra_2').hide();
} else if ($('#product :selected').val() == "AZURE") {
$('#div-username label').text('<?php echo __('Client ID'); ?>');
$('#div-password label').text('<?php echo __('Application secret'); ?>');
$('#div-extra_1 label').text('<?php echo __('Tenant or domain name'); ?>');
$('#div-extra_2 label').text('<?php echo __('Subscription id'); ?>');
$('#div-extra_1').show();
$('#div-extra_2').show();
}
}
function add_key() {
// Clear form.
$('#form_update').empty();
$('#form_update').html('Loading...');
$.ajax({
method: 'post',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
data: {
page: 'godmode/groups/credential_store',
new_form: 1
},
success: function(data) {
$('#form_new').html(data);
$('#id_group').val(0);
// By default AWS.
$('#product').val('AWS');
calculate_inputs();
$('#product').on('change', function() {
calculate_inputs()
});
// Show form.
$('#new_key').dialog({
width: 580,
height: 400,
position: {
my: 'center',
at: 'center',
of: window,
collision: 'fit'
},
title: "<?php echo __('Register new key into keystore'); ?>",
buttons: [
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel',
text: "<?php echo __('Cancel'); ?>",
click: function(e) {
$(this).dialog('close');
cleanupDOM();
}
},
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next',
text: 'OK',
click: function(e) {
var values = {};
console.log($('#form_new'));
$('#form_new :input').each(function() {
values[this.name] = btoa($(this).val());
});
$.ajax({
method: 'post',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
data: {
page: 'godmode/groups/credential_store',
new_key: 1,
values: values
},
datatype: "json",
success: function (data) {
handle_response(data);
},
error: function(e) {
handle_response(e);
}
});
}
},
]
});
}
})
}
$(document).ready(function(){
$("#submit-create").on('click', function(){
add_key();
});
});
</script>

View File

@ -1,20 +1,36 @@
<?php
/**
* Group management view.
*
* @category Group View
* @package Pandora FMS
* @subpackage Opensource
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Begin.
ui_require_css_file('tree');
ui_require_css_file('fixed-bottom-box');
// Load global vars
// Load global vars.
global $config;
check_login();
@ -76,15 +92,17 @@ if (is_ajax()) {
$recursion = (int) get_parameter('recursion', 0);
$privilege = (string) get_parameter('privilege', '');
$all_agents = (int) get_parameter('all_agents', 0);
// Is is possible add keys prefix to avoid auto sorting in js object conversion
// Is is possible add keys prefix to avoid auto sorting in
// js object conversion.
$keys_prefix = (string) get_parameter('keys_prefix', '');
// This attr is for the operation "bulk alert accions add", it controls the query that take the agents
// from db
// This attr is for the operation "bulk alert accions add", it controls
// the query that take the agents from db.
$add_alert_bulk_op = get_parameter('add_alert_bulk_op', false);
// Ids of agents to be include in the SQL clause as id_agent IN ()
// Ids of agents to be include in the SQL clause as id_agent IN ().
$filter_agents_json = (string) get_parameter('filter_agents_json', '');
$status_agents = (int) get_parameter('status_agents', AGENT_STATUS_ALL);
// Juanma (22/05/2014) Fix: If setted remove void agents from result (by default and for compatibility show void agents)
// Juanma (22/05/2014) Fix: If setted remove void agents from result
// (by default and for compatibility show void agents).
$show_void_agents = (int) get_parameter('show_void_agents', 1);
$serialized = (bool) get_parameter('serialized', false);
$serialized_separator = (string) get_parameter('serialized_separator', '|');
@ -121,7 +139,7 @@ if (is_ajax()) {
$filter['status'] = $status_agents;
}
// Juanma (22/05/2014) Fix: If remove void agents setted
// Juanma (22/05/2014) Fix: If remove void agents set.
$_sql_post = ' 1=1 ';
if ($show_void_agents == 0) {
$_sql_post .= ' AND id_agente IN (SELECT a.id_agente FROM tagente a, tagente_modulo b WHERE a.id_agente=b.id_agente AND b.delete_pending=0) AND \'1\'';
@ -131,8 +149,9 @@ if (is_ajax()) {
$id_groups_get_agents = $id_group;
if ($id_group == 0 && $privilege != '') {
$groups = users_get_groups($config['id_user'], $privilege, false);
// if group ID doesn't matter and $privilege is specified (like 'AW'),
// retruns all agents that current user has $privilege privilege for.
// If group ID doesn't matter and $privilege is specified
// (like 'AW'), retruns all agents that current user has $privilege
// privilege for.
$id_groups_get_agents = array_keys($groups);
}
@ -149,13 +168,13 @@ if (is_ajax()) {
);
$agents_disabled = [];
// Add keys prefix
// Add keys prefix.
if ($keys_prefix !== '') {
foreach ($agents as $k => $v) {
$agents[$keys_prefix.$k] = $v;
unset($agents[$k]);
if ($all_agents) {
// Unserialize to get the status
// Unserialize to get the status.
if ($serialized && is_metaconsole()) {
$agent_info = explode($serialized_separator, $k);
$agent_disabled = db_get_value_filter(
@ -174,7 +193,8 @@ if (is_ajax()) {
['id_agente' => $agent_info[1]]
);
} else if (!$serialized && is_metaconsole()) {
// Cannot retrieve the disabled status. Mark all as not disabled
// Cannot retrieve the disabled status.
// Mark all as not disabled.
$agent_disabled = 0;
} else {
$agent_disabled = db_get_value_filter(
@ -226,11 +246,13 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
}
$sec = defined('METACONSOLE') ? 'advanced' : 'gagente';
$url_tree = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=tree";
$url_groups = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=groups";
$url_credbox = 'index.php?sec='.$sec.'&sec2=godmode/groups/group_list&tab=credbox';
$url_tree = 'index.php?sec='.$sec.'&sec2=godmode/groups/group_list&tab=tree';
$url_groups = 'index.php?sec='.$sec.'&sec2=godmode/groups/group_list&tab=groups';
$buttons['tree'] = [
'active' => false,
'text' => "<a href='$url_tree'>".html_print_image(
'text' => '<a href="'.$url_tree.'">'.html_print_image(
'images/gm_massive_operations.png',
true,
[
@ -241,7 +263,7 @@ $buttons['tree'] = [
$buttons['groups'] = [
'active' => false,
'text' => "<a href='$url_groups'>".html_print_image(
'text' => '<a href="'.$url_groups.'">'.html_print_image(
'images/group.png',
true,
[
@ -250,21 +272,38 @@ $buttons['groups'] = [
).'</a>',
];
$buttons['credbox'] = [
'active' => false,
'text' => '<a href="'.$url_credbox.'">'.html_print_image(
'images/key.png',
true,
[
'title' => __('Credential Store'),
]
).'</a>',
];
$tab = (string) get_parameter('tab', 'groups');
// Marks correct tab
$title = __('Groups defined in %s', get_product_name());
// Marks correct tab.
switch ($tab) {
case 'tree':
$buttons['tree']['active'] = true;
break;
case 'credbox':
$buttons['credbox']['active'] = true;
$title = __('Credential store');
break;
case 'groups':
default:
$buttons['groups']['active'] = true;
break;
}
// Header
// Header.
if (defined('METACONSOLE')) {
agents_meta_print_header();
echo '<div class="notify">';
@ -272,7 +311,7 @@ if (defined('METACONSOLE')) {
echo '</div>';
} else {
ui_print_page_header(
__('Groups defined in %s', get_product_name()),
$title,
'images/group.png',
false,
'group_list_tab',
@ -281,12 +320,19 @@ if (defined('METACONSOLE')) {
);
}
// Load credential store view before parse list-tree forms.
if ($tab == 'credbox') {
include_once __DIR__.'/credential_store.php';
// Stop script.
return;
}
$create_group = (bool) get_parameter('create_group');
$update_group = (bool) get_parameter('update_group');
$delete_group = (bool) get_parameter('delete_group');
$pure = get_parameter('pure', 0);
// Create group
// Create group.
if (($create_group) && (check_acl($config['id_user'], 0, 'PM'))) {
$name = (string) get_parameter('name');
$icon = (string) get_parameter('icon');
@ -301,7 +347,7 @@ if (($create_group) && (check_acl($config['id_user'], 0, 'PM'))) {
$check = db_get_value('nombre', 'tgrupo', 'nombre', $name);
$propagate = (bool) get_parameter('propagate');
// Check if name field is empty
// Check if name field is empty.
if ($name != '') {
if (!$check) {
$values = [
@ -328,12 +374,11 @@ if (($create_group) && (check_acl($config['id_user'], 0, 'PM'))) {
ui_print_error_message(__('Each group must have a different name'));
}
} else {
// $result = false;
ui_print_error_message(__('Group must have a name'));
}
}
// Update group
// Update group.
if ($update_group) {
$id_group = (int) get_parameter('id_group');
$name = (string) get_parameter('name');
@ -349,49 +394,35 @@ if ($update_group) {
$contact = (string) get_parameter('contact');
$other = (string) get_parameter('other');
// Check if name field is empty
// Check if name field is empty.
if ($name != '') {
switch ($config['dbtype']) {
case 'mysql':
$sql = sprintf(
'UPDATE tgrupo SET nombre = "%s",
icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d, description = "%s", contact = "%s", other = "%s", password = "%s"
WHERE id_grupo = %d',
$name,
empty($icon) ? '' : substr($icon, 0, -4),
!$alerts_enabled,
$id_parent,
$custom_id,
$propagate,
$skin,
$description,
$contact,
$other,
$group_pass,
$id_group
);
break;
case 'postgresql':
case 'oracle':
$sql = sprintf(
'UPDATE tgrupo SET nombre = \'%s\',
icon = \'%s\', disabled = %d, parent = %d, custom_id = \'%s\', propagate = %d, id_skin = %d, description = \'%s\', contact = \'%s\', other = \'%s\'
WHERE id_grupo = %d',
$name,
substr($icon, 0, -4),
!$alerts_enabled,
$id_parent,
$custom_id,
$propagate,
$skin,
$description,
$contact,
$other,
$id_group
);
break;
}
$sql = sprintf(
'UPDATE tgrupo
SET nombre = "%s",
icon = "%s",
disabled = %d,
parent = %d,
custom_id = "%s",
propagate = %d,
id_skin = %d,
description = "%s",
contact = "%s",
other = "%s",
password = "%s"
WHERE id_grupo = %d',
$name,
empty($icon) ? '' : substr($icon, 0, -4),
!$alerts_enabled,
$id_parent,
$custom_id,
$propagate,
$skin,
$description,
$contact,
$other,
$group_pass,
$id_group
);
$result = db_process_sql($sql);
} else {
@ -405,7 +436,7 @@ if ($update_group) {
}
}
// Delete group
// Delete group.
if (($delete_group) && (check_acl($config['id_user'], 0, 'PM'))) {
$id_group = (int) get_parameter('id_group');
@ -445,7 +476,14 @@ if (($delete_group) && (check_acl($config['id_user'], 0, 'PM'))) {
}
}
// Credential store is loaded previously in this document to avoid
// process group tree - list forms.
if ($tab == 'tree') {
/*
* Group tree view.
*/
echo html_print_image(
'images/spinner.gif',
true,
@ -456,6 +494,10 @@ if ($tab == 'tree') {
);
echo "<div id='tree-controller-recipient'></div>";
} else {
/*
* Group list view.
*/
$acl = '';
$search_name = '';
$offset = (int) get_parameter('offset', 0);
@ -463,17 +505,22 @@ if ($tab == 'tree') {
$block_size = $config['block_size'];
if (!empty($search)) {
$search_name = "AND t.nombre LIKE '%$search%'";
$search_name = 'AND t.nombre LIKE "%'.$search.'%"';
}
if (!users_can_manage_group_all('AR')) {
$user_groups_acl = users_get_groups(false, 'AR');
$groups_acl = implode(',', $user_groups_ACL);
if (empty($groups_acl)) {
return ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups') ]);
return ui_print_info_message(
[
'no_close' => true,
'message' => __('There are no defined groups'),
]
);
}
$acl = "AND t.id_grupo IN ($groups_acl)";
$acl = 'AND t.id_grupo IN ('.$groups_acl.')';
}
$form = "<form method='post' action=''>";
@ -488,29 +535,37 @@ if ($tab == 'tree') {
echo $form;
$groups_sql = "SELECT t.*,
$groups_sql = sprintf(
'SELECT t.*,
p.nombre AS parent_name,
IF(t.parent=p.id_grupo, 1, 0) AS has_child
FROM tgrupo t
LEFT JOIN tgrupo p
FROM tgrupo t
LEFT JOIN tgrupo p
ON t.parent=p.id_grupo
WHERE 1=1
$acl
$search_name
WHERE 1=1
%s
%s
ORDER BY nombre
LIMIT $offset, $block_size
";
LIMIT %d, %d',
$acl,
$search_name,
$offset,
$block_size
);
$groups = db_get_all_rows_sql($groups_sql);
if (!empty($groups)) {
// Count all groups for pagination only saw user and filters
$groups_sql_count = "SELECT count(*)
// Count all groups for pagination only saw user and filters.
$groups_sql_count = sprintf(
'SELECT count(*)
FROM tgrupo t
WHERE 1=1
$acl
$search_name
";
%s
%s',
$acl,
$search_name
);
$groups_count = db_get_value_sql($groups_sql_count);
$table = new StdClass();
@ -545,7 +600,7 @@ if ($tab == 'tree') {
$url = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'];
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'];
$table->data[$key][0] = $group['id_grupo'];
$table->data[$key][1] = "<a href='$url'>".$group['nombre'].'</a>';
$table->data[$key][1] = '<a href="'.$url.'">'.$group['nombre'].'</a>';
if ($group['icon'] != '') {
$table->data[$key][2] = html_print_image(
'images/groups_small/'.$group['icon'].'.png',
@ -553,22 +608,25 @@ if ($tab == 'tree') {
[
'style' => '',
'class' => 'bot',
'alt' => $group['nombre'],
'alt' => $group['nombre'],
'title' => $group['nombre'],
false, false, false, true
]
],
false,
false,
false,
true
);
} else {
$table->data[$key][2] = '';
}
// reporting_get_group_stats
$table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled');
// Reporting_get_group_stats.
$table->data[$key][3] = ($group['disabled']) ? __('Disabled') : __('Enabled');
$table->data[$key][4] = $group['parent_name'];
$table->data[$key][5] = $group['description'];
$table->cellclass[$key][6] = 'action_buttons';
$table->data[$key][6] = "<a href='$url'>".html_print_image(
$table->data[$key][6] = '<a href="'.$url.'">'.html_print_image(
'images/config.png',
true,
[

View File

@ -84,7 +84,9 @@ if ($create_profiles) {
);
}
html_print_table($table);
if ($table !== null) {
html_print_table($table);
}
unset($table);

View File

@ -177,6 +177,9 @@ $table->data['operations'][1] .= html_print_checkbox('copy_alerts', 1, true, tru
$table->data['operations'][1] .= html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true);
$table->data['operations'][1] .= '</span>';
$table->data['form_modules_filter'][0] = __('Filter Modules');
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
$table->data[1][0] = __('Modules');
$table->data[1][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
$table->data[1][1] .= html_print_select(
@ -302,6 +305,8 @@ echo '<h3 class="error invisible" id="message">&nbsp;</h3>';
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var module_alerts;
@ -478,6 +483,9 @@ $(document).ready (function () {
}
$("#fieldset_targets").show ();
$("#target_modules, #target_alerts").enable ();
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
filterByText($('#target_modules'), $("#text-filter_modules"), textNoData);
},
"json"
);

View File

@ -429,6 +429,11 @@ $table->data['form_modules_3'][1] = html_print_select(
);
$table->data['form_modules_3'][3] = '';
$table->rowstyle['form_modules_filter'] = 'vertical-align: top;';
$table->rowclass['form_modules_filter'] = 'select_modules_row select_modules_row_2';
$table->data['form_modules_filter'][0] = __('Filter Modules');
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
$table->rowstyle['form_modules_2'] = 'vertical-align: top;';
$table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
$table->data['form_modules_2'][0] = __('Modules');
@ -571,6 +576,7 @@ if ($selection_mode == 'modules') {
}
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
@ -650,6 +656,9 @@ $(document).ready (function () {
});
$("#module_loading").hide();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
filterByText($('#module_name'), $("#text-filter_modules"), textNoData);
},
"json"
);

View File

@ -92,7 +92,9 @@ if ($delete_profiles) {
);
}
html_print_table($table);
if ($table !== null) {
html_print_table($table);
}
unset($table);

View File

@ -170,6 +170,8 @@ if ($update_agents) {
$n_edited = 0;
$result = false;
foreach ($id_agents as $id_agent) {
$old_interval_value = db_get_value_filter('intervalo', 'tagente', ['id_agente' => $id_agent]);
if (!empty($values)) {
$group_old = false;
$disabled_old = false;
@ -196,6 +198,18 @@ if ($update_agents) {
$result_metaconsole = agent_update_from_cache($id_agent, $values, $server_name);
}
// Update the configuration files.
if ($result && ($old_interval_value != $values['intervalo'])) {
enterprise_hook(
'config_agents_update_config_token',
[
$id_agent,
'interval',
$values['intervalo'],
]
);
}
if ($disabled_old !== false && $disabled_old != $values['disabled']) {
enterprise_hook(
'config_agents_update_config_token',

View File

@ -388,6 +388,11 @@ $table->data['form_modules_4'][1] = html_print_select(
true
);
$table->rowstyle['form_modules_filter'] = 'vertical-align: top;';
$table->rowclass['form_modules_filter'] = 'select_modules_row select_modules_row_2';
$table->data['form_modules_filter'][0] = __('Filter Modules');
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
$table->rowstyle['form_modules_2'] = 'vertical-align: top;';
$table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
$table->data['form_modules_2'][0] = __('Modules');
@ -1247,6 +1252,9 @@ $(document).ready (function () {
});
$("#module_loading").hide ();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
filterByText($('#module_name'), $("#text-filter_modules"), textNoData);
},
"json"
);

View File

@ -24,9 +24,23 @@ $menu_godmode['class'] = 'godmode';
if (check_acl($config['id_user'], 0, 'PM')) {
$sub = [];
$sub['godmode/servers/discovery']['text'] = __('Discovery');
$sub['godmode/servers/discovery']['id'] = 'Discovery';
$sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery'];
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Discovery Main');
$sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery';
$sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
$sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
$sub['godmode/servers/discovery&wiz=app']['text'] = __('Applications');
$sub['godmode/servers/discovery&wiz=app']['id'] = 'app';
$sub['godmode/servers/discovery&wiz=cloud']['text'] = __('Cloud');
$sub['godmode/servers/discovery&wiz=cloud']['id'] = 'cloud';
$sub['godmode/servers/discovery&wiz=ctask']['text'] = __('Console task');
$sub['godmode/servers/discovery&wiz=ctask']['id'] = 'ctask';
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
// Add to menu.
$menu_godmode['discovery']['text'] = __('Discovery');
@ -208,7 +222,7 @@ if (!empty($sub)) {
}
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, 'RR')) {
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'PM')) {
// Servers
$menu_godmode['gservers']['text'] = __('Servers');
$menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server';

View File

@ -277,7 +277,7 @@ if (isset($data)) {
}
echo '<form method="post">';
echo '<form method="post" action='.$url.'>';
echo '<div class="" style="float:right;">';
html_print_input_hidden('new', 1);
html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"');

View File

@ -1,17 +1,32 @@
<?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Network components Plugins
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global variables
global $config;
check_login();
@ -29,7 +44,7 @@ $data[1] = html_print_select_from_sql(
false,
false
);
// Store the macros in base64 into a hidden control to move between pages
// Store the macros in base64 into a hidden control to move between pages.
$data[1] .= html_print_input_hidden('macros', base64_encode($macros), true);
$data[2] = __('Post process');
$data[3] = html_print_extended_select_for_post_process(
@ -46,7 +61,7 @@ $data[3] = html_print_extended_select_for_post_process(
push_table_row($data, 'plugin_1');
// A hidden "model row" to clone it from javascript to add fields dynamicly
// A hidden "model row" to clone it from javascript to add fields dynamicly.
$data = [];
$data[0] = 'macro_desc';
$data[0] .= ui_print_help_tip('macro_help', true);
@ -56,7 +71,7 @@ $table->rowstyle['macro_field'] = 'display:none';
push_table_row($data, 'macro_field');
// If there are $macros, we create the form fields
// If there are $macros, we create the form fields.
if (!empty($macros)) {
$macros = json_decode($macros, true);
@ -68,9 +83,23 @@ if (!empty($macros)) {
}
if ($m['hide'] == 1) {
$data[1] = html_print_input_text($m['macro'], $m['value'], '', 100, 1024, true);
$data[1] = html_print_input_text(
$m['macro'],
io_output_password($m['value']),
'',
100,
1024,
true
);
} else {
$data[1] = html_print_input_text($m['macro'], io_output_password($m['value']), '', 100, 1024, true);
$data[1] = html_print_input_text(
$m['macro'],
$m['value'],
'',
100,
1024,
true
);
}
$table->colspan['macro'.$m['macro']][1] = 3;

View File

@ -61,7 +61,7 @@ $buttons['visual_console_favorite'] = [
'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image('images/list.png', true, ['title' => __('Visual Favourite Console')]).'</a>',
];
if ($is_enterprise && $vconsoles_manage) {
if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image('images/templates.png', true, ['title' => __('Visual Console Template')]).'</a>',

View File

@ -165,6 +165,8 @@ switch ($action) {
$show_in_landscape = 0;
$hide_notinit_agents = 0;
$priority_mode = REPORT_PRIORITY_MODE_OK;
$failover_mode = 0;
$failover_type = REPORT_FAILOVER_TYPE_NORMAL;
$server_name = '';
$server_id = 0;
$dyn_height = 230;
@ -314,6 +316,8 @@ switch ($action) {
$sla_sorted_by = $item['top_n'];
$period = $item['period'];
$current_month = $item['current_month'];
$failover_mode = $item['failover_mode'];
$failover_type = $item['failover_type'];
break;
case 'module_histogram_graph':
@ -566,7 +570,6 @@ switch ($action) {
$include_extended_events = $item['show_extended_events'];
$filter_search = $style['event_filter_search'];
break;
case 'event_report_group':
@ -582,6 +585,9 @@ switch ($action) {
$filter_search = $style['event_filter_search'];
$filter_event_severity = json_decode($style['filter_event_severity'], true);
$filter_event_status = json_decode($style['filter_event_status'], true);
$filter_event_type = json_decode($style['filter_event_type'], true);
$include_extended_events = $item['show_extended_events'];
@ -847,7 +853,10 @@ $class = 'databox filters';
}
?>
<?php
$text = __('This type of report brings a lot of data loading, it is recommended to use it for scheduled reports and not for real-time view.');
if (!isset($text)) {
$text = __('This type of report brings a lot of data loading, it is recommended to use it for scheduled reports and not for real-time view.');
}
echo '<a id="log_help_tip" style="visibility: hidden;" href="javascript:" class="tip" >'.html_print_image('images/tip.png', true, ['title' => $text]).'</a>';
?>
</td>
@ -2235,6 +2244,7 @@ $class = 'databox filters';
?>
</td>
</tr>
<tr id="row_select_fields2" style="" class="datos">
<td style="font-weight:bold;margin-right:150px;">
<?php
@ -2606,6 +2616,59 @@ $class = 'databox filters';
</td>
</tr>
<tr id="row_failover_mode" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Failover mode').ui_print_help_tip(
__('SLA calculation must be performed taking into account the failover modules assigned to the primary module'),
true
);
?>
</td>
<td>
<?php
html_print_checkbox_switch(
'failover_mode',
1,
$failover_mode
);
?>
</td>
</tr>
<tr id="row_failover_type" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Failover type');
?>
</td>
<td>
<?php
echo __('Failover normal');
echo '<span style="margin-left:5px;"></span>';
html_print_radio_button(
'failover_type',
REPORT_FAILOVER_TYPE_NORMAL,
'',
$failover_type == REPORT_FAILOVER_TYPE_NORMAL,
''
);
echo '<span style="margin:30px;"></span>';
echo __('Failover simple');
echo '<span style="margin-left:5px;"></span>';
html_print_radio_button(
'failover_type',
REPORT_FAILOVER_TYPE_SIMPLE,
'',
$failover_type == REPORT_FAILOVER_TYPE_SIMPLE,
''
);
?>
</td>
</tr>
<tr id="row_filter_search" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Free search'); ?></td>
<td>
@ -2769,6 +2832,13 @@ function print_SLA_list($width, $action, $idItem=null)
'id_rc',
$idItem
);
$failover_mode = db_get_value(
'failover_mode',
'treport_content',
'id_rc',
$idItem
);
?>
<table class="databox data" id="sla_list" border="0" cellpadding="4" cellspacing="4" width="100%">
<thead>
@ -2781,8 +2851,23 @@ function print_SLA_list($width, $action, $idItem=null)
<th class="header sla_list_module_col" scope="col">
<?php
echo __('Module');
?>
if ($report_item_type == 'availability_graph'
&& $failover_mode
) {
?>
<th class="header sla_list_agent_failover" scope="col">
<?php
echo __('Agent Failover');
?>
</th>
<th class="header sla_list_module_failover" scope="col">
<?php
echo __('Module Failover');
?>
</th>
<?php
}
?>
<th class="header sla_list_service_col" scope="col">
<?php
echo __('Service');
@ -2828,6 +2913,7 @@ function print_SLA_list($width, $action, $idItem=null)
case 'update':
case 'edit':
echo '<tbody id="list_sla">';
$itemsSLA = db_get_all_rows_filter(
'treport_content_sla_combined',
['id_report_content' => $idItem]
@ -2862,6 +2948,25 @@ function print_SLA_list($width, $action, $idItem=null)
['id_agente_modulo' => $item['id_agent_module']]
);
if (isset($item['id_agent_module_failover']) === true
&& $item['id_agent_module_failover'] !== 0
) {
$idAgentFailover = db_get_value_filter(
'id_agente',
'tagente_modulo',
['id_agente_modulo' => $item['id_agent_module_failover']]
);
$nameAgentFailover = agents_get_alias(
$idAgentFailover
);
$nameModuleFailover = db_get_value_filter(
'nombre',
'tagente_modulo',
['id_agente_modulo' => $item['id_agent_module_failover']]
);
}
$server_name_element = '';
if ($meta && $server_name != '') {
$server_name_element .= ' ('.$server_name.')';
@ -2875,6 +2980,17 @@ function print_SLA_list($width, $action, $idItem=null)
echo printSmallFont($nameModule);
echo '</td>';
if ($report_item_type == 'availability_graph'
&& $failover_mode
) {
echo '<td class="sla_list_agent_failover">';
echo printSmallFont($nameAgentFailover).$server_name_element;
echo '</td>';
echo '<td class="sla_list_module_failover">';
echo printSmallFont($nameModuleFailover);
echo '</td>';
}
if (enterprise_installed()
&& $report_item_type == 'SLA_services'
) {
@ -2923,6 +3039,15 @@ function print_SLA_list($width, $action, $idItem=null)
<td class="sla_list_agent_col agent_name"></td>
<td class="sla_list_module_col module_name"></td>
<?php
if ($report_item_type == 'availability_graph'
&& $failover_mode
) {
?>
<td class="sla_list_agent_failover agent_name_failover"></td>
<td class="sla_list_module_failover module_name_failover"></td>
<?php
}
if (enterprise_installed()
&& $report_item_type == 'SLA_services'
) {
@ -2979,6 +3104,44 @@ function print_SLA_list($width, $action, $idItem=null)
</select>
</td>
<?php
if ($report_item_type == 'availability_graph'
&& $failover_mode
) {
?>
<td class="sla_list_agent_failover_col">
<input id="hidden-id_agent_failover" name="id_agent_failover" value="" type="hidden">
<input id="hidden-server_name_failover" name="server_name_failover" value="" type="hidden">
<?php
$params = [];
$params['show_helptip'] = true;
$params['input_name'] = 'agent_failover';
$params['value'] = '';
$params['use_hidden_input_idagent'] = true;
$params['hidden_input_idagent_id'] = 'hidden-id_agent_failover';
$params['javascript_is_function_select'] = true;
$params['selectbox_id'] = 'id_agent_module_failover';
$params['add_none_module'] = false;
if ($meta) {
$params['use_input_id_server'] = true;
$params['input_id_server_id'] = 'hidden-id_server';
$params['disabled_javascript_on_blur_function'] = true;
}
ui_print_agent_autocomplete_input($params);
?>
</td>
<td class="sla_list_module_failover_col">
<select id="id_agent_module_failover" name="id_agent_module_failover" disabled="disabled" style="max-width: 180px">
<option value="0">
<?php
echo __('Select an Agent first');
?>
</option>
</select>
</td>
<?php
}
if (enterprise_installed()
&& $report_item_type == 'SLA_services'
) {
@ -2999,23 +3162,23 @@ function print_SLA_list($width, $action, $idItem=null)
],
]
);
if (!empty($services_tmp)
&& $services_tmp != ENTERPRISE_NOT_HOOK
if (!empty($services_tmp)
&& $services_tmp != ENTERPRISE_NOT_HOOK
) {
foreach ($services_tmp as $service) {
$check_module_sla = modules_check_agentmodule_exists(
$service['sla_id_module']
);
$check_module_sla_value = modules_check_agentmodule_exists(
$service['sla_value_id_module']
);
if ($check_module_sla
&& $check_module_sla_value
) {
foreach ($services_tmp as $service) {
$check_module_sla = modules_check_agentmodule_exists(
$service['sla_id_module']
);
$check_module_sla_value = modules_check_agentmodule_exists(
$service['sla_value_id_module']
);
if ($check_module_sla
&& $check_module_sla_value
) {
$services[$service['id']] = $service['name'];
}
}
$services[$service['id']] = $service['name'];
}
}
}
echo '<td class="sla_list_service_col">';
echo html_print_select(
@ -3614,11 +3777,18 @@ $(document).ready (function () {
$("#checkbox-checkbox_show_resume").change(function(){
if($(this).is(":checked")){
$("#row_select_fields2").show();
$("#row_select_fields3").show();
}
else{
$("#row_select_fields2").hide();
$("#row_select_fields3").hide();
}
});
$("#checkbox-failover_mode").change(function(){
if($(this).is(":checked")){
$("#row_failover_type").show();
}
else{
$("#row_failover_type").hide();
}
});
});
@ -3912,10 +4082,13 @@ function deleteGeneralRow(id_row) {
function addSLARow() {
var nameAgent = $("input[name=agent_sla]").val();
var nameAgentFailover = $("input[name=agent_failover]").val();
var idAgent = $("input[name=id_agent_sla]").val();
var serverId = $("input[name=id_server]").val();
var idModule = $("#id_agent_module_sla").val();
var idModuleFailover = $("#id_agent_module_failover").val();
var nameModule = $("#id_agent_module_sla :selected").text();
var nameModuleFailover = $("#id_agent_module_failover :selected").text();
var slaMin = $("input[name=sla_min]").val();
var slaMax = $("input[name=sla_max]").val();
var slaLimit = $("input[name=sla_limit]").val();
@ -3976,10 +4149,63 @@ function addSLARow() {
});
}
if (nameAgentFailover != '') {
//Truncate nameAgentFailover
var params = [];
params.push("truncate_text=1");
params.push("text=" + nameAgentFailover);
params.push("page=include/ajax/reporting.ajax");
jQuery.ajax ({
data: params.join ("&"),
type: 'POST',
url: action=
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
+ "/ajax.php",
async: false,
timeout: 10000,
success: function (data) {
nameAgentFailover = data;
}
});
//Truncate nameModuleFailover
var params = [];
params.push("truncate_text=1");
params.push("text=" + nameModuleFailover);
params.push("page=include/ajax/reporting.ajax");
jQuery.ajax ({
data: params.join ("&"),
type: 'POST',
url: action=
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
+ "/ajax.php",
async: false,
timeout: 10000,
success: function (data) {
nameModuleFailover = data;
}
});
}
var params = [];
params.push("add_sla=1");
params.push("id=" + $("input[name=id_item]").val());
params.push("id_module=" + idModule);
params.push("id_module_failover=" + idModuleFailover);
params.push("sla_min=" + slaMin);
params.push("sla_max=" + slaMax);
params.push("sla_limit=" + slaLimit);
@ -4012,6 +4238,8 @@ function addSLARow() {
$("#row", row).attr('id', 'sla_' + data['id']);
$(".agent_name", row).html(nameAgent);
$(".module_name", row).html(nameModule);
$(".agent_name_failover", row).html(nameAgentFailover);
$(".module_name_failover", row).html(nameModuleFailover);
$(".service_name", row).html(serviceName);
$(".sla_min", row).html(slaMin);
$(".sla_max", row).html(slaMax);
@ -4022,14 +4250,22 @@ function addSLARow() {
);
$("#list_sla").append($(row).html());
$("input[name=id_agent_sla]").val('');
$("input[name=id_agent_failover]").val('');
$("input[name=id_server]").val('');
$("input[name=agent_sla]").val('');
$("input[name=agent_failover]").val('');
$("#id_agent_module_sla").empty();
$("#id_agent_module_sla").attr('disabled', 'true');
$("#id_agent_module_sla").append(
$("<option></option>")
.attr ("value", 0)
.html ($("#module_sla_text").html()));
$("#id_agent_module_failover").empty();
$("#id_agent_module_failover").attr('disabled', 'true');
$("#id_agent_module_failover").append(
$("<option></option>")
.attr ("value", 0)
.html ($("#module_sla_text").html()));
$("input[name=sla_min]").val('');
$("input[name=sla_max]").val('');
$("input[name=sla_limit]").val('');
@ -4158,7 +4394,6 @@ function addGeneralRow() {
success: function (data) {
if (data['correct']) {
row = $("#general_template").clone();
$("#row", row).show();
$("#row", row).attr('id', 'general_' + data['id']);
$(".agent_name", row).html(nameAgent);
@ -4208,6 +4443,8 @@ function chooseType() {
$("#row_custom_example").hide();
$("#row_group").hide();
$("#row_current_month").hide();
$("#row_failover_mode").hide();
$("#row_failover_type").hide();
$("#row_working_time").hide();
$("#row_only_display_wrong").hide();
$("#row_combo_module").hide();
@ -4286,6 +4523,8 @@ function chooseType() {
$("#row_event_filter").show();
$("#row_event_graphs").show();
$("#row_event_graph_by_agent").show();
$("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show();
@ -4293,6 +4532,11 @@ function chooseType() {
$("#row_extended_events").show();
$("#row_filter_search").show();
$("#row_event_severity").show();
$("#row_event_status").show();
$("#row_event_type").show();
$("#row_historical_db_check").hide();
break;
@ -4374,6 +4618,11 @@ function chooseType() {
$("#row_working_time").show();
$("#row_historical_db_check").hide();
$("#row_priority_mode").show();
$("#row_failover_mode").show();
var failover_checked = $("input[name='failover_mode']").prop("checked");
if(failover_checked){
$("#row_failover_type").show();
}
break;
case 'module_histogram_graph':

View File

@ -774,14 +774,14 @@ switch ($action) {
$table->head[1] = __('Description');
$table->head[2] = __('HTML');
$table->head[3] = __('XML');
$table->size[0] = '60%';
$table->size[0] = '50%';
$table->size[1] = '20%';
$table->size[2] = '2%';
$table->headstyle[2] = 'min-width: 35px;text-align: center;';
$table->headstyle[2] = 'min-width: 35px;text-align: left;';
$table->size[3] = '2%';
$table->headstyle[3] = 'min-width: 35px;text-align: center;';
$table->headstyle[3] = 'min-width: 35px;text-align: left;';
$table->size[4] = '2%';
$table->headstyle[4] = 'min-width: 35px;text-align: center;';
$table->headstyle[4] = 'min-width: 35px;text-align: left;';
$next = 4;
// Calculate dinamically the number of the column.
@ -790,15 +790,16 @@ switch ($action) {
}
$table->size[$next] = '2%';
$table->style[$next] = 'text-align: center;';
$table->style[$next] = 'text-align: left;';
$table->headstyle[($next + 2)] = 'min-width: 100px;';
$table->style[($next + 2)] = 'text-align: center;';
$table->headstyle[($next + 2)] = 'min-width: 130px; text-align:right;';
$table->style[($next + 2)] = 'text-align: right;';
// Admin options only for RM flag.
if (check_acl($config['id_user'], 0, 'RM')) {
$table->head[$next] = __('Private');
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
if (defined('METACONSOLE')) {
$table->align[$next] = '';
@ -808,7 +809,9 @@ switch ($action) {
$next++;
$table->head[$next] = __('Group');
$table->size[$next] = '15%';
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
$table->align[$next] = 'left';
$next++;
$op_column = false;
@ -826,7 +829,7 @@ switch ($action) {
// $table->size = array ();
$table->size[$next] = '10%';
$table->align[$next] = 'left';
$table->align[$next] = 'right';
}
$columnview = false;
@ -1441,6 +1444,14 @@ switch ($action) {
$values['show_graph'] = get_parameter(
'combo_graph_options'
);
$values['failover_mode'] = get_parameter(
'failover_mode',
0
);
$values['failover_type'] = get_parameter(
'failover_type',
REPORT_FAILOVER_TYPE_NORMAL
);
$good_format = true;
break;
@ -2398,6 +2409,16 @@ switch ($action) {
$values['current_month'] = get_parameter('current_month');
$values['failover_mode'] = get_parameter(
'failover_mode',
0
);
$values['failover_type'] = get_parameter(
'failover_type',
REPORT_FAILOVER_TYPE_NORMAL
);
$style = [];
$style['show_in_same_row'] = get_parameter(
'show_in_same_row',

View File

@ -254,10 +254,12 @@ function update_button_palette_callback() {
var values = {};
values = readFields();
if (values["map_linked"] == 0) {
if (values["agent"] == "" || values["agent"] == "none") {
dialog_message("#message_alert_no_agent");
return false;
if (selectedItem == "static_graph") {
if (values["map_linked"] == 0) {
if (values["agent"] == "" || values["agent"] == "none") {
dialog_message("#message_alert_no_agent");
return false;
}
}
}
// TODO VALIDATE DATA

View File

@ -171,7 +171,7 @@ foreach ($layoutDatas as $layoutData) {
$table->data[($i + 1)]['icon'] = html_print_image(
'images/camera.png',
true,
['title' => __('Static Graph')]
['title' => __('Static Image')]
);
break;

View File

@ -54,7 +54,7 @@ $buttons['visual_console_favorite'] = [
'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image('images/list.png', true, ['title' => __('Visual Favourite Console')]).'</a>',
];
if ($is_enterprise && $vconsoles_manage) {
if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
$buttons['visual_console_template'] = [
'active' => false,
'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image('images/templates.png', true, ['title' => __('Visual Console Template')]).'</a>',

View File

@ -130,5 +130,11 @@ if ($classname_selected === null) {
}
}
// Show hints if there is no task
if (get_parameter('discovery_hint', 0)) {
ui_require_css_file('discovery-hint');
ui_print_info_message(__('You must create a task first'));
}
Wizard::printBigButtonsList($wiz_data);
}

View File

@ -70,7 +70,7 @@ if (is_ajax()) {
$table->head[0] = __('Agent');
$table->head[1] = __('Module');
foreach ($modules as $mod) {
$agent_name = '<a href="'.$config['homeurl'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$mod['id_agente'].'">'.modules_get_agentmodule_agent_name(
$agent_name = '<a href="'.ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$mod['id_agente']).'">'.modules_get_agentmodule_agent_alias(
$mod['id_agente_modulo']
).'</a>';
@ -280,7 +280,7 @@ if (($create != '') || ($view != '')) {
} else {
if ($create != '') {
ui_print_page_header(
__('Plugin creation'),
__('Plugin registration'),
'images/gm_servers.png',
false,
'plugin_definition',
@ -1215,4 +1215,3 @@ ui_require_javascript_file('pandora_modules');
</script>

View File

@ -152,12 +152,12 @@ foreach ($servers as $server) {
$data[8] = '';
if ($server['type'] == 'recon') {
$data[8] .= '<a href="index.php?sec=gservers&sec2=operation/servers/recon_view">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
$data[8] .= html_print_image(
'images/firts_task/icono_grande_reconserver.png',
true,
[
'title' => __('Manage recon tasks'),
'title' => __('Manage Discovery tasks'),
'style' => 'width:21px;height:21px;',
]
);
@ -165,7 +165,7 @@ foreach ($servers as $server) {
}
if ($server['type'] == 'data') {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server'].'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/target.png',
true,
@ -173,7 +173,7 @@ foreach ($servers as $server) {
);
$data[8] .= '</a>';
} else if ($server['type'] == 'enterprise snmp') {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server'].'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/target.png',
true,
@ -182,7 +182,7 @@ foreach ($servers as $server) {
$data[8] .= '</a>';
}
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server'].'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
$data[8] .= html_print_image(
'images/config.png',
true,
@ -191,7 +191,7 @@ foreach ($servers as $server) {
$data[8] .= '</a>';
if (($names_servers[$safe_server_name] === true) && ($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
$data[8] .= html_print_image(
'images/remote_configuration.png',
true,
@ -201,7 +201,7 @@ foreach ($servers as $server) {
$names_servers[$safe_server_name] = false;
}
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1">';
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1').'">';
$data[8] .= html_print_image(
'images/cross.png',
true,

View File

@ -86,7 +86,7 @@ $buttons = [];
// Draws header.
$buttons['general'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general">'.html_print_image('images/gm_setup.png', true, ['title' => __('General')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general').'">'.html_print_image('images/gm_setup.png', true, ['title' => __('General')]).'</a>',
];
if (enterprise_installed()) {
@ -95,37 +95,37 @@ if (enterprise_installed()) {
$buttons['auth'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=auth">'.html_print_image('images/key.png', true, ['title' => __('Authentication')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=auth').'">'.html_print_image('images/key.png', true, ['title' => __('Authentication')]).'</a>',
];
$buttons['perf'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=perf">'.html_print_image('images/performance.png', true, ['title' => __('Performance')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=perf').'">'.html_print_image('images/performance.png', true, ['title' => __('Performance')]).'</a>',
];
$buttons['vis'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=vis">'.html_print_image('images/chart.png', true, ['title' => __('Visual styles')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=vis').'">'.html_print_image('images/chart.png', true, ['title' => __('Visual styles')]).'</a>',
];
if (check_acl($config['id_user'], 0, 'AW')) {
if ($config['activate_netflow']) {
$buttons['net'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=net">'.html_print_image('images/op_netflow.png', true, ['title' => __('Netflow')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=net').'">'.html_print_image('images/op_netflow.png', true, ['title' => __('Netflow')]).'</a>',
];
}
}
$buttons['ehorus'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=ehorus">'.html_print_image('images/ehorus/ehorus.png', true, ['title' => __('eHorus')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=ehorus').'">'.html_print_image('images/ehorus/ehorus.png', true, ['title' => __('eHorus')]).'</a>',
];
// FIXME: Not definitive icon
$buttons['notifications'] = [
'active' => false,
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications').'">'.html_print_image('images/alerts_template.png', true, ['title' => __('Notifications')]).'</a>',
];
$help_header = '';

View File

@ -1,5 +1,13 @@
<?php
/**
* General setup.
*
* @category Setup
* @package Pandora FMS
* @subpackage Opensource
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
@ -18,8 +26,36 @@
* ============================================================================
*/
// File begin.
/**
* Return sounds path.
*
* @return string Path.
*/
function get_sounds()
{
global $config;
$return = [];
$files = scandir($config['homedir'].'/include/sounds');
foreach ($files as $file) {
if (strstr($file, 'wav') !== false) {
$return['include/sounds/'.$file] = $file;
}
}
return $return;
}
// Begin.
global $config;
check_login();
$table = new StdClass();
@ -33,35 +69,18 @@ $table->style[0] = 'font-weight:bold';
$table->size[1] = '70%';
// Current config["language"] could be set by user, not taken from global setup !
switch ($config['dbtype']) {
case 'mysql':
$current_system_lang = db_get_sql(
'SELECT `value`
FROM tconfig WHERE `token` = "language"'
);
break;
case 'postgresql':
$current_system_lang = db_get_sql(
'SELECT "value"
FROM tconfig WHERE "token" = \'language\''
);
break;
case 'oracle':
$current_system_lang = db_get_sql(
'SELECT value
FROM tconfig WHERE token = \'language\''
);
break;
}
$current_system_lang = db_get_sql(
'SELECT `value` FROM tconfig WHERE `token` = "language"'
);
if ($current_system_lang == '') {
$current_system_lang = 'en';
}
$table->data[0][0] = __('Language code');
$table->data[0][1] = html_print_select_from_sql(
$i = 0;
$table->data[$i][0] = __('Language code');
$table->data[$i++][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'language',
$current_system_lang,
@ -71,68 +90,67 @@ $table->data[0][1] = html_print_select_from_sql(
true
);
$table->data[1][0] = __('Remote config directory').ui_print_help_tip(__('Directory where agent remote configuration is stored.'), true);
$table->data[$i][0] = __('Remote config directory').ui_print_help_tip(__('Directory where agent remote configuration is stored.'), true);
$table->data[$i++][1] = html_print_input_text('remote_config', io_safe_output($config['remote_config']), '', 30, 100, true);
$table->data[1][1] = html_print_input_text('remote_config', io_safe_output($config['remote_config']), '', 30, 100, true);
$table->data[$i][0] = __('Phantomjs bin directory').ui_print_help_tip(__('Directory where phantomjs binary file exists and has execution grants.'), true);
$table->data[$i++][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true);
$table->data[2][0] = __('Phantomjs bin directory').ui_print_help_tip(__('Directory where phantomjs binary file exists and has execution grants.'), true);
$table->data[$i][0] = __('Auto login (hash) password');
$table->data[$i++][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
$table->data[2][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true);
$table->data[6][0] = __('Auto login (hash) password');
$table->data[6][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
$table->data[9][0] = __('Time source');
$table->data[$i][0] = __('Time source');
$sources['system'] = __('System');
$sources['sql'] = __('Database');
$table->data[9][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true);
$table->data[$i++][1] = html_print_select($sources, 'timesource', $config['timesource'], '', '', '', true);
$table->data[10][0] = __('Automatic check for updates');
$table->data[10][1] = html_print_checkbox_switch('autoupdate', 1, $config['autoupdate'], true);
$table->data[$i][0] = __('Automatic check for updates');
$table->data[$i++][1] = html_print_checkbox_switch('autoupdate', 1, $config['autoupdate'], true);
echo "<div id='dialog' title='".__('Enforce https Information')."' style='display:none;'>";
echo "<p style='text-align: center;'>".__('If SSL is not properly configured you will lose access to ').get_product_name().__(' Console').'</p>';
echo '</div>';
$table->data[11][0] = __('Enforce https');
$table->data[11][1] = html_print_checkbox_switch_extended('https', 1, $config['https'], false, '', '', true);
$table->data[$i][0] = __('Enforce https');
$table->data[$i++][1] = html_print_checkbox_switch_extended('https', 1, $config['https'], false, '', '', true);
$table->data[12][0] = __('Use cert of SSL');
$table->data[12][1] = html_print_checkbox_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true);
$table->data[$i][0] = __('Use cert of SSL');
$table->data[$i++][1] = html_print_checkbox_switch_extended('use_cert', 1, $config['use_cert'], false, '', '', true);
$table->rowstyle[13] = 'display: none;';
$table->data[13][0] = __('Path of SSL Cert.').ui_print_help_tip(__('Path where you put your cert and name of this cert. Remember your cert only in .pem extension.'), true);
$table->data[13][1] = html_print_input_text('cert_path', io_safe_output($config['cert_path']), '', 50, 255, true);
$table->rowstyle[$i] = 'display: none;';
$table->rowid[$i] = 'ssl-path-tr';
$table->data[$i][0] = __('Path of SSL Cert.').ui_print_help_tip(__('Path where you put your cert and name of this cert. Remember your cert only in .pem extension.'), true);
$table->data[$i++][1] = html_print_input_text('cert_path', io_safe_output($config['cert_path']), '', 50, 255, true);
$table->data[14][0] = __('Attachment store').ui_print_help_tip(__('Directory where temporary data is stored.'), true);
$table->data[14][1] = html_print_input_text('attachment_store', io_safe_output($config['attachment_store']), '', 50, 255, true);
$table->data[$i][0] = __('Attachment store').ui_print_help_tip(__('Directory where temporary data is stored.'), true);
$table->data[$i++][1] = html_print_input_text('attachment_store', io_safe_output($config['attachment_store']), '', 50, 255, true);
$table->data[15][0] = __('IP list with API access');
$table->data[$i][0] = __('IP list with API access');
if (isset($_POST['list_ACL_IPs_for_API'])) {
$list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API');
} else {
$list_ACL_IPs_for_API = get_parameter_get('list_ACL_IPs_for_API', implode("\n", $config['list_ACL_IPs_for_API']));
}
$table->data[15][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
$table->data[$i++][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
$table->data[16][0] = __('API password').ui_print_help_tip(__('Please be careful if you put a password put https access.'), true);
$table->data[16][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
$table->data[$i][0] = __('API password').ui_print_help_tip(__('Please be careful if you put a password put https access.'), true);
$table->data[$i++][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
$table->data[17][0] = __('Enable GIS features');
$table->data[17][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true);
$table->data[$i][0] = __('Enable GIS features');
$table->data[$i++][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true);
$table->data[19][0] = __('Enable Netflow');
$table->data[$i][0] = __('Enable Netflow');
$rbt_disabled = false;
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
$rbt_disabled = true;
$table->data[19][0] .= ui_print_help_tip(__('Not supported in Windows systems'), true);
$table->data[$i][0] .= ui_print_help_tip(__('Not supported in Windows systems'), true);
}
$table->data[19][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true);
$table->data[$i++][1] = html_print_checkbox_switch_extended('activate_netflow', 1, $config['activate_netflow'], $rbt_disabled, '', '', true);
$table->data[21][0] = __('Enable Network Traffic Analyzer');
$table->data[21][1] = html_print_switch(
$table->data[$i][0] = __('Enable Network Traffic Analyzer');
$table->data[$i++][1] = html_print_switch(
[
'name' => 'activate_nta',
'value' => $config['activate_nta'],
@ -171,11 +189,11 @@ foreach ($timezones as $timezone) {
}
}
$table->data[23][0] = __('Timezone setup').' '.ui_print_help_tip(
$table->data[$i][0] = __('Timezone setup').' '.ui_print_help_tip(
__('Must have the same time zone as the system or database to avoid mismatches of time.'),
true
);
$table->data[23][1] = html_print_input_text_extended(
$table->data[$i][1] = html_print_input_text_extended(
'timezone_text',
$config['timezone'],
'text-timezone_text',
@ -187,47 +205,63 @@ $table->data[23][1] = html_print_input_text_extended(
'readonly',
true
);
$table->data[23][1] .= '<a id="change_timezone">'.html_print_image('images/pencil.png', true, ['title' => __('Change timezone')]).'</a>';
$table->data[23][1] .= '&nbsp;&nbsp;'.html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
$table->data[23][1] .= '&nbsp;&nbsp;'.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
$table->data[$i][1] .= '<a id="change_timezone">'.html_print_image('images/pencil.png', true, ['title' => __('Change timezone')]).'</a>';
$table->data[$i][1] .= '&nbsp;&nbsp;'.html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true);
$table->data[$i++][1] .= '&nbsp;&nbsp;'.html_print_select($timezone_n, 'timezone', $config['timezone'], '', '', '', true);
$sounds = get_sounds();
$table->data[24][0] = __('Sound for Alert fired');
$table->data[24][1] = html_print_select($sounds, 'sound_alert', $config['sound_alert'], 'replaySound(\'alert\');', '', '', true);
$table->data[24][1] .= ' <a href="javascript: toggleButton(\'alert\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_alert', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[24][1] .= '<div id="layer_sound_alert"></div>';
$table->data[$i][0] = __('Sound for Alert fired');
$table->data[$i][1] = html_print_select($sounds, 'sound_alert', $config['sound_alert'], 'replaySound(\'alert\');', '', '', true);
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'alert\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_alert', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[$i++][1] .= '<div id="layer_sound_alert"></div>';
$table->data[25][0] = __('Sound for Monitor critical');
$table->data[25][1] = html_print_select($sounds, 'sound_critical', $config['sound_critical'], 'replaySound(\'critical\');', '', '', true);
$table->data[25][1] .= ' <a href="javascript: toggleButton(\'critical\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_critical', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[25][1] .= '<div id="layer_sound_critical"></div>';
$table->data[$i][0] = __('Sound for Monitor critical');
$table->data[$i][1] = html_print_select($sounds, 'sound_critical', $config['sound_critical'], 'replaySound(\'critical\');', '', '', true);
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'critical\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_critical', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[$i++][1] .= '<div id="layer_sound_critical"></div>';
$table->data[26][0] = __('Sound for Monitor warning');
$table->data[26][1] = html_print_select($sounds, 'sound_warning', $config['sound_warning'], 'replaySound(\'warning\');', '', '', true);
$table->data[26][1] .= ' <a href="javascript: toggleButton(\'warning\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_warning', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[26][1] .= '<div id="layer_sound_warning"></div>';
$table->data[$i][0] = __('Sound for Monitor warning');
$table->data[$i][1] = html_print_select($sounds, 'sound_warning', $config['sound_warning'], 'replaySound(\'warning\');', '', '', true);
$table->data[$i][1] .= ' <a href="javascript: toggleButton(\'warning\');">'.html_print_image('images/control_play_col.png', true, ['id' => 'button_sound_warning', 'style' => 'vertical-align: middle;', 'width' => '16', 'title' => __('Play sound')]).'</a>';
$table->data[$i++][1] .= '<div id="layer_sound_warning"></div>';
$table->data[28][0] = __('Public URL');
$table->data[28][0] .= ui_print_help_tip(
$table->data[$i][0] = __('Public URL');
$table->data[$i][0] .= ui_print_help_tip(
__('Set this value when your %s across inverse proxy or for example with mod_proxy of Apache.', get_product_name()).' '.__('Without the index.php such as http://domain/console_url/'),
true
);
$table->data[28][1] = html_print_input_text('public_url', $config['public_url'], '', 40, 255, true);
$table->data[$i++][1] = html_print_input_text('public_url', $config['public_url'], '', 40, 255, true);
$table->data[29][0] = __('Referer security');
$table->data[29][0] .= ui_print_help_tip(__("If enabled, actively checks if the user comes from %s's URL", get_product_name()), true);
$table->data[29][1] = html_print_checkbox_switch('referer_security', 1, $config['referer_security'], true);
$table->data[$i][0] = __('Force use Public URL');
$table->data[$i][0] .= ui_print_help_tip(__('Force using defined public URL).', get_product_name()), true);
$table->data[$i++][1] = html_print_switch(
[
'name' => 'force_public_url',
'value' => $config['force_public_url'],
]
);
$table->data[30][0] = __('Event storm protection');
$table->data[30][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true);
$table->data[30][1] = html_print_checkbox_switch('event_storm_protection', 1, $config['event_storm_protection'], true);
echo "<div id='force_public_url_dialog' title='".__('Enforce public URL usage information')."' style='display:none;'>";
echo "<p style='text-align: center;'>".__('If public URL is not properly configured you will lose access to ').get_product_name().__(' Console').'</p>';
echo '</div>';
$table->data[$i][0] = __('Public URL host exclusions');
$table->data[$i++][1] = html_print_textarea('public_url_exclusions', 2, 25, $config['public_url_exclusions'], 'style="height: 50px; width: 300px"', true);
$table->data[$i][0] = __('Referer security');
$table->data[$i][0] .= ui_print_help_tip(__("If enabled, actively checks if the user comes from %s's URL", get_product_name()), true);
$table->data[$i++][1] = html_print_checkbox_switch('referer_security', 1, $config['referer_security'], true);
$table->data[$i][0] = __('Event storm protection');
$table->data[$i][0] .= ui_print_help_tip(__('If set to yes no events or alerts will be generated, but agents will continue receiving data.'), true);
$table->data[$i++][1] = html_print_checkbox_switch('event_storm_protection', 1, $config['event_storm_protection'], true);
$table->data[31][0] = __('Command Snapshot').ui_print_help_tip(__('The string modules with several lines show as command output'), true);
$table->data[31][1] = html_print_checkbox_switch('command_snapshot', 1, $config['command_snapshot'], true);
$table->data[$i][0] = __('Command Snapshot').ui_print_help_tip(__('The string modules with several lines show as command output'), true);
$table->data[$i++][1] = html_print_checkbox_switch('command_snapshot', 1, $config['command_snapshot'], true);
$table->data[32][0] = __('Server logs directory').ui_print_help_tip(__('Directory where the server logs are stored.'), true);
$table->data[32][1] = html_print_input_text(
$table->data[$i][0] = __('Server logs directory').ui_print_help_tip(__('Directory where the server logs are stored.'), true);
$table->data[$i++][1] = html_print_input_text(
'server_log_dir',
$config['server_log_dir'],
'',
@ -236,8 +270,8 @@ $table->data[32][1] = html_print_input_text(
true
);
$table->data[33][0] = __('Log size limit in system logs viewer extension').ui_print_help_tip(__('Max size (in bytes) for the logs to be shown.'), true);
$table->data[33][1] = html_print_input_text(
$table->data[$i][0] = __('Log size limit in system logs viewer extension').ui_print_help_tip(__('Max size (in bytes) for the logs to be shown.'), true);
$table->data[$i++][1] = html_print_input_text(
'max_log_size',
$config['max_log_size'],
'',
@ -251,8 +285,8 @@ $modes_tutorial = [
'on_demand' => __('On demand'),
'expert' => __('Expert'),
];
$table->data['tutorial_mode'][0] = __('Tutorial mode').ui_print_help_tip(__("Configuration of our clippy, 'full mode' show the icon in the header and the contextual helps and it is noise, 'on demand' it is equal to full but it is not noise and 'expert' the icons in the header and the context is not."), true);
$table->data['tutorial_mode'][1] = html_print_select(
$table->data[$i][0] = __('Tutorial mode').ui_print_help_tip(__("Configuration of our clippy, 'full mode' show the icon in the header and the contextual helps and it is noise, 'on demand' it is equal to full but it is not noise and 'expert' the icons in the header and the context is not."), true);
$table->data[$i++][1] = html_print_select(
$modes_tutorial,
'tutorial_mode',
$config['tutorial_mode'],
@ -263,11 +297,11 @@ $table->data['tutorial_mode'][1] = html_print_select(
);
$config['past_planned_downtimes'] = isset($config['past_planned_downtimes']) ? $config['past_planned_downtimes'] : 1;
$table->data[34][0] = __('Allow create planned downtimes in the past').ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
$table->data[34][1] = html_print_checkbox_switch('past_planned_downtimes', 1, $config['past_planned_downtimes'], true);
$table->data[$i][0] = __('Allow create planned downtimes in the past').ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
$table->data[$i++][1] = html_print_checkbox_switch('past_planned_downtimes', 1, $config['past_planned_downtimes'], true);
$table->data[35][0] = __('Limit for bulk operations').ui_print_help_tip(__('Your PHP environment is set to 1000 max_input_vars. This parameter should have the same value or lower.', ini_get('max_input_vars')), true);
$table->data[35][1] = html_print_input_text(
$table->data[$i][0] = __('Limit for bulk operations').ui_print_help_tip(__('Your PHP environment is set to 1000 max_input_vars. This parameter should have the same value or lower.', ini_get('max_input_vars')), true);
$table->data[$i++][1] = html_print_input_text(
'limit_parameters_massive',
$config['limit_parameters_massive'],
'',
@ -276,17 +310,17 @@ $table->data[35][1] = html_print_input_text(
true
);
$table->data[36][0] = __('Include agents manually disabled');
$table->data[36][1] = html_print_checkbox_switch('include_agents', 1, $config['include_agents'], true);
$table->data[$i][0] = __('Include agents manually disabled');
$table->data[$i++][1] = html_print_checkbox_switch('include_agents', 1, $config['include_agents'], true);
$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);
$table->data[$i][0] = __('Audit log directory').ui_print_help_tip(__('Directory where audit log is stored.'), true);
$table->data[$i++][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true);
$table->data[38][0] = __('Set alias as name by default in agent creation');
$table->data[38][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
$table->data[$i][0] = __('Set alias as name by default in agent creation');
$table->data[$i++][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
$table->data[39][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
$table->data[39][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true);
$table->data[$i][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
$table->data[$i++][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
@ -352,44 +386,50 @@ $(document).ready (function () {
});
if ($("input[name=use_cert]").is(':checked')) {
$('#setup_general-13').show();
$('#ssl-path-tr').show();
}
$("input[name=use_cert]").change(function () {
if( $(this).is(":checked") )
$('#setup_general-13').show();
$('#ssl-path-tr').show();
else
$('#setup_general-13').hide();
$('#ssl-path-tr').hide();
});
$("input[name=https]").change(function (){
if($("input[name=https]").prop('checked')) {
$("#dialog").css({'display': 'inline', 'font-weight': 'bold'}).dialog({
$("#dialog").dialog({
modal: true,
buttons:{
"<?php echo __('Close'); ?>": function(){
$(this).dialog("close");
width: 500,
buttons:[
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next',
text: "<?php echo __('OK'); ?>",
click: function(){
$(this).dialog("close");
}
}
}
]
});
}
})
$("input[name=force_public_url]").change(function (){
if($("input[name=force_public_url]").prop('checked')) {
$("#force_public_url_dialog").dialog({
modal: true,
width: 500,
buttons: [
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next',
text: "<?php echo __('OK'); ?>",
click: function(){
$(this).dialog("close");
}
}
]
});
}
})
});
</script>
<?php
function get_sounds()
{
global $config;
$return = [];
$files = scandir($config['homedir'].'/include/sounds');
foreach ($files as $file) {
if (strstr($file, 'wav') !== false) {
$return['include/sounds/'.$file] = $file;
}
}
return $return;
}

View File

@ -159,6 +159,16 @@ $table_styles->data[$row][1] = html_print_select(
$table_styles->data[$row][1] .= '&nbsp;'.html_print_button(__('View'), 'status_set_preview', false, '', 'class="sub camera logo_preview"', true);
$row++;
// Divs to show icon status Colours (Default)
$icon_unknown_ball = ui_print_status_image(STATUS_AGENT_UNKNOWN_BALL, '', true);
$icon_unknown = ui_print_status_image(STATUS_AGENT_UNKNOWN, '', true);
$icon_ok_ball = ui_print_status_image(STATUS_AGENT_OK_BALL, '', true);
$icon_ok = ui_print_status_image(STATUS_AGENT_OK, '', true);
$icon_warning_ball = ui_print_status_image(STATUS_AGENT_WARNING_BALL, '', true);
$icon_warning = ui_print_status_image(STATUS_AGENT_WARNING, '', true);
$icon_bad_ball = ui_print_status_image(STATUS_AGENT_CRITICAL_BALL, '', true);
$icon_bad = ui_print_status_image(STATUS_AGENT_CRITICAL, '', true);
// End - Divs to show icon status Colours (Default)
$table_styles->data[$row][0] = __('Login background').ui_print_help_tip(__('You can place your custom images into the folder images/backgrounds/'), true);
$backgrounds_list_jpg = list_files('images/backgrounds', 'jpg', 1, 0);
$backgrounds_list_gif = list_files('images/backgrounds', 'gif', 1, 0);
@ -1113,15 +1123,6 @@ $row++;
$table_other->data[$row][0] = __('Show QR Code icon in the header');
$table_other->data[$row][1] = html_print_checkbox_switch(
'show_qr_code_header',
1,
$config['show_qr_code_header'],
true
);
$row++;
$table_other->data[$row][0] = __('Custom graphviz directory').ui_print_help_tip(__('Custom directory where the graphviz binaries are stored.'), true);
$table_other->data[$row][1] = html_print_input_text(
'graphviz_bin_dir',
@ -1504,7 +1505,7 @@ $(document).ready (function () {
.prop('checked');
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id'));
});
$(".databox.filters").css('margin-bottom','-10px');
$(".databox.filters").css('margin-bottom','0px');
});
// Change the favicon preview when is changed
@ -1644,6 +1645,17 @@ $("#button-status_set_preview").click (function (e) {
$icon_bad_ball = $("<img src=\"" + icon_path + "agent_critical_ball.png\">");
$icon_bad = $("<img src=\"" + icon_path + "agent_critical.png\">");
if(icon_dir == 'default'){
$icon_unknown_ball = '<?php echo $icon_unknown_ball; ?>';
$icon_unknown = '<?php echo $icon_unknown; ?>';
$icon_ok_ball = '<?php echo $icon_ok_ball; ?>';
$icon_ok = '<?php echo $icon_ok; ?>';
$icon_warning_ball = '<?php echo $icon_warning_ball; ?>';
$icon_warning = '<?php echo $icon_warning; ?>';
$icon_bad_ball = '<?php echo $icon_bad_ball; ?>';
$icon_bad = '<?php echo $icon_bad; ?>';
}
try {
$dialog
.hide()

View File

@ -137,6 +137,8 @@ if ($new_user && $config['admin_can_add_user']) {
$user_info['not_login'] = false;
$user_info['strict_acl'] = false;
$user_info['session_time'] = 0;
$user_info['middlename'] = 0;
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$user_info['id_skin'] = '';
}
@ -218,6 +220,7 @@ if ($create_user) {
}
$values['not_login'] = (bool) get_parameter('not_login', false);
$values['middlename'] = get_parameter('middlename', 0);
$values['strict_acl'] = (bool) get_parameter('strict_acl', false);
$values['session_time'] = (int) get_parameter('session_time', 0);
@ -317,12 +320,13 @@ if ($update_user) {
$values['timezone'] = (string) get_parameter('timezone');
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
// eHorus user level conf
// eHorus user level conf.
$values['ehorus_user_level_enabled'] = (bool) get_parameter('ehorus_user_level_enabled', false);
$values['ehorus_user_level_user'] = (string) get_parameter('ehorus_user_level_user');
$values['ehorus_user_level_pass'] = (string) get_parameter('ehorus_user_level_pass');
$values['middlename'] = get_parameter('middlename', 0);
$dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', '');
@ -869,13 +873,27 @@ foreach ($event_filter_data as $filter) {
$table->data[16][0] = __('Default event filter');
$table->data[16][1] = html_print_select($event_filter, 'default_event_filter', $user_info['default_event_filter'], '', '', __('None'), true, false, false);
$table->data[17][0] = __('Disabled newsletter');
if ($user_info['middlename'] >= 0) {
$middlename = false;
} else {
$middlename = true;
}
$table->data[17][1] = html_print_checkbox(
'middlename',
-1,
$middlename,
true
);
if ($config['ehorus_user_level_conf']) {
$table->data[17][0] = __('eHorus user acces enabled');
$table->data[17][1] = html_print_checkbox('ehorus_user_level_enabled', 1, $user_info['ehorus_user_level_enabled'], true);
$table->data[18][0] = __('eHorus user');
$table->data[19][0] = __('eHorus password');
$table->data[18][1] = html_print_input_text('ehorus_user_level_user', $user_info['ehorus_user_level_user'], '', 15, 45, true);
$table->data[19][1] = html_print_input_password('ehorus_user_level_pass', io_output_password($user_info['ehorus_user_level_pass']), '', 15, 45, true);
$table->data[18][0] = __('eHorus user acces enabled');
$table->data[18][1] = html_print_checkbox('ehorus_user_level_enabled', 1, $user_info['ehorus_user_level_enabled'], true);
$table->data[19][0] = __('eHorus user');
$table->data[20][0] = __('eHorus password');
$table->data[19][1] = html_print_input_text('ehorus_user_level_user', $user_info['ehorus_user_level_user'], '', 15, 45, true);
$table->data[20][1] = html_print_input_password('ehorus_user_level_pass', io_output_password($user_info['ehorus_user_level_pass']), '', 15, 45, true);
}

View File

@ -501,41 +501,60 @@ class DiscoveryTaskList extends Wizard
$data[5] = __('Pending');
}
if ($task['id_recon_script'] == 0) {
// Internal discovery task.
switch ($task['type']) {
case DISCOVERY_CLOUD_AWS_RDS:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Cloud RDS')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Cloud.Aws.RDS');
break;
switch ($task['type']) {
case DISCOVERY_CLOUD_AZURE_COMPUTE:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/plugin.png',
true,
['title' => __('Discovery Cloud Azure Compute')]
).'&nbsp;&nbsp;';
$data[6] .= __('Cloud.Azure.Compute');
break;
case DISCOVERY_APP_MYSQL:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications MySQL')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.MySQL');
break;
case DISCOVERY_CLOUD_AWS_EC2:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/plugin.png',
true,
['title' => __('Discovery Cloud AWS EC2')]
).'&nbsp;&nbsp;';
$data[6] .= __('Cloud.AWS.EC2');
break;
case DISCOVERY_APP_ORACLE:
// Discovery Applications Oracle.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications Oracle')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Oracle');
break;
case DISCOVERY_CLOUD_AWS_RDS:
// Discovery Cloud RDS.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Cloud RDS')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Cloud.Aws.RDS');
break;
case DISCOVERY_HOSTDEVICES:
default:
case DISCOVERY_APP_MYSQL:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications MySQL')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.MySQL');
break;
case DISCOVERY_APP_ORACLE:
// Discovery Applications Oracle.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications Oracle')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Oracle');
break;
case DISCOVERY_HOSTDEVICES:
default:
if ($task['id_recon_script'] == 0) {
// Discovery NetScan.
$data[6] = html_print_image(
'images/network.png',
@ -550,15 +569,15 @@ class DiscoveryTaskList extends Wizard
} else {
$data[6] .= __('Discovery.NetScan');
}
break;
}
} else {
// APP recon task.
$data[6] = html_print_image(
'images/plugin.png',
true
).'&nbsp;&nbsp;';
$data[6] .= $recon_script_name;
} else {
// APP or external script recon task.
$data[6] = html_print_image(
'images/plugin.png',
true
).'&nbsp;&nbsp;';
$data[6] .= $recon_script_name;
}
break;
}
if ($task['status'] <= 0 || $task['status'] > 100) {
@ -699,7 +718,16 @@ class DiscoveryTaskList extends Wizard
if ($script !== false) {
switch ($script['type']) {
case DISCOVERY_SCRIPT_CLOUD_AWS:
return 'wiz=cloud&mode=amazonws&page=1';
switch ($task['type']) {
case DISCOVERY_CLOUD_AWS_EC2:
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1';
case DISCOVERY_CLOUD_AZURE_COMPUTE:
return 'wiz=cloud&mode=azure&ki='.$task['auth_strings'].'&sub=compute&page=0';
default:
return 'wiz=cloud';
}
case DISCOVERY_SCRIPT_APP_VMWARE:
return 'wiz=app&mode=vmware&page=0';
@ -722,10 +750,10 @@ class DiscoveryTaskList extends Wizard
case DISCOVERY_CLOUD_AWS:
case DISCOVERY_CLOUD_AWS_EC2:
return 'wiz=cloud&mode=amazonws&page=1';
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1';
case DISCOVERY_CLOUD_AWS_RDS:
return 'wiz=cloud&mode=amazonws&sub=rds&page=0';
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&sub=rds&page=0';
default:
if ($task['description'] == 'console_task') {

View File

@ -1048,7 +1048,7 @@ class Wizard
*/
public static function printBigButtonsList($list_data)
{
echo '<ul>';
echo '<ul class="bigbuttonlist">';
array_map('self::printBigButtonElement', $list_data);
echo '</ul>';
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 926 B

View File

@ -75,13 +75,73 @@ $graphic_event_group = (bool) get_parameter('graphic_event_group');
$get_table_response_command = (bool) get_parameter('get_table_response_command');
$save_filter_modal = get_parameter('save_filter_modal', 0);
$load_filter_modal = get_parameter('load_filter_modal', 0);
$save_filter = get_parameter('save_filter', 0);
$get_filter_values = get_parameter('get_filter_values', 0);
$update_event_filter = get_parameter('update_event_filter', 0);
$save_event_filter = get_parameter('save_event_filter', 0);
$in_process_event = get_parameter('in_process_event', 0);
$validate_event = get_parameter('validate_event', 0);
$delete_event = get_parameter('delete_event', 0);
$get_event_filters = get_parameter('get_event_filters', 0);
$get_comments = get_parameter('get_comments', 0);
if ($get_comments) {
$event = get_parameter('event', false);
$filter = get_parameter('filter', false);
if ($event === false) {
return __('Failed to retrieve comments');
}
if ($filter['group_rep'] == 1) {
$events = events_get_all(
['te.*'],
// Filter.
$filter,
// Offset.
null,
// Limit.
null,
// Order.
null,
// Sort_field.
null,
// History.
$filter['history'],
// Return_sql.
false,
// Having.
sprintf(
' HAVING max_id_evento = %d',
$event['id_evento']
)
);
if ($events !== false) {
$event = $events[0];
}
} else {
$events = events_get_event(
$event['id_evento'],
false,
$meta,
$history
);
if ($events !== false) {
$event = $events[0];
}
}
echo events_page_comments($event, true);
return;
}
if ($get_event_filters) {
$event_filter = events_get_event_filter_select();
echo io_json_mb_encode($event_filter);
return;
}
// Delete event (filtered or not).
if ($delete_event) {
@ -267,6 +327,17 @@ if ($get_filter_values) {
$event_filter = events_get_event_filter($id_filter);
if ($event_filter === false) {
$event_filter = [
'status' => EVENT_NO_VALIDATED,
'event_view_hr' => $config['event_view_hr'],
'group_rep' => 1,
'tag_with' => [],
'tag_without' => [],
'history' => false,
];
}
$event_filter['search'] = io_safe_output($event_filter['search']);
$event_filter['id_name'] = io_safe_output($event_filter['id_name']);
$event_filter['tag_with'] = base64_encode(
@ -590,7 +661,7 @@ function save_new_filter() {
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
{
"page" : "operation/events/events_list",
"page" : "include/ajax/events",
"save_event_filter" : 1,
"id_name" : $("#text-id_name").val(),
"id_group" : $("select#id_group").val(),
@ -659,7 +730,7 @@ function save_update_filter() {
var name_filter_update = $("#overwrite_filter option[value='"+id_filter_update+"']").text();
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
{"page" : "operation/events/events_list",
{"page" : "include/ajax/events",
"update_event_filter" : 1,
"id" : $("#overwrite_filter").val(),
"id_group" : $("select#id_group").val(),
@ -712,7 +783,7 @@ function save_update_filter() {
$('#filter_id').append ($('<option></option>').html ( <?php echo "'".__('none')."'"; ?> ).attr ("value", 0));
// Reload filters select
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
{"page" : "operation/events/events_list",
{"page" : "include/ajax/events",
"get_event_filters" : 1
},
function (data) {
@ -1040,6 +1111,7 @@ if ($get_extended_event) {
global $config;
$event = get_parameter('event', false);
$filter = get_parameter('filter', false);
if ($event === false) {
return;
@ -1067,6 +1139,7 @@ if ($get_extended_event) {
$dialog_page = get_parameter('dialog_page', 'general');
$filter = get_parameter('filter', []);
$similar_ids = get_parameter('similar_ids', $event_id);
$group_rep = $filter['group_rep'];
$event_rep = $event['event_rep'];
$timestamp_first = $event['min_timestamp'];
@ -1074,34 +1147,44 @@ if ($get_extended_event) {
$server_id = $event['server_id'];
$comments = $event['comments'];
$event['similar_ids'] = $similar_ids;
if (!isset($comments)) {
$comments = $event['user_comment'];
}
// Check ACLs.
$access = false;
if (is_user_admin($config['id_user'])) {
// Do nothing if you're admin, you get full access.
$__ignored_line = 0;
$access = true;
} else if ($config['id_user'] == $event['owner_user']) {
// Do nothing if you're the owner user, you get access.
$__ignored_line = 0;
$access = true;
} else if ($event['id_grupo'] == 0) {
// If the event has access to all groups, you get access.
$__ignored_line = 0;
$access = true;
} else {
// Get your groups.
$groups = users_get_groups($config['id_user'], 'ER');
if (in_array($event['id_grupo'], array_keys($groups))) {
// If event group is among the groups of the user, you get access.
$__ignored_line = 0;
} else {
// If all the access types fail, abort.
echo 'Access denied';
return false;
$access = true;
} else if ($event['id_agente']
&& agents_check_access_agent($event['id_agente'], 'ER')
) {
// Secondary group, indirect access.
$access = true;
}
}
if (!$access) {
// If all the access types fail, abort.
echo 'Access denied';
return false;
}
// Print group_rep in a hidden field to recover it from javascript.
html_print_input_hidden('group_rep', (int) $group_rep);
@ -1227,7 +1310,7 @@ if ($get_extended_event) {
$general = events_page_general($event);
$comments = events_page_comments($event);
$comments = '<div id="extended_event_comments_page" class="extended_event_pages"></div>';
$notifications = '<div id="notification_comment_error" style="display:none">'.ui_print_error_message(__('Error adding comment'), '', true).'</div>';
$notifications .= '<div id="notification_comment_success" style="display:none">'.ui_print_success_message(__('Comment added successfully'), '', true).'</div>';
@ -1238,6 +1321,18 @@ if ($get_extended_event) {
$loading = '<div id="response_loading" style="display:none">'.html_print_image('images/spinner.gif', true).'</div>';
$i = 0;
$tab['general'] = $i++;
$tab['details'] = $i++;
if (!empty($related)) {
$tab['related'] = $i++;
}
$tab['custom_fields'] = $i++;
$tab['comments'] = $i++;
$tab['responses'] = $i++;
$tab['custom_data'] = $i++;
$out = '<div id="tabs">'.$tabs.$notifications.$loading.$general.$details.$related.$custom_fields.$comments.$responses.$custom_data.html_print_input_hidden('id_event', $event['id_evento']).'</div>';
$js = '<script>
@ -1249,31 +1344,31 @@ if ($get_extended_event) {
// Load the required tab.
switch ($dialog_page) {
case 'general':
$js .= '$tabs.tabs( "option", "active", 0);';
$js .= '$tabs.tabs( "option", "active", '.$tab['general'].');';
break;
case 'details':
$js .= '$tabs.tabs( "option", "active", 1);';
$js .= '$tabs.tabs( "option", "active", '.$tab['details'].');';
break;
case 'related':
$js .= '$tabs.tabs( "option", "active", 2);';
$js .= '$tabs.tabs( "option", "active", '.$tab['related'].');';
break;
case 'custom_fields':
$js .= '$tabs.tabs( "option", "active", 3);';
$js .= '$tabs.tabs( "option", "active", '.$tab['custom_fields'].');';
break;
case 'comments':
$js .= '$tabs.tabs( "option", "active", 4);';
$js .= '$tabs.tabs( "option", "active", '.$tab['comments'].');';
break;
case 'responses':
$js .= '$tabs.tabs( "option", "active", 5);';
$js .= '$tabs.tabs( "option", "active", '.$tab['responses'].');';
break;
case 'custom_data':
$js .= '$tabs.tabs( "option", "active", 6);';
$js .= '$tabs.tabs( "option", "active", '.$tab['custom_data'].');';
break;
default:
@ -1283,6 +1378,24 @@ if ($get_extended_event) {
$js .= '});';
$js .= '
$("#link_comments").click(function (){
$.post ({
url : "ajax.php",
data : {
page: "include/ajax/events",
get_comments: 1,
event: '.json_encode($event).',
filter: '.json_encode($filter).'
},
dataType : "html",
success: function (data) {
$("#extended_event_comments_page").empty();
$("#extended_event_comments_page").html(data);
}
});
});';
if (events_has_extended_info($event['id_evento']) === true) {
$js .= '
$("#link_related").click(function (){

View File

@ -472,11 +472,17 @@ if (check_login()) {
$result = false;
$id_module_a = (int) get_parameter('id_module_a');
$id_module_b = (int) get_parameter('id_module_b');
$type = (string) get_parameter('relation_type');
if ($id_module_a < 1) {
$name_module_a = get_parameter('name_module_a', '');
if ($name_module_a) {
$id_module_a = (int) db_get_value('id_agente_modulo', 'tagente_modulo', 'nombre', $name_module_a);
$id_module_a = (int) db_get_value(
'id_agente_modulo',
'tagente_modulo',
'nombre',
$name_module_a
);
} else {
echo json_encode($result);
return;
@ -486,7 +492,12 @@ if (check_login()) {
if ($id_module_b < 1) {
$name_module_b = get_parameter('name_module_b', '');
if ($name_module_b) {
$id_module_b = (int) db_get_value('id_agente_modulo', 'tagente_modulo', 'nombre', $name_module_b);
$id_module_b = (int) db_get_value(
'id_agente_modulo',
'tagente_modulo',
'nombre',
$name_module_b
);
} else {
echo json_encode($result);
return;
@ -494,7 +505,7 @@ if (check_login()) {
}
if ($id_module_a > 0 && $id_module_b > 0) {
$result = modules_add_relation($id_module_a, $id_module_b);
$result = modules_add_relation($id_module_a, $id_module_b, $type);
}
echo json_encode($result);
@ -1011,7 +1022,7 @@ if (check_login()) {
$title
);
$data[5] = ui_print_module_status($module['estado'], $title, true, false, true);
$data[5] = ui_print_status_image($status, $title, true);
if (!$show_context_help_first_time) {
$show_context_help_first_time = true;
@ -1134,7 +1145,7 @@ if (check_login()) {
urlencode(
base64_encode($module['nombre'])
)
).'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)";
).'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 700)";
if (!is_snapshot_data($module['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;';
}

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