From f6b0af4f0c7de688a063d672c6ca9a9f821f30ec Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 12 Aug 2014 16:31:27 +0000 Subject: [PATCH] 2014-08-12 Miguel de Dios * 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 --- pandora_console/ChangeLog | 10 ++++ pandora_console/general/header.php | 6 +- pandora_console/include/functions_clippy.php | 35 ++++++++++++ pandora_console/include/functions_ui.php | 3 +- .../include/help/clippy/module_unknow.php | 55 +++++++++++++++++++ .../help/en/help_context_module_unknow.php | 24 ++++++++ pandora_console/include/javascript/intro.js | 5 +- pandora_console/include/styles/pandora.css | 9 +++ pandora_console/index.php | 2 +- .../operation/agentes/estado_monitores.php | 11 ++++ .../operation/agentes/ver_agente.php | 20 +++---- 11 files changed, 163 insertions(+), 17 deletions(-) create mode 100644 pandora_console/include/help/clippy/module_unknow.php create mode 100644 pandora_console/include/help/en/help_context_module_unknow.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b2632dcc78..c63374166f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2014-08-12 Miguel de Dios + + * 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 * include/functions_modules.php: killed some unicorns and magic diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 32eab67bb8..469185582e 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -324,12 +324,12 @@ config_check(); + '; + + + + return $return; +} ?> \ No newline at end of file diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 884db5dcf8..399ede8e40 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2300,7 +2300,8 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $buffer .= '' . ui_print_truncate_text($title, 38); if ($help != "") - $buffer .= "
" . ui_print_help_icon ($help, true, '', 'images/help_w.png') . "
"; + $buffer .= "
" . + ui_print_help_icon ($help, true, '', 'images/help_w.png') . "
"; $buffer .= '
'; if (is_array($options)) { diff --git a/pandora_console/include/help/clippy/module_unknow.php b/pandora_console/include/help/clippy/module_unknow.php new file mode 100644 index 0000000000..ced9c476e7 --- /dev/null +++ b/pandora_console/include/help/clippy/module_unknow.php @@ -0,0 +1,55 @@ + '{clippy}', //The template to replace with the autogenerate id + 'intro' => '' . + '' . + '' . + '' . + '' . + '' . + '' . + '
' . + __('You have unknown modules in this agent.') . + '
' . + __('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') . + '
' + ); + $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); +} +?> \ No newline at end of file diff --git a/pandora_console/include/help/en/help_context_module_unknow.php b/pandora_console/include/help/en/help_context_module_unknow.php new file mode 100644 index 0000000000..891306a655 --- /dev/null +++ b/pandora_console/include/help/en/help_context_module_unknow.php @@ -0,0 +1,24 @@ + +

Unknown modules in Pandora

+

+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. +

+

+These are a few cases where you can get unknown modules: +

+
    +
  • Your pandora server is down. Restart it, dont forget to check /var/log/pandora/pandora_server.log to see why was down.
  • +
  • Your tentacle server is down, and cannot get data from your Pandora FMS agents installed in your remote servers.
  • +
  • You have a network problem between your agents and your server.
  • +
  • Your pandora fms agent is stopped and is not sending information to your server.
  • +
  • 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).
  • +
  • Your agent is reporting a badly synchronized date. Means reports a timedate in the past and that messup everything.
  • +
  • The script / module before works now doesn't, that can be because something is happing in the agent, check it out.
  • +
+

+Sometimes UNKNOWN status can be useful to monitor, so you can setup alerts on UNKNOWN status to warn you about that. +

\ No newline at end of file diff --git a/pandora_console/include/javascript/intro.js b/pandora_console/include/javascript/intro.js index 4109e34e13..27343b89b6 100644 --- a/pandora_console/include/javascript/intro.js +++ b/pandora_console/include/javascript/intro.js @@ -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'; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 30e7400ff2..3c3f29993e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -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; +} \ No newline at end of file diff --git a/pandora_console/index.php b/pandora_console/index.php index 54cc52a913..eb8366535d 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -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 ()); diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 38186be4c0..fe10d57321 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -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) { diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index a725bb8a5b..e92470e810 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -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 ''.__('Last contact').': '.human_time_comparation($agent['ultimo_contacto']).'
'; echo ''.__('Last remote contact').': '.human_time_comparation($agent['ultimo_contacto_remoto']).'
'; - + # 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;