Merge remote-tracking branch 'origin/develop' into ent-11471-integracion-pandora-integria
This commit is contained in:
commit
5a61f074d7
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, AIX version
|
||||
# Version 7.0NG.773.1, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, FreeBSD Version
|
||||
# Version 7.0NG.773.1, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, HP-UX Version
|
||||
# Version 7.0NG.773.1, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, Solaris Version
|
||||
# Version 7.0NG.773.1, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773, AIX version
|
||||
# Version 7.0NG.773.1, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773, HPUX Version
|
||||
# Version 7.0NG.773.1, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773, Solaris version
|
||||
# Version 7.0NG.773.1, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, AIX version
|
||||
# Version 7.0NG.773.1, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.773-230821
|
||||
Version: 7.0NG.773.1-230822
|
||||
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.773-230821"
|
||||
pandora_version="7.0NG.773.1-230822"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.773"
|
||||
VERSION="7.0NG.773.1"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.1" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.1" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.773</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.773 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.773</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.773.1</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.773.1 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.773.1</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, FreeBSD Version
|
||||
# Version 7.0NG.773.1, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, HP-UX Version
|
||||
# Version 7.0NG.773.1, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2004-2023 Pandora FMS
|
||||
# https://pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, NetBSD Version
|
||||
# Version 7.0NG.773.1, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, Solaris Version
|
||||
# Version 7.0NG.773.1, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1030,8 +1030,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.773';
|
||||
use constant AGENT_BUILD => '230821';
|
||||
use constant AGENT_VERSION => '7.0NG.773.1';
|
||||
use constant AGENT_BUILD => '230822';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773
|
||||
%define release 230821
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -25,7 +25,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
|
|||
Requires: coreutils unzip
|
||||
Requires: util-linux procps grep
|
||||
Requires: /sbin/ip /bin/awk
|
||||
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip)
|
||||
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) perl(File::Copy) perl(Sys::Hostname)
|
||||
# Required by plugins
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
AutoReq: 0
|
||||
|
|
|
@ -26,9 +26,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
|
|||
Requires: coreutils unzip
|
||||
Requires: util-linux procps grep
|
||||
Requires: /sbin/ip /bin/awk
|
||||
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip)
|
||||
# Required by plugins
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
#Requires: libnsl
|
||||
AutoReq: 0
|
||||
Provides: %{name}-%{version}
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773
|
||||
%define release 230821
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773"
|
||||
PI_BUILD="230821"
|
||||
PI_VERSION="7.0NG.773.1"
|
||||
PI_BUILD="230822"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.773}
|
||||
{Pandora FMS Windows Agent v7.0NG.773.1}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230821}
|
||||
{230822}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.773 Build 230821")
|
||||
#define PANDORA_VERSION ("7.0NG.773.1 Build 230822")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Pandora FMS"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.773(Build 230821))"
|
||||
VALUE "ProductVersion", "(7.0NG.773.1(Build 230822))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.773-230821
|
||||
Version: 7.0NG.773.1-230822
|
||||
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.773-230821"
|
||||
pandora_version="7.0NG.773.1-230822"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -261,12 +261,27 @@ function agents_modules_load_js()
|
|||
}
|
||||
|
||||
function select_selected () {
|
||||
// $('#id_agents2 option').each(function(){
|
||||
// if($(this).attr('selected') === 'selected'){
|
||||
// $(this).prop('selected', true);
|
||||
// }
|
||||
// });
|
||||
var f = document.forms.filter_form;
|
||||
f.action = "index.php?sec=view&sec2=extensions/agents_modules";
|
||||
$('#filter_form').submit();
|
||||
}
|
||||
/* <![CDATA[ */
|
||||
function export_csv() {
|
||||
let group_id = $('#group_id option:selected').val();
|
||||
let module_group_id = $('#modulegroup option:selected').val();
|
||||
let agent_id = $('#id_agents2 option:selected').map((_, e) => e.value).get();
|
||||
let module_id = $('#module option:selected').map((_, e) => e.value).get();
|
||||
|
||||
let filters_array = {group_id: group_id, module_group_id:module_group_id, agent_id:agent_id, module_id:module_id}
|
||||
let jsonFilters = JSON.stringify(filters_array)
|
||||
let filters = window.btoa(jsonFilters)
|
||||
var f = document.forms.filter_form;
|
||||
|
||||
blockResubmit($(this));
|
||||
f.action = "extensions/agents_modules_csv.php?get_agents_module_csv=1&filters="+filters;
|
||||
$("#filter_form").submit();
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
@ -653,7 +668,7 @@ function mainAgentsModules()
|
|||
}
|
||||
|
||||
if ($config['pure'] != 1) {
|
||||
$show_filters = '<form method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
|
||||
$show_filters = '<form id="filter_form" method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
|
||||
$show_filters .= '<table class="filter-table-adv w100p no-border" cellpadding="4" cellspacing="4">';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td width="33%">'.$filter_type.'</td>';
|
||||
|
@ -679,6 +694,13 @@ function mainAgentsModules()
|
|||
'onclick' => 'select_selected()',
|
||||
],
|
||||
true
|
||||
).html_print_button(
|
||||
__('Export to CSV'),
|
||||
'srcbutton_csv',
|
||||
false,
|
||||
'export_csv()',
|
||||
['class' => 'secondary mini'],
|
||||
true,
|
||||
),
|
||||
],
|
||||
true
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
<?php
|
||||
/**
|
||||
* Export data.
|
||||
*
|
||||
* @category Tools
|
||||
* @package Pandora FMS
|
||||
* @subpackage Operation
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
require_once $config['homedir'].'/include/config.php';
|
||||
require_once $config['homedir'].'/include/functions_reporting.php';
|
||||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
*/
|
||||
require_once '../include/config.php';
|
||||
require_once '../include/functions_agents.php';
|
||||
require_once '../include/functions_reporting.php';
|
||||
require_once '../include/functions_modules.php';
|
||||
require_once '../include/functions_users.php';
|
||||
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
// ACL Check.
|
||||
if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Agent view (Grouped)'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$get_agents_module_csv = get_parameter('get_agents_module_csv', 0);
|
||||
|
||||
|
||||
if ($get_agents_module_csv === '1') {
|
||||
// ***************************************************
|
||||
// Header output
|
||||
// ***************************************************
|
||||
$config['ignore_callback'] = true;
|
||||
while (@ob_end_clean()) {
|
||||
}
|
||||
|
||||
$filename = 'agents_module_view_'.date('Ymd').'-'.date('His');
|
||||
|
||||
// Set cookie for download control.
|
||||
setDownloadCookieToken();
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'.csv"');
|
||||
// ***************************************************
|
||||
// Data processing
|
||||
// ***************************************************
|
||||
echo pack('C*', 0xEF, 0xBB, 0xBF);
|
||||
|
||||
$json_filters = get_parameter('filters', '');
|
||||
|
||||
$filters = json_decode(
|
||||
base64_decode(
|
||||
get_parameter('filters', '')
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
$results = export_agents_module_csv($filters);
|
||||
|
||||
$divider = $config['csv_divider'];
|
||||
$dataend = PHP_EOL;
|
||||
|
||||
$header_fields = [
|
||||
__('Agent'),
|
||||
__('Module'),
|
||||
__('Data'),
|
||||
];
|
||||
|
||||
$out_csv = '';
|
||||
foreach ($header_fields as $key => $value) {
|
||||
$out_csv .= $value.$divider;
|
||||
}
|
||||
|
||||
$out_csv .= "\n";
|
||||
|
||||
foreach ($results as $result) {
|
||||
foreach ($result as $key => $value) {
|
||||
$out_csv .= io_safe_output($value).$divider;
|
||||
}
|
||||
|
||||
$out_csv .= "\n";
|
||||
}
|
||||
|
||||
echo io_safe_output($out_csv);
|
||||
|
||||
exit;
|
||||
}
|
|
@ -366,59 +366,37 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$header_autorefresh_counter .= '</div>';
|
||||
}
|
||||
|
||||
// Button for feedback pandora.
|
||||
if (enterprise_installed() && $config['activate_feedback']) {
|
||||
$header_feedback = '<div id="feedback-icon-header">';
|
||||
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
|
||||
$header_feedback .= '<div id="msg-header" class="invisible"></div>';
|
||||
$header_feedback .= html_print_image(
|
||||
'images/send_feedback@header.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'title' => __('Feedback'),
|
||||
'id' => 'feedback-header',
|
||||
'alt' => __('Feedback'),
|
||||
'style' => 'cursor: pointer;',
|
||||
]
|
||||
);
|
||||
$header_feedback .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
// Support.
|
||||
if (enterprise_installed()) {
|
||||
$header_support_link = $config['custom_support_url'];
|
||||
$modal_box = '<div id="modal_help" class="invisible">
|
||||
<div id="modal-feedback-form" class="invisible"></div>
|
||||
<div id="msg-header" class="invisible"></div>
|
||||
<a href="https://pandorafms.com/manual" target="_blank">'.__('Pandora documentation').'</a>';
|
||||
if (enterprise_installed() === true) {
|
||||
$modal_box .= '<a href="https://support.pandorafms.com/" target="_blank">'.__('Enterprise support ').'</a>';
|
||||
$modal_box .= '<a href="#" id="feedback-header">'.__('Give us feedback').'</a>';
|
||||
} else {
|
||||
$header_support_link = 'https://pandorafms.com/forums/';
|
||||
$modal_box .= '<a href="https://pandorafms.com/community/forums/" target="_blank">'.__('Community Support').'</a>';
|
||||
}
|
||||
|
||||
$header_support = '<div id="header_support">';
|
||||
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
|
||||
$header_support .= html_print_image(
|
||||
'images/support@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Go to support'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
$header_support .= '</a></div>';
|
||||
$modal_box .= '<hr class="separator" />';
|
||||
$modal_box .= '<a href="https://github.com/pandorafms/pandorafms/issues" target="_blank">'.__('Open an issue in Github').'</a>';
|
||||
$modal_box .= '<a href="https://discord.com/invite/xVt2ruSxmr" target="_blank">'.__('Join discord community').'</a>';
|
||||
$modal_box .= '</div>';
|
||||
|
||||
// Documentation.
|
||||
$header_docu = '<div id="header_docu">';
|
||||
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
|
||||
$header_docu .= html_print_image(
|
||||
'images/documentation@header.svg',
|
||||
true,
|
||||
$modal_help = html_print_div(
|
||||
[
|
||||
'title' => __('Go to documentation'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
'id' => 'modal-help-content',
|
||||
'content' => html_print_image(
|
||||
'images/help@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Help'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
).$modal_box,
|
||||
],
|
||||
true,
|
||||
);
|
||||
$header_docu .= '</a></div>';
|
||||
|
||||
|
||||
// User.
|
||||
|
@ -472,11 +450,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
echo '</span>';
|
||||
echo '</div>';
|
||||
echo '<div class="header_center"></div>';
|
||||
echo '<div class="header_right">'.$header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
echo '<div class="header_right">'.$modal_help, $header_user, $header_logout.'</div>';
|
||||
} else {
|
||||
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
|
||||
<div class="header_center">'.$header_searchbar.'</div>
|
||||
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $modal_help, $header_user, $header_logout.'</div>';
|
||||
}
|
||||
?>
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
|
@ -554,6 +532,54 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
element.style.display = "none"
|
||||
}
|
||||
|
||||
function notifications_clean_all() {
|
||||
let wrapper_inner = document.getElementById('notification-wrapper-inner');
|
||||
while (wrapper_inner.firstChild) {
|
||||
wrapper_inner.removeChild(wrapper_inner.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
function mark_all_notification_as_read() {
|
||||
jQuery.post ("ajax.php",
|
||||
{
|
||||
"page" : "godmode/setup/setup_notifications",
|
||||
"mark_all_notification_as_read" : 1
|
||||
},
|
||||
function (data, status) {
|
||||
notifications_clean_all();
|
||||
location.reload();
|
||||
},
|
||||
"json"
|
||||
)
|
||||
.fail(function(xhr, textStatus, errorThrown){
|
||||
console.error(
|
||||
"Failed to mark al notification as read. Error: ",
|
||||
xhr.responseText
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function filter_notification() {
|
||||
let notification_type = '';
|
||||
$('.notification-item').hide();
|
||||
$(".checkbox_filter_notifications:checkbox:checked").each(function() {
|
||||
notification_type = $(this).val();
|
||||
console.log(notification_type);
|
||||
$('.notification-item[value='+notification_type+']').show();
|
||||
if (notification_type == 'All'){
|
||||
$('.notification-item').show();
|
||||
}
|
||||
});
|
||||
|
||||
if (notification_type == 'All'){
|
||||
$('.notification-item').show();
|
||||
}
|
||||
|
||||
if (notification_type == ''){
|
||||
$('.notification-item').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function click_on_notification_toast(event) {
|
||||
var match = /notification-(.*)-id-([0-9]+)/.exec(event.target.id);
|
||||
if (!match) {
|
||||
|
@ -960,8 +986,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
<?php if (enterprise_installed()) { ?>
|
||||
// Feedback.
|
||||
$("#feedback-header").click(function () {
|
||||
// Clean DOM.
|
||||
$("#feedback-header").empty();
|
||||
// Function charge Modal.
|
||||
show_feedback();
|
||||
});
|
||||
|
@ -1067,6 +1091,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(document).click(function(event) {
|
||||
if (!$(event.target).closest('#modal-help-content').length &&
|
||||
$('#modal_help').hasClass('invisible') === false) {
|
||||
$('#modal_help').addClass('invisible');
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal-help-content').on('click', (e) => {
|
||||
if($(e.target).prop('tagName') === 'A') {
|
||||
$('#modal_help').addClass('invisible');
|
||||
} else {
|
||||
$('#modal_help').removeClass('invisible');
|
||||
}
|
||||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -24,6 +24,14 @@ if (! check_acl($config['id_user'], 0, 'AR')
|
|||
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
ui_require_javascript_file('pandora_alerts');
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
|
||||
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('pandora_fullcalendar');
|
||||
|
||||
|
||||
/**
|
||||
* Mask class names.
|
||||
|
@ -204,3 +212,115 @@ if ($classname_selected === null) {
|
|||
|
||||
Wizard::printBigButtonsList($wiz_data);
|
||||
}
|
||||
|
||||
$is_management_allowed = is_management_allowed();
|
||||
$task_id = get_parameter('task', '');
|
||||
if ($task_id !== '') {
|
||||
$task = db_get_row_filter(
|
||||
'tuser_task_scheduled',
|
||||
['id' => $task_id]
|
||||
);
|
||||
$args = unserialize($task['args']);
|
||||
$event_calendar = io_safe_output($args['weekly_schedule']);
|
||||
} else {
|
||||
$event_calendar = '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("#table-new-job-3").hide();
|
||||
var edit = '<?php echo $task_id; ?>';
|
||||
if (edit != '') {
|
||||
exec_calendar();
|
||||
}
|
||||
|
||||
$("#scheduled").change(exec_calendar);
|
||||
|
||||
function exec_calendar() {
|
||||
if ($("#scheduled").val() == "weekly") {
|
||||
var is_management_allowed = parseInt('<?php echo (int) $is_management_allowed; ?>');
|
||||
var eventsBBDD = '<?php echo $event_calendar; ?>';
|
||||
var events = loadEventBBDD(eventsBBDD);
|
||||
var calendarEl = document.getElementById('calendar_map');
|
||||
|
||||
var options = {
|
||||
contentHeight: "auto",
|
||||
headerToolbar: {
|
||||
left: "",
|
||||
center: "",
|
||||
right: is_management_allowed === 0 ? '' : "timeGridWeek,dayGridWeek"
|
||||
},
|
||||
buttonText: {
|
||||
dayGridWeek: '<?php echo __('Simple'); ?>',
|
||||
timeGridWeek: '<?php echo __('Detailed'); ?>'
|
||||
},
|
||||
dayHeaderFormat: { weekday: "short" },
|
||||
initialView: "dayGridWeek",
|
||||
navLinks: false,
|
||||
selectable: true,
|
||||
selectMirror: true,
|
||||
slotDuration: "01:00:00",
|
||||
slotLabelInterval: "02:00:00",
|
||||
snapDuration: "01:00:00",
|
||||
slotMinTime: "00:00:00",
|
||||
slotMaxTime: "24:00:00",
|
||||
scrollTime: "01:00:00",
|
||||
locale: "en-GB",
|
||||
firstDay: 1,
|
||||
eventTimeFormat: {
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
hour12: false
|
||||
},
|
||||
eventColor: "#82b92e",
|
||||
editable: is_management_allowed === 0 ? false : true,
|
||||
dayMaxEvents: 3,
|
||||
dayPopoverFormat: { weekday: "long" },
|
||||
defaultAllDay: false,
|
||||
displayEventTime: true,
|
||||
displayEventEnd: true,
|
||||
selectOverlap: false,
|
||||
eventOverlap: false,
|
||||
allDaySlot: true,
|
||||
droppable: false,
|
||||
select: is_management_allowed === 0 ? false : select_alert_template,
|
||||
selectAllow: is_management_allowed === 0 ? false : selectAllow_alert_template,
|
||||
eventAllow: is_management_allowed === 0 ? false : eventAllow_alert_template,
|
||||
eventDrop: is_management_allowed === 0 ? false : eventDrop_alert_template,
|
||||
eventDragStop: is_management_allowed === 0 ? false : eventDragStop_alert_template,
|
||||
eventResize: is_management_allowed === 0 ? false : eventResize_alert_template,
|
||||
eventMouseEnter: is_management_allowed === 0 ? false : eventMouseEnter_alert_template,
|
||||
eventMouseLeave: is_management_allowed === 0 ? false : eventMouseLeave_alert_template,
|
||||
eventClick: is_management_allowed === 0 ? false : eventClick_alert_template,
|
||||
};
|
||||
|
||||
var settings = {
|
||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
||||
timeText: '<?php echo __('Time'); ?>',
|
||||
hourText: '<?php echo __('Hour'); ?>',
|
||||
minuteText: '<?php echo __('Minute'); ?>',
|
||||
secondText: '<?php echo __('Second'); ?>',
|
||||
currentText: '<?php echo __('Now'); ?>',
|
||||
closeText: '<?php echo __('Close'); ?>',
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
removeText: '<?php echo __('Remove'); ?>',
|
||||
userLanguage: '<?php echo get_user_language(); ?>',
|
||||
loadingText: '<?php echo __('Loading, this operation might take several minutes...'); ?>',
|
||||
tooltipText: '<?php echo __('Drag out to remove'); ?>',
|
||||
alert: '<?php echo __('Alert'); ?>'
|
||||
}
|
||||
|
||||
var calendar = fullCalendarPandora(calendarEl, options, settings, events);
|
||||
calendar.render();
|
||||
|
||||
$("#table-new-job-3").show();
|
||||
$('.fc-event-title').hide();
|
||||
$(".fc-button-active" ).trigger( "click" );
|
||||
} else {
|
||||
$("#calendar_map").html();
|
||||
$("#table-new-job-3").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -187,6 +187,27 @@ if (get_parameter('mark_notification_as_read', 0)) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (get_parameter('mark_all_notification_as_read', 0)) {
|
||||
$unread_messages = db_get_all_rows_sql('SELECT id_mensaje FROM tnotification_user WHERE utimestamp_read is NULL');
|
||||
|
||||
if ($unread_messages !== false) {
|
||||
foreach ($unread_messages as $messages) {
|
||||
messages_process_read($messages['id_mensaje']);
|
||||
}
|
||||
|
||||
$result = true;
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
// If there is new messages, get the info.
|
||||
echo json_encode(
|
||||
['result' => $result]
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (get_parameter('get_notifications_dropdown', 0)) {
|
||||
echo notifications_print_dropdown();
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?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>help_pandora</title>
|
||||
<g id="help_pandora" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10,0 C15.4050388,0 20,1.5951272 20,5.39448104 L20,14.605519 C20,18.4048728 15.4050388,20 10,20 C4.59496118,20 0,18.4048728 0,14.605519 L0,5.39448104 C0,1.5951272 4.59496118,0 10,0 Z M9.79831933,13.1716621 C8.99159664,13.1716621 8.35294118,13.8092643 8.35294118,14.5940054 C8.35294118,15.3623978 8.99159664,16 9.79831933,16 C10.605042,16 11.2605042,15.3623978 11.2605042,14.5940054 C11.2605042,13.8092643 10.605042,13.1716621 9.79831933,13.1716621 Z M9.91596639,4 C7.46218487,4 6,5.61852861 6,7.53133515 C6,7.74386921 6.01680672,7.98910082 6.06722689,8.21798365 L8.42016807,8.29972752 C8.40336134,8.23433243 8.3697479,8.07084469 8.3697479,7.69482289 C8.3697479,6.92643052 8.94117647,6.15803815 9.91596639,6.15803815 C10.9243697,6.15803815 11.4117647,6.77929155 11.4117647,7.41689373 C11.4117647,7.84196185 11.2605042,8.23433243 10.8067227,8.5613079 L9.94957983,9.18256131 C8.99159664,9.88555858 8.67226891,10.719346 8.67226891,11.4877384 C8.67226891,11.7493188 8.68907563,11.9782016 8.7394958,12.2070845 L10.7394958,12.2070845 C10.7394958,11.4713896 11.1428571,11.0463215 11.7310924,10.6212534 L12.3697479,10.1634877 C13.3781513,9.42779292 14,8.52861035 14,7.22070845 C14,5.58583106 12.6386555,4 9.91596639,4 Z" id="Mask" fill="#3F3F3F"></path>
|
||||
<g id="?" transform="translate(6, 4)"></g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
|
@ -1444,6 +1444,7 @@ if ($add_comment === true) {
|
|||
if ($change_status === true) {
|
||||
$event_ids = get_parameter('event_ids');
|
||||
$new_status = get_parameter('new_status');
|
||||
$group_rep = (int) get_parameter('group_rep', 0);
|
||||
$server_id = 0;
|
||||
if (is_metaconsole() === true) {
|
||||
$server_id = (int) get_parameter('server_id');
|
||||
|
@ -1457,10 +1458,19 @@ if ($change_status === true) {
|
|||
$node->connect();
|
||||
}
|
||||
|
||||
$return = events_change_status(
|
||||
explode(',', $event_ids),
|
||||
$new_status
|
||||
);
|
||||
if ($group_rep !== 3) {
|
||||
$return = events_change_status(
|
||||
explode(',', $event_ids),
|
||||
$new_status
|
||||
);
|
||||
} else {
|
||||
// Update all elements with same extraid.
|
||||
$return = events_update_status(
|
||||
$event_ids,
|
||||
(int) $new_status,
|
||||
['group_rep' => $group_rep]
|
||||
);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
|
|
|
@ -169,6 +169,7 @@ class ConsoleSupervisor
|
|||
* NOTIF.PHP.DISABLE_FUNCTIONS
|
||||
* NOTIF.PHP.CHROMIUM
|
||||
* NOTIF.PHP.VERSION
|
||||
* NOTIF.PHP.VERSION.SUPPORT
|
||||
*/
|
||||
|
||||
$this->checkPHPSettings();
|
||||
|
@ -210,6 +211,12 @@ class ConsoleSupervisor
|
|||
|
||||
$this->checkUpdateManagerRegistration();
|
||||
|
||||
/*
|
||||
* Check if has API access.
|
||||
* NOTIF.API.ACCESS
|
||||
*/
|
||||
$this->checkApiAccess();
|
||||
|
||||
/*
|
||||
* Check if there're new messages in UM.
|
||||
* NOTIF.UPDATEMANAGER.MESSAGES
|
||||
|
@ -377,6 +384,7 @@ class ConsoleSupervisor
|
|||
* NOTIF.PHP.DISABLE_FUNCTIONS
|
||||
* NOTIF.PHP.CHROMIUM
|
||||
* NOTIF.PHP.VERSION
|
||||
* NOTIF.PHP.VERSION.SUPPORT
|
||||
*/
|
||||
|
||||
$this->checkPHPSettings();
|
||||
|
@ -434,6 +442,12 @@ class ConsoleSupervisor
|
|||
|
||||
$this->checkUpdateManagerRegistration();
|
||||
|
||||
/*
|
||||
* Check if has API access.
|
||||
* NOTIF.API.ACCESS
|
||||
*/
|
||||
$this->checkApiAccess();
|
||||
|
||||
/*
|
||||
* Check if event storm protection is activated.
|
||||
* NOTIF.MISC.EVENTSTORMPROTECTION
|
||||
|
@ -498,6 +512,12 @@ class ConsoleSupervisor
|
|||
|
||||
$this->checkUpdateManagerRegistration();
|
||||
|
||||
/*
|
||||
* Check if has API access.
|
||||
* NOTIF.API.ACCESS
|
||||
*/
|
||||
$this->checkApiAccess();
|
||||
|
||||
/*
|
||||
* Check if there're new messages in UM.
|
||||
* NOTIF.UPDATEMANAGER.MESSAGES
|
||||
|
@ -856,6 +876,7 @@ class ConsoleSupervisor
|
|||
case 'NOTIF.PHP.DISABLE_FUNCTIONS':
|
||||
case 'NOTIF.PHP.CHROMIUM':
|
||||
case 'NOTIF.PHP.VERSION':
|
||||
case 'NOTIF.PHP.VERSION.SUPPORT':
|
||||
case 'NOTIF.HISTORYDB':
|
||||
case 'NOTIF.PANDORADB':
|
||||
case 'NOTIF.PANDORADB.HISTORICAL':
|
||||
|
@ -864,6 +885,7 @@ class ConsoleSupervisor
|
|||
case 'NOTIF.METACONSOLE.DB_CONNECTION':
|
||||
case 'NOTIF.DOWNTIME':
|
||||
case 'NOTIF.UPDATEMANAGER.REGISTRATION':
|
||||
case 'NOTIF.API.ACCESS':
|
||||
case 'NOTIF.MISC.EVENTSTORMPROTECTION':
|
||||
case 'NOTIF.MISC.DEVELOPBYPASS':
|
||||
case 'NOTIF.MISC.FONTPATH':
|
||||
|
@ -1811,14 +1833,14 @@ class ConsoleSupervisor
|
|||
$url = 'https://www.php.net/supported-versions.php';
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.PHP.VERSION',
|
||||
'type' => 'NOTIF.PHP.VERSION.SUPPORT',
|
||||
'title' => __('PHP UPDATE REQUIRED'),
|
||||
'message' => __('You should update your PHP version because it will be out of official support').'<br>'.__('Current PHP version: ').PHP_VERSION,
|
||||
'url' => $url,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.PHP.VERSION');
|
||||
$this->cleanNotifications('NOTIF.PHP.VERSION.SUPPORT');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2366,6 +2388,30 @@ class ConsoleSupervisor
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if has access to the API
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkApiAccess()
|
||||
{
|
||||
global $config;
|
||||
include_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
||||
if (update_manager_verify_api() === false) {
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.API.ACCESS',
|
||||
'title' => __('Cannot access the Pandora FMS API '),
|
||||
'message' => __('Please check the configuration, some components may fail due to this misconfiguration.'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.API.ACCESS');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if user 'admin' is enabled and using default password.
|
||||
*
|
||||
|
|
|
@ -122,10 +122,11 @@ class Tree
|
|||
public function setFilter($filter)
|
||||
{
|
||||
// There is not module filter in metaconsole.
|
||||
if (is_metaconsole()) {
|
||||
/*
|
||||
if (is_metaconsole()) {
|
||||
$filter['searchModule'] = '';
|
||||
$filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS;
|
||||
}
|
||||
}*/
|
||||
|
||||
$this->filter = $filter;
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230821';
|
||||
$pandora_version = 'v7.0NG.773';
|
||||
$build_version = 'PC230822';
|
||||
$pandora_version = 'v7.0NG.773.1';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
|
|
@ -477,7 +477,7 @@ function events_update_status($id_evento, $status, $filter=null)
|
|||
{
|
||||
global $config;
|
||||
|
||||
if (!$status) {
|
||||
if (!$status && $status !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1762,11 +1762,9 @@ function events_get_all(
|
|||
}
|
||||
}
|
||||
|
||||
$string_metaconsole_connections = implode(',', $metaconsole_connections);
|
||||
$explode_metaconsole_connections = explode(',', $string_metaconsole_connections);
|
||||
$result_meta = Promise\wait(
|
||||
parallelMap(
|
||||
$explode_metaconsole_connections,
|
||||
$metaconsole_connections,
|
||||
function ($node_int) use ($sql, $history) {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
|
@ -3540,11 +3538,15 @@ function events_page_responses($event)
|
|||
);
|
||||
|
||||
if ($status_blocked === false) {
|
||||
if (isset($event['server_id']) === false) {
|
||||
$event['server_id'] = '0';
|
||||
}
|
||||
|
||||
$data[2] = html_print_button(
|
||||
__('Update'),
|
||||
'status_button',
|
||||
false,
|
||||
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].');',
|
||||
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].', '.$event['group_rep'].');',
|
||||
[
|
||||
'icon' => 'next',
|
||||
'mode' => 'link',
|
||||
|
|
|
@ -2904,6 +2904,8 @@ function html_print_anchor(
|
|||
|
||||
$output .= '>';
|
||||
|
||||
$output .= (isset($options['text']) === true) ? $options['text'] : '';
|
||||
|
||||
$output .= (isset($options['content']) === true) ? io_safe_input_html($options['content']) : '';
|
||||
|
||||
$output .= '</a>';
|
||||
|
@ -7136,6 +7138,7 @@ function html_print_menu_button(array $options, bool $return=false)
|
|||
'class' => ($options['class'] ?? ''),
|
||||
'style' => ($options['style'] ?? ''),
|
||||
'onClick' => ($options['onClick'] ?? ''),
|
||||
'text' => ($options['text'] ?? ''),
|
||||
'content' => $content,
|
||||
],
|
||||
$return
|
||||
|
|
|
@ -4687,3 +4687,75 @@ function get_agent_module_childs(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function for export a csv file from Agents/Module view
|
||||
*
|
||||
* @param array $filters Data from agents/module filter.
|
||||
*
|
||||
* @return array Returns the data that will be saved in the csv file
|
||||
*/
|
||||
function export_agents_module_csv($filters)
|
||||
{
|
||||
$query_filter = '';
|
||||
foreach ($filters as $key => $filter) {
|
||||
switch ($key) {
|
||||
case 'group_id':
|
||||
if ($filter != 0) {
|
||||
$query_filter .= ' AND ta.id_grupo = '.$filter.' ';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'module_group_id':
|
||||
if ($filter != 0) {
|
||||
$query_filter .= ' AND tam.id_module_group = '.$filter.' ';
|
||||
;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'agent_id':
|
||||
if (count($filter) > 0) {
|
||||
$agent_filter = '('.implode(', ', $filter).')';
|
||||
$query_filter .= ' AND ta.id_agente IN '.$agent_filter.' ';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'module_id':
|
||||
if (count($filter) > 0) {
|
||||
if (is_numeric($filter[0]) === false) {
|
||||
foreach ($filter as $key => $module) {
|
||||
$filter[$key] = io_safe_input($module);
|
||||
}
|
||||
|
||||
$module_filter = '(\''.implode("', '", $filter).'\')';
|
||||
$query_filter .= ' AND tam.nombre IN '.$module_filter.' ';
|
||||
} else {
|
||||
$module_filter = '('.implode(', ', $filter).')';
|
||||
$query_filter .= ' AND tam.id_tipo_modulo IN '.$module_filter.' ';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Query fields result.
|
||||
$query = sprintf(
|
||||
'SELECT ta.alias as agent, tam.nombre as module, tae.datos as data
|
||||
FROM tagente_modulo as tam
|
||||
INNER JOIN tagente as ta ON tam.id_agente = ta.id_agente
|
||||
INNER JOIN tagente_estado as tae ON tam.id_agente_modulo = tae.id_agente_modulo
|
||||
WHERE ta.disabled = 0
|
||||
%s
|
||||
',
|
||||
$query_filter
|
||||
);
|
||||
|
||||
$result = db_get_all_rows_sql($query);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -136,6 +136,7 @@ function notifications_get_subtypes(?string $source=null)
|
|||
'NOTIF.PHP.DISABLE_FUNCTIONS',
|
||||
'NOTIF.PHP.CHROMIUM',
|
||||
'NOTIF.PHP.VERSION',
|
||||
'NOTIF.PHP.VERSION.SUPPORT',
|
||||
'NOTIF.HISTORYDB',
|
||||
'NOTIF.PANDORADB',
|
||||
'NOTIF.PANDORADB.HISTORICAL',
|
||||
|
@ -145,6 +146,7 @@ function notifications_get_subtypes(?string $source=null)
|
|||
'NOTIF.METACONSOLE.DB_CONNECTION',
|
||||
'NOTIF.DOWNTIME',
|
||||
'NOTIF.UPDATEMANAGER.REGISTRATION',
|
||||
'NOTIF.API.ACCESS',
|
||||
'NOTIF.MISC.EVENTSTORMPROTECTION',
|
||||
'NOTIF.MISC.DEVELOPBYPASS',
|
||||
'NOTIF.MISC.FONTPATH',
|
||||
|
@ -1009,6 +1011,106 @@ function notifications_print_user_switch($source, $user, $label)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates an HTML of notification filter types.
|
||||
*
|
||||
* @return string HTML filter notification.
|
||||
*/
|
||||
function notification_filter()
|
||||
{
|
||||
$types_list[] = 'All';
|
||||
$notification_types = db_get_all_rows_sql('SELECT DISTINCT tm.subtype FROM tmensajes as tm INNER JOIN tnotification_user as tnu ON tm.id_mensaje = tnu.id_mensaje WHERE tnu.utimestamp_read IS NULL');
|
||||
if ($notification_types !== false) {
|
||||
foreach ($notification_types as $notification_type) {
|
||||
$type = explode('.', $notification_type['subtype'])[1];
|
||||
$types_list[] = $type;
|
||||
}
|
||||
}
|
||||
|
||||
$types_list = array_unique($types_list);
|
||||
$notification_filter = "<ul id='menu-filter_notification'>";
|
||||
|
||||
$notification_filter .= "<li>
|
||||
<input type='checkbox' name='filter_menu' id='filter_menu'>
|
||||
<label for='filter_menu' id='filter_menu_label'>".__('Filter').'</label>';
|
||||
|
||||
$notification_filter .= "<ul class='sublevel-filter_notification'>";
|
||||
foreach ($types_list as $type) {
|
||||
if ($type === 'All') {
|
||||
$checked = 'checked';
|
||||
} else {
|
||||
$checked = '';
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'HISTORYDB':
|
||||
$type_name = 'HISTORY DB';
|
||||
break;
|
||||
|
||||
case 'PANDORADB':
|
||||
$type_name = 'PANDORA DB';
|
||||
break;
|
||||
|
||||
case 'UPDATEMANAGER':
|
||||
$type_name = 'UPDATE MANAGER';
|
||||
break;
|
||||
|
||||
case 'ALLOWOVERRIDE':
|
||||
$type_name = 'ALLOW OVERRIDE';
|
||||
break;
|
||||
|
||||
case 'DISCOVERYTASK':
|
||||
$type_name = 'DISCOVERY TASK';
|
||||
break;
|
||||
|
||||
default:
|
||||
$type_name = $type;
|
||||
break;
|
||||
}
|
||||
|
||||
$notification_filter .= "<li><div class='item-filter'>
|
||||
<input type='checkbox'
|
||||
class='checkbox_filter_notifications'
|
||||
value=".$type."
|
||||
name='filter_".$type."'
|
||||
".$checked."
|
||||
id='filter_".$type."'>
|
||||
<label for='filter_".$type."'>".$type_name.'</label>
|
||||
</div>
|
||||
</li>';
|
||||
}
|
||||
|
||||
$notification_filter .= "<li><div class='item-filter'>";
|
||||
$notification_filter .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons w100p',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'btn_submit',
|
||||
false,
|
||||
[
|
||||
'class' => 'mini sub filter',
|
||||
'icon' => 'search mini',
|
||||
'onClick' => 'filter_notification()',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$notification_filter .= '</div>
|
||||
</li>';
|
||||
|
||||
$notification_filter .= '</ul>';
|
||||
|
||||
$notification_filter .= '</li>';
|
||||
|
||||
$notification_filter .= '</ul>';
|
||||
return $notification_filter;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates the dropdown notifications menu.
|
||||
*
|
||||
|
@ -1021,9 +1123,24 @@ function notifications_print_dropdown()
|
|||
$mess = [];
|
||||
}
|
||||
|
||||
$notification_menu = html_print_menu_button(
|
||||
[
|
||||
'href' => 'javascript:',
|
||||
'class' => 'notification_menu_actions',
|
||||
'text' => __('Mark all as read'),
|
||||
'onClick' => 'mark_all_notification_as_read()',
|
||||
],
|
||||
true
|
||||
);
|
||||
$notification_filter = notification_filter();
|
||||
|
||||
return sprintf(
|
||||
"<div id='notification-wrapper'>
|
||||
<div id='notification-wrapper-inner'>
|
||||
<div class='notificaion_menu_container'>
|
||||
<div class='menu_tab filter_notification'>%s</div>
|
||||
<div class='menu_tab notification_menu'>%s</div>
|
||||
</div>
|
||||
%s
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1033,6 +1150,8 @@ function notifications_print_dropdown()
|
|||
>
|
||||
</div>
|
||||
",
|
||||
$notification_filter,
|
||||
$notification_menu,
|
||||
array_reduce(
|
||||
$mess,
|
||||
function ($carry, $message) {
|
||||
|
@ -1092,6 +1211,8 @@ function notifications_print_dropdown_element($message_info)
|
|||
$message_info['subject'] = io_safe_input($img);
|
||||
}
|
||||
|
||||
$type = explode('.', $message_info['subtype'])[1];
|
||||
|
||||
if (strlen($body_preview) >= 170) {
|
||||
$body_preview = substr($body_preview, 0, 150);
|
||||
$body_preview .= __('. Read More...');
|
||||
|
@ -1102,6 +1223,7 @@ function notifications_print_dropdown_element($message_info)
|
|||
class='notification-item'
|
||||
onclick='%s'
|
||||
id='notification-item-id-%s'
|
||||
value='%s'
|
||||
href='%s'
|
||||
target='%s'
|
||||
>
|
||||
|
@ -1115,8 +1237,9 @@ function notifications_print_dropdown_element($message_info)
|
|||
</p>
|
||||
</div>
|
||||
</a>",
|
||||
$action.';click_on_notification_toast(event)',
|
||||
$action.'; click_on_notification_toast(event)',
|
||||
$message_info['id_mensaje'],
|
||||
$type,
|
||||
messages_get_url($message_info['id_mensaje']),
|
||||
$target,
|
||||
html_print_image('images/info.svg', true, ['style' => 'height: 40px;margin-left: -20px;margin-top: -40px;']),
|
||||
|
|
|
@ -55,6 +55,18 @@ function update_manager_verify_registration()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verifies api state.
|
||||
*
|
||||
* @return boolean Status.
|
||||
*/
|
||||
function update_manager_verify_api()
|
||||
{
|
||||
global $config;
|
||||
return (isset($config['has_api_access']) === true && $config['has_api_access'] == '1');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves current update from DB.
|
||||
*
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -217,6 +217,8 @@ function initialiceLayout(data) {
|
|||
success: function(widgetData) {
|
||||
// Remove spinner.
|
||||
removeSpinner(element);
|
||||
widgetData = widgetData.replace("<script", "<script");
|
||||
widgetData = widgetData.replace("</script", "</script");
|
||||
$("#widget-" + id + " .content-widget").append(widgetData);
|
||||
|
||||
$("#button-add-widget-" + id).click(function() {
|
||||
|
|
|
@ -322,7 +322,7 @@ function perform_response(response, response_id, index = "") {
|
|||
}
|
||||
|
||||
// Change the status of an event to new, in process or validated.
|
||||
function event_change_status(event_ids, server_id) {
|
||||
function event_change_status(event_ids, server_id, group_rep) {
|
||||
var new_status = $("#estado").val();
|
||||
|
||||
$("#button-status_button").attr("disabled", "disabled");
|
||||
|
@ -334,7 +334,8 @@ function event_change_status(event_ids, server_id) {
|
|||
change_status: 1,
|
||||
event_ids: event_ids,
|
||||
new_status: new_status,
|
||||
server_id: server_id
|
||||
server_id: server_id,
|
||||
group_rep: group_rep
|
||||
},
|
||||
type: "POST",
|
||||
url: getUrlAjax(),
|
||||
|
|
|
@ -340,6 +340,7 @@ class GroupsStatusWidget extends Widget
|
|||
|
||||
// Head agents.
|
||||
$table->data[0][0] = '<span>';
|
||||
|
||||
$table->data[0][0] .= html_print_image(
|
||||
'images/agent.png',
|
||||
true,
|
||||
|
@ -359,38 +360,70 @@ class GroupsStatusWidget extends Widget
|
|||
$table->data[0][1] .= '</span>';
|
||||
|
||||
if ($stats['total_agents'] !== 0) {
|
||||
if (is_metaconsole() === true) {
|
||||
$agentdetail_url = $url.'&statusAgent=';
|
||||
} else {
|
||||
$agentdetail_url = $url.'&status=';
|
||||
}
|
||||
|
||||
// Agent Critical.
|
||||
$table->data[1][0] = $this->getCellCounter(
|
||||
$agent_url = '';
|
||||
$agent_url .= $agentdetail_url.'1';
|
||||
$agent_data = '<a href="'.$agent_url.'">';
|
||||
$agent_data .= $this->getCellCounter(
|
||||
$stats['agent_critical'],
|
||||
'',
|
||||
'bg_ff5'
|
||||
);
|
||||
$agent_data .= '</a>';
|
||||
|
||||
$table->data[1][0] = $agent_data;
|
||||
|
||||
// Agent Warning.
|
||||
$table->data[2][0] = $this->getCellCounter(
|
||||
$agent_url = '';
|
||||
$agent_url .= $agentdetail_url.'2';
|
||||
$agent_data = '<a href="'.$agent_url.'">';
|
||||
$agent_data .= $this->getCellCounter(
|
||||
$stats['agent_warning'],
|
||||
'',
|
||||
'bg_ffd'
|
||||
);
|
||||
$agent_data .= '</a>';
|
||||
$table->data[2][0] = $agent_data;
|
||||
|
||||
// Agent OK.
|
||||
$table->data[3][0] = $this->getCellCounter(
|
||||
$agent_url = '';
|
||||
$agent_url .= $agentdetail_url.'0';
|
||||
$agent_data = '<a href="'.$agent_url.'">';
|
||||
$agent_data .= $this->getCellCounter(
|
||||
$stats['agent_ok'],
|
||||
'',
|
||||
'bg_82B92E'
|
||||
);
|
||||
$agent_data .= '</a>';
|
||||
$table->data[3][0] = $agent_data;
|
||||
|
||||
// Agent Unknown.
|
||||
$table->data[1][1] = $this->getCellCounter(
|
||||
$agent_url = '';
|
||||
$agent_url .= $agentdetail_url.'3';
|
||||
$agent_data = '<a href="'.$agent_url.'">';
|
||||
$agent_data .= $this->getCellCounter(
|
||||
$stats['agent_unknown'],
|
||||
'#B2B2B2'
|
||||
);
|
||||
$agent_data .= '</a>';
|
||||
$table->data[1][1] = $agent_data;
|
||||
|
||||
// Agent Not Init.
|
||||
$table->data[2][1] = $this->getCellCounter(
|
||||
$agent_url = '';
|
||||
$agent_url .= $agentdetail_url.'5';
|
||||
$agent_data = '<a href="'.$agent_url.'">';
|
||||
$agent_data .= $this->getCellCounter(
|
||||
$stats['agent_not_init'],
|
||||
'#4a83f3'
|
||||
);
|
||||
$agent_data .= '</a>';
|
||||
$table->data[2][1] = $agent_data;
|
||||
|
||||
$data .= html_print_table($table, true);
|
||||
$data .= '</div>';
|
||||
|
@ -436,38 +469,69 @@ class GroupsStatusWidget extends Widget
|
|||
$table->data[0][1] .= '</b>';
|
||||
$table->data[0][1] .= '</span>';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$monitordetail_url = $url.'&statusModule=';
|
||||
} else {
|
||||
$monitordetail_url = 'index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group='.$this->values['groupId'].'&status=';
|
||||
}
|
||||
|
||||
// Modules Critical.
|
||||
$table->data[1][0] = $this->getCellCounter(
|
||||
$module_url = '';
|
||||
$module_url .= $monitordetail_url.'1';
|
||||
$module_data = '<a href="'.$module_url.'">';
|
||||
$module_data .= $this->getCellCounter(
|
||||
$stats['monitor_critical'],
|
||||
'',
|
||||
'bg_ff5'
|
||||
);
|
||||
$module_data .= '</a>';
|
||||
$table->data[1][0] = $module_data;
|
||||
|
||||
// Modules Warning.
|
||||
$table->data[2][0] = $this->getCellCounter(
|
||||
$module_url = '';
|
||||
$module_url .= $monitordetail_url.'2';
|
||||
$module_data = '<a href="'.$module_url.'">';
|
||||
$module_data .= $this->getCellCounter(
|
||||
$stats['monitor_warning'],
|
||||
'',
|
||||
'bg_ffd'
|
||||
);
|
||||
$module_data .= '</a>';
|
||||
$table->data[2][0] = $module_data;
|
||||
|
||||
// Modules OK.
|
||||
$table->data[3][0] = $this->getCellCounter(
|
||||
$module_url = '';
|
||||
$module_url .= $monitordetail_url.'0';
|
||||
$module_data = '<a href="'.$module_url.'">';
|
||||
$module_data .= $this->getCellCounter(
|
||||
$stats['monitor_ok'],
|
||||
'',
|
||||
'bg_82B92E'
|
||||
);
|
||||
$module_data .= '</a>';
|
||||
$table->data[3][0] = $module_data;
|
||||
|
||||
// Modules Unknown.
|
||||
$table->data[1][1] = $this->getCellCounter(
|
||||
$module_url = '';
|
||||
$module_url .= $monitordetail_url.'3';
|
||||
$module_data = '<a href="'.$module_url.'">';
|
||||
$module_data .= $this->getCellCounter(
|
||||
$stats['monitor_unknown'],
|
||||
'#B2B2B2'
|
||||
);
|
||||
$module_data .= '</a>';
|
||||
$table->data[1][1] = $module_data;
|
||||
|
||||
// Modules Not Init.
|
||||
$table->data[2][1] = $this->getCellCounter(
|
||||
$module_url = '';
|
||||
$module_url .= $monitordetail_url.'5';
|
||||
$module_data = '<a href="'.$module_url.'">';
|
||||
$module_data .= $this->getCellCounter(
|
||||
$stats['monitor_not_init'],
|
||||
'#4a83f3'
|
||||
);
|
||||
$module_data .= '</a>';
|
||||
$table->data[2][1] = $module_data;
|
||||
|
||||
$data .= html_print_table($table, true);
|
||||
$data .= '</div>';
|
||||
|
|
|
@ -1535,7 +1535,45 @@ div#head {
|
|||
input.datos {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
#modal_help {
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
right: 32px;
|
||||
background: white;
|
||||
display: flex;
|
||||
min-width: 160px;
|
||||
flex-direction: column;
|
||||
filter: drop-shadow(1px 2px 2px #0000005e);
|
||||
padding: 10px 0px;
|
||||
}
|
||||
#modal-help-content {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
#modal_help a {
|
||||
margin: 3px 0px;
|
||||
padding: 0px 15px;
|
||||
}
|
||||
#modal_help a:hover {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
#modal_help .separator {
|
||||
width: 100%;
|
||||
opacity: 0.4;
|
||||
}
|
||||
#modal_help::before {
|
||||
content: "";
|
||||
border: 8px solid #0000;
|
||||
border-bottom: 8px solid white;
|
||||
left: auto;
|
||||
right: -16px;
|
||||
top: 5px;
|
||||
position: absolute;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
#modal_help.invisible {
|
||||
display: none;
|
||||
}
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
* - REPORTS -
|
||||
|
@ -12320,6 +12358,84 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
|
|||
width: 100% !important;
|
||||
}
|
||||
|
||||
.notificaion_menu_container {
|
||||
display: flex;
|
||||
padding-top: 10px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
.notification_menu {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.filter_notification {
|
||||
width: auto;
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
#menu-filter_notification * {
|
||||
list-style: none;
|
||||
}
|
||||
#menu-filter_notification li {
|
||||
line-height: 180%;
|
||||
}
|
||||
#menu-filter_notification input[name="filter_menu"] {
|
||||
position: absolute;
|
||||
left: -1000em;
|
||||
}
|
||||
#menu-filter_notification label[id="filter_menu_label"]:before {
|
||||
content: "\025b8";
|
||||
margin-right: 4px;
|
||||
}
|
||||
#menu-filter_notification
|
||||
input[name="filter_menu"]:checked
|
||||
~ label[id="filter_menu_label"]:before {
|
||||
content: "\025be";
|
||||
}
|
||||
#menu-filter_notification .sublevel-filter_notification {
|
||||
display: none;
|
||||
}
|
||||
#menu-filter_notification input[name="filter_menu"]:checked ~ ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.item-filter > label {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.item-filter > input[type="checkbox"] {
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/*Horizontal tree*/
|
||||
|
||||
.horizontal_tree-icon {
|
||||
position: absolute;
|
||||
background: #f4f4f4;
|
||||
margin-top: 140px;
|
||||
margin-left: 15px;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.horizontal_tree-icon-sunburst {
|
||||
position: absolute;
|
||||
background: #f4f4f4;
|
||||
margin-top: 40px;
|
||||
/*margin-left: 15px;*/
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.tree-icon {
|
||||
position: absolute;
|
||||
background: #f4f4f4;
|
||||
margin-top: 140px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.label_agent_service > label {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
|
|
@ -1851,3 +1851,10 @@ a.pandora_pagination,
|
|||
color: #fff !important;
|
||||
background-color: #333 !important;
|
||||
}
|
||||
|
||||
#modal_help {
|
||||
background: #222222;
|
||||
}
|
||||
#modal_help::before {
|
||||
border-bottom: 8px solid #222222;
|
||||
}
|
||||
|
|
|
@ -130,8 +130,8 @@
|
|||
</div>
|
||||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.773';
|
||||
$build = '230821';
|
||||
$version = '7.0NG.773.1';
|
||||
$build = '230822';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
|
|
@ -157,6 +157,10 @@ try {
|
|||
throw new Exception('Invalid filter. ['.$plain_filter.']');
|
||||
}
|
||||
|
||||
if (key_exists('server_id', $filter) === true && is_array($filter['server_id']) === false) {
|
||||
$filter['server_id'] = explode(',', $filter['server_id']);
|
||||
}
|
||||
|
||||
$filter['csv_all'] = true;
|
||||
|
||||
$names = events_get_column_names($column_names);
|
||||
|
|
|
@ -291,47 +291,46 @@ if (is_metaconsole() === true) {
|
|||
);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
// Module filter.
|
||||
$module_status_arr = [];
|
||||
$module_status_arr[-1] = __('All');
|
||||
// Default.
|
||||
$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
|
||||
$module_status_arr['fired'] = __('Fired alerts');
|
||||
// if (is_metaconsole() === false) {
|
||||
// Module filter.
|
||||
$module_status_arr = [];
|
||||
$module_status_arr[-1] = __('All');
|
||||
// Default.
|
||||
$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
|
||||
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
|
||||
$module_status_arr['fired'] = __('Fired alerts');
|
||||
|
||||
$table->data['last_row'][] = html_print_label_input_block(
|
||||
__('Search module'),
|
||||
html_print_input_text('search_module', $search_module, '', 25, 30, true)
|
||||
);
|
||||
$table->data['last_row'][] = html_print_label_input_block(
|
||||
__('Search module'),
|
||||
html_print_input_text('search_module', $search_module, '', 25, 30, true)
|
||||
);
|
||||
|
||||
$table->data['last_row'][] = html_print_label_input_block(
|
||||
__('Show not init modules'),
|
||||
html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true)
|
||||
);
|
||||
|
||||
$table->data['last_row'][] = html_print_label_input_block(
|
||||
__('Module status'),
|
||||
html_print_select(
|
||||
$module_status_arr,
|
||||
'status_module',
|
||||
$status_module,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
}
|
||||
$table->data['last_row'][] = html_print_label_input_block(
|
||||
__('Show not init modules'),
|
||||
html_print_checkbox_switch('show_not_init_modules', $show_not_init_modules, true, true)
|
||||
);
|
||||
|
||||
$table->data['last_row'][] = html_print_label_input_block(
|
||||
__('Module status'),
|
||||
html_print_select(
|
||||
$module_status_arr,
|
||||
'status_module',
|
||||
$status_module,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
// }
|
||||
$form_html = '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$tab.'&pure='.$config['pure'].'">';
|
||||
$form_html .= html_print_table($table, true);
|
||||
$form_html .= html_print_div(
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773
|
||||
%define release 230821
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773
|
||||
%define release 230821
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.773
|
||||
%define release 230821
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773"
|
||||
PI_VERSION="7.0NG.773.1"
|
||||
FORCE=0
|
||||
DESTDIR=""
|
||||
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.773-230821
|
||||
Version: 7.0NG.773.1-230822
|
||||
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.773-230821"
|
||||
pandora_version="7.0NG.773.1-230822"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -733,15 +733,29 @@ sub main() {
|
|||
my $command = $Config{'plugin_exec'}.' 30 curl --cookie-jar /tmp/cron-session-cookies '.$curl_execution.' 2>/dev/null';
|
||||
my $exe_testing_api = `$command`;
|
||||
my @res_testing_api = split(',', $exe_testing_api);
|
||||
my $has_api_access = undef;
|
||||
|
||||
if ( $res_testing_api[0] ne 'OK' ) {
|
||||
logger(\%Config, "Warning! The server does not have access to the API, this can trigger problems in the generation of reports and graphs.", 1);
|
||||
pandora_event (\%Config, "Server does not have access to the API", 0, 0, 0, 0, 0, 'system', 0, $DBH);
|
||||
pandora_event (\%Config, "The server " . $Config{'servername'} ." cannot access the Pandora FMS API through the supplied credentials. Please check the configuration, some components may fail due to this misconfiguration. Look in the manual for the configuration tokens related to console_api_pass.", 0, 0, 0, 0, 0, 'system', 0, $DBH);
|
||||
$has_api_access = "0";
|
||||
} else {
|
||||
# Test successful.
|
||||
pandora_set_tconfig_token($DBH, 'internal_user_pass',
|
||||
pandora_input_password(\%Config, $Config{"console_pass"})
|
||||
);
|
||||
pandora_set_tconfig_token($DBH, 'internal_user', $Config{"console_user"});
|
||||
$has_api_access = "1";
|
||||
}
|
||||
|
||||
my $token = "has_api_access";
|
||||
my $prev_access = pandora_get_config_value($DBH, $token);
|
||||
|
||||
if(defined($prev_access) && $prev_access ne "") {
|
||||
db_update ($DBH, 'UPDATE tconfig SET value = ? WHERE token = ?', $has_api_access, $token);
|
||||
}
|
||||
else {
|
||||
db_insert ($DBH, 'id_config', 'INSERT INTO tconfig (token, value) VALUES (?, ?)', $token, $has_api_access);
|
||||
}
|
||||
|
||||
# Generate 'going up' events
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#############################################################################
|
||||
# Pandora FMS Server Parameters
|
||||
# Pandora FMS, the Flexible Monitoring System.
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -45,8 +45,8 @@ our @EXPORT = qw(
|
|||
);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.773";
|
||||
my $pandora_build = "230821";
|
||||
my $pandora_version = "7.0NG.773.1";
|
||||
my $pandora_build = "230822";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -2058,6 +2058,8 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
|
|||
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist#'
|
||||
);
|
||||
|
||||
$notification->{'subtype'} .= safe_input('NOTIF.DISCOVERYTASK.REVIEW');
|
||||
|
||||
$notification->{'mensaje'} = safe_input(
|
||||
'Discovery task (host&devices) \''.safe_output($self->{'task_data'}{'name'})
|
||||
.'\' has been completed. Please review the results.'
|
||||
|
|
|
@ -33,8 +33,8 @@ use base 'Exporter';
|
|||
our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.773";
|
||||
my $pandora_build = "230821";
|
||||
my $pandora_version = "7.0NG.773.1";
|
||||
my $pandora_build = "230822";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.773
|
||||
%define release 230821
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773"
|
||||
PI_BUILD="230821"
|
||||
PI_VERSION="7.0NG.773.1"
|
||||
PI_BUILD="230822"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.773 Build 230821";
|
||||
my $version = "7.0NG.773.1 Build 230822";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
@ -769,8 +769,8 @@ sub pandora_checkdb_integrity {
|
|||
|
||||
# Delete orphan data from visual console.
|
||||
log_message ('INTEGRITY', "Deleting orphan visual console items.");
|
||||
db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent NOT IN (SELECT id_agente FROM tagente)');
|
||||
db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)');
|
||||
db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agent <> 0 AND id_agent NOT IN (SELECT id_agente FROM tagente)');
|
||||
db_do ($dbh, 'DELETE FROM tlayout_data WHERE id_agente_modulo <> 0 AND id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)');
|
||||
|
||||
# Delete orphan data form deleted agents.
|
||||
# Clearl orphan data from dashboards
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.773 Build 230821";
|
||||
my $version = "7.0NG.773.1 Build 230822";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue