Merge remote-tracking branch 'origin/ent-EDF' into ent-4769-modulos-ssh-php-perl

This commit is contained in:
fbsanchez 2019-11-05 15:40:14 +01:00
commit f4f618c1da
92 changed files with 8686 additions and 1290 deletions

BIN
extras/bin/gotty Executable file

Binary file not shown.

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.740
Version: 7.0NG.740-191029
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.740"
pandora_version="7.0NG.740-191029"
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

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.740';
use constant AGENT_BUILD => '191028';
use constant AGENT_BUILD => '191029';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.740
%define release 1
%define release 191029
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.740
%define release 1
%define release 191029
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.740"
PI_BUILD="191028"
PI_BUILD="191029"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{191028}
{191029}
ViewReadme
{Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No}
Windows,Executable
{<%AppName%>-Setup<%Ext%>}
{<%AppName%>-<%Version%>-Setup<%Ext%>}
Windows,FileDescription
{<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.740(Build 191028)")
#define PANDORA_VERSION ("7.0NG.740(Build 191029)")
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.740(Build 191028))"
VALUE "ProductVersion", "(7.0NG.740(Build 191029))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.740
Version: 7.0NG.740-191029
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.740"
pandora_version="7.0NG.740-191029"
package_pear=0
package_pandora=1

View File

@ -1,5 +1,5 @@
{
"name": "Pandora FMS",
"name": "pandorafms/console",
"description": "Pandora Flexible Monitoring System ",
"authors": [
{
@ -14,7 +14,9 @@
"autoload": {
"psr-4": {
"Models\\": "include/rest-api/models",
"Enterprise\\Models\\": "enterprise/include/rest-api/models"
"Enterprise\\Models\\": "enterprise/include/rest-api/models",
"PandoraFMS\\": "include/lib",
"PandoraFMS\\Enterprise\\": "enterprise/include/lib"
}
},
"autoload-dev": {

View File

@ -0,0 +1,503 @@
<?php
/**
* Quick Shell extension.
*
* @category Extension
* @package Pandora FMS
* @subpackage QuickShell
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
/**
* Show Quick Shell interface.
*
* @return void
*/
function quickShell()
{
global $config;
check_login();
if (check_acl($config['id_user'], 0, 'PM') === false) {
db_pandora_audit(
'ACL Violation',
'Trying to access Profile Management'
);
include 'general/noaccess.php';
return;
}
$agent_id = get_parameter('id_agente', 0);
$username = get_parameter('username', null);
$method = get_parameter('method', null);
$method_port = get_parameter('port', null);
// Retrieve main IP Address.
$address = agents_get_address($agent_id);
ui_require_css_file('wizard');
ui_require_css_file('discovery');
// Settings.
// WebSocket host, where to connect.
if (isset($config['ws_host']) === false) {
config_update_value('ws_host', $_SERVER['SERVER_ADDR']);
}
if (isset($config['ws_port']) === false) {
config_update_value('ws_port', 8080);
}
if (empty($config['ws_proxy_url']) === true) {
$ws_url = 'http://'.$config['ws_host'].':'.$config['ws_port'];
} else {
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
if (isset($_SERVER['HTTPS']) === true) {
$ws_url = 'https://'.$matches[1];
} else {
$ws_url = 'http://'.$matches[1];
}
}
// Gotty settings. Internal communication (WS).
if (isset($config['gotty_host']) === false) {
config_update_value('gotty_host', '127.0.0.1');
}
if (isset($config['gotty_telnet_port']) === false) {
config_update_value('gotty_telnet_port', 8082);
}
if (isset($config['gotty_ssh_port']) === false) {
config_update_value('gotty_ssh_port', 8081);
}
// Username. Retrieve from form.
if (empty($username) === true) {
// No username provided, ask for it.
$wiz = new Wizard();
$test = file_get_contents($ws_url);
if ($test === false) {
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
$wiz->printForm(
[
'form' => [
'method' => 'POST',
'action' => '#',
],
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('Retry'),
'type' => 'submit',
'attributes' => 'class="sub next"',
'return' => true,
],
],
],
]
);
return;
}
$wiz->printForm(
[
'form' => [
'action' => '#',
'class' => 'wizard',
'method' => 'post',
],
'inputs' => [
[
'label' => __('Username'),
'arguments' => [
'type' => 'text',
'name' => 'username',
],
],
[
'label' => __('Port'),
'arguments' => [
'type' => 'text',
'id' => 'port',
'name' => 'port',
'value' => 22,
],
],
[
'label' => __('Method'),
'arguments' => [
'type' => 'select',
'name' => 'method',
'fields' => [
'ssh' => __('SSH'),
'telnet' => __('Telnet'),
],
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
],
],
[
'arguments' => [
'type' => 'submit',
'label' => __('Connect'),
'attributes' => 'class="sub next"',
],
],
],
],
false,
true
);
return;
}
// Initialize Gotty Client.
$host = $config['gotty_host'];
if ($method == 'ssh') {
// SSH.
$port = $config['gotty_ssh_port'];
$command_arguments = "var args = '?arg=".$username.'@'.$address;
$command_arguments .= '&arg=-p '.$method_port."';";
} else if ($method == 'telnet') {
// Telnet.
$port = $config['gotty_telnet_port'];
$command_arguments = "var args = '?arg=-l ".$username;
$command_arguments .= '&arg='.$address;
$command_arguments .= '&arg='.$method_port."';";
} else {
ui_print_error_message(__('Please use SSH or Telnet.'));
return;
}
// If rediretion is enabled, we will try to connect to http:// or https:// endpoint.
$test = get_headers($ws_url);
if ($test === false) {
if (empty($wiz) === true) {
$wiz = new Wizard();
}
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
echo $wiz->printGoBackButton('#');
return;
}
// Check credentials.
$auth_str = '';
$gotty_url = $host.':'.$port;
if (empty($config['gotty_user']) === false
&& empty($config['gotty_pass']) === false
) {
$auth_str = $config['gotty_user'].':'.$config['gotty_pass'];
$gotty_url = $auth_str.'@'.$host.':'.$port;
}
$r = file_get_contents('http://'.$gotty_url.'/js/hterm.js');
if (empty($r) === true) {
if (empty($wiz) === true) {
$wiz = new Wizard();
}
ui_print_error_message(__('WebService engine is not working properly, please check documentation.'));
echo $wiz->printGoBackButton('#');
return;
}
// Override gotty client settings.
if (empty($auth_str) === true) {
$r .= "var gotty_auth_token = '';";
} else {
$r .= "var gotty_auth_token = '";
$r .= $auth_str."';";
}
// Set websocket target and method.
$gotty = file_get_contents('http://'.$gotty_url.'/js/gotty.js');
$url = "var url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws';";
if (empty($config['ws_proxy_url']) === true) {
$new = "var url = (httpsEnabled ? 'wss://' : 'ws://')";
$new .= " + window.location.host + ':";
$new .= $config['ws_port'].'/'.$method."';";
} else {
$new = "var url = '";
$new .= $config['ws_proxy_url'].'/'.$method."';";
}
// Update url.
$gotty = str_replace($url, $new, $gotty);
// Update websocket arguments.
$args = 'var args = window.location.search;';
$new = $command_arguments;
// Update arguments.
$gotty = str_replace($args, $new, $gotty);
?>
<style>#terminal {
height: 650px;
width: 100%;
margin: 0px;
padding: 0;
}
#terminal > iframe {
position: relative!important;
}
</style>
<div id="terminal"></div>
<script type="text/javascript">
<?php echo $r; ?>
</script>
<script type="text/javascript">
<?php echo $gotty; ?>
</script>
<?php
}
/**
* Provide an interface where configure all settings.
*
* @return void
*/
function quickShellSettings()
{
global $config;
ui_require_css_file('wizard');
ui_require_css_file('discovery');
// Parser.
// Gotty settings. Internal communication (WS).
$gotty = get_parameter(
'gotty',
$config['gotty']
);
$gotty_host = get_parameter(
'gotty_host',
$config['gotty_host']
);
$gotty_ssh_port = get_parameter(
'gotty_ssh_port',
$config['gotty_ssh_port']
);
$gotty_telnet_port = get_parameter(
'gotty_telnet_port',
$config['gotty_telnet_port']
);
$gotty_user = get_parameter(
'gotty_user',
$config['gotty_user']
);
$gotty_pass = get_parameter(
'gotty_pass',
io_output_password($config['gotty_pass'])
);
$gotty_pass = io_input_password($gotty_pass);
$changes = 0;
$critical = 0;
if ($config['gotty'] != $gotty) {
config_update_value('gotty', $gotty);
$changes++;
$critical++;
}
if ($config['gotty_host'] != $gotty_host) {
config_update_value('gotty_host', $gotty_host);
$changes++;
}
if ($config['gotty_telnet_port'] != $gotty_telnet_port) {
config_update_value('gotty_telnet_port', $gotty_telnet_port);
$changes++;
}
if ($config['gotty_ssh_port'] != $gotty_ssh_port) {
config_update_value('gotty_ssh_port', $gotty_ssh_port);
$changes++;
}
if ($config['gotty_user'] != $gotty_user) {
config_update_value('gotty_user', $gotty_user);
$changes++;
$critical++;
}
if ($config['gotty_pass'] != $gotty_pass) {
config_update_value('gotty_pass', $gotty_pass);
$changes++;
$critical++;
}
// Interface.
ui_print_page_header(__('QuickShell settings'));
if ($changes > 0) {
$msg = __('%d Updated', $changes);
if ($critical > 0) {
$msg = __(
'%d Updated, please restart WebSocket engine service',
$changes
);
}
ui_print_success_message($msg);
}
// Form.
$wiz = new Wizard();
$wiz->printForm(
[
'form' => [
'action' => '#',
'class' => 'wizard',
'method' => 'post',
],
'inputs' => [
[
'label' => __('Gotty path').ui_print_help_tip(
__('Leave blank if using an external Gotty service')
),
'arguments' => [
'type' => 'text',
'name' => 'gotty',
'value' => $config['gotty'],
],
],
[
'label' => __('Gotty host'),
'arguments' => [
'type' => 'text',
'name' => 'gotty_host',
'value' => $config['gotty_host'],
],
],
[
'label' => __('Gotty ssh port'),
'arguments' => [
'type' => 'text',
'name' => 'gotty_ssh_port',
'value' => $config['gotty_ssh_port'],
],
],
[
'label' => __('Gotty telnet port'),
'arguments' => [
'type' => 'text',
'name' => 'gotty_telnet_port',
'value' => $config['gotty_telnet_port'],
],
],
[
'label' => __('Gotty user').ui_print_help_tip(
__('Optional, set a user to access gotty service')
),
'arguments' => [
'type' => 'text',
'name' => 'gotty_user',
'value' => $config['gotty_user'],
],
],
[
'label' => __('Gotty password').ui_print_help_tip(
__('Optional, set a password to access gotty service')
),
'arguments' => [
'type' => 'password',
'name' => 'gotty_pass',
'value' => io_output_password($config['gotty_pass']),
],
],
[
'arguments' => [
'type' => 'submit',
'label' => __('Update'),
'attributes' => 'class="sub next"',
],
],
],
],
false,
true
);
}
// This extension is usefull only if the agent has associated IP.
$agent_id = get_parameter('id_agente');
if (empty($agent_id) === false
&& get_parameter('sec2', '') == 'operation/agentes/ver_agente'
) {
$address = agents_get_address($agent_id);
if (empty($address) === false) {
// Extension registration.
extensions_add_opemode_tab_agent(
// TabId.
'quick_shell',
// TabName.
__('QuickShell'),
// TabIcon.
'images/ehorus/terminal.png',
// TabFunction.
'quickShell',
// Version.
'N/A',
// Acl.
'PM'
);
}
}
extensions_add_godmode_menu_option(
// Name.
__('QuickShell settings'),
// Acl.
'PM',
// FatherId.
'gextensions',
// Icon.
'images/ehorus/terminal.png',
// Version.
'N/A',
// SubfatherId.
null
);
extensions_add_godmode_function('quickShellSettings');

View File

@ -238,19 +238,6 @@ function output_xml_report($id)
echo '<line_separator><![CDATA['.io_safe_output($item['line_separator']).']]></line_separator>';
echo '<column_separator><![CDATA['.io_safe_output($item['header_definition']).']]></column_separator>';
break;
/*
case 'TTRT':
break;
case 'TTO':
break;
case 'MTBF':
break;
case 'MTTR':
break;*/
}
echo "</item>\n";

View File

@ -375,19 +375,6 @@ function process_upload_xml_report($xml, $group_filter=0)
$values['line_separator'] = io_safe_input($item['line_separator']);
$values['column_separator'] = io_safe_input($item['column_separator']);
break;
/*
case 'TTRT':
break;
case 'TTO':
break;
case 'MTBF':
break;
case 'MTTR':
break;*/
}
if (empty($agents_item)) {

View File

@ -0,0 +1,66 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
require_once __DIR__.'/../include/config.php';
require_once __DIR__.'/../include/auth/mysql.php';
require_once __DIR__.'/../include/functions.php';
require_once __DIR__.'/../include/functions_db.php';
/*
* Review if sample agent is active and deploys configuration for
* visual consoles if necessary
*/
global $config;
// Deployment of sample agent for visual consoles.
if ($config['sample_agent'] == 1 && !isset($config['sample_agent_deployed'])) {
$id_agente = db_get_sql('SELECT id_agente FROM tagente WHERE nombre = "Sample_Agent";');
$modules = db_get_all_rows_filter('tagente_modulo', ['id_agente' => $id_agente], 'id_agente_modulo');
$count_modules = count($modules);
// Update of layout 1 (Rack sample).
$images_rack_server = [
'rack_server_rack',
'rack_server',
'rack_switch',
'rack_firewall',
'rack_double_server',
'rack_frame',
'rack_pdu',
];
$query = 'UPDATE `tlayout_data` SET `id_agent` = '.$id_agente.', `id_agente_modulo` = CASE ';
for ($i = 0; $i < $count_modules; $i++) {
$query .= 'WHEN `image` = "'.$images_rack_server[$i].'" THEN '.$modules[$i]['id_agente_modulo'].' ';
}
$query .= 'END WHERE `id_layout` = 1 AND `image` IN ("'.implode('","', $images_rack_server).'");';
db_process_sql($query);
// Update of layout 2 (Dashboard).
$query = 'UPDATE `tlayout_data` SET `id_agent`= '.$id_agente.', `id_agente_modulo` = CASE ';
$query .= 'WHEN `id` = 107 THEN '.$modules[0]['id_agente_modulo'].' ';
$query .= 'WHEN `id` = 108 THEN '.$modules[1]['id_agente_modulo'].' ';
$query .= 'WHEN `id` = 109 THEN '.$modules[2]['id_agente_modulo'].' ';
$query .= 'WHEN `id` = 110 THEN '.$modules[2]['id_agente_modulo'].' ';
$query .= 'WHEN `id` = 111 THEN '.$modules[3]['id_agente_modulo'].' ';
$query .= 'WHEN `id` = 112 THEN '.$modules[4]['id_agente_modulo'].' ';
$query .= 'WHEN `id` = 113 THEN '.$modules[5]['id_agente_modulo'].' ';
$query .= 'WHEN `id` = 114 THEN '.$modules[6]['id_agente_modulo'].' ';
$query .= 'END WHERE `id_layout` = 2 AND `id` IN (107,108,109,110,111,112,113,114);';
db_process_sql($query);
// This setting will avoid regenerate all the times the visual consoles.
config_update_value('sample_agent_deployed', 1);
}
extensions_add_main_function('sample_agent_deployment');

View File

@ -1,9 +1,11 @@
START TRANSACTION;
ALTER TABLE `tlayout_template_data` ADD COLUMN `cache_expiration` INTEGER UNSIGNED NOT NULL DEFAULT 0;
INSERT INTO `ttipo_modulo` VALUES
(34,'remote_cmd', 10, 'Remote execution, numeric data', 'mod_remote_cmd.png'),
(35,'remote_cmd_proc', 10, 'Remote execution, boolean data', 'mod_remote_cmd_proc.png'),
(36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'),
(37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png');
COMMIT;
COMMIT;

View File

@ -1,796 +1,2 @@
<script type="text/javascript">
function effectFadeOut() {
$('.content').fadeOut(800).fadeIn(800)
}
$(document).ready(function(){
setInterval(effectFadeOut, 1600);
});
</script>
<?php
// Pandora FMS - the Flexible Monitoring System
// ============================================
// Copyright (c) 2010 Artica Soluciones Tecnologicas, http://www.artica.es
// Please see http://pandora.sourceforge.net 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.
global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to change License settings');
include 'general/noaccess.php';
return;
}
$update_settings = (bool) get_parameter_post('update_settings');
if ($update_settings) {
foreach ($_POST['keys'] as $key => $value) {
db_process_sql_update(
'tupdate_settings',
[db_escape_key_identifier('value') => $value],
[db_escape_key_identifier('key') => $key]
);
}
ui_print_success_message(__('License updated'));
}
ui_require_javascript_file_enterprise('load_enterprise');
enterprise_include_once('include/functions_license.php');
$license = enterprise_hook('license_get_info');
$rows = db_get_all_rows_in_table('tupdate_settings');
$settings = new StdClass;
foreach ($rows as $row) {
$settings->{$row['key']} = $row['value'];
}
echo '<script type="text/javascript">';
if (enterprise_installed()) {
print_js_var_enteprise();
}
echo '</script>';
function render_info($table)
{
global $console_mode;
$info = db_get_sql("SELECT COUNT(*) FROM $table");
render_row($info, "DB Table $table");
}
function render_info_data($query, $label)
{
global $console_mode;
$info = db_get_sql($query);
render_row($info, $label);
}
function render_row($data, $label)
{
global $console_mode;
if ($console_mode == 1) {
echo $label;
echo '|';
echo $data;
echo "\n";
} else {
echo '<tr>';
echo "<td style='padding:2px;border:0px;' width='60%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$label;
echo '</div></td>';
echo "<td style='font-weight:bold;padding:2px;border:0px;' width='40%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>".$data;
echo '</div></td>';
echo '</tr>';
}
}
function get_value_sum($arr)
{
foreach ($arr as $clave) {
foreach ($clave as $valor) {
if (is_numeric($valor) === true) {
$result += $valor;
}
}
}
return $result;
}
function execution_time()
{
$times = db_get_all_rows_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = 29 ORDER BY utimestamp DESC LIMIT 2');
if ($times[0]['datos'] > ($times[1]['datos'] * 1.2)) {
return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>";
} else {
return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For more information about this data, check the Execution Time graph</a>";
}
}
function get_logs_size($file)
{
$file_name = '/var'.$file.'';
$size_server_log = filesize($file_name);
return $size_server_log;
}
function get_status_logs($path)
{
$status_server_log = '';
$size_server_log = number_format(get_logs_size($path));
$size_server_log = (0 + str_replace(',', '', $size_server_log));
if ($size_server_log <= 10485760) {
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>";
} else {
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>";
}
return $status_server_log;
}
function percentage_modules_per_agent()
{
$status_average_modules = '';
$total_agents = db_get_value_sql('SELECT count(*) FROM tagente');
$total_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo');
$average_modules_per_agent = ($total_modules / $total_agents);
if ($average_modules_per_agent <= 40) {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The average of modules per agent is less than 40</a>";
} else {
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbspThe average of modules per agent is more than 40. You can have performance problems</a>";
}
return $status_average_modules;
}
function license_capacity()
{
$license = enterprise_hook('license_get_info');
$license_limit = $license['limit'];
$status_license_capacity = '';
$current_count = db_get_value_sql('SELECT count(*) FROM tagente');
if ($current_count > ($license_limit * 90 / 100)) {
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp License capacity exceeds 90 percent</a>";
} else {
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp License capacity is less than 90 percent</a>";
}
return $status_license_capacity;
}
function status_license_params($license_param)
{
$status_license_par = '';
if ($license_param <= 0) {
$status_license_par = 'OFF';
} else {
$status_license_par = 'ON';
}
return $status_license_par;
}
function interval_average_of_network_modules()
{
$total_network_modules = db_get_value_sql('SELECT count(*) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18');
$total_module_interval_time = db_get_value_sql('SELECT SUM(module_interval) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18');
$average_time = ((int) $total_module_interval_time / $total_network_modules);
if ($average_time < 180) {
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system is overloaded (average time $average_time) and a very fine configuration is required</a>";
} else {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system is not overloaded (average time $average_time) </a>";
}
if ($average_time == 0) {
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has no load</a>";
}
return $status_average_modules;
}
$attachment_total_files = count(glob($config['homedir'].'/attachment/{*.*}', GLOB_BRACE));
function files_attachment_folder($total_files)
{
if ($total_files <= 700) {
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attached folder contains less than 700 files.</a>";
} else {
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attached folder contains more than 700 files.</a>";
}
return $status_total_files;
}
$tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
function status_tagente_datos($tagente_datos_size)
{
if ($tagente_datos_size <= 3000000) {
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table contains an acceptable amount of data.</a>";
} else {
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table contains too much data. A historical database is recommended.</a>";
}
return $tagente_datos_size;
}
function status_values($val_rec, $val)
{
if ($val_rec <= $val) {
return $val."<a style='text-decoration: none;'> (Min. Recommended Value </a>".$val_rec.'<a>)</a>';
} else {
return $val."<a style='text-decoration: none;'> (Min. Recommended Value </a>".$val_rec."<a>)</a><a class= 'content' style ='color: red;text-decoration: none;'> Warning Status</a>";
}
}
$tables_fragmentation = db_get_sql(
"SELECT (data_free/(index_length+data_length))
as frag_ratio from information_schema.tables where DATA_FREE > 0 and table_name='tagente_datos' and table_schema='pandora'"
);
$db_size = db_get_all_rows_sql(
'SELECT table_schema,
ROUND(SUM(data_length+index_length)/1024/1024,3)
FROM information_schema.TABLES
GROUP BY table_schema;'
);
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
$total_server_threads = shell_exec('ps -T aux | grep pandora_server | grep -v grep | wc -l');
$percentage_threads_ram = shell_exec("ps axo pmem,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
$percentage_threads_cpu = shell_exec("ps axo pcpu,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
}
$path_server_logs = '/log/pandora/pandora_server.log';
$path_err_logs = '/log/pandora/pandora_server.error';
$path_console_logs = '/www/html/pandora_console/pandora_console.log';
$innodb_log_file_size_min_rec_value = '64M';
$innodb_log_buffer_size_min_rec_value = '16M';
$innodb_flush_log_at_trx_commit_min_rec_value = 0;
$query_cache_limit_min_rec_value = 2;
$max_allowed_packet_min_rec_value = 32;
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
$sort_buffer_size_min_rec_value = 32;
$join_buffer_size_min_rec_value = 265;
$query_cache_type_min_rec_value = 'ON';
$query_cache_size_min_rec_value = 24;
$innodb_lock_wait_timeout_max_rec_value = 120;
$tables_fragmentation_max_rec_value = 10;
$thread_cache_size_max_rec_value = 8;
$thread_stack_min_rec_value = 256;
$max_connections_max_rec_value = 150;
$key_buffer_size_min_rec_value = 256;
$read_buffer_size_min_rec_value = 32;
$read_rnd_buffer_size_min_rec_value = 32;
$query_cache_min_res_unit_min_rec_value = 2;
$innodb_file_per_table_min_rec_value = 1;
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation)
{
$status_tables_frag = '';
if ($tables_fragmentation > $tables_fragmentation_max_rec_value) {
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp Table fragmentation is higher than recommended. They should be defragmented.</a>";
} else {
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp Table fragmentation is correct.</a>";
}
return $status_tables_frag;
}
$console_mode = 1;
if (!isset($argc)) {
$console_mode = 0;
}
if ($console_mode == 1) {
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
if ($argc == 1 || in_array($argv[1], ['--help', '-help', '-h', '-?'])) {
echo "\nThis command line script contains information about Pandora FMS database.
This program can only be executed from the console, and it needs a parameter, the
full path to Pandora FMS 'config.php' file.
Usage:
php pandora_diag.php path_to_pandora_console
Example:
php pandora_diag.php /var/www/pandora_console
";
exit;
}
if (preg_match('/[^a-zA-Z0-9_\/\.]|(\/\/)|(\.\.)/', $argv[1])) {
echo "Invalid path: $argv[1]. Always use absolute paths.";
exit;
}
include $argv[1].'/include/config.php';
} else {
if (file_exists('../include/config.php')) {
include '../include/config.php';
}
// Not from console, this is a web session.
if ((!isset($config['id_user'])) || (!check_acl($config['id_user'], 0, 'PM'))) {
echo "<h2>You don't have privileges to use diagnostic tool</h2>";
echo '<p>Please login with an administrator account before try to use this tool</p>';
exit;
}
// Header.
ui_print_page_header(
__('Pandora FMS Diagnostic tool'),
'',
false,
'diagnostic_tool_tab',
true
);
echo "<table id='diagnostic_info' width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
}
render_row($build_version, 'Pandora FMS Build');
render_row($pandora_version, 'Pandora FMS Version');
render_info_data("SELECT value FROM tconfig where token ='MR'", 'Minor Release');
render_row($config['homedir'], 'Homedir');
render_row($config['homeurl'], 'HomeUrl');
render_info_data(
"SELECT `value`
FROM tconfig
WHERE `token` = 'enterprise_installed'",
'Enterprise installed'
);
$full_key = db_get_sql(
"SELECT value
FROM tupdate_settings
WHERE `key` = 'customer_key'"
);
$compressed_key = substr($full_key, 0, 5).'...'.substr($full_key, -5);
render_row($compressed_key, 'Update Key');
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE `key` = 'updating_code_path'",
'Updating code path'
);
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE `key` = 'current_update'",
'Current Update #'
);
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('PHP setup').'</th></tr>';
render_row(phpversion(), 'PHP Version');
render_row(ini_get('max_execution_time').'&nbspseconds', 'PHP Max execution time');
render_row(ini_get('max_input_time').'&nbspseconds', 'PHP Max input time');
render_row(ini_get('memory_limit'), 'PHP Memory limit');
render_row(ini_get('session.cookie_lifetime'), 'Session cookie lifetime');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database size stats').'</th></tr>';
render_info_data('SELECT COUNT(*) FROM tagente', 'Total agents');
render_info_data('SELECT COUNT(*) FROM tagente_modulo', 'Total modules');
render_info_data('SELECT COUNT(*) FROM tgrupo', 'Total groups');
render_info_data('SELECT COUNT(*) FROM tagente_datos', 'Total module data records');
render_info_data('SELECT COUNT(*) FROM tagent_access', 'Total agent access record');
render_info_data('SELECT COUNT(*) FROM tevento', 'Total events');
if ($config['enterprise_installed']) {
render_info_data('SELECT COUNT(*) FROM ttrap', 'Total traps');
}
render_info_data('SELECT COUNT(*) FROM tusuario', 'Total users');
render_info_data('SELECT COUNT(*) FROM tsesion', 'Total sessions');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database sanity').'</th></tr>';
render_info_data(
'SELECT COUNT( DISTINCT tagente.id_agente)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND tagente_estado.id_agente = tagente.id_agente
AND tagente_estado.estado = 3',
'Total unknown agents'
);
render_info_data(
'SELECT COUNT(tagente_estado.estado)
FROM tagente_estado
WHERE tagente_estado.estado = 4',
'Total not-init modules'
);
$last_run_difference = '';
$diferencia = (time() - date(
db_get_sql(
"SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'"
)
));
$last_run_difference_months = 0;
$last_run_difference_weeks = 0;
$last_run_difference_days = 0;
$last_run_difference_minutos = 0;
$last_run_difference_seconds = 0;
while ($diferencia >= 2419200) {
$diferencia -= 2419200;
$last_run_difference_months++;
}
while ($diferencia >= 604800) {
$diferencia -= 604800;
$last_run_difference_weeks++;
}
while ($diferencia >= 86400) {
$diferencia -= 86400;
$last_run_difference_days++;
}
while ($diferencia >= 3600) {
$diferencia -= 3600;
$last_run_difference_hours++;
}
while ($diferencia >= 60) {
$diferencia -= 60;
$last_run_difference_minutes++;
}
$last_run_difference_seconds = $diferencia;
if ($last_run_difference_months > 0) {
$last_run_difference .= $last_run_difference_months.'month/s ';
}
if ($last_run_difference_weeks > 0) {
$last_run_difference .= $last_run_difference_weeks.' week/s ';
}
if ($last_run_difference_days > 0) {
$last_run_difference .= $last_run_difference_days.' day/s ';
}
if ($last_run_difference_hours > 0) {
$last_run_difference .= $last_run_difference_hours.' hour/s ';
}
if ($last_run_difference_minutes > 0) {
$last_run_difference .= $last_run_difference_minutes.' minute/s ';
}
$last_run_difference .= $last_run_difference_seconds.' second/s ago';
render_row(
date(
'Y/m/d H:i:s',
db_get_sql(
"SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'"
)
).' ('.$last_run_difference.')'.' *',
'PandoraDB Last run'
);
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Database status info').'</th></tr>';
switch ($config['dbtype']) {
case 'mysql':
render_info_data(
"SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_first_version'",
'DB Schema Version (first installed)'
);
render_info_data(
"SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_version'",
'DB Schema Version (actual)'
);
render_info_data(
"SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_build'",
'DB Schema Build'
);
render_row(get_value_sum($db_size).'M', 'DB Size');
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('System info').'</th></tr>';
$output = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
$output2 = 'cat /proc/cpuinfo | grep "processor" | wc -l';
render_row(exec($output).' x '.exec($output2), 'CPU');
$output = 'cat /proc/meminfo | grep "MemTotal"';
render_row(exec($output), 'RAM');
}
break;
case 'postgresql':
render_info_data(
"SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_version'",
'DB Schema Version'
);
render_info_data(
"SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_build'",
'DB Schema Build'
);
render_info_data(
"SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'enterprise_installed'",
'Enterprise installed'
);
render_row(
date(
'Y/m/d H:i:s',
db_get_sql(
"SELECT \"value\"
FROM tconfig WHERE \"token\" = 'db_maintance'"
)
),
'PandoraDB Last run'
);
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE \"key\" = 'customer_key';",
'Update Key'
);
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'",
'Updating code path'
);
render_info_data(
"SELECT value
FROM tupdate_settings
WHERE \"key\" = 'current_update'",
'Current Update #'
);
break;
case 'oracle':
render_info_data(
"SELECT value
FROM tconfig
WHERE token = 'db_scheme_version'",
'DB Schema Version'
);
render_info_data(
"SELECT value
FROM tconfig
WHERE token = 'db_scheme_build'",
'DB Schema Build'
);
render_info_data(
"SELECT value
FROM tconfig
WHERE token = 'enterprise_installed'",
'Enterprise installed'
);
render_row(
db_get_sql(
"SELECT value
FROM tconfig
WHERE token = 'db_maintance'"
),
'PandoraDB Last run'
);
render_info_data(
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
WHERE \"key\" = 'customer_key'",
'Update Key'
);
render_info_data(
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'",
'Updating code path'
);
render_info_data(
'SELECT '.db_escape_key_identifier('value')." FROM tupdate_settings
WHERE \"key\" = 'current_update'",
'Current Update #'
);
break;
}
$innodb_log_file_size = (db_get_value_sql('SELECT @@innodb_log_file_size') / 1048576);
$innodb_log_buffer_size = (db_get_value_sql('SELECT @@innodb_log_buffer_size') / 1048576);
$innodb_flush_log_at_trx_commit = db_get_value_sql('SELECT @@innodb_flush_log_at_trx_commit');
$max_allowed_packet = (db_get_value_sql('SELECT @@max_allowed_packet') / 1048576);
$innodb_buffer_pool_size = (db_get_value_sql('SELECT @@innodb_buffer_pool_size') / 1024);
$sort_buffer_size = number_format((db_get_value_sql('SELECT @@sort_buffer_size') / 1024), 2);
$join_buffer_size = (db_get_value_sql('SELECT @@join_buffer_size') / 1024);
$query_cache_type = db_get_value_sql('SELECT @@query_cache_type');
$query_cache_size = (db_get_value_sql('SELECT @@query_cache_size') / 1048576);
$query_cache_limit = (db_get_value_sql('SELECT @@query_cache_limit') / 1048576);
$innodb_lock_wait_timeout = db_get_value_sql('SELECT @@innodb_lock_wait_timeout');
$thread_cache_size = db_get_value_sql('SELECT @@thread_cache_size');
$thread_stack = (db_get_value_sql('SELECT @@thread_stack') / 1024);
$max_connections = db_get_value_sql('SELECT @@max_connections');
$key_buffer_size = (db_get_value_sql('SELECT @@key_buffer_size') / 1024);
$read_buffer_size = (db_get_value_sql('SELECT @@read_buffer_size') / 1024);
$read_rnd_buffer_size = (db_get_value_sql('SELECT @@read_rnd_buffer_size') / 1024);
$query_cache_min_res_unit = (db_get_value_sql('SELECT @@query_cache_min_res_unit') / 1024);
$innodb_file_per_table = db_get_value_sql('SELECT @@innodb_file_per_table');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('MySQL Performance metrics').' '.ui_print_help_icon('performance_metrics_tab', true).'</th></tr>';
render_row(status_values($innodb_log_file_size_min_rec_value, $innodb_log_file_size), 'InnoDB log file size ', 'InnoDB log file size ');
render_row(status_values($innodb_log_buffer_size_min_rec_value, $innodb_log_buffer_size), 'InnoDB log buffer size ', 'InnoDB log buffer size ');
render_row(status_values($innodb_flush_log_at_trx_commit_min_rec_value, $innodb_flush_log_at_trx_commit), 'InnoDB flush log at trx-commit ', 'InnoDB flush log at trx-commit ');
render_row(status_values($max_allowed_packet_min_rec_value, $max_allowed_packet), 'Maximun allowed packet ', 'Maximun allowed packet ');
render_row(status_values($innodb_buffer_pool_size_min_rec_value, $innodb_buffer_pool_size), 'InnoDB buffer pool size ', 'InnoDB buffer pool size ');
render_row(status_values($sort_buffer_size_min_rec_value, $sort_buffer_size), 'Sort buffer size ', 'Sort buffer size ');
render_row(status_values($join_buffer_size_min_rec_value, $join_buffer_size), 'Join buffer size ', 'Join buffer size ');
render_row(status_values($query_cache_type_min_rec_value, $query_cache_type), 'Query cache type ', 'Query cache type ');
render_row(status_values($query_cache_size_min_rec_value, $query_cache_size), 'Query cache size ', 'Query cache size ');
render_row(status_values($query_cache_limit_min_rec_value, $query_cache_limit), 'Query cache limit ', 'Query cache limit ');
render_row(status_values($innodb_lock_wait_timeout_max_rec_value, $innodb_lock_wait_timeout), 'InnoDB lock wait timeout ', 'InnoDB lock wait timeout ');
render_row(status_values($thread_cache_size_max_rec_value, $thread_cache_size), 'Thread cache size ', 'Thread cache size ');
render_row(status_values($thread_stack_min_rec_value, $thread_stack), 'Thread stack ', 'Thread stack ');
render_row(status_values($max_connections_max_rec_value, $max_connections), 'Maximum connections ', 'Maximun connections ');
render_row(status_values($key_buffer_size_min_rec_value, $key_buffer_size), 'Key buffer size ', 'Key buffer size ');
render_row(status_values($read_buffer_size_min_rec_value, $read_buffer_size), 'Read buffer size ', 'Read buffer size ');
render_row(status_values($read_rnd_buffer_size_min_rec_value, $read_rnd_buffer_size), 'Read rnd-buffer size ', 'Read rnd-buffer size ');
render_row(status_values($query_cache_min_res_unit_min_rec_value, $query_cache_min_res_unit), 'Query cache min-res-unit ', 'Query cache min-res-unit ');
render_row(status_values($innodb_file_per_table_min_rec_value, $innodb_file_per_table), 'InnoDB file per table ', 'InnoDB file per table ');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Tables fragmentation in the Pandora FMS database').'</th></tr>';
render_row($tables_fragmentation_max_rec_value.'%', 'Tables fragmentation (maximum recommended value)');
render_row(number_format($tables_fragmentation, 2).'%', 'Tables fragmentation (current value)');
render_row(status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), 'Table fragmentation status');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS logs dates').'</th></tr>';
render_row(number_format((get_logs_size($path_server_logs) / 1048576), 3).'M', 'Size server logs (current value)');
render_row(get_status_logs($path_server_logs), 'Status server logs');
render_row(number_format((get_logs_size($path_err_logs) / 1048576), 3).'M', 'Size error logs (current value)');
render_row(get_status_logs($path_err_logs), 'Status error logs');
render_row(number_format((get_logs_size($path_console_logs) / 1048576), 3).'M', 'Size console logs (current value)');
render_row(get_status_logs($path_console_logs), 'Status console logs');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS Licence Information').'</th></tr>';
render_row(html_print_textarea('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:40px; width:450px;"', true), 'Customer key');
render_row($license['expiry_date'], $license['expiry_caption']);
render_row($license['limit'].' agents', 'Platform Limit');
render_row($license['count'].' agents', 'Current Platform Count');
render_row($license['count_enabled'].' agents', 'Current Platform Count (enabled: items)');
render_row($license['count_disabled'].' agents', 'Current Platform Count (disabled: items)');
render_row($license['license_mode'], 'License Mode');
render_row(status_license_params($license['nms']), 'Network Management System');
render_row(status_license_params($license['dhpm']), 'Satellite');
render_row($license['licensed_to'], 'Licensed to');
render_row(license_capacity(), 'Status of agents capacity');
render_row(percentage_modules_per_agent(), 'Status of average modules per agent');
render_row(interval_average_of_network_modules(), 'Interval average of the network modules');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Status of the attachment folder').'</th></tr>';
render_row($attachment_total_files, 'Total files in the attached folder');
render_row(files_attachment_folder($attachment_total_files), 'Status of the attachment folder');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Information from the tagente_datos table').'</th></tr>';
render_row($tagente_datos_size, 'Total data in tagente_datos table');
render_row(status_tagente_datos($tagente_datos_size), 'Tangente_datos table status');
render_row(execution_time(), 'Execution time degradation when executing a count');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Pandora FMS server threads').'</th></tr>';
render_row($total_server_threads, 'Total server threads');
render_row($percentage_threads_ram.'%', 'Percentage of threads used by the RAM');
render_row($percentage_threads_cpu.'%', 'Percentage of threads used by the CPU');
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(' Graphs modules that represent the self-monitoring system').'</th></tr>';
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE master = 1');
$agent_id = db_get_value_sql("SELECT id_agente FROM tagente WHERE nombre = '$server_name'");
$id_modules = agents_get_modules($agent_id);
$id_modules = [
modules_get_agentmodule_id('Agents_Unknown', $agent_id),
modules_get_agentmodule_id('Database&#x20;Maintenance', $agent_id),
modules_get_agentmodule_id('FreeDisk_SpoolDir', $agent_id),
modules_get_agentmodule_id('Free_RAM', $agent_id),
modules_get_agentmodule_id('Queued_Modules', $agent_id),
modules_get_agentmodule_id('Status', $agent_id),
modules_get_agentmodule_id('System_Load_AVG', $agent_id),
modules_get_agentmodule_id('Execution_time', $agent_id),
];
foreach ($id_modules as $id_module) {
$params = [
'agent_module_id' => $id_module['id_agente_modulo'],
'period' => SECONDS_1MONTH,
'date' => time(),
'height' => '150',
];
render_row(grafico_modulo_sparse($params), 'Graph of the '.$id_module['nombre'].' module.');
}
if ($console_mode == 0) {
echo '</table>';
}
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
echo '<span>'.__(
'(*) Please check your Pandora Server setup and make sure that the database maintenance daemon is running. It\' is very important to
keep the database up-to-date to get the best performance and results in Pandora'
).'</span><br><br><br>';
// remove file.

View File

@ -1912,6 +1912,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
`linked_layout_status_as_service_warning` FLOAT(20, 3) NOT NULL default 0,
`linked_layout_status_as_service_critical` FLOAT(20, 3) NOT NULL default 0,
`linked_layout_node_id` INT(10) NOT NULL default 0,
`cache_expiration` INTEGER UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id`),
FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -33,7 +33,7 @@ ui_require_css_file('firts_task');
);
?>
</p>
<form action="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor" method="post">
<form action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Planned Downtime'); ?>" />
</form>
</div>

View File

@ -328,9 +328,27 @@ if ($config['menu_type'] == 'classic') {
$header_autorefresh_counter .= $autorefresh_additional;
$header_autorefresh_counter .= '</div>';
// Button for feedback pandora.
if (enterprise_installed()) {
$header_feedback = '<div id="feedback-icon-header">';
$header_feedback .= '<div id="modal-feedback-form" style="display:none;"></div>';
$header_feedback .= '<div id="msg-header" style="display: none"></div>';
$header_feedback .= html_print_image(
'/images/feedback-header.png',
true,
[
'title' => __('Feedback'),
'id' => 'feedback-header',
'alt' => __('Feedback'),
'style' => 'cursor: pointer; width: 27px;',
]
);
$header_feedback .= '</div>';
}
// Support.
if (defined('PANDORA_ENTERPRISE')) {
if (enterprise_installed()) {
$header_support_link = 'https://support.artica.es/';
} else {
$header_support_link = 'https://pandorafms.com/forums/';
@ -388,9 +406,9 @@ if ($config['menu_type'] == 'classic') {
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
<div class="header_center">'.$header_searchbar.'</div>
<div class="header_right">'.$header_chat, $header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_support, $header_docu, $header_user, $header_logout.'</div>';
<div class="header_right">'.$header_chat, $header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
?>
</div> <!-- Closes #table_header_inner -->
</div> <!-- Closes #table_header_inner -->
</div> <!-- Closes #table_header -->
@ -610,8 +628,47 @@ if ($config['menu_type'] == 'classic') {
});
var fixed_header = <?php echo json_encode((bool) $config_fixed_header); ?>;
var new_chat = <?php echo (int) $_SESSION['new_chat']; ?>;
/**
* Loads modal from AJAX to add feedback.
*/
function show_feedback() {
<?php
// Require specific CSS and JS.
ui_require_css_file('wizard');
ui_require_css_file('discovery');
ui_require_css_file('diagnostics');
?>
var btn_ok_text = '<?php echo __('Send'); ?>';
var btn_cancel_text = '<?php echo __('Cancel'); ?>';
var title = '<?php echo __('Report an issue'); ?>';
var url = '<?php echo 'tools/diagnostics'; ?>';
load_modal({
target: $('#modal-feedback-form'),
form: 'modal_form_feedback',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
modal: {
title: title,
ok: btn_ok_text,
cancel: btn_cancel_text,
},
onshow: {
page: url,
method: 'formFeedback',
},
onsubmit: {
page: url,
method: 'createdScheduleFeedbackTask',
dataType: 'json',
},
ajax_callback: generalShowMsg,
idMsgCallback: 'msg-header',
});
}
$(document).ready (function () {
// Check new notifications on a periodic way
@ -661,7 +718,15 @@ if ($config['menu_type'] == 'classic') {
$("#ui_close_dialog_titlebar").click(function () {
$("#agent_access").css("display","");
});
// Feedback.
$("#feedback-header").click(function () {
// Clean DOM.
$("#feedback-header").empty();
// Function charge Modal.
show_feedback();
});
function blinkpubli(){
$(".publienterprise").delay(100).fadeTo(300,0.2).delay(100).fadeTo(300,1, blinkpubli);
}

View File

@ -0,0 +1,77 @@
<?php
/**
* Credential store
*
* @category HelperFeedBack
* @package Pandora FMS
* @subpackage Help Feedback
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
/**
* Class HelpFeedBack.
*/
global $config;
require_once $config['homedir'].'/include/class/HelpFeedBack.class.php';
$ajaxPage = 'general/help_feedback';
// Control call flow.
try {
// User access and validation is being processed on class constructor.
$helpfeedback = new HelpFeedBack($ajaxPage);
} catch (Exception $e) {
if (is_ajax()) {
echo json_encode(['error' => '[HelpFeedBack]'.$e->getMessage() ]);
exit;
} else {
echo '[HelpFeedBack]'.$e->getMessage();
}
// Stop this execution, but continue 'globally'.
return;
}
// Ajax controller.
if (is_ajax()) {
$method = get_parameter('method', '');
if (method_exists($helpfeedback, $method) === true) {
if ($helpfeedback->ajaxMethod($method) === true) {
$helpfeedback->{$method}();
} else {
$helpfeedback->error('Unavailable method.');
}
} else {
$helpfeedback->error('Method not found. ['.$method.']');
}
// Stop any execution.
exit;
} else {
// Run.
$helpfeedback->run();
}

View File

@ -30,6 +30,7 @@
global $config;
require_once $config['homedir'].'/include/functions_update_manager.php';
require_once $config['homedir'].'/include/class/WelcomeWindow.class.php';
if (is_ajax()) {
@ -122,6 +123,8 @@ if (is_ajax()) {
exit();
}
ui_require_css_file('register');
$initial = isset($config['initial_wizard']) !== true
@ -170,6 +173,16 @@ if (!$config['disabled_newsletter']) {
}
}
$welcome = !$registration && !$show_newsletter && !$initial;
try {
$welcome_window = new WelcomeWindow($welcome);
if ($welcome_window !== null) {
$welcome_window->run();
}
} catch (Exception $e) {
$welcome = false;
}
$newsletter = null;
?>

View File

@ -2278,6 +2278,10 @@ if ($updateGIS) {
// -----------------------------------
// Load page depending on tab selected
// -----------------------------------
if ($_SESSION['create_module'] && $config['welcome_state'] == 1) {
$edit_module = true;
}
switch ($tab) {
case 'main':
include 'agent_manager.php';

View File

@ -391,6 +391,9 @@ if ($id_agent_module) {
} else {
if (isset($moduletype) === false) {
$moduletype = (string) get_parameter('moduletype');
if ($_SESSION['create_module'] && $config['welcome_state'] == 1) {
$moduletype = 'networkserver';
}
// Clean up specific network modules fields.
$name = '';

View File

@ -827,7 +827,7 @@ $table->data[5][1] = "
</table>
</div>';
echo '<form method="POST" action="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor">';
echo '<form method="POST" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor">';
if ($id_downtime > 0) {
echo '<table width=100% border=0 cellpadding=4 >';
@ -929,7 +929,7 @@ if ($id_downtime > 0) {
$disabled_add_button = true;
}
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'min-width:180px;margin-right:15px;');
html_print_checkbox('recursion', 1, $recursion, false, false, '');
@ -939,7 +939,7 @@ if ($id_downtime > 0) {
echo '</form>';
// Show available agents to include into downtime
echo '<h4>'.__('Available agents').':</h4>';
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
echo html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, false, true, true, '', false, 'width: 180px;');
@ -1085,7 +1085,7 @@ if ($id_downtime > 0) {
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
}
$data[5] .= '<a href="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
$data[5] .= '<a href="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
}
$table->data['agent_'.$downtime_agent['id_agente']] = $data;

View File

@ -357,7 +357,7 @@ if (!$downtimes && !$filter_performed) {
// No downtimes cause the user performed a search.
else if (!$downtimes) {
// Filter form.
echo "<form method='post' action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list'>";
echo "<form method='post' action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>";
html_print_table($table_form);
echo '</form>';
@ -369,7 +369,7 @@ else if (!$downtimes) {
// Create button.
if ($write_permisson) {
echo '&nbsp;';
echo '<form method="post" action="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>';
}
@ -378,11 +378,11 @@ else if (!$downtimes) {
}
// Has downtimes.
else {
echo "<form method='post' action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list'>";
echo "<form method='post' action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>";
html_print_table($table_form);
echo '</form>';
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
ui_pagination($downtimes_number, "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
// User groups with AR, AD or AW permission.
$groupsAD = users_get_groups($config['id_user'], $access);
@ -476,7 +476,7 @@ else {
if (in_array($downtime['id_group'], $groupsAD)) {
// Stop button
if ($downtime['type_execution'] == 'once' && $downtime['executed'] == 1) {
$data['stop'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]);
$data['stop'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]);
} else {
$data['stop'] = '';
}
@ -484,12 +484,12 @@ else {
// Edit & delete buttons.
if ($downtime['executed'] == 0) {
// Edit.
$data['edit'] = '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
// Delete.
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]);
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]);
} else if ($downtime['executed'] == 1 && $downtime['type_execution'] == 'once') {
// Edit.
$data['edit'] = '<a href="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
// Delete.
$data['delete'] = __('N/A');
} else {
@ -515,7 +515,7 @@ else {
}
html_print_table($table);
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom');
ui_pagination($downtimes_number, "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom');
echo '<div class="action-buttons" style="width: '.$table->width.'">';
// CSV export button.
@ -532,7 +532,7 @@ else {
// Create button.
if ($write_permisson) {
echo '&nbsp;';
echo '<form method="post" action="index.php?sec=estado&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>';
}
@ -559,7 +559,7 @@ $(document).ready (function () {
if (<?php echo json_encode($malformed_downtimes_exist); ?> && <?php echo json_encode($migrate_malformed == false); ?>) {
if (confirm("<?php echo __('WARNING: There are malformed planned downtimes').'.\n'.__('Do you want to migrate automatically the malformed items?'); ?>")) {
window.location.href = "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1";
window.location.href = "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1";
}
}
});

View File

@ -339,13 +339,13 @@ if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, '
$sub = [];
if (check_acl($config['id_user'], 0, 'PM')) {
// Audit //meter en extensiones
// Audit //meter en extensiones.
$sub['godmode/admin_access_logs']['text'] = __('System audit log');
$sub['godmode/admin_access_logs']['id'] = 'System audit log';
$sub['godmode/setup/links']['text'] = __('Links');
$sub['godmode/setup/links']['id'] = 'Links';
$sub['extras/pandora_diag']['text'] = __('Diagnostic info');
$sub['extras/pandora_diag']['id'] = 'Diagnostic info';
$sub['tools/diagnostics']['text'] = __('Diagnostic info');
$sub['tools/diagnostics']['id'] = 'Diagnostic info';
$sub['godmode/setup/news']['text'] = __('Site news');
$sub['godmode/setup/news']['id'] = 'Site news';
$sub['godmode/setup/file_manager']['text'] = __('File manager');

View File

@ -482,51 +482,6 @@ switch ($action) {
$period = $item['period'];
break;
/*
case 'TTRT':
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter(
'id_agente',
'tagente_modulo',
['id_agente_modulo' => $idAgentModule]
);
$period = $item['period'];
break;
case 'TTO':
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter(
'id_agente',
'tagente_modulo',
['id_agente_modulo' => $idAgentModule]
);
$period = $item['period'];
break;
case 'MTBF':
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter(
'id_agente',
'tagente_modulo',
['id_agente_modulo' => $idAgentModule]
);
$period = $item['period'];
break;
case 'MTTR':
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter(
'id_agente',
'tagente_modulo',
['id_agente_modulo' => $idAgentModule]
);
$period = $item['period'];
break;
*/
case 'alert_report_module':
$description = $item['description'];
$idAgentModule = $item['id_agent_module'];
@ -791,11 +746,6 @@ switch ($action) {
case 'avg_value':
case 'projection_graph':
case 'prediction_date':
/*
case 'TTRT':
case 'TTO':
case 'MTBF':
case 'MTTR':*/
case 'simple_baseline_graph':
case 'event_report_log':
case 'increment':
@ -3757,10 +3707,6 @@ $(document).ready (function () {
case 'event_report_module':
case 'simple_graph':
case 'simple_baseline_graph':
/* case 'TTRT':
case 'TTO':
case 'MTBF':
case 'MTTR':*/
case 'prediction_date':
case 'projection_graph':
case 'avg_value':
@ -3798,10 +3744,6 @@ $(document).ready (function () {
case 'event_report_module':
case 'simple_graph':
case 'simple_baseline_graph':
/* case 'TTRT':
case 'TTO':
case 'MTBF':
case 'MTTR':*/
case 'prediction_date':
case 'projection_graph':
case 'avg_value':
@ -4833,38 +4775,6 @@ function chooseType() {
$("#row_period").show();
$("#row_historical_db_check").hide();
break;
/*
case 'TTRT':
$("#row_description").show();
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_historical_db_check").hide();
break;
case 'TTO':
$("#row_description").show();
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_historical_db_check").hide();
break;
case 'MTBF':
$("#row_description").show();
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_historical_db_check").hide();
break;
case 'MTTR':
$("#row_description").show();
$("#row_agent").show();
$("#row_module").show();
$("#row_period").show();
$("#row_historical_db_check").hide();
break;*/
case 'alert_report_module':
$("#row_description").show();
@ -5218,10 +5128,6 @@ function chooseType() {
case 'min_value':
case 'max_value':
case 'avg_value':
/* case 'TTRT':
case 'TTO':
case 'MTBF':
case 'MTTR':*/
case 'simple_baseline_graph':
$("#row_label").show();
break;

View File

@ -2006,11 +2006,6 @@ switch ($action) {
case 'avg_value':
case 'projection_graph':
case 'prediction_date':
/*
case 'TTRT':
case 'TTO':
case 'MTBF':
case 'MTTR':*/
case 'simple_baseline_graph':
case 'nt_top_n':
if ($label != '') {
@ -2613,11 +2608,6 @@ switch ($action) {
case 'avg_value':
case 'projection_graph':
case 'prediction_date':
/*
case 'TTRT':
case 'TTO':
case 'MTBF':
case 'MTTR':*/
case 'simple_baseline_graph':
case 'nt_top_n':
if ($label != '') {

View File

@ -63,9 +63,20 @@ if (is_ajax()) {
$test_address = get_parameter('test_address', '');
$res = enterprise_hook('send_email_attachment', [$test_address, __('This is an email test sent from Pandora FMS. If you can read this, your configuration works.'), __('Testing Pandora FMS email'), null]);
$res = enterprise_hook(
'send_email_attachment',
[
$test_address,
__('This is an email test sent from Pandora FMS. If you can read this, your configuration works.'),
__('Testing Pandora FMS email'),
null,
]
);
echo $res;
// Exit after ajax response.
exit();
}
$table = new StdClass();
@ -389,6 +400,52 @@ html_print_input_hidden('update_config', 1);
html_print_table($table_mail_conf);
echo '</fieldset>';
echo '<fieldset>';
echo '<legend>'.__('WebSocket settings').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->data = [];
$t->style[0] = 'font-weight: bold';
$t->data[0][0] = __('Bind address');
$t->data[0][1] = html_print_input_text(
'ws_bind_address',
$config['ws_bind_address'],
'',
30,
100,
true
);
$t->data[1][0] = __('Bind port');
$t->data[1][2] = html_print_input_text(
'ws_port',
$config['ws_port'],
'',
30,
100,
true
);
$t->data[2][0] = __('WebSocket proxy url').ui_print_help_tip(__('If you had configured a wsproxy set here target URL (for instance ws://your.public.fqdn/ws).'), true);
$t->data[2][2] = html_print_input_text(
'ws_proxy_url',
$config['ws_proxy_url'],
'',
30,
100,
true
);
html_print_input_hidden('update_config', 1);
html_print_table($t);
echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';

View File

@ -404,13 +404,42 @@ class Wizard
/**
* Print a block of inputs.
* Example, using direct to 'anidate' inputs directly to wrapper:
* [
* 'wrapper' => 'div',
* 'block_id' => 'example_id',
* 'class' => 'your class',
* 'direct' => 1,
* 'block_content' => [
* [
* 'arguments' => [
* 'label' => __('Sugesstion'),
* 'type' => 'button',
* 'attributes' => 'class="sub ok btn_sug"',
* 'name' => 'option_1',
* 'id' => 'option_1',
* 'script' => 'change_option1()',
* ],
* ],
* [
* 'arguments' => [
* 'label' => __('Something is not quite right'),
* 'type' => 'button',
* 'attributes' => 'class="sub ok btn_something"',
* 'name' => 'option_2',
* 'id' => 'option_2',
* 'script' => 'change_option2()',
* ],
* ],
* ],
* ].
*
* @param array $input Definition of target block to be printed.
* @param boolean $return Return as string or direct output.
*
* @return string HTML content.
*/
public function printBlock(array $input, bool $return=false)
public function printBlock(array $input, bool $return=false, bool $not_direct=false)
{
$output = '';
if ($input['hidden'] == 1) {
@ -424,33 +453,47 @@ class Wizard
}
if (is_array($input['block_content']) === true) {
$not_direct = (bool) $input['direct'];
// Print independent block of inputs.
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
if ($input['wrapper']) {
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
$output .= '<'.$input['wrapper'].' id="'.$input['block_id'].'" class="'.$class.'">';
} else {
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
}
$output .= '<ul class="wizard '.$input['block_class'].'">';
if (!$not_direct) {
// Avoid encapsulation if input is direct => 1.
$output .= '<ul class="wizard '.$input['block_class'].'">';
}
foreach ($input['block_content'] as $input) {
$output .= $this->printBlock($input, $return);
$output .= $this->printBlock($input, $return, (bool) $not_direct);
}
// Close block.
if ($input['wrapper']) {
$output .= '</ul></'.$input['wrapper'].'>';
} else {
$output .= '</ul></li>';
if (!$not_direct) {
$output .= '</ul>';
}
if ($input['wrapper']) {
$output .= '</'.$input['wrapper'].'>';
}
$output .= '</li>';
} else {
if ($input['arguments']['type'] != 'hidden') {
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
if (!$not_direct) {
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
}
$output .= '<label>'.$input['label'].'</label>';
$output .= $this->printInput($input['arguments']);
// Allow dynamic content.
$output .= $input['extra'];
$output .= '</li>';
if (!$not_direct) {
$output .= '</li>';
}
} else {
$output .= $this->printInput($input['arguments']);
// Allow dynamic content.

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

View File

@ -0,0 +1,62 @@
<?php
/**
* Welcome window ajax controller.
*
* @category WelcomeWindow
* @package Pandora FMS
* @subpackage New Installation Welcome Window
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/include/class/WelcomeWindow.class.php';
if (is_ajax() === false) {
exit;
}
$ajaxPage = 'include/ajax/welcome_window';
// Control call flow.
try {
// User access and validation is being processed on class constructor.
$welcome_actions = new WelcomeWindow(true, $ajaxPage);
} catch (Exception $e) {
exit;
}
// Ajax controller.
$method = get_parameter('method', '');
if (method_exists($welcome_actions, $method) === true) {
if ($welcome_actions->ajaxMethod($method) === true) {
$welcome_actions->{$method}();
} else {
$welcome_actions->error('Unavailable method.');
}
} else {
$welcome_actions->error('Method not found. ['.$method.']');
}
// Stop any execution.
exit;

View File

@ -2354,26 +2354,52 @@ class ConsoleSupervisor
public function checkConsoleServerVersions()
{
global $config;
// List all servers except satellite server
// List all servers except satellite server.
$server_version_list = db_get_all_rows_sql(
'SELECT name, version FROM tserver WHERE server_type != '.SERVER_TYPE_ENTERPRISE_SATELLITE
sprintf(
'SELECT `name`, `version`
FROM tserver
WHERE server_type != %d
GROUP BY `version`',
SERVER_TYPE_ENTERPRISE_SATELLITE
)
);
foreach ($server_version_list as $server) {
if (strpos($server['version'], $config['current_package_enterprise']) === false) {
$title_ver_misaligned = $server['name'].' version misaligned with Console';
$message_ver_misaligned = 'Server '.$server['name'].' and this console have different versions. This might cause several malfunctions. Please, update this server.';
$missed = 0;
$this->notify(
[
'type' => 'NOTIF.SERVER.MISALIGNED',
'title' => __($title_ver_misaligned),
'message' => __($message_ver_misaligned),
'url' => ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'),
]
);
if (is_array($server_version_list) === true) {
foreach ($server_version_list as $server) {
if (strpos(
$server['version'],
$config['current_package_enterprise']
) === false
) {
$missed++;
$title_ver_misaligned = __(
'%s version misaligned with Console',
$server['name']
);
$message_ver_misaligned = __(
'Server %s and this console have different versions. This might cause several malfunctions. Please, update this server.',
$server['name']
);
$this->notify(
[
'type' => 'NOTIF.SERVER.MISALIGNED',
'title' => __($title_ver_misaligned),
'message' => __($message_ver_misaligned),
'url' => ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'),
]
);
}
}
}
// Cleanup notifications if exception is recovered.
if ($missed == 0) {
$this->cleanNotifications('NOTIF.SERVER.MISALIGNED');
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,310 @@
<?php
/**
* Credential store
*
* @category Class
* @package Pandora FMS
* @subpackage Help Feedback
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
ui_require_css_file('pandora');
/**
* Class HelpFeedBack.
*/
class HelpFeedBack extends Wizard
{
/**
* Allowed methods to be called using AJAX request.
*
* @var array
*/
public $AJAXMethods = [
'loadFeedbackForm',
'sendMailMethod',
];
/**
* Url of controller.
*
* @var string
*/
public $ajaxController;
/**
* Checks if target method is available to be called using AJAX.
*
* @param string $method Target method.
*
* @return boolean True allowed, false not.
*/
public function ajaxMethod($method)
{
return in_array($method, $this->AJAXMethods);
}
/**
* Constructor.
*
* @param string $ajax_controller Controller.
*
* @return object
*/
public function __construct($ajax_controller)
{
$this->ajaxController = $ajax_controller;
return $this;
}
/**
* Main method.
*
* @return void
*/
public function run()
{
ui_require_css_file('help_feedback');
$help_url = get_parameter('url', null);
if ($help_url === null) {
echo __('Page not found');
} else {
?>
<iframe width="100%" height="100%" frameBorder="0"
src="<?php echo $help_url; ?>">
<?php echo __('Browser not compatible.'); ?>
</iframe>
<?php
}
echo '<div class="help_feedback">';
// Load feedback form.
echo $this->loadFeedbackForm();
echo '</div>';
}
/**
* Loads a feedback form
*
* @return string HTML code for form.
*
* @return Function loadFeedbackForm.
*/
public function loadFeedbackForm()
{
global $config;
ui_require_css_file('helper');
$form = [
'action' => '#',
'id' => 'feedback_form',
'onsubmit' => 'return false;',
];
$inputs = [
[
'wrapper' => 'div',
'block_id' => 'btn_section',
'class' => 'btn_section',
'direct' => 1,
'block_content' => [
[
'arguments' => [
'label' => __('Sugesstion'),
'type' => 'button',
'attributes' => 'class="btn_sug"',
'name' => 'option_1',
'id' => 'option_1',
'script' => 'change_option1()',
],
],
[
'arguments' => [
'label' => __('Something is not quite right'),
'type' => 'button',
'attributes' => 'class="btn_something"',
'name' => 'option_2',
'id' => 'option_2',
'script' => 'change_option2()',
],
],
],
],
[
'label' => __('What Happend?'),
'arguments' => [
'class' => 'textarea_feedback',
'id' => 'feedback_text',
'type' => 'textarea',
'name' => 'feedback_text',
],
],
[
'label' => __('Your Email'),
'arguments' => [
'id' => 'feedback_email',
'name' => 'feedback_email',
'input_class' => 'email_feedback',
'class' => 'email_feedback',
'type' => 'text',
],
],
[
'arguments' => [
'button_class' => 'btn_submit',
'class' => 'btn_submit',
'attributes' => 'class="sub next btn_submit_feed_back"',
'type' => 'submit',
'id' => 'submit_feedback',
'label' => __('Submit'),
],
],
];
$output = ui_toggle(
$this->printForm(
[
'form' => $form,
'inputs' => $inputs,
],
true
),
__('Feedback'),
'',
'',
true,
false,
'',
'no-border'
);
$output .= $this->loadJS();
return $output;
}
/**
* Function send_mail_method,we use send_email_attachment method
* from functions_cron.php.
*
* @param string $feedback_option type fo mail.
* @param string $feedback_text text mail.
* @param string $feedback_mail costumer mail.
*
* @return integer Status of the email send task.
*/
public function sendMailMethod()
{
$subject = get_parameter('feedback_option', null);
$feedback_text = get_parameter('feedback_text', null);
$feedback_mail = get_parameter('feedback_email', null);
$subject;
if ($subject === null) {
echo json_encode(['error' => __('No ha seleccionado una opcion')]);
exit;
}
enterprise_include_once('include/functions_cron.php');
$feedback_text .= '
From '.$feedback_mail.' ';
$res = enterprise_hook('send_email_attachment', ['feedback@artica.es', $feedback_text, $subject]);
return $res;
}
public function loadJS()
{
ob_start();
?>
<script type="text/javascript">
var option_selected = "";
function change_option1() {
option_selected = "<?php echo __('Suggestion'); ?>";
document.getElementById("button-option_1").className = "btn_sug_not_selected";
document.getElementById("button-option_2").className = "btn_sug";
;
}
function change_option2() {
option_selected = "<?php echo __('Something is not quite rigth'); ?>";
document.getElementById("button-option_2").className = "btn_sug_not_selected";
document.getElementById("button-option_1").className = "btn_sug";
}
// Set values to data.
$("#feedback_form").on('submit', function() {
// Make the AJAX call to send mails.
$.ajax({
type: "POST",
url: "ajax.php",
dataType: "html",
data: {
page: "<?php echo $this->ajaxController; ?>",
method: 'sendMailMethod',
feedback_option: option_selected,
feedback_text: $("textarea[name=feedback_text]").val(),
feedback_email: $("input[name=feedback_email]").val()
},
success: function (data) {
console.log(data);
if (data == 1) {
alert('Message sent');
} else {
console.error("Error in AJAX call to send help feedback mail")
}
},
error: function (data) {
console.error("Fatal error in AJAX call to send help feedback mail")
}
});
});
</script>
<?php
return ob_get_clean();
}
}

View File

@ -2642,8 +2642,17 @@ class NetworkMap
*/
public function loadMapData()
{
global $config;
$networkmap = $this->map;
// ACL.
$networkmap_write = check_acl(
$config['id_user'],
$networkmap['id_group'],
'MW'
);
$simulate = false;
if (isset($networkmap['__simulated']) === false) {
$networkmap['filter'] = json_decode(
@ -2711,6 +2720,7 @@ class NetworkMap
$output .= 'var networkmap_center = [ '.$networkmap['center_x'].', '.$networkmap['center_y']."];\n";
$output .= 'var networkmap_dimensions = [ '.$networkmap['width'].', '.$networkmap['height']."];\n";
$output .= 'var enterprise_installed = '.((int) enterprise_installed()).";\n";
$output .= 'var networkmap_write = '.$networkmap_write.";\n";
$output .= 'var node_radius = '.$networkmap['filter']['node_radius'].";\n";
$output .= 'var networkmap_holding_area_dimensions = '.json_encode($networkmap['filter']['holding_area']).";\n";
$output .= "var networkmap = {'nodes': [], 'links': []};\n";

View File

@ -0,0 +1,760 @@
<?php
/**
* Welcome to Pandora FMS feature.
*
* @category Class
* @package Pandora FMS
* @subpackage New Installation Welcome Window
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
/**
* Class WelcomeWindow.
*/
class WelcomeWindow extends Wizard
{
/**
* Allowed methods to be called using AJAX request.
*
* @var array
*/
public $AJAXMethods = [
'loadWelcomeWindow',
'cancelWelcome',
];
/**
* Url of controller.
*
* @var string
*/
public $ajaxController;
/**
* Current step.
*
* @var integer
*/
public $step;
/**
* Current agent (created example).
*
* @var integer
*/
public $agent;
/**
* Generates a JSON error.
*
* @param string $msg Error message.
*
* @return void
*/
public function error($msg)
{
echo json_encode(
['error' => $msg]
);
}
/**
* Checks if target method is available to be called using AJAX.
*
* @param string $method Target method.
*
* @return boolean True allowed, false not.
*/
public function ajaxMethod($method)
{
global $config;
// Check access.
check_login();
return in_array($method, $this->AJAXMethods);
}
/**
* Constructor.
*
* @param boolean $must_run Must run or not.
* @param string $ajax_controller Controller.
*
* @return object
* @throws Exception On error.
*/
public function __construct(
bool $must_run=false,
$ajax_controller='include/ajax/welcome_window'
) {
$this->ajaxController = $ajax_controller;
if ($this->initialize($must_run) !== true) {
throw new Exception('Must not be shown');
}
return $this;
}
/**
* Main method.
*
* @return void
*/
public function run()
{
ui_require_css_file('new_installation_welcome_window');
echo '<div id="welcome_modal_window" style="display: none"; >';
?>
<script type="text/javascript">
load_modal({
target: $('#welcome_modal_window'),
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
modal: {
title: "<?php echo __('Welcome to Pandora FMS'); ?>",
cancel: '<?php echo __('Ignore'); ?>',
ok: '<?php echo __('Cancel'); ?>'
},
onshow: {
page: '<?php echo $this->ajaxController; ?>',
method: 'loadWelcomeWindow',
},
oncancel: {
page: '<?php echo $this->ajaxController; ?>',
title: "<?php echo __('Cancel Configuration Window'); ?>",
method: 'cancelWelcome',
confirm: function (fn) {
confirmDialog({
title: '<?php echo __('Are you sure?'); ?>',
message: '<?php echo __('Are you sure you want to cancel this tutorial?'); ?>',
ok: '<?php echo __('OK'); ?>',
cancel: '<?php echo __('Cancel'); ?>',
onAccept: function() {
// Continue execution.
fn();
}
})
}
}
});
</script>
<?php
echo '</div>';
}
/**
* Method to cancel welcome modal window.
*
* @return void
*/
public function cancelWelcome()
{
// Config update value.
$this->setStep(WELCOME_FINISHED);
}
/**
* Return current step.
*
* @return integer Step.
*/
public function getStep(): int
{
global $config;
$this->step = $config['welcome_state'];
return $this->step;
}
/**
* Sets current step.
*
* @param integer $step Current step.
*
* @return void
*/
public function setStep(int $step)
{
$this->step = $step;
config_update_value('welcome_state', $step);
}
/**
* Retrieve current welcome agent id.
*
* @return integer Agent id (created).
*/
public function getWelcomeAgent()
{
global $config;
return $config['welcome_id_agent'];
}
/**
* Saves current welcome agent (latest created).
*
* @param integer $id_agent Agent id.
*
* @return void
*/
public function setWelcomeAgent(int $id_agent)
{
config_update_value('welcome_id_agent', $id_agent);
}
/**
* Loads a welcome window form
*
* @return string HTML code for form.
*
* @return void Runs loadWelcomeWindow (AJAX).
*/
public function loadWelcomeWindow()
{
global $config;
$btn_configure_mail_class = 'pending';
$btn_create_agent_class = 'pending';
$btn_create_module_class = '';
$btn_create_alert_class = '';
$btn_create_discovery_class = 'pending';
switch ($this->step) {
case W_CREATE_AGENT:
$btn_configure_mail_class = ' completed';
$btn_create_agent_class = ' pending';
break;
case W_CREATE_MODULE:
$btn_configure_mail_class = ' completed';
$btn_create_agent_class = ' completed';
$btn_create_module_class = ' pending';
break;
case W_CREATE_ALERT:
$btn_configure_mail_class = ' completed';
$btn_create_agent_class = ' completed';
$btn_create_module_class = ' completed';
$btn_create_alert_class = ' pending';
break;
case W_CREATE_TASK:
$btn_configure_mail_class = ' completed';
$btn_create_agent_class = ' completed';
$btn_create_module_class = ' completed';
$btn_create_alert_class = ' completed';
$btn_create_discovery_class = ' pending';
break;
case WELCOME_FINISHED:
// Nothing left to do.
$btn_configure_mail_class = ' completed';
$btn_create_agent_class = ' completed';
$btn_create_module_class = ' completed';
$btn_create_alert_class = ' completed';
$btn_create_discovery_class = ' completed';
break;
default:
case W_CONFIGURE_MAIL:
// Nothing done yet.
$btn_configure_mail_class = ' pending';
break;
}
$form = [
'action' => '#',
'id' => 'welcome_form',
'onsubmit' => 'this.dialog("close");',
'class' => 'modal',
];
$inputs = [
[
'wrapper' => 'div',
'block_id' => 'div_configure_mail',
'class' => 'flex-row w100p',
'direct' => 1,
'block_content' => [
[
'label' => __('Please ensure mail configuration matches your needs'),
'arguments' => [
'class' => 'first_lbl',
'name' => 'lbl_create_agent',
'id' => 'lbl_create_agent',
],
],
[
'arguments' => [
'label' => '',
'type' => 'button',
'attributes' => 'class="go '.$btn_configure_mail_class.'"',
'name' => 'btn_email_conf',
'id' => 'btn_email_conf',
],
],
],
],[
'wrapper' => 'div',
'block_id' => 'div_create_agent',
'class' => 'flex-row w100p',
'direct' => 1,
'block_content' => [
[
'label' => __('Create an agent'),
'arguments' => [
'class' => 'first_lbl',
'name' => 'lbl_create_agent',
'id' => 'lbl_create_agent',
],
],
[
'arguments' => [
'label' => '',
'type' => 'button',
'attributes' => 'class="go '.$btn_create_agent_class.'"',
'name' => 'btn_create_agent',
'id' => 'btn_create_agent',
],
],
],
],
[
'label' => 'Learn to monitor',
'arguments' => [
'class' => 'class="lbl_learn"',
'name' => 'lbl_learn',
'id' => 'lbl_learn',
],
],
[
'wrapper' => 'div',
'block_id' => 'div_monitor_actions',
'class' => 'learn_content_indented flex-row w100p',
'direct' => 1,
'block_content' => [
[
'label' => __('Create a module to check if an agent is online'),
'arguments' => [
'class' => 'second_lbl',
'name' => 'lbl_check_agent',
'id' => 'lbl_check_agent',
],
],
[
'arguments' => [
'label' => '',
'type' => 'button',
'attributes' => 'class="go '.$btn_create_module_class.'"',
'name' => 'btn_create_module',
'id' => 'btn_create_module',
],
],
],
],
[
'wrapper' => 'div',
'block_id' => 'div_monitor_actions',
'class' => 'learn_content_indented flex-row w100p',
'direct' => 1,
'block_content' => [
[
'label' => __('Be warned if something is wrong, create an alert on the module'),
'arguments' => [
'class' => 'second_lbl',
'name' => 'lbl_create_alert',
'id' => 'lbl_create_alert',
],
],
[
'arguments' => [
'label' => '',
'type' => 'button',
'attributes' => 'class="go '.$btn_create_alert_class.'"',
'name' => 'btn_create_alert',
'id' => 'btn_create_alert',
],
],
],
],
[
'wrapper' => 'div',
'block_id' => 'div_discover',
'class' => 'flex-row w100p',
'direct' => 1,
'block_content' => [
[
'label' => __('Discover hosts and devices in your network'),
'arguments' => [
'class' => 'first_lbl',
'name' => 'lbl_discover_devices',
'id' => 'lbl_discover_devices',
],
],
[
'arguments' => [
'label' => '',
'type' => 'button',
'attributes' => 'class="go '.$btn_create_discovery_class.'"',
'name' => 'btn_discover_devices',
'id' => 'btn_discover_devices',
],
],
],
],
[
'wrapper' => 'div',
'block_id' => 'div_not_working',
'class' => 'flex-row w100p',
'direct' => 1,
'block_content' => [
[
'label' => __('If something is not working as expected, look for this icon and report!'),
'arguments' => [
'class' => 'first_lbl',
'name' => 'lbl_not_working',
'id' => 'lbl_not_working',
],
],
[
'label' => html_print_image(
'images/feedback-header.png',
true,
[
'onclick' => '$(\'#feedback-header\').click()',
'style' => 'cursor: pointer;',
]
),
],
],
],
];
$output = $this->printForm(
[
'form' => $form,
'inputs' => $inputs,
],
true
);
$output .= $this->loadJS();
echo $output;
// Ajax methods does not continue.
exit();
}
/**
* This function acts as a constructor. Receive the condition to check with
* the global config (welcome_state) if continues
*
* @param boolean $must_run Must be run or not (check register.php).
*
* @return boolean True if initialized or false if must not run.
*/
public function initialize($must_run)
{
global $config;
if (isset($config['welcome_state']) === false) {
$this->setStep(W_CONFIGURE_MAIL);
}
// Check current page.
$sec2 = get_parameter('sec2', '');
if ($must_run === false
|| $config['welcome_state'] === WELCOME_FINISHED
) {
// Do not show if finished.
return false;
}
$this->step = $this->getStep();
$this->agent = $this->getWelcomeAgent();
/*
* Configure mail. Control current flow.
*
* On empty sec2: show current step.
* On setup page: do not show.
* After mail configuration: enable agent step.
*/
if ($this->step == W_CONFIGURE_MAIL) {
if ($sec2 === 'godmode/setup/setup'
&& get_parameter('section', '') == 'general'
&& get_parameter('update_config', false) !== false
) {
// Mail configuration have been processed.
$_SESSION['configured_mail'] = true;
$this->setStep(W_CREATE_AGENT);
} else if ($sec2 === 'godmode/setup/setup'
&& get_parameter('section', '') === 'general'
) {
// Mail configuration is being processed.
return false;
} else if (empty($sec2) === true) {
// If at main page, show welcome.
return true;
}
}
/*
* Create agent. Control current flow.
*
* On empty sec2: show current step.
* On agent creation page: do not show.
* After agent creation: enable module step.
*/
if ($this->step === W_CREATE_AGENT) {
// Create agent is pending.
if ($sec2 === 'godmode/agentes/configurar_agente'
&& get_parameter('create_agent', false) !== false
) {
// Agent have been created. Store.
$this->setWelcomeAgent(
db_get_value(
'MAX(id_agente)',
'tagente'
)
);
$this->setStep(W_CREATE_MODULE);
return true;
} else if ($sec2 === 'godmode/agentes/configurar_agente') {
// Agent is being created.
return false;
} else if (empty($sec2) === true) {
// If at main page, show welcome.
return true;
}
}
/*
* Create module. Control current flow.
*
* On empty sec2: show current step.
* On module creation page: do not show.
* After module creation: enable alert step.
*/
if ($this->step === W_CREATE_MODULE) {
// Create module is pending.
if ($sec2 === 'godmode/agentes/configurar_agente'
&& get_parameter('tab', '') === 'module'
&& get_parameter('create_module', false) !== false
) {
// Module have been created.
$this->setStep(W_CREATE_ALERT);
return true;
} else if ($sec2 === 'godmode/agentes/configurar_agente'
&& get_parameter('tab', '') === 'module'
) {
// Module is being created.
return false;
} else if (empty($sec2) === true) {
// If at main page, show welcome.
return true;
}
}
/*
* Create alert. Control current flow.
*
* On empty sec2: show current step.
* On alert creation page: do not show.
* After alert creation: enable discovery task step.
*/
if ($this->step === W_CREATE_ALERT) {
// Create alert is pending.
if ($sec2 === 'godmode/agentes/configurar_agente'
&& get_parameter('tab', '') === 'alert'
&& get_parameter('create_alert', false) !== false
) {
// Alert have been created.
$this->setStep(W_CREATE_TASK);
return true;
} else if ($sec2 === 'godmode/agentes/configurar_agente'
&& get_parameter('tab', '') === 'alert'
) {
// Alert is being created.
return false;
} else if (empty($sec2) === true) {
// If at main page, show welcome.
return true;
}
}
/*
* Create discovery task. Control current flow.
*
* On empty sec2: show current step.
* On discovery task creation page: do not show.
* After discovery task creation: finish.
*/
if ($this->step === W_CREATE_TASK) {
// Create Discovery task is pending.
// Host&Devices finishses on page 2.
if ($sec2 === 'godmode/servers/discovery'
&& get_parameter('page', 0) == 2
) {
// Discovery task have been created.
$this->setStep(WELCOME_FINISHED);
// Finished! do not show.
return false;
} else if ($sec2 == 'godmode/servers/discovery') {
// Discovery task is being created.
return false;
} else if (empty($sec2) === true) {
// If at main page, show welcome.
return true;
}
}
if ($this->step === WELCOME_FINISHED) {
// Welcome tutorial finished.
return false;
}
// Return a reference to the new object.
return false;
}
/**
* Load JS content.
* function that enables the functions to the buttons when its action is
* completed.
* Assign the url of each button.
*
* @return string HTML code for javascript functionality.
*/
public function loadJS()
{
ob_start();
?>
<script type="text/javascript">
<?php
if ($this->step > W_CREATE_AGENT) {
switch ($this->step) {
case W_CREATE_MODULE:
?>
document.getElementById("button-btn_create_module").setAttribute(
'onclick',
'checkAgentOnline()'
);
<?php
break;
case W_CREATE_ALERT:
?>
document.getElementById("button-btn_create_alert").setAttribute(
'onclick',
'createAlertModule()'
);
<?php
break;
default:
// Ignore.
break;
}
}
?>
document.getElementById("button-btn_email_conf").setAttribute(
'onclick',
'configureEmail()'
);
document.getElementById("button-btn_create_agent").setAttribute(
'onclick',
'createNewAgent()'
);
document.getElementById("button-btn_discover_devices").setAttribute(
'onclick',
'discoverDevicesNetwork()'
);
function configureEmail() {
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup&section=general#table3'); ?>';
}
function createNewAgent() {
window.location = '<?php echo ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&new_agent=1&crt-2=Create+agent'); ?>';
}
function checkAgentOnline() {
window.location = '<?php echo ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$this->getWelcomeAgent().''); ?>';
}
function createAlertModule() {
window.location = '<?php echo ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$this->getWelcomeAgent().''); ?>';
}
function monitorRemoteCommands() {
window.location = '<?php echo ui_get_full_url(''); ?>';
}
function discoverDevicesNetwork() {
window.location = '<?php echo ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd&mode=netscan'); ?>';
}
function reportIsNotWorking() {
}
function cierre_dialog(){
this.dialog("close");
}
</script>
<?php
return ob_get_clean();
}
}

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC191028';
$build_version = 'PC191029';
$pandora_version = 'v7.0NG.740';
// Do not overwrite default timezone set if defined.

View File

@ -648,3 +648,12 @@ define('HA_PENDING', 2);
define('HA_PROCESSING', 3);
define('HA_DISABLED', 4);
define('HA_FAILED', 5);
define('WELCOME_STARTED', 1);
define('W_CONFIGURE_MAIL', 1);
define('W_CREATE_AGENT', 2);
define('W_CREATE_MODULE', 3);
define('W_CREATE_ALERT', 4);
define('W_CREATE_TASK', 5);
define('WELCOME_FINISHED', -1);

View File

@ -3881,11 +3881,11 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined=false
$img_content = join("\n", $result);
if ($params['return_img_base_64']) {
// To be used in alerts
// To be used in alerts.
$width_img = 500;
return $img_content;
} else {
// to be used in PDF files
// to be used in PDF files.
$config['temp_images'][] = $img_path;
return '<img src="'.$img_url.'" />';
}

View File

@ -353,6 +353,18 @@ function config_update_config()
if (!config_update_value('email_password', get_parameter('email_password'))) {
$error_update[] = __('Email password');
}
if (!config_update_value('ws_bind_address', get_parameter('ws_bind_address'))) {
$error_update[] = __('WebSocket bind address');
}
if (!config_update_value('ws_port', get_parameter('ws_port'))) {
$error_update[] = __('WebSocket port');
}
if (!config_update_value('ws_proxy_url', get_parameter('ws_proxy_url'))) {
$error_update[] = __('WebSocket proxy url');
}
break;
case 'enterprise':
@ -1883,6 +1895,10 @@ function config_process_config()
config_update_value('unique_ip', 0);
}
if (!isset($config['welcome_state'])) {
config_update_value('welcome_state', WELCOME_STARTED);
}
/*
* Parse the ACL IP list for access API
*/

View File

@ -1535,6 +1535,89 @@ function html_print_input_text($name, $value, $alt='', $size=50, $maxlength=255,
}
/**
* Render an input email element.
*
* @param array $settings Array with attributes input.
* only name is necessary.
*
* @return string Html input.
*/
function html_print_input_email(array $settings):string
{
// TODO: const.
$valid_attrs = [
'accept',
'disabled',
'maxlength',
'name',
'readonly',
'placeholder',
'size',
'value',
'accesskey',
'class',
'dir',
'id',
'lang',
'style',
'tabindex',
'title',
'xml:lang',
'onfocus',
'onblur',
'onselect',
'onchange',
'onclick',
'ondblclick',
'onmousedown',
'onmouseup',
'onmouseover',
'onmousemove',
'onmouseout',
'onkeypress',
'onkeydown',
'onkeyup',
'required',
'pattern',
'autocomplete',
];
$output = '';
if (isset($settings) === true && is_array($settings) === true) {
// Check Name is necessary.
if (isset($settings['name']) === true) {
$output = '<input type="email" ';
// Check Max length.
if (isset($settings['maxlength']) === false) {
$settings['maxlength'] = 255;
}
// Check Size.
if (isset($settings['size']) === false
|| $settings['size'] === 0
) {
$settings['size'] = 255;
}
foreach ($settings as $attribute => $attr_value) {
// Check valid attribute.
if (in_array($attribute, $valid_attrs) === false) {
continue;
}
$output .= $attribute.'="'.$attr_value.'" ';
}
$output .= $function.'/>';
}
}
return $output;
}
/**
* Render an input image element.
*
@ -1822,7 +1905,7 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
*/
function html_print_textarea($name, $rows, $columns, $value='', $attributes='', $return=false, $class='')
{
$output = '<textarea id="textarea_'.$name.'" name="'.$name.'" cols="'.$columns.'" rows="'.$rows.'" '.$attributes.'" class="'.$class.'">';
$output = '<textarea id="textarea_'.$name.'" name="'.$name.'" cols="'.$columns.'" rows="'.$rows.'" '.$attributes.' class="'.$class.'">';
// $output .= io_safe_input ($value);
$output .= ($value);
$output .= '</textarea>';
@ -1898,6 +1981,7 @@ function html_get_predefined_table($model='transparent', $columns=4)
* $table->titlestyle - Title style
* $table->titleclass - Title class
* $table->styleTable - Table style
* $table->autosize - Autosize
* $table->caption - Table title
* @param bool Whether to return an output string or echo now
*
@ -2008,6 +2092,12 @@ function html_print_table(&$table, $return=false)
// $table->width = '80%';
}
if (isset($table->autosize) === true) {
$table->autosize = 'autosize = "1"';
} else {
$table->autosize = '';
}
if (empty($table->border)) {
if (empty($table)) {
$table = new stdClass();
@ -2042,9 +2132,9 @@ function html_print_table(&$table, $return=false)
$tableid = empty($table->id) ? 'table'.$table_count : $table->id;
if (!empty($table->width)) {
$output .= '<table style="width:'.$table->width.'; '.$styleTable.' '.$table->tablealign;
$output .= '<table '.$table->autosize.' style="width:'.$table->width.'; '.$styleTable.' '.$table->tablealign;
} else {
$output .= '<table style="'.$styleTable.' '.$table->tablealign;
$output .= '<table '.$table->autosize.' style="'.$styleTable.' '.$table->tablealign;
}
$output .= ' cellpadding="'.$table->cellpadding.'" cellspacing="'.$table->cellspacing.'"';
@ -3003,23 +3093,24 @@ function html_print_csrf_error()
/**
* Print an swith button
* Print an swith button.
*
* @param array $atributes. Valid params:
* name: Usefull to handle in forms
* value: If is checked or not
* disabled: Disabled. Cannot be pressed.
* id: Optional id for the switch.
* class: Additional classes (string).
* @return string with HTML of button
* @param array $attributes Valid params.
* name: Usefull to handle in forms.
* value: If is checked or not.
* disabled: Disabled. Cannot be pressed.
* id: Optional id for the switch.
* class: Additional classes (string).
*
* @return string with HTML of button.
*/
function html_print_switch($attributes=[])
{
$html_expand = '';
// Check the load values on status.
$html_expand .= (bool) $attributes['value'] ? ' checked' : '';
$html_expand .= (bool) $attributes['disabled'] ? ' disabled' : '';
$html_expand .= (bool) ($attributes['value']) ? ' checked' : '';
$html_expand .= (bool) ($attributes['disabled']) ? ' disabled' : '';
// Only load the valid attributes.
$valid_attrs = [
@ -3042,7 +3133,7 @@ function html_print_switch($attributes=[])
}
return "<label class='p-switch' style='".$attributes['style']."'>
<input type='checkbox' $html_expand>
<input type='checkbox' ".$html_expand.">
<span class='p-slider'></span>
</label>";
}
@ -3200,6 +3291,10 @@ function html_print_input($data, $wrapper='div', $input_only=false)
);
break;
case 'email':
$output .= html_print_input_email($data);
break;
case 'hidden':
$output .= html_print_input_hidden(
$data['name'],

View File

@ -224,7 +224,12 @@ function reporting_make_reporting_data(
// General reports with 0 period means last value
// Avoid to overwrite it by template value.
if (!empty($period) && ($content['type'] !== 'general' && $content['period'] != 0)) {
$general_last_value = false;
if ($content['type'] === 'general' && $content['period'] == 0) {
$general_last_value = true;
}
if (!empty($period) && $general_last_value === false) {
$content['period'] = $period;
}
@ -506,43 +511,6 @@ function reporting_make_reporting_data(
);
break;
/*
case 'MTTR':
$report['contents'][] = reporting_value(
$report,
$content,
'MTTR',
$pdf
);
break;
case 'MTBF':
$report['contents'][] = reporting_value(
$report,
$content,
'MTBF',
$pdf
);
break;
case 'TTO':
$report['contents'][] = reporting_value(
$report,
$content,
'TTO',
$pdf
);
break;
case 'TTRT':
$report['contents'][] = reporting_value(
$report,
$content,
'TTRT',
$pdf
);
break;
*/
case 'agent_configuration':
$report['contents'][] = io_safe_output(
reporting_agent_configuration(
@ -3276,6 +3244,7 @@ function reporting_database_serialized($report, $content)
}
$return['keys'] = $keys;
$return['agent_name_db'] = agents_get_name($id_agent);
$return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name;
@ -4303,6 +4272,7 @@ function reporting_monitor_report($report, $content)
);
}
$return['agent_name_db'] = agents_get_name($id_agent);
$return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name;
@ -4475,6 +4445,7 @@ function reporting_prediction_date($report, $content)
$agent_name = io_safe_output(
modules_get_agentmodule_agent_alias($content['id_agent_module'])
);
$agent_name_db = io_safe_output(modules_get_agentmodule_agent_name($content['id_agent_module']));
$return['title'] = $content['name'];
$return['subtitle'] = $agent_name.' - '.$module_name;
@ -4482,6 +4453,7 @@ function reporting_prediction_date($report, $content)
$return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$return['agent_name_db'] = $agent_name_db;
$return['agent_name'] = $agent_name;
$return['module_name'] = $module_name;
@ -4526,12 +4498,14 @@ function reporting_projection_graph(
$module_name = io_safe_output(modules_get_agentmodule_name($content['id_agent_module']));
$agent_name = io_safe_output(modules_get_agentmodule_agent_alias($content['id_agent_module']));
$agent_name_db = io_safe_output(modules_get_agentmodule_agent_name($content['id_agent_module']));
$return['title'] = $content['name'];
$return['subtitle'] = $agent_name.' - '.$module_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$return['agent_name_db'] = $agent_name_db;
$return['agent_name'] = $agent_name;
$return['module_name'] = $module_name;
@ -4727,23 +4701,6 @@ function reporting_value($report, $content, $type, $pdf=false)
case 'sum':
$return['type'] = 'sumatory';
break;
/*
case 'MTTR':
$return['type'] = 'MTTR';
break;
case 'MTBF':
$return['type'] = 'MTBF';
break;
case 'TTO':
$return['type'] = 'TTO';
break;
case 'TTRT':
$return['type'] = 'TTRT';
break;*/
}
if (empty($content['name'])) {
@ -4763,23 +4720,6 @@ function reporting_value($report, $content, $type, $pdf=false)
case 'sum':
$content['name'] = __('Summatory');
break;
/*
case 'MTTR':
$content['name'] = __('MTTR');
break;
case 'MTBF':
$content['name'] = __('MTBF');
break;
case 'TTO':
$content['name'] = __('TTO');
break;
case 'TTRT':
$content['name'] = __('TTRT');
break;*/
}
}
@ -4796,6 +4736,9 @@ function reporting_value($report, $content, $type, $pdf=false)
$agent_name = io_safe_output(
modules_get_agentmodule_agent_alias($content['id_agent_module'])
);
$agent_name_db = io_safe_output(
modules_get_agentmodule_agent_name($content['id_agent_module'])
);
$unit = db_get_value(
'unit',
'tagente_modulo',
@ -4812,6 +4755,7 @@ function reporting_value($report, $content, $type, $pdf=false)
$return['id_agent'] = $content['id_agent'];
$return['id_agent_module'] = $content['id_agent_module'];
$return['agent_name_db'] = $agent_name_db;
$return['agent_name'] = $agent_name;
$return['module_name'] = $module_name;
@ -4952,51 +4896,6 @@ function reporting_value($report, $content, $type, $pdf=false)
$formated_value = format_for_graph($value, $config['graph_precision']).' '.$unit;
}
break;
/*
case 'MTTR':
$value = reporting_get_agentmodule_mttr(
$content['id_agent_module'],
$content['period'],
$report['datetime']
);
$formated_value = null;
break;
case 'MTBF':
$value = reporting_get_agentmodule_mtbf(
$content['id_agent_module'],
$content['period'],
$report['datetime']
);
$formated_value = null;
break;
case 'TTO':
$value = reporting_get_agentmodule_tto(
$content['id_agent_module'],
$content['period'],
$report['datetime']
);
if ($value == 0) {
$formated_value = null;
} else {
$formated_value = human_time_description_raw($value);
}
break;
case 'TTRT':
$value = reporting_get_agentmodule_ttr(
$content['id_agent_module'],
$content['period'],
$report['datetime']
);
if ($value == 0) {
$formated_value = null;
} else {
$formated_value = human_time_description_raw($value);
}
break;*/
}
$return['data'] = [
@ -7755,6 +7654,7 @@ function reporting_simple_graph(
$return['title'] = $content['name'];
$return['subtitle'] = $agent_alias.' - '.$module_name;
$return['agent_name_db'] = agents_get_name($id_agent);
$return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name;
$return['description'] = $content['description'];

View File

@ -288,23 +288,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
reporting_html_sum_value($table, $item, $mini);
break;
/*
case 'MTTR':
reporting_html_MTTR_value($table, $item, $mini, true, true);
break;
case 'MTBF':
reporting_html_MTBF_value($table, $item, $mini, true, true);
break;
case 'TTO':
reporting_html_TTO_value($table, $item, $mini, false, true);
break;
case 'TTRT':
reporting_html_TTRT_value($table, $item, $mini, false, true);
break;
*/
case 'agent_configuration':
reporting_html_agent_configuration($table, $item);
break;
@ -2729,31 +2712,6 @@ function reporting_html_agent_configuration(
}
/*
function reporting_html_TTRT_value(&$table, $item, $mini, $only_value=false, $check_empty=false)
{
reporting_html_value($table, $item, $mini, $only_value, $check_empty);
}
function reporting_html_TTO_value(&$table, $item, $mini, $only_value=false, $check_empty=false)
{
reporting_html_value($table, $item, $mini, $only_value, $check_empty);
}
function reporting_html_MTBF_value(&$table, $item, $mini, $only_value=false, $check_empty=false)
{
reporting_html_value($table, $item, $mini, $only_value, $check_empty);
}
function reporting_html_MTTR_value(&$table, $item, $mini, $only_value=false, $check_empty=false)
{
reporting_html_value($table, $item, $mini, $only_value, $check_empty);
}
*/
function reporting_html_sum_value(&$table, $item, $mini)
{
reporting_html_value($table, $item, $mini);

View File

@ -679,24 +679,6 @@ function reports_get_report_types($template=false, $not_editor=false)
'name' => __('Module Histogram graph'),
];
/*
$types['TTRT'] = [
'optgroup' => __('ITIL'),
'name' => __('TTRT'),
];
$types['TTO'] = [
'optgroup' => __('ITIL'),
'name' => __('TTO'),
];
$types['MTBF'] = [
'optgroup' => __('ITIL'),
'name' => __('MTBF'),
];
$types['MTTR'] = [
'optgroup' => __('ITIL'),
'name' => __('MTTR'),
];
*/
$types['SLA'] = [
'optgroup' => __('SLA'),
'name' => __('S.L.A.'),

View File

@ -1411,7 +1411,7 @@ function ui_print_help_icon(
[
'class' => 'img_help',
'title' => __('Help'),
'onclick' => "open_help ('".$url."')",
'onclick' => "open_help ('".ui_get_full_url('index.php?sec=view&sec2=general/help_feedback&pure=1&url='.$url)."')",
'id' => $id,
],
false,
@ -3015,6 +3015,10 @@ function ui_print_datatable(array $parameters)
$parameters['default_pagination'] = $config['block_size'];
}
if (!isset($parameters['paging'])) {
$parameters['paging'] = true;
}
$no_sortable_columns = [];
if (isset($parameters['no_sortable_columns'])) {
$no_sortable_columns = json_encode($parameters['no_sortable_columns']);
@ -3175,7 +3179,7 @@ function ui_print_datatable(array $parameters)
$table = '<table id="'.$table_id.'" ';
$table .= 'class="'.$parameters['class'].'"';
$table .= 'style="'.$parameters['style'].'">';
$table .= '<thead><tr>';
$table .= '<thead><tr class="datatables_thead_tr">';
if (isset($parameters['column_names'])
&& is_array($parameters['column_names'])
@ -3224,7 +3228,7 @@ function ui_print_datatable(array $parameters)
},
processing: true,
serverSide: true,
paging: true,
paging: '.$parameters['paging'].',
pageLength: '.$parameters['default_pagination'].',
searching: false,
responsive: true,
@ -3324,10 +3328,18 @@ function ui_print_datatable(array $parameters)
$("#'.$form_id.'_search_bt").click(function (){
dt_'.$table_id.'.draw().page(0)
});
});
});';
</script>';
if (isset($parameters['caption']) === true
&& empty($parameters['caption']) === false
) {
$js .= '$("#'.$table_id.'").append("<caption>'.$parameters['caption'].'</caption>");';
$js .= '$(".datatables_thead_tr").css("height", 0);';
}
$js .= '});';
$js .= '</script>';
// Order.
$err_msg = '<div id="error-'.$table_id.'"></div>';
@ -3343,7 +3355,7 @@ function ui_print_datatable(array $parameters)
$output = $include.$output;
// Print datatable if needed.
if (!(isset($parameters['print']) && $parameters['print'] === false)) {
if (isset($parameters['print']) === false || $parameters['print'] === false) {
echo $output;
}

View File

@ -1236,3 +1236,29 @@ function users_get_explode_tags(&$group)
}
}
/**
* Get mail admin.
*
* @return string Return mail admin.
*/
function get_mail_admin():string
{
$mail = db_get_value('email', 'tusuario', 'is_admin', 1);
return $mail;
}
/**
* Get name admin.
*
* @return string Return name admin.
*/
function get_name_admin():string
{
$mail = db_get_value('fullname', 'tusuario', 'is_admin', 1);
return $mail;
}

View File

@ -14,6 +14,7 @@
/* global holding_area_dimensions */
/* global networkmap_id */
/* global enterprise_installed */
/* global networkmap_write */
/* global force */
/* global layer_graph_nodes */
/* global layer_graph_links */
@ -2087,7 +2088,12 @@ function show_menu(item, data) {
icon: "add_node",
disabled: function() {
if (enterprise_installed) {
return false;
// Check if user can write network maps.
if (networkmap_write) {
return false;
} else {
return true;
}
} else {
return true;
}
@ -2099,6 +2105,14 @@ function show_menu(item, data) {
items_list["center"] = {
name: set_center_menu,
icon: "center",
disabled: function() {
// Check if user can write network maps.
if (networkmap_write) {
return false;
} else {
return true;
}
},
callback: function(key, options) {
set_center(networkmap_id);
}
@ -2136,7 +2150,12 @@ function show_menu(item, data) {
icon: "restart_map",
disabled: function() {
if (enterprise_installed) {
return false;
// Check if user can write network maps.
if (networkmap_write) {
return false;
} else {
return true;
}
} else {
return true;
}

View File

@ -1,3 +1,6 @@
/* global $ */
/* exported load_modal */
var ENTERPRISE_DIR = "enterprise";
/* Function to hide/unhide a specific Div id */
@ -1872,8 +1875,6 @@ function logo_preview(icon_name, icon_path, incoming_options) {
}
// Advanced Form control.
/* global $ */
/* exported load_modal */
function load_modal(settings) {
var AJAX_RUNNING = 0;
var data = new FormData();
@ -1899,6 +1900,169 @@ function load_modal(settings) {
buttons: []
})
.show();
var required_buttons = [];
if (settings.modal.cancel != undefined) {
//The variable contains a function
// that is responsible for executing the method it receives from settings
// which confirms the closure of a modal
var cancelModal = function() {
settings.target.dialog("close");
if (AJAX_RUNNING) return;
AJAX_RUNNING = 1;
var formdata = new FormData();
formdata.append("page", settings.oncancel.page);
formdata.append("method", settings.oncancel.method);
$.ajax({
method: "post",
url: settings.url,
processData: false,
contentType: false,
data: formdata,
success: function(data) {
if (typeof settings.oncancel.callback == "function") {
settings.oncancel.callback(data);
settings.target.dialog("close");
}
AJAX_RUNNING = 0;
},
error: function(data) {
// console.log(data);
AJAX_RUNNING = 0;
}
});
};
required_buttons.push({
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel",
text: settings.modal.cancel,
click: function() {
if (settings.oncancel != undefined) {
if (typeof settings.oncancel.confirm == "function") {
//receive function
settings.oncancel.confirm(cancelModal);
} else if (settings.oncancel != undefined) {
cancelModal();
}
} else {
$(this).dialog("close");
}
}
});
}
if (settings.modal.ok != undefined) {
required_buttons.push({
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: settings.modal.ok,
click: function() {
if (AJAX_RUNNING) return;
if (settings.onsubmit != undefined) {
if (settings.onsubmit.preaction != undefined) {
settings.onsubmit.preaction();
}
AJAX_RUNNING = 1;
if (settings.onsubmit.dataType == undefined) {
settings.onsubmit.dataType = "html";
}
var formdata = new FormData();
if (settings.extradata) {
settings.extradata.forEach(function(item) {
if (item.value != undefined)
formdata.append(item.name, item.value);
});
}
formdata.append("page", settings.onsubmit.page);
formdata.append("method", settings.onsubmit.method);
var flagError = false;
$("#" + settings.form + " :input").each(function() {
if (this.checkValidity() === false) {
$(this).attr("title", this.validationMessage);
$(this).tooltip({
tooltipClass: "uitooltip",
position: {
my: "right bottom",
at: "right top",
using: function(position, feedback) {
$(this).css(position);
$("<div>")
.addClass("arrow")
.addClass(feedback.vertical)
.addClass(feedback.horizontal)
.appendTo(this);
}
}
});
$(this).tooltip("open");
var element = $(this);
setTimeout(
function(element) {
element.tooltip("destroy");
element.removeAttr("title");
},
3000,
element
);
flagError = true;
}
if (this.type == "file") {
if ($(this).prop("files")[0]) {
formdata.append(this.name, $(this).prop("files")[0]);
}
} else {
if ($(this).attr("type") == "checkbox") {
if (this.checked) {
formdata.append(this.name, "on");
}
} else {
formdata.append(this.name, $(this).val());
}
}
});
if (flagError === false) {
$.ajax({
method: "post",
url: settings.url,
processData: false,
contentType: false,
data: formdata,
dataType: settings.onsubmit.dataType,
success: function(data) {
if (settings.ajax_callback != undefined) {
if (settings.idMsgCallback != undefined) {
settings.ajax_callback(data, settings.idMsgCallback);
} else {
settings.ajax_callback(data);
}
}
AJAX_RUNNING = 0;
}
});
} else {
AJAX_RUNNING = 0;
}
} else {
// No onsumbit configured. Directly close.
$(this).dialog("close");
}
},
error: function(data) {
// console.log(data);
AJAX_RUNNING = 0;
}
});
}
$.ajax({
method: "post",
@ -1921,69 +2085,131 @@ function load_modal(settings) {
opacity: 0.5,
background: "black"
},
buttons: [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel",
text: settings.modal.cancel,
click: function() {
$(this).dialog("close");
if (typeof settings.cleanup == "function") {
settings.cleanup();
}
}
},
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: settings.modal.ok,
click: function() {
if (AJAX_RUNNING) return;
AJAX_RUNNING = 1;
if (settings.onsubmit.preaction != undefined) {
settings.onsubmit.preaction();
}
var formdata = new FormData();
if (settings.extradata) {
settings.extradata.forEach(function(item) {
if (item.value != undefined)
formdata.append(item.name, item.value);
});
}
formdata.append("page", settings.onsubmit.page);
formdata.append("method", settings.onsubmit.method);
$("#" + settings.form + " :input").each(function() {
if (this.type == "file") {
if ($(this).prop("files")[0]) {
formdata.append(this.name, $(this).prop("files")[0]);
}
} else {
formdata.append(this.name, $(this).val());
}
});
$.ajax({
method: "post",
url: settings.url,
processData: false,
contentType: false,
data: formdata,
success: function(data) {
if (settings.ajax_callback != undefined) {
settings.ajax_callback(data);
}
AJAX_RUNNING = 0;
}
});
}
}
],
buttons: required_buttons,
closeOnEscape: false,
open: function() {
$(".ui-dialog-titlebar-close").hide();
}
});
},
error: function(data) {
// console.log(data);
}
});
}
//Function that shows a dialog box to confirm closures of generic manners. The modal id is random
function confirmDialog(settings) {
var randomStr =
Math.random()
.toString(36)
.substring(2, 15) +
Math.random()
.toString(36)
.substring(2, 15);
$("body").append(
'<div id="confirm_' + randomStr + '">' + settings.message + "</div>"
);
$("#confirm_" + randomStr);
$("#confirm_" + randomStr)
.dialog({
title: settings.title,
close: false,
width: 350,
modal: true,
buttons: [
{
text: "Cancel",
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel",
click: function() {
$(this).dialog("close");
if (typeof settings.onDeny == "function") settings.onDeny();
}
},
{
text: "Ok",
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
click: function() {
$(this).dialog("close");
if (typeof settings.onAccept == "function") settings.onAccept();
}
}
]
})
.show();
}
/**
* Function to show modal with message Validation.
*
* @param {json} data Json example:
* $return = [
* 'error' => 0 or 1,
* 'title' => [
* Failed,
* Success,
* ],
* 'text' => [
* Failed,
* Success,
* ],
*];
* @param {string} idMsg ID div charge modal.
*
* @return {void}
*/
function generalShowMsg(data, idMsg) {
var title = data.title[data.error];
var text = data.text[data.error];
var failed = !data.error;
$("#" + idMsg).empty();
$("#" + idMsg).html(text);
$("#" + idMsg).dialog({
width: 450,
position: {
my: "center",
at: "center",
of: window,
collision: "fit"
},
title: title,
buttons: [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: "OK",
click: function(e) {
if (!failed) {
$(".ui-dialog-content").dialog("close");
} else {
$(this).dialog("close");
}
}
}
]
});
}
/**
* Function for AJAX request.
*
* @param {string} id Id container append data.
* @param {json} settings Json with settings.
*
* @return {void}
*/
function ajaxRequest(id, settings) {
$.ajax({
type: settings.type,
dataType: settings.html,
url: settings.url,
data: settings.data,
success: function(data) {
$("#" + id).append(data);
}
});
}

View File

@ -0,0 +1,440 @@
<?php
/**
* PHP WebSocketServer Manager.
*
* Adapted to PandoraFMS by Fco de Borja Sanchez <fborja.sanchez@artica.es>
* Compatible with PHP >= 7.0
*
* @category External library
* @package Pandora FMS
* @subpackage WebSocketServer
* @version 1.0.0
* @license See below
* @filesource https://github.com/ghedipunk/PHP-Websockets
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* - Neither the name of PHP WebSockets nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
// Begin.
namespace PandoraFMS\WebSockets;
use \PandoraFMS\Websockets\WebSocketServer;
use \PandoraFMS\Websockets\WebSocketUser;
use \PandoraFMS\User;
require_once __DIR__.'/../functions.php';
/**
* Redirects ws communication between two endpoints.
*/
class WSManager extends WebSocketServer
{
/**
* Target host.
*
* @var string
*/
private $intHost = '127.0.0.1';
/**
* Target port
*
* @var integer
*/
private $intPort = 8080;
/**
* Internal URL.
*
* @var string
*/
private $intUrl = '/ws';
/**
* 1MB... overkill for an echo server, but potentially plausible for other
* applications.
*
* @var integer
*/
public $maxBufferSize = 1048576;
/**
* Interactive mode.
*
* @var boolean
*/
public $interative = true;
/**
* Use a timeout of 100 milliseconds to search for messages..
*
* @var integer
*/
public $timeout = 250;
/**
* Handlers for connected step:
* 'protocol' => 'function';
*
* @var array
*/
public $handlerConnected = [];
/**
* Handlers for process step:
* 'protocol' => 'function';
*
* @var array
*/
public $handlerProcess = [];
/**
* Handlers for processRaw step:
* 'protocol' => 'function';
*
* @var array
*/
public $handlerProcessRaw = [];
/**
* Handlers for tick step:
* 'protocol' => 'function';
*
* @var array
*/
public $handlerTick = [];
/**
* Allow only one connection per user session.
*
* @var boolean
*/
public $socketPerSession = false;
/**
* Builder.
*
* @param string $listen_addr Target address (external).
* @param integer $listen_port Target port (external).
* @param array $connected Handlers for <connected> step.
* @param array $process Handlers for <process> step.
* @param array $processRaw Handlers for <processRaw> step.
* @param array $tick Handlers for <tick> step.
* @param integer $bufferLength Max buffer size.
* @param boolean $debug Enable traces.
*/
public function __construct(
$listen_addr,
$listen_port,
$connected=[],
$process=[],
$processRaw=[],
$tick=[],
$bufferLength=1048576,
$debug=false
) {
$this->maxBufferSize = $bufferLength;
$this->debug = $debug;
// Configure handlers.
$this->handlerConnected = $connected;
$this->handlerProcess = $process;
$this->handlerProcessRaw = $processRaw;
$this->handlerTick = $tick;
$this->userClass = '\\PandoraFMS\\Websockets\\WebSocketUser';
parent::__construct($listen_addr, $listen_port, $bufferLength);
}
/**
* Call a target handler function.
*
* @param User $user User.
* @param array $handler Internal handler.
* @param array $arguments Arguments for handler function.
*
* @return mixed handler return or null.
*/
public function callHandler($user, $handler, $arguments)
{
if (isset($user->headers['sec-websocket-protocol'])) {
$proto = $user->headers['sec-websocket-protocol'];
if (isset($handler[$proto])
&& function_exists($handler[$proto])
) {
// Launch configured handler.
$this->stderr('Calling '.$handler[$proto]);
return call_user_func_array(
$handler[$proto],
$arguments
);
}
}
return null;
}
/**
* Read from user's socket.
*
* @param object $user Target user connection.
*
* @return string Buffer.
*/
public function readSocket($user)
{
$buffer;
$numBytes = socket_recv(
$user->socket,
$buffer,
$this->maxBufferSize,
0
);
if ($numBytes === false) {
// Failed. Disconnect.
$this->handleSocketError($user->socket);
return false;
} else if ($numBytes == 0) {
$this->disconnect($user->socket);
$this->stderr(
'Client disconnected. TCP connection lost: '.$user->socket
);
return false;
}
$user->lastRawPacket = $buffer;
return $buffer;
}
/**
* Write to socket.
*
* @param object $user Target user connection.
* @param string $message Target message to be sent.
*
* @return void
*/
public function writeSocket($user, $message)
{
if (is_resource($user->socket)) {
if (!socket_write($user->socket, $message)) {
$this->disconnect($user->socket);
}
} else {
// Failed. Disconnect all.
$this->disconnect($user->socket);
$this->disconnect($user->redirect->socket);
}
}
/**
* User already connected.
*
* @param object $user User.
*
* @return void
*/
public function connected($user)
{
global $config;
$php_session_id = \str_replace(
'PHPSESSID=',
'',
$user->headers['cookie']
);
// If being redirected from proxy.
if (isset($user->headers['x-forwarded-for']) === true) {
$user->address = $user->headers['x-forwarded-for'];
}
$user->account = new User(['phpsessionid' => $php_session_id]);
$_SERVER['REMOTE_ADDR'] = $user->address;
// Ensure user is allowed to connect.
if (\check_login(false) === false) {
$this->disconnect($user->socket);
\db_pandora_audit(
'WebSockets engine',
'Trying to access websockets engine without a valid session',
'N/A'
);
return;
}
// User exists, and session is valid.
\db_pandora_audit(
'WebSockets engine',
'WebSocket connection started',
$user->account->idUser
);
$this->stderr('ONLINE '.$user->address.'('.$user->account->idUser.')');
if ($this->socketPerSession === true) {
// Disconnect previous sessions.
$this->cleanupSocketByCookie($user);
}
// Launch registered handler.
$this->callHandler(
$user,
$this->handlerConnected,
[
$this,
$user,
]
);
}
/**
* Protocol.
*
* @param string $protocol Protocol.
*
* @return string
*/
public function processProtocol($protocol): string
{
return 'Sec-Websocket-Protocol: '.$protocol."\r\n";
}
/**
* Process programattic function
*
* @return void
*/
public function tick()
{
foreach ($this->users as $user) {
// Launch registered handler.
$this->callHandler(
$user,
$this->handlerTick,
[
$this,
$user,
]
);
}
}
/**
* Process undecoded user message.
*
* @param object $user User.
* @param string $buffer Message.
*
* @return boolean
*/
public function processRaw($user, $buffer)
{
// Launch registered handler.
return $this->callHandler(
$user,
$this->handlerProcessRaw,
[
$this,
$user,
$buffer,
]
);
}
/**
* Process user message. Implement.
*
* @param object $user User.
* @param string $message Message.
* @param boolean $str_message String message or not.
*
* @return void
*/
public function process($user, $message, $str_message)
{
if ($str_message === true) {
$remmitent = $user->address.'('.$user->account->idUser.')';
$this->stderr($remmitent.': '.$message);
}
// Launch registered handler.
$this->callHandler(
$user,
$this->handlerProcess,
[
$this,
$user,
$message,
$str_message,
]
);
}
/**
* Also close internal socket.
*
* @param object $user User.
*
* @return void
*/
public function closed($user)
{
if ($user->account) {
$_SERVER['REMOTE_ADDR'] = $user->address;
\db_pandora_audit(
'WebSockets engine',
'WebSocket connection finished',
$user->account->idUser
);
$this->stderr('OFFLINE '.$user->address.'('.$user->account->idUser.')');
}
// Ensure both sockets are disconnected.
$this->disconnect($user->socket);
if ($user->redirect) {
$this->disconnect($user->redirect->socket);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,161 @@
<?php
/**
* PHP WebSocketUser from:
*
* Copyright (c) 2012, Adam Alexander
* All rights reserved.
*
* Adapted to PandoraFMS by Fco de Borja Sanchez <fborja.sanchez@artica.es>
* Compatible with PHP >= 7.0
*
* @category External library
* @package Pandora FMS
* @subpackage WebSocketUser
* @version 1.0.0
* @license See below
* @filesource https://github.com/ghedipunk/PHP-Websockets
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* - Neither the name of PHP WebSockets nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
// Begin.
namespace PandoraFMS\Websockets;
/**
* Parent class for WebSocket User.
*/
class WebSocketUser
{
/**
* Socket.
*
* @var Socket
*/
public $socket;
/**
* Id.
*
* @var string
*/
public $id;
/**
* Headers.
*
* @var array
*/
public $headers = [];
/**
* Handshake.
*
* @var boolean
*/
public $handshake = false;
/**
* HandlingPartialPacket.
*
* @var boolean
*/
public $handlingPartialPacket = false;
/**
* PartialBuffer.
*
* @var string
*/
public $partialBuffer = '';
/**
* SendingContinuous.
*
* @var boolean
*/
public $sendingContinuous = false;
/**
* PartialMessage.
*
* @var string
*/
public $partialMessage = '';
/**
* HasSentClose.
*
* @var boolean
*/
public $hasSentClose = false;
/**
* Raw packet for redirection.
*
* @var string
*/
public $lastRawPacket;
/**
* Pair resend packages.
*
* @var WebSocketUser
*/
public $redirect;
/**
* Pandora FMS user account.
*
* @var User
*/
public $account;
/**
* Remote address.
*
* @var string
*/
public $address;
/**
* Initializes a websocket user.
*
* @param string $id Id of the new user.
* @param Socket $socket Socket where communication is stablished.
*/
public function __construct($id, $socket)
{
socket_getpeername($socket, $this->address);
$this->id = $id;
$this->socket = $socket;
}
}

View File

@ -0,0 +1,66 @@
.pdf-report {
page-break-inside: avoid;
}
.pdf-report th,
.title-self-monitoring,
.caption_table caption {
text-align: center;
font-size: 1.5em;
font-weight: bolder;
color: #fff;
background: #282828;
padding: 8px;
}
.pdf-report tr {
text-align: justify;
}
.datatables-td-title {
width: 25% !important;
font-weight: bolder;
}
.datatables-td-max {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.datatables-td-max img {
margin-right: 10px;
}
.datatables-td-max span {
width: 400px;
display: inline-block;
word-wrap: break-word;
}
.pdf-report td {
font-size: 1.2em;
}
.container-self-monitoring {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.element-self-monitoring {
flex: 2 1 600px;
}
.footer-self-monitoring {
margin: 30px;
font-style: italic;
}
#modal_form_feedback {
margin: 10px;
}
#div-what-happened label {
margin-bottom: 10px;
}

View File

@ -205,6 +205,7 @@ label {
}
li > input[type="text"],
li > input[type="email"],
li > input[type="password"],
.discovery_text_input > input[type="password"],
.discovery_text_input > input[type="text"],
@ -270,3 +271,54 @@ a.ext_link {
margin-left: 1em;
font-size: 8pt;
}
div.ui-tooltip.ui-corner-all.ui-widget-shadow.ui-widget.ui-widget-content.uitooltip {
background: grey;
opacity: 0.9;
border-radius: 4px;
box-shadow: 6px 5px 9px -9px black;
padding: 6px;
}
.ui-tooltip-content {
background: transparent;
color: #fff;
font-weight: bold;
font-family: "lato-lighter", "Open Sans", sans-serif;
letter-spacing: 0.03pt;
font-size: 8pt;
}
.arrow {
width: 70px;
height: 16px;
overflow: hidden;
position: absolute;
left: 50%;
margin-left: -35px;
bottom: -16px;
}
.arrow.top {
top: -16px;
bottom: auto;
}
.arrow.left {
left: 50%;
}
.arrow:after {
background: grey;
content: "";
position: absolute;
left: 20px;
top: -20px;
width: 25px;
height: 25px;
box-shadow: 6px 5px 9px -9px black;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.arrow.top:after {
bottom: -20px;
top: auto;
}

View File

@ -0,0 +1,105 @@
html,
body {
width: 100%;
height: 100%;
}
div.help_feedback {
position: fixed;
bottom: 0;
background: white;
height: auto;
width: 365px;
padding-left: 10px;
padding-right: 10px;
}
.btn_sug {
margin-right: 10px;
margin-top: 10px;
margin-left: 10px;
font-weight: normal;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
font-size: 1.2em;
background-repeat: no-repeat;
background-position: 92% 10px;
color: #000;
padding-bottom: 10px;
padding-top: 10px;
padding-left: 10px;
border: none;
font-family: "lato", "Open Sans", sans-serif;
cursor: pointer;
padding-right: 30px;
}
.btn_something {
margin-top: 10px;
margin-left: 10px;
font-weight: normal;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
font-size: 1.2em;
background-repeat: no-repeat;
background-position: 92% 10px;
color: #000;
padding-bottom: 10px;
padding-top: 10px;
padding-left: 10px;
border: none;
font-family: "lato", "Open Sans", sans-serif;
cursor: pointer;
padding-right: 30px;
}
.textarea_feedback {
margin-left: 11px;
max-width: 200px;
margin-top: 10px;
font-weight: bolder;
}
.email_feedback {
max-width: 200px;
margin-left: 39px;
margin-top: 10px;
margin-bottom: 10px;
font-weight: bolder;
}
.btn_submit_feed_back {
margin-right: 50px;
margin-top: 5px;
margin-bottom: 10px;
}
.btn_sug_not_selected {
font-weight: normal;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
font-size: 1.2em;
background-repeat: no-repeat;
background-position: 92% 10px;
color: #000;
padding-bottom: 10px;
padding-top: 10px;
padding-left: 10px;
border: 1px solid #888;
font-family: "lato", "Open Sans", sans-serif;
cursor: pointer;
margin-right: 20px;
margin-top: 10px;
margin-left: 10px;
background-image: url(../../images/input_tick.png);
padding-right: 30px;
}
.btn_section {
display: flex;
}

View File

@ -0,0 +1,62 @@
.modal {
overflow: hidden;
}
.welcome_modal_window {
overflow: hidden;
}
#welcome_modal_window {
/*
max-height: 100%;
height: 100%;
border-left: 1em solid #82b92f;
margin-bottom: -59px;
padding-bottom: 100px;
margin-left: -1px;
*/
}
#welcome_form ul.wizard li {
padding: 1em;
padding-bottom: 0;
padding-top: 1em;
}
#welcome_form label {
font-family: "lato-lighter", "Open Sans", sans-serif;
font-weight: normal;
}
.content_position {
display: flex;
margin-top: 5px;
font-family: "lato-lighter", "Open Sans", sans-serif;
font-weight: normal;
}
.learn_content_indented {
text-indent: 1.5em;
font-family: "lato-lighter", "Open Sans", sans-serif;
font-weight: normal;
}
#lbl_learn {
font-family: "lato-lighter", "Open Sans", sans-serif;
font-weight: normal;
}
.go {
background-repeat: no-repeat;
background-size: cover;
width: 20px;
height: 20px;
border: none;
}
.pending {
background-image: url(../../images/darrowright.png);
}
.completed {
background-image: url(../../images/input_tick.png);
}

View File

@ -544,6 +544,13 @@ select:-internal-list-box {
align-items: baseline;
}
.flex-row-vcenter {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
}
.nowrap {
flex-wrap: nowrap;
}

View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Feedback</title>
<style>
* {
font-family: Arial, Helvetica, sans-serif;
}
h3 {
padding: 30px;
background-color: #81b92e;
color: #fff;
}
p,
h5 {
width: 90%;
margin: 0 auto;
}
h5 {
margin-bottom: 20px;
}
p {
margin-bottom: 10px;
}
p.msg-user {
padding: 20px;
white-space: pre;
background-color: #e2e2e2;
border: 3px dashed grey;
border-radius: 10px;
}
p.legal {
font-size: 10px;
font-style: italic;
}
</style>
</head>
<body>
<h3>__title__</h3>
<br />
<p>__p1__</p>
<p class="msg-user">__p2__</p>
<p>__attachment__</p>
<p>__p3__</p>
<br />
<h5>__legal__</h5>
<p class="legal">__legal1__</p>
<p class="legal">__legal2__</p>
<p class="legal">__legal3__</p>
<p class="legal">__legal4__</p>
</body>
</html>

View File

@ -0,0 +1,189 @@
<?php
/**
* Extra functionality for PandoraFMS WebSockets.
*
* Register here your methods to handle different WebSocket steps.
* * connected
* * process
* * disconnect
* * tick
*
* DO NOT FORGET TO REGISTER THEM TO ws.php!!
*
* @category Websocket
* @package Pandora FMS
* @subpackage Console
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
/*
* ============================================================================
* * GOTTY PROTOCOL: PROXY
* ============================================================================
*/
/**
* Connects to internal socket.
*
* @param WSManager $ws_object Main WebSocket manager object.
* @param array $headers Communication headers.
* @param string $to_addr Target address (internal).
* @param integer $to_port Target port (internal).
* @param integer $to_url Target url (internal).
*
* @return socket Active socket or null.
*/
function connectInt(
$ws_object,
$headers,
$to_addr,
$to_port,
$to_url
) {
$intSocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$connect = socket_connect(
$intSocket,
$to_addr,
$to_port
);
if (!$connect) {
return null;
}
$c_str = 'GET '.$to_url." HTTP/1.1\r\n";
$c_str .= 'Host: '.$to_addr."\r\n";
$c_str .= "Upgrade: websocket\r\n";
$c_str .= "Connection: Upgrade\r\n";
$c_str .= 'Origin: http://'.$to_addr."\r\n";
$c_str .= 'Sec-WebSocket-Key: '.$headers['Sec-WebSocket-Key']."\r\n";
$c_str .= 'Sec-WebSocket-Version: '.$headers['Sec-WebSocket-Version']."\r\n";
if (isset($headers['Sec-WebSocket-Protocol'])) {
$c_str .= 'Sec-WebSocket-Protocol: '.$headers['Sec-WebSocket-Protocol']."\r\n";
}
$c_str .= "\r\n";
// Send.
// Register user - internal.
$intUser = new $ws_object->userClass('INTERNAL-'.uniqid('u'), $intSocket);
$intUser->headers = [
'get' => $to_url.' HTTP/1.1',
'host' => $to_addr,
'origin' => $to_addr,
'sec-websocket-protocol' => 'gotty',
];
$ws_object->writeSocket($intUser, $c_str);
return $intUser;
}
/**
* Process a connected step on proxied protocols.
*
* @param WSManager $ws_object Main WebSocket manager object.
* @param User $user WebSocketUser.
*
* @return void
*/
function proxyConnected(
$ws_object,
$user
) {
global $config;
/*
* $user->redirect is connected to internal (reflexive).
* $user->socket is connected to external.
*/
// Gotty. Based on the command selected, redirect to a target port.
if ($user->requestedResource == '/ssh') {
$port = $config['gotty_ssh_port'];
} else if ($user->requestedResource == '/telnet') {
$port = $config['gotty_telnet_port'];
} else {
$ws_object->disconnect($user->socket);
return;
}
// Switch between ports...
// Create a new socket connection (internal).
$intUser = connectInt(
$ws_object,
$ws_object->rawHeaders,
$config['gotty_host'],
$port,
'/ws'
);
if ($intUser === null) {
$ws_object->disconnect($user->socket);
return;
}
// Map user.
$user->intUser = $intUser;
// And socket.
$user->intSocket = $intUser->socket;
$user->redirect = $intUser;
$intUser->redirect = $user;
// Keep an eye on changes.
$ws_object->remoteSockets[$intUser->id] = $intUser->socket;
$ws_object->remoteUsers[$intUser->id] = $intUser;
// Ignore. Cleanup socket.
$response = $ws_object->readSocket($user->intUser);
}
/**
* Redirects input from user to redirection stabished.
*
* @param WSManager $ws_object Main WebSocket manager object.
* @param WebSocketUser $user WebSocket user.
* @param string $buffer Buffer.
*
* @return boolean Ok or not.
*/
function proxyProcessRaw($ws_object, $user, $buffer)
{
if (isset($user->redirect) !== true) {
$ws_object->disconnect($user->socket);
return false;
}
$ws_object->stderr($user->id.' >> '.$user->redirect->id);
$ws_object->stderr($ws_object->dump($buffer));
$ws_object->writeSocket($user->redirect, $buffer);
return true;
}
/*
* ============================================================================
* * ENDS: GOTTY PROTOCOL: PROXY
* ============================================================================
*/

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.740';
$build = '191028';
$build = '191029';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -430,15 +430,38 @@ if ($date_to_trap != '') {
}
if ($filter_severity != -1) {
// Test if install the enterprise to search oid in text or oid field in ttrap.
if ($config['enterprise_installed']) {
$whereSubquery .= ' AND (
(alerted = 0 AND severity = '.$filter_severity.') OR
(alerted = 1 AND priority = '.$filter_severity.'))';
} else {
$whereSubquery .= ' AND (
(alerted = 0 AND 1 = '.$filter_severity.') OR
(alerted = 1 AND priority = '.$filter_severity.'))';
// There are two special severity values aimed to match two different trap standard severities in database: warning/critical and critical/normal.
if ($filter_severity != EVENT_CRIT_OR_NORMAL && $filter_severity != EVENT_CRIT_WARNING_OR_CRITICAL) {
// Test if enterprise is installed to search oid in text or oid field in ttrap.
if ($config['enterprise_installed']) {
$whereSubquery .= ' AND (
(alerted = 0 AND severity = '.$filter_severity.') OR
(alerted = 1 AND priority = '.$filter_severity.'))';
} else {
$whereSubquery .= ' AND (
(alerted = 0 AND 1 = '.$filter_severity.') OR
(alerted = 1 AND priority = '.$filter_severity.'))';
}
} else if ($filter_severity === EVENT_CRIT_WARNING_OR_CRITICAL) {
// Test if enterprise is installed to search oid in text or oid field in ttrap.
if ($config['enterprise_installed']) {
$whereSubquery .= ' AND (
(alerted = 0 AND (severity = '.EVENT_CRIT_WARNING.' OR severity = '.EVENT_CRIT_CRITICAL.')) OR
(alerted = 1 AND (priority = '.EVENT_CRIT_WARNING.' OR priority = '.EVENT_CRIT_CRITICAL.')))';
} else {
$whereSubquery .= ' AND (
(alerted = 1 AND (priority = '.EVENT_CRIT_WARNING.' OR priority = '.EVENT_CRIT_CRITICAL.')))';
}
} else if ($filter_severity === EVENT_CRIT_OR_NORMAL) {
// Test if enterprise is installed to search oid in text or oid field in ttrap.
if ($config['enterprise_installed']) {
$whereSubquery .= ' AND (
(alerted = 0 AND (severity = '.EVENT_CRIT_NORMAL.' OR severity = '.EVENT_CRIT_CRITICAL.')) OR
(alerted = 1 AND (priority = '.EVENT_CRIT_NORMAL.' OR priority = '.EVENT_CRIT_CRITICAL.')))';
} else {
$whereSubquery .= ' AND (
(alerted = 1 AND (priority = '.EVENT_CRIT_NORMAL.' OR priority = '.EVENT_CRIT_CRITICAL.')))';
}
}
}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.740
%define release 1
%define release 191029
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.740
%define release 1
%define release 191029
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.740
%define release 1
%define release 191029
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -0,0 +1,175 @@
#!/bin/bash
# Copyright (c) 2005-2019 Artica ST
#
# /etc/init.d/websocket
#
# System startup script for Pandora FMS Console websocket engine
#
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 10
# description: Pandora FMS Console webscoket engine startup script
#
# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: websocket
# Required-Start: $syslog cron
# Should-Start: $network cron mysql
# Required-Stop: $syslog
# Should-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Pandora FMS Console websocket engine startup script
# Description: Pandora FMS Console websocket engine startup script
### END INIT INFO
if [ -x /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
# If you want to run several pandora Console Websocket engines in this machine, just copy
# this script to another name, editing PANDORA_HOME to the new .conf
export WS_ENGINE="/var/www/html/pandora_console/ws.php"
export PHP=/usr/bin/php
export WS_LOG="/var/www/html/pandora_console/pandora_console.log"
export GOTTY="/tmp/"
# Environment variables
if [[ -z ${PANDORA_RB_PRODUCT_NAME} ]]; then
PANDORA_RB_PRODUCT_NAME="Pandora FMS"
fi
if [[ -z ${PANDORA_RB_COPYRIGHT_NOTICE} ]]; then
PANDORA_RB_COPYRIGHT_NOTICE="Artica ST"
fi
export PANDORA_RB_PRODUCT_NAME=$PANDORA_RB_PRODUCT_NAME
export PANDORA_RB_COPYRIGHT_NOTICE=$PANDORA_RB_COPYRIGHT_NOTICE
# Uses a wait limit before sending a KILL signal, before trying to stop
# Pandora FMS Console Websocket engine nicely. Some big systems need some time before close
# all pending tasks / threads.
export MAXWAIT=60
# Check for SUSE status scripts
if [ -f /etc/rc.status ]
then
. /etc/rc.status
rc_reset
else
# Define part of rc functions for non-suse systems
function rc_status () {
RETVAL=$?
case $1 in
-v) RETVAL=0;;
esac
}
function rc_exit () { exit $RETVAL; }
function rc_failed () { RETVAL=${1:-1}; }
RETVAL=0
fi
# This function replace pidof, not working in the same way in different linux distros
function pidof_pandora () {
# This sets COLUMNS to XXX chars, because if command is run
# in a "strech" term, ps aux don't report more than COLUMNS
# characters and this will not work.
COLUMNS=300
PANDORA_PID=`ps aux | grep "$PHP $WS_ENGINE" | grep -v grep | tail -1 | awk '{ print $2 }'`
echo $PANDORA_PID
}
# Main script
if [ ! -x $GOTTY ]
then
echo "Gotty not found in $GOTTY"
rc_failed 5 # program is not installed
rc_exit
fi
if [ ! -f $PHP ]
then
echo "$PHP not found, please install version >= 7.0"
rc_failed 5 # program is not installed
rc_exit
fi
case "$1" in
start)
PANDORA_PID=`pidof_pandora`
if [ ! -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is currently running on this machine with PID ($PANDORA_PID)."
rc_exit # running start on a service already running
fi
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
$PHP $WS_ENGINE >> $WS_LOG 2>&1 &
sleep 1
PANDORA_PID=`pidof_pandora`
if [ ! -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is now running with PID $PANDORA_PID"
rc_status -v
else
echo "Cannot start $PANDORA_RB_PRODUCT_NAME Console Websocket engine. Aborted."
echo "Check $PANDORA_RB_PRODUCT_NAME log files at $WS_LOG"
rc_failed 7 # program is not running
fi
;;
stop)
PANDORA_PID=`pidof_pandora`
if [ -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is not running, cannot stop it."
rc_exit # running stop on a service already stopped or not running
else
echo "Stopping $PANDORA_RB_PRODUCT_NAME Console Websocket engine"
kill $PANDORA_PID > /dev/null 2>&1
COUNTER=0
while [ $COUNTER -lt $MAXWAIT ]
do
_PID=`pidof_pandora`
if [ "$_PID" != "$PANDORA_PID" ]
then
COUNTER=$MAXWAIT
fi
COUNTER=`expr $COUNTER + 1`
sleep 1
done
# Send a KILL -9 signal to process, if it's alive after 60secs, we need
# to be sure is really dead, and not pretending...
if [ "$_PID" = "$PANDORA_PID" ]
then
kill -9 $PANDORA_PID > /dev/null 2>&1
fi
rc_status -v
fi
;;
status)
PANDORA_PID=`pidof_pandora`
if [ -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is not running."
rc_failed 7 # program is not running
else
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is running with PID $PANDORA_PID."
rc_status
fi
;;
force-reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
exit 1
esac
rc_exit

View File

@ -0,0 +1,19 @@
[Unit]
Description=php webSocket
After=syslog.target network.target
[Service]
User=apache
Type=simple
ExecStart=php /var/www/html/pandora_console/ws.php >> /var/www/html/pandora_console/pandora_console.log 2>&1
TimeoutStopSec=20
KillMode=process
Restart=always
RestartSec=2
StandardOutput=file:/var/www/html/pandora_console/pandora_console.log
StandardError=file:/var/www/html/pandora_console/pandora_console.log
[Install]
WantedBy=multi-user.target
Alias=websocket.service

View File

@ -3522,6 +3522,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` (
`time_format` varchar(60) NOT NULL default "time",
`timezone` varchar(60) NOT NULL default "Europe/Madrid",
`show_last_value` tinyint(1) UNSIGNED NULL default '0',
`cache_expiration` INTEGER UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id`),
FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -138,7 +138,9 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('cr_incident_type', ''),
('cr_incident_status', ''),
('cr_incident_title', ''),
('cr_incident_content', '');
('cr_incident_content', ''),
('sample_agent', '0'),
('gotty', '/usr/bin/gotty');
UNLOCK TABLES;
--
@ -268,7 +270,7 @@ INSERT INTO `torigen` VALUES
--
-- Identifiers 30 and 31 are reserved for Enterprise data types
INSERT INTO `ttipo_modulo` VALUES
INSERT INTO `ttipo_modulo` VALUES
(1,'generic_data',0,'Generic numeric','mod_data.png'),
(2,'generic_proc',1,'Generic boolean','mod_proc.png'),
(3,'generic_data_string',2,'Generic string','mod_string.png'),
@ -283,19 +285,15 @@ INSERT INTO `ttipo_modulo` VALUES
(15,'remote_snmp',3,'Remote SNMP network agent, numeric data','mod_snmp_data.png'),
(16,'remote_snmp_inc',3,'Remote SNMP network agent, incremental data','mod_snmp_inc.png'),
(17,'remote_snmp_string',5,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png'),
(18,'remote_snmp_proc',4,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'),
(21,'async_proc', 7, 'Asyncronous proc data', 'mod_async_proc.png'),
(22,'async_data', 6, 'Asyncronous numeric data', 'mod_async_data.png'),
(18,'remote_snmp_proc',4,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'),
(21,'async_proc', 7, 'Asyncronous proc data', 'mod_async_proc.png'),
(22,'async_data', 6, 'Asyncronous numeric data', 'mod_async_data.png'),
(23,'async_string', 8, 'Asyncronous string data', 'mod_async_string.png'),
(25,'web_analysis', 8, 'Web analysis data', 'module-wux.png'),
(30,'web_data',9,'Remote HTTP module to check latency','mod_web_data.png'),
(31,'web_proc',9,'Remote HTTP module to check server response','mod_web_proc.png'),
(32,'web_content_data',9,'Remote HTTP module to retrieve numeric data','mod_web_data.png'),
(33,'web_content_string',9,'Remote HTTP module to retrieve string data','mod_web_data.png'),
(34,'remote_cmd', 10, 'Remote execution, numeric data', 'mod_remote_cmd.png'),
(35,'remote_cmd_proc', 10, 'Remote execution, boolean data', 'mod_remote_cmd_proc.png'),
(36,'remote_cmd_string', 10, 'Remote execution, alphanumeric data', 'mod_remote_cmd_string.png'),
(37,'remote_cmd_inc', 10, 'Remote execution, incremental data', 'mod_remote_cmd_inc.png'),
(100,'keep_alive',-1,'KeepAlive','mod_keepalive.png');
--

View File

@ -0,0 +1,73 @@
<?php
/**
* Diagnostics view.
*
* @category Diagnostics
* @package Pandora FMS
* @subpackage Opensource
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/include/class/Diagnostics.class.php';
$ajaxPage = 'tools/diagnostics';
$pdf = false;
// Control call flow.
try {
// User access and validation is being processed on class constructor.
$cs = new Diagnostics($ajaxPage, $pdf);
} catch (Exception $e) {
if (is_ajax()) {
echo json_encode(['error' => '[Diagnostics]'.$e->getMessage() ]);
exit;
} else {
echo '[Diagnostics]'.$e->getMessage();
}
// Stop this execution, but continue 'globally'.
return;
}
// AJAX controller.
if (is_ajax()) {
$method = get_parameter('method');
if (method_exists($cs, $method) === true) {
if ($cs->ajaxMethod($method) === true) {
$cs->{$method}();
} else {
$cs->error('Unavailable method.');
}
} else {
$cs->error('Method not found. ['.$method.']');
}
// Stop any execution.
exit;
} else {
// Run.
$cs->run();
}

View File

@ -1,4 +1,3 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -6,11 +6,321 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'DeepCopy\\DeepCopy' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/DeepCopy.php',
'DeepCopy\\Exception\\CloneException' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php',
'DeepCopy\\Exception\\PropertyException' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php',
'DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php',
'DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php',
'DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php',
'DeepCopy\\Filter\\Filter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php',
'DeepCopy\\Filter\\KeepFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php',
'DeepCopy\\Filter\\ReplaceFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php',
'DeepCopy\\Filter\\SetNullFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php',
'DeepCopy\\Matcher\\Doctrine\\DoctrineProxyMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php',
'DeepCopy\\Matcher\\Matcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php',
'DeepCopy\\Matcher\\PropertyMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php',
'DeepCopy\\Matcher\\PropertyNameMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php',
'DeepCopy\\Matcher\\PropertyTypeMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php',
'DeepCopy\\Reflection\\ReflectionHelper' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php',
'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php',
'DeepCopy\\TypeFilter\\ReplaceFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php',
'DeepCopy\\TypeFilter\\ShallowCopyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php',
'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php',
'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php',
'DeepCopy\\TypeFilter\\TypeFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php',
'DeepCopy\\TypeMatcher\\TypeMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php',
'Doctrine\\Common\\Lexer\\AbstractLexer' => $vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php',
'Egulias\\EmailValidator\\EmailLexer' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailLexer.php',
'Egulias\\EmailValidator\\EmailParser' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailParser.php',
'Egulias\\EmailValidator\\EmailValidator' => $vendorDir . '/egulias/email-validator/EmailValidator/EmailValidator.php',
'Egulias\\EmailValidator\\Exception\\AtextAfterCFWS' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/AtextAfterCFWS.php',
'Egulias\\EmailValidator\\Exception\\CRLFAtTheEnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CRLFAtTheEnd.php',
'Egulias\\EmailValidator\\Exception\\CRLFX2' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CRLFX2.php',
'Egulias\\EmailValidator\\Exception\\CRNoLF' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CRNoLF.php',
'Egulias\\EmailValidator\\Exception\\CharNotAllowed' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CharNotAllowed.php',
'Egulias\\EmailValidator\\Exception\\CommaInDomain' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/CommaInDomain.php',
'Egulias\\EmailValidator\\Exception\\ConsecutiveAt' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveAt.php',
'Egulias\\EmailValidator\\Exception\\ConsecutiveDot' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveDot.php',
'Egulias\\EmailValidator\\Exception\\DomainHyphened' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/DomainHyphened.php',
'Egulias\\EmailValidator\\Exception\\DotAtEnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/DotAtEnd.php',
'Egulias\\EmailValidator\\Exception\\DotAtStart' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/DotAtStart.php',
'Egulias\\EmailValidator\\Exception\\ExpectedQPair' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingQPair.php',
'Egulias\\EmailValidator\\Exception\\ExpectingAT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingAT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingATEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingATEXT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingCTEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingCTEXT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingDTEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingDTEXT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingDomainLiteralClose' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/ExpectingDomainLiteralClose.php',
'Egulias\\EmailValidator\\Exception\\InvalidEmail' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/InvalidEmail.php',
'Egulias\\EmailValidator\\Exception\\NoDNSRecord' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/NoDNSRecord.php',
'Egulias\\EmailValidator\\Exception\\NoDomainPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/NoDomainPart.php',
'Egulias\\EmailValidator\\Exception\\NoLocalPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/NoLocalPart.php',
'Egulias\\EmailValidator\\Exception\\UnclosedComment' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/UnclosedComment.php',
'Egulias\\EmailValidator\\Exception\\UnclosedQuotedString' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/UnclosedQuotedString.php',
'Egulias\\EmailValidator\\Exception\\UnopenedComment' => $vendorDir . '/egulias/email-validator/EmailValidator/Exception/UnopenedComment.php',
'Egulias\\EmailValidator\\Parser\\DomainPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Parser/DomainPart.php',
'Egulias\\EmailValidator\\Parser\\LocalPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Parser/LocalPart.php',
'Egulias\\EmailValidator\\Parser\\Parser' => $vendorDir . '/egulias/email-validator/EmailValidator/Parser/Parser.php',
'Egulias\\EmailValidator\\Validation\\DNSCheckValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/DNSCheckValidation.php',
'Egulias\\EmailValidator\\Validation\\EmailValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/EmailValidation.php',
'Egulias\\EmailValidator\\Validation\\Error\\RFCWarnings' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/Error/RFCWarnings.php',
'Egulias\\EmailValidator\\Validation\\Error\\SpoofEmail' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/Error/SpoofEmail.php',
'Egulias\\EmailValidator\\Validation\\Exception\\EmptyValidationList' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/Exception/EmptyValidationList.php',
'Egulias\\EmailValidator\\Validation\\MultipleErrors' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/MultipleErrors.php',
'Egulias\\EmailValidator\\Validation\\MultipleValidationWithAnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php',
'Egulias\\EmailValidator\\Validation\\NoRFCWarningsValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/NoRFCWarningsValidation.php',
'Egulias\\EmailValidator\\Validation\\RFCValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/RFCValidation.php',
'Egulias\\EmailValidator\\Validation\\SpoofCheckValidation' => $vendorDir . '/egulias/email-validator/EmailValidator/Validation/SpoofCheckValidation.php',
'Egulias\\EmailValidator\\Warning\\AddressLiteral' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/AddressLiteral.php',
'Egulias\\EmailValidator\\Warning\\CFWSNearAt' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/CFWSNearAt.php',
'Egulias\\EmailValidator\\Warning\\CFWSWithFWS' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/CFWSWithFWS.php',
'Egulias\\EmailValidator\\Warning\\Comment' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/Comment.php',
'Egulias\\EmailValidator\\Warning\\DeprecatedComment' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/DeprecatedComment.php',
'Egulias\\EmailValidator\\Warning\\DomainLiteral' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/DomainLiteral.php',
'Egulias\\EmailValidator\\Warning\\DomainTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/DomainTooLong.php',
'Egulias\\EmailValidator\\Warning\\EmailTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/EmailTooLong.php',
'Egulias\\EmailValidator\\Warning\\IPV6BadChar' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6BadChar.php',
'Egulias\\EmailValidator\\Warning\\IPV6ColonEnd' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonEnd.php',
'Egulias\\EmailValidator\\Warning\\IPV6ColonStart' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonStart.php',
'Egulias\\EmailValidator\\Warning\\IPV6Deprecated' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6Deprecated.php',
'Egulias\\EmailValidator\\Warning\\IPV6DoubleColon' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6DoubleColon.php',
'Egulias\\EmailValidator\\Warning\\IPV6GroupCount' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6GroupCount.php',
'Egulias\\EmailValidator\\Warning\\IPV6MaxGroups' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/IPV6MaxGroups.php',
'Egulias\\EmailValidator\\Warning\\LabelTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/LabelTooLong.php',
'Egulias\\EmailValidator\\Warning\\LocalTooLong' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/LocalTooLong.php',
'Egulias\\EmailValidator\\Warning\\NoDNSMXRecord' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/NoDNSMXRecord.php',
'Egulias\\EmailValidator\\Warning\\ObsoleteDTEXT' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/ObsoleteDTEXT.php',
'Egulias\\EmailValidator\\Warning\\QuotedPart' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/QuotedPart.php',
'Egulias\\EmailValidator\\Warning\\QuotedString' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/QuotedString.php',
'Egulias\\EmailValidator\\Warning\\TLD' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/TLD.php',
'Egulias\\EmailValidator\\Warning\\Warning' => $vendorDir . '/egulias/email-validator/EmailValidator/Warning/Warning.php',
'FPDF_TPL' => $vendorDir . '/setasign/fpdi/fpdf_tpl.php',
'FPDI' => $vendorDir . '/setasign/fpdi/fpdi.php',
'FilterASCII85' => $vendorDir . '/setasign/fpdi/filters/FilterASCII85.php',
'FilterASCIIHexDecode' => $vendorDir . '/setasign/fpdi/filters/FilterASCIIHexDecode.php',
'FilterLZW' => $vendorDir . '/setasign/fpdi/filters/FilterLZW.php',
'Models\\CachedModel' => $baseDir . '/include/rest-api/models/CachedModel.php',
'Models\\Model' => $baseDir . '/include/rest-api/models/Model.php',
'Models\\VisualConsole\\Container' => $baseDir . '/include/rest-api/models/VisualConsole/Container.php',
'Models\\VisualConsole\\Item' => $baseDir . '/include/rest-api/models/VisualConsole/Item.php',
'Models\\VisualConsole\\Items\\BarsGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/BarsGraph.php',
'Models\\VisualConsole\\Items\\Box' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Box.php',
'Models\\VisualConsole\\Items\\Clock' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Clock.php',
'Models\\VisualConsole\\Items\\ColorCloud' => $baseDir . '/include/rest-api/models/VisualConsole/Items/ColorCloud.php',
'Models\\VisualConsole\\Items\\DonutGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/DonutGraph.php',
'Models\\VisualConsole\\Items\\EventsHistory' => $baseDir . '/include/rest-api/models/VisualConsole/Items/EventsHistory.php',
'Models\\VisualConsole\\Items\\Group' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Group.php',
'Models\\VisualConsole\\Items\\Icon' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Icon.php',
'Models\\VisualConsole\\Items\\Label' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Label.php',
'Models\\VisualConsole\\Items\\Line' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Line.php',
'Models\\VisualConsole\\Items\\ModuleGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/ModuleGraph.php',
'Models\\VisualConsole\\Items\\Percentile' => $baseDir . '/include/rest-api/models/VisualConsole/Items/Percentile.php',
'Models\\VisualConsole\\Items\\SimpleValue' => $baseDir . '/include/rest-api/models/VisualConsole/Items/SimpleValue.php',
'Models\\VisualConsole\\Items\\StaticGraph' => $baseDir . '/include/rest-api/models/VisualConsole/Items/StaticGraph.php',
'Mpdf\\Barcode' => $vendorDir . '/mpdf/mpdf/src/Barcode.php',
'Mpdf\\Barcode\\AbstractBarcode' => $vendorDir . '/mpdf/mpdf/src/Barcode/AbstractBarcode.php',
'Mpdf\\Barcode\\BarcodeException' => $vendorDir . '/mpdf/mpdf/src/Barcode/BarcodeException.php',
'Mpdf\\Barcode\\BarcodeInterface' => $vendorDir . '/mpdf/mpdf/src/Barcode/BarcodeInterface.php',
'Mpdf\\Barcode\\Codabar' => $vendorDir . '/mpdf/mpdf/src/Barcode/Codabar.php',
'Mpdf\\Barcode\\Code11' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code11.php',
'Mpdf\\Barcode\\Code128' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code128.php',
'Mpdf\\Barcode\\Code39' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code39.php',
'Mpdf\\Barcode\\Code93' => $vendorDir . '/mpdf/mpdf/src/Barcode/Code93.php',
'Mpdf\\Barcode\\EanExt' => $vendorDir . '/mpdf/mpdf/src/Barcode/EanExt.php',
'Mpdf\\Barcode\\EanUpc' => $vendorDir . '/mpdf/mpdf/src/Barcode/EanUpc.php',
'Mpdf\\Barcode\\I25' => $vendorDir . '/mpdf/mpdf/src/Barcode/I25.php',
'Mpdf\\Barcode\\Imb' => $vendorDir . '/mpdf/mpdf/src/Barcode/Imb.php',
'Mpdf\\Barcode\\Msi' => $vendorDir . '/mpdf/mpdf/src/Barcode/Msi.php',
'Mpdf\\Barcode\\Postnet' => $vendorDir . '/mpdf/mpdf/src/Barcode/Postnet.php',
'Mpdf\\Barcode\\Rm4Scc' => $vendorDir . '/mpdf/mpdf/src/Barcode/Rm4Scc.php',
'Mpdf\\Barcode\\S25' => $vendorDir . '/mpdf/mpdf/src/Barcode/S25.php',
'Mpdf\\Cache' => $vendorDir . '/mpdf/mpdf/src/Cache.php',
'Mpdf\\Color\\ColorConverter' => $vendorDir . '/mpdf/mpdf/src/Color/ColorConverter.php',
'Mpdf\\Color\\ColorModeConverter' => $vendorDir . '/mpdf/mpdf/src/Color/ColorModeConverter.php',
'Mpdf\\Color\\ColorSpaceRestrictor' => $vendorDir . '/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php',
'Mpdf\\Color\\NamedColors' => $vendorDir . '/mpdf/mpdf/src/Color/NamedColors.php',
'Mpdf\\Config\\ConfigVariables' => $vendorDir . '/mpdf/mpdf/src/Config/ConfigVariables.php',
'Mpdf\\Config\\FontVariables' => $vendorDir . '/mpdf/mpdf/src/Config/FontVariables.php',
'Mpdf\\Conversion\\DecToAlpha' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToAlpha.php',
'Mpdf\\Conversion\\DecToCjk' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToCjk.php',
'Mpdf\\Conversion\\DecToHebrew' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToHebrew.php',
'Mpdf\\Conversion\\DecToOther' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToOther.php',
'Mpdf\\Conversion\\DecToRoman' => $vendorDir . '/mpdf/mpdf/src/Conversion/DecToRoman.php',
'Mpdf\\CssManager' => $vendorDir . '/mpdf/mpdf/src/CssManager.php',
'Mpdf\\Css\\Border' => $vendorDir . '/mpdf/mpdf/src/Css/Border.php',
'Mpdf\\Css\\DefaultCss' => $vendorDir . '/mpdf/mpdf/src/Css/DefaultCss.php',
'Mpdf\\Css\\TextVars' => $vendorDir . '/mpdf/mpdf/src/Css/TextVars.php',
'Mpdf\\DirectWrite' => $vendorDir . '/mpdf/mpdf/src/DirectWrite.php',
'Mpdf\\Exception\\InvalidArgumentException' => $vendorDir . '/mpdf/mpdf/src/Exception/InvalidArgumentException.php',
'Mpdf\\Fonts\\FontCache' => $vendorDir . '/mpdf/mpdf/src/Fonts/FontCache.php',
'Mpdf\\Fonts\\FontFileFinder' => $vendorDir . '/mpdf/mpdf/src/Fonts/FontFileFinder.php',
'Mpdf\\Fonts\\GlyphOperator' => $vendorDir . '/mpdf/mpdf/src/Fonts/GlyphOperator.php',
'Mpdf\\Fonts\\MetricsGenerator' => $vendorDir . '/mpdf/mpdf/src/Fonts/MetricsGenerator.php',
'Mpdf\\Form' => $vendorDir . '/mpdf/mpdf/src/Form.php',
'Mpdf\\Gif\\ColorTable' => $vendorDir . '/mpdf/mpdf/src/Gif/ColorTable.php',
'Mpdf\\Gif\\FileHeader' => $vendorDir . '/mpdf/mpdf/src/Gif/FileHeader.php',
'Mpdf\\Gif\\Gif' => $vendorDir . '/mpdf/mpdf/src/Gif/Gif.php',
'Mpdf\\Gif\\Image' => $vendorDir . '/mpdf/mpdf/src/Gif/Image.php',
'Mpdf\\Gif\\ImageHeader' => $vendorDir . '/mpdf/mpdf/src/Gif/ImageHeader.php',
'Mpdf\\Gif\\Lzw' => $vendorDir . '/mpdf/mpdf/src/Gif/Lzw.php',
'Mpdf\\Gradient' => $vendorDir . '/mpdf/mpdf/src/Gradient.php',
'Mpdf\\Hyphenator' => $vendorDir . '/mpdf/mpdf/src/Hyphenator.php',
'Mpdf\\Image\\Bmp' => $vendorDir . '/mpdf/mpdf/src/Image/Bmp.php',
'Mpdf\\Image\\ImageProcessor' => $vendorDir . '/mpdf/mpdf/src/Image/ImageProcessor.php',
'Mpdf\\Image\\ImageTypeGuesser' => $vendorDir . '/mpdf/mpdf/src/Image/ImageTypeGuesser.php',
'Mpdf\\Image\\Svg' => $vendorDir . '/mpdf/mpdf/src/Image/Svg.php',
'Mpdf\\Image\\Wmf' => $vendorDir . '/mpdf/mpdf/src/Image/Wmf.php',
'Mpdf\\Language\\LanguageToFont' => $vendorDir . '/mpdf/mpdf/src/Language/LanguageToFont.php',
'Mpdf\\Language\\LanguageToFontInterface' => $vendorDir . '/mpdf/mpdf/src/Language/LanguageToFontInterface.php',
'Mpdf\\Language\\ScriptToLanguage' => $vendorDir . '/mpdf/mpdf/src/Language/ScriptToLanguage.php',
'Mpdf\\Language\\ScriptToLanguageInterface' => $vendorDir . '/mpdf/mpdf/src/Language/ScriptToLanguageInterface.php',
'Mpdf\\Log\\Context' => $vendorDir . '/mpdf/mpdf/src/Log/Context.php',
'Mpdf\\Mpdf' => $vendorDir . '/mpdf/mpdf/src/Mpdf.php',
'Mpdf\\MpdfException' => $vendorDir . '/mpdf/mpdf/src/MpdfException.php',
'Mpdf\\MpdfImageException' => $vendorDir . '/mpdf/mpdf/src/MpdfImageException.php',
'Mpdf\\Otl' => $vendorDir . '/mpdf/mpdf/src/Otl.php',
'Mpdf\\OtlDump' => $vendorDir . '/mpdf/mpdf/src/OtlDump.php',
'Mpdf\\Output\\Destination' => $vendorDir . '/mpdf/mpdf/src/Output/Destination.php',
'Mpdf\\PageFormat' => $vendorDir . '/mpdf/mpdf/src/PageFormat.php',
'Mpdf\\Pdf\\Protection' => $vendorDir . '/mpdf/mpdf/src/Pdf/Protection.php',
'Mpdf\\Pdf\\Protection\\UniqidGenerator' => $vendorDir . '/mpdf/mpdf/src/Pdf/Protection/UniqidGenerator.php',
'Mpdf\\QrCode\\QrCode' => $vendorDir . '/mpdf/mpdf/src/QrCode/QrCode.php',
'Mpdf\\QrCode\\QrCodeException' => $vendorDir . '/mpdf/mpdf/src/QrCode/QrCodeException.php',
'Mpdf\\Shaper\\Indic' => $vendorDir . '/mpdf/mpdf/src/Shaper/Indic.php',
'Mpdf\\Shaper\\Myanmar' => $vendorDir . '/mpdf/mpdf/src/Shaper/Myanmar.php',
'Mpdf\\Shaper\\Sea' => $vendorDir . '/mpdf/mpdf/src/Shaper/Sea.php',
'Mpdf\\SizeConverter' => $vendorDir . '/mpdf/mpdf/src/SizeConverter.php',
'Mpdf\\TTFontFile' => $vendorDir . '/mpdf/mpdf/src/TTFontFile.php',
'Mpdf\\TTFontFileAnalysis' => $vendorDir . '/mpdf/mpdf/src/TTFontFileAnalysis.php',
'Mpdf\\TableOfContents' => $vendorDir . '/mpdf/mpdf/src/TableOfContents.php',
'Mpdf\\Tag' => $vendorDir . '/mpdf/mpdf/src/Tag.php',
'Mpdf\\Tag\\A' => $vendorDir . '/mpdf/mpdf/src/Tag/A.php',
'Mpdf\\Tag\\Acronym' => $vendorDir . '/mpdf/mpdf/src/Tag/Acronym.php',
'Mpdf\\Tag\\Address' => $vendorDir . '/mpdf/mpdf/src/Tag/Address.php',
'Mpdf\\Tag\\Annotation' => $vendorDir . '/mpdf/mpdf/src/Tag/Annotation.php',
'Mpdf\\Tag\\Article' => $vendorDir . '/mpdf/mpdf/src/Tag/Article.php',
'Mpdf\\Tag\\Aside' => $vendorDir . '/mpdf/mpdf/src/Tag/Aside.php',
'Mpdf\\Tag\\B' => $vendorDir . '/mpdf/mpdf/src/Tag/B.php',
'Mpdf\\Tag\\BarCode' => $vendorDir . '/mpdf/mpdf/src/Tag/BarCode.php',
'Mpdf\\Tag\\Bdi' => $vendorDir . '/mpdf/mpdf/src/Tag/Bdi.php',
'Mpdf\\Tag\\Bdo' => $vendorDir . '/mpdf/mpdf/src/Tag/Bdo.php',
'Mpdf\\Tag\\Big' => $vendorDir . '/mpdf/mpdf/src/Tag/Big.php',
'Mpdf\\Tag\\BlockQuote' => $vendorDir . '/mpdf/mpdf/src/Tag/BlockQuote.php',
'Mpdf\\Tag\\BlockTag' => $vendorDir . '/mpdf/mpdf/src/Tag/BlockTag.php',
'Mpdf\\Tag\\Bookmark' => $vendorDir . '/mpdf/mpdf/src/Tag/Bookmark.php',
'Mpdf\\Tag\\Br' => $vendorDir . '/mpdf/mpdf/src/Tag/Br.php',
'Mpdf\\Tag\\Caption' => $vendorDir . '/mpdf/mpdf/src/Tag/Caption.php',
'Mpdf\\Tag\\Center' => $vendorDir . '/mpdf/mpdf/src/Tag/Center.php',
'Mpdf\\Tag\\Cite' => $vendorDir . '/mpdf/mpdf/src/Tag/Cite.php',
'Mpdf\\Tag\\Code' => $vendorDir . '/mpdf/mpdf/src/Tag/Code.php',
'Mpdf\\Tag\\ColumnBreak' => $vendorDir . '/mpdf/mpdf/src/Tag/ColumnBreak.php',
'Mpdf\\Tag\\Columns' => $vendorDir . '/mpdf/mpdf/src/Tag/Columns.php',
'Mpdf\\Tag\\Dd' => $vendorDir . '/mpdf/mpdf/src/Tag/Dd.php',
'Mpdf\\Tag\\Del' => $vendorDir . '/mpdf/mpdf/src/Tag/Del.php',
'Mpdf\\Tag\\Details' => $vendorDir . '/mpdf/mpdf/src/Tag/Details.php',
'Mpdf\\Tag\\Div' => $vendorDir . '/mpdf/mpdf/src/Tag/Div.php',
'Mpdf\\Tag\\Dl' => $vendorDir . '/mpdf/mpdf/src/Tag/Dl.php',
'Mpdf\\Tag\\DotTab' => $vendorDir . '/mpdf/mpdf/src/Tag/DotTab.php',
'Mpdf\\Tag\\Dt' => $vendorDir . '/mpdf/mpdf/src/Tag/Dt.php',
'Mpdf\\Tag\\Em' => $vendorDir . '/mpdf/mpdf/src/Tag/Em.php',
'Mpdf\\Tag\\FieldSet' => $vendorDir . '/mpdf/mpdf/src/Tag/FieldSet.php',
'Mpdf\\Tag\\FigCaption' => $vendorDir . '/mpdf/mpdf/src/Tag/FigCaption.php',
'Mpdf\\Tag\\Figure' => $vendorDir . '/mpdf/mpdf/src/Tag/Figure.php',
'Mpdf\\Tag\\Font' => $vendorDir . '/mpdf/mpdf/src/Tag/Font.php',
'Mpdf\\Tag\\Footer' => $vendorDir . '/mpdf/mpdf/src/Tag/Footer.php',
'Mpdf\\Tag\\Form' => $vendorDir . '/mpdf/mpdf/src/Tag/Form.php',
'Mpdf\\Tag\\FormFeed' => $vendorDir . '/mpdf/mpdf/src/Tag/FormFeed.php',
'Mpdf\\Tag\\H1' => $vendorDir . '/mpdf/mpdf/src/Tag/H1.php',
'Mpdf\\Tag\\H2' => $vendorDir . '/mpdf/mpdf/src/Tag/H2.php',
'Mpdf\\Tag\\H3' => $vendorDir . '/mpdf/mpdf/src/Tag/H3.php',
'Mpdf\\Tag\\H4' => $vendorDir . '/mpdf/mpdf/src/Tag/H4.php',
'Mpdf\\Tag\\H5' => $vendorDir . '/mpdf/mpdf/src/Tag/H5.php',
'Mpdf\\Tag\\H6' => $vendorDir . '/mpdf/mpdf/src/Tag/H6.php',
'Mpdf\\Tag\\HGroup' => $vendorDir . '/mpdf/mpdf/src/Tag/HGroup.php',
'Mpdf\\Tag\\Header' => $vendorDir . '/mpdf/mpdf/src/Tag/Header.php',
'Mpdf\\Tag\\Hr' => $vendorDir . '/mpdf/mpdf/src/Tag/Hr.php',
'Mpdf\\Tag\\I' => $vendorDir . '/mpdf/mpdf/src/Tag/I.php',
'Mpdf\\Tag\\Img' => $vendorDir . '/mpdf/mpdf/src/Tag/Img.php',
'Mpdf\\Tag\\IndexEntry' => $vendorDir . '/mpdf/mpdf/src/Tag/IndexEntry.php',
'Mpdf\\Tag\\IndexInsert' => $vendorDir . '/mpdf/mpdf/src/Tag/IndexInsert.php',
'Mpdf\\Tag\\InlineTag' => $vendorDir . '/mpdf/mpdf/src/Tag/InlineTag.php',
'Mpdf\\Tag\\Input' => $vendorDir . '/mpdf/mpdf/src/Tag/Input.php',
'Mpdf\\Tag\\Ins' => $vendorDir . '/mpdf/mpdf/src/Tag/Ins.php',
'Mpdf\\Tag\\Kbd' => $vendorDir . '/mpdf/mpdf/src/Tag/Kbd.php',
'Mpdf\\Tag\\Legend' => $vendorDir . '/mpdf/mpdf/src/Tag/Legend.php',
'Mpdf\\Tag\\Li' => $vendorDir . '/mpdf/mpdf/src/Tag/Li.php',
'Mpdf\\Tag\\Main' => $vendorDir . '/mpdf/mpdf/src/Tag/Main.php',
'Mpdf\\Tag\\Mark' => $vendorDir . '/mpdf/mpdf/src/Tag/Mark.php',
'Mpdf\\Tag\\Meter' => $vendorDir . '/mpdf/mpdf/src/Tag/Meter.php',
'Mpdf\\Tag\\Nav' => $vendorDir . '/mpdf/mpdf/src/Tag/Nav.php',
'Mpdf\\Tag\\NewColumn' => $vendorDir . '/mpdf/mpdf/src/Tag/NewColumn.php',
'Mpdf\\Tag\\NewPage' => $vendorDir . '/mpdf/mpdf/src/Tag/NewPage.php',
'Mpdf\\Tag\\Ol' => $vendorDir . '/mpdf/mpdf/src/Tag/Ol.php',
'Mpdf\\Tag\\Option' => $vendorDir . '/mpdf/mpdf/src/Tag/Option.php',
'Mpdf\\Tag\\P' => $vendorDir . '/mpdf/mpdf/src/Tag/P.php',
'Mpdf\\Tag\\PageBreak' => $vendorDir . '/mpdf/mpdf/src/Tag/PageBreak.php',
'Mpdf\\Tag\\PageFooter' => $vendorDir . '/mpdf/mpdf/src/Tag/PageFooter.php',
'Mpdf\\Tag\\PageHeader' => $vendorDir . '/mpdf/mpdf/src/Tag/PageHeader.php',
'Mpdf\\Tag\\Pre' => $vendorDir . '/mpdf/mpdf/src/Tag/Pre.php',
'Mpdf\\Tag\\Progress' => $vendorDir . '/mpdf/mpdf/src/Tag/Progress.php',
'Mpdf\\Tag\\Q' => $vendorDir . '/mpdf/mpdf/src/Tag/Q.php',
'Mpdf\\Tag\\S' => $vendorDir . '/mpdf/mpdf/src/Tag/S.php',
'Mpdf\\Tag\\Samp' => $vendorDir . '/mpdf/mpdf/src/Tag/Samp.php',
'Mpdf\\Tag\\Section' => $vendorDir . '/mpdf/mpdf/src/Tag/Section.php',
'Mpdf\\Tag\\Select' => $vendorDir . '/mpdf/mpdf/src/Tag/Select.php',
'Mpdf\\Tag\\SetHtmlPageFooter' => $vendorDir . '/mpdf/mpdf/src/Tag/SetHtmlPageFooter.php',
'Mpdf\\Tag\\SetHtmlPageHeader' => $vendorDir . '/mpdf/mpdf/src/Tag/SetHtmlPageHeader.php',
'Mpdf\\Tag\\SetPageFooter' => $vendorDir . '/mpdf/mpdf/src/Tag/SetPageFooter.php',
'Mpdf\\Tag\\SetPageHeader' => $vendorDir . '/mpdf/mpdf/src/Tag/SetPageHeader.php',
'Mpdf\\Tag\\Small' => $vendorDir . '/mpdf/mpdf/src/Tag/Small.php',
'Mpdf\\Tag\\Span' => $vendorDir . '/mpdf/mpdf/src/Tag/Span.php',
'Mpdf\\Tag\\Strike' => $vendorDir . '/mpdf/mpdf/src/Tag/Strike.php',
'Mpdf\\Tag\\Strong' => $vendorDir . '/mpdf/mpdf/src/Tag/Strong.php',
'Mpdf\\Tag\\Sub' => $vendorDir . '/mpdf/mpdf/src/Tag/Sub.php',
'Mpdf\\Tag\\SubstituteTag' => $vendorDir . '/mpdf/mpdf/src/Tag/SubstituteTag.php',
'Mpdf\\Tag\\Summary' => $vendorDir . '/mpdf/mpdf/src/Tag/Summary.php',
'Mpdf\\Tag\\Sup' => $vendorDir . '/mpdf/mpdf/src/Tag/Sup.php',
'Mpdf\\Tag\\TBody' => $vendorDir . '/mpdf/mpdf/src/Tag/TBody.php',
'Mpdf\\Tag\\TFoot' => $vendorDir . '/mpdf/mpdf/src/Tag/TFoot.php',
'Mpdf\\Tag\\THead' => $vendorDir . '/mpdf/mpdf/src/Tag/THead.php',
'Mpdf\\Tag\\Table' => $vendorDir . '/mpdf/mpdf/src/Tag/Table.php',
'Mpdf\\Tag\\Tag' => $vendorDir . '/mpdf/mpdf/src/Tag/Tag.php',
'Mpdf\\Tag\\Td' => $vendorDir . '/mpdf/mpdf/src/Tag/Td.php',
'Mpdf\\Tag\\TextArea' => $vendorDir . '/mpdf/mpdf/src/Tag/TextArea.php',
'Mpdf\\Tag\\TextCircle' => $vendorDir . '/mpdf/mpdf/src/Tag/TextCircle.php',
'Mpdf\\Tag\\Th' => $vendorDir . '/mpdf/mpdf/src/Tag/Th.php',
'Mpdf\\Tag\\Time' => $vendorDir . '/mpdf/mpdf/src/Tag/Time.php',
'Mpdf\\Tag\\Toc' => $vendorDir . '/mpdf/mpdf/src/Tag/Toc.php',
'Mpdf\\Tag\\TocEntry' => $vendorDir . '/mpdf/mpdf/src/Tag/TocEntry.php',
'Mpdf\\Tag\\TocPageBreak' => $vendorDir . '/mpdf/mpdf/src/Tag/TocPageBreak.php',
'Mpdf\\Tag\\Tr' => $vendorDir . '/mpdf/mpdf/src/Tag/Tr.php',
'Mpdf\\Tag\\Tt' => $vendorDir . '/mpdf/mpdf/src/Tag/Tt.php',
'Mpdf\\Tag\\Tta' => $vendorDir . '/mpdf/mpdf/src/Tag/Tta.php',
'Mpdf\\Tag\\Tts' => $vendorDir . '/mpdf/mpdf/src/Tag/Tts.php',
'Mpdf\\Tag\\Ttz' => $vendorDir . '/mpdf/mpdf/src/Tag/Ttz.php',
'Mpdf\\Tag\\U' => $vendorDir . '/mpdf/mpdf/src/Tag/U.php',
'Mpdf\\Tag\\Ul' => $vendorDir . '/mpdf/mpdf/src/Tag/Ul.php',
'Mpdf\\Tag\\VarTag' => $vendorDir . '/mpdf/mpdf/src/Tag/VarTag.php',
'Mpdf\\Tag\\WatermarkImage' => $vendorDir . '/mpdf/mpdf/src/Tag/WatermarkImage.php',
'Mpdf\\Tag\\WatermarkText' => $vendorDir . '/mpdf/mpdf/src/Tag/WatermarkText.php',
'Mpdf\\Ucdn' => $vendorDir . '/mpdf/mpdf/src/Ucdn.php',
'Mpdf\\Utils\\Arrays' => $vendorDir . '/mpdf/mpdf/src/Utils/Arrays.php',
'Mpdf\\Utils\\NumericString' => $vendorDir . '/mpdf/mpdf/src/Utils/NumericString.php',
'Mpdf\\Utils\\PdfDate' => $vendorDir . '/mpdf/mpdf/src/Utils/PdfDate.php',
'Mpdf\\Utils\\UtfString' => $vendorDir . '/mpdf/mpdf/src/Utils/UtfString.php',
'PandoraFMS\\User' => $baseDir . '/include/lib/User.php',
'PandoraFMS\\WebSockets\\WSManager' => $baseDir . '/include/lib/WSManager.php',
'PandoraFMS\\Websockets\\WebSocketServer' => $baseDir . '/include/lib/WebSocketServer.php',
'PandoraFMS\\Websockets\\WebSocketUser' => $baseDir . '/include/lib/WebSocketUser.php',
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'fpdi_pdf_parser' => $vendorDir . '/setasign/fpdi/fpdi_pdf_parser.php',
'pdf_context' => $vendorDir . '/setasign/fpdi/pdf_context.php',
);

View File

@ -8,6 +8,8 @@ $baseDir = dirname($vendorDir);
return array(
'Tests\\' => array($baseDir . '/tests'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'PandoraFMS\\Enterprise\\' => array($baseDir . '/enterprise/include/lib'),
'PandoraFMS\\' => array($baseDir . '/include/lib'),
'Mpdf\\' => array($vendorDir . '/mpdf/mpdf/src'),
'Models\\' => array($baseDir . '/include/rest-api/models'),
'Enterprise\\Models\\' => array($baseDir . '/enterprise/include/rest-api/models'),

View File

@ -19,6 +19,8 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa
'P' =>
array (
'Psr\\Log\\' => 8,
'PandoraFMS\\Enterprise\\' => 22,
'PandoraFMS\\' => 11,
),
'M' =>
array (
@ -45,6 +47,14 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa
array (
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
),
'PandoraFMS\\Enterprise\\' =>
array (
0 => __DIR__ . '/../..' . '/enterprise/include/lib',
),
'PandoraFMS\\' =>
array (
0 => __DIR__ . '/../..' . '/include/lib',
),
'Mpdf\\' =>
array (
0 => __DIR__ . '/..' . '/mpdf/mpdf/src',
@ -78,11 +88,321 @@ class ComposerStaticInitfdecadadce22e6dde51e9535fe4ad7aa
);
public static $classMap = array (
'DeepCopy\\DeepCopy' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/DeepCopy.php',
'DeepCopy\\Exception\\CloneException' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php',
'DeepCopy\\Exception\\PropertyException' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php',
'DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php',
'DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php',
'DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php',
'DeepCopy\\Filter\\Filter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Filter.php',
'DeepCopy\\Filter\\KeepFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/KeepFilter.php',
'DeepCopy\\Filter\\ReplaceFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php',
'DeepCopy\\Filter\\SetNullFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php',
'DeepCopy\\Matcher\\Doctrine\\DoctrineProxyMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php',
'DeepCopy\\Matcher\\Matcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/Matcher.php',
'DeepCopy\\Matcher\\PropertyMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php',
'DeepCopy\\Matcher\\PropertyNameMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php',
'DeepCopy\\Matcher\\PropertyTypeMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php',
'DeepCopy\\Reflection\\ReflectionHelper' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php',
'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php',
'DeepCopy\\TypeFilter\\ReplaceFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php',
'DeepCopy\\TypeFilter\\ShallowCopyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php',
'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedList' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedList.php',
'DeepCopy\\TypeFilter\\Spl\\SplDoublyLinkedListFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/SplDoublyLinkedListFilter.php',
'DeepCopy\\TypeFilter\\TypeFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/TypeFilter.php',
'DeepCopy\\TypeMatcher\\TypeMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php',
'Doctrine\\Common\\Lexer\\AbstractLexer' => __DIR__ . '/..' . '/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php',
'Egulias\\EmailValidator\\EmailLexer' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailLexer.php',
'Egulias\\EmailValidator\\EmailParser' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailParser.php',
'Egulias\\EmailValidator\\EmailValidator' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/EmailValidator.php',
'Egulias\\EmailValidator\\Exception\\AtextAfterCFWS' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/AtextAfterCFWS.php',
'Egulias\\EmailValidator\\Exception\\CRLFAtTheEnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CRLFAtTheEnd.php',
'Egulias\\EmailValidator\\Exception\\CRLFX2' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CRLFX2.php',
'Egulias\\EmailValidator\\Exception\\CRNoLF' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CRNoLF.php',
'Egulias\\EmailValidator\\Exception\\CharNotAllowed' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CharNotAllowed.php',
'Egulias\\EmailValidator\\Exception\\CommaInDomain' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/CommaInDomain.php',
'Egulias\\EmailValidator\\Exception\\ConsecutiveAt' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveAt.php',
'Egulias\\EmailValidator\\Exception\\ConsecutiveDot' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ConsecutiveDot.php',
'Egulias\\EmailValidator\\Exception\\DomainHyphened' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/DomainHyphened.php',
'Egulias\\EmailValidator\\Exception\\DotAtEnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/DotAtEnd.php',
'Egulias\\EmailValidator\\Exception\\DotAtStart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/DotAtStart.php',
'Egulias\\EmailValidator\\Exception\\ExpectedQPair' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingQPair.php',
'Egulias\\EmailValidator\\Exception\\ExpectingAT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingAT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingATEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingATEXT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingCTEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingCTEXT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingDTEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingDTEXT.php',
'Egulias\\EmailValidator\\Exception\\ExpectingDomainLiteralClose' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/ExpectingDomainLiteralClose.php',
'Egulias\\EmailValidator\\Exception\\InvalidEmail' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/InvalidEmail.php',
'Egulias\\EmailValidator\\Exception\\NoDNSRecord' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/NoDNSRecord.php',
'Egulias\\EmailValidator\\Exception\\NoDomainPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/NoDomainPart.php',
'Egulias\\EmailValidator\\Exception\\NoLocalPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/NoLocalPart.php',
'Egulias\\EmailValidator\\Exception\\UnclosedComment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/UnclosedComment.php',
'Egulias\\EmailValidator\\Exception\\UnclosedQuotedString' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/UnclosedQuotedString.php',
'Egulias\\EmailValidator\\Exception\\UnopenedComment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Exception/UnopenedComment.php',
'Egulias\\EmailValidator\\Parser\\DomainPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Parser/DomainPart.php',
'Egulias\\EmailValidator\\Parser\\LocalPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Parser/LocalPart.php',
'Egulias\\EmailValidator\\Parser\\Parser' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Parser/Parser.php',
'Egulias\\EmailValidator\\Validation\\DNSCheckValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/DNSCheckValidation.php',
'Egulias\\EmailValidator\\Validation\\EmailValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/EmailValidation.php',
'Egulias\\EmailValidator\\Validation\\Error\\RFCWarnings' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/Error/RFCWarnings.php',
'Egulias\\EmailValidator\\Validation\\Error\\SpoofEmail' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/Error/SpoofEmail.php',
'Egulias\\EmailValidator\\Validation\\Exception\\EmptyValidationList' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/Exception/EmptyValidationList.php',
'Egulias\\EmailValidator\\Validation\\MultipleErrors' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/MultipleErrors.php',
'Egulias\\EmailValidator\\Validation\\MultipleValidationWithAnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/MultipleValidationWithAnd.php',
'Egulias\\EmailValidator\\Validation\\NoRFCWarningsValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/NoRFCWarningsValidation.php',
'Egulias\\EmailValidator\\Validation\\RFCValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/RFCValidation.php',
'Egulias\\EmailValidator\\Validation\\SpoofCheckValidation' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Validation/SpoofCheckValidation.php',
'Egulias\\EmailValidator\\Warning\\AddressLiteral' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/AddressLiteral.php',
'Egulias\\EmailValidator\\Warning\\CFWSNearAt' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/CFWSNearAt.php',
'Egulias\\EmailValidator\\Warning\\CFWSWithFWS' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/CFWSWithFWS.php',
'Egulias\\EmailValidator\\Warning\\Comment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/Comment.php',
'Egulias\\EmailValidator\\Warning\\DeprecatedComment' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/DeprecatedComment.php',
'Egulias\\EmailValidator\\Warning\\DomainLiteral' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/DomainLiteral.php',
'Egulias\\EmailValidator\\Warning\\DomainTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/DomainTooLong.php',
'Egulias\\EmailValidator\\Warning\\EmailTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/EmailTooLong.php',
'Egulias\\EmailValidator\\Warning\\IPV6BadChar' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6BadChar.php',
'Egulias\\EmailValidator\\Warning\\IPV6ColonEnd' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonEnd.php',
'Egulias\\EmailValidator\\Warning\\IPV6ColonStart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6ColonStart.php',
'Egulias\\EmailValidator\\Warning\\IPV6Deprecated' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6Deprecated.php',
'Egulias\\EmailValidator\\Warning\\IPV6DoubleColon' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6DoubleColon.php',
'Egulias\\EmailValidator\\Warning\\IPV6GroupCount' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6GroupCount.php',
'Egulias\\EmailValidator\\Warning\\IPV6MaxGroups' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/IPV6MaxGroups.php',
'Egulias\\EmailValidator\\Warning\\LabelTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/LabelTooLong.php',
'Egulias\\EmailValidator\\Warning\\LocalTooLong' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/LocalTooLong.php',
'Egulias\\EmailValidator\\Warning\\NoDNSMXRecord' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/NoDNSMXRecord.php',
'Egulias\\EmailValidator\\Warning\\ObsoleteDTEXT' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/ObsoleteDTEXT.php',
'Egulias\\EmailValidator\\Warning\\QuotedPart' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/QuotedPart.php',
'Egulias\\EmailValidator\\Warning\\QuotedString' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/QuotedString.php',
'Egulias\\EmailValidator\\Warning\\TLD' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/TLD.php',
'Egulias\\EmailValidator\\Warning\\Warning' => __DIR__ . '/..' . '/egulias/email-validator/EmailValidator/Warning/Warning.php',
'FPDF_TPL' => __DIR__ . '/..' . '/setasign/fpdi/fpdf_tpl.php',
'FPDI' => __DIR__ . '/..' . '/setasign/fpdi/fpdi.php',
'FilterASCII85' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterASCII85.php',
'FilterASCIIHexDecode' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterASCIIHexDecode.php',
'FilterLZW' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterLZW.php',
'Models\\CachedModel' => __DIR__ . '/../..' . '/include/rest-api/models/CachedModel.php',
'Models\\Model' => __DIR__ . '/../..' . '/include/rest-api/models/Model.php',
'Models\\VisualConsole\\Container' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Container.php',
'Models\\VisualConsole\\Item' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Item.php',
'Models\\VisualConsole\\Items\\BarsGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/BarsGraph.php',
'Models\\VisualConsole\\Items\\Box' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Box.php',
'Models\\VisualConsole\\Items\\Clock' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Clock.php',
'Models\\VisualConsole\\Items\\ColorCloud' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/ColorCloud.php',
'Models\\VisualConsole\\Items\\DonutGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/DonutGraph.php',
'Models\\VisualConsole\\Items\\EventsHistory' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/EventsHistory.php',
'Models\\VisualConsole\\Items\\Group' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Group.php',
'Models\\VisualConsole\\Items\\Icon' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Icon.php',
'Models\\VisualConsole\\Items\\Label' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Label.php',
'Models\\VisualConsole\\Items\\Line' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Line.php',
'Models\\VisualConsole\\Items\\ModuleGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/ModuleGraph.php',
'Models\\VisualConsole\\Items\\Percentile' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/Percentile.php',
'Models\\VisualConsole\\Items\\SimpleValue' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/SimpleValue.php',
'Models\\VisualConsole\\Items\\StaticGraph' => __DIR__ . '/../..' . '/include/rest-api/models/VisualConsole/Items/StaticGraph.php',
'Mpdf\\Barcode' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode.php',
'Mpdf\\Barcode\\AbstractBarcode' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/AbstractBarcode.php',
'Mpdf\\Barcode\\BarcodeException' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/BarcodeException.php',
'Mpdf\\Barcode\\BarcodeInterface' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/BarcodeInterface.php',
'Mpdf\\Barcode\\Codabar' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Codabar.php',
'Mpdf\\Barcode\\Code11' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code11.php',
'Mpdf\\Barcode\\Code128' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code128.php',
'Mpdf\\Barcode\\Code39' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code39.php',
'Mpdf\\Barcode\\Code93' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Code93.php',
'Mpdf\\Barcode\\EanExt' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/EanExt.php',
'Mpdf\\Barcode\\EanUpc' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/EanUpc.php',
'Mpdf\\Barcode\\I25' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/I25.php',
'Mpdf\\Barcode\\Imb' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Imb.php',
'Mpdf\\Barcode\\Msi' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Msi.php',
'Mpdf\\Barcode\\Postnet' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Postnet.php',
'Mpdf\\Barcode\\Rm4Scc' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/Rm4Scc.php',
'Mpdf\\Barcode\\S25' => __DIR__ . '/..' . '/mpdf/mpdf/src/Barcode/S25.php',
'Mpdf\\Cache' => __DIR__ . '/..' . '/mpdf/mpdf/src/Cache.php',
'Mpdf\\Color\\ColorConverter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/ColorConverter.php',
'Mpdf\\Color\\ColorModeConverter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/ColorModeConverter.php',
'Mpdf\\Color\\ColorSpaceRestrictor' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/ColorSpaceRestrictor.php',
'Mpdf\\Color\\NamedColors' => __DIR__ . '/..' . '/mpdf/mpdf/src/Color/NamedColors.php',
'Mpdf\\Config\\ConfigVariables' => __DIR__ . '/..' . '/mpdf/mpdf/src/Config/ConfigVariables.php',
'Mpdf\\Config\\FontVariables' => __DIR__ . '/..' . '/mpdf/mpdf/src/Config/FontVariables.php',
'Mpdf\\Conversion\\DecToAlpha' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToAlpha.php',
'Mpdf\\Conversion\\DecToCjk' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToCjk.php',
'Mpdf\\Conversion\\DecToHebrew' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToHebrew.php',
'Mpdf\\Conversion\\DecToOther' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToOther.php',
'Mpdf\\Conversion\\DecToRoman' => __DIR__ . '/..' . '/mpdf/mpdf/src/Conversion/DecToRoman.php',
'Mpdf\\CssManager' => __DIR__ . '/..' . '/mpdf/mpdf/src/CssManager.php',
'Mpdf\\Css\\Border' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/Border.php',
'Mpdf\\Css\\DefaultCss' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/DefaultCss.php',
'Mpdf\\Css\\TextVars' => __DIR__ . '/..' . '/mpdf/mpdf/src/Css/TextVars.php',
'Mpdf\\DirectWrite' => __DIR__ . '/..' . '/mpdf/mpdf/src/DirectWrite.php',
'Mpdf\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/mpdf/mpdf/src/Exception/InvalidArgumentException.php',
'Mpdf\\Fonts\\FontCache' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/FontCache.php',
'Mpdf\\Fonts\\FontFileFinder' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/FontFileFinder.php',
'Mpdf\\Fonts\\GlyphOperator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/GlyphOperator.php',
'Mpdf\\Fonts\\MetricsGenerator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Fonts/MetricsGenerator.php',
'Mpdf\\Form' => __DIR__ . '/..' . '/mpdf/mpdf/src/Form.php',
'Mpdf\\Gif\\ColorTable' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/ColorTable.php',
'Mpdf\\Gif\\FileHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/FileHeader.php',
'Mpdf\\Gif\\Gif' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Gif.php',
'Mpdf\\Gif\\Image' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Image.php',
'Mpdf\\Gif\\ImageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/ImageHeader.php',
'Mpdf\\Gif\\Lzw' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Lzw.php',
'Mpdf\\Gradient' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gradient.php',
'Mpdf\\Hyphenator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Hyphenator.php',
'Mpdf\\Image\\Bmp' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Bmp.php',
'Mpdf\\Image\\ImageProcessor' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/ImageProcessor.php',
'Mpdf\\Image\\ImageTypeGuesser' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/ImageTypeGuesser.php',
'Mpdf\\Image\\Svg' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Svg.php',
'Mpdf\\Image\\Wmf' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Wmf.php',
'Mpdf\\Language\\LanguageToFont' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/LanguageToFont.php',
'Mpdf\\Language\\LanguageToFontInterface' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/LanguageToFontInterface.php',
'Mpdf\\Language\\ScriptToLanguage' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/ScriptToLanguage.php',
'Mpdf\\Language\\ScriptToLanguageInterface' => __DIR__ . '/..' . '/mpdf/mpdf/src/Language/ScriptToLanguageInterface.php',
'Mpdf\\Log\\Context' => __DIR__ . '/..' . '/mpdf/mpdf/src/Log/Context.php',
'Mpdf\\Mpdf' => __DIR__ . '/..' . '/mpdf/mpdf/src/Mpdf.php',
'Mpdf\\MpdfException' => __DIR__ . '/..' . '/mpdf/mpdf/src/MpdfException.php',
'Mpdf\\MpdfImageException' => __DIR__ . '/..' . '/mpdf/mpdf/src/MpdfImageException.php',
'Mpdf\\Otl' => __DIR__ . '/..' . '/mpdf/mpdf/src/Otl.php',
'Mpdf\\OtlDump' => __DIR__ . '/..' . '/mpdf/mpdf/src/OtlDump.php',
'Mpdf\\Output\\Destination' => __DIR__ . '/..' . '/mpdf/mpdf/src/Output/Destination.php',
'Mpdf\\PageFormat' => __DIR__ . '/..' . '/mpdf/mpdf/src/PageFormat.php',
'Mpdf\\Pdf\\Protection' => __DIR__ . '/..' . '/mpdf/mpdf/src/Pdf/Protection.php',
'Mpdf\\Pdf\\Protection\\UniqidGenerator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Pdf/Protection/UniqidGenerator.php',
'Mpdf\\QrCode\\QrCode' => __DIR__ . '/..' . '/mpdf/mpdf/src/QrCode/QrCode.php',
'Mpdf\\QrCode\\QrCodeException' => __DIR__ . '/..' . '/mpdf/mpdf/src/QrCode/QrCodeException.php',
'Mpdf\\Shaper\\Indic' => __DIR__ . '/..' . '/mpdf/mpdf/src/Shaper/Indic.php',
'Mpdf\\Shaper\\Myanmar' => __DIR__ . '/..' . '/mpdf/mpdf/src/Shaper/Myanmar.php',
'Mpdf\\Shaper\\Sea' => __DIR__ . '/..' . '/mpdf/mpdf/src/Shaper/Sea.php',
'Mpdf\\SizeConverter' => __DIR__ . '/..' . '/mpdf/mpdf/src/SizeConverter.php',
'Mpdf\\TTFontFile' => __DIR__ . '/..' . '/mpdf/mpdf/src/TTFontFile.php',
'Mpdf\\TTFontFileAnalysis' => __DIR__ . '/..' . '/mpdf/mpdf/src/TTFontFileAnalysis.php',
'Mpdf\\TableOfContents' => __DIR__ . '/..' . '/mpdf/mpdf/src/TableOfContents.php',
'Mpdf\\Tag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag.php',
'Mpdf\\Tag\\A' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/A.php',
'Mpdf\\Tag\\Acronym' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Acronym.php',
'Mpdf\\Tag\\Address' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Address.php',
'Mpdf\\Tag\\Annotation' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Annotation.php',
'Mpdf\\Tag\\Article' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Article.php',
'Mpdf\\Tag\\Aside' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Aside.php',
'Mpdf\\Tag\\B' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/B.php',
'Mpdf\\Tag\\BarCode' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/BarCode.php',
'Mpdf\\Tag\\Bdi' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Bdi.php',
'Mpdf\\Tag\\Bdo' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Bdo.php',
'Mpdf\\Tag\\Big' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Big.php',
'Mpdf\\Tag\\BlockQuote' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/BlockQuote.php',
'Mpdf\\Tag\\BlockTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/BlockTag.php',
'Mpdf\\Tag\\Bookmark' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Bookmark.php',
'Mpdf\\Tag\\Br' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Br.php',
'Mpdf\\Tag\\Caption' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Caption.php',
'Mpdf\\Tag\\Center' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Center.php',
'Mpdf\\Tag\\Cite' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Cite.php',
'Mpdf\\Tag\\Code' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Code.php',
'Mpdf\\Tag\\ColumnBreak' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/ColumnBreak.php',
'Mpdf\\Tag\\Columns' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Columns.php',
'Mpdf\\Tag\\Dd' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Dd.php',
'Mpdf\\Tag\\Del' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Del.php',
'Mpdf\\Tag\\Details' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Details.php',
'Mpdf\\Tag\\Div' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Div.php',
'Mpdf\\Tag\\Dl' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Dl.php',
'Mpdf\\Tag\\DotTab' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/DotTab.php',
'Mpdf\\Tag\\Dt' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Dt.php',
'Mpdf\\Tag\\Em' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Em.php',
'Mpdf\\Tag\\FieldSet' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/FieldSet.php',
'Mpdf\\Tag\\FigCaption' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/FigCaption.php',
'Mpdf\\Tag\\Figure' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Figure.php',
'Mpdf\\Tag\\Font' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Font.php',
'Mpdf\\Tag\\Footer' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Footer.php',
'Mpdf\\Tag\\Form' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Form.php',
'Mpdf\\Tag\\FormFeed' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/FormFeed.php',
'Mpdf\\Tag\\H1' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H1.php',
'Mpdf\\Tag\\H2' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H2.php',
'Mpdf\\Tag\\H3' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H3.php',
'Mpdf\\Tag\\H4' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H4.php',
'Mpdf\\Tag\\H5' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H5.php',
'Mpdf\\Tag\\H6' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/H6.php',
'Mpdf\\Tag\\HGroup' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/HGroup.php',
'Mpdf\\Tag\\Header' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Header.php',
'Mpdf\\Tag\\Hr' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Hr.php',
'Mpdf\\Tag\\I' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/I.php',
'Mpdf\\Tag\\Img' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Img.php',
'Mpdf\\Tag\\IndexEntry' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/IndexEntry.php',
'Mpdf\\Tag\\IndexInsert' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/IndexInsert.php',
'Mpdf\\Tag\\InlineTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/InlineTag.php',
'Mpdf\\Tag\\Input' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Input.php',
'Mpdf\\Tag\\Ins' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ins.php',
'Mpdf\\Tag\\Kbd' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Kbd.php',
'Mpdf\\Tag\\Legend' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Legend.php',
'Mpdf\\Tag\\Li' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Li.php',
'Mpdf\\Tag\\Main' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Main.php',
'Mpdf\\Tag\\Mark' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Mark.php',
'Mpdf\\Tag\\Meter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Meter.php',
'Mpdf\\Tag\\Nav' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Nav.php',
'Mpdf\\Tag\\NewColumn' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/NewColumn.php',
'Mpdf\\Tag\\NewPage' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/NewPage.php',
'Mpdf\\Tag\\Ol' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ol.php',
'Mpdf\\Tag\\Option' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Option.php',
'Mpdf\\Tag\\P' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/P.php',
'Mpdf\\Tag\\PageBreak' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/PageBreak.php',
'Mpdf\\Tag\\PageFooter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/PageFooter.php',
'Mpdf\\Tag\\PageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/PageHeader.php',
'Mpdf\\Tag\\Pre' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Pre.php',
'Mpdf\\Tag\\Progress' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Progress.php',
'Mpdf\\Tag\\Q' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Q.php',
'Mpdf\\Tag\\S' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/S.php',
'Mpdf\\Tag\\Samp' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Samp.php',
'Mpdf\\Tag\\Section' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Section.php',
'Mpdf\\Tag\\Select' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Select.php',
'Mpdf\\Tag\\SetHtmlPageFooter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetHtmlPageFooter.php',
'Mpdf\\Tag\\SetHtmlPageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetHtmlPageHeader.php',
'Mpdf\\Tag\\SetPageFooter' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetPageFooter.php',
'Mpdf\\Tag\\SetPageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SetPageHeader.php',
'Mpdf\\Tag\\Small' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Small.php',
'Mpdf\\Tag\\Span' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Span.php',
'Mpdf\\Tag\\Strike' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Strike.php',
'Mpdf\\Tag\\Strong' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Strong.php',
'Mpdf\\Tag\\Sub' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Sub.php',
'Mpdf\\Tag\\SubstituteTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/SubstituteTag.php',
'Mpdf\\Tag\\Summary' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Summary.php',
'Mpdf\\Tag\\Sup' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Sup.php',
'Mpdf\\Tag\\TBody' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TBody.php',
'Mpdf\\Tag\\TFoot' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TFoot.php',
'Mpdf\\Tag\\THead' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/THead.php',
'Mpdf\\Tag\\Table' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Table.php',
'Mpdf\\Tag\\Tag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tag.php',
'Mpdf\\Tag\\Td' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Td.php',
'Mpdf\\Tag\\TextArea' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TextArea.php',
'Mpdf\\Tag\\TextCircle' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TextCircle.php',
'Mpdf\\Tag\\Th' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Th.php',
'Mpdf\\Tag\\Time' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Time.php',
'Mpdf\\Tag\\Toc' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Toc.php',
'Mpdf\\Tag\\TocEntry' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TocEntry.php',
'Mpdf\\Tag\\TocPageBreak' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/TocPageBreak.php',
'Mpdf\\Tag\\Tr' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tr.php',
'Mpdf\\Tag\\Tt' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tt.php',
'Mpdf\\Tag\\Tta' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tta.php',
'Mpdf\\Tag\\Tts' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Tts.php',
'Mpdf\\Tag\\Ttz' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ttz.php',
'Mpdf\\Tag\\U' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/U.php',
'Mpdf\\Tag\\Ul' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/Ul.php',
'Mpdf\\Tag\\VarTag' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/VarTag.php',
'Mpdf\\Tag\\WatermarkImage' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/WatermarkImage.php',
'Mpdf\\Tag\\WatermarkText' => __DIR__ . '/..' . '/mpdf/mpdf/src/Tag/WatermarkText.php',
'Mpdf\\Ucdn' => __DIR__ . '/..' . '/mpdf/mpdf/src/Ucdn.php',
'Mpdf\\Utils\\Arrays' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/Arrays.php',
'Mpdf\\Utils\\NumericString' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/NumericString.php',
'Mpdf\\Utils\\PdfDate' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/PdfDate.php',
'Mpdf\\Utils\\UtfString' => __DIR__ . '/..' . '/mpdf/mpdf/src/Utils/UtfString.php',
'PandoraFMS\\User' => __DIR__ . '/../..' . '/include/lib/User.php',
'PandoraFMS\\WebSockets\\WSManager' => __DIR__ . '/../..' . '/include/lib/WSManager.php',
'PandoraFMS\\Websockets\\WebSocketServer' => __DIR__ . '/../..' . '/include/lib/WebSocketServer.php',
'PandoraFMS\\Websockets\\WebSocketUser' => __DIR__ . '/../..' . '/include/lib/WebSocketUser.php',
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php',
'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php',
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'fpdi_pdf_parser' => __DIR__ . '/..' . '/setasign/fpdi/fpdi_pdf_parser.php',
'pdf_context' => __DIR__ . '/..' . '/setasign/fpdi/pdf_context.php',
);

159
pandora_console/ws.php Normal file
View File

@ -0,0 +1,159 @@
<?php
/**
* PHP script to manage Pandora FMS websockets.
*
* @category Websocket
* @package Pandora FMS
* @subpackage Console
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
require_once __DIR__.'/vendor/autoload.php';
use \PandoraFMS\WebSockets\WSManager;
// Set to true to get full output.
$debug = false;
// 1MB.
$bufferSize = 1048576;
if (file_exists(__DIR__.'/include/config.php') === false
|| is_readable(__DIR__.'/include/config.php') === false
) {
echo "Main console configuration file not found.\n";
exit;
}
// Simulate.
$_SERVER['DOCUMENT_ROOT'] = __DIR__.'/../';
// Don't start a session before this import.
// The session is configured and started inside the config process.
require_once __DIR__.'/include/config.php';
require_once __DIR__.'/include/functions.php';
require_once __DIR__.'/include/functions_db.php';
require_once __DIR__.'/include/auth/mysql.php';
require_once __DIR__.'/include/websocket_registrations.php';
// Enterprise support.
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php') === true) {
include_once ENTERPRISE_DIR.'/load_enterprise.php';
}
// Avoid direct access through browsers.
if (isset($_SERVER['REMOTE_ADDR']) === true) {
// Force redirection.
header('Location: '.ui_get_full_url('index.php'));
exit;
}
if (isset($config['ws_port']) === false) {
config_update_value('ws_port', 8080);
}
if (isset($config['ws_bind_address']) === false) {
config_update_value('ws_bind_address', '0.0.0.0');
}
if (isset($config['gotty_host']) === false) {
config_update_value('gotty_host', '127.0.0.1');
}
if (isset($config['gotty_telnet_port']) === false) {
config_update_value('gotty_telnet_port', 8082);
}
if (isset($config['gotty_ssh_port']) === false) {
config_update_value('gotty_ssh_port', 8081);
}
if (isset($config['gotty']) === false) {
config_update_value('gotty', '/usr/bin/gotty');
}
ini_set('display_errors', 1);
error_reporting(E_ALL);
$os = strtolower(PHP_OS);
if (substr($os, 0, 3) !== 'win') {
if (empty($config['gotty']) === false) {
// Allow start without gotty binary. External service.
if (is_executable($config['gotty']) === false) {
echo 'Failed to execute gotty ['.$config['gotty']."]\n";
exit(1);
}
$gotty_creds = '';
if (empty($config['gotty_user']) === false
&& empty($config['gotty_pass']) === false
) {
$gotty_pass = io_output_password($config['gotty_pass']);
$gotty_creds = " -c '".$config['gotty_user'].':'.$gotty_pass."'";
}
// Kill previous gotty running.
$clean_cmd = 'ps aux | grep "'.$config['gotty'].'"';
$clean_cmd .= '| grep -v grep | awk \'{print $2}\'';
$clean_cmd .= '| xargs kill -9 ';
shell_exec($clean_cmd);
// Common.
$base_cmd = 'nohup "'.$config['gotty'].'" '.$gotty_creds;
$base_cmd .= ' --permit-arguments -a 127.0.0.1 -w ';
// Launch gotty - SSH.
$cmd = $base_cmd.' --port '.$config['gotty_ssh_port'];
$cmd .= ' ssh >> '.__DIR__.'/pandora_console.log 2>&1 &';
shell_exec($cmd);
// Launch gotty - telnet.
$cmd = $base_cmd.' --port '.$config['gotty_telnet_port'];
$cmd .= ' telnet >> '.__DIR__.'/pandora_console.log 2>&1 &';
shell_exec($cmd);
}
}
// Start Web SocketProxy.
$ws = new WSManager(
// Bind address.
$config['ws_bind_address'],
// Bind port.
$config['ws_port'],
// Connected handlers.
['gotty' => 'proxyConnected'],
// Process handlers.
[],
// ProcessRaw handlers.
['gotty' => 'proxyProcessRaw'],
// Tick handlers.
[],
$bufferSize,
$debug
);
try {
$ws->run();
} catch (Exception $e) {
$ws->stdout($e->getMessage());
}

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.740
Version: 7.0NG.740-191029
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.740"
pandora_version="7.0NG.740-191029"
package_cpan=0
package_pandora=1

View File

@ -348,6 +348,15 @@ self_monitoring 1
# Self monitoring interval (in seconds).
self_monitoring_interval 300
# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent
# will make sample data. Disabled by default.
sample_agent 0
# Pandora Sample Agent interval (in seconds).
sample_agent_interval 600
# Update parent from the agent xml
#update_parent 1

View File

@ -340,6 +340,15 @@ restart_delay 60
self_monitoring 1
# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent
# will make sample data. Disabled by default.
sample_agent 0
# Pandora Sample Agent interval (in seconds).
sample_agent_interval 600
# Update parent from the agent xml
#update_parent 1

View File

@ -382,6 +382,16 @@ sub pandora_server_tasks ($) {
pandora_self_monitoring ($pa_config, $dbh);
}
# Pandora sample agent
if (defined($pa_config->{'sample_agent'})) {
if ($pa_config->{'sample_agent'} == 1
&& !is_metaconsole($pa_config)
&& $counter % $pa_config->{'sample_agent_interval'} == 0){
pandora_sample_agent ($pa_config);
}
pandora_update_config_token ($dbh, 'sample_agent', $pa_config->{'sample_agent'});
}
# Avoid counter overflow
if ($counter >= ~0){
$counter = 0;

View File

@ -376,6 +376,15 @@ self_monitoring 1
# Self monitoring interval (in seconds).
self_monitoring_interval 300
# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent
# will make sample data. Disabled by default.
sample_agent 0
# Pandora Sample Agent interval (in seconds).
sample_agent_interval 600
# Update parent from the agent xml
#update_parent 1

View File

@ -330,6 +330,15 @@ restart_delay 60
# Self monitoring interval (in seconds).
#self_monitoring_interval 300
# Pandora Sample Agent. If enabled, every 10 minutes, this embedded agent
# will make sample data. Disabled by default.
sample_agent 0
# Pandora Sample Agent interval (in seconds).
sample_agent_interval 600
# Update parent from the agent xml
#update_parent 1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.740";
my $pandora_build = "191028";
my $pandora_build = "191029";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -79,7 +79,7 @@ sub help_screen {
sub pandora_init {
my $pa_config = $_[0];
my $init_string = $_[1];
print "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-2018 " . pandora_get_initial_copyright_notice() . "\n";
print "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-20".substr($pandora_build,0,2)." " . pandora_get_initial_copyright_notice() . "\n";
print "This program is OpenSource, licensed under the terms of GPL License version 2.\n";
print "You can download latest versions and documentation at official web page.\n\n";
@ -398,6 +398,12 @@ sub pandora_load_config {
# Self monitoring interval
$pa_config->{'self_monitoring_interval'} = 300; # 5.1SP1
# Sample Agent
$pa_config->{'sample_agent'} = 0;
# Sample agent interval
$pa_config->{'sample_agent_interval'} = 600;
# Process XML data files as a stack
$pa_config->{"dataserver_lifo"} = 0; # 5.0
@ -950,6 +956,12 @@ sub pandora_load_config {
elsif ($parametro =~ m/^self_monitoring_interval\s+([0-9]*)/i) {
$pa_config->{'self_monitoring_interval'} = clean_blank($1);
}
elsif ($parametro =~ m/^sample_agent\s+([0-1])/i) {
$pa_config->{'sample_agent'} = clean_blank($1);
}
elsif ($parametro =~ m/^sample_agent_interval\s+([0-9]*)/i) {
$pa_config->{'sample_agent_interval'} = clean_blank($1);
}
elsif ($parametro =~ m/^update_parent\s+([0-1])/i) {
$pa_config->{'update_parent'} = clean_blank($1);
}

View File

@ -100,6 +100,8 @@ Exported Functions:
=item * C<pandora_self_monitoring>
=item * C<pandora_sample_agent>
=back
=head1 METHODS
@ -122,6 +124,7 @@ use threads::shared;
use JSON qw(decode_json encode_json);
use MIME::Base64;
use Text::ParseWords;
use Math::Trig; # Math functions
# Debugging
#use Data::Dumper;
@ -248,6 +251,7 @@ our @EXPORT = qw(
pandora_group_statistics
pandora_server_statistics
pandora_self_monitoring
pandora_sample_agent
pandora_process_policy_queue
subst_alert_macros
subst_column_macros
@ -5236,6 +5240,83 @@ sub pandora_self_monitoring ($$) {
print XMLFILE $xml_output;
close (XMLFILE);
}
##########################################################################
=head2 C<< xml_module_template (I<$module_name>, I<$module_type>, I<$module_data>) >>
Module template for sample agent
=cut
##########################################################################
sub xml_module_template ($$$) {
my ($module_name, $module_type, $module_data) = @_;
my $output = "<module>\n";
$module_name = "<![CDATA[".$module_name."]]>" if $module_name =~ /[\s+.]+/;
$module_data = "<![CDATA[".$module_data."]]>" if $module_data =~ /[\s+.]+/;
$output .= "\t<name>".$module_name."</name>\n";
$output .= "\t<type>".$module_type."</type>\n";
$output .= "\t<data>".$module_data."</data>\n";
$output .= "</module>\n";
return $output;
}
##########################################################################
=head2 C<< pandora_sample_agent (I<$pa_config>) >>
Pandora agent for make sample data
=cut
##########################################################################
sub pandora_sample_agent ($) {
my ($pa_config) = @_;
my $utimestamp = time ();
my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime());
# First line
my $xml_output = "<?xml version='1.0' encoding='UTF-8'?>\n";
# Header
$xml_output = "<agent_data agent_name='Sample_Agent' agent_alias='Sample_Agent' description='Agent for sample generation purposes' group='Servers' os_name='$OS' os_version='$OS_VERSION' interval='".$pa_config->{'sample_agent_interval'}."' version='" . $pa_config->{'version'} . "' timestamp='".$timestamp."'>\n";
# Boolean ever return TRUE
$xml_output .= xml_module_template ("Boolean ever true", "generic_proc","1");
# Boolean return TRUE at 80% of times
my $sample_boolean_mostly_true = 1;
$sample_boolean_mostly_true = 0 if rand(9) > 7;
$xml_output .= xml_module_template ("Boolean mostly true", "generic_proc",$sample_boolean_mostly_true);
# Boolean return false at 80% of times
my $sample_boolean_mostly_false = 0;
$sample_boolean_mostly_false = 1 if rand(9) > 7;
$xml_output .= xml_module_template ("Boolean mostly false", "generic_proc", $sample_boolean_mostly_false);
# Boolean ever return FALSE
$xml_output .= xml_module_template ("Boolean ever false", "generic_proc","0");
# Random integer between 0 and 100
$xml_output .= xml_module_template ("Random integer values", "generic_data",int(rand(100)));
# Random values obtained with sinusoidal curves between 0 and 100 values
my $b = 1;
my $sample_serie_curve = 1 + cos(deg2rad($b));
$b = $b + rand(20)/10;
$b = 0 if ($b > 180);
$sample_serie_curve = $sample_serie_curve * $b * 10;
$sample_serie_curve =~ s/\,/\./g;
$xml_output .= xml_module_template ("Random serie curve", "generic_data", $sample_serie_curve);
# String with 10 random characters
my $sample_random_text = "";
my @characters = ('a'..'z','A'..'Z');
for (1...10){
$sample_random_text .= $characters[int(rand(@characters))];
}
$xml_output .= xml_module_template ("Random text", "generic_data_string", $sample_random_text);
# End of xml
$xml_output .= "</agent_data>";
# File path definition
my $filename = $pa_config->{"incomingdir"}."/".$pa_config->{'servername'}.".sample.".$utimestamp.".data";
# Opening, Writing and closing of XML
open (my $xmlfile, ">", $filename) or die "[FATAL] Could not open sample XML file for deploying monitorization at '$filename'";
print $xmlfile $xml_output;
close ($xmlfile);
}
##########################################################################
=head2 C<< set_master (I<$pa_config>, I<$dbh>) >>

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.740";
my $pandora_build = "191028";
my $pandora_build = "191029";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.740
%define release 1
%define release 191029
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.740
%define release 1
%define release 191029
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.740"
PI_BUILD="191028"
PI_BUILD="191029"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.740 PS191028";
my $version = "7.0NG.740 PS191029";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.740 PS191028";
my $version = "7.0NG.740 PS191029";
# save program name for logging
my $progname = basename($0);
@ -5895,9 +5895,16 @@ sub cli_stop_downtime () {
exist_check($downtime_id,'planned downtime',$downtime_id);
my $current_time = time;
my $downtime_date_to = get_db_value ($dbh, 'SELECT date_to FROM tplanned_downtime WHERE id=?', $downtime_id);
if($current_time >= $downtime_date_to) {
my $data = get_db_single_row ($dbh, 'SELECT date_to, type_execution, executed FROM tplanned_downtime WHERE id=?', $downtime_id);
if( $data->{'type_execution'} eq 'periodically' && $data->{'executed'} == 1){
print_log "[ERROR] Planned_downtime '$downtime_name' cannot be stopped.\n";
print_log "[INFO] Periodical and running planned downtime cannot be stopped.\n\n";
exit;
}
if($current_time >= $data->{'date_to'}) {
print_log "[INFO] Planned_downtime '$downtime_name' is already stopped\n\n";
exit;
}