2018-05-04 10:58:37 +02:00
|
|
|
<?php
|
2020-11-30 14:26:49 +01:00
|
|
|
/**
|
|
|
|
* View charts.
|
|
|
|
*
|
|
|
|
* @category View charts Realtime.
|
|
|
|
* @package Pandora FMS
|
|
|
|
* @subpackage Community
|
|
|
|
* @version 1.0.0
|
|
|
|
* @license See below
|
|
|
|
*
|
|
|
|
* ______ ___ _______ _______ ________
|
|
|
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
|
|
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
|
|
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
|
|
|
*
|
|
|
|
* ============================================================================
|
2020-12-14 11:10:35 +01:00
|
|
|
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
2020-11-30 14:26:49 +01:00
|
|
|
* 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.
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
2018-05-04 10:58:37 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
require_once '../../include/config.php';
|
|
|
|
require_once $config['homedir'].'/include/auth/mysql.php';
|
|
|
|
require_once $config['homedir'].'/include/functions.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_db.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_reporting.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_graph.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_modules.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_agents.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_tags.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_extensions.php';
|
|
|
|
check_login();
|
2018-05-04 10:58:37 +02:00
|
|
|
|
2020-11-30 14:26:49 +01:00
|
|
|
// Metaconsole connection to the node.
|
2019-01-30 16:18:44 +01:00
|
|
|
$server_id = (int) get_parameter('server');
|
2018-05-04 10:58:37 +02:00
|
|
|
if (is_metaconsole() && !empty($server_id)) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$server = metaconsole_get_connection_by_id($server_id);
|
|
|
|
|
2020-11-30 14:26:49 +01:00
|
|
|
// Error connecting.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (metaconsole_connect($server) !== NOERR) {
|
|
|
|
echo '<html>';
|
|
|
|
echo '<body>';
|
2020-11-30 14:26:49 +01:00
|
|
|
ui_print_error_message(
|
|
|
|
__('There was a problem connecting with the node')
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
echo '</body>';
|
|
|
|
echo '</html>';
|
|
|
|
exit;
|
|
|
|
}
|
2018-05-04 10:58:37 +02:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$user_language = get_user_language($config['id_user']);
|
|
|
|
if (file_exists('../../include/languages/'.$user_language.'.mo')) {
|
2020-11-30 14:26:49 +01:00
|
|
|
$l10n = new gettext_reader(
|
|
|
|
new CachedFileReader('../../include/languages/'.$user_language.'.mo')
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$l10n->load_tables();
|
2018-05-04 10:58:37 +02:00
|
|
|
}
|
|
|
|
|
2021-05-12 14:52:44 +02:00
|
|
|
if ($config['style'] === 'pandora_black') {
|
|
|
|
ui_require_css_file('pandora_black', 'include/styles/', true);
|
|
|
|
}
|
|
|
|
|
2021-11-04 16:28:15 +01:00
|
|
|
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
|
2018-05-04 10:58:37 +02:00
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
2019-01-30 16:18:44 +01:00
|
|
|
<head>
|
|
|
|
<?php
|
2020-11-30 14:26:49 +01:00
|
|
|
// Parsing the refresh before sending any header.
|
2019-01-30 16:18:44 +01:00
|
|
|
$refresh = (int) get_parameter('refresh', -1);
|
|
|
|
if ($refresh > 0) {
|
|
|
|
$query = ui_get_url_refresh(false);
|
|
|
|
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title><?php echo __('%s Realtime Module Graph', get_product_name()); ?></title>
|
|
|
|
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
|
2019-02-05 09:23:53 +01:00
|
|
|
<link rel="stylesheet" href="../../include/styles/js/jquery-ui.min.css" type="text/css" />
|
2019-01-30 16:18:44 +01:00
|
|
|
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
|
2019-11-21 16:42:39 +01:00
|
|
|
<script type='text/javascript' src='../../include/javascript/pandora_ui.js'></script>
|
2021-08-12 09:30:43 +02:00
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery.current.js'></script>
|
2019-01-30 16:18:44 +01:00
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
|
|
|
|
<script type='text/javascript' src='../../include/javascript/jquery-ui.min.js'></script>
|
|
|
|
<?php
|
2020-11-30 14:26:49 +01:00
|
|
|
// Include the javascript for the js charts library.
|
2019-01-30 16:18:44 +01:00
|
|
|
require_once $config['homedir'].'/include/graphs/functions_flot.php';
|
2018-05-04 10:58:37 +02:00
|
|
|
include_javascript_dependencies_flot_graph();
|
2019-01-30 16:18:44 +01:00
|
|
|
?>
|
|
|
|
</head>
|
2021-05-12 14:52:44 +02:00
|
|
|
<?php
|
|
|
|
if ($config['style'] === 'pandora_black') {
|
|
|
|
}
|
|
|
|
?>
|
2021-03-11 15:40:23 +01:00
|
|
|
<body bgcolor="#ffffff" class='bg_white'>
|
2019-01-30 16:18:44 +01:00
|
|
|
<?php
|
|
|
|
if (!check_acl($config['id_user'], 0, 'AR')) {
|
|
|
|
include $config['homedir'].'/general/noaccess.php';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$config['extensions'] = extensions_get_extensions(false, '../../');
|
|
|
|
if (!extensions_is_enabled_extension('realtime_graphs.php')) {
|
|
|
|
ui_print_error_message(__('Realtime extension is not enabled.'));
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
include_once '../../extensions/realtime_graphs.php';
|
|
|
|
}
|
|
|
|
|
2018-05-04 10:58:37 +02:00
|
|
|
pandora_realtime_graphs();
|
2019-01-30 16:18:44 +01:00
|
|
|
?>
|
2018-05-04 10:58:37 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
</body>
|
2018-05-04 10:58:37 +02:00
|
|
|
</html>
|