#11218 resolved conflict
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.771-230517
|
||||
Version: 7.0NG.771-230608
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.771-230517"
|
||||
pandora_version="7.0NG.771-230608"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -1,31 +1,31 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.771, GNU/Linux
|
||||
# Version 7.0NG.771
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
# Copyright (c) 2004-2023 Pandora FMS
|
||||
# https://pandorafms.com
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
||||
server_ip localhost
|
||||
server_path /var/spool/pandora/data_in
|
||||
server_ip localhost
|
||||
server_path /var/spool/pandora/data_in
|
||||
temporal /tmp
|
||||
logfile /var/log/pandora/pandora_agent.log
|
||||
|
||||
#include /etc/pandora/pandora_agent_alt.conf
|
||||
#broker_agent name_agent
|
||||
|
||||
# Interval in seconds, 300 by default
|
||||
interval 300
|
||||
# Interval in seconds, 300 by default (5 minutes)
|
||||
interval 300
|
||||
|
||||
# Debug mode renames XML in the temp folder and continues running
|
||||
debug 0
|
||||
debug 0
|
||||
|
||||
# Optional. UDP Server to receive orders from outside
|
||||
# By default is disabled, set 1 to enable
|
||||
# Set port (41122 by default)
|
||||
# Set address to restrict who can order a agent restart (0.0.0.0 = anybody)
|
||||
#
|
||||
|
||||
udp_server 0
|
||||
udp_server_port 41122
|
||||
udp_server_auth_address 0.0.0.0
|
||||
@ -33,12 +33,13 @@ udp_server_auth_address 0.0.0.0
|
||||
#process_xeyes_start xeyes
|
||||
#process_xeyes_stop killall xeyes
|
||||
|
||||
# By default, agent takes machine name
|
||||
#agent_name adama
|
||||
# By default, agent takes hostname
|
||||
#agent_name adama
|
||||
|
||||
# To define agent name by specific command, define 'agent_name_cmd'.
|
||||
# (In the following example, agent name is 'hostname_IP')
|
||||
# If set to __rand__ the agent will generate a random name.
|
||||
# If set to __rand__ the agent will generate a random name, used by default to generate a unique name
|
||||
|
||||
#agent_name_cmd LANG=C; /bin/echo -n `hostname`; /bin/echo -n "_"; /bin/echo `/sbin/ifconfig eth0 | /bin/grep 'inet addr' | /usr/bin/awk '{print $2;}' | /usr/bin/cut -d: -f2`
|
||||
agent_name_cmd __rand__
|
||||
|
||||
@ -52,7 +53,7 @@ agent_name_cmd __rand__
|
||||
#agent_alias_cmd
|
||||
|
||||
# Agent description
|
||||
#description This is a demo agent for Linux
|
||||
#description This is an agent running Linux
|
||||
|
||||
# Group assigned for this agent (descriptive, p.e: Servers)
|
||||
group Servers
|
||||
@ -78,20 +79,19 @@ address auto
|
||||
# Those parameters define the geographical position of the agent
|
||||
|
||||
# gis_exec: Call a script that returns a string with a fixed
|
||||
# format of latitude,longitude,altitude
|
||||
# format of latitude, longitude, altitude. Used for custom integration with GIS
|
||||
# i.e.: 41.377,-5.105,2.365
|
||||
|
||||
#gis_exec /tmp/gis.sh
|
||||
#gis_exec /mypath/my_gis_script.sh
|
||||
|
||||
# This sets the GIS coordinates as fixed values:
|
||||
# latitude
|
||||
|
||||
#latitude 0
|
||||
# longitude
|
||||
#longitude 0
|
||||
# altitude
|
||||
#altitude 0
|
||||
|
||||
#GPS Position description
|
||||
|
||||
#position_description Madrid, centro
|
||||
|
||||
# By default agent try to take default encoding defined in host.
|
||||
@ -133,7 +133,8 @@ transfer_mode tentacle
|
||||
# is much more safe
|
||||
#cron_mode
|
||||
|
||||
# If set to 1 allows the agent to be configured via the web console (Only Enterprise version)
|
||||
# If set to 1 allows the agent to be configured via the web console (Only use this in Enterprise version)
|
||||
# when is set to 1, local .conf file changes are overwritten. Set to 0 if you want to edit the .conf file
|
||||
remote_config 0
|
||||
|
||||
# Default 0, set to 1 to avoid module executions and report to server
|
||||
@ -157,7 +158,7 @@ remote_config 0
|
||||
# Number of threads to execute modules in parallel
|
||||
#agent_threads 1
|
||||
|
||||
# User the agent will run as
|
||||
# User the agent will run as. By default uses root, but could be configured to run as other user
|
||||
#pandora_user pandora
|
||||
|
||||
# Enable or disable XML buffer.
|
||||
@ -177,9 +178,9 @@ temporal_max_files 1024
|
||||
# Agent mode: Learn (default), No-learn, Autodisable
|
||||
# agent_mode autodisable
|
||||
|
||||
# eHorus agent configuration file path:
|
||||
# Pandora RC (former eHorus) agent configuration file path.
|
||||
# The agent will create a custom field named eHorusID that contains
|
||||
# the eHorus agent's identifying key
|
||||
# the PandoraRC agent's identifying key
|
||||
ehorus_conf /etc/ehorus/ehorus_agent.conf
|
||||
|
||||
# Secondary groups. You can select several groups separated by comma.
|
||||
@ -272,10 +273,22 @@ module_plugin autodiscover --default
|
||||
# Plugin for inventory on the agent.
|
||||
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
|
||||
|
||||
# Log collection modules. Only for enterprise version, this will collect log files for forensic analysis.
|
||||
# This is for LOG monitoring, only on enterprise version
|
||||
# Log collection modules. This will collect log files for forensic analysis and store everything
|
||||
# This is for LOG monitoring. Different than log monitoring.
|
||||
#module_plugin grep_log_module /var/log/messages Syslog \.\*
|
||||
|
||||
# Another samples of monitoring modules
|
||||
|
||||
# Command snapshot
|
||||
|
||||
#module_begin
|
||||
#module_name process_table
|
||||
#module_type generic_data_string
|
||||
#module_exec ps aux
|
||||
#module_description Command snapshot of running processes
|
||||
#module_group System
|
||||
#module_end
|
||||
|
||||
#module_begin
|
||||
#module_name HTTPD_Status
|
||||
#module_type generic_proc
|
||||
|
@ -1023,7 +1023,7 @@ my $Sem = undef;
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.771';
|
||||
use constant AGENT_BUILD => '230517';
|
||||
use constant AGENT_BUILD => '230608';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.771
|
||||
%define release 230517
|
||||
%define release 230608
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.771
|
||||
%define release 230517
|
||||
%define release 230608
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.771"
|
||||
PI_BUILD="230517"
|
||||
PI_BUILD="230608"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -22,6 +22,11 @@
|
||||
use strict;
|
||||
use File::Basename;
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
BEGIN {
|
||||
eval {
|
||||
require MIME::Base64;
|
||||
};
|
||||
}
|
||||
|
||||
# Output format (module or log_module).
|
||||
my $Output = 'module';
|
||||
@ -65,6 +70,37 @@ if ( (defined ($ENV{GREP_LOG_TMP})) && (-d $ENV{GREP_LOG_TMP}) ) {
|
||||
$Idx_dir=$ENV{GREP_LOG_TMP};
|
||||
}
|
||||
|
||||
# Define encode_base64 if it is not available via MIME::Base64.
|
||||
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
|
||||
my ($str, $endl) = @_;
|
||||
|
||||
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
|
||||
my $str_len = length($str);
|
||||
my $str_base64 = '';
|
||||
|
||||
for (my $i = 0; $i < $str_len; $i += 3) {
|
||||
my $chunk = substr($str, $i, 3);
|
||||
my $chunk_len = length($chunk);
|
||||
|
||||
my $num = 0;
|
||||
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
|
||||
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
|
||||
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
|
||||
|
||||
my $enc_1 = ($num & 0xfc0000) >> 18;
|
||||
my $enc_2 = ($num & 0x03f000) >> 12;
|
||||
my $enc_3 = ($num & 0x000fc0) >> 6;
|
||||
my $enc_4 = ($num & 0x00003f);
|
||||
|
||||
$str_base64 .= $ALPHABET[$enc_1];
|
||||
$str_base64 .= $ALPHABET[$enc_2];
|
||||
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
|
||||
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
|
||||
}
|
||||
|
||||
return $str_base64;
|
||||
};
|
||||
|
||||
########################################################################################
|
||||
# Erase blank spaces before and after the string
|
||||
########################################################################################
|
||||
@ -335,11 +371,13 @@ sub print_log ($) {
|
||||
my $output = "<log_module>\n";
|
||||
$output .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
|
||||
$output .= "<data><![CDATA[";
|
||||
my $tmp = '';
|
||||
foreach my $line (@kdata) {
|
||||
my $processed_line = $line;
|
||||
$processed_line =~ s/\]\]/]]]]><![CDATA[/g;
|
||||
$output .= $processed_line;
|
||||
foreach my $content (@{$data->{$line}}) {
|
||||
$tmp .= $content;
|
||||
}
|
||||
}
|
||||
$output .= &$encode_sub($tmp, '');
|
||||
$output .= "]]></data>";
|
||||
$output .= "</log_module>\n";
|
||||
|
||||
|
@ -22,6 +22,11 @@
|
||||
|
||||
use strict;
|
||||
use File::Basename;
|
||||
BEGIN {
|
||||
eval {
|
||||
require MIME::Base64;
|
||||
};
|
||||
}
|
||||
|
||||
# Output format (module or log_module).
|
||||
my $Output = 'log_module';
|
||||
@ -53,6 +58,37 @@ my $Idx_size = 0;
|
||||
# Regular expression to be matched
|
||||
my $Reg_exp = '';
|
||||
|
||||
# Define encode_base64 if it is not available via MIME::Base64.
|
||||
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
|
||||
my ($str, $endl) = @_;
|
||||
|
||||
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
|
||||
my $str_len = length($str);
|
||||
my $str_base64 = '';
|
||||
|
||||
for (my $i = 0; $i < $str_len; $i += 3) {
|
||||
my $chunk = substr($str, $i, 3);
|
||||
my $chunk_len = length($chunk);
|
||||
|
||||
my $num = 0;
|
||||
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
|
||||
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
|
||||
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
|
||||
|
||||
my $enc_1 = ($num & 0xfc0000) >> 18;
|
||||
my $enc_2 = ($num & 0x03f000) >> 12;
|
||||
my $enc_3 = ($num & 0x000fc0) >> 6;
|
||||
my $enc_4 = ($num & 0x00003f);
|
||||
|
||||
$str_base64 .= $ALPHABET[$enc_1];
|
||||
$str_base64 .= $ALPHABET[$enc_2];
|
||||
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
|
||||
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
|
||||
}
|
||||
|
||||
return $str_base64;
|
||||
};
|
||||
|
||||
###############################################################################
|
||||
# SUB error_msg
|
||||
# Print an error message and exit.
|
||||
@ -213,11 +249,9 @@ sub print_log (@) {
|
||||
if ($Output eq 'log_module') {
|
||||
my $output = "<log_module>\n";
|
||||
$output .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
|
||||
$output .= "<encoding>base64</encoding>\n";
|
||||
$output .= "<data><![CDATA[";
|
||||
foreach my $line (@data) {
|
||||
$line =~ s/\]\]/]]]]><![CDATA[/g;
|
||||
$output .= $line;
|
||||
}
|
||||
$output .= &$encode_sub(join('', @data), '');
|
||||
$output .= "]]></data>";
|
||||
$output .= "</log_module>\n";
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1a0d742e4e1944a599fe7609544719c82ab560590784f0a82733fdba8a7964a3
|
||||
size 7630848
|
||||
oid sha256:ad4d006cf2662a57f2e062b5adbfe8702d2147ec4c4d3dc9a1019938fe7d5b22
|
||||
size 16557020
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{230517}
|
||||
{230608}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -520,7 +520,7 @@ Pandora_Module::getXml () {
|
||||
if (this->module_type == TYPE_LOG) {
|
||||
module_xml = "<log_module>\n\t<source><![CDATA[";
|
||||
module_xml += this->module_name;
|
||||
module_xml += "]]></source>\n\t<data><![CDATA[";
|
||||
module_xml += "]]></source>\n\t<encoding>base64</encoding>\n\t<data><![CDATA[";
|
||||
|
||||
if (this->data_list && this->data_list->size () > 1) {
|
||||
list<Pandora_Data *>::iterator iter;
|
||||
@ -532,25 +532,19 @@ Pandora_Module::getXml () {
|
||||
data = *iter;
|
||||
|
||||
try {
|
||||
data_clean = strreplace (this->getDataOutput (data),
|
||||
"%", "%%" );
|
||||
data_clean = strreplace (data_clean, "]]>", "]]><![CDATA[");
|
||||
data_clean += this->getDataOutput(data);
|
||||
} catch (Module_Exception e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
module_xml += data_clean;
|
||||
}
|
||||
} else {
|
||||
data = data_list->front ();
|
||||
try {
|
||||
data_clean = strreplace (this->getDataOutput (data), "%", "%%" );
|
||||
data_clean = strreplace (data_clean, "]]>", "]]><![CDATA[");
|
||||
module_xml += data_clean;
|
||||
|
||||
data_clean = this->getDataOutput (data);
|
||||
} catch (Module_Exception e) {
|
||||
}
|
||||
}
|
||||
module_xml += base64Encode(data_clean);
|
||||
module_xml += "]]></data></log_module>";
|
||||
|
||||
/* Clean up */
|
||||
|
@ -12,6 +12,14 @@ use warnings;
|
||||
|
||||
use File::Basename;
|
||||
BEGIN { push @INC, '/usr/lib/perl5'; }
|
||||
|
||||
# NOTE: The binary compiled with PAR::Packer for Pandora FMS doesn't work well
|
||||
# with JSON:XS, probably because JSON::Backend::XS is defined in the __DATA__
|
||||
# section of JSON.pm and that doesn't work well with PAR::Filter. If this
|
||||
# becomes a bottleneck, a workaround would be possible (e.g., redefining
|
||||
# JSON::Backend::XS here).
|
||||
BEGIN { $ENV{PERL_JSON_BACKEND} = 'JSON::PP' };
|
||||
|
||||
use PandoraFMS::PluginTools;
|
||||
use PandoraFMS::Omnishell;
|
||||
|
||||
@ -90,4 +98,4 @@ if ($@) {
|
||||
exit 0;
|
||||
}
|
||||
|
||||
exit 0;
|
||||
exit 0;
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.771 Build 230517")
|
||||
#define PANDORA_VERSION ("7.0NG.771 Build 230608")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -24,6 +24,8 @@
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <cstring> // for strchr
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
|
||||
using namespace Pandora;
|
||||
|
||||
@ -56,6 +58,54 @@ Pandora_Strutils::trim (const string str) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode the given string to base64.
|
||||
* Based on: https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
|
||||
*
|
||||
* @param str String to be encoded.
|
||||
*
|
||||
* @return The base64 encoded string.
|
||||
*/
|
||||
string
|
||||
Pandora_Strutils::base64Encode(string str) {
|
||||
string base64_str;
|
||||
std::uint32_t temp;
|
||||
const static char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
std::vector<std::uint8_t> buffer(begin(str), end(str));
|
||||
base64_str.reserve(((buffer.size() / 3) + (buffer.size() % 3 > 0)) * 4);
|
||||
|
||||
std::vector<std::uint8_t>::iterator cursor = buffer.begin();
|
||||
for(size_t idx = 0; idx < buffer.size() / 3; idx++) {
|
||||
temp = (*cursor++) << 16;
|
||||
temp += (*cursor++) << 8;
|
||||
temp += (*cursor++);
|
||||
base64_str.append(1, alphabet[(temp & 0x00FC0000) >> 18]);
|
||||
base64_str.append(1, alphabet[(temp & 0x0003F000) >> 12]);
|
||||
base64_str.append(1, alphabet[(temp & 0x00000FC0) >> 6]);
|
||||
base64_str.append(1, alphabet[(temp & 0x0000003F)]);
|
||||
}
|
||||
|
||||
switch(buffer.size() % 3){
|
||||
case 1:
|
||||
temp = (*cursor++) << 16;
|
||||
base64_str.append(1, alphabet[(temp & 0x00FC0000) >> 18]);
|
||||
base64_str.append(1, alphabet[(temp & 0x0003F000) >> 12]);
|
||||
base64_str.append(2, '=');
|
||||
break;
|
||||
case 2:
|
||||
temp = (*cursor++) << 16;
|
||||
temp += (*cursor++) << 8;
|
||||
base64_str.append(1, alphabet[(temp & 0x00FC0000) >> 18]);
|
||||
base64_str.append(1, alphabet[(temp & 0x0003F000) >> 12]);
|
||||
base64_str.append(1, alphabet[(temp & 0x00000FC0) >> 6]);
|
||||
base64_str.append(1, '=');
|
||||
break;
|
||||
}
|
||||
|
||||
return base64_str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an unicode string to a ANSI string.
|
||||
*
|
||||
|
@ -44,6 +44,7 @@ namespace Pandora_Strutils {
|
||||
|
||||
string trim (const string str);
|
||||
|
||||
string base64Encode(string str);
|
||||
string strUnicodeToAnsi (LPCWSTR s);
|
||||
wstring strAnsiToUnicode (LPCSTR s);
|
||||
string inttostr (const int i);
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.771(Build 230517))"
|
||||
VALUE "ProductVersion", "(7.0NG.771(Build 230608))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -99,7 +99,7 @@ Pandora_Wmi::isServiceRunning (string service_name) {
|
||||
string query;
|
||||
char *state;
|
||||
string str_state;
|
||||
int retval;
|
||||
int retval = -1;
|
||||
|
||||
query = "SELECT * FROM Win32_Service WHERE Name = \"" + service_name + "\"";
|
||||
|
||||
@ -112,23 +112,27 @@ Pandora_Wmi::isServiceRunning (string service_name) {
|
||||
FOR_EACH (quickfix, quickfixes, NULL) {
|
||||
dhGetValue (L"%s", &state, quickfix,
|
||||
L".State");
|
||||
str_state = state;
|
||||
if (str_state == "Running") {
|
||||
retval = 1;
|
||||
}
|
||||
else {
|
||||
retval = 0;
|
||||
if (retval == -1) {
|
||||
str_state = state;
|
||||
if (str_state == "Running") {
|
||||
retval = 1;
|
||||
}
|
||||
else {
|
||||
retval = 0;
|
||||
}
|
||||
}
|
||||
dhFreeString (state);
|
||||
|
||||
return retval;
|
||||
} NEXT_THROW (quickfix);
|
||||
} catch (string errstr) {
|
||||
pandoraLog ("isServiceRunning error. %s", errstr.c_str ());
|
||||
}
|
||||
|
||||
pandoraDebug ("Service %s not found.", service_name.c_str ());
|
||||
return 0;
|
||||
if (retval == -1) {
|
||||
pandoraDebug ("Service %s not found.", service_name.c_str ());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1261,7 +1265,7 @@ Pandora_Wmi::getSystemAddress () {
|
||||
CDispPtr wmi_svc = NULL, nic_info = NULL;
|
||||
VARIANT ip_addresses;
|
||||
char *caption = NULL, *mac_address = NULL;
|
||||
string ret = "";
|
||||
string str_addr, ret = "";
|
||||
|
||||
try {
|
||||
|
||||
@ -1274,12 +1278,12 @@ Pandora_Wmi::getSystemAddress () {
|
||||
dhGetValue (L"%v", &ip_addresses, nic_info_item,
|
||||
L".IPAddress");
|
||||
|
||||
if (&ip_addresses != NULL)
|
||||
if (&ip_addresses != NULL && ret == "")
|
||||
{
|
||||
ret = getIPs(&ip_addresses);
|
||||
if(ret != "0.0.0.0") {
|
||||
break;
|
||||
}
|
||||
str_addr = getIPs(&ip_addresses);
|
||||
if (str_addr != "0.0.0.0") {
|
||||
ret = str_addr;
|
||||
}
|
||||
}
|
||||
} NEXT_THROW (nic_info_item);
|
||||
} catch (string errstr) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.771-230517
|
||||
Version: 7.0NG.771-230608
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.771-230517"
|
||||
pandora_version="7.0NG.771-230608"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -185,7 +185,7 @@ if (isset($config['force_instant_logout']) === true
|
||||
header_remove('Set-Cookie');
|
||||
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
||||
|
||||
if ($config['auth'] === 'saml') {
|
||||
if ($config['auth'] === 'saml' && empty($public_hash) === true) {
|
||||
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
|
||||
$as = new SimpleSAML_Auth_Simple('PandoraFMS');
|
||||
$as->logout();
|
||||
|
7
pandora_console/extensions/grafana/.htaccess
Normal file
@ -0,0 +1,7 @@
|
||||
# /etc/httpd/conf/httpd.conf -> AllowOverride All -> service httpd restart
|
||||
|
||||
RewriteEngine on
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME}\.php -f
|
||||
RewriteRule ^(.*)$ $1.php
|
66
pandora_console/extensions/grafana/index.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
// Allow Grafana proxy
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, X-Grafana-Org-Id, X-Grafana-NoCache, X-DS-Authorization');
|
||||
|
||||
// Get all request headers
|
||||
$headers = apache_request_headers();
|
||||
|
||||
// Check if user and password has been sent
|
||||
if ($headers['Authorization']) {
|
||||
$headers['X-DS-Authorization'] = $headers['Authorization'];
|
||||
}
|
||||
|
||||
if ($headers['X-DS-Authorization']) {
|
||||
include_once '../../include/config.php';
|
||||
|
||||
global $config;
|
||||
|
||||
include_once $config['homedir'].'/include/functions_config.php';
|
||||
include_once $config['homedir'].'/include/functions.php';
|
||||
|
||||
list($user, $password) = explode(':', base64_decode($headers['X-DS-Authorization']));
|
||||
|
||||
// Check user login
|
||||
$user_in_db = process_user_login($user, $password, true);
|
||||
|
||||
if ($user_in_db !== false) {
|
||||
// Check user ACL
|
||||
if (check_acl($user_in_db, 0, 'AR')) {
|
||||
$result_array = [
|
||||
'code' => 200,
|
||||
'message' => 'Access granted',
|
||||
];
|
||||
} else {
|
||||
$result_array = [
|
||||
'code' => 403,
|
||||
'message' => 'Access forbidden',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$result_array = [
|
||||
'code' => 401,
|
||||
'message' => 'Unauthorized',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
// OPTIONS request automatically works
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
|
||||
$result_array = [
|
||||
'code' => 200,
|
||||
'message' => 'Options request accepted',
|
||||
];
|
||||
} else {
|
||||
$result_array = [
|
||||
'code' => 401,
|
||||
'message' => 'Unauthorized',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Numeric data in array must be numeric data in json (not text)
|
||||
$result = json_encode($result_array, JSON_NUMERIC_CHECK);
|
||||
|
||||
echo $result;
|
139
pandora_console/extensions/grafana/query.php
Normal file
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
// Allow Grafana proxy.
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, X-Grafana-Org-Id, X-Grafana-NoCache, X-DS-Authorization');
|
||||
|
||||
// Get all request headers.
|
||||
$headers = apache_request_headers();
|
||||
|
||||
$result_array = [];
|
||||
|
||||
// Check if user and password has been sent.
|
||||
if ($headers['Authorization']) {
|
||||
// Get all POST data sent.
|
||||
$payload = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
include_once '../../include/config.php';
|
||||
|
||||
global $config;
|
||||
|
||||
include_once $config['homedir'].'/include/functions_config.php';
|
||||
include_once $config['homedir'].'/include/functions.php';
|
||||
|
||||
list($user, $password) = explode(':', base64_decode($headers['Authorization']));
|
||||
|
||||
// Check user login
|
||||
$user_in_db = process_user_login($user, $password, true);
|
||||
|
||||
if ($user_in_db !== false) {
|
||||
// Check user ACL
|
||||
if (check_acl($user_in_db, 0, 'AR')) {
|
||||
include_once $config['homedir'].'/include/functions_db.php';
|
||||
include_once $config['homedir'].'/include/functions_graph.php';
|
||||
|
||||
// Get graph data for each Grafana target
|
||||
foreach ($payload['targets'] as $target) {
|
||||
$sql_results = [];
|
||||
$result_data = [];
|
||||
|
||||
// Decode target data sent by datasource plugin in Grafana
|
||||
$target_data = json_decode($target['target'], true);
|
||||
|
||||
if ($target_data['module']) {
|
||||
// Get module name as target if not defined in Grafana.
|
||||
if (!$target_data['target']) {
|
||||
$target_data['target'] = io_safe_output(db_get_value_sql('SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = '.$target_data['module']));
|
||||
}
|
||||
|
||||
$target_data['interval'] = db_get_value_sql('SELECT module_interval FROM tagente_modulo WHERE id_agente_modulo = '.$target_data['module']);
|
||||
|
||||
$params = [
|
||||
'agent_module_id' => $target_data['module'],
|
||||
'period' => (strtotime($payload['range']['to']) - strtotime($payload['range']['from'])),
|
||||
'date' => strtotime($payload['range']['to']),
|
||||
'return_data' => 1,
|
||||
'show_unknown' => true,
|
||||
'fullscale' => (bool) $target_data['tip'],
|
||||
'time_interval' => $target_data['interval'],
|
||||
];
|
||||
|
||||
// Get all data.
|
||||
$data = grafico_modulo_sparse($params);
|
||||
|
||||
$unknown_timestamps = [];
|
||||
|
||||
// Set unknown data as null.
|
||||
foreach ($data['unknown1']['data'] as $d) {
|
||||
if (($d[1] == 1 && !$params['fullscale']) || ($d[1] == 0 && $params['fullscale'])) {
|
||||
$result_data[] = [
|
||||
null,
|
||||
$d[0],
|
||||
];
|
||||
}
|
||||
|
||||
$unknown_timestamps[] = $d[0];
|
||||
}
|
||||
|
||||
// Get each data if not in unknown timestamps
|
||||
foreach ($data['sum1']['data'] as $d) {
|
||||
if ($d[1] != false && !in_array($d[0], $unknown_timestamps)) {
|
||||
$result_data[] = [
|
||||
$d[1],
|
||||
$d[0],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// Sort all data by utimestamp (Grafana needs it).
|
||||
usort(
|
||||
$result_data,
|
||||
function ($a, $b) {
|
||||
return $a[1] > $b[1] ? 1 : -1;
|
||||
}
|
||||
);
|
||||
|
||||
$rows = [];
|
||||
|
||||
foreach ($result_data as $k => $v) {
|
||||
if (($result_data[$k][0] !== $result_data[($k - 1)][0]
|
||||
|| $result_data[$k][0] !== $result_data[($k + 1)][0])
|
||||
|| ($result_data[($k - 1)][0] === null
|
||||
&& $result_data[$k][0] !== null
|
||||
&& $result_data[$k][1] != (strtotime($payload['range']['to']) * 1000))
|
||||
|| ($result_data[($k - 1)][0] === $result_data[$k][0] && $result_data[$k][1] == (strtotime($payload['range']['to']) * 1000))
|
||||
) {
|
||||
$rows[] = $result_data[$k];
|
||||
}
|
||||
}
|
||||
|
||||
if (!$params['fullscale']) {
|
||||
$target_data['target'] .= ' (avg)';
|
||||
}
|
||||
|
||||
// Set all target info and data
|
||||
$result_array[] = [
|
||||
'type' => 'table',
|
||||
'target' => $target_data['target'],
|
||||
'refId' => $target_data['target'],
|
||||
'columns' => [
|
||||
[
|
||||
'text' => $target_data['target'],
|
||||
],
|
||||
[
|
||||
'text' => 'Time',
|
||||
'type' => 'time',
|
||||
],
|
||||
],
|
||||
'datapoints' => array_values($rows),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Numeric data in array must be numeric data in json (not text).
|
||||
$result = json_encode($result_array, JSON_NUMERIC_CHECK);
|
||||
|
||||
echo $result;
|
87
pandora_console/extensions/grafana/search.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
// Allow Grafana proxy
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, X-Grafana-Org-Id, X-Grafana-NoCache, X-DS-Authorization');
|
||||
|
||||
// Get all request headers
|
||||
$headers = apache_request_headers();
|
||||
|
||||
$result_array = [];
|
||||
|
||||
// Check if user and password has been sent
|
||||
if ($headers['Authorization']) {
|
||||
// Get all POST data sent
|
||||
$payload = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
include_once '../../include/config.php';
|
||||
|
||||
global $config;
|
||||
|
||||
include_once $config['homedir'].'/include/functions_config.php';
|
||||
include_once $config['homedir'].'/include/functions.php';
|
||||
|
||||
list($user, $password) = explode(':', base64_decode($headers['Authorization']));
|
||||
|
||||
// Check user login
|
||||
$user_in_db = process_user_login($user, $password, true);
|
||||
|
||||
if ($user_in_db !== false) {
|
||||
// Check user ACL
|
||||
if (check_acl($user_in_db, 0, 'AR')) {
|
||||
include_once $config['homedir'].'/include/functions_db.php';
|
||||
|
||||
// If search is for groups
|
||||
if ($payload['type'] == 'group') {
|
||||
// Include group ALL
|
||||
$result_array[] = [
|
||||
'value' => 0,
|
||||
'text' => 'All',
|
||||
];
|
||||
|
||||
// Get groups that match the search
|
||||
$sql = 'SELECT nombre, id_grupo id FROM tgrupo WHERE LOWER(nombre) LIKE LOWER("%'.io_safe_input($payload['search']).'%")';
|
||||
|
||||
// If search is for agents
|
||||
} else if ($payload['type'] == 'agent') {
|
||||
// Get agents that match the search
|
||||
$sql = 'SELECT a.alias nombre, a.id_agente id FROM tagente a, tgrupo g WHERE a.disabled = 0 AND a.id_grupo = g.id_grupo AND LOWER(a.alias) LIKE LOWER("%'.io_safe_input($payload['search']).'%")';
|
||||
|
||||
// If search group is not all, add extra filter
|
||||
if ($payload['extra'] != 0) {
|
||||
$sql .= ' AND g.id_grupo = "'.io_safe_input($payload['extra']).'"';
|
||||
}
|
||||
|
||||
// If search is for modules
|
||||
} else if ($payload['type'] == 'module') {
|
||||
// Get modules that match the search (not string)
|
||||
$sql = 'SELECT m.nombre nombre, m.id_agente_modulo id FROM tagente_modulo m, tagente a, ttipo_modulo t WHERE m.disabled = 0 AND m.id_agente = a.id_agente AND t.id_tipo = m.id_tipo_modulo AND a.id_agente = "'.io_safe_input($payload['extra']).'" AND LOWER(m.nombre) LIKE LOWER("%'.io_safe_input($payload['search']).'%") AND t.nombre NOT LIKE "%string"';
|
||||
}
|
||||
|
||||
// Run query
|
||||
$sql_results = db_get_all_rows_sql($sql);
|
||||
|
||||
foreach ($sql_results as $sql_result) {
|
||||
// If search is for groups, only add those with permissions
|
||||
if ($payload['type'] == 'group') {
|
||||
if (check_acl($user_in_db, $sql_result['id'], 'AR')) {
|
||||
$result_array[] = [
|
||||
'value' => $sql_result['id'],
|
||||
'text' => io_safe_output($sql_result['nombre']),
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$result_array[] = [
|
||||
'value' => $sql_result['id'],
|
||||
'text' => io_safe_output($sql_result['nombre']),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = json_encode($result_array, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
echo $result;
|
@ -31,7 +31,7 @@ global $config;
|
||||
|
||||
check_login();
|
||||
// ACL Check.
|
||||
if (!check_acl($config['id_user'], 0, 'AR')) {
|
||||
if (check_acl($config['id_user'], 0, 'AR') === 0 && check_acl($config['id_user'], 0, 'RR') === 0) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Module Groups view'
|
||||
|
@ -186,10 +186,6 @@ function pandora_realtime_graphs()
|
||||
|
||||
$table->data[] = $data;
|
||||
|
||||
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
|
||||
echo snmp_browser_print_container(true, '100%', '60%', 'none');
|
||||
}
|
||||
|
||||
// Print the relative path to AJAX calls.
|
||||
html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
|
||||
|
||||
@ -224,7 +220,7 @@ function pandora_realtime_graphs()
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph'
|
||||
'box-flat white_table_graph fixed_filter_bar top_0px_important mrgn_btn_35px_imp'
|
||||
);
|
||||
|
||||
$chart[time()]['graph'] = '0';
|
||||
@ -266,6 +262,16 @@ function pandora_realtime_graphs()
|
||||
]
|
||||
);
|
||||
|
||||
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'white_box',
|
||||
'id' => 'graph_snmp_interface',
|
||||
'content' => snmp_browser_print_container(true, '100%', '60%', '', false, false),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// echo $canvas;
|
||||
// Define a custom action to save
|
||||
// the OID selected in the SNMP browser to the form.
|
||||
|
@ -453,7 +453,7 @@ function resource_exportation_extension_main()
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', ['mode' => 'link'], true);
|
||||
$table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr("report");', ['mode' => 'link'], true);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Visual console'),
|
||||
@ -465,7 +465,7 @@ function resource_exportation_extension_main()
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', ['mode' => 'link'], true);
|
||||
$table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr("visual_console");', ['mode' => 'link'], true);
|
||||
|
||||
if ($hook_enterprise === true) {
|
||||
add_rows_for_enterprise($table->data);
|
||||
|
@ -1,5 +1,69 @@
|
||||
START TRANSACTION;
|
||||
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'You know reports of Availability?','They are very useful as they tell you how long (%) a check has been in different states over a period of time, say a week. It offers complete raw data of what has been done in enough detail to convince a vendor or customer.','',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'informe_disponibiliad.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Did you know that you can monitor websites?','In a simple way through standard or transactional HTTP checks through centralized WUX transactions, or decentralized with the UX agent plugin.','https://pandorafms.com/manual/en/documentation/03_monitoring/06_web_monitoring',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_web.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Did you know that each user can have their own Time Zone?','Different time zones can be established for each user, so that it interprets the data taking into account the time difference. Pandora FMS can also have servers and agents in different time zones. All over the world!','',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'usuario_zona_horaria.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Does your network lose packets?','You can measure the packet loss in your network using an agent and a free plugin called “Packet Loss”. This is especially useful on Wi-Fi networks or networks shared with many users. We wrote an article on our blog talking about it, check it out','https://pandorafms.com/blog/packet-loss/',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'tu_red_pierde_paquetes.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Console Internal Audit','The console logs all relevant activities of each user connected to the console. This includes the application of configurations, validation of events and alerts, connection and disconnection, and hundreds of other operations. Security in Pandora FMS has always been one of the design characteristics of its architecture.','https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#log_de_auditoria',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'auditoria.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Two-factor authentication','It is possible to activate (and force its use to all users) a double authentication system (using Google Auth) so that any user authenticates in addition to a password, with a single-use token system, giving the system much more security.','https://pandorafms.com/manual/en/documentation/04_using/12_console_setup?s%5B%5D%3Dgoogle%26s%5B%5D%',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'politica_de_pass.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Visual consoles: heat maps','The console allows a series of data to be integrated into a personalized background, which, depending on their value, is represented with one color or another, in real time. The applications are endless, it just depends on your imagination.','https://pandorafms.com/manual/en/documentation/04_using/05_data_presentation_visual_maps#mapa_de_cal',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'mapa_de_calor.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Network links in the visual console','There is a visual console element called “Network link” that allows to visually show the union of two network interfaces, their status and the upload/download traffic, in a very visual way.','https://pandorafms.com/manual/en/documentation/04_using/05_data_presentation_visual_maps#enlace_de_red',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'enlaces_consola_visual.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Google Sheet ','Do you know that you can get the value of a cell from a Google Sheet spreadsheet? We use the API to request the data through a remote plugin. It's perfect for building business dashboards, getting real-time alerts, and creating your own custom reports.','https://pandorafms.com/library/google-sheets-plugin/',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'google_sheets.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Availability graphs','Similar to availability reports, but much more visual, they offer detailed status of a monitor over time. They can be grouped with another module to offer final data taking into account the high availability of a service. They are perfect for use in reports to suppliers and/or customers.','https://pandorafms.com/manual/en/documentation/04_using/08_data_presentation_reports#grafico_de_disp',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'graficas_disponibilidad.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Full resolution graphics','Pandora FMS and other tools, when they have to display a graph, obtain the data from the data source and then “simplify” the graph, since if the data series has 10,000 elements and the graph is only 300 pixels wide, they cannot fit all of them. , so those 10,000 points are “simplified” into only 300. However, when simplifying, “detail” is lost in the graph, and of course we cannot “zoom in”. Pandora FMS graphs allow you to display and use all the data in a graph, which we call "TIP" that shows all the overlapping points and also allows you not to lose resolution when zooming.','',1);
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'dark mode','Do you know that there is a dark mode in Pandora FMS? An administrator can activate it at a global level from the visual configuration options or any user at an individual level, in the user options.','',1);
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Remote monitoring of SNMP devices','Network devices such as switches, APs, routers, and firewalls can be remotely monitored using the SNMP protocol. It is enough to know your IP, the SNMP community and launch an SNMP wizard from the console.','https://pandorafms.com/manual/en/documentation/03_monitoring/03_remote_monitoring#monitorizacion_snmp',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_snmp.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Monitoring JMX (Tomcat, Websphere, Weblogic, Jboss, Apache Kafka, Jetty, GlassFish…)','There is an Enterprise plugin that is used to monitor any JMX technology. It can be used locally (as a local plugin) or remotely with the plugin server.','https://pandorafms.com/library/jmx-monitoring/',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_con_jmx.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Monitor routes from one IP to another','There is a special plugin that is used to visually monitor the routes from one IP to another in a visual and dynamic way, as it changes over time.','https://pandorafms.com/manual/en/documentation/03_monitoring/03_remote_monitoring#monitorizacion_de_rutas',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_desde_ip.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'planned stops','It is possible to define, at the agent level and at the module level, periods in which the alerts and/or the collected data are ignored. It is perfect for planning service stops or disconnection of monitored systems. It also affects SLA reporting, preventing those time intervals from being taken into account.','https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#paradas_de_servicio_planificadas',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'paradas_planificadas.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Customize alert emails','Did you know that Pandora alert emails can be customized? You only have to edit the default HTML code of the email type alert actions.','https://pandorafms.com/manual/en/documentation/04_using/01_alerts#editing_an_action',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'personalizar_los_emails.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'password policy','The Pandora FMS console has a credential policy management system, to reinforce local security (in addition to allowing external authentication against LDAP, Active Directory or SAML). Through this system we can force password changes every X days, save a history of passwords used or prevent the use of certain passwords, among other actions.','https://pandorafms.com/manual/en/documentation/04_using/12_console_setup?s%5B%5D%3Dcontrase%25C3%25B',1);
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Automatic agent provision system','The agent self-provisioning system allows an agent recently entered into the system to automatically apply changes to their configuration (such as moving them from group, assigning them certain values in custom fields) and of course applying certain monitoring policies. It is one of the most powerful functionalities, aimed at managing very large system parks.','https://pandorafms.com/manual/start?id=en/documentation/02_installation/05_configuration_agents#conf',1);
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Automatic agent provision system','The agent self-provisioning system allows an agent recently entered into the system to automatically apply changes to their configuration (such as moving them from group, assigning them certain values in custom fields) and of course applying certain monitoring policies. It is one of the most powerful functionalities, aimed at managing very large system parks.','https://pandorafms.com/manual/start?id=en/documentation/02_installation/05_configuration_agents#conf',1);
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Automatic agent provision system','The agent self-provisioning system allows an agent recently entered into the system to automatically apply changes to their configuration (such as moving them from group, assigning them certain values in custom fields) and of course applying certain monitoring policies. It is one of the most powerful functionalities, aimed at managing very large system parks.','https://pandorafms.com/manual/start?id=en/documentation/02_installation/05_configuration_agents#conf',1);
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'ARP tables','Do you know that there is an inventory module to get the ARP tables from your windows servers? It is easy to install and can give you very detailed information about your equipment.','https://pandorafms.com/library/arp-table-windows-local/',1);
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Using custom icons in visual consoles','Thanks to the custom icons, you can create highly customized views, such as the one in the image, which represents racks with the types of servers in the order they are placed within the rack. Perfect for a technician to know exactly what machine is failing. It couldn't be more visual, hence the name.','https://pandorafms.com/manual/start?id=en/documentation/04_using/05_data_presentation_visual_maps',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'iconos_personalizados.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Use Telegram with Pandora FMS','Perfect to receive alerts with embedded graphics and thus customize the reception of notices individually or in a common channel with more people.','https://pandorafms.com/library/telegram-bot-cli/',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'telegram_con_pandora.png','images/tips/');
|
||||
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Zoom on data graphs','Do you know that Pandora FMS allows you to zoom in on a part of the graph. With that you will expand the information of the graph. If you are looking at a graph for a month and you zoom in, you will be able to see the data for that interval. If you use a graph with full resolution data (we call them TIP graphs) you will be able to see the detail of each piece of data, even if your graph has thousands of samples.','',1);
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'zoom_en_graficas.png','images/tips/');
|
||||
|
||||
ALTER TABLE `tnetwork_component` ADD COLUMN `target_ip` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
|
||||
UPDATE `tnetwork_component`
|
||||
SET module_enabled=1
|
||||
WHERE name='Cisco _nameOID_ power state';
|
||||
@ -7,4 +71,18 @@ WHERE name='Cisco _nameOID_ power state';
|
||||
ALTER TABLE `tlayout_data`
|
||||
ADD COLUMN `recursive_group` TINYINT NOT NULL DEFAULT '0' AFTER `fill_color`;
|
||||
|
||||
ALTER TABLE `tlayout_template_data`
|
||||
ADD COLUMN `recursive_group` TINYINT NOT NULL DEFAULT '0' AFTER `fill_color`;
|
||||
|
||||
ALTER TABLE `tusuario`
|
||||
ADD COLUMN `metaconsole_section` VARCHAR(255) NOT NULL DEFAULT 'Default' AFTER `data_section`;
|
||||
|
||||
ALTER TABLE `tusuario`
|
||||
ADD COLUMN `metaconsole_data_section` VARCHAR(255) NOT NULL DEFAULT '' AFTER `metaconsole_section`;
|
||||
|
||||
ALTER TABLE `tusuario`
|
||||
ADD COLUMN `metaconsole_default_event_filter` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `default_event_filter`;
|
||||
|
||||
UPDATE tconfig SET value = 'Renaissance' WHERE token LIKE 'lts_name';
|
||||
|
||||
COMMIT;
|
||||
|
@ -263,7 +263,7 @@ switch ($login_screen) {
|
||||
}
|
||||
|
||||
if ($config['auth'] == 'saml') {
|
||||
echo '<div id="log_nick" class="login_nick invisible" >';
|
||||
echo '<div id="log_nick" class="login_nick invisible '.$style_theme.'" >';
|
||||
html_print_input_text_extended(
|
||||
'nick',
|
||||
'',
|
||||
@ -294,7 +294,7 @@ switch ($login_screen) {
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="log_button" class="login_button invisible">';
|
||||
html_print_submit_button(__('Login as admin'), 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']);
|
||||
html_print_submit_button(__('Let's go'), 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']);
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="login_button" id="remove_button">';
|
||||
@ -303,7 +303,7 @@ switch ($login_screen) {
|
||||
'input_saml',
|
||||
false,
|
||||
[
|
||||
'fixed_id' => 'submit-login_button',
|
||||
'fixed_id' => 'submit-admin_button',
|
||||
'class' => 'next_login',
|
||||
'onclick' => 'show_normal_menu()',
|
||||
'id' => 'input_saml',
|
||||
@ -833,13 +833,15 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
function show_normal_menu() {
|
||||
document.getElementById('input_saml').style.display = 'none';
|
||||
event.preventDefault();
|
||||
const style = '<?php echo $style_theme; ?>';
|
||||
|
||||
document.getElementById('remove_button').style.display = 'none';
|
||||
document.getElementById('log_nick').style.display = 'block';
|
||||
document.getElementById('log_pass').style.display = 'block';
|
||||
document.getElementById('log_nick').className = `login_nick ${style}`;
|
||||
document.getElementById('log_pass').className = `login_pass ${style}`;
|
||||
document.getElementById('log_button').style.display = 'block';
|
||||
document.getElementById('remove_button').style.display = 'none';
|
||||
document.getElementById('log_nick').className = 'login_nick';
|
||||
document.getElementById('log_pass').className = 'login_pass';
|
||||
}
|
||||
|
||||
switch ("<?php echo $login_screen; ?>") {
|
||||
|
@ -33,6 +33,15 @@ require_once 'include/config.php';
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
// ACL Check.
|
||||
if (check_acl($config['id_user'], 0, 'AR') === 0) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Default view'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'include/functions_reporting.php';
|
||||
require_once 'include/functions_tactical.php';
|
||||
|
@ -295,25 +295,25 @@ if (enterprise_installed() === true) {
|
||||
$cps_val = $cps;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Parent agents.
|
||||
$paramsParentAgent = [];
|
||||
$paramsParentAgent['return'] = true;
|
||||
$paramsParentAgent['show_helptip'] = false;
|
||||
$paramsParentAgent['input_name'] = 'id_parent';
|
||||
$paramsParentAgent['print_hidden_input_idagent'] = true;
|
||||
$paramsParentAgent['hidden_input_idagent_name'] = 'id_agent_parent';
|
||||
$paramsParentAgent['hidden_input_idagent_value'] = $id_parent;
|
||||
$paramsParentAgent['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
||||
$paramsParentAgent['selectbox_id'] = 'cascade_protection_module';
|
||||
$paramsParentAgent['javascript_is_function_select'] = true;
|
||||
$paramsParentAgent['cascade_protection'] = true;
|
||||
$paramsParentAgent['input_style'] = 'width: 100%;';
|
||||
// Parent agents.
|
||||
$paramsParentAgent = [];
|
||||
$paramsParentAgent['return'] = true;
|
||||
$paramsParentAgent['show_helptip'] = false;
|
||||
$paramsParentAgent['input_name'] = 'id_parent';
|
||||
$paramsParentAgent['print_hidden_input_idagent'] = true;
|
||||
$paramsParentAgent['hidden_input_idagent_name'] = 'id_agent_parent';
|
||||
$paramsParentAgent['hidden_input_idagent_value'] = $id_parent;
|
||||
$paramsParentAgent['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
||||
$paramsParentAgent['selectbox_id'] = 'cascade_protection_module';
|
||||
$paramsParentAgent['javascript_is_function_select'] = true;
|
||||
$paramsParentAgent['cascade_protection'] = true;
|
||||
$paramsParentAgent['input_style'] = 'width: 100%;';
|
||||
|
||||
if ($id_agente !== 0) {
|
||||
// Deletes the agent's offspring.
|
||||
$paramsParentAgent['delete_offspring_agents'] = $id_agente;
|
||||
}
|
||||
if ($id_agente !== 0) {
|
||||
// Deletes the agent's offspring.
|
||||
$paramsParentAgent['delete_offspring_agents'] = $id_agente;
|
||||
}
|
||||
|
||||
$listIcons = gis_get_array_list_icons();
|
||||
@ -631,15 +631,18 @@ $tableAdvancedAgent->style = [];
|
||||
$tableAdvancedAgent->cellclass = [];
|
||||
$tableAdvancedAgent->colspan = [];
|
||||
$tableAdvancedAgent->rowspan = [];
|
||||
// Secondary groups.
|
||||
$tableAdvancedAgent->data['secondary_groups'][] = html_print_label_input_block(
|
||||
__('Secondary groups'),
|
||||
html_print_select_agent_secondary(
|
||||
$agent,
|
||||
$id_agente,
|
||||
['selected_post' => $secondary_groups]
|
||||
)
|
||||
);
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
// Secondary groups.
|
||||
$tableAdvancedAgent->data['secondary_groups'][] = html_print_label_input_block(
|
||||
__('Secondary groups'),
|
||||
html_print_select_agent_secondary(
|
||||
$agent,
|
||||
$id_agente,
|
||||
['selected_post' => $secondary_groups]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Parent agent.
|
||||
$tableAdvancedAgent->data['parent_agent'][] = html_print_label_input_block(
|
||||
@ -754,13 +757,14 @@ $tableAdvancedAgent->data['agent_icon'][] = html_print_label_input_block(
|
||||
false,
|
||||
true,
|
||||
'w540px'
|
||||
).html_print_image(
|
||||
).'<div class="flex mrgn_top_6px mrgn_btn_5px">'.html_print_image(
|
||||
$path_ok,
|
||||
true,
|
||||
[
|
||||
'id' => 'icon_ok',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
'width' => '40',
|
||||
'width' => '30',
|
||||
'class' => 'mrgn_right_5px',
|
||||
]
|
||||
).html_print_image(
|
||||
$path_bad,
|
||||
@ -768,7 +772,8 @@ $tableAdvancedAgent->data['agent_icon'][] = html_print_label_input_block(
|
||||
[
|
||||
'id' => 'icon_bad',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
'width' => '40',
|
||||
'width' => '30',
|
||||
'class' => 'mrgn_right_5px',
|
||||
]
|
||||
).html_print_image(
|
||||
$path_warning,
|
||||
@ -776,9 +781,10 @@ $tableAdvancedAgent->data['agent_icon'][] = html_print_label_input_block(
|
||||
[
|
||||
'id' => 'icon_warning',
|
||||
'style' => 'display:'.$display_icons.';',
|
||||
'width' => '40',
|
||||
'width' => '30',
|
||||
'class' => 'mrgn_right_5px',
|
||||
]
|
||||
)
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
// Url address.
|
||||
@ -795,8 +801,6 @@ if (enterprise_installed() === true) {
|
||||
'',
|
||||
'w540px',
|
||||
'',
|
||||
// Autocomplete.
|
||||
'new-password'
|
||||
);
|
||||
} else {
|
||||
$urlAddressInput = html_print_input_text(
|
||||
@ -903,18 +907,16 @@ $tableAdvancedAgent->data['safe_operation'][] = html_print_label_input_block(
|
||||
)
|
||||
);
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
ui_toggle(
|
||||
html_print_table($tableAdvancedAgent, true),
|
||||
'<span class="subsection_header_title">'.__('Advanced options').'</span>',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box_content',
|
||||
'no-border white_table_graph'
|
||||
);
|
||||
}
|
||||
ui_toggle(
|
||||
html_print_table($tableAdvancedAgent, true),
|
||||
'<span class="subsection_header_title">'.__('Advanced options').'</span>',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box_content',
|
||||
'no-border white_table_graph'
|
||||
);
|
||||
|
||||
// Custom fields.
|
||||
$customOutputData = '';
|
||||
|
@ -1525,8 +1525,8 @@ if ($update_module === true || $create_module === true) {
|
||||
$percentage_warning = 0;
|
||||
$warning_inverse = 0;
|
||||
} else if ($warning_threshold_check_type === 'warning_inverse') {
|
||||
$warning_inverse = (int) get_parameter('warning_inverse_string_sent');
|
||||
$percentage_warning = 0;
|
||||
$warning_inverse = (int) get_parameter('warning_inverse_string_sent');
|
||||
$percentage_warning = 0;
|
||||
} else {
|
||||
$percentage_warning = (int) get_parameter('warning_inverse_string_sent');
|
||||
$warning_inverse = 0;
|
||||
@ -1538,15 +1538,20 @@ if ($update_module === true || $create_module === true) {
|
||||
$percentage_critical = 0;
|
||||
$critical_inverse = 0;
|
||||
} else if ($critical_threshold_check_type === 'critical_inverse') {
|
||||
$critical_inverse = (int) get_parameter('critical_inverse_string_sent');
|
||||
$percentage_critical = 0;
|
||||
$critical_inverse = (int) get_parameter('critical_inverse_string_sent');
|
||||
$percentage_critical = 0;
|
||||
} else {
|
||||
$percentage_critical = (int) get_parameter('critical_inverse_string_sent');
|
||||
$critical_inverse = 0;
|
||||
}
|
||||
|
||||
// Inverse string checkbox.
|
||||
if ($id_module_type === MODULE_TYPE_GENERIC_DATA_STRING || $id_module_type === MODULE_TYPE_ASYNC_STRING) {
|
||||
if ($id_module_type === MODULE_TYPE_GENERIC_DATA_STRING
|
||||
|| $id_module_type === MODULE_TYPE_ASYNC_STRING
|
||||
|| $id_module_type === MODULE_TYPE_REMOTE_TCP_STRING
|
||||
|| $id_module_type === MODULE_TYPE_REMOTE_CMD_STRING
|
||||
|| $id_module_type === MODULE_TYPE_REMOTE_SNMP_STRING
|
||||
) {
|
||||
// Warning inverse string checkbox.
|
||||
$warning_string_checkbox = get_parameter('warning_inverse_string');
|
||||
if (!empty($warning_string_checkbox) && $warning_string_checkbox === 'warning_inverse_string') {
|
||||
@ -2024,10 +2029,10 @@ if ($create_module) {
|
||||
|
||||
// MODULE ENABLE/DISABLE
|
||||
// =====================.
|
||||
if ($enable_module) {
|
||||
/*
|
||||
if ($enable_module) {
|
||||
$result = modules_change_disabled($enable_module, 0);
|
||||
$module_name = modules_get_agentmodule_name($enable_module);
|
||||
|
||||
// Write for conf disable if remote_config.
|
||||
$configuration_data = enterprise_hook(
|
||||
'config_agents_get_module_from_conf',
|
||||
@ -2041,10 +2046,8 @@ if ($enable_module) {
|
||||
|
||||
// Force Update when disabled for save disabled in conf.
|
||||
$old_configuration_data = $configuration_data;
|
||||
|
||||
// Successfull action.
|
||||
$success_action = $result;
|
||||
|
||||
$success_action = $result;
|
||||
if ($result === NOERR) {
|
||||
db_pandora_audit(
|
||||
@ -2057,9 +2060,11 @@ if ($enable_module) {
|
||||
'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($disable_module) {
|
||||
if ($disable_module) {
|
||||
|
||||
hd($disable_module, true);
|
||||
$result = modules_change_disabled($disable_module, 1);
|
||||
$module_name = modules_get_agentmodule_name($disable_module);
|
||||
|
||||
@ -2083,18 +2088,20 @@ if ($disable_module) {
|
||||
|
||||
|
||||
if ($result === NOERR) {
|
||||
hd($disable_module, true);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||
);
|
||||
} else {
|
||||
hd($disable_module, true);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
// Fix to stop the module from being added to the agent's conf
|
||||
// when an error occurred while updating or inserting. or enable disable module.
|
||||
if ($update_module || $create_module
|
||||
@ -2521,10 +2528,10 @@ switch ($tab) {
|
||||
});
|
||||
|
||||
// Change description when edit port
|
||||
$( "#text-tcp_port" ).change(function() {
|
||||
/*$( "#text-tcp_port" ).change(function() {
|
||||
$( "#textarea_description" ).text(`Checks port ${$( "#text-tcp_port" ).val()} is opened`);
|
||||
});
|
||||
|
||||
});*/
|
||||
|
||||
// Set the position and width of the subtab
|
||||
/*
|
||||
function agent_wizard_tab_setup() {
|
||||
|
@ -840,8 +840,8 @@ if ($modules !== false) {
|
||||
$linked = policies_is_module_linked($module['id_agente_modulo']);
|
||||
$adopt = policies_is_module_adopt($module['id_agente_modulo']);
|
||||
|
||||
if ($linked !== false) {
|
||||
if ($adopt === true) {
|
||||
if ((bool) $linked !== false) {
|
||||
if ((bool) $adopt === true) {
|
||||
$img = 'images/policies_not_brick.png';
|
||||
$title = '('.__('Adopted').') '.$policyInfo['name_policy'];
|
||||
} else {
|
||||
@ -849,7 +849,7 @@ if ($modules !== false) {
|
||||
$title = $policyInfo['name_policy'];
|
||||
}
|
||||
} else {
|
||||
if ($adopt === true) {
|
||||
if ((bool) $adopt === true) {
|
||||
$img = 'images/policies_not_brick.png';
|
||||
$title = '('.__('Unlinked').') ('.__('Adopted').') '.$policyInfo['name_policy'];
|
||||
} else {
|
||||
@ -1009,7 +1009,7 @@ if ($modules !== false) {
|
||||
$data[8] .= html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo'],
|
||||
'onClick' => "if (!confirm(\' '.__('Are you sure?').'\')) return false;",
|
||||
'onClick' => 'javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;',
|
||||
'image' => 'images/delete.svg',
|
||||
'title' => __('Delete'),
|
||||
],
|
||||
@ -1105,8 +1105,9 @@ $createModuleTable->data[0][] = html_print_label_input_block(
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:250px;'
|
||||
)
|
||||
'width:350px;'
|
||||
),
|
||||
['div_style' => 'margin-top: 25px;'],
|
||||
);
|
||||
|
||||
$createModuleTable->data[1][] = html_print_label_input_block(
|
||||
@ -1134,8 +1135,9 @@ $modalCreateModule .= html_print_div(
|
||||
'modal_button_create',
|
||||
false,
|
||||
[
|
||||
'icon' => 'next',
|
||||
'mode' => 'mini secondary',
|
||||
'icon' => 'next',
|
||||
'mode' => 'mini secondary',
|
||||
'style' => 'margin-top: 140px;',
|
||||
],
|
||||
true
|
||||
),
|
||||
@ -1162,8 +1164,8 @@ html_print_div(
|
||||
draggable: true,
|
||||
modal: true,
|
||||
close: false,
|
||||
height: 222,
|
||||
width: 480,
|
||||
height: 400,
|
||||
width: 495,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
|
@ -509,7 +509,7 @@ $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||
10,
|
||||
1024,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === false,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
@ -690,6 +690,7 @@ if ((int) $moduletype === MODULE_DATA) {
|
||||
// If it is a non policy form, the module_interval will not provided and will.
|
||||
// be taken the agent interval (this code is at configurar_agente.php).
|
||||
} else {
|
||||
$interval = ($interval === '') ? '300' : $interval;
|
||||
$outputExecutionInterval = html_print_extended_select_for_time('module_interval', $interval, '', '', '0', false, true, false, false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
|
||||
}
|
||||
|
||||
@ -1049,8 +1050,8 @@ $table_advanced->data['textarea_description_instructions'][1] = html_print_texta
|
||||
|
||||
$table_advanced->rowclass['caption_textarea_crit_warn_instructions'] = 'field_half_width pdd_t_10px';
|
||||
$table_advanced->rowclass['textarea_crit_warn_instructions'] = 'field_half_width';
|
||||
$table_advanced->data['caption_textarea_crit_warn_instructions'][1] = __('Warning instructions');
|
||||
$table_advanced->data['caption_textarea_crit_warn_instructions'][0] = __('Critical instructions');
|
||||
$table_advanced->data['caption_textarea_crit_warn_instructions'][1] = __('Warning instructions');
|
||||
$table_advanced->data['textarea_crit_warn_instructions'][0] = html_print_textarea(
|
||||
'critical_instructions',
|
||||
5,
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
global $config;
|
||||
require_once $config['homedir'].'/include/class/CredentialStore.class.php';
|
||||
require_once $config['homedir'].'/operation/snmpconsole/snmp_browser.php';
|
||||
require_once $config['homedir'].'/include/functions_snmp_browser.php';
|
||||
$snmp_browser_path = (is_metaconsole() === true) ? '../../' : '';
|
||||
$snmp_browser_path .= 'include/javascript/pandora_snmp_browser.js';
|
||||
@ -310,7 +311,7 @@ $data[2] .= html_print_button(
|
||||
__('SNMP Walk'),
|
||||
'snmp_walk',
|
||||
false,
|
||||
'snmpBrowserWindow()',
|
||||
'snmpBrowserWindow('.$id_agente.')',
|
||||
[ 'mode' => 'link' ],
|
||||
true
|
||||
);
|
||||
|
@ -153,18 +153,24 @@ foreach ($password_fields as $k => $p) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function changePluginSelect() {
|
||||
if (flag_load_plugin_component) {
|
||||
if (typeof flag_load_plugin_component !== 'undefined' && flag_load_plugin_component) {
|
||||
flag_load_plugin_component = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const moduleId = <?php echo $id_agent_module; ?>;
|
||||
|
||||
load_plugin_description($("#id_plugin").val());
|
||||
|
||||
load_plugin_macros_fields('simple-macro');
|
||||
load_plugin_macros_fields('simple-macro', moduleId);
|
||||
|
||||
forced_title_callback();
|
||||
|
||||
$('select#id_plugin').select2('close');
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
changePluginSelect();
|
||||
});
|
||||
</script>
|
||||
|
@ -193,7 +193,7 @@ $actionButtons .= html_print_button(
|
||||
__('Debug'),
|
||||
'btn_debugModule',
|
||||
$disableDebug,
|
||||
'loadDebugWindow()',
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'mini secondary ',
|
||||
|
@ -1430,10 +1430,10 @@ ui_print_spinner('Loading');
|
||||
$table = new stdClass();
|
||||
$table->id = 'editor';
|
||||
$table->width = '100%';
|
||||
$table->colspan['module'][1] = '5';
|
||||
$table->colspan['module'][1] = '6';
|
||||
$table->data = [];
|
||||
$table->data['module'] = [];
|
||||
$table->data['module'][0] = '';
|
||||
// $table->data['module'][0] = '';
|
||||
$table->data['module'][1] = '<h4>'.__('Modules').'</h4>';
|
||||
|
||||
// List of modules, empty, it is populated by javascript.
|
||||
@ -1457,7 +1457,7 @@ $table->data['module'][1] = "
|
||||
[
|
||||
'border' => '0',
|
||||
'alt' => __('Delete'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>'."</td>
|
||||
</tr>
|
||||
@ -1779,7 +1779,6 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
||||
//Avoid freak states.
|
||||
if (action_in_progress)
|
||||
return;
|
||||
|
||||
//Check if the row editor module exists
|
||||
if ($('#loading_' + id_agent).length > 0) {
|
||||
//The row exists
|
||||
@ -1789,7 +1788,6 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
||||
if ($('#module_editor_' + id_agent).length == 0) {
|
||||
$("#list-agent_" + id_agent).after(
|
||||
$("#loading-loading").clone().attr('id', 'loading_' + id_agent));
|
||||
|
||||
jQuery.post ('ajax.php',
|
||||
{"page": "include/ajax/planned_downtime.ajax",
|
||||
"get_modules_downtime": 1,
|
||||
@ -1799,15 +1797,15 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
||||
function (data) {
|
||||
if (data['correct']) {
|
||||
//Check if the row editor module exists
|
||||
if ($('#loading_' + id_agent).length > 0) {
|
||||
if ($('#list-agent_' + id_agent).length > 0) {
|
||||
//The row exists
|
||||
$('#loading_' + id_agent).remove();
|
||||
|
||||
//$('#loading_' + id_agent).remove();
|
||||
|
||||
$("#list-agent_" + id_agent).after(
|
||||
$("#editor-module").clone()
|
||||
.attr('id', 'module_editor_' + id_agent)
|
||||
.hide());
|
||||
|
||||
|
||||
fill_row_editor(id_agent, data);
|
||||
}
|
||||
}
|
||||
@ -2039,7 +2037,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
||||
var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>;
|
||||
var datetime_now = <?php echo json_encode($utimestamp); ?>;
|
||||
var create = <?php echo json_encode($create); ?>;
|
||||
if (!create && (type_execution == 'periodically' || (type_execution == 'once' && datetime_from < datetime_now))) {
|
||||
if (!create && (type_execution == 'periodically' && (type_execution == 'once' && datetime_from < datetime_now))) {
|
||||
$("input#submit-updbutton, input#submit-add_item, table#list a").click(function (e) {
|
||||
if (!confirm("<?php echo __('WARNING: If you edit this scheduled downtime, the data of future SLA reports may be altered'); ?>")) {
|
||||
e.preventDefault();
|
||||
|
@ -133,7 +133,7 @@ if (is_ajax()) {
|
||||
}
|
||||
}
|
||||
|
||||
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc;' : '';
|
||||
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc; font-family: text-security-disc;' : '';
|
||||
|
||||
if (!empty($field_value)) {
|
||||
$field_value = io_safe_output($field_value);
|
||||
|
@ -166,10 +166,10 @@ $table->data[1][1] = html_print_label_input_block(
|
||||
);
|
||||
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Threshold'),
|
||||
__('Threshold').ui_print_help_tip(__('It takes precedence over the action\'s threshold configuration.'), true),
|
||||
html_print_extended_select_for_time(
|
||||
'module_action_threshold',
|
||||
0,
|
||||
'0',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
|
@ -1032,7 +1032,7 @@ foreach ($simple_alerts as $alert) {
|
||||
|
||||
$data[4] .= html_print_input_image(
|
||||
'update',
|
||||
'images/builder.png',
|
||||
'images/builder@svg.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
|
@ -144,7 +144,7 @@ if ($disabled) {
|
||||
$name = '';
|
||||
$id_command = '';
|
||||
$group = 0;
|
||||
$action_threshold = 0;
|
||||
$action_threshold = '0';
|
||||
// All group is 0.
|
||||
if ($id) {
|
||||
$action = alerts_get_alert_action($id);
|
||||
@ -284,7 +284,7 @@ $table->data[1][0] = html_print_label_input_block(
|
||||
);
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Threshold'),
|
||||
__('Threshold').ui_print_help_tip(__('An alert action is executed only once within this time interval, regardless of how many times the alert is triggered.'), true),
|
||||
html_print_extended_select_for_time(
|
||||
'action_threshold',
|
||||
$action_threshold,
|
||||
|
@ -369,7 +369,7 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$selected,
|
||||
!$is_management_allowed,
|
||||
'cursor: \'pointer\'',
|
||||
'class="hide_inputs"',
|
||||
['input_class' => 'hide_inputs'],
|
||||
true
|
||||
)
|
||||
);
|
||||
@ -413,16 +413,16 @@ $(document).ready (function () {
|
||||
$(".hide_inputs").each(function(index) {
|
||||
var $input_in_row = $(this).closest('tr').find('.field_value');
|
||||
if($(this).is(':checked')) {
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc;');
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc; font-family: text-security-disc;');
|
||||
} else {
|
||||
$input_in_row.prop('style', '');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".hide_inputs").click(function() {
|
||||
var $input_in_row = $(this).closest('tr').find('.field_value');
|
||||
if($(this).is(':checked')) {
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc;');
|
||||
$input_in_row.prop('style', '-webkit-text-security: disc; font-family: text-security-disc;');
|
||||
} else {
|
||||
$input_in_row.prop('style', '');
|
||||
}
|
||||
|
@ -688,7 +688,7 @@ if ($step == 2) {
|
||||
);
|
||||
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Time threshold'),
|
||||
__('Time threshold').ui_print_help_tip(__('Reset the alert counter within the configured period if there is no manual recovery or validation of the alert.'), true),
|
||||
html_print_extended_select_for_time(
|
||||
'threshold',
|
||||
$threshold,
|
||||
|
@ -109,7 +109,7 @@ if ($create_profiles) {
|
||||
} else {
|
||||
foreach ($profiles_id as $profile) {
|
||||
// Check profiles permissions for non admin user.
|
||||
if (is_user_admin($config['user_id']) === false) {
|
||||
if (is_user_admin($config['id_user']) === false) {
|
||||
$user_profiles = profile_get_profiles(
|
||||
[
|
||||
'pandora_management' => '<> 1',
|
||||
@ -122,7 +122,7 @@ if ($create_profiles) {
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to add administrator profile whith standar user for user '.io_safe_input($user)
|
||||
);
|
||||
exit;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ if ($create_profiles) {
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to add profile group without permission for user '.io_safe_input($user)
|
||||
);
|
||||
exit;
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($users_id as $user) {
|
||||
@ -141,7 +141,7 @@ if ($create_profiles) {
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to edit user without permission for user '.io_safe_input($user)
|
||||
);
|
||||
exit;
|
||||
continue;
|
||||
}
|
||||
|
||||
$profile_data = db_get_row_filter('tusuario_perfil', ['id_usuario' => $user, 'id_perfil' => $profile, 'id_grupo' => $group]);
|
||||
|
@ -524,6 +524,17 @@ function edit_massive_agent(
|
||||
alerts_validate_alert_agent($id_agent);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($values['id_grupo']) === false) {
|
||||
// Check if group and secondary group match and remove.
|
||||
$remove_sg = (bool) db_process_sql_delete(
|
||||
'tagent_secondary_group',
|
||||
[
|
||||
'id_agent' => (int) $id_agent,
|
||||
'id_group' => (int) $values['id_grupo'],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$info = [];
|
||||
|
@ -259,7 +259,6 @@ if ($access_console_node === true) {
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'LW') === true
|
||||
|| (bool) check_acl($config['id_user'], 0, 'LM') === true
|
||||
|| (bool) check_acl($config['id_user'], 0, 'AD') === true
|
||||
) {
|
||||
$menu_godmode['galertas']['text'] = __('Alerts');
|
||||
$menu_godmode['galertas']['sec2'] = 'godmode/alerts/alert_list';
|
||||
@ -452,8 +451,8 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($
|
||||
}
|
||||
}
|
||||
|
||||
$sub['godmode/events/configuration_sounds']['text'] = __('Accoustic console setup');
|
||||
$sub['godmode/events/configuration_sounds']['id'] = 'Accoustic console setup';
|
||||
$sub['godmode/events/configuration_sounds']['text'] = __('Acoustic console setup');
|
||||
$sub['godmode/events/configuration_sounds']['id'] = 'Acoustic console setup';
|
||||
$sub['godmode/events/configuration_sounds']['pages'] = ['godmode/events/configuration_sounds'];
|
||||
|
||||
$menu_godmode['gextensions']['sub'] = $sub;
|
||||
|
@ -77,6 +77,7 @@ $min = (int) get_parameter('min');
|
||||
$tcp_send = (string) get_parameter('tcp_send');
|
||||
$tcp_rcv = (string) get_parameter('tcp_rcv');
|
||||
$tcp_port = (int) get_parameter('tcp_port');
|
||||
$target_ip = (string) get_parameter('target_ip');
|
||||
$snmp_oid = (string) get_parameter('snmp_oid');
|
||||
$snmp_community = (string) get_parameter('snmp_community');
|
||||
$id_module_group = (int) get_parameter('id_module_group');
|
||||
@ -360,6 +361,7 @@ if ($is_management_allowed === true && $create_component) {
|
||||
'tcp_send' => $tcp_send,
|
||||
'tcp_rcv' => $tcp_rcv,
|
||||
'tcp_port' => $tcp_port,
|
||||
'target_ip' => $target_ip,
|
||||
'snmp_oid' => $snmp_oid,
|
||||
'snmp_community' => $snmp_community,
|
||||
'id_module_group' => $id_module_group,
|
||||
@ -465,6 +467,7 @@ if ($is_management_allowed === true && $update_component) {
|
||||
'tcp_send' => $tcp_send,
|
||||
'tcp_rcv' => $tcp_rcv,
|
||||
'tcp_port' => $tcp_port,
|
||||
'target_ip' => $target_ip,
|
||||
'snmp_oid' => $snmp_oid,
|
||||
'snmp_community' => $snmp_community,
|
||||
'id_module_group' => $id_module_group,
|
||||
|
@ -60,6 +60,7 @@ if ($create_network_from_module) {
|
||||
$max = $data_module['max'];
|
||||
$min = $data_module['min'];
|
||||
$module_interval = $data_module['module_interval'];
|
||||
$target_ip = $data_module['target_ip'];
|
||||
$tcp_port = $data_module['tcp_port'];
|
||||
$tcp_rcv = $data_module['tcp_rcv'];
|
||||
$tcp_send = $data_module['tcp_send'];
|
||||
@ -120,6 +121,7 @@ if (isset($id)) {
|
||||
$max = $component['max'];
|
||||
$min = $component['min'];
|
||||
$module_interval = $component['module_interval'];
|
||||
$target_ip = $component['target_ip'];
|
||||
$tcp_port = $component['tcp_port'];
|
||||
$tcp_rcv = $component['tcp_rcv'];
|
||||
$tcp_send = $component['tcp_send'];
|
||||
@ -207,6 +209,7 @@ if (isset($id)) {
|
||||
$max = '0';
|
||||
$min = '0';
|
||||
$module_interval = '300';
|
||||
$target_ip = '';
|
||||
$tcp_port = '';
|
||||
$tcp_rcv = '';
|
||||
$tcp_send = '';
|
||||
|
@ -327,7 +327,7 @@ $table->data[10][2] = __('Discard unknown events');
|
||||
$table->data[10][3] = html_print_checkbox(
|
||||
'throw_unknown_events',
|
||||
1,
|
||||
network_components_is_disable_type_event($id, EVENTS_GOING_UNKNOWN),
|
||||
network_components_is_disable_type_event(($id === 0) ? false : $id, EVENTS_GOING_UNKNOWN),
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -50,8 +50,19 @@ $snmp_versions['2c'] = 'v. 2c';
|
||||
$snmp_versions['3'] = 'v. 3';
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Port');
|
||||
$data[1] = html_print_input_text('tcp_port', $tcp_port, '', 5, 20, true);
|
||||
$data[0] = __('Target IP');
|
||||
$data[1] = html_print_input_text_extended(
|
||||
'target_ip',
|
||||
$target_ip,
|
||||
'target_ip',
|
||||
'',
|
||||
30,
|
||||
10000,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$data[2] = __('SNMP version');
|
||||
$data[3] = html_print_select(
|
||||
$snmp_versions,
|
||||
@ -66,19 +77,11 @@ $data[3] = html_print_select(
|
||||
''
|
||||
);
|
||||
|
||||
push_table_row($data, 'snmp_port');
|
||||
push_table_row($data, 'row1');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('SNMP Enterprise String');
|
||||
$data[1] = html_print_input_text(
|
||||
'snmp_oid',
|
||||
$snmp_oid,
|
||||
'',
|
||||
30,
|
||||
400,
|
||||
true
|
||||
);
|
||||
|
||||
$data[0] = __('Port');
|
||||
$data[1] = html_print_input_text('tcp_port', $tcp_port, '', 5, 20, true);
|
||||
$data[2] = __('SNMP community');
|
||||
$data[3] = html_print_input_text(
|
||||
'snmp_community',
|
||||
@ -89,17 +92,16 @@ $data[3] = html_print_input_text(
|
||||
true
|
||||
);
|
||||
|
||||
push_table_row($data, 'snmp_2');
|
||||
|
||||
push_table_row($data, 'snmp_port');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Auth user');
|
||||
$data[0] = __('SNMP Enterprise String');
|
||||
$data[1] = html_print_input_text(
|
||||
'snmp3_auth_user',
|
||||
$snmp3_auth_user,
|
||||
'snmp_oid',
|
||||
$snmp_oid,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
30,
|
||||
400,
|
||||
true
|
||||
);
|
||||
$data[2] = __('Auth password');
|
||||
@ -117,20 +119,18 @@ $data[3] .= html_print_input_hidden_extended(
|
||||
'active_snmp_v3_mncfn',
|
||||
true
|
||||
);
|
||||
push_table_row($data, 'field_snmpv3_row1');
|
||||
|
||||
push_table_row($data, 'snmp_2');
|
||||
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Privacy method');
|
||||
$data[1] = html_print_select(
|
||||
[
|
||||
'DES' => __('DES'),
|
||||
'AES' => __('AES'),
|
||||
],
|
||||
'snmp3_privacy_method',
|
||||
$snmp3_privacy_method,
|
||||
'',
|
||||
'',
|
||||
$data[0] = __('Auth user');
|
||||
$data[1] = html_print_input_text(
|
||||
'snmp3_auth_user',
|
||||
$snmp3_auth_user,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true
|
||||
);
|
||||
$data[2] = __('Privacy pass');
|
||||
@ -142,17 +142,18 @@ $data[3] = html_print_input_password(
|
||||
60,
|
||||
true
|
||||
);
|
||||
push_table_row($data, 'field_snmpv3_row2');
|
||||
|
||||
push_table_row($data, 'field_snmpv3_row1');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Auth method');
|
||||
$data[0] = __('Privacy method');
|
||||
$data[1] = html_print_select(
|
||||
[
|
||||
'MD5' => __('MD5'),
|
||||
'SHA' => __('SHA'),
|
||||
'DES' => __('DES'),
|
||||
'AES' => __('AES'),
|
||||
],
|
||||
'snmp3_auth_method',
|
||||
$snmp3_auth_method,
|
||||
'snmp3_privacy_method',
|
||||
$snmp3_privacy_method,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
@ -172,6 +173,37 @@ $data[3] = html_print_select(
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
push_table_row($data, 'field_snmpv3_row2');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Auth method');
|
||||
$data[1] = html_print_select(
|
||||
[
|
||||
'MD5' => __('MD5'),
|
||||
'SHA' => __('SHA'),
|
||||
],
|
||||
'snmp3_auth_method',
|
||||
$snmp3_auth_method,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$data[2] = __('Name OID').' '.ui_print_help_icon('xxx', true);
|
||||
$data[3] = html_print_input_text_extended(
|
||||
'name_oid',
|
||||
$name_oid,
|
||||
'name_oid',
|
||||
'',
|
||||
30,
|
||||
10000,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
push_table_row($data, 'field_snmpv3_row3');
|
||||
|
||||
$data = [];
|
||||
@ -188,20 +220,6 @@ $data[1] = html_print_extended_select_for_post_process(
|
||||
true
|
||||
);
|
||||
|
||||
$data[2] = __('Name OID').' '.ui_print_help_icon('xxx', true);
|
||||
$data[3] = html_print_input_text_extended(
|
||||
'name_oid',
|
||||
$name_oid,
|
||||
'name_oid',
|
||||
'',
|
||||
30,
|
||||
10000,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
push_table_row($data, 'field_process');
|
||||
|
||||
// Advanced stuff.
|
||||
|
@ -182,7 +182,7 @@ if ($delete_item) {
|
||||
$buttons['graph_container'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
|
||||
'images/graph-container.png',
|
||||
'images/graph-container@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Graph container'),
|
||||
|
@ -309,7 +309,7 @@ if ($edit_graph === true) {
|
||||
'graph_editor' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id='.$id_graph.'">'.html_print_image(
|
||||
'images/builder.png',
|
||||
'images/builder@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Graph editor'),
|
||||
|
@ -95,7 +95,7 @@ $subsection = reporting_enterprise_add_graph_template_subsection('', $buttons);
|
||||
$buttons['graph_container'] = [
|
||||
'active' => true,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
|
||||
'images/graph-container.png',
|
||||
'images/graph-container.svg@svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Graph container'),
|
||||
|
@ -100,7 +100,7 @@ if ($enterpriseEnable) {
|
||||
$buttons['graph_container'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
|
||||
'images/graph-container.png',
|
||||
'images/graph-container@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Graphs containers'),
|
||||
|
@ -1219,11 +1219,9 @@ $class = 'databox filters';
|
||||
<?php
|
||||
html_print_select(
|
||||
$servers,
|
||||
'combo_server',
|
||||
'combo_server_sql',
|
||||
$server_name,
|
||||
'',
|
||||
$nothing,
|
||||
$nothing_value
|
||||
''
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
|
@ -518,8 +518,9 @@ foreach ($items as $item) {
|
||||
}
|
||||
|
||||
$agent_name_db = implode('<br>', $agent_name_db);
|
||||
|
||||
$module_name_db = implode('<br>', $modules);
|
||||
if (is_array($modules) === true) {
|
||||
$module_name_db = implode('<br>', $modules);
|
||||
}
|
||||
} else {
|
||||
$agent_id = agents_get_agent_id_by_module_id($item['id_agent_module']);
|
||||
$agent_name = agents_get_name($agent_id);
|
||||
|
@ -2197,9 +2197,12 @@ switch ($action) {
|
||||
'id_custom'
|
||||
);
|
||||
if ($values['treport_custom_sql_id'] == 0) {
|
||||
$values['external_source'] = get_parameter(
|
||||
'sql'
|
||||
);
|
||||
$sql = get_parameter('sql', '');
|
||||
if ($sql !== '') {
|
||||
$good_format = db_validate_sql($sql);
|
||||
}
|
||||
|
||||
$values['external_source'] = $sql;
|
||||
}
|
||||
|
||||
$values['historical_db'] = get_parameter(
|
||||
@ -2207,7 +2210,14 @@ switch ($action) {
|
||||
);
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
|
||||
$values['server_name'] = get_parameter('combo_server');
|
||||
if ($values['type'] === 'sql_graph_hbar'
|
||||
|| ($values['type'] === 'sql_graph_vbar')
|
||||
|| ($values['type'] === 'sql_graph_pie')
|
||||
) {
|
||||
$values['server_name'] = get_parameter('combo_server_sql');
|
||||
} else {
|
||||
$values['server_name'] = get_parameter('combo_server');
|
||||
}
|
||||
} else if ($values['type'] == 'url') {
|
||||
$values['external_source'] = get_parameter('url');
|
||||
} else if ($values['type'] == 'event_report_group') {
|
||||
@ -2936,9 +2946,12 @@ switch ($action) {
|
||||
'id_custom'
|
||||
);
|
||||
if ($values['treport_custom_sql_id'] == 0) {
|
||||
$values['external_source'] = get_parameter(
|
||||
'sql'
|
||||
);
|
||||
$sql = get_parameter('sql', '');
|
||||
if ($sql !== '') {
|
||||
$good_format = db_validate_sql($sql);
|
||||
}
|
||||
|
||||
$values['external_source'] = $sql;
|
||||
}
|
||||
|
||||
$values['historical_db'] = get_parameter(
|
||||
@ -3684,7 +3697,7 @@ if ($idReport != 0) {
|
||||
|
||||
$tab_builder = ($activeTab === 'item_editor') ? 'reporting_item_editor_tab' : '';
|
||||
|
||||
if ($action !== 'update') {
|
||||
if (is_metaconsole() === true || $action !== 'update') {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$textReportName,
|
||||
|
@ -408,7 +408,6 @@ $(document).ready (function () {
|
||||
});
|
||||
|
||||
$( "button[type=submit]" ).click(function( event ) {
|
||||
console.log('aaaaaaaaaaa');
|
||||
if (parseInt($('input[name=width]').val()) < 1024){
|
||||
alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px');
|
||||
$('input[name=width]').val('1024');
|
||||
|
@ -202,15 +202,6 @@ function visual_map_main() {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//Resize the view to adapt the screen size.
|
||||
if ($("#main").length) {
|
||||
//Console
|
||||
$("#frame_view").height($("#main").height() - 75);
|
||||
} else {
|
||||
//Metaconsole
|
||||
$("#frame_view").height($("#page").height() - 75);
|
||||
}
|
||||
}
|
||||
|
||||
function cancel_button_palette_callback() {
|
||||
@ -2426,10 +2417,10 @@ function loadFieldsFromDB(item) {
|
||||
});
|
||||
}
|
||||
|
||||
function setAspectRatioBackground(side) {
|
||||
function setAspectRatioBackground(side, id) {
|
||||
toggle_item_palette();
|
||||
|
||||
parameter = Array();
|
||||
var parameter = Array();
|
||||
parameter.push({
|
||||
name: "page",
|
||||
value: "include/ajax/visual_console_builder.ajax"
|
||||
@ -2440,18 +2431,20 @@ function setAspectRatioBackground(side) {
|
||||
value: $("#background_img").attr("src")
|
||||
});
|
||||
|
||||
parameter.push({ name: "id_visual_console", value: id });
|
||||
|
||||
jQuery.ajax({
|
||||
url: "ajax.php",
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
old_width = parseInt(
|
||||
var old_width = parseInt(
|
||||
$("#background")
|
||||
.css("width")
|
||||
.replace("px", "")
|
||||
);
|
||||
old_height = parseInt(
|
||||
var old_height = parseInt(
|
||||
$("#background")
|
||||
.css("height")
|
||||
.replace("px", "")
|
||||
@ -2464,8 +2457,12 @@ function setAspectRatioBackground(side) {
|
||||
old_height = 768;
|
||||
}
|
||||
|
||||
img_width = data[0];
|
||||
img_height = data[1];
|
||||
var img_width = data[0];
|
||||
var img_height = data[1];
|
||||
|
||||
var ratio = 0;
|
||||
var height = 0;
|
||||
var width = 0;
|
||||
|
||||
if (side == "width") {
|
||||
ratio = old_width / img_width;
|
||||
@ -5821,14 +5818,14 @@ function deleteDB(idElement) {
|
||||
}
|
||||
|
||||
function activeToolboxButton(id, active) {
|
||||
if ($("input." + id + "[name=button_toolbox2]").length == 0) {
|
||||
if ($("button." + id + "[name=" + id + "]").length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (active) {
|
||||
$("input." + id + "[name=button_toolbox2]").removeAttr("disabled");
|
||||
$("button." + id + "[name=" + id + "]").removeAttr("disabled");
|
||||
} else {
|
||||
$("input." + id + "[name=button_toolbox2]").attr("disabled", true);
|
||||
$("button." + id + "[name=" + id + "]").attr("disabled", true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6446,9 +6443,9 @@ function eventsBackground() {
|
||||
|
||||
function move_elements_resize(original_width, original_height, width, height) {
|
||||
jQuery.each($(".item"), function(key, value) {
|
||||
item = value;
|
||||
var item = value;
|
||||
idItem = $(item).attr("id");
|
||||
classItem = $(item)
|
||||
var classItem = $(item)
|
||||
.attr("class")
|
||||
.replace("item", "")
|
||||
.replace("ui-draggable", "")
|
||||
@ -6456,22 +6453,22 @@ function move_elements_resize(original_width, original_height, width, height) {
|
||||
.replace(/^\s+/g, "")
|
||||
.replace(/\s+$/g, "");
|
||||
|
||||
old_height = parseInt(
|
||||
var old_height = parseInt(
|
||||
$(item)
|
||||
.css("top")
|
||||
.replace("px", "")
|
||||
);
|
||||
old_width = parseInt(
|
||||
var old_width = parseInt(
|
||||
$(item)
|
||||
.css("left")
|
||||
.replace("px", "")
|
||||
);
|
||||
|
||||
ratio_width = width / original_width;
|
||||
ratio_height = height / original_height;
|
||||
var ratio_width = width / original_width;
|
||||
var ratio_height = height / original_height;
|
||||
|
||||
new_height = old_height * ratio_height;
|
||||
new_width = old_width * ratio_width;
|
||||
var new_height = old_height * ratio_height;
|
||||
var new_width = old_width * ratio_width;
|
||||
|
||||
var values = {};
|
||||
|
||||
|
@ -92,14 +92,14 @@ html_print_input_hidden('metaconsole', (is_metaconsole() === true) ? 1 : 0);
|
||||
visual_map_editor_print_hack_translate_strings();
|
||||
visual_map_editor_print_item_palette($visualConsole['id'], $background);
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
if (is_metaconsole() === true) {
|
||||
echo '<div id="frame_view" class="frame_view_meta">';
|
||||
} else {
|
||||
echo '<div id="frame_view" class="frame_view_node mrgn_top_meta_35px">';
|
||||
echo '<div id="frame_view" class="frame_view_node">';
|
||||
}
|
||||
|
||||
echo '<div id="background" class="" style="top:0px;
|
||||
margin: 0px auto;border: 1px lightgray solid; width: '.$widthBackground.'px; height: '.$heightBackground.'px;background-color: '.$visualConsole['background_color'].';">';
|
||||
margin: 0px auto;border: 1px lightgray solid; width: '.$widthBackground.'px; height: '.$heightBackground.'px;background-color: '.$visualConsole['background_color'].';z-index:0;">';
|
||||
echo "<div id='background_grid'
|
||||
style='position: absolute; display: none; overflow: hidden;
|
||||
background: url(".ui_get_full_url('images/console/background/white_boxed.jpg', false, false, false).');
|
||||
|
@ -635,15 +635,20 @@ switch ($activeTab) {
|
||||
} else {
|
||||
if (is_metaconsole() === true) {
|
||||
$agents_ids = [];
|
||||
$servers_ids = [];
|
||||
foreach ($id_agents as $id_agent_id) {
|
||||
$server_and_agent = explode('|', $id_agent_id);
|
||||
|
||||
$agents_ids[] = $server_and_agent[1];
|
||||
$servers_ids[] = $server_and_agent[0];
|
||||
}
|
||||
|
||||
$rows = db_get_all_rows_filter(
|
||||
'tmetaconsole_agent',
|
||||
['id_tagente' => $agents_ids]
|
||||
[
|
||||
'id_tagente' => $agents_ids,
|
||||
'id_tmetaconsole_setup' => $servers_ids,
|
||||
]
|
||||
);
|
||||
|
||||
$agents = [];
|
||||
@ -688,7 +693,9 @@ switch ($activeTab) {
|
||||
|
||||
foreach ($modules_serial as $data_serialized) {
|
||||
$data = explode('|', $data_serialized);
|
||||
$id_modules[] = $data[0];
|
||||
if ($id_server == $data[2]) {
|
||||
$id_modules[] = $data[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -833,7 +840,7 @@ $buttons['wizard'] = [
|
||||
if ($config['legacy_vc']) {
|
||||
$buttons['editor'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/builder.png', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'</a>',
|
||||
'text' => '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/builder@svg.svg', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,8 @@
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once 'include/functions_servers.php';
|
||||
require_once 'include/functions_graph.php';
|
||||
require_once $config['homedir'].'/include/functions_servers.php';
|
||||
require_once $config['homedir'].'/include/functions_graph.php';
|
||||
|
||||
check_login();
|
||||
|
||||
@ -205,24 +205,46 @@ if (isset($_GET['server']) === true) {
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
ui_print_standard_header(
|
||||
__('Remote Configuration'),
|
||||
'images/gm_servers.png',
|
||||
false,
|
||||
'servers',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
if (is_metaconsole() === true) {
|
||||
ui_print_standard_header(
|
||||
__('Remote Configuration'),
|
||||
'images/gm_servers.png',
|
||||
false,
|
||||
'servers',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Servers'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Servers'),
|
||||
],
|
||||
[
|
||||
'link' => 'index.php?sec=advanced&sec2=advanced/servers',
|
||||
'label' => __('%s servers', get_product_name()),
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_print_standard_header(
|
||||
__('Remote Configuration'),
|
||||
'images/gm_servers.png',
|
||||
false,
|
||||
'servers',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
'link' => 'index.php?sec=gservers&sec2=godmode/servers/modificar_server',
|
||||
'label' => __('%s servers', get_product_name()),
|
||||
],
|
||||
]
|
||||
);
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Servers'),
|
||||
],
|
||||
[
|
||||
'link' => 'index.php?sec=gservers&sec2=godmode/servers/modificar_server',
|
||||
'label' => __('%s servers', get_product_name()),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($tab === 'standard_editor') {
|
||||
$advanced_editor = false;
|
||||
|
@ -978,14 +978,14 @@ if (empty($create) === false || empty($view) === false) {
|
||||
if ($rows !== false) {
|
||||
$pluginTable = new stdClass();
|
||||
$pluginTable->id = 'plugin_table';
|
||||
$pluginTable->class = (is_metaconsole() === true) ? 'databox data' : 'info_table';
|
||||
$pluginTable->class = 'info_table';
|
||||
|
||||
$pluginTable->head = [];
|
||||
$pluginTable->head[0] = __('Name');
|
||||
$pluginTable->head[1] = __('Type');
|
||||
$pluginTable->head[2] = __('Command');
|
||||
if ($management_allowed === true) {
|
||||
$pluginTable->head[3] = '<span title="'.__('Operations').'">'.__('Op.').'</span>';
|
||||
$pluginTable->head[3] = __('Operations');
|
||||
}
|
||||
|
||||
$pluginTable->data = [];
|
||||
|
@ -93,10 +93,6 @@ if (is_metaconsole() === true) {
|
||||
}
|
||||
}
|
||||
|
||||
$str = 'This extension makes registering server plugins an easier task.';
|
||||
$str .= ' Here you can upload a server plugin in .pspz zipped format.';
|
||||
$str .= ' Please refer to the official documentation on how to obtain and use Server Plugins.';
|
||||
|
||||
$output = '<div class="new_task">';
|
||||
$output .= '<div class="image_task">';
|
||||
$output .= html_print_image(
|
||||
@ -108,7 +104,7 @@ $output .= '</div>';
|
||||
$output .= '<div class="text_task">';
|
||||
$output .= '<h3>'.__('Plugin registration').'</h3>';
|
||||
$output .= '<p id="description_task">';
|
||||
$output .= __($str);
|
||||
$output .= __('This extension makes registering server plugins an easier task. Here you can upload a server plugin in .pspz zipped format. Please refer to the official documentation on how to obtain and use Server Plugins.');
|
||||
$output .= '<br><br>';
|
||||
$output .= __('You can get more plugins in our');
|
||||
$output .= '<a href="https://pandorafms.com/Library/Library/">';
|
||||
|
@ -167,19 +167,22 @@ foreach ($servers as $server) {
|
||||
break;
|
||||
}
|
||||
|
||||
$data[6] = $server['threads'].' : '.$server['queued_modules'];
|
||||
$data[6] = '';
|
||||
if ($server['queued_modules'] > 500) {
|
||||
$data[6] .= ' <div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
||||
$data[6] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
||||
'images/info-warning.svg',
|
||||
true,
|
||||
[
|
||||
'width' => 16,
|
||||
'heght' => 16,
|
||||
'class' => 'pulsate clickable',
|
||||
'style' => 'margin-left: -25px;',
|
||||
]
|
||||
).'</a></div>';
|
||||
).'</a></div> ';
|
||||
}
|
||||
|
||||
$data[6] .= $server['threads'].' : '.$server['queued_modules'];
|
||||
|
||||
$data[7] = ui_print_timestamp($server['keepalive'], true);
|
||||
|
||||
|
||||
@ -256,7 +259,7 @@ foreach ($servers as $server) {
|
||||
'images/agents@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Manage satellite hosts'),
|
||||
'title' => __('Manage server conf'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
|
@ -66,7 +66,7 @@ $table->head[1] = __('Icon');
|
||||
$table->head[2] = __('Name');
|
||||
$table->head[3] = __('Description');
|
||||
if ($is_management_allowed === true) {
|
||||
$table->head[4] = '';
|
||||
$table->head[4] = __('Actions');
|
||||
}
|
||||
|
||||
if ($is_management_allowed === true) {
|
||||
@ -132,8 +132,7 @@ foreach ($osList as $os) {
|
||||
$data[] = html_print_anchor(
|
||||
[
|
||||
'href' => $hrefDelete,
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'content' => html_print_image('images/delete.svg', true),
|
||||
'content' => html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -24,7 +24,7 @@ global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true && is_user_admin($config['id_user']) === false) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === false && is_user_admin($config['id_user']) === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Setup Management'
|
||||
|
@ -70,6 +70,10 @@ html_print_input_hidden('update_config', 1);
|
||||
|
||||
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
|
||||
|
||||
echo "<div id='dialog-legacy-vc' title='".__('Legacy visual console Information')."' class='invisible'>";
|
||||
echo "<p class='center'>".__('Visual console in legacy mode will no longer be supported as of LTS 772').'</p>';
|
||||
echo '</div>';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// BEHAVIOUR CONFIGURATION
|
||||
// ----------------------------------------------------------------------
|
||||
@ -2243,9 +2247,22 @@ $(document).ready (function () {
|
||||
// Show the cache expiration conf or not.
|
||||
$("input[name=legacy_vc]").change(function (e) {
|
||||
if ($(this).prop("checked") === true) {
|
||||
$("select#vc_default_cache_expiration_select").closest("tr").hide();
|
||||
$("select#vc_default_cache_expiration_select").closest("td").hide();
|
||||
$("#dialog-legacy-vc").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");
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
} else {
|
||||
$("select#vc_default_cache_expiration_select").closest("tr").show();
|
||||
$("select#vc_default_cache_expiration_select").closest("td").show();
|
||||
}
|
||||
}).change();
|
||||
|
||||
|
@ -121,12 +121,13 @@ if ($update_tag && $id_tag != 0) {
|
||||
);
|
||||
}
|
||||
|
||||
// Create tag: creates a new tag
|
||||
// Create tag: creates a new tag.
|
||||
if ($create_tag) {
|
||||
$return_create = true;
|
||||
|
||||
// Erase comma characters on tag name
|
||||
// Erase comma characters and spaces on tag name.
|
||||
$name_tag = str_replace(',', '', $name_tag);
|
||||
$name_tag = str_replace(' ', '', $name_tag);
|
||||
|
||||
$data = [];
|
||||
$data['name'] = $name_tag;
|
||||
@ -155,11 +156,14 @@ if ($create_tag) {
|
||||
AUDIT_LOG_TAG_MANAGEMENT,
|
||||
$auditMessage
|
||||
);
|
||||
ui_print_result_message(
|
||||
$action === 'update',
|
||||
__('Successfully created tag'),
|
||||
__('Error creating tag')
|
||||
);
|
||||
|
||||
if ($name_tag !== '') {
|
||||
ui_print_result_message(
|
||||
$action === 'update',
|
||||
__('Successfully created tag'),
|
||||
__('Error creating tag')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Form fields are filled here
|
||||
|
@ -69,6 +69,11 @@ $homeScreenValues = [
|
||||
// This defines the working user. Beware with this, old code get confusses
|
||||
// and operates with current logged user (dangerous).
|
||||
$id = get_parameter('id', get_parameter('id_user', ''));
|
||||
|
||||
if (empty($id) === true) {
|
||||
$id = $config['id_user'];
|
||||
}
|
||||
|
||||
// Check if we are the same user for edit or we have a proper profile for edit users.
|
||||
if ($id !== $config['id_user']) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'UM') === false) {
|
||||
@ -85,6 +90,13 @@ if ($id !== $config['id_user']) {
|
||||
// ID given as parameter.
|
||||
$pure = get_parameter('pure', 0);
|
||||
$user_info = get_user_info($id);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$user_info['section'] = $user_info['metaconsole_section'];
|
||||
$user_info['data_section'] = $user_info['metaconsole_data_section'];
|
||||
$user_info['default_event_filter'] = $user_info['metaconsole_default_event_filter'];
|
||||
}
|
||||
|
||||
$is_err = false;
|
||||
|
||||
if (is_ajax() === true) {
|
||||
@ -372,6 +384,8 @@ if ($create_user === true) {
|
||||
|
||||
// Generate new API token.
|
||||
$values['api_token'] = api_token_generate();
|
||||
// Validate the user ID if it already exists.
|
||||
$user_exists = get_user_info($id);
|
||||
|
||||
if (empty($id) === true) {
|
||||
ui_print_error_message(__('User ID cannot be empty'));
|
||||
@ -380,6 +394,13 @@ if ($create_user === true) {
|
||||
$password_new = '';
|
||||
$password_confirm = '';
|
||||
$new_user = true;
|
||||
} else if (isset($user_exists['id_user'])) {
|
||||
$is_err = true;
|
||||
ui_print_error_message(__('User ID already exists'));
|
||||
$user_info = $values;
|
||||
$password_new = '';
|
||||
$password_confirm = '';
|
||||
$new_user = true;
|
||||
} else if (preg_match('/^\s+|\s+$/', io_safe_output($id))) {
|
||||
ui_print_error_message(__('Invalid user ID: leading or trailing blank spaces not allowed'));
|
||||
$is_err = true;
|
||||
@ -627,9 +648,15 @@ if ($update_user) {
|
||||
$values['section'] = $homeScreenValues[$values['section']];
|
||||
|
||||
if (enterprise_installed() === true && is_metaconsole() === true) {
|
||||
$values['metaconsole_access'] = get_parameter('metaconsole_access');
|
||||
$values['metaconsole_agents_manager'] = get_parameter('metaconsole_agents_manager', '0');
|
||||
$values['metaconsole_access_node'] = get_parameter('metaconsole_access_node', '0');
|
||||
if (users_is_admin() === true) {
|
||||
$values['metaconsole_access'] = get_parameter('metaconsole_access');
|
||||
$values['metaconsole_agents_manager'] = get_parameter('metaconsole_agents_manager', '0');
|
||||
$values['metaconsole_access_node'] = get_parameter('metaconsole_access_node', '0');
|
||||
} else {
|
||||
$values['metaconsole_access'] = $user_info['metaconsole_access'];
|
||||
$values['metaconsole_agents_manager'] = $user_info['metaconsole_agents_manager'];
|
||||
$values['metaconsole_access_node'] = db_get_value('metaconsole_access_node', 'tusuario', 'id_user', $id);
|
||||
}
|
||||
}
|
||||
|
||||
$values['not_login'] = (bool) get_parameter('not_login', false);
|
||||
@ -677,6 +704,10 @@ if ($update_user) {
|
||||
]
|
||||
);
|
||||
$res3 = save_pass_history($id, $password_new);
|
||||
|
||||
// Generate new API token.
|
||||
$newToken = api_token_generate();
|
||||
$res4 = update_user($id, ['api_token' => $newToken]);
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
@ -701,6 +732,10 @@ if ($update_user) {
|
||||
'utimestamp' => time(),
|
||||
]
|
||||
);
|
||||
|
||||
// Generate new API token.
|
||||
$newToken = api_token_generate();
|
||||
$res4 = update_user($id, ['api_token' => $newToken]);
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
@ -1453,6 +1488,10 @@ foreach ($event_filter_data as $filter) {
|
||||
$event_filter[$filter['id_filter']] = $filter['id_name'];
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true && empty($user_info['metaconsole_default_event_filter']) !== true) {
|
||||
$user_info['default_event_filter'] = $user_info['metaconsole_default_event_filter'];
|
||||
}
|
||||
|
||||
$default_event_filter = '<div class="label_select"><p class="edit_user_labels">'.__('Default event filter').'</p>';
|
||||
$default_event_filter .= html_print_select(
|
||||
$event_filter,
|
||||
@ -1583,7 +1622,8 @@ $autorefresh_list_out['operation/events/events'] = 'Events';
|
||||
if (isset($autorefresh_list) === false || empty($autorefresh_list) === true || empty($autorefresh_list[0]) === true) {
|
||||
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '".$id."'");
|
||||
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
|
||||
if ($autorefresh_list === null) {
|
||||
if ($autorefresh_list === null || $autorefresh_list === 0) {
|
||||
$autorefresh_list = [];
|
||||
$autorefresh_list[0] = __('None');
|
||||
} else {
|
||||
$aux = [];
|
||||
|
@ -413,10 +413,11 @@ if ($delete_user === true) {
|
||||
);
|
||||
} else if ($disable_user !== false) {
|
||||
// CSRF Validator.
|
||||
if (html_print_csrf_error()) {
|
||||
/*
|
||||
if (html_print_csrf_error()) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
// Disable_user.
|
||||
$id_user = get_parameter('id', 0);
|
||||
|
||||
|
@ -272,7 +272,7 @@ $passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_exte
|
||||
'password_new',
|
||||
'',
|
||||
'25',
|
||||
'45',
|
||||
'150',
|
||||
$view_mode,
|
||||
'',
|
||||
[
|
||||
@ -291,7 +291,7 @@ $passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_e
|
||||
'password_conf',
|
||||
'',
|
||||
'20',
|
||||
'45',
|
||||
'150',
|
||||
$view_mode,
|
||||
'',
|
||||
[
|
||||
@ -311,7 +311,7 @@ if ($new_user === false) {
|
||||
'own_password_confirm',
|
||||
'',
|
||||
'20',
|
||||
'45',
|
||||
'150',
|
||||
$view_mode,
|
||||
'',
|
||||
[
|
||||
@ -596,11 +596,15 @@ $userManagementTable->data['fields_blocksize_eventfilter'][0] = html_print_input
|
||||
true
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true && empty($user_info['metaconsole_default_event_filter']) !== true) {
|
||||
$user_info['default_event_filter'] = $user_info['metaconsole_default_event_filter'];
|
||||
}
|
||||
|
||||
$userManagementTable->data['captions_blocksize_eventfilter'][1] = __('Event filter');
|
||||
$userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_select(
|
||||
$event_filter,
|
||||
'default_event_filter',
|
||||
($user_info['default_event_filter'] ?? 0),
|
||||
[$user_info['default_event_filter']],
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
@ -617,6 +621,11 @@ $homeScreenTable->style = [];
|
||||
$homeScreenTable->rowclass = [];
|
||||
$homeScreenTable->data = [];
|
||||
// Home screen.
|
||||
if (is_metaconsole() === true && empty($user_info['metaconsole_data_section']) !== true) {
|
||||
$user_info['data_section'] = $user_info['metaconsole_data_section'];
|
||||
$user_info['section'] = $user_info['metaconsole_section'];
|
||||
}
|
||||
|
||||
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
|
||||
$homeScreenTable->colspan['captions_homescreen'][0] = 2;
|
||||
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
|
||||
@ -643,6 +652,17 @@ $homeScreenTable->data['fields_homescreen'][1] = html_print_div(
|
||||
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
|
||||
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
|
||||
|
||||
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
|
||||
[
|
||||
'class' => 'w100p',
|
||||
'content' => $customHomeScreenDataField,
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
|
||||
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
|
||||
|
||||
|
||||
if (is_metaconsole() === true && users_is_admin() === true) {
|
||||
$userManagementTable->rowclass['search_custom1_looknfeel'] = 'field_half_width';
|
||||
|
@ -1460,7 +1460,7 @@ class HostDevices extends Wizard
|
||||
}
|
||||
|
||||
include_once $config['homedir'].'/include/class/CredentialStore.class.php';
|
||||
$available_keys = CredentialStore::getKeys('CUSTOM');
|
||||
$available_keys = CredentialStore::getKeys('WMI');
|
||||
if (check_acl($config['id_user'], 0, 'UM')) {
|
||||
$link_to_cs = '<a class="ext_link" href="'.ui_get_full_url(
|
||||
'index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox'
|
||||
@ -1482,7 +1482,7 @@ class HostDevices extends Wizard
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'name' => 'auth_strings[]',
|
||||
'fields' => CredentialStore::getKeys('CUSTOM'),
|
||||
'fields' => CredentialStore::getKeys('WMI'),
|
||||
'selected' => explode(
|
||||
',',
|
||||
$this->task['auth_strings']
|
||||
|
BIN
pandora_console/images/builder.png
Executable file → Normal file
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 518 B |
BIN
pandora_console/images/builder@2x.png
Normal file
After Width: | Height: | Size: 963 B |
9
pandora_console/images/builder@svg.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
|
||||
<title>Dark/20/builder@svg</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Dark/20/builder" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M11.2000009,9 C11.6418287,9 12.0000009,9.24624341 12.0000009,9.55 L12.0000009,18.625 C12.0000009,19.3444236 11.1963458,19.9348008 10.1725686,19.9949529 L10.0000009,20 C8.89543137,20 8.00000089,19.3843915 8.00000089,18.625 L8.00000089,9.55 C8.00000089,9.24624341 8.35817313,9 8.80000089,9 L11.2000009,9 Z M4.26666773,0 C4.58021643,0.000327502857 4.83365862,0.256429891 4.83333415,0.572021011 L4.83273845,1.1514049 C4.83209502,1.77722291 5.33889914,2.28507025 5.96471715,2.28571369 L5.9658822,2.28571429 C5.97463278,1.028388 6.98240281,0.00602907429 8.2306519,0 L17.2749359,0 C18.227663,0 19.0000009,0.778828069 19.0000009,1.73956118 L19.0000009,2.90444994 C19.0000009,3.21877749 18.7482417,3.47408731 18.4365385,3.47586469 C16.7044902,3.48574131 15.4517873,3.68716343 14.6784298,4.08013103 C13.8970625,4.47716869 13.4597945,5.60295629 13.3666256,7.45749383 C13.3513448,7.76145183 13.1024969,8 12.8006847,8 L8.89562156,8 C7.8879903,8 7.52254304,7.89465034 7.15382124,7.6965828 C6.78509944,7.49851526 6.49535873,7.20772989 6.29718553,6.8368584 C6.1461106,6.55412903 6.04847891,6.27306171 6.00847638,5.70526629 C5.95356666,5.71123749 5.88644204,5.71428571 5.80077411,5.71428571 C5.26339018,5.71428571 4.82759963,6.14962846 4.82704715,6.68701211 L4.82644971,7.2681156 C4.82618797,7.52268394 4.79983225,7.61497223 4.75041109,7.70800617 C4.70098993,7.80104006 4.62852471,7.87403851 4.53621487,7.92377851 C4.44390504,7.97351851 4.35235851,8 4.09991144,8 L2.72643507,8 C2.47383808,8 2.38224031,7.9734784 2.28989463,7.92367634 C2.19754894,7.87387434 2.12507551,7.80079189 2.0756885,7.70767023 C2.02630148,7.61454851 2.00000089,7.52218103 2.00000089,7.26746137 L2.00000089,0.732538629 C2.00000089,0.477818989 2.02630148,0.385451491 2.0756885,0.2923298 C2.12507551,0.199208109 2.19754894,0.126125657 2.28989463,0.0763236286 C2.38224031,0.0265216057 2.47383808,0 2.72643507,0 L4.26666773,0 Z" id="Shape" fill="#3F3F3F"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 623 B |
BIN
pandora_console/images/graph-container@2x.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
19
pandora_console/images/graph-container@svg.svg
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons/Dark/20/graph container@svg</title>
|
||||
<g id="Icons/Dark/20/graph-container" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g id="Group" transform="translate(2.000000, 2.000000)" stroke="#3F3F3F" stroke-width="2">
|
||||
<g id="Group-2">
|
||||
<polyline id="Path-4" points="0 0 0 16 16 16"></polyline>
|
||||
<g id="Group-3" transform="translate(2.941811, 0.000000)">
|
||||
<polyline id="Path" points="0 9.999897 4.0553112 5.0332489 7.05959702 7.04601669 13.0581894 -1.44328993e-15"></polyline>
|
||||
<polyline id="Path-2" points="13.0581894 4 13.0581894 0 9.05818939 0"></polyline>
|
||||
</g>
|
||||
</g>
|
||||
<line x1="7.03043747" y1="16" x2="7.03043747" y2="13.0441227" id="Path-75"></line>
|
||||
<line x1="3.03043747" y1="16" x2="3.03043747" y2="13.0441227" id="Path-75-Copy"></line>
|
||||
<line x1="11.0304375" y1="16" x2="11.0304375" y2="13.0441227" id="Path-75-Copy-2"></line>
|
||||
<line x1="15.0304375" y1="16" x2="15.0304375" y2="13.0441227" id="Path-75-Copy-3"></line>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -537,7 +537,7 @@ if ($show_update_action_menu) {
|
||||
$data .= '</tr>';
|
||||
$data .= '<tr class="datos2">';
|
||||
$data .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data .= __('Threshold');
|
||||
$data .= __('Threshold').ui_print_help_tip(__('If a value of 0 is assigned, the Threshold of the action will be used.'), true);
|
||||
$data .= '</td>';
|
||||
$data .= '<td class="datos2">';
|
||||
$data .= html_print_extended_select_for_time(
|
||||
|
@ -38,6 +38,7 @@ if (check_login()) {
|
||||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
|
||||
$get_plugin_macros = get_parameter('get_plugin_macros');
|
||||
$get_module_macros = get_parameter('get_module_macros');
|
||||
$search_modules = get_parameter('search_modules');
|
||||
$get_module_detail = get_parameter('get_module_detail', 0);
|
||||
$get_module_autocomplete_input = (bool) get_parameter(
|
||||
@ -118,6 +119,28 @@ if (check_login()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($get_module_macros && $get_module_macros > 0) {
|
||||
if (https_is_running()) {
|
||||
header('Content-type: application/json');
|
||||
}
|
||||
|
||||
$module_id = $get_module_macros;
|
||||
|
||||
$module_macros = db_get_value(
|
||||
'macros',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$module_id
|
||||
);
|
||||
|
||||
$macros = [];
|
||||
$macros['base64'] = base64_encode($module_macros);
|
||||
$macros['array'] = json_decode($module_macros, true);
|
||||
|
||||
echo json_encode($macros);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($search_modules) {
|
||||
if (https_is_running()) {
|
||||
header('Content-type: application/json');
|
||||
@ -1058,8 +1081,8 @@ if (check_login()) {
|
||||
$policyInfo = policies_info_module_policy($module['id_policy_module']);
|
||||
$adopt = policies_is_module_adopt($module['id_agente_modulo']);
|
||||
|
||||
if ($linked === true) {
|
||||
if ($adopt === true) {
|
||||
if ((bool) $linked === true) {
|
||||
if ((bool) $adopt === true) {
|
||||
$img = 'images/policies_brick.png';
|
||||
$title = '('.__('Adopted').') '.$name_policy;
|
||||
} else {
|
||||
@ -1067,7 +1090,7 @@ if (check_login()) {
|
||||
$title = $name_policy;
|
||||
}
|
||||
} else {
|
||||
if ($adopt === true) {
|
||||
if ((bool) $adopt === true) {
|
||||
$img = 'images/policies_not_brick.png';
|
||||
$title = '('.__('Unlinked').') ('.__('Adopted').') '.$name_policy;
|
||||
} else {
|
||||
@ -1159,7 +1182,6 @@ if (check_login()) {
|
||||
$last_status_change_text = __('Time elapsed since last status change: ');
|
||||
$last_status_change_text .= (empty($module['last_status_change']) === false) ? human_time_comparation($module['last_status_change']) : __('N/A');
|
||||
|
||||
$data[4] .= ui_print_status_image($status, htmlspecialchars($title), true, false, false, true, $last_status_change_text);
|
||||
if ($show_context_help_first_time === false) {
|
||||
$show_context_help_first_time = true;
|
||||
|
||||
@ -1168,6 +1190,8 @@ if (check_login()) {
|
||||
}
|
||||
}
|
||||
|
||||
$data[4] .= ui_print_status_image($status, htmlspecialchars($title), true, false, false, true, $last_status_change_text);
|
||||
|
||||
// Module thresholds.
|
||||
$data[5] = '';
|
||||
if ((int) $module['id_tipo_modulo'] !== 25) {
|
||||
|
@ -34,7 +34,7 @@ if ($get_image_path_status) {
|
||||
$id_visual_console = get_parameter('id_visual_console', null);
|
||||
|
||||
// WARNING: CHECK THE ENTIRE FUNCTIONALITY
|
||||
// Visual console id required
|
||||
// Visual console id required.
|
||||
if (empty($id_visual_console)) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
@ -1774,7 +1774,7 @@ switch ($action) {
|
||||
break;
|
||||
}
|
||||
|
||||
// visual map element status check
|
||||
// Visual map element status check.
|
||||
if ($get_element_status) {
|
||||
$layoutData = db_get_row_filter(
|
||||
'tlayout_data',
|
||||
|
@ -801,6 +801,34 @@ function update_user(string $id_user, array $values)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($values['section']) === true) {
|
||||
$homeScreenValues = [
|
||||
HOME_SCREEN_DEFAULT => __('Default'),
|
||||
HOME_SCREEN_VISUAL_CONSOLE => __('Visual console'),
|
||||
HOME_SCREEN_EVENT_LIST => __('Event list'),
|
||||
HOME_SCREEN_GROUP_VIEW => __('Group view'),
|
||||
HOME_SCREEN_TACTICAL_VIEW => __('Tactical view'),
|
||||
HOME_SCREEN_ALERT_DETAIL => __('Alert detail'),
|
||||
HOME_SCREEN_EXTERNAL_LINK => __('External link'),
|
||||
HOME_SCREEN_OTHER => __('Other'),
|
||||
HOME_SCREEN_DASHBOARD => __('Dashboard'),
|
||||
];
|
||||
|
||||
if (array_key_exists($values['section'], $homeScreenValues) === true) {
|
||||
$values['section'] = $homeScreenValues[$values['section']];
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$values['metaconsole_section'] = $values['section'];
|
||||
$values['metaconsole_data_section'] = $values['data_section'];
|
||||
$values['metaconsole_default_event_filter'] = $values['default_event_filter'];
|
||||
unset($values['id_skin']);
|
||||
unset($values['section']);
|
||||
unset($values['data_section']);
|
||||
unset($values['default_event_filter']);
|
||||
}
|
||||
}
|
||||
|
||||
$output = db_process_sql_update('tusuario', $values, ['id_user' => $id_user]);
|
||||
|
||||
if (isset($values['is_admin']) === true && (bool) $values['is_admin'] === true) {
|
||||
@ -1596,7 +1624,7 @@ function local_ldap_search(
|
||||
}
|
||||
|
||||
$dn = ' -b '.escapeshellarg($dn);
|
||||
$ldapsearch_command = 'ldapsearch -LLL -o ldif-wrap=no -o nettimeout='.$ldap_search_time.' -x'.$ldap_host.$ldap_version.' -E pr=10000/noprompt '.$ldap_admin_user.$ldap_admin_pass.$dn.$filter.$tls.' | grep -v "^#\|^$" | sed "s/:\+ /=>/g"';
|
||||
$ldapsearch_command = 'timeout '.$ldap_search_time.' ldapsearch -LLL -o ldif-wrap=no -o nettimeout='.$ldap_search_time.' -x'.$ldap_host.$ldap_version.' -E pr=10000/noprompt '.$ldap_admin_user.$ldap_admin_pass.$dn.$filter.$tls.' | grep -v "^#\|^$" | sed "s/:\+ /=>/g"';
|
||||
$shell_ldap_search = explode("\n", shell_exec($ldapsearch_command));
|
||||
foreach ($shell_ldap_search as $line) {
|
||||
$values = explode('=>', $line);
|
||||
|
@ -46,6 +46,8 @@ if (json_last_error() === JSON_ERROR_NONE) {
|
||||
$session_id = $data_decoded['session_id'];
|
||||
$type_graph_pdf = $data_decoded['type_graph_pdf'];
|
||||
$id_user = $data_decoded['id_user'];
|
||||
$slicebar = $data_decoded['slicebar'];
|
||||
$slicebar_value = $data_decoded['slicebar_value'];
|
||||
|
||||
$data_combined = [];
|
||||
if (isset($data_decoded['data_combined']) === true) {
|
||||
@ -64,6 +66,9 @@ global $config;
|
||||
// Care whit this!!! check_login not working if you remove this.
|
||||
$config['id_user'] = $id_user;
|
||||
$_SESSION['id_usuario'] = $id_user;
|
||||
if (!isset($config[$slicebar])) {
|
||||
$config[$slicebar] = $slicebar_value;
|
||||
}
|
||||
|
||||
// Try to initialize session using existing php session id.
|
||||
$user = new PandoraFMS\User(['phpsessionid' => $session_id]);
|
||||
|
@ -526,12 +526,14 @@ class AgentDeployWizard
|
||||
true
|
||||
);
|
||||
|
||||
$mac_installer_link = 'http://firefly.pandorafms.com/pandorafms/latest/macOS/Pandora_FMS_MacOS_agent-7.0NG.dmg';
|
||||
$mac_content_link = '<a class="green-link" style="font-size: 15px;" href="'.$mac_installer_link.'" target="_blank">'.__('Click to Download the agent').'</a>';
|
||||
html_print_div(
|
||||
[
|
||||
'id' => 'mac_installer',
|
||||
'class' => 'white_table_flex agent_details_col',
|
||||
'style' => 'margin-bottom: 20px',
|
||||
'content' => $content.$mac_warn_box,
|
||||
'content' => $content.$mac_warn_box.$mac_content_link,
|
||||
]
|
||||
);
|
||||
|
||||
@ -660,7 +662,7 @@ class AgentDeployWizard
|
||||
var group_val = $('[name="group"] option:selected').text();
|
||||
|
||||
var win_installer_command = `Invoke-WebRequest -Uri https://firefly.pandorafms.com/pandorafms/latest/Windows/Pandora%20FMS%20Windows%20Agent%20v7.0NG.x86_64.exe -OutFile \$\{env:tmp\}\\\pandora-agent-windows.exe; & \$\{env:tmp\}\\\pandora-agent-windows.exe /S --ip ${server_addr_val} --group \"${group_val}\" --remote_config 1`;
|
||||
var linux_installer_command = `export PANDORA_SERVER_IP='${server_addr_val}' && \\ \nexport PANDORA_REMOTE_CONFIG=1 && \\ \nexport PANDORA_GROUP='${group_val}' && \\ \ncurl -Ls https://pfms.me/agent-deploy | bash`;
|
||||
var linux_installer_command = `export PANDORA_SERVER_IP='${server_addr_val}' && \\\nexport PANDORA_REMOTE_CONFIG=1 && \\\nexport PANDORA_GROUP='${group_val}' && \\\ncurl -Ls https://pfms.me/agent-deploy | bash`;
|
||||
var mac_installer_text = `To complete the installation process, please perform a manual installation and configure the server IP to ${server_addr_val} and specify the group as ${group_val}. Thank you for your cooperation`;
|
||||
var linux_service_start = "/etc/init.d/pandora_agent_daemon start";
|
||||
var win_service_start = "NET START PandoraFMSAgent";
|
||||
|
@ -325,7 +325,7 @@ class AgentWizard extends HTML
|
||||
$this->wizardSection = get_parameter('wizard_section', 'snmp_explorer');
|
||||
$this->idAgent = get_parameter('id_agente', '');
|
||||
$this->idPolicy = get_parameter('id', '');
|
||||
$this->targetIp = get_parameter('targetIp', '');
|
||||
$this->targetIp = io_safe_input(trim(io_safe_output(get_parameter('targetIp', ''))));
|
||||
$this->wmiBinary = $config['wmiBinary'];
|
||||
$this->defaultSNMPValues = (array) json_decode(io_safe_output($config['agent_wizard_defaults']));
|
||||
|
||||
@ -2333,7 +2333,7 @@ class AgentWizard extends HTML
|
||||
}
|
||||
|
||||
$tmp->id_plugin($infoMacros['server_plugin']);
|
||||
$tmp->macros(json_encode($fieldsPlugin));
|
||||
$tmp->macros(io_json_mb_encode($fieldsPlugin));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2507,7 +2507,7 @@ class AgentWizard extends HTML
|
||||
}
|
||||
|
||||
$tmp->id_plugin($infoMacros['server_plugin']);
|
||||
$tmp->macros(json_encode($fieldsPlugin));
|
||||
$tmp->macros(io_json_mb_encode($fieldsPlugin));
|
||||
}
|
||||
|
||||
$tmp->ip_target(io_safe_input($this->targetIp));
|
||||
|
@ -1366,7 +1366,7 @@ class CredentialStore extends Wizard
|
||||
$('#li_snmp_2').show();
|
||||
|
||||
if ($('#li_snmp_1').length > 0) {
|
||||
$('#version').val('1');
|
||||
//$('#version').val('1');
|
||||
$('#version').trigger('change');
|
||||
} else {
|
||||
const ul = $('#modal_form').children('ul')[0];
|
||||
|
@ -209,7 +209,7 @@ class EventSound extends HTML
|
||||
$titleHeader = __('Add new sound');
|
||||
} else {
|
||||
$helpHeader = 'servers_ha_clusters_tab';
|
||||
$titleHeader = __('Accoustic console sound list');
|
||||
$titleHeader = __('Acoustic console sound list');
|
||||
}
|
||||
|
||||
// Header.
|
||||
@ -227,7 +227,7 @@ class EventSound extends HTML
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Accoustic console setup'),
|
||||
'label' => __('Acoustic console setup'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -1339,7 +1339,11 @@ class ModuleTemplates extends HTML
|
||||
function filterGroupComponents(e){
|
||||
var selectedGroup = e.target.value;
|
||||
var entireList = JSON.parse($('#hidden-group-components').val());
|
||||
var componentsToShow = entireList[selectedGroup];
|
||||
if(typeof entireList[selectedGroup] !== 'undefined'){
|
||||
var componentsToShow = entireList[selectedGroup].split(",");
|
||||
} else {
|
||||
var componentsToShow = [];
|
||||
}
|
||||
$('#add-modules-components').children().each(function(){
|
||||
var id = $(this).val();
|
||||
if (typeof componentsToShow === 'undefined' && selectedGroup != '0') {
|
||||
@ -1348,7 +1352,7 @@ class ModuleTemplates extends HTML
|
||||
$(this).css('display','block');
|
||||
} else {
|
||||
$(this).css('display','none');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -270,14 +270,28 @@ class TipsWindow
|
||||
}
|
||||
|
||||
$sql .= sprintf(' AND id_profile IN (%s)', $idProfilesFilter);
|
||||
$sql .= sprintf(' AND id_lang = "%s"', $language);
|
||||
|
||||
$sql .= ' ORDER BY CASE WHEN id_lang = "'.$language.'" THEN id_lang END DESC, RAND()';
|
||||
|
||||
$tip = db_get_row_sql($sql);
|
||||
|
||||
$check_tips = db_get_row_sql('SELECT count(*) AS tips FROM twelcome_tip WHERE id_lang = "'.$language.'"')['tips'];
|
||||
if (empty($tip) === false) {
|
||||
$tip['files'] = $this->getFilesFromTip($tip['id']);
|
||||
|
||||
$tip['title'] = io_safe_output($tip['title']);
|
||||
$tip['text'] = io_safe_output($tip['text']);
|
||||
$tip['url'] = io_safe_output($tip['url']);
|
||||
} else if ($check_tips === '0') {
|
||||
$language = 'en_GB';
|
||||
$sql = 'SELECT id, title, text, url
|
||||
FROM twelcome_tip
|
||||
WHERE enable = "1" AND id_lang = "'.$language.'"';
|
||||
$sql .= ' ORDER BY CASE WHEN id_lang = "'.$language.'" THEN id_lang END DESC, RAND()';
|
||||
$tip = db_get_row_sql($sql);
|
||||
|
||||
$tip['files'] = $this->getFilesFromTip($tip['id']);
|
||||
|
||||
$tip['title'] = io_safe_output($tip['title']);
|
||||
$tip['text'] = io_safe_output($tip['text']);
|
||||
$tip['url'] = io_safe_output($tip['url']);
|
||||
@ -311,6 +325,15 @@ class TipsWindow
|
||||
global $config;
|
||||
$profilesUser = users_get_user_profile($config['id_user']);
|
||||
$idProfilesFilter = '0';
|
||||
$userInfo = users_get_user_by_id($config['id_user']);
|
||||
$language = ($userInfo['language'] !== 'default') ? $userInfo['language'] : $config['language'];
|
||||
|
||||
$check_tips = db_get_row_sql('SELECT count(*) AS tips FROM twelcome_tip WHERE id_lang = "'.$language.'"')['tips'];
|
||||
|
||||
if ($check_tips === '0') {
|
||||
$language = 'en_GB';
|
||||
}
|
||||
|
||||
foreach ($profilesUser as $key => $profile) {
|
||||
$idProfilesFilter .= ','.$profile['id_perfil'];
|
||||
}
|
||||
@ -320,9 +343,9 @@ class TipsWindow
|
||||
WHERE enable = "1" ';
|
||||
|
||||
$sql .= sprintf(' AND id_profile IN (%s)', $idProfilesFilter);
|
||||
$sql .= sprintf(' AND id_lang = "%s"', $language);
|
||||
|
||||
$sql .= ' ORDER BY CASE WHEN id_lang = "'.$config['language'].'" THEN id_lang END DESC, RAND()';
|
||||
|
||||
$sql .= ' ORDER BY CASE WHEN id_lang = "'.$language.'" THEN id_lang END DESC, RAND()';
|
||||
return db_get_sql($sql);
|
||||
}
|
||||
|
||||
|
@ -162,7 +162,7 @@ class WebServerModuleDebug extends Wizard
|
||||
results.setReadOnly(true);
|
||||
results.setShowPrintMargin(false);
|
||||
|
||||
$("#submit-execute_query").click(function() {
|
||||
$("#button-execute_query").click(function() {
|
||||
// Show the spinner.
|
||||
showSpinner(true);
|
||||
// Empty the results container.
|
||||
|
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230517';
|
||||
$build_version = 'PC230608';
|
||||
$pandora_version = 'v7.0NG.771';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -1190,30 +1190,32 @@ function mysql_db_format_array_to_update_sql($values)
|
||||
$fields = [];
|
||||
|
||||
foreach ($values as $field => $value) {
|
||||
if (is_numeric($field)) {
|
||||
array_push($fields, $value);
|
||||
continue;
|
||||
} else if ($field[0] == '`') {
|
||||
$field = str_replace('`', '', $field);
|
||||
}
|
||||
|
||||
if ($value === null) {
|
||||
$sql = sprintf('`%s` = NULL', $field);
|
||||
} else if (is_int($value) || is_bool($value)) {
|
||||
$sql = sprintf('`%s` = %d', $field, $value);
|
||||
} else if (is_float($value) || is_double($value)) {
|
||||
$sql = sprintf('`%s` = %f', $field, $value);
|
||||
} else {
|
||||
// String
|
||||
if (isset($value[0]) && $value[0] == '`') {
|
||||
// Don't round with quotes if it references a field
|
||||
$sql = sprintf('`%s` = %s', $field, $value);
|
||||
} else {
|
||||
$sql = sprintf("`%s` = '%s'", $field, $value);
|
||||
if (is_object($value) === false) {
|
||||
if (is_numeric($field)) {
|
||||
array_push($fields, $value);
|
||||
continue;
|
||||
} else if ($field[0] == '`') {
|
||||
$field = str_replace('`', '', $field);
|
||||
}
|
||||
}
|
||||
|
||||
array_push($fields, $sql);
|
||||
if ($value === null) {
|
||||
$sql = sprintf('`%s` = NULL', $field);
|
||||
} else if (is_int($value) || is_bool($value)) {
|
||||
$sql = sprintf('`%s` = %d', $field, $value);
|
||||
} else if (is_float($value) || is_double($value)) {
|
||||
$sql = sprintf('`%s` = %f', $field, $value);
|
||||
} else {
|
||||
// String
|
||||
if (isset($value[0]) && $value[0] == '`') {
|
||||
// Don't round with quotes if it references a field
|
||||
$sql = sprintf('`%s` = %s', $field, $value);
|
||||
} else {
|
||||
$sql = sprintf("`%s` = '%s'", $field, $value);
|
||||
}
|
||||
}
|
||||
|
||||
array_push($fields, $sql);
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $fields);
|
||||
|
@ -3548,6 +3548,25 @@ function update_config_token($cfgtoken, $cfgvalue)
|
||||
}
|
||||
|
||||
|
||||
function update_check_config_token($cfgtoken, $cfgvalue)
|
||||
{
|
||||
global $config;
|
||||
db_process_sql('START TRANSACTION');
|
||||
if (isset($config[$cfgtoken])) {
|
||||
delete_config_token($cfgtoken);
|
||||
}
|
||||
|
||||
$insert = db_process_sql(sprintf("INSERT INTO tconfig (token, value) VALUES ('%s', '%s')", $cfgtoken, $cfgvalue));
|
||||
db_process_sql('COMMIT');
|
||||
if ($insert) {
|
||||
$config[$cfgtoken] = $cfgvalue;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function delete_config_token($cfgtoken)
|
||||
{
|
||||
$delete = db_process_sql(sprintf('DELETE FROM tconfig WHERE token = "%s"', $cfgtoken));
|
||||
@ -4284,6 +4303,8 @@ function generator_chart_to_pdf(
|
||||
'data_module_list' => $module_list,
|
||||
'data_combined' => $params_combined,
|
||||
'id_user' => $config['id_user'],
|
||||
'slicebar' => $_SESSION['slicebar'],
|
||||
'slicebar_value' => $config[$_SESSION['slicebar']],
|
||||
];
|
||||
} else {
|
||||
$data = [
|
||||
@ -4291,6 +4312,8 @@ function generator_chart_to_pdf(
|
||||
'session_id' => $session_id,
|
||||
'type_graph_pdf' => $type_graph_pdf,
|
||||
'id_user' => $config['id_user'],
|
||||
'slicebar' => $_SESSION['slicebar'],
|
||||
'slicebar_value' => $config[$_SESSION['slicebar']],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -9612,6 +9612,7 @@ function api_set_new_user($id, $thrash2, $other, $thrash3)
|
||||
$values['section'] = $other['data'][11];
|
||||
$values['session_time'] = $other['data'][12];
|
||||
$values['metaconsole_access_node'] = $other['data'][13];
|
||||
$values['api_token'] = api_token_generate();
|
||||
|
||||
if (empty($password) === true) {
|
||||
returnError('Password cannot be empty.');
|
||||
@ -9708,6 +9709,8 @@ function api_set_update_user($id, $thrash2, $other, $thrash3)
|
||||
if (!update_user_password($id, $other['data'][4])) {
|
||||
returnError('The user could not be updated. Password info incorrect.');
|
||||
return;
|
||||
} else {
|
||||
$values['api_token'] = api_token_generate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,22 +296,34 @@ function clippy_context_help($help=null)
|
||||
$code = str_replace('{clippy}', '#'.$id, $code);
|
||||
$code = str_replace('{clippy_obj}', 'intro_'.$id, $code);
|
||||
|
||||
$return = $code.'<div id="'.$id.'" class="inline"><a onclick="show_'.$id.'();" href="javascript: void(0);" >'.html_print_image(
|
||||
'images/clippy_icon.png',
|
||||
true
|
||||
).'</a></div>
|
||||
if ($help === 'module_unknow') {
|
||||
$img = html_print_image(
|
||||
'images/info-warning.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'style' => 'margin-left: -25px;',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$img = html_print_image(
|
||||
'images/info-warning.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
);
|
||||
}
|
||||
|
||||
$return = $code.'<div id="'.$id.'" class="inline"><a onclick="show_'.$id.'();" href="javascript: void(0);" >'.$img.'</a></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
function show_'.$id.'() {
|
||||
if (intro_'.$id.'.started()) {
|
||||
started = 1;
|
||||
}
|
||||
else {
|
||||
started = 0;
|
||||
}
|
||||
|
||||
if (started == 0)
|
||||
intro_'.$id.'.start();
|
||||
confirmDialog({
|
||||
title: "'.__('You have unknown modules in this agent.').'",
|
||||
message: "'.('Unknown modules are modules which receive data normally at least in one occassion, but at this time are not receving data. Please check our troubleshoot help page to help you determine why you have unknown modules.').'",
|
||||
strOKButton: "'.__('Close').'",
|
||||
hideCancelButton: true,
|
||||
size: 675,
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -607,6 +607,10 @@ function config_update_config()
|
||||
$error_update[] = __('Start TLS');
|
||||
}
|
||||
|
||||
if (config_update_value('recursive_search', get_parameter('recursive_search'), true) === false) {
|
||||
$error_update[] = __('Recursive search');
|
||||
}
|
||||
|
||||
if (config_update_value('ad_advanced_config', get_parameter('ad_advanced_config'), true) === false) {
|
||||
$error_update[] = __('Advanced Config AD');
|
||||
}
|
||||
@ -3082,6 +3086,10 @@ function config_process_config()
|
||||
config_update_value('ad_start_tls', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['recursive_search'])) {
|
||||
config_update_value('recursive_search', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['ad_advanced_config'])) {
|
||||
config_update_value('ad_advanced_config', 0);
|
||||
}
|
||||
|
@ -2555,3 +2555,28 @@ function db_get_column_type(string $table, string $column='')
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate sql query.
|
||||
*
|
||||
* @param string $sql Query for validate.
|
||||
*
|
||||
* @return boolean True if query is valid.
|
||||
*/
|
||||
function db_validate_sql(string $sql)
|
||||
{
|
||||
try {
|
||||
error_reporting(0);
|
||||
db_process_sql_begin();
|
||||
$result = db_process_sql(io_safe_output($sql));
|
||||
} catch (Exception $e) {
|
||||
// Catch all posible errors.
|
||||
$result = false;
|
||||
} finally {
|
||||
db_process_sql_rollback();
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
|
||||
return ($result !== false) ? true : false;
|
||||
}
|
||||
|