2014-08-12 Miguel de Dios <miguel.dedios@artica.es>
* index.php, operation/agentes/ver_agente.php, operation/agentes/estado_monitores.php, general/header.php, include/functions_clippy.php, include/functions_ui.php, include/help/en/help_context_module_unknow.php, include/help/clippy/module_unknow.php, include/styles/pandora.css, include/javascript/intro.js: added first version of context help interactive. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10410 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a525b562b0
commit
f6b0af4f0c
|
@ -1,3 +1,13 @@
|
|||
2014-08-12 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* index.php, operation/agentes/ver_agente.php,
|
||||
operation/agentes/estado_monitores.php, general/header.php,
|
||||
include/functions_clippy.php, include/functions_ui.php,
|
||||
include/help/en/help_context_module_unknow.php,
|
||||
include/help/clippy/module_unknow.php, include/styles/pandora.css,
|
||||
include/javascript/intro.js: added first version of context help
|
||||
interactive.
|
||||
|
||||
2014-08-12 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_modules.php: killed some unicorns and magic
|
||||
|
|
|
@ -324,12 +324,12 @@ config_check();
|
|||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
|
||||
var fixed_header = <?php echo json_encode((bool)$config['fixed_header']); ?>;
|
||||
|
||||
|
||||
var new_chat = <?php echo (int)$_SESSION['new_chat'];?>;
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
if (fixed_header) {
|
||||
$('div#head').addClass('fixed_header');
|
||||
$('div#page')
|
||||
|
|
|
@ -138,4 +138,39 @@ function clippy_write_javascript_helps_steps($helps,
|
|||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
function clippy_context_help($help = null) {
|
||||
$id = uniqid("id_");
|
||||
|
||||
$return = '';
|
||||
|
||||
require_once("include/help/clippy/" . $help . ".php");
|
||||
|
||||
ob_start();
|
||||
$function = "clippy_" . $help;
|
||||
$function();
|
||||
$code = ob_get_clean();
|
||||
|
||||
$code = str_replace('{clippy}', '#' . $id, $code); html_debug_print($code, true);
|
||||
$code = str_replace('{clippy_obj}', 'intro_' . $id, $code); html_debug_print($code, true);
|
||||
|
||||
$return = $code .
|
||||
'<div id="' . $id . '" style="display: inline;">' .
|
||||
'<a onclick="intro_' . $id . '.start();" href="javascript: return false;" >' .
|
||||
html_print_image(
|
||||
"images/clippy_icon.png",
|
||||
true) .
|
||||
'</a>' .
|
||||
'</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#' . $id . ' img").pulsate ();
|
||||
});
|
||||
</script>
|
||||
';
|
||||
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
?>
|
|
@ -2300,7 +2300,8 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
|
|||
$buffer .= '<span style="display: inline-block; vertical-align: top; margin-top: 2px;">' .
|
||||
ui_print_truncate_text($title, 38);
|
||||
if ($help != "")
|
||||
$buffer .= "<div class='head_help' style='float: right; margin-top: -3px !important; margin-left: 2px !important;'>" . ui_print_help_icon ($help, true, '', 'images/help_w.png') . "</div>";
|
||||
$buffer .= "<div class='head_help' style='float: right; margin-top: -3px !important; margin-left: 2px !important;'>" .
|
||||
ui_print_help_icon ($help, true, '', 'images/help_w.png') . "</div>";
|
||||
$buffer .= '</span></li></ul></div>';
|
||||
|
||||
if (is_array($options)) {
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 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 Lesser 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.
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* @subpackage Clippy
|
||||
*/
|
||||
|
||||
function clippy_module_unknow() {
|
||||
$helps = array();
|
||||
|
||||
//==================================================================
|
||||
//Help tour about the monitoring with a ping (step 3)
|
||||
//------------------------------------------------------------------
|
||||
$helps['module_unknow'] = array();
|
||||
$helps['module_unknow']['steps'] = array();
|
||||
$helps['module_unknow']['steps'][] = array(
|
||||
'element'=> '{clippy}', //The template to replace with the autogenerate id
|
||||
'intro' => '<table>' .
|
||||
'<tr>' .
|
||||
'<td class="context_help_title">' .
|
||||
__('You have unknown modules in this agent.') .
|
||||
'</td>' .
|
||||
'</tr>' .
|
||||
'<tr>' .
|
||||
'<td class="context_help_body">' .
|
||||
__('Unknown modules are modules which receive data normally at least in one occassion, but at this time are not receving data. Please check our troubleshoot help page to help you determine why you have unknown modules.') .
|
||||
ui_print_help_icon ('context_module_unknow', true, '', 'images/help_w.png') .
|
||||
'</td>' .
|
||||
'</tr>' .
|
||||
'</table>'
|
||||
);
|
||||
$helps['module_unknow']['conf'] = array();
|
||||
$helps['module_unknow']['conf']['autostart'] = false;
|
||||
$helps['module_unknow']['conf']['showBullets'] = 0;
|
||||
$helps['module_unknow']['conf']['showStepNumbers'] = 0;
|
||||
$helps['module_unknow']['conf']['name_obj_tour'] = '{clippy_obj}';
|
||||
//==================================================================
|
||||
|
||||
clippy_write_javascript_helps_steps($helps, true);
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Include/help/en
|
||||
*/
|
||||
?>
|
||||
<h1>Unknown modules in Pandora</h1>
|
||||
<p>
|
||||
You may have unknown modules for many reasons. Unknown module is a special status for a module/monitor which means “I dont have recent data for this monitor and I should have data”. A monitor goes to unknown status when doesnt receive nothing in at least its interval (for example, 300 seconds) multiplied by two, in this case, if you doesn't receive nothing in ten minutes, monitor goes to unknown.
|
||||
</p>
|
||||
<p>
|
||||
These are a few cases where you can get unknown modules:
|
||||
</p>
|
||||
<ul style="list-style-type: disc; margin-left: 30px;">
|
||||
<li>Your pandora server is down. Restart it, dont forget to check /var/log/pandora/pandora_server.log to see why was down.</li>
|
||||
<li>Your tentacle server is down, and cannot get data from your Pandora FMS agents installed in your remote servers.</li>
|
||||
<li>You have a network problem between your agents and your server.</li>
|
||||
<li>Your pandora fms agent is stopped and is not sending information to your server.</li>
|
||||
<li>Your network is down, or the remote device you are trying to ask is down or changed it's IP address (for example for numerical SNMP remote queries).</li>
|
||||
<li>Your agent is reporting a badly synchronized date. Means reports a timedate in the past and that messup everything.</li>
|
||||
<li>The script / module before works now doesn't, that can be because something is happing in the agent, check it out.</li>
|
||||
</ul>
|
||||
<p>
|
||||
Sometimes UNKNOWN status can be useful to monitor, so you can setup alerts on UNKNOWN status to warn you about that.
|
||||
</p>
|
|
@ -621,7 +621,7 @@
|
|||
self.goToStep(this.getAttribute('data-stepnumber'));
|
||||
};
|
||||
|
||||
if (i === 0) anchorLink.className = "active";
|
||||
if (i === (targetElement.step-1)) anchorLink.className = "active";
|
||||
|
||||
anchorLink.href = 'javascript:void(0);';
|
||||
anchorLink.innerHTML = " ";
|
||||
|
@ -750,7 +750,8 @@
|
|||
//More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context
|
||||
var zIndex = _getPropValue(parentElm, 'z-index');
|
||||
var opacity = parseFloat(_getPropValue(parentElm, 'opacity'));
|
||||
if (/[0-9]+/.test(zIndex) || opacity < 1) {
|
||||
var transform = _getPropValue(parentElm, 'transform') || _getPropValue(parentElm, '-webkit-transform') || _getPropValue(parentElm, '-moz-transform') || _getPropValue(parentElm, '-ms-transform') || _getPropValue(parentElm, '-o-transform');
|
||||
if (/[0-9]+/.test(zIndex) || opacity < 1 || transform !== 'none') {
|
||||
parentElm.className += ' introjs-fixParent';
|
||||
}
|
||||
|
||||
|
|
|
@ -2702,3 +2702,12 @@ td.empty_field {
|
|||
table#policy_modules td * {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
||||
.context_help_title {
|
||||
font-weight: bolder;
|
||||
text-align: left;
|
||||
}
|
||||
.context_help_body {
|
||||
text-align: left;
|
||||
}
|
|
@ -590,7 +590,7 @@ if ($config["pure"] == 0) {
|
|||
}
|
||||
|
||||
/// Clippy function
|
||||
require ('include/functions_clippy.php');
|
||||
require_once('include/functions_clippy.php');
|
||||
clippy_start($sec2);
|
||||
|
||||
while (@ob_end_flush ());
|
||||
|
|
|
@ -102,6 +102,7 @@ if (!isset ($id_agente)) {
|
|||
include_once($config['homedir'] . "/include/functions_modules.php");
|
||||
include_once($config['homedir'] . "/include/functions_servers.php");
|
||||
include_once($config['homedir'] . "/include/functions_tags.php");
|
||||
include_once($config['homedir'] . "/include/functions_clippy.php");
|
||||
|
||||
$id_agent = get_parameter('id_agente');
|
||||
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agent;
|
||||
|
@ -413,6 +414,8 @@ $rowIndex = 0;
|
|||
$id_type_web_content_string = db_get_value('id_tipo', 'ttipo_modulo',
|
||||
'nombre', 'web_content_string');
|
||||
|
||||
$show_context_help_first_time = false;
|
||||
|
||||
foreach ($modules as $module) {
|
||||
//The code add the row of 1 cell with title of group for to be more organice the list.
|
||||
|
||||
|
@ -548,7 +551,15 @@ foreach ($modules as $module) {
|
|||
modules_get_status($module['id_agente_modulo'], $module['estado'],
|
||||
$module_value, $status, $title);
|
||||
|
||||
|
||||
$data[5] = ui_print_status_image($status, $title, true);
|
||||
if (!$show_context_help_first_time) {
|
||||
$show_context_help_first_time = true;
|
||||
|
||||
if ($module['estado'] == AGENT_MODULE_STATUS_UNKNOWN) {
|
||||
$data[5] .= clippy_context_help("module_unknow");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($module["id_tipo_modulo"] == 24) {
|
||||
|
|
|
@ -48,7 +48,7 @@ if (is_ajax ()) {
|
|||
$recursion = (int) get_parameter ('recursion', 0);
|
||||
$custom_condition = get_parameter('custom_condition', '');
|
||||
$privilege = (string) get_parameter ('privilege', "AR");
|
||||
|
||||
|
||||
// Is is possible add keys prefix to avoid auto sorting in js object conversion
|
||||
$keys_prefix = (string) get_parameter ('keys_prefix', '');
|
||||
$status_agents = (int)get_parameter('status_agents', AGENT_STATUS_ALL);
|
||||
|
@ -142,7 +142,7 @@ if (is_ajax ()) {
|
|||
|
||||
$groups = users_get_groups ($config["id_user"], "AW", false);
|
||||
$group_id_list = ($groups ? join(",",array_keys($groups)):"0");
|
||||
|
||||
|
||||
$sql = 'SELECT DISTINCT(t1.nombre) as name
|
||||
FROM tagente t1, tagente_modulo t2
|
||||
WHERE t1.id_agente = t2.id_agente
|
||||
|
@ -156,7 +156,7 @@ if (is_ajax ()) {
|
|||
WHERE t3.id_agente = t4.id_agente AND t1.nombre = t3.nombre
|
||||
AND t4.nombre IN (\'' . implode('\',\'', $nameModules) . '\')) = '.count($nameModules);
|
||||
}
|
||||
|
||||
|
||||
$sql .= ' ORDER BY t1.nombre';
|
||||
|
||||
$nameAgents = db_get_all_rows_sql($sql);
|
||||
|
@ -468,17 +468,17 @@ if (is_ajax ()) {
|
|||
|
||||
echo '<strong>'.__('Last contact').':</strong> '.human_time_comparation($agent['ultimo_contacto']).'<br />';
|
||||
echo '<strong>'.__('Last remote contact').':</strong> '.human_time_comparation($agent['ultimo_contacto_remoto']).'<br />';
|
||||
|
||||
|
||||
# Fix : Only show agents with module with tags of user profile
|
||||
$_user_tags = tags_get_user_tags($config['id_user'], 'RR');
|
||||
|
||||
|
||||
$_sql_post = '';
|
||||
if ($_user_tags !== false) {
|
||||
|
||||
|
||||
$_tags = implode(',', array_keys($_user_tags));
|
||||
|
||||
|
||||
$_sql_post .= ' AND tagente_modulo.id_agente_modulo IN (SELECT a.id_agente_modulo FROM tagente_modulo a, ttag_module b WHERE a.id_agente_modulo=b.id_agente_modulo AND b.id_tag IN (' . $_tags . ')) ';
|
||||
|
||||
|
||||
}
|
||||
|
||||
$sql = sprintf ('SELECT tagente_modulo.descripcion,
|
||||
|
@ -488,9 +488,9 @@ if (is_ajax ()) {
|
|||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_estado.estado = 1', $id_agent);
|
||||
|
||||
|
||||
$sql .= $_sql_post;
|
||||
|
||||
|
||||
if ($metaconsole) {
|
||||
if (metaconsole_connect($server) != NOERR) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue