Merge branch 'develop' into 'ent-7594-custom-profile-acl-enterprise'

# Conflicts:
#   pandora_console/index.php
This commit is contained in:
José González 2021-06-11 13:57:10 +00:00
commit 6db03d943d
314 changed files with 86444 additions and 40054 deletions

2
.gitignore vendored
View File

@ -9,3 +9,5 @@ MYMETA.yml
**/PandoraFMS-Enterprise/pm_to_blib
**/pandora_console/attachment/cache
**/pandora_console/attachment/agents
pandora_console/.DS_Store
.DS_Store

View File

@ -1,12 +1,7 @@
* {
font-family: "Open Sans", "Noto Sans", sans-serif
}
body {
min-width: 425px;
min-height: 540px;
margin: 5px;
font-family: Tahoma, Geneva, Arial;
font-size: 10pt;
}
h1 {
@ -28,7 +23,8 @@ a:hover {
text-decoration: underline;
}
a:visited {
color: #254533; text-decoration:none;
color: #254533;
text-decoration: none;
}
a:visited:hover {
text-decoration: underline;
@ -51,8 +47,8 @@ div.main {
width: 400px;
}
div.textarea {
background-color: #D5DED5;
width: 100%
background-color: #d5ded5;
width: 100%;
}
div.e {
text-align: right;
@ -88,7 +84,6 @@ div.options_divider {
div.options_divider h2 {
margin: 20px 20px 0;
padding: 5px;
font-weight: 500;
border: 2px solid #82b92e;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
@ -233,25 +228,25 @@ button h3 {
}
.sev-Warning {
background: #FDDD30;
background: #fddd30;
color: #333;
}
.sev-Critical {
background: #F84348;
background: #f84348;
}
.sev-Informational {
background: #4CA8E0;
background: #4ca8e0;
}
.sev-Normal {
background: #84B839;
background: #84b839;
}
.sev-Maintenance {
background: #A8A8A8;
background: #a8a8a8;
}
.sev-Minor {
background: #F099A2;
background: #f099a2;
color: #333;
}
.sev-Major {
background: #C97A4A;
background: #c97a4a;
}

View File

@ -1,21 +1,42 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Wicket Alert</title>
<style type="text/css">
body { margin:0; font-family:arial; font-size:10pt }
h1 { font-weight:bold; font-size:16px; margin:2px 0 2px 4px; color:#237948; font-family:arial; }
body {
margin: 0;
font-size: 10pt;
}
h1 {
font-weight: bold;
font-size: 16px;
margin: 2px 0 2px 4px;
color: #237948;
}
a { color: #237948; text-decoration:none; }
a:hover { text-decoration:underline; }
a:visited { color: #237948; text-decoration:none; }
a:visited:hover { text-decoration:underline; }
a {
color: #237948;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:visited {
color: #237948;
text-decoration: none;
}
a:visited:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>Event Alert</h1>
<div id="e" style="background:url('images/icon.png') no-repeat 0% 50%; margin:0 4px; padding-left:50px; min-height:48px;">
<div
id="e"
style="background:url('images/icon.png') no-repeat 0% 50%; margin:0 4px; padding-left:50px; min-height:48px;"
>
<script src="js/notification.js"></script>
</div>
</body>

View File

@ -2,50 +2,97 @@ body {
min-width: 425px;
min-height: 540px;
margin: 5px;
font-family:Tahoma, Geneva, Arial;
font-size: 10pt;
}
h1 { font-weight: bold; font-size:16px; margin:2px 0px 2px 0px; color:#237948; font-family:arial }
h1 {
font-weight: bold;
font-size: 16px;
margin: 2px 0px 2px 0px;
color: #237948;
}
h2 {
color: blue;
}
label { color: #254533; text-decoration:none; }
label:hover { text-decoration:underline; }
label:visited { color: #254533; text-decoration:none; }
label:visited:hover { text-decoration:underline; }
label {
color: #254533;
text-decoration: none;
}
label:hover {
text-decoration: underline;
}
label:visited {
color: #254533;
text-decoration: none;
}
label:visited:hover {
text-decoration: underline;
}
label.text-link {
color: #254533;
text-decoration: none;
}
label.text-link :hover {
text-decoration: underline;
}
label.text-link :visited {
color: #254533;
text-decoration: none;
}
label.text-link :visited:hover {
text-decoration: underline;
}
label.text-link { color: #254533; text-decoration:none; }
label.text-link :hover { text-decoration:underline; }
label.text-link :visited { color: #254533; text-decoration:none; }
label.text-link :visited:hover { text-decoration:underline; }
span.res {
font-size: 80%;
color: #555;
}
span.res { font-size:80%; color:#555; }
image.pm { margin-right:3px;cursor:pointer; margin-top:0px; }
image.pm {
margin-right: 3px;
cursor: pointer;
margin-top: 0px;
}
.main {
background-color: white;
height: 500px;
width: 400px;
}
.textarea {
background-color : #D5DED5;
width :100%
background-color: #d5ded5;
width: 100%;
}
vbox.e {
text-align: right;
font-size: 8pt;
}
vbox.b {
background-color: white;
border: 1px solid #bababa;
margin: 5px;
padding: 4px;
}
vbox.b description label {
font-size: 10pt;
}
vbox.b description {
margin: 2px 0px 4px 0px;
color: #333;
font-size: 9pt;
}
vbox.e{ text-align:right; font-size:8pt; }
vbox.b { background-color:white; border:1px solid #BABABA; margin:5px; padding:4px; }
vbox.b description label { font-size: 10pt; }
vbox.b description { margin:2px 0px 4px 0px; color:#333; font-size:9pt; }
vbox.b vbox.items description {
margin:2px 0px 8px 0px; color:#333; width:355px;float:left; display:block;
margin: 2px 0px 8px 0px;
color: #333;
width: 355px;
float: left;
display: block;
}
vbox.b vbox.items description image {
float:left;margin:0px 3px 0px 0px;
float: left;
margin: 0px 3px 0px 0px;
}
.tooltip {
display: none;
font-size: 12px;
@ -67,5 +114,3 @@ vbox.b vbox.items description image {
width: 100px; /* width of the spinner gif */
height: 102px; /*hight of the spinner gif +2px to fix IE8 issue */
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.754
# Version 7.0NG.755
# 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.754-210526
Version: 7.0NG.755-210611
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -24,7 +24,7 @@ fi
if [ "$#" -ge 2 ]; then
VERSION="$2"
else
VERSION="7.0NG.754"
VERSION="7.0NG.755"
fi
# Path for the generated DMG file

View 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.754" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.755" 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.754" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.755" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -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.754</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.754 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.754</string>
<key>CFBundleVersion</key> <string>7.0NG.755</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.755 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.755</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.754
%define release 210526
%define version 7.0NG.755
%define release 210611
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.754
%define release 210526
%define version 7.0NG.755
%define release 210611
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.754
# Version 7.0NG.755
# 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

View File

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

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.754 Build 210526")
#define PANDORA_VERSION ("7.0NG.755 Build 210611")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.754(Build 210526))"
VALUE "ProductVersion", "(7.0NG.755(Build 210611))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.754-210526
Version: 7.0NG.755-210611
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -1,16 +1,29 @@
<?php
/**
* Pandora FMS - http://pandorafms.com
* ==================================================
* Agents/Modules Monitoring view.
*
* @category Operations
* @package Pandora FMS
* @subpackage Opensource
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
@ -370,7 +383,7 @@ function mainAgentsModules()
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
}
}
@ -435,14 +448,25 @@ function mainAgentsModules()
if ($config['pure'] == 0) {
// Header.
ui_print_page_header(
ui_print_standard_header(
__('Agents/Modules'),
'images/module.png',
false,
'',
false,
$updated_time
(array) $updated_time,
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
);
echo '<table class="w100p">';
echo '<tr>';
echo "<td> <span class='float-right'>".$fullscreen['text'].'</span> </td>';

View File

@ -103,7 +103,7 @@ function load_matrix_console()
context.fillRect(0, 0, width, height);
context.fillStyle = "#0F0"; // Green text
context.font = font_size + "px arial";
context.font = font_size + "px lato";
// Looping over drops
for (var i = 0; i < drops.length; i++) {
if (drops[i] == -1) {

View File

@ -246,13 +246,24 @@ function mainModuleGroups()
$array_data[$value['id_grupo']][$value['id_mg']] = $value;
}
ui_print_page_header(
// Header.
ui_print_standard_header(
__('Combined table of agent group and module group'),
'images/module_group.png',
false,
'',
false,
''
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
);
echo "<table cellpadding='4' cellspacing='4' class='databox filters bolder margin-bottom-10' width='100%'>

View File

@ -53,13 +53,24 @@ function pandora_realtime_graphs()
$hide_header = get_parameter('hide_header', 0);
if ($hide_header === 0) {
ui_print_page_header(
// Header.
ui_print_standard_header(
__('Realtime graphs'),
'images/extensions.png',
false,
'real_time_view',
false,
$onheader
$onheader,
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
);
}

View File

@ -1,28 +1,42 @@
<?php
/**
* Resource registration.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Remember the hard-coded values
/*
-- id_modulo now uses tmodule
-- ---------------------------
-- 1 - Data server modules (agent related modules)
-- 2 - Network server modules
-- 4 - Plugin server
-- 5 - Predictive server
-- 6 - WMI server
-- 7 - WEB Server (enteprise)
In the xml is the tag "module_source"
/**
* Remember the hard-coded values.
* -- id_modulo now uses tmodule.
* -- ---------------------------.
* -- 1 - Data server modules (agent related modules)
* -- 2 - Network server modules
* -- 4 - Plugin server
* -- 5 - Predictive server
* -- 6 - WMI server
* -- 7 - WEB Server (enteprise)
* In the xml is the tag "module_source"
*/
require_once $config['homedir'].'/include/functions_agents.php';
@ -1096,6 +1110,7 @@ function resource_registration_extension_main()
}
$xml = simplexml_load_file($_FILES['resource_upload']['tmp_name'], null, LIBXML_NOCDATA);
if ($xml === false) {
ui_print_error_message(
__('Error uploading resource. Check if the selected file is a valid resource template in .ptr format')

View File

@ -21,4 +21,7 @@ PREPARE pr_oum755 FROM @st_oum755;
EXECUTE pr_oum755;
DEALLOCATE PREPARE pr_oum755;
UPDATE `tconfig` set value = 'lato.ttf' WHERE token LIKE 'custom_report_front_font';
UPDATE `tconfig` set value = 'lato.ttf' WHERE token LIKE 'fontpath';
COMMIT;

View File

@ -1019,7 +1019,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
-- Criticity: 5 - Minor
-- Criticity: 6 - Major
ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL;
ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`);
@ -1072,7 +1072,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` (
-- Criticity: 5 - Minor
-- Criticity: 6 - Major
ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `data` double(22,5) default NULL;
ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_estado_idx` (`estado`);
ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_timestamp_idx` (`timestamp`);
@ -1556,7 +1556,7 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `debug_content` varchar(200);
-- ---------------------------------------------------------------------
-- Table `tagente_datos`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_datos MODIFY `datos` double(22,5);
ALTER TABLE tagente_datos MODIFY `datos` double(50,5);
ALTER TABLE `tagente_datos` DROP INDEX `data_index1`, ADD INDEX `data_index1` (`id_agente_modulo`, `utimestamp`);
-- ---------------------------------------------------------------------
@ -1567,7 +1567,7 @@ ALTER TABLE `tagente_datos_string` MODIFY COLUMN `datos` mediumtext NOT NULL, DR
-- ---------------------------------------------------------------------
-- Table `tagente_datos_inc`
-- ---------------------------------------------------------------------
ALTER TABLE tagente_datos_inc MODIFY `datos` double(22,5);
ALTER TABLE tagente_datos_inc MODIFY `datos` double(50,5);
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
@ -2341,7 +2341,7 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` (
-- ---------------------------------------------------------------------
-- Table `tevento`
-- ---------------------------------------------------------------------
ALTER TABLE `tevento` ADD COLUMN `data` double(22,5) default NULL;
ALTER TABLE `tevento` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';

View File

@ -192,15 +192,15 @@ if (check_login()) {
echo "
</div>
<div class='right height_30px'>
</div>
<div class='btn_update_online_open height_30px'>
<div class='modalokbutton cerrar'>
<span class='modalokbuttontext'>OK</span>
</div>";
if ($open) {
echo "<div class='modalgobutton gopandora'>
<span class='modalgobuttontext'>About Enterprise</span>
</div>";
</div></div>";
}
}

View File

@ -24,12 +24,20 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'],
return;
}
\ui_print_page_header(
__('Monitoring').' &raquo; '.__('Clusters'),
// Header.
ui_print_standard_header(
__('Clusters'),
'images/chart.png',
false,
'',
false
false,
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
]
);
ui_require_css_file('first_task');

View File

@ -49,9 +49,7 @@ echo __(
$pandora_version,
$build_package_version,
$config['MR']
);
echo '</a><br />';
echo '<small><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span></small>';
).'</a><br><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span><br>';

View File

@ -28,7 +28,6 @@
.modalheadertex{
color:white;
position:relative;
font-family:Nunito;
font-size:13pt;
top:8px;
}
@ -70,7 +69,6 @@
}
.modalwikibuttontex{
color:#ffffff;
font-family:Nunito;
font-size:10pt;
position:relative;
top:6px;

View File

@ -29,7 +29,6 @@
}
.modalheadertex{
color:#000;
font-family:Nunito;
line-height: 40px;
font-size: 23pt;
margin-bottom:30px;
@ -66,7 +65,6 @@
}
.modalokbuttontex{
color:#82b92e;
font-family:Nunito;
font-size:13pt;
}
.modalgobutto{
@ -80,7 +78,6 @@
}
.modalgobuttontex{
color:#82b92e;
font-family:Nunito;
font-size:10pt;
}

View File

@ -29,7 +29,6 @@
}
.modalheadertex{
color:#000;
font-family:Nunito;
line-height: 40px;
font-size: 23pt;
margin-bottom:30px;
@ -66,7 +65,6 @@
}
.modalokbuttontex{
color:#82b92e;
font-family:Nunito;
font-size:13pt;
}
.modalgobutto{
@ -80,7 +78,6 @@
}
.modalgobuttontex{
color:#82b92e;
font-family:Nunito;
font-size:10pt;
}

View File

@ -500,7 +500,7 @@ if (enterprise_installed()) {
false,
// Delete_groups.
// Do not show the primary group in this selection.
array_merge($secondary_groups_selected['plain'], [$agent['id_grupo']])
array_merge(($secondary_groups_selected['plain'] ?? []), [$agent['id_grupo']])
// Include_groups.
// Size.
// Simple_multiple_options.

View File

@ -1668,16 +1668,7 @@ if ($update_module) {
'module_macros' => $module_macros,
];
if (preg_match('/http_auth_user/m', $values['plugin_parameter'])) {
$http_user_conf = true;
}
if (preg_match('/http_auth_pass/m', $values['plugin_parameter'])) {
$http_pass_conf = true;
}
if (!$http_user_conf || !$http_pass_conf) {
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {
$plugin_parameter_split = explode('&#x0a;', $values['plugin_parameter']);
@ -1686,18 +1677,10 @@ if ($update_module) {
foreach ($plugin_parameter_split as $key => $value) {
if ($key == 1) {
if ($http_user) {
if ($http_user_conf) {
continue;
}
$values['plugin_parameter'] .= 'http_auth_user&#x20;'.$http_user.'&#x0a;';
}
if ($http_pass) {
if ($http_user_pass) {
continue;
}
$values['plugin_parameter'] .= 'http_auth_pass&#x20;'.$http_pass.'&#x0a;';
}
@ -1707,7 +1690,7 @@ if ($update_module) {
}
}
}
}
// In local modules, the interval is updated by agent.
$module_kind = (int) get_parameter('moduletype');
@ -2112,106 +2095,8 @@ if ($delete_module) {
exit;
}
enterprise_include_once('include/functions_config_agents.php');
enterprise_hook('config_agents_delete_module_in_conf', [modules_get_agentmodule_agent($id_borrar_modulo), modules_get_agentmodule_name($id_borrar_modulo)]);
// Init transaction.
$error = 0;
// First delete from tagente_modulo -> if not successful, increment
// error. NOTICE that we don't delete all data here, just marking for deletion
// and delete some simple data.
$values = [
'nombre' => 'pendingdelete',
'disabled' => 1,
'delete_pending' => 1,
];
$result = db_process_sql_update(
'tagente_modulo',
$values,
['id_agente_modulo' => $id_borrar_modulo]
);
if ($result === false) {
$error++;
} else {
// Set flag to update module status count.
db_process_sql(
'UPDATE tagente
SET update_module_count = 1, update_alert_count = 1
WHERE id_agente = '.$module_data['id_agente']
);
}
$result = db_process_sql_delete(
'tagente_estado',
['id_agente_modulo' => $id_borrar_modulo]
);
if ($result === false) {
$error++;
}
$result = db_process_sql_delete(
'tagente_datos_inc',
['id_agente_modulo' => $id_borrar_modulo]
);
if ($result === false) {
$error++;
}
if (alerts_delete_alert_agent_module(
false,
['id_agent_module' => $id_borrar_modulo]
) === false
) {
$error++;
}
$result = db_process_delete_temp(
'ttag_module',
'id_agente_modulo',
$id_borrar_modulo
);
if ($result === false) {
$error++;
}
// Trick to detect if we are deleting a synthetic module (avg or arithmetic)
// If result is empty then module doesn't have this type of submodules.
$ops_json = enterprise_hook('modules_get_synthetic_operations', [$id_borrar_modulo]);
$result_ops_synthetic = json_decode($ops_json);
if (!empty($result_ops_synthetic)) {
$result = enterprise_hook('modules_delete_synthetic_operations', [$id_borrar_modulo]);
if ($result === false) {
$error++;
}
} else {
$result_components = enterprise_hook('modules_get_synthetic_components', [$id_borrar_modulo]);
$count_components = 1;
if (!empty($result_components)) {
// Get number of components pending to delete to know when it's needed to update orders.
$num_components = count($result_components);
$last_target_module = 0;
foreach ($result_components as $id_target_module) {
// Detects change of component or last component to update orders.
if (($count_components == $num_components)
|| ($last_target_module != $id_target_module)
) {
$update_orders = true;
} else {
$update_orders = false;
}
$result = enterprise_hook('modules_delete_synthetic_operations', [$id_target_module, $id_borrar_modulo, $update_orders]);
if ($result === false) {
$error++;
}
$count_components++;
$last_target_module = $id_target_module;
}
}
}
// Also call base function to delete modules madafakas de los cojones.
modules_delete_agent_module($id_borrar_modulo);
// Check for errors.
if ($error != 0) {

View File

@ -1,17 +1,32 @@
<?php
/**
* Agents defined view.
*
* @category Manage Agents.
* @package Pandora FMS
* @subpackage Resources.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
// Take some parameters (GET).
@ -76,13 +91,23 @@ $viewtab['active'] = false;
$onheader = ['view' => $viewtab];
// Header.
ui_print_page_header(
ui_print_standard_header(
__('Agents defined in %s', get_product_name()),
'images/agent.png',
false,
'',
true,
$onheader
$onheader,
[
[
'link' => '',
'label' => __('Resources'),
],
[
'link' => '',
'label' => __('Manage agents'),
],
]
);
if (is_central_policies_on_node()) {

View File

@ -238,7 +238,7 @@ echo '</table>';
if (!$config['disable_help']) {
echo '<div class="disable_help">';
echo '<strong>';
echo "<a class='color-black-grey' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo "<a class='color-black-grey invert_filter' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo '</strong>';
echo '</div>';
}
@ -1130,7 +1130,6 @@ foreach ($modules as $module) {
[
'alt' => __('Enable module'),
'title' => __('Enable module'),
'class' => 'invert_filter_important',
]
).'</a>';
} else {

View File

@ -1,17 +1,32 @@
<?php
/**
* Common editor fields.
*
* @category Module manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Begin
require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_categories.php';
require_once $config['homedir'].'/include/graphs/functions_d3.php';
@ -19,7 +34,10 @@ require_once $config['homedir'].'/include/graphs/functions_d3.php';
include_javascript_d3();
global $config;function prepend_table_simple($row, $id=false)
global $config;
function prepend_table_simple($row, $id=false)
{
global $table_simple;
@ -581,8 +599,12 @@ if ($moduletype == MODULE_DATA) {
$table_advanced->colspan[1][1] = 2;
$interval_factor = 1;
if (isset($id_agente)) {
$agent_interval = agents_get_interval($id_agente);
$agent_interval = (float) agents_get_interval($id_agente);
if ($agent_interval > 0) {
$interval = (float) $interval;
$interval_factor = ($interval / $agent_interval);
}
$table_advanced->data[1][1] = human_time_description_raw($interval).' ('.sprintf(__('Agent interval x %s'), $interval_factor).') ';
} else {
$table_advanced->data[1][1] = sprintf(__('Agent interval x %s'), $interval_factor);

View File

@ -101,21 +101,39 @@ if ($id_policy_module) {
$plugin_parameter = $module['plugin_parameter'];
}
$plugin_parameter_split = explode('&#x0a;', $plugin_parameter);
$plugin_parameter_final_split = '';
foreach ($plugin_parameter_split as $key => $value) {
if (strpos($value, 'http_auth_user') === false && strpos($value, 'http_auth_pass') === false) {
$plugin_parameter_final_split .= $value.'&#x0a;';
}
if (strpos($value, 'http_auth_user') !== false) {
$plugin_parameter_http_user = str_replace('http_auth_user&#x20;', '', $value);
}
if (strpos($value, 'http_auth_pass') !== false) {
$plugin_parameter_http_pass = str_replace('http_auth_pass&#x20;', '', $value);
}
}
if ((bool) $adopt === false) {
$data[1] = html_print_textarea(
'plugin_parameter',
15,
65,
$plugin_parameter,
$plugin_parameter_final_split,
$disabledTextBecauseInPolicy,
true
true,
'resizev'
);
} else {
$data[1] = html_print_textarea(
'plugin_parameter',
15,
65,
$plugin_parameter,
$plugin_parameter_final_split,
false,
true
);
@ -258,16 +276,12 @@ foreach ($texts as $code => $text) {
"get_content",
"debug",
"task_end",
"head",
"http_auth_user",
"http_auth_pass"
"head"
];
$(document).ready(function() {
var plugin_parameter = $("#textarea_plugin_parameter");
var http_auth_user = $('#text-http_user');
var http_auth_pass = $('#password-http_pass');
$(plugin_parameter).keyup(function() {
@ -277,18 +291,6 @@ foreach ($texts as $code => $text) {
} else {
$('#button-btn_loadbasic').attr('disabled', 'disabled');
}
// Update http_auth_user from conf data
var http_auth_user_value = get_module_token_from_config('http_auth_user', plugin_parameter, "\n");
if (http_auth_user_value != "") {
http_auth_user.val(http_auth_user_value);
}
// Update http_auth_pass from conf data
var http_auth_pass_value = get_module_token_from_config('http_auth_pass', plugin_parameter, "\n");
if (http_auth_pass_value != "") {
http_auth_pass.val(http_auth_pass_value);
}
});
$('#button-btn_loadbasic').click(function() {
@ -412,57 +414,6 @@ foreach ($texts as $code => $text) {
});
$(plugin_parameter).trigger('keyup');
http_auth_user.keyup(function() {
config = plugin_parameter.val();
if (config.search("http_auth_user") == -1) {
var http_auth_user_end =
"http_auth_user " + this.value + "\n" + "task_end" + "\n";
plugin_parameter.val(config.replace(/^task_end.*$/m, http_auth_user_end));
} else {
plugin_parameter.val(
config.replace(/^http_auth_user.*$/m, "http_auth_user " + this.value)
);
// Hide success and error indicators
$(".checks").hide();
}
});
http_auth_pass.keyup(function() {
config = plugin_parameter.val();
if (config.search("http_auth_pass") == -1) {
var http_auth_pass_end =
"http_auth_pass " + this.value + "\n" + "task_end" + "\n";
plugin_parameter.val(config.replace(/^task_end.*$/m, http_auth_pass_end));
} else {
plugin_parameter.val(
config.replace(/^http_auth_pass.*$/m, "http_auth_pass " + this.value)
);
// Hide success and error indicators
$(".checks").hide();
}
});
});
function get_module_token_from_config(token_name, plugin_parameter, separator) {
var return_var = "";
if(token_name == null || token_name == '') {
return '';
}
data = plugin_parameter.val().split(separator);
len = data.length;
for (i = 0; i < len; i++) {
if (data[i][0] == "#") continue;
tokens = data[i].split(" ");
if (tokens.length == 0) continue;
token = tokens.shift();
if (token == token_name ) return_var = tokens.join(" ");
}
return_var = $.trim(return_var);
return return_var;
}
</script>

View File

@ -1015,7 +1015,21 @@ $table->data['module'][1] = "
'',
'',
0,
true
true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
false,
false,
false
)."</td>
<td class='datos2 button_cell' style='text-align: right; width:10%;' id=''>".'<div id="add_button_div">'.'<a class="add_button" href="">'.html_print_image(
'images/add.png',

View File

@ -810,7 +810,8 @@ foreach ($simple_alerts as $alert) {
'images/lightbulb_off.png',
1,
'padding:0px',
true
true,
['class' => 'invert_filter']
);
$data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else {
@ -879,7 +880,10 @@ foreach ($simple_alerts as $alert) {
$data[4] .= html_print_image(
'images/add.disabled.png',
true,
['title' => __('Add action')]
[
'title' => __('Add action'),
'class' => 'invert_filter',
]
);
} else {
if ((int) $alert['id_policy_alerts'] === 0) {

View File

@ -224,31 +224,31 @@ $table_days->data[0] = array_fill(0, 7, html_print_image('images/blade.png', tru
$days = [];
if ($template['monday']) {
$table_days->data[0][0] = html_print_image('images/tick.png', true);
$table_days->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
if ($template['tuesday']) {
$table_days->data[0][1] = html_print_image('images/tick.png', true);
$table_days->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
if ($template['wednesday']) {
$table_days->data[0][2] = html_print_image('images/tick.png', true);
$table_days->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
if ($template['thursday']) {
$table_days->data[0][3] = html_print_image('images/tick.png', true);
$table_days->data[0][3] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
if ($template['friday']) {
$table_days->data[0][4] = html_print_image('images/tick.png', true);
$table_days->data[0][4] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
if ($template['saturday']) {
$table_days->data[0][5] = html_print_image('images/tick.png', true);
$table_days->data[0][5] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
if ($template['sunday']) {
$table_days->data[0][6] = html_print_image('images/tick.png', true);
$table_days->data[0][6] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
$data[0] = html_print_table($table_days, true);
@ -265,7 +265,7 @@ $table_time->styleTable = 'padding: 1px; margin: 0px; text-align: center; height
// $data[0] = __('Time from') . ' / ' . __('Time to');
if ($template['time_from'] == $template['time_to']) {
$table_time->head[0] = '00:00:00<br>-<br>23:59:59';
$table_time->data[0][0] = html_print_image('images/tick.png', true);
$table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else {
$from_array = explode(':', $template['time_from']);
$from = ($from_array[0] * SECONDS_1HOUR + $from_array[1] * SECONDS_1MINUTE + $from_array[2]);
@ -278,7 +278,7 @@ if ($template['time_from'] == $template['time_to']) {
}
$table_time->head[1] = $template['time_from'].'<br>-<br>'.$template['time_to'];
$table_time->data[0][1] = html_print_image('images/tick.png', true);
$table_time->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
if ($template['time_to'] != '23:59:59') {
$table_time->head[2] = $template['time_to'].'<br>-<br>23:59:59';
@ -287,15 +287,15 @@ if ($template['time_from'] == $template['time_to']) {
} else {
if ($template['time_to'] != '00:00:00') {
$table_time->head[0] = '00:00:00<br>-<br>'.$template['time_to'];
$table_time->data[0][0] = html_print_image('images/tick.png', true);
$table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
$table_time->head[1] = $template['time_to'].'<br>-<br>'.$template['time_from'];
$table_time->data[0][1] = html_print_image('images/blade.png', true);
$table_time->data[0][1] = html_print_image('images/blade.png', true, ['class' => 'invert_filter']);
if ($template['time_from'] != '23:59:59') {
$table_time->head[2] = $template['time_from'].'<br>-<br>23:59:59';
$table_time->data[0][2] = html_print_image('images/tick.png', true);
$table_time->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
}
}
@ -354,7 +354,7 @@ $table->style[0] = 'font-weight: bold; text-align: left;';
if (count($actions) == 1 && isset($actions[0])) {
$table->head[1] = __('Every time that the alert is fired');
$table->data[0][0] = $actions[0]['name'];
$table->data[0][1] = html_print_image('images/tick.png', true);
$table->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else {
foreach ($actions as $kaction => $action) {
$table->data[$kaction][0] = $action['name'];
@ -364,7 +364,7 @@ if (count($actions) == 1 && isset($actions[0])) {
foreach ($action['escalation'] as $k => $v) {
if ($v > 0) {
$table->data[$kaction][$k] = html_print_image('images/tick.png', true);
$table->data[$kaction][$k] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else {
$table->data[$kaction][$k] = html_print_image('images/blade.png', true);
}

View File

@ -95,7 +95,7 @@ if ($id_group) {
}
// Header
if (defined('METACONSOLE')) {
if (is_metaconsole() === true) {
agents_meta_print_header();
$sec = 'advanced';
} else {
@ -105,13 +105,24 @@ if (defined('METACONSOLE')) {
$title_in_header = __('Create group');
}
ui_print_page_header(
// Header.
ui_print_standard_header(
$title_in_header,
'images/group.png',
false,
'',
true,
''
false,
[],
[
[
'link' => '',
'label' => __('Profiles'),
],
[
'link' => '',
'label' => __('Manage agents group'),
],
]
);
$sec = 'gagente';
}

View File

@ -333,6 +333,7 @@ $title = __('Groups defined in %s', get_product_name());
switch ($tab) {
case 'tree':
$buttons['tree']['active'] = true;
$title .= sprintf(' &raquo; %s', __('Tree view'));
break;
case 'credbox':
@ -343,23 +344,38 @@ switch ($tab) {
case 'groups':
default:
$buttons['groups']['active'] = true;
$title .= sprintf(' &raquo; %s', __('Table view'));
break;
}
// Header.
if (is_metaconsole() === true) {
agents_meta_print_header();
echo '<div class="notify">';
echo __('Edit or delete groups can cause problems with synchronization');
echo '</div>';
html_print_div(
[
'class' => 'notify',
'content' => __('Edit or delete groups can cause problems with synchronization'),
]
);
} else {
ui_print_page_header(
// Header.
ui_print_standard_header(
$title,
'images/group.png',
false,
'',
true,
$buttons
false,
$buttons,
[
[
'link' => '',
'label' => __('Profiles'),
],
[
'link' => '',
'label' => __('Manage agents group'),
],
]
);
}
@ -471,7 +487,7 @@ if ($update_group) {
$values = [
'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4),
'parent' => $id_parent == -1 ? 0 : $id_parent,
'parent' => ($id_parent == -1) ? 0 : $id_parent,
'disabled' => !$alerts_enabled,
'custom_id' => $custom_id,
'id_skin' => $skin,

View File

@ -261,7 +261,10 @@ $table->data[1][2] .= html_print_select(
);
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;');
$templates = alerts_get_alert_templates(false, ['id', 'name']);
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
$table->data[2][0] = __('Alert template');
$table->data[2][1] = html_print_select(
index_array($templates, 'id', 'name'),

View File

@ -252,7 +252,10 @@ $table->size[3] = '40%';
$table->data = [];
$templates = alerts_get_alert_templates(false, ['id', 'name']);
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
$table->data[0][0] = __('Alert template');
$table->data[0][1] = html_print_select(
index_array($templates, 'id', 'name'),

View File

@ -58,12 +58,27 @@ $buttons['view'] = [
$tab = get_parameter('tab', 'view');
if ($tab != 'search_module') {
if ($tab !== 'search_module') {
$buttons[$tab]['active'] = true;
}
ui_print_page_header(__('Module Library').' &raquo; '.__('View'), '', false, 'module_library', true, $buttons);
$headerTitle = ($tab === 'categories') ? __('Categories') : __('Main view');
// Header.
ui_print_standard_header(
$headerTitle,
'',
false,
'module_library',
true,
$buttons,
[
[
'link' => '',
'label' => __('Module library'),
],
]
);
// Styles.
ui_require_css_file('module_library');

View File

@ -73,7 +73,7 @@ if (! check_acl($config['id_user'], 0, 'RW')
exit;
}
if ($edit_graph) {
if ($edit_graph === true) {
$graphInTgraph = db_get_row_sql(
'SELECT * FROM tgraph WHERE id_graph = '.$id_graph
);
@ -113,18 +113,18 @@ if ($edit_graph) {
// -----------------------
// CREATE/EDIT GRAPH FORM
// -----------------------
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder';
if ($edit_graph) {
$output = "<form method='post' action='".$url.'&edit_graph=1&update_graph=1&id='.$id_graph."'>";
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1';
if ($edit_graph === true) {
$output = "<form method='post' action='".$url.'&update_graph=1&id='.$id_graph."'>";
} else {
$output = "<form method='post' action='".$url."&edit_graph=1&add_graph=1'>";
$output = "<form method='post' action='".$url."&add_graph=1'>";
}
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
$output .= '<tr>';
$output .= "<td class='datos'><b>".__('Name').'</b></td>';
$output .= "<td class='datos'><input type='text' name='name' size='25' ";
if ($edit_graph) {
if ($edit_graph === true) {
$output .= "value='".$graphInTgraph['name']."' ";
}
@ -179,7 +179,7 @@ $output .= '</td></tr>';
$output .= '<tr>';
$output .= "<td class='datos2'><b>".__('Description').'</b></td>';
$output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>";
if ($edit_graph) {
if ($edit_graph === true) {
$output .= $graphInTgraph['description'];
}
@ -291,15 +291,30 @@ $output .= '</tr>';
$output .= '</table>';
if ($edit_graph) {
$output .= "<div class='w100p'>";
$output .= "<input type=submit name='store' class='sub upd right' value='".__('Update')."'>";
$output .= '</div>';
} else {
$output .= "<div class='w100p'>";
$output .= "<input type=submit name='store' class='sub next right' value='".__('Create')."'>";
$output .= '</div>';
}
$stringButton = ($edit_graph === true) ? __('Update') : __('Create');
$output .= html_print_div(
[
'class' => 'w100p',
'content' => "<input type=submit name='store' class='sub next right databox' value='".$stringButton."'>",
],
true
);
$output .= html_print_div(
[
'class' => 'w100p',
'content' => html_print_button(
__('Go back'),
'go_back',
false,
'window.location.href = \'index.php?sec=reporting&sec2=godmode/reporting/graphs\'',
'class="sub cancel right"',
true
),
],
true
);
$output .= '</form>';

View File

@ -26,10 +26,9 @@
* ============================================================================
*/
// Begin.
global $config;
if (is_ajax()) {
$search_agents = (bool) get_parameter('search_agents');
@ -110,7 +109,7 @@ if ($id_graph !== 0) {
}
if ($add_graph) {
if ($add_graph === true) {
$name = get_parameter_post('name');
$description = get_parameter_post('description');
$module_number = get_parameter_post('module_number');
@ -179,7 +178,7 @@ if ($update_graph) {
$stacked = $threshold;
}
if (trim($name) != '') {
if (empty(trim($name)) === false) {
$success = db_process_sql_update(
'tgraph',
[
@ -221,7 +220,7 @@ function add_quotes($item)
}
if ($add_module) {
if ($add_module === true) {
$id_graph = get_parameter('id');
$id_modules = get_parameter('module');
$id_agents = get_parameter('id_agents');
@ -252,7 +251,7 @@ if ($add_module) {
}
}
if ($delete_module) {
if ($delete_module === true) {
$id_graph = get_parameter('id');
$deleteGraph = get_parameter('delete');
@ -261,7 +260,7 @@ if ($delete_module) {
db_process_sql('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val);
}
if ($change_weight) {
if ($change_weight === true) {
$weight = get_parameter('weight');
$id_gs = get_parameter('graph');
db_process_sql_update(
@ -281,7 +280,7 @@ if ($change_label) {
);
}
if ($edit_graph) {
if ($edit_graph === true) {
$buttons = [
'graph_list' => [
'active' => false,
@ -335,41 +334,47 @@ if ($edit_graph) {
$graphInTgraph = db_get_row_sql('SELECT name FROM tgraph WHERE id_graph = '.$id_graph);
$name = $graphInTgraph['name'];
} else {
$buttons = '';
$buttons = [];
}
$head = __('Graph builder');
if (isset($name)) {
$head .= ' - '.$name;
if (isset($name) === true) {
$head .= ' &raquo; '.$name;
}
// Header.
$tab = get_parameter('tab', '');
$tab = get_parameter('tab');
switch ($tab) {
default:
case 'main':
ui_print_page_header(
$head,
'images/chart.png',
false,
'graph_builder',
false,
$buttons
);
case 'graph_editor':
$headerHelp = '';
break;
case 'graph_editor':
ui_print_page_header(
case 'main':
default:
$headerHelp = 'graph_builder';
break;
}
// Header.
ui_print_standard_header(
$head,
'images/chart.png',
false,
'',
$headerHelp,
false,
$buttons
$buttons,
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom graphs'),
],
]
);
break;
}
if ($add_graph) {
ui_print_result_message(
@ -405,12 +410,12 @@ if ($delete_module) {
// Parse CHUNK information into showable information.
// Split id to get all parameters.
if (!$delete_module) {
if (isset($_POST['period'])) {
if ($delete_module === false) {
if (isset($_POST['period']) === true) {
$period = $_POST['period'];
}
if ((isset($chunkdata) ) && ($chunkdata != '')) {
if ((isset($chunkdata) === true) && (empty($chunkdata) === false)) {
$module_array = [];
$weight_array = [];
$agent_array = [];
@ -418,7 +423,8 @@ if (!$delete_module) {
$chunk1 = explode('|', $chunkdata);
$modules = '';
$weights = '';
for ($a = 0; $a < count($chunk1); $a++) {
$chunkCount = count($chunk1);
for ($a = 0; $a < $chunkCount; $a++) {
$chunk2[$a] = [];
$chunk2[$a] = explode(',', $chunk1[$a]);
if (strpos($modules, $chunk2[$a][1]) == 0) {
@ -450,4 +456,8 @@ switch ($active_tab) {
case 'graph_editor':
include_once 'godmode/reporting/graph_builder.graph_editor.php';
break;
default:
// Nothing to do.
break;
}

View File

@ -1,19 +1,35 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global variables
/**
* Custom graph containers
*
* @category Reporting
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
// Check user credentials
// Check user credentials.
check_login();
if (! check_acl($config['id_user'], 0, 'RR') || enterprise_installed() === false) {
@ -87,8 +103,26 @@ $buttons['graph_container'] = [
]
).'</a>',
];
// Header
ui_print_page_header(__('Graph container'), '', false, '', false, $buttons);
// Header.
ui_print_standard_header(
__('Graph container'),
'',
false,
'',
false,
$buttons,
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom graphs'),
],
]
);
$container = folder_get_folders();

View File

@ -1,16 +1,32 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global variables
/**
* Reporting graphs.
*
* @category Reporting
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once 'include/functions_custom_graphs.php';
@ -99,8 +115,25 @@ $view_graph = (bool) get_parameter('view_graph');
$id = (int) get_parameter('id');
$multiple_delete = (bool) get_parameter('multiple_delete', 0);
// Header
ui_print_page_header(__('Reporting').' &raquo; '.__('Custom graphs'), 'images/chart.png', false, '', false, $buttons);
// Header.
ui_print_standard_header(
__('List of custom graphs'),
'images/chart.png',
false,
'',
false,
$buttons,
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom graphs'),
],
]
);
// Delete module SQL code
if ($delete_graph) {

View File

@ -1,16 +1,32 @@
<?php
/**
* Map builder console.
*
* @category Topology maps
* @package Pandora FMS
* @subpackage Visual consoles
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Begin.
global $config;
require_once $config['homedir'].'/include/functions_visual_map.php';
@ -32,9 +48,7 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
exit;
}
if (!$is_metaconsole) {
if ($is_metaconsole === false) {
$url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
$url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite';
$url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template';
@ -102,14 +116,24 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
];
}
if (!$is_metaconsole) {
ui_print_page_header(
__('Reporting').' &raquo; '.__('Visual Console'),
if ($is_metaconsole === false) {
ui_print_standard_header(
__('Visual Console List'),
'images/op_reporting.png',
false,
'',
false,
$buttons
true,
$buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
);
} else {
ui_meta_print_header(

View File

@ -62,6 +62,20 @@ $show_sort_options = [];
$show_sort_options[1] = __('Ascending');
$show_sort_options[2] = __('Descending');
// Agents inventory display options.
$agents_inventory_display_options = [];
$agents_inventory_display_options['alias'] = __('Alias');
$agents_inventory_display_options['direccion'] = __('IP');
$agents_inventory_display_options['id_os'] = __('OS');
$agents_inventory_display_options['id_grupo'] = __('Group');
$agents_inventory_display_options['secondary_groups'] = __('Secondary groups');
$agents_inventory_display_options['comentarios'] = __('Description');
$agents_inventory_display_options['url_address'] = __('URL');
$agents_inventory_display_options['custom_fields'] = __('Custom fields');
$agents_inventory_display_options['estado'] = __('Status');
$agents_inventory_display_options['agent_version'] = __('Version');
$agents_inventory_display_options['remote'] = __('Remote configuration');
enterprise_include('/godmode/reporting/reporting_builder.item_editor.php');
require_once $config['homedir'].'/include/functions_agents.php';
if (enterprise_include_once('include/functions_metaconsole.php')) {
@ -725,6 +739,25 @@ switch ($action) {
$idAgentModule = $module;
break;
case 'agents_inventory':
$description = $item['description'];
$es = json_decode($item['external_source'], true);
$date = $es['date'];
$selected_agent_server_filter = $es['agent_server_filter'];
$selected_agent_group_filter = $es['agent_group_filter'];
$selected_agents_inventory_display_options = $es['agents_inventory_display_options'];
$selected_agent_os_filter = $es['agent_os_filter'];
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
$selected_agent_status_filter = $es['agent_status_filter'];
$selected_agent_module_search_filter = $es['agent_module_search_filter'];
$selected_agent_version_filter = $es['agent_version_filter'];
$selected_agent_remote = $es['agent_remote_conf'];
$idAgent = $es['id_agents'];
$idAgentModule = $inventory_modules;
break;
case 'inventory':
$description = $item['description'];
$es = json_decode($item['external_source'], true);
@ -3020,6 +3053,232 @@ $class = 'databox filters';
<td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td>
</tr>
<tr id="row_agents_inventory_display_options" class="datos">
<td class="bolder">
<?php
echo __('Display options');
?>
</td>
<td>
<?php
html_print_select(
$agents_inventory_display_options,
'agents_inventory_display_options[]',
$selected_agents_inventory_display_options,
'',
'',
'',
false,
true,
true,
'',
false,
'width:200px'
);
?>
</td>
</tr>
<?php
$server_fields = [];
$server_fields[0] = __('All');
$servers = metaconsole_get_servers();
foreach ($servers as $key => $server) {
$server_fields[$key] = $server['server_name'];
}
$server_filter_markup = '
<tr id="row_agent_server_filter" class="datos">
<td class="bolder">'.__('Server').'</td><td>'.html_print_select(
$server_fields,
'agent_server_filter',
$selected_agent_server_filter,
'',
false,
'',
true,
false,
false,
'',
false,
'min-width: 180px'
).'</td></tr>';
if (is_metaconsole()) {
echo $server_filter_markup;
}
?>
<tr id="row_agent_group_filter" class="datos">
<td class="bolder">
<?php
echo __('Agent group filter');
?>
</td>
<td>
<?php
html_print_select_groups(
$config['id_user'],
'RW',
true,
'agent_group_filter',
$selected_agent_group_filter,
''
);
?>
</td>
</tr>
<tr id="row_os" class="datos">
<td class="bolder">
<?php
echo __('Agent OS filter');
?>
</td>
<td>
<?php
if ($selected_agent_os_filter === null) {
$selected_agent_os_filter = 0;
}
html_print_select_from_sql(
'SELECT id_os, name FROM tconfig_os',
'agent_os_filter[]',
$selected_agent_os_filter,
'',
__('All'),
'0',
false,
true
);
?>
</td>
</tr>
<tr id="row_custom_field" class="datos">
<td class="bolder">
<?php
echo __('Agent custom field filter');
?>
</td>
<td >
<?php
echo html_print_input_text(
'agent_custom_field_filter',
$selected_agent_custom_field_filter,
'',
50,
255,
true,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>
<tr id="row_agent_status" class="datos">
<td class="bolder">
<?php
echo __('Agent status filter');
?>
</td>
<td>
<?php
$fields = [];
$fields[AGENT_STATUS_NORMAL] = __('Normal');
$fields[AGENT_STATUS_WARNING] = __('Warning');
$fields[AGENT_STATUS_CRITICAL] = __('Critical');
$fields[AGENT_STATUS_UNKNOWN] = __('Unknown');
$fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$fields[AGENT_STATUS_NOT_INIT] = __('Not init');
if ($selected_agent_status_filter === null) {
$selected_agent_status_filter = -1;
}
html_print_select(
$fields,
'agent_status_filter[]',
$selected_agent_status_filter,
'',
__('All'),
'-1',
false,
true,
false,
'',
false,
'min-width: 180px'
);
?>
</td>
</tr>
<tr id="row_agent_version" class="datos">
<td class="bolder">
<?php
echo __('Agent version filter');
?>
</td>
<td >
<?php
echo html_print_input_text(
'agent_version_filter',
$selected_agent_version_filter,
'',
50,
255,
true,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>
<tr id="row_agent_remote_conf" class="datos">
<td class="bolder">
<?php
echo __('Agent has remote configuration').ui_print_help_tip(
__('Filter agents by remote configuration enabled.'),
true
);
?>
</td>
<td><?php html_print_checkbox_switch('agent_remote_conf', 1, $selected_agent_remote); ?></td>
</tr>
<tr id="row_module_free_search" class="datos">
<td class="bolder">
<?php
echo __('Agent module filter');
?>
</td>
<td>
<?php
echo html_print_input_text(
'agent_module_search_filter',
$selected_agent_module_search_filter,
'',
50,
255,
true,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>
</tbody>
</table>
@ -5223,6 +5482,15 @@ function chooseType() {
$("#row_users").hide();
$("#row_profiles_group").hide();
$("#row_select_by_group").hide();
$("#row_agents_inventory_display_options").hide();
$("#row_agent_server_filter").hide();
$("#row_agent_group_filter").hide();
$("#row_os").hide();
$("#row_custom_field").hide();
$("#row_agent_status").hide();
$("#row_agent_version").hide();
$("#row_agent_remote_conf").hide();
$("#row_module_free_search").hide();
// SLA list default state.
@ -5764,6 +6032,20 @@ function chooseType() {
break;
case 'agents_inventory':
$("#row_agents_inventory_display_options").show();
$("#row_agent_server_filter").show();
$("#row_agent_group_filter").show();
$("#row_group").show();
$("#row_os").show();
$("#row_custom_field").show();
$("#row_agent_status").show();
$("#row_agent_version").show();
$("#row_agent_remote_conf").show();
$("#row_module_free_search").show();
break;
case 'inventory':
$("#row_description").show();
$("#row_group").show();

View File

@ -272,6 +272,8 @@ if ($idReport != 0) {
}
}
$helpers = ($helpers ?? '');
switch ($action) {
case 'sort_items':
switch ($activeTab) {
@ -548,7 +550,7 @@ switch ($action) {
$subsection = $data_tab['subsection'];
$buttons = $data_tab['buttons'];
$helpers = $data_tab['helpers'];
$helpers = $data_tab['helper'];
break;
}
@ -567,17 +569,24 @@ switch ($action) {
// Print header.
ui_meta_print_header(__('Reporting'), '', $buttons);
} else {
// Page header for normal console.
ui_print_page_header(
__('Custom reporting'),
// Header.
ui_print_standard_header(
__('List of reports'),
'images/op_reporting.png',
false,
'',
false,
$buttons,
false,
'',
60
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
);
}
@ -2100,6 +2109,20 @@ switch ($action) {
$values['external_source'] = json_encode($es);
break;
case 'agents_inventory':
$es['agent_server_filter'] = get_parameter('agent_server_filter');
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
$es['agent_group_filter'] = get_parameter('agent_group_filter');
$es['agent_remote_conf'] = get_parameter('agent_remote_conf');
$values['external_source'] = json_encode($es);
break;
default:
// Default.
break;
@ -2486,7 +2509,7 @@ switch ($action) {
0
);
$values['exception_condition'] = (int) get_parameter(
'radiobutton_exception_condition',
'exception_condition',
0
);
$values['exception_condition_value'] = get_parameter(
@ -2725,6 +2748,20 @@ switch ($action) {
$values['external_source'] = json_encode($es);
break;
case 'agents_inventory':
$es['agent_server_filter'] = get_parameter('agent_server_filter');
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
$es['agent_group_filter'] = get_parameter('agent_group_filter');
$es['agent_remote_conf'] = get_parameter('agent_remote_conf');
$values['external_source'] = json_encode($es);
break;
default:
// Default.
break;
@ -3145,17 +3182,24 @@ switch ($action) {
// Print header.
ui_meta_print_header(__('Reporting'), '', $buttons);
} else {
// Page header for normal console.
ui_print_page_header(
// Header.
ui_print_standard_header(
$subsection,
'images/op_reporting.png',
false,
'',
false,
$buttons,
false,
'',
60
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
);
}
@ -3251,17 +3295,25 @@ if ($enterpriseEnable && defined('METACONSOLE')) {
} else {
$tab_builder = ($activeTab === 'item_editor') ? 'reporting_item_editor_tab' : '';
if ($action !== 'update' && !is_metaconsole()) {
ui_print_page_header(
if ($action !== 'update' && is_metaconsole() === false) {
// Header.
ui_print_standard_header(
$textReportName,
'images/op_reporting.png',
false,
$tab_builder,
false,
$buttons,
false,
'',
60
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
);
}
}
@ -3291,17 +3343,25 @@ if ($resultOperationDB !== null) {
$activeTab = 'list_items';
$buttons[$activeTab]['active'] = true;
if (!is_metaconsole()) {
ui_print_page_header(
if (is_metaconsole() === false) {
// Header.
ui_print_standard_header(
$textReportName,
'images/op_reporting.png',
false,
$helpers,
false,
$buttons,
false,
'',
60
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
);
}
}

View File

@ -1,16 +1,33 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Login check
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
global $statusProcessInDB;
@ -812,14 +829,25 @@ $buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
if (!defined('METACONSOLE')) {
ui_print_page_header(
if (is_metaconsole() === false) {
// Header.
ui_print_standard_header(
$visualConsoleName,
'images/visual_console.png',
false,
$tab_builder,
false,
$buttons
$buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
);
}

View File

@ -211,26 +211,6 @@ $fonts = [
'196pt' => '196pt',
];
/*
$fontf = array('andale mono,times' => 'Andale Mono',
'arial,helvetica,sans-serif' => 'Arial',
'arial black,avant garde' => 'Arial Black',
'comic sans ms,sans-serif' => 'Comic Sans MS',
'courier new,courier' => 'Courier New',
'georgia,palatino' => 'Georgia',
'helvetica,impact' => 'Helvetica',
'impact,chicago' => 'Impact',
'symbol' => 'Symbol',
'tahoma,arial,helvetica,sans-serif' => 'Tahoma',
'terminal,monaco' => 'Terminal',
'times new roman,times' => 'Times New Roman',
'trebuchet ms,geneva' => 'Trebuchet MS',
'verdana,geneva' => 'Verdana',
'Webdings' => 'Webdings',
'Wingdings' => 'Wingdings'
);
*/
$table->rowstyle['all_9'] = 'display: none;';
$table->data['all_9'][0] = __('Font');
$table->colspan['all_9'][1] = '3';

View File

@ -1,19 +1,38 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
/**
* Favorite visual console.
*
* @category Topology maps
* @package Pandora FMS
* @subpackage Visual consoles
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/include/functions_visual_map.php';
// Breadcrumb.
require_once $config['homedir'].'/include/class/HTML.class.php';
ui_require_css_file('discovery');
// ACL for the general permission
$vconsoles_read = check_acl($config['id_user'], 0, 'VR');
$vconsoles_write = check_acl($config['id_user'], 0, 'VW');
@ -32,7 +51,7 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
}
if (!$is_metaconsole) {
if ($is_metaconsole === false) {
$url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
$url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite';
$url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template';
@ -94,14 +113,24 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
];
}
if (!$is_metaconsole) {
ui_print_page_header(
__('Reporting').' &raquo; '.__('Visual Favourite Console'),
if ($is_metaconsole === false) {
ui_print_standard_header(
__('Favourite Visual Console'),
'images/op_reporting.png',
false,
'',
false,
$buttons
true,
$buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
);
} else {
ui_meta_print_header(

View File

@ -386,10 +386,10 @@ function check_process (id_server) {
parameters,
function (data) {
if (data['correct']) {
$("#check_exec_server img").attr("src", <?php echo 'images/dot_green.png'; ?>);
$("#check_exec_server img").attr("src", "images/dot_green.png");
}
else {
$("#check_exec_server img").attr("src", <?php echo 'images/dot_red.png'; ?>);
$("#check_exec_server img").attr("src", "images/dot_red.png");
$("#check_error_message").empty();
$("#check_error_message").append("<span>" + data['message'] + "</span>");
}

View File

@ -1,17 +1,32 @@
<?php
/**
* Images File Manager
*
* @category File manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Get global data.
global $config;
check_login();
@ -24,33 +39,25 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
require_once 'include/functions_filemanager.php';
// Header
// Header.
ui_print_page_header(__('File manager'), '', false, '', true);
if (isset($config['filemanager']['message'])) {
if (isset($config['filemanager']['message']) === true) {
echo $config['filemanager']['message'];
$config['filemanager']['message'] = null;
}
$directory = (string) get_parameter('directory', '/');
$directory = (string) get_parameter('directory');
if (empty($directory) === true) {
$directory = 'images';
} else {
$directory = str_replace('\\', '/', $directory);
// A miminal security check to avoid directory traversal
if (preg_match('/\.\./', $directory)) {
$directory = 'images';
$directory = filemanager_safe_directory($directory, 'images');
}
if (preg_match('/^\//', $directory)) {
$directory = 'images';
}
if (preg_match('/^manager/', $directory)) {
$directory = 'images';
}
// Add custom directories here
// Add custom directories here.
$fallback_directory = 'images';
// Banned directories.
$banned_directories['include'] = true;
$banned_directories['godmode'] = true;
$banned_directories['operation'] = true;
@ -58,7 +65,7 @@ $banned_directories['reporting'] = true;
$banned_directories['general'] = true;
$banned_directories[ENTERPRISE_DIR] = true;
if (isset($banned_directories[$directory])) {
if (isset($banned_directories[$directory]) === true) {
$directory = $fallback_directory;
}
@ -71,11 +78,11 @@ $create_text_file = (bool) get_parameter('create_text_file');
$default_real_directory = realpath($config['homedir'].'/'.$fallback_directory);
if ($upload_file_or_zip) {
if ($upload_file_or_zip === true) {
upload_file($upload_file_or_zip, $default_real_directory);
}
if ($create_text_file) {
if ($create_text_file === true) {
create_text_file($default_real_directory);
}

View File

@ -1,17 +1,32 @@
<?php
/**
* OS Edition
*
* @category Server
* @package Pandora FMS
* @subpackage Godmode
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
global $config;
check_login();
@ -45,8 +60,8 @@ if ($idOS) {
$message = '';
switch ($action) {
default:
case 'new':
default:
$actionHidden = 'save';
$textButton = __('Create');
$classButton = 'class="sub next"';
@ -183,12 +198,31 @@ $buttons = [
$buttons[$tab]['active'] = true;
if (!is_metaconsole()) {
$headerTitle = ($tab === 'builder') ? __('Edit OS') : __('List of OS');
if (is_metaconsole() === false) {
// Header.
ui_print_page_header(__('Edit OS'), '', false, '', true, $buttons);
ui_print_standard_header(
$headerTitle,
'',
false,
'',
true,
$buttons,
[
[
'link' => '',
'label' => __('Servers'),
],
[
'link' => '',
'label' => __('Edit OS'),
],
]
);
}
if (!empty($id_message)) {
if (empty($id_message) === false) {
switch ($id_message) {
case 1:
echo ui_print_success_message(__('Success creating OS'), '', true);
@ -226,13 +260,11 @@ if (!empty($id_message)) {
switch ($tab) {
case 'list':
default:
include_once $config['homedir'].'/godmode/setup/os.list.php';
return;
break;
case 'builder':
include_once $config['homedir'].'/godmode/setup/os.builder.php';
return;
break;
}

View File

@ -116,7 +116,12 @@ $table_remote->data['ehorus_test'] = $row;
// Print.
echo '<div class="center pdd_b_20px">';
echo '<a target="_blank" rel="noopener noreferrer" href="http://ehorus.com">';
if ($config['style'] === 'pandora_black') {
html_print_image('include/ehorus/images/ehorus-logo.png');
} else {
html_print_image('include/ehorus/images/ehorus-logo-grey.png');
}
echo '</a>';
echo '<br />';
echo '<div class="ehorus_title">';

View File

@ -34,9 +34,11 @@ check_login();
if (is_ajax()) {
$test_address = get_parameter('test_address', '');
$params = get_parameter('params', '');
$res = send_test_email(
$test_address
$test_address,
$params
);
echo $res;
@ -709,12 +711,25 @@ function perform_email_test () {
$('#email_test_failure_message').hide();
var test_address = $('#text-email_test_address').val();
params = {
email_smtpServer : $('#text-email_smtpServer').val(),
email_smtpPort : $('#text-email_smtpPort').val(),
email_username : $('#text-email_username').val(),
email_password : $('#password-email_password').val(),
email_encryption : $( "#email_encryption option:selected" ).val(),
email_from_dir : $('#text-email_from_dir').val(),
email_from_name : $('#text-email_from_name').val()
};
$.ajax({
type: "POST",
url: "ajax.php",
data: "page=godmode/setup/setup_general&test_address="+test_address,
dataType: "html",
data : {
page: "godmode/setup/setup_general",
test_address: test_address,
params: params
},
dataType: "json",
success: function(data) {
if (parseInt(data) === 1) {
$('#email_test_sent_message').show();

View File

@ -616,36 +616,6 @@ $table_font->style[0] = 'font-weight: bold;';
$table_font->size[0] = '50%';
$table_font->data = [];
$table_font->data[$row][0] = __('Graphs font family');
// Load font families.
$fonts = [];
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$explode = explode('-', $entryDir);
if (count($explode) === 1) {
$fonts[$entryDir] = substr($entryDir, 0, (strlen($entryDir) - 4));
}
if ($explode[1] === 'Regular.ttf') {
$fonts[$explode[0].'.ttf'] = $explode[0];
}
}
}
$table_font->data[$row][1] = html_print_select(
$fonts,
'fontpath',
io_safe_output($config['fontpath']),
'',
'',
0,
true
);
$row++;
$table_font->data[$row][0] = __('Graphs font size');
$font_size_array = [
@ -1150,20 +1120,6 @@ $table_report->data[$row][1] = "<input type ='number' value=".$config['font_size
$row++;
$table_report->data[$row][0] = __('PDF font family');
$table_report->data[$row][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
__('Default'),
'',
true
);
$row++;
$table_report->data[$row][0] = __('Graph image height for HTML reports');
$table_report->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true);

View File

@ -1257,7 +1257,14 @@ if ($create_alert || $update_alert) {
foreach ($other_actions as $action) {
$data[1] .= '<tr>';
$data[1] .= '<td>'.alerts_get_alert_action_name($action['alert_type']).'</td>';
$data[1] .= '<td> <a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert&delete_action=1&action_id='.$action['id'].'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a> </td>';
$data[1] .= '<td> <a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert&delete_action=1&action_id='.$action['id'].'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image(
'images/cross.png',
true,
[
'border' => '0',
'alt' => __('Delete'),
]
).'</a> </td>';
$data[1] .= '</tr>';
}
}
@ -1278,7 +1285,34 @@ if ($create_alert || $update_alert) {
}
if (check_acl_restricted_all($config['id_user'], $row['id_group'], 'LW')) {
$data[8] = '<a href="index.php?'.'sec=snmpconsole&'.'sec2=godmode/snmpconsole/snmp_alert&'.'duplicate_alert=1&'.'id_alert_snmp='.$row['id_as'].'">'.html_print_image('images/copy.png', true, ['alt' => __('Duplicate'), 'title' => __('Duplicate'), 'class' => 'invert_filter']).'</a>'.'<a href="index.php?'.'sec=snmpconsole&'.'sec2=godmode/snmpconsole/snmp_alert&'.'update_alert=1&'.'id_alert_snmp='.$row['id_as'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter']).'</a>'.'<a href="javascript:show_add_action_snmp(\''.$row['id_as'].'\');">'.html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']).'</a>'.'<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert&delete_alert='.$row['id_as'].'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image('images/cross.png', true, ['border' => '0', 'class' => 'invert_filter', 'alt' => __('Delete')]).'</a>';
$data[8] = '<a href="index.php?'.'sec=snmpconsole&'.'sec2=godmode/snmpconsole/snmp_alert&'.'duplicate_alert=1&'.'id_alert_snmp='.$row['id_as'].'">'.html_print_image(
'images/copy.png',
true,
[
'alt' => __('Duplicate'),
'title' => __('Duplicate'),
]
).'</a>'.'<a href="index.php?'.'sec=snmpconsole&'.'sec2=godmode/snmpconsole/snmp_alert&'.'update_alert=1&'.'id_alert_snmp='.$row['id_as'].'">'.html_print_image(
'images/config.png',
true,
[
'border' => '0',
'alt' => __('Update'),
]
).'</a>'.'<a href="javascript:show_add_action_snmp(\''.$row['id_as'].'\');">'.html_print_image(
'images/add.png',
true,
[
'title' => __('Add action'),
]
).'</a>'.'<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert&delete_alert='.$row['id_as'].'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">'.html_print_image(
'images/cross.png',
true,
[
'border' => '0',
'alt' => __('Delete'),
]
).'</a>';
$data[9] = html_print_checkbox_extended(
@ -1409,7 +1443,7 @@ if ($create_alert || $update_alert) {
echo '<div class="right mrgn_lft_10px;">';
html_print_input_hidden('multiple_delete', 1);
html_print_submit_button(__('Delete selected'), 'delete_button', false, 'class="sub delete"');
html_print_submit_button(__('Delete selected'), 'delete_button', false, 'class="sub delete mrgn_btn_10px"');
echo '</div>';
echo '</form>';
}

View File

@ -32,15 +32,36 @@ $index_post = (int) get_parameter('index_post', 0);
// Create/update header
if ($edit_filter > -2) {
if ($edit_filter > -1) {
ui_print_page_header(__('SNMP Console').' &raquo; '.__('Update filter'), 'images/op_snmp.png', false, '', false);
$activeFilterCaption = ' &raquo; '.__('Update filter');
} else {
ui_print_page_header(__('SNMP Console').' &raquo; '.__('Create filter'), 'images/op_snmp.png', false, '', false);
$activeFilterCaption = ' &raquo; '.__('Create filter');
}
} else {
// Overview header
ui_print_page_header(__('SNMP Console').' &raquo; '.__('Filter overview'), 'images/op_snmp.png', false, '', false);
$activeFilterCaption = ' &raquo; '.__('Filter overview');
}
// Header.
ui_print_standard_header(
__('SNMP Console').$activeFilterCaption,
'images/op_snmp.png',
false,
'',
false,
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('SMNP'),
],
]
);
// Create/update filter
if ($update_filter > -2) {
// UPDATE

View File

@ -33,14 +33,27 @@ $snmp_type = (int) get_parameter('snmp_type', 0);
$snmp_value = (string) get_parameter('snmp_value', '');
$generate_trap = (bool) get_parameter('generate_trap', 0);
ui_print_page_header(
// Header.
ui_print_standard_header(
__('SNMP Trap generator'),
'images/op_snmp.png',
false,
'snmp_trap_generator_view',
false
false,
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('SMNP'),
],
]
);
if ($generate_trap) {
$result = true;
$error = '';

View File

@ -2,7 +2,6 @@
background-color: #373a3d;
background-image: -moz-linear-gradient(center top, #373a3d, #313437);
border-radius: 3px;
font-family: "PT Sans Narrow", sans-serif;
margin: 0px;
padding: 30px;
}
@ -24,7 +23,6 @@
#drop_file table td,
#drop_file table label {
color: #707070;
font-family: "PT Sans Narrow", sans-serif;
font-size: 16px;
font-weight: bold;
margin-top: 0;
@ -153,7 +151,7 @@
div#box_online * {
font-size: 16pt;
font-family: "Open Sans", sans-serif;
margin-bottom: 50px;
}
#box_online .content {
@ -200,7 +198,6 @@ a.update_manager_button {
font-size: 16px;
border-radius: 4px;
text-decoration: none;
font-family: "Open Sans", sans-serif;
}
a.update_manager_button:after {
@ -221,6 +218,7 @@ a.update_manager_button:after {
color: #82b92e;
font-size: 75pt;
font-weight: bold;
margin-bottom: 50px;
}
/* METACONSOLE */

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -6,6 +6,6 @@
C0,3.19,3.188,0,7.087,0h14.826C25.809,0,29,3.188,29,7.088V21.915z"/>
</g>
</g>
<text transform="matrix(1 0 0 1 8.0737 21.2432)" fill="#FFFFFF" font-family="'Arial-BoldMT'" font-size="19">D</text>
<text transform="matrix(1 0 0 1 8.0737 21.2432)" fill="#FFFFFF" font-size="19">D</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 379 B

After

Width:  |  Height:  |  Size: 350 B

View File

@ -233,7 +233,7 @@ if (check_login()) {
false
);
$formtable->data[0][2] = '';
$formtable->data[0][3] = "<a href='javascript: show_module_detail_dialog(".$module_id.', '.$agentId.', "'.$server_name.'", 0, -1,"'.modules_get_agentmodule_name($module_id)."\")'>".html_print_image('images/refresh.png', true, ['style' => 'vertical-align: middle;', 'border' => '0' ]).'</a>';
$formtable->data[0][3] = "<a href='javascript: show_module_detail_dialog(".$module_id.', '.$agentId.', "'.$server_name.'", 0, -1,"'.modules_get_agentmodule_name($module_id)."\")'>".html_print_image('images/refresh.png', true, ['style' => 'vertical-align: middle;', 'border' => '0', 'class' => 'invert_filter' ]).'</a>';
$formtable->rowspan[0][3] = 2;
$formtable->cellstyle[0][3] = 'vertical-align: middle;';
@ -1051,7 +1051,7 @@ if (check_login()) {
if ($module['flag'] == 0) {
$data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;flag=1&amp;refr=60">'.html_print_image('images/target.png', true, ['border' => '0', 'title' => __('Force'), 'class' => 'invert_filter' ]).'</a>';
} else {
$data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;refr=60">'.html_print_image('images/refresh.png', true, ['border' => '0', 'title' => __('Refresh')]).'</a>';
$data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;refr=60">'.html_print_image('images/refresh.png', true, ['border' => '0', 'title' => __('Refresh'), 'class' => 'invert_filter']).'</a>';
}
}
} else {
@ -1140,7 +1140,7 @@ if (check_login()) {
// Adds tag context information.
if (tags_get_modules_tag_count($module['id_agente_modulo']) > 0) {
$data[3] .= ' <a class="tag_details" href="ajax.php?page=operation/agentes/estado_monitores&get_tag_tooltip=1&id_agente_modulo='.$module['id_agente_modulo'].'">'.html_print_image('images/tag_red.png', true, ['id' => 'tag-details-'.$module['id_agente_modulo'], 'class' => 'img_help']).'</a> ';
$data[3] .= ' <a class="tag_details" href="ajax.php?page=operation/agentes/estado_monitores&get_tag_tooltip=1&id_agente_modulo='.$module['id_agente_modulo'].'">'.html_print_image('images/tag_red.png', true, ['id' => 'tag-details-'.$module['id_agente_modulo'], 'class' => 'img_help invert_filter']).'</a> ';
}
// Adds relations context information.

View File

@ -65,7 +65,7 @@ if ($get_modules_downtime) {
$downtime_module_ids = extract_column($downtime_modules, 'id_agent_module');
$downtime_modules = array_fill_keys($downtime_module_ids, true);
$filter = ['id_agente' => $id_agent];
$filter = ['id_agente' => $id_agent, 'delete_pending' => 0];
$modules = db_get_all_rows_filter('tagente_modulo', $filter);
if (empty($modules)) {
$modules = [];

View File

@ -183,11 +183,9 @@
var scwLanguage;
function scwSetDefaultLanguage()
{try
{scwSetLanguage();}
catch (exception)
{// English
function scwSetDefaultLanguage() {
try { scwSetLanguage(); }
catch (exception) {// English
scwToday = 'Today:';
scwDrag = 'click here to drag';
scwArrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
@ -436,7 +434,6 @@
'vertical-align:middle;' +
'border: ridge 2px;' +
'font-size: 10pt;' +
'font-family: Arial,Helvetica,Sans-Serif;'+
'font-weight: bold;}' +
'td.scwDrag,' +
'td.scwHead {padding: 0px 0px;' +
@ -451,7 +448,7 @@
'margin: 2px 1px;' +
'font-weight: bold;' +
'font-size: 10pt;' +
'font-family: fixedSys;}' +
'}' +
'td.scwWeekNumberHead,' +
'td.scwWeek {padding: 0px;' +
'text-align: center;' +
@ -599,21 +596,21 @@
// Add a method to format a date into the required pattern
Date.prototype.scwFormat =
function(scwFormat)
{var charCount = 0,
function (scwFormat) {
var charCount = 0,
codeChar = '',
result = '';
for (var i=0;i<=scwFormat.length;i++)
{if (i<scwFormat.length && scwFormat.charAt(i)==codeChar)
{// If we haven't hit the end of the string and
for (var i = 0; i <= scwFormat.length; i++) {
if (i < scwFormat.length && scwFormat.charAt(i) == codeChar) {// If we haven't hit the end of the string and
// the format string character is the same as
// the previous one, just clock up one to the
// length of the current element definition
charCount++;
}
else {switch (codeChar)
{case 'y': case 'Y':
else {
switch (codeChar) {
case 'y': case 'Y':
result += (this.getFullYear() % Math.
pow(10, charCount)).toString().
scwPadLeft(charCount);
@ -637,8 +634,7 @@
while (charCount-- > 0) { result += codeChar; }
}
if (i<scwFormat.length)
{// Store the character we have just worked on
if (i < scwFormat.length) {// Store the character we have just worked on
codeChar = scwFormat.charAt(i);
charCount = 1;
}
@ -650,8 +646,8 @@
// Add a method to left pad zeroes
String.prototype.scwPadLeft =
function(padToLength)
{var result = '';
function (padToLength) {
var result = '';
for (var i = 0; i < (padToLength - this.length); i++) { result += '0'; }
return (result + this);
};
@ -661,16 +657,14 @@
// arguments.
Function.prototype.runsAfterSCW =
function() {var func = this,
function () {
var func = this,
args = new Array(arguments.length);
for (var i=0;i<args.length;++i)
{args[i] = arguments[i];}
for (var i = 0; i < args.length; ++i) { args[i] = arguments[i]; }
return function()
{// concat/join the two argument arrays
for (var i=0;i<arguments.length;++i)
{args[args.length] = arguments[i];}
return function () {// concat/join the two argument arrays
for (var i = 0; i < arguments.length; ++i) { args[args.length] = arguments[i]; }
return (args.shift() == scwTriggerEle)
? func.apply(this, args) : null;
@ -711,19 +705,19 @@
// ****************************************************************************
function showCal(scwEle, scwSourceEle) { scwShow(scwEle, scwSourceEle); }
function scwShow(scwEle,scwSourceEle)
{scwTriggerEle = scwSourceEle;
function scwShow(scwEle, scwSourceEle) {
scwTriggerEle = scwSourceEle;
// Take any parameters that there might be from the third onwards as
// day numbers to be disabled 0 = Sunday through to 6 = Saturday.
scwParmActiveToday = true;
for (var i=0;i<7;i++)
{scwPassEnabledDay[(i+7-scwWeekStart)%7] = true;
for (var j=2;j<arguments.length;j++)
{if (arguments[j]==i)
{scwPassEnabledDay[(i+7-scwWeekStart)%7] = false;
for (var i = 0; i < 7; i++) {
scwPassEnabledDay[(i + 7 - scwWeekStart) % 7] = true;
for (var j = 2; j < arguments.length; j++) {
if (arguments[j] == i) {
scwPassEnabledDay[(i + 7 - scwWeekStart) % 7] = false;
if (scwDateNow.getDay() == i) scwParmActiveToday = false;
}
}
@ -738,20 +732,19 @@
// Find the date and Strip space characters from start and
// end of date input.
if (typeof scwEle.value == 'undefined')
{var scwChildNodes = scwEle.childNodes;
if (typeof scwEle.value == 'undefined') {
var scwChildNodes = scwEle.childNodes;
for (var i = 0; i < scwChildNodes.length; i++)
if (scwChildNodes[i].nodeType == 3)
{var scwDateValue = scwChildNodes[i].nodeValue.replace(/^\s+/,'').replace(/\s+$/,'');
if (scwDateValue.length > 0)
{scwTriggerEle.scwTextNode = scwChildNodes[i];
if (scwChildNodes[i].nodeType == 3) {
var scwDateValue = scwChildNodes[i].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '');
if (scwDateValue.length > 0) {
scwTriggerEle.scwTextNode = scwChildNodes[i];
scwTriggerEle.scwLength = scwChildNodes[i].nodeValue.length;
break;
}
}
}
else
{var scwDateValue = scwEle.value.replace(/^\s+/,'').replace(/\s+$/,'');}
else { var scwDateValue = scwEle.value.replace(/^\s+/, '').replace(/\s+$/, ''); }
// Set the language-dependent elements
@ -779,22 +772,21 @@
scwToday + ' ' +
scwDateNow.scwFormat(scwDateDisplayFormat);
if (scwDateValue.length==0)
{// If no value is entered and today is within the range,
if (scwDateValue.length == 0) {// If no value is entered and today is within the range,
// use today's date, otherwise use the middle of the valid range.
scwBlnFullInputDate = false;
if ((new Date(scwBaseYear + scwDropDownYears, 0, 0)) < scwSeedDate ||
(new Date(scwBaseYear, 0, 1)) > scwSeedDate
)
{scwSeedDate = new Date(scwBaseYear +
) {
scwSeedDate = new Date(scwBaseYear +
Math.floor(scwDropDownYears / 2), 5, 1);
}
}
else
{function scwInputFormat()
{var scwArrSeed = new Array(),
else {
function scwInputFormat() {
var scwArrSeed = new Array(),
scwArrInput = scwDateValue.
split(new RegExp('[\\' + scwArrDelimiters.
join('\\') + ']+', 'g'));
@ -808,8 +800,8 @@
// still appear in the output string if in the output
// format.
if (scwArrInput[0]!=null)
{if (scwArrInput[0].length==0) scwArrInput.splice(0,1);
if (scwArrInput[0] != null) {
if (scwArrInput[0].length == 0) scwArrInput.splice(0, 1);
if (scwArrInput[scwArrInput.length - 1].length == 0)
scwArrInput.splice(scwArrInput.length - 1, 1);
@ -817,8 +809,8 @@
scwBlnFullInputDate = false;
switch (scwArrInput.length)
{case 1:
switch (scwArrInput.length) {
case 1:
{// Year only entry
scwArrSeed[0] = parseInt(scwArrInput[0], 10); // Year
scwArrSeed[1] = '6'; // Month
@ -882,8 +874,8 @@
if (scwExpValYear.exec(scwArrSeed[0]) == null ||
scwExpValMonth.exec(scwArrSeed[1]) == null ||
scwExpValDay.exec(scwArrSeed[2]) == null
)
{if (scwShowInvalidDateMsg)
) {
if (scwShowInvalidDateMsg)
alert(scwInvalidDateMsg +
scwInvalidAlert[0] + scwDateValue +
scwInvalidAlert[1]);
@ -916,8 +908,8 @@
// Check whether the month is in digits or an abbreviation
if (scwArrSeedDate[1].search(/\d+/)!=0)
{month = scwArrMonthNames.join('|').toUpperCase().
if (scwArrSeedDate[1].search(/\d+/) != 0) {
month = scwArrMonthNames.join('|').toUpperCase().
search(scwArrSeedDate[1].substr(0, 3).
toUpperCase());
scwArrSeedDate[1] = Math.floor(month / 4) + 1;
@ -930,8 +922,8 @@
// Test that we have arrived at a valid date
if (isNaN(scwSeedDate))
{if (scwShowInvalidDateMsg)
if (isNaN(scwSeedDate)) {
if (scwShowInvalidDateMsg)
alert(scwInvalidDateMsg +
scwInvalidAlert[0] + scwDateValue +
scwInvalidAlert[1]);
@ -939,34 +931,33 @@
Math.floor(scwDropDownYears / 2), 5, 1);
scwBlnFullInputDate = false;
}
else
{// Test that the date is within range,
else {// Test that the date is within range,
// if not then set date to a sensible date in range.
if ((new Date(scwBaseYear,0,1)) > scwSeedDate)
{if (scwBlnStrict && scwShowOutOfRangeMsg)
if ((new Date(scwBaseYear, 0, 1)) > scwSeedDate) {
if (scwBlnStrict && scwShowOutOfRangeMsg)
alert(scwOutOfRangeMsg);
scwSeedDate = new Date(scwBaseYear, 0, 1);
scwBlnFullInputDate = false;
}
else
{if ((new Date(scwBaseYear+scwDropDownYears,0,0))<
scwSeedDate)
{if (scwBlnStrict && scwShowOutOfRangeMsg)
else {
if ((new Date(scwBaseYear + scwDropDownYears, 0, 0)) <
scwSeedDate) {
if (scwBlnStrict && scwShowOutOfRangeMsg)
alert(scwOutOfRangeMsg);
scwSeedDate = new Date(scwBaseYear +
Math.floor(scwDropDownYears) - 1,
11, 1);
scwBlnFullInputDate = false;
}
else
{if (scwBlnStrict && scwBlnFullInputDate &&
else {
if (scwBlnStrict && scwBlnFullInputDate &&
(scwSeedDate.getDate() != scwArrSeedDate[2] ||
(scwSeedDate.getMonth() + 1) != scwArrSeedDate[1] ||
scwSeedDate.getFullYear() != scwArrSeedDate[0]
)
)
{if (scwShowDoesNotExistMsg) alert(scwDoesNotExistMsg);
) {
if (scwShowDoesNotExistMsg) alert(scwDoesNotExistMsg);
scwSeedDate = new Date(scwSeedDate.getFullYear(),
scwSeedDate.getMonth() - 1, 1);
scwBlnFullInputDate = false;
@ -978,27 +969,27 @@
// Test the disabled dates for validity
// Give error message if not valid.
for (var i=0;i<scwDisabledDates.length;i++)
{if (!((typeof scwDisabledDates[i] == 'object') &&
(scwDisabledDates[i].constructor == Date)))
{if ((typeof scwDisabledDates[i] == 'object') &&
(scwDisabledDates[i].constructor == Array))
{var scwPass = true;
for (var i = 0; i < scwDisabledDates.length; i++) {
if (!((typeof scwDisabledDates[i] == 'object') &&
(scwDisabledDates[i].constructor == Date))) {
if ((typeof scwDisabledDates[i] == 'object') &&
(scwDisabledDates[i].constructor == Array)) {
var scwPass = true;
if (scwDisabledDates[i].length !=2)
{if (scwShowRangeDisablingError)
if (scwDisabledDates[i].length != 2) {
if (scwShowRangeDisablingError)
alert(scwRangeDisablingError[0] +
scwDisabledDates[i] +
scwRangeDisablingError[1]);
scwPass = false;
}
else
{for (var j=0;j<scwDisabledDates[i].length;j++)
{if (!((typeof scwDisabledDates[i][j]
else {
for (var j = 0; j < scwDisabledDates[i].length; j++) {
if (!((typeof scwDisabledDates[i][j]
== 'object') &&
(scwDisabledDates[i][j].constructor
== Date)))
{if (scwShowRangeDisablingError)
== Date))) {
if (scwShowRangeDisablingError)
alert(scwDateDisablingError[0] +
scwDisabledDates[i][j] +
scwDateDisablingError[1]);
@ -1009,11 +1000,10 @@
if (scwPass &&
(scwDisabledDates[i][0] > scwDisabledDates[i][1])
)
{scwDisabledDates[i].reverse();}
) { scwDisabledDates[i].reverse(); }
}
else
{if (scwShowRangeDisablingError)
else {
if (scwShowRangeDisablingError)
alert(scwDateDisablingError[0] +
scwDisabledDates[i] +
scwDateDisablingError[1]);
@ -1037,8 +1027,8 @@
// It requires the following work-around to force SELECTs to display
// correctly.
if (window.opera)
{scwID('scwMonths').style.display = 'none';
if (window.opera) {
scwID('scwMonths').style.display = 'none';
scwID('scwMonths').style.display = 'block';
scwID('scwYears').style.display = 'none';
scwID('scwYears').style.display = 'block';
@ -1073,16 +1063,17 @@
parseInt(scwEle.offsetHeight, 10),
offsetLeft = parseInt(scwEle.offsetLeft, 10);
if (!window.opera)
{while (scwEle.tagName!='BODY' && scwEle.tagName!='HTML')
{offsetTop -=parseInt(scwEle.scrollTop, 10);
if (!window.opera) {
while (scwEle.tagName != 'BODY' && scwEle.tagName != 'HTML') {
offsetTop -= parseInt(scwEle.scrollTop, 10);
offsetLeft -= parseInt(scwEle.scrollLeft, 10);
scwEle = scwEle.parentNode;
}
scwEle = scwTargetEle;
}
do {scwEle=scwEle.offsetParent;
do {
scwEle = scwEle.offsetParent;
offsetTop += parseInt(scwEle.offsetTop, 10);
offsetLeft += parseInt(scwEle.offsetLeft, 10);
}
@ -1091,8 +1082,8 @@
scwID('scw').style.top = offsetTop + 'px';
scwID('scw').style.left = offsetLeft + 'px';
if (scwID('scwIframe'))
{scwID('scwIframe').style.top=offsetTop +'px';
if (scwID('scwIframe')) {
scwID('scwIframe').style.top = offsetTop + 'px';
scwID('scwIframe').style.left = offsetLeft + 'px';
scwID('scwIframe').style.width = (scwID('scw').offsetWidth - 2) + 'px';
scwID('scwIframe').style.height = (scwID('scw').offsetHeight - 2) + 'px';
@ -1112,63 +1103,64 @@
? scwSourceEle.parentNode
: scwSourceEle;
if (typeof event=='undefined')
{el.addEventListener('click',
if (typeof event == 'undefined') {
el.addEventListener('click',
scwStopPropagation,
false);
}
else {if (el.attachEvent)
{el.attachEvent('onclick',scwStopPropagation);}
else {
if (el.attachEvent) { el.attachEvent('onclick', scwStopPropagation); }
else { event.cancelBubble = true; }
}
}
function scwHide()
{scwID('scw').style.visibility='hidden';
if (scwID('scwIframe'))
{scwID('scwIframe').style.visibility='hidden';}
function scwHide() {
scwID('scw').style.visibility = 'hidden';
if (scwID('scwIframe')) { scwID('scwIframe').style.visibility = 'hidden'; }
if (typeof scwNextAction!='undefined' && scwNextAction!=null)
{scwNextActionReturn = scwNextAction();
if (typeof scwNextAction != 'undefined' && scwNextAction != null) {
scwNextActionReturn = scwNextAction();
// Explicit null set to prevent closure causing memory leak
scwNextAction = null;
}
}
function scwCancel(scwEvt)
{if (scwClickToHide) scwHide();
function scwCancel(scwEvt) {
if (scwClickToHide) scwHide();
scwStopPropagation(scwEvt);
}
function scwStopPropagation(scwEvt)
{if (scwEvt.stopPropagation)
function scwStopPropagation(scwEvt) {
if (scwEvt.stopPropagation)
scwEvt.stopPropagation(); // Capture phase
else scwEvt.cancelBubble = true; // Bubbling phase
}
function scwBeginDrag(event)
{var elementToDrag = scwID('scw');
function scwBeginDrag(event) {
var elementToDrag = scwID('scw');
var deltaX = event.clientX,
deltaY = event.clientY,
offsetEle = elementToDrag;
do {deltaX -= parseInt(offsetEle.offsetLeft,10);
do {
deltaX -= parseInt(offsetEle.offsetLeft, 10);
deltaY -= parseInt(offsetEle.offsetTop, 10);
offsetEle = offsetEle.offsetParent;
}
while (offsetEle.tagName != 'BODY' &&
offsetEle.tagName != 'HTML');
if (document.addEventListener)
{document.addEventListener('mousemove',
if (document.addEventListener) {
document.addEventListener('mousemove',
moveHandler,
true); // Capture phase
document.addEventListener('mouseup',
upHandler,
true); // Capture phase
}
else {elementToDrag.attachEvent('onmousemove',
else {
elementToDrag.attachEvent('onmousemove',
moveHandler); // Bubbling phase
elementToDrag.attachEvent('onmouseup',
upHandler); // Bubbling phase
@ -1177,14 +1169,14 @@
scwStopPropagation(event);
function moveHandler(scwEvt)
{if (!scwEvt) scwEvt = window.event;
function moveHandler(scwEvt) {
if (!scwEvt) scwEvt = window.event;
elementToDrag.style.left = (scwEvt.clientX - deltaX) + 'px';
elementToDrag.style.top = (scwEvt.clientY - deltaY) + 'px';
if (scwID('scwIframe'))
{scwID('scwIframe').style.left =
if (scwID('scwIframe')) {
scwID('scwIframe').style.left =
(scwEvt.clientX - deltaX) + 'px';
scwID('scwIframe').style.top =
(scwEvt.clientY - deltaY) + 'px';
@ -1193,18 +1185,19 @@
scwStopPropagation(scwEvt);
}
function upHandler(scwEvt)
{if (!scwEvt) scwEvt = window.event;
function upHandler(scwEvt) {
if (!scwEvt) scwEvt = window.event;
if (document.removeEventListener)
{document.removeEventListener('mousemove',
if (document.removeEventListener) {
document.removeEventListener('mousemove',
moveHandler,
true); // Capture phase
document.removeEventListener('mouseup',
upHandler,
true); // Capture phase
}
else {elementToDrag.detachEvent('onmouseup',
else {
elementToDrag.detachEvent('onmouseup',
upHandler); // Bubbling phase
elementToDrag.detachEvent('onmousemove',
moveHandler); // Bubbling phase
@ -1215,8 +1208,7 @@
}
}
function scwShowMonth(scwBias)
{// Set the selectable Month and Year
function scwShowMonth(scwBias) {// Set the selectable Month and Year
// May be called: from the left and right arrows
// (shift month -1 and +1 respectively)
// from the month selection list
@ -1237,14 +1229,12 @@
scwSelYears = scwID('scwYears');
scwSelMonths = scwID('scwMonths');
if (scwSelYears.options.selectedIndex>-1)
{scwMonthSum=12*(scwSelYears.options.selectedIndex)+scwBias;
if (scwSelMonths.options.selectedIndex>-1)
{scwMonthSum+=scwSelMonths.options.selectedIndex;}
if (scwSelYears.options.selectedIndex > -1) {
scwMonthSum = 12 * (scwSelYears.options.selectedIndex) + scwBias;
if (scwSelMonths.options.selectedIndex > -1) { scwMonthSum += scwSelMonths.options.selectedIndex; }
}
else
{if (scwSelMonths.options.selectedIndex>-1)
{scwMonthSum+=scwSelMonths.options.selectedIndex;}
else {
if (scwSelMonths.options.selectedIndex > -1) { scwMonthSum += scwSelMonths.options.selectedIndex; }
}
scwShowDate.setFullYear(scwBaseYear + Math.floor(scwMonthSum / 12),
@ -1261,8 +1251,8 @@
if ((12 * parseInt((scwShowDate.getFullYear() - scwBaseYear), 10)) +
parseInt(scwShowDate.getMonth(), 10) < (12 * scwDropDownYears) &&
(12 * parseInt((scwShowDate.getFullYear() - scwBaseYear), 10)) +
parseInt(scwShowDate.getMonth(),10) > -1)
{scwSelYears.options.selectedIndex=Math.floor(scwMonthSum/12);
parseInt(scwShowDate.getMonth(), 10) > -1) {
scwSelYears.options.selectedIndex = Math.floor(scwMonthSum / 12);
scwSelMonths.options.selectedIndex = (scwMonthSum % 12);
scwCurMonth = scwShowDate.getMonth();
@ -1278,43 +1268,45 @@
scwStartDate = new Date(scwShowDate);
if (scwID('scwFoot'))
{var scwFoot = scwID('scwFoot');
if (scwID('scwFoot')) {
var scwFoot = scwID('scwFoot');
function scwFootOutput() { scwSetOutput(scwDateNow); }
if (scwDisabledDates.length==0)
{if (scwActiveToday && scwParmActiveToday)
{scwFoot.onclick = scwFootOutput;
if (scwDisabledDates.length == 0) {
if (scwActiveToday && scwParmActiveToday) {
scwFoot.onclick = scwFootOutput;
scwFoot.className = 'scwFoot';
if (scwID('scwIFrame'))
{scwFoot.onmouseover = scwChangeClass;
if (scwID('scwIFrame')) {
scwFoot.onmouseover = scwChangeClass;
scwFoot.onmouseout = scwChangeClass;
}
}
else
{scwFoot.onclick = null;
else {
scwFoot.onclick = null;
scwFoot.className = 'scwFootDisabled';
if (scwID('scwIFrame'))
{scwFoot.onmouseover = null;
if (scwID('scwIFrame')) {
scwFoot.onmouseover = null;
scwFoot.onmouseout = null;
}
if (document.addEventListener)
{scwFoot.addEventListener('click',
if (document.addEventListener) {
scwFoot.addEventListener('click',
scwStopPropagation,
false);
}
else {scwFoot.attachEvent('onclick',
scwStopPropagation);}
else {
scwFoot.attachEvent('onclick',
scwStopPropagation);
}
}
else
{for (var k=0;k<scwDisabledDates.length;k++)
{if (!scwActiveToday || !scwParmActiveToday ||
}
else {
for (var k = 0; k < scwDisabledDates.length; k++) {
if (!scwActiveToday || !scwParmActiveToday ||
((typeof scwDisabledDates[k] == 'object') &&
(((scwDisabledDates[k].constructor == Date) &&
scwDateNow.valueOf() == scwDisabledDates[k].
@ -1328,31 +1320,32 @@
)
)
)
)
{scwFoot.onclick = null;
) {
scwFoot.onclick = null;
scwFoot.className = 'scwFootDisabled';
if (scwID('scwIFrame'))
{scwFoot.onmouseover = null;
if (scwID('scwIFrame')) {
scwFoot.onmouseover = null;
scwFoot.onmouseout = null;
}
if (document.addEventListener)
{scwFoot.addEventListener('click',
if (document.addEventListener) {
scwFoot.addEventListener('click',
scwStopPropagation,
false);
}
else {scwFoot.attachEvent('onclick',
else {
scwFoot.attachEvent('onclick',
scwStopPropagation);
}
break;
}
else
{scwFoot.onclick=scwFootOutput;
else {
scwFoot.onclick = scwFootOutput;
scwFoot.className = 'scwFoot';
if (scwID('scwIFrame'))
{scwFoot.onmouseover = scwChangeClass;
if (scwID('scwIFrame')) {
scwFoot.onmouseover = scwChangeClass;
scwFoot.onmouseout = scwChangeClass;
}
}
@ -1360,21 +1353,21 @@
}
}
function scwSetOutput(scwOutputDate)
{if (typeof scwTargetEle.value == 'undefined')
{scwTriggerEle.scwTextNode.
function scwSetOutput(scwOutputDate) {
if (typeof scwTargetEle.value == 'undefined') {
scwTriggerEle.scwTextNode.
replaceData(0, scwTriggerEle.scwLength,
scwOutputDate.scwFormat(scwDateOutputFormat));
}
else
{scwTargetEle.value =
else {
scwTargetEle.value =
scwOutputDate.scwFormat(scwDateOutputFormat);
}
scwHide();
}
function scwCellOutput(scwEvt)
{var scwEle = scwEventTrigger(scwEvt),
function scwCellOutput(scwEvt) {
var scwEle = scwEventTrigger(scwEvt),
scwOutputDate = new Date(scwStartDate);
if (scwEle.nodeType == 3) scwEle = scwEle.parentNode;
@ -1385,13 +1378,13 @@
scwSetOutput(scwOutputDate);
}
function scwChangeClass(scwEvt)
{var scwEle = scwEventTrigger(scwEvt);
function scwChangeClass(scwEvt) {
var scwEle = scwEventTrigger(scwEvt);
if (scwEle.nodeType == 3) scwEle = scwEle.parentNode;
switch (scwEle.className)
{case 'scwCells':
switch (scwEle.className) {
case 'scwCells':
scwEle.className = 'scwCellsHover';
break;
case 'scwCellsHover':
@ -1425,13 +1418,12 @@
return true;
}
function scwEventTrigger(scwEvt)
{if (!scwEvt) scwEvt = event;
function scwEventTrigger(scwEvt) {
if (!scwEvt) scwEvt = event;
return scwEvt.target || scwEvt.srcElement;
}
function scwWeekNumber(scwInDate)
{// The base day in the week of the input date
function scwWeekNumber(scwInDate) {// The base day in the week of the input date
var scwInDateWeekBase = new Date(scwInDate);
scwInDateWeekBase.setDate(scwInDateWeekBase.getDate()
@ -1450,16 +1442,14 @@
);
if (scwFirstBaseDay <
new Date(scwInDateWeekBase.getFullYear(),0,1))
{scwFirstBaseDay.setDate(scwFirstBaseDay.getDate()+7);}
new Date(scwInDateWeekBase.getFullYear(), 0, 1)) { scwFirstBaseDay.setDate(scwFirstBaseDay.getDate() + 7); }
// Start of Week 01
var scwStartWeekOne = new Date(scwFirstBaseDay
- scwWeekNumberBaseDay
+ scwInDate.getDay());
if (scwStartWeekOne > scwFirstBaseDay)
{scwStartWeekOne.setDate(scwStartWeekOne.getDate()-7);}
if (scwStartWeekOne > scwFirstBaseDay) { scwStartWeekOne.setDate(scwStartWeekOne.getDate() - 7); }
// Subtract the date of the current week from the date of the
// first week of the year to get the number of weeks in
@ -1486,11 +1476,10 @@
var scwCells = scwID('scwCells');
for (i=0;i<scwCells.childNodes.length;i++)
{var scwRows = scwCells.childNodes[i];
if (scwRows.nodeType==1 && scwRows.tagName=='TR')
{if (scwWeekNumberDisplay)
{//Calculate the week number using scwShowDate
for (i = 0; i < scwCells.childNodes.length; i++) {
var scwRows = scwCells.childNodes[i];
if (scwRows.nodeType == 1 && scwRows.tagName == 'TR') {
if (scwWeekNumberDisplay) {//Calculate the week number using scwShowDate
scwTmpEl = scwRows.childNodes[0];
scwTmpEl.innerHTML = scwWeekNumber(scwShowDate);
scwTmpEl.style.borderColor =
@ -1501,13 +1490,12 @@
: '';
scwTmpEl.style.display = '';
}
else
{scwRows.childNodes[0].style.display='none';}
else { scwRows.childNodes[0].style.display = 'none'; }
for (j=1;j<scwRows.childNodes.length;j++)
{var scwCols = scwRows.childNodes[j];
if (scwCols.nodeType==1 && scwCols.tagName=='TD')
{scwRows.childNodes[j].innerHTML=
for (j = 1; j < scwRows.childNodes.length; j++) {
var scwCols = scwRows.childNodes[j];
if (scwCols.nodeType == 1 && scwCols.tagName == 'TD') {
scwRows.childNodes[j].innerHTML =
scwShowDate.getDate();
var scwCell = scwRows.childNodes[j],
scwDisabled =
@ -1550,8 +1538,8 @@
)
) ? 'hidden' : '';
for (var k=0;k<scwDisabledDates.length;k++)
{if ((typeof scwDisabledDates[k]=='object')
for (var k = 0; k < scwDisabledDates.length; k++) {
if ((typeof scwDisabledDates[k] == 'object')
&&
(scwDisabledDates[k].constructor ==
Date
@ -1559,10 +1547,9 @@
&&
scwCompareDateValue ==
scwDisabledDates[k].valueOf()
)
{scwDisabled = true;}
else
{if ((typeof scwDisabledDates[k]=='object')
) { scwDisabled = true; }
else {
if ((typeof scwDisabledDates[k] == 'object')
&&
(scwDisabledDates[k].constructor ==
Array
@ -1573,8 +1560,7 @@
&&
scwCompareDateValue <=
scwDisabledDates[k][1].valueOf()
)
{scwDisabled = true;}
) { scwDisabled = true; }
}
}
@ -1585,11 +1571,11 @@
!scwPassEnabledDay[(j - 1 + (7 * (i * scwCells.
childNodes.
length / 6))) % 7]
)
{scwRows.childNodes[j].onclick = null;
) {
scwRows.childNodes[j].onclick = null;
if (scwID('scwIFrame'))
{scwRows.childNodes[j].onmouseover = null;
if (scwID('scwIFrame')) {
scwRows.childNodes[j].onmouseover = null;
scwRows.childNodes[j].onmouseout = null;
}
@ -1613,11 +1599,11 @@
? document.defaultView.getComputedStyle(scwCell, null).getPropertyValue('background-color')
: '';
}
else
{scwRows.childNodes[j].onclick=scwCellOutput;
else {
scwRows.childNodes[j].onclick = scwCellOutput;
if (scwID('scwIFrame'))
{scwRows.childNodes[j].onmouseover =
if (scwID('scwIFrame')) {
scwRows.childNodes[j].onmouseover =
scwChangeClass;
scwRows.childNodes[j].onmouseout =
scwChangeClass;
@ -1720,12 +1706,12 @@
"<tbody id='scwCells' " +
"onClick='scwStopPropagation(event);'>");
for (i=0;i<6;i++)
{document.write(
for (i = 0; i < 6; i++) {
document.write(
"<tr>" +
"<td class='scwWeekNo' id='scwWeek_" + i + "'></td>");
for (j=0;j<7;j++)
{document.write(
for (j = 0; j < 7; j++) {
document.write(
"<td class='scwCells' id='scwCell_" + (j + (i * 7)) +
"'></td>");
}
@ -1738,8 +1724,8 @@
"</tbody>");
if ((new Date(scwBaseYear + scwDropDownYears, 0, 0)) > scwDateNow &&
(new Date(scwBaseYear, 0, 0)) < scwDateNow)
{document.write(
(new Date(scwBaseYear, 0, 0)) < scwDateNow) {
document.write(
"<tfoot class='scwFoot'>" +
"<tr class='scwFoot'>" +
"<td class='scwFoot' id='scwFoot' colspan='8'>" +
@ -1754,8 +1740,8 @@
"</tr>" +
"</table>");
if (document.addEventListener)
{scwID('scw' ).addEventListener('click',scwCancel,false);
if (document.addEventListener) {
scwID('scw').addEventListener('click', scwCancel, false);
scwID('scwHeadLeft').addEventListener('click', scwStopPropagation, false);
scwID('scwMonths').addEventListener('click', scwStopPropagation, false);
scwID('scwMonths').addEventListener('change', scwStopPropagation, false);
@ -1763,7 +1749,8 @@
scwID('scwYears').addEventListener('change', scwStopPropagation, false);
scwID('scwHeadRight').addEventListener('click', scwStopPropagation, false);
}
else {scwID('scw' ).attachEvent('onclick',scwCancel);
else {
scwID('scw').attachEvent('onclick', scwCancel);
scwID('scwHeadLeft').attachEvent('onclick', scwStopPropagation);
scwID('scwMonths').attachEvent('onclick', scwStopPropagation);
scwID('scwMonths').attachEvent('onchange', scwStopPropagation);
@ -1779,8 +1766,7 @@
// Start of document level event definition
// ****************************************
if (document.addEventListener)
{document.addEventListener('click',scwHide, false);}
if (document.addEventListener) { document.addEventListener('click', scwHide, false); }
else { document.attachEvent('onclick', scwHide); }
// ****************************************

View File

@ -176,6 +176,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['only_image'] = false;
$params['menu'] = false;
$params['disable_black'] = true;
$params_combined = json_decode($data_combined, true);
$module_list = json_decode($data_module_list, true);
@ -219,6 +220,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
break;
case 'pie_chart':
$params['pdf'] = true;
echo flot_pie_chart(
$params['values'],
$params['keys'],
@ -234,10 +236,12 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
break;
case 'vbar':
$params['pdf'] = true;
echo flot_vcolumn_chart($params);
break;
case 'hbar':
$params['pdf'] = true;
echo flot_hcolumn_chart(
$params['chart_data'],
$params['width'],
@ -248,11 +252,13 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['backgroundColor'],
$params['tick_color'],
$params['val_min'],
$params['val_max']
$params['val_max'],
$params['pdf']
);
break;
case 'ring_graph':
$params['pdf'] = true;
echo flot_custom_pie_chart(
$params['chart_data'],
$params['width'],
@ -271,7 +277,8 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['homeurl'],
$params['background_color'],
$params['legend_position'],
$params['background_color']
$params['background_color'],
$params['pdf']
);
break;

View File

@ -312,7 +312,7 @@ class AgentWizard extends HTML
$this->idPolicy = get_parameter('id', '');
$this->targetIp = get_parameter('targetIp', '');
if (!empty($this->idAgent)) {
if (empty($this->idAgent) === false) {
$array_aux = db_get_all_rows_sql(
sprintf(
'SELECT ip FROM taddress ta
@ -1582,6 +1582,10 @@ class AgentWizard extends HTML
if ($candidate['execution_type'] === 0
|| $candidate['execution_type'] === EXECUTION_TYPE_NETWORK
) {
if (substr($candidate['value'], 0, 1) !== '.') {
$candidate['value'] = '.'.$candidate['value'];
}
if ($this->serverType === SERVER_TYPE_ENTERPRISE_SATELLITE) {
$values['id_module'] = MODULE_DATA;
$values['module_interval'] = 1;
@ -1687,6 +1691,20 @@ class AgentWizard extends HTML
)
);
if ($this->wizardSection === 'snmp_interfaces_explorer'
&& empty($candidate['macros']) === false
) {
// Use definition provided.
$values['id_plugin'] = $candidate['id_plugin'];
$values['macros'] = base64_decode($candidate['macros']);
} else {
$fieldsPlugin = db_get_value_sql(
sprintf(
'SELECT macros FROM tplugin WHERE id=%d',
(int) $infoMacros['server_plugin']
)
);
if ($fieldsPlugin !== false) {
$fieldsPlugin = json_decode($fieldsPlugin, true);
$i = 1;
@ -1711,6 +1729,7 @@ class AgentWizard extends HTML
$values['macros'] = json_encode($fieldsPlugin);
}
}
}
} else if ($this->protocol === 'wmi') {
if ($candidate['execution_type'] === EXECUTION_TYPE_NETWORK) {
// Generals fields.
@ -1947,6 +1966,10 @@ class AgentWizard extends HTML
|| $candidate['execution_type'] === EXECUTION_TYPE_NETWORK
) {
if ($this->serverType === SERVER_TYPE_ENTERPRISE_SATELLITE) {
if (substr($candidate['value'], 0, 1) !== '.') {
$candidate['value'] = '.'.$candidate['value'];
}
$tmp->module_interval(300);
$tmp->id_modulo(MODULE_DATA);
$tmp->updateConfigurationData(
@ -2086,7 +2109,7 @@ class AgentWizard extends HTML
$tmp->id_modulo(MODULE_PLUGIN);
if ($this->wizardSection === 'snmp_interfaces_explorer'
&& empty($candidate['macros']) === true
&& empty($candidate['macros']) === false
) {
// Use definition provided.
$tmp->id_plugin($candidate['id_plugin']);

View File

@ -729,37 +729,24 @@ class AgentsAlerts extends HTML
public function loadHeader()
{
if ($this->pure == 0) {
// Breadcrums.
$this->setBreadcrum([]);
$this->prepareBreadcrum(
[
[
'link' => '',
'label' => __('Monitoring'),
'selected' => false,
],
[
'link' => '',
'label' => __('Views'),
'selected' => true,
],
],
true
);
ui_print_page_header(
// Header.
ui_print_standard_header(
__('Agents/Alerts'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
);
}

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