From d2377f9f09d7e59bee6a92ad1151e769637da32c Mon Sep 17 00:00:00 2001 From: slerena <slerena@gmail.com> Date: Thu, 10 Jul 2008 11:58:40 +0000 Subject: [PATCH] 2008-07-10 Sancho Lerena <slerena@gmail.com> * include/styles/pandora_red.css: Updated. * include/styles/pandora_black.css: New style with BLACK blackground. * include/styles/pandora.css: Updated. * include/functions_db.php: Added auto order combos and queries. * include/functions_visual_map.php: Added overlap on down elements if there are more than one in the same position (This could allow to cluster elements to shown the down status first). Removed unused code. * operation/events/events.php: Added tooltip for group name. * operation/visual_console/render_view.php: Adjusted controls position. * operation/agentes/status_monitor.php: Added status for unknown monitors. Added some database search improvement. * operation/agentes/sla_view.php: Sorted list of items. * operation/agentes/ver_agente.php: Updated AJAX code for network map detail view of an agent. Added alert data. * operation/agentes/tactical.php: Removed 'fixed' styles, now using CSS. * operation/agentes/networkmap.php: Added ransep and font selectors. Added alert under yellow color. Minor improvements. * operation/reporting/graph_viewer.php: Style update. * operation/menu.php: Visual console maps sort by name * images/background-li.gif: This sould replace <li> image. * general/login_page.php: Added build version on develop mode. * godmode/reporting/map_builder.php: Sorted lists, and shown module name instead description. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@949 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 43 ++ pandora_console/general/login_page.php | 7 +- .../godmode/reporting/map_builder.php | 14 +- pandora_console/images/background-li.gif | Bin 0 -> 38 bytes pandora_console/include/functions_db.php | 16 +- .../include/functions_visual_map.php | 15 +- pandora_console/include/styles/pandora.css | 16 +- .../include/styles/pandora_black.css | 704 ++++++++++++++++++ .../include/styles/pandora_red.css | 113 ++- .../operation/agentes/networkmap.php | 92 ++- .../operation/agentes/sla_view.php | 5 +- .../operation/agentes/status_monitor.php | 41 +- .../operation/agentes/tactical.php | 54 +- .../operation/agentes/ver_agente.php | 38 +- pandora_console/operation/events/events.php | 3 +- pandora_console/operation/menu.php | 2 +- .../operation/reporting/graph_viewer.php | 17 +- .../operation/visual_console/index.php | 2 +- .../operation/visual_console/render_view.php | 29 +- 19 files changed, 1066 insertions(+), 145 deletions(-) create mode 100644 pandora_console/images/background-li.gif create mode 100644 pandora_console/include/styles/pandora_black.css diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index cc7e0cf44b..ab2dd3dccc 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,46 @@ +2008-07-10 Sancho Lerena <slerena@gmail.com> + + * include/styles/pandora_red.css: Updated. + + * include/styles/pandora_black.css: New style with BLACK blackground. + + * include/styles/pandora.css: Updated. + + * include/functions_db.php: Added auto order combos and queries. + + * include/functions_visual_map.php: Added overlap on down elements if + there are more than one in the same position (This could allow to cluster + elements to shown the down status first). Removed unused code. + + * operation/events/events.php: Added tooltip for group name. + + * operation/visual_console/render_view.php: Adjusted controls position. + + * operation/agentes/status_monitor.php: Added status for unknown monitors. + Added some database search improvement. + + * operation/agentes/sla_view.php: Sorted list of items. + + * operation/agentes/ver_agente.php: Updated AJAX code for network map + detail view of an agent. Added alert data. + + * operation/agentes/tactical.php: Removed 'fixed' styles, now using CSS. + + * operation/agentes/networkmap.php: Added ransep and font selectors. + Added alert under yellow color. Minor improvements. + + * operation/reporting/graph_viewer.php: Style update. + + * operation/menu.php: Visual console maps sort by name + + * images/background-li.gif: This sould replace <li> image. + + * general/login_page.php: Added build version on develop mode. + + * godmode/reporting/map_builder.php: Sorted lists, and shown module name + instead description. + + 2008-07-09 Evi Vanoost <vanooste@rcbi.rochester.edu> * pandoradb.sql: Updated indexes diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 99f9fdba9b..bb19101a03 100644 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -38,7 +38,12 @@ if (isset($_GET['sec'])){ <tr><td rowspan='3' align='left' style="border-right: solid 1px #678;"> <a href="index.php"> <img src="images/pandora_logo.png" border="0" alt="logo"></a><br> - <?php echo $pandora_version; ?> + <?php + echo $pandora_version; + if ($develop_bypass == 1){ + echo " Build " . $build_version; + } + ?> <td rowspan='3' width='5'> <td class='f9b'> Login <br> diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index b3109f7637..8859f070a2 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -263,7 +263,7 @@ if (! $edit_layout && ! $id_layout) { $table->align = array (); $table->align[2] = 'center'; - $maps = get_db_all_rows_in_table ('tlayout'); + $maps = get_db_all_rows_in_table ('tlayout','name'); foreach ($maps as $map) { $data = array (); @@ -372,10 +372,10 @@ if (! $edit_layout && ! $id_layout) { $all_agents = get_agents_in_group ($id_group); $agents = array (); foreach ($all_agents as $agent) { - $agents[$agent['id_agente']] = $agent['nombre']; + $agents[$agent['id_agente']] = strtolower($agent['nombre']); } - asort ($agents); - + asort($agents); + echo '<div id="layout_editor_drop">'; echo '<h1>'.lang_string ('Map element editor').'</h1>'; echo lang_string ('Drag an element here to edit the properties'); @@ -454,11 +454,7 @@ function agent_changed (event, id_agent, selected) { $('#form_layout_data_editor #module').empty (); $('#form_layout_data_editor #module').append (new Option ("--", 0)); jQuery.each (data, function (i, val) { - if (val['descripcion'] == "") { - s = html_entity_decode (val['nombre']); - } else { - s = html_entity_decode (val['descripcion']); - } + s = html_entity_decode (val['nombre']); $('#form_layout_data_editor #module').append (new Option (s, val['id_agente_modulo'])); $('#form_layout_data_editor #module').fadeIn ('normal'); }); diff --git a/pandora_console/images/background-li.gif b/pandora_console/images/background-li.gif new file mode 100644 index 0000000000000000000000000000000000000000..2cefea3ed3df5eccea84c238fd9e18c87d6797cf GIT binary patch literal 38 qcmZ?wbh9u|WMN=oXkcXc-_G#=|9>3@AOMLlFtPF^ET108U=0AfHVGsE literal 0 HcmV?d00001 diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 5ffd93d2f9..b52ab3398b 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -224,12 +224,12 @@ function get_agents_in_group ($id_group, $disabled = false) { if ($id_group == 1) { if ($disabled) return get_db_all_rows_in_table ('tagente', 'nombre'); - return get_db_all_rows_field_filter ('tagente', 'disabled', 0); + return get_db_all_rows_field_filter ('tagente', 'disabled', 0, 'nombre'); } if ($disabled) - return get_db_all_rows_field_filter ('tagente', 'id_grupo', (int) $id_group); + return get_db_all_rows_field_filter ('tagente', 'id_grupo', (int) $id_group, 'nombre'); $sql = sprintf ('SELECT * FROM tagente - WHERE id_grupo = %d AND disabled = 0', + WHERE id_grupo = %d AND disabled = 0 ORDER BY nombre', $id_group); return get_db_all_rows_sql ($sql); } @@ -1445,17 +1445,17 @@ function return_status_agent_module ($id_agentmodule = 0){ if ($resq2 != 0) { $rowdup2 = mysql_fetch_array ($resq2); if ($rowdup2[0] > 0){ - return false; + return 0; } } // No alerts fired for this agent module - return true; + return 1; } elseif ($rowdup[0] == 0) // 0 is ok for estado field - return true; - return false; + return 1; + return 0; } - return true; + return 1; } /** diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index fd01a9fc23..ed53bb4207 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -42,11 +42,18 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = // STATIC IMAGE (type = 0) // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ($layout_data['type'] == 0) { + // Link image //index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 - + if ($status == 0) // Bad monitor + $z_index = 2; + elseif ($status == 2) // Alert + $z_index = 3; + else + $z_index = 1; // Print BAD over good + // Draw image - echo '<div style="z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.$layout_data['pos_x'].'px; margin-top:'.$layout_data['pos_y'].'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">'; + echo '<div style="z-index: '.$z_index.'; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.$layout_data['pos_x'].'px; margin-top:'.$layout_data['pos_y'].'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">'; if ($show_links) { if ($layout_data['id_layout_linked'] == "" || $layout_data['id_layout_linked'] == 0) { echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agent&tab=data'>"; @@ -103,13 +110,9 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = // Get parent relationship - Create line data // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ($layout_data["parent_item"] != "" && $layout_data["parent_item"] != 0) { - $parent_x = get_layoutdata_x ($layout_data["parent_item"]); - $parent_y = get_layoutdata_y ($layout_data["parent_item"]); $line['id'] = $layout_data['id']; $line['node_begin'] = 'layout-data-'.$layout_data["parent_item"]; $line['node_end'] = 'layout-data-'.$layout_data["id"]; - $line['width'] = $parent_x + 15; - $line['height'] = $parent_y + 15; $line['color'] = $status_parent ? '#00dd00' : '#dd0000'; array_push ($lines, $line); } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 3f8d63261f..132162b904 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -204,7 +204,6 @@ div#main { margin-left: 0px; margin-right: 0px; } - div#menu { width: 155px; float: left; @@ -376,6 +375,11 @@ td.datos_jus, td.datos2_jus { border-bottom: 1px solid #708090; width: 100%; } +.suc { + color: #5a8629; + background: url(../../images/suc.png) no-repeat 1px; + padding: 4px 1px 6px 30px; +} .green { color: #5a8629; } @@ -739,3 +743,13 @@ div#main_pure { background-color: #999999; padding: 20px; } + + +td.big_data { + font-size: 2em; + font-weight: bold; +} + +a.big_data { + text-decoration: none; font: bold 1em Arial, Sans-serif; +} diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css new file mode 100644 index 0000000000..cef6984e96 --- /dev/null +++ b/pandora_console/include/styles/pandora_black.css @@ -0,0 +1,704 @@ +/* +// Pandora FMS - the Free monitoring system +// ======================================== +// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com +// Main PHP/SQL code development and project architecture and management +// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com +// CSS and some PHP additions +// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com +// Javascript Active Console code. +// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net> +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// +// 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. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +@import url(op.css); +@import url(god.css); +@import url(link.css); +@import url(tip.css); +* { + font-family: verdana, sans-serif; + font-size: 8pt; +} +body { + text-align: center; + color: #EEE; +} +td { + color: #EEE; +} +input, textarea { + border: 1px solid #ddd; + font: verdana, sans-serif; + font-size: 8pt; +} +textarea { + padding: 5px; + height: 100px; + font-family: verdana, sans-serif; + font-size: 8pt; +} +input { + padding: 2px 3px 4px 3px; +} +input.button { + margin: 0; + font: bold, Arial, Sans-serif; + border: 1px solid #ccc; + background: #fff; + padding: 2px 3px; + margin: 10px 15px; +} +select { + padding: 0px; + border:1px solid #ddd; + font-family: verdana, sans-serif; + font-size: 8pt; +} +checkbox { + padding: 4px; + border:1px solid #eee; +} +h1, h2, h3 { + font: bold 1em Arial, Sans-serif; + text-transform: uppercase; + color: #BBB; + padding-bottom: 5px; + padding-top: 7px; +} +h1 { + font-size: 16px; +} +h2 { + font-size: 15px; +} +h3 { + font-size: 13px; +} +a { + color: #ddd; + font-weight: bold; + text-decoration: none; +} +a:hover { + color: #CCC; + text-decoration: underline; +} +a.white_bold { + color: #DDD; + text-decoration: none; + font-weight: bold; +} +a.white { + color: #CCC; + text-decoration: none; +} +p.center { + text-align: center; +} +h1#log { + font-size: 18px; + margin-bottom: 0px; + color: #FFF; +} +h1#log_f { + color: #f00; + border-bottom: 1px solid #f00; + padding-bottom: 3px; +} +div#login { + margin: 0 auto; + margin-top: 200px; + width: 460px; + border-left: solid 1px #000; + border-top: solid 1px #000; + border-bottom: solid 2px #000; + border-right: solid 2px #000 +} +div#login_in, #login_f { + margin: 0 auto; + width: 400px; +} +div#login_f { + margin-top: 10px; + margin-bottom: 25px; +} +div#noaccess { + width: 350px; + padding-left: 40px; +} +div#activity{ + padding-top: 18px; + padding-bottom: 18px; +} +div#noa { + float: right; + padding-right: 50px; + margin-top: 25px; +} +div#db_f { + text-align: justify; + margin: auto; + padding: 0.5em; + width: 55em; + margin-top: 3em; +} +div#db_ftxt { + float: right; + padding-top: 10px; +} +div#container { + margin: 0 auto; + width: 960px; + text-align: left; + border-left: solid 2px #000; + border-right: solid 2px #000; + border-top: solid 2px #000; + margin-top: 5px; +} +div#page { + width: 960px; + background: #000; + clear: both; + border-bottom: solid 5px #001E40; + border-top: solid 5px #001E40; +} +div#main { + background: #000; + width: 780px; + min-height: 500px; + float: right; + padding-left: 0px; + padding-top: 0px; + padding-bottom: 20px; + margin-bottom: 25px; + margin-top: 0px; + margin-left: 0px; + margin-right: 0px; +} +div#menu { + width: 155px; + float: left; +} +div#page>div#menu { + width: 157px; +} +div#head { + font-size: 8pt; + width: 960px; + height: 60px; + background: #000; +} +div#foot { + font-size: 7pt; + margin-top: solid 2px #000; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + background: #960003; + width: 960px; + clear: both; +} +#ver { + margin-bottom: 25px; +} +#ip { + margin-top: 10px; + margin-bottom: 5px; +} +label { + display: block; + float: left; + padding-top: 4px; +} +th > label { + padding-top: 7px; +} +input:hover { + background-color: #d4dccd; +} +input.chk {margin-right: 0px; + border: 0px none; + height: 14px; +} +input.datos { + background-color: #f5f5f5; +} +input.datos_readonly { + background-color: #050505; +} +input.login { + border-color: #786; + background-color: #000; + margin: 2px 0 8px; + width: 90px; +} +input.sub { + font-weight: bold; + border-bottom-color: #708090; + border-right-color: #708090; + -moz-border-radius: 5%; + font-size: 8pt; +} +input.next { + padding-right: 21px; + background: #e5e5e5 url(../../images/go.png) no-repeat right 2px; +} +input.upd { + padding-right: 21px; + background: #e5e5e5 url(../../images/upd.png) no-repeat right 3px; +} +input.wand { + padding-right: 21px; + background: #e5e5e5 url(../../images/wand.png) no-repeat right 3px; +} +input.delete { + padding-right: 21px; + background: #e5e5e5 url(../../images/cross.png) no-repeat right 3px; +} +input.search { + padding-right: 21px; + background: #e5e5e5 url(../../images/zoom.png) no-repeat right 3px; +} +input.copy { + padding-right: 21px; + background: #e5e5e5 url(../../images/copy.png) no-repeat right 3px; +} +input.ok { + padding-right: 21px; + background: #e5e5e5 url(../../images/ok.png) no-repeat right 3px; +} +table, img { + border: 0px; +} +th { + background-color: #041D3D; +} +td.datos, td.datost, td.datosb , td.datos_id, td.datosf9 { + background-color: #020E1D; +} +td.datos2, td.datos2t, td.datos2b, td.datos2_id , td.datos2f9 { + background-color: #02152A; +} +td.datos3 { + background-color: #1E1E1E; +} +td.datos_id { + color: #fff; +} +td.datos_jus, td.datos2_jus { + text-align: justify; +} +.bg { /* op menu */ + background-color: #786; +} +.bg2 { /* main page */ + background-color: #d84437; +} +.bg3 { /* godmode */ + background-color: #d84437; +} +.bg4 { /* links */ + background-color: #5385bf; +} +.bg, .bg2, .bg3, .bg4 { + position: relative; + height: 20px; + width: 100%; +} +.f10, #ip { + font-size: 7pt; + text-align: center; +} +.f9, .f9i, .f9b, td.f9, td.f9i, td.datosf9, td.datos2f9 { + font-size: 6pt; +} +.f9i, .redi { + font-style: italic; +} +.jus { + text-align: justify; + width: 700px; +} +.tit { + padding-top: 3px; +} +.tit, .titb { + font-weight: bold; + color: #fff; + text-align: center; +} +.suc { + color: #5a8629; + background: url(../../images/suc.png) no-repeat 1px; + padding: 4px 1px 6px 30px; +} +.error { + background: url(../../images/error.png) no-repeat; + padding: 4px 1px 6px 30px; +} +.red , .redb, .redi, .error { + color: #f00; +} +.sep { + margin-left: 30px; + border-bottom: 1px solid #708090; + width: 100%; +} +.green { + color: #5a8629; +} +.greenb { + color: #00aa00; +} +.grey { + color: #808080; + font-weight: bold; +} +.redb, .greenb, td.datos_id, td.datos2_id, f9b { + font-weight: bold; +} +.p10 { + padding-top: 1px; + padding-bottom: 0px; +} +.p21 { + padding-top: 2px; + padding-bottom: 1px; +} +.w120 { + width: 120px; +} +.w130 { + width: 130px; +} +.w135 { + width: 135px; +} +.w155 { + width: 155px; +} +.top, .top_red, .bgt, td.datost, td.datos2t { + vertical-align: top; +} +.top_red { + background: #ff0000; +} +.bot, .titb, td.datosb { + vertical-align: bottom; +} +.msg { + margin-top: 15px; + text-align: justify; +} +ul.mn { + list-style: none; + padding: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; + line-height: 24px; +} +.gr { + font-size: 10pt; + font-weight: bold; +} +a.mn, .gr { + font-family: Arial, Verdana, sans-serif, Helvetica; +} +div.nf { + background: url(../../images/info.png) no-repeat; + color: #ac4444; + margin-left: 7px; + padding: 2px 1px 6px 25px; +} +div.title_line { + background-color: #000; + height: 5px; + width: 762px; +} +#menu_tab_frame { + background: #D84437; + width: 805px; + min-height: 22px; + padding-left: 0x; + margin-left: -25px; + float:left; + border-bottom: 1px solid #778866; +} +#menu_tab_frame_view { + background: #66AA44; + width: 805px; + min-height: 22px; + padding-left: 0x; + margin-left: -25px; + float:left; + border-bottom: 1px solid #778866; +} + + +#menu_tab .mn, #menu_tab ul, #menu_tab .mn ul { + padding: 0px; + list-style: none; + margin: 0px; +} +#menu_tab .mn li { + float: right; + position: relative; +} +#menu_tab li a, #menu_tab li.nomn a { + background: #082C43; + padding: 2px 10px 2px 10px; + color: #CFCFCF; + border-left: 1px solid #000; + font-weight: bold; + line-height: 18px; +} +#menu_tab li.nomn_high a { + background: #799E48; + color: #fff; + padding: 2px 10px 2px 10px; + border-left: 2px solid #778866; + font-weight: bold; + line-height: 18px; +} + +#menu_tab .mn li a { + display: block; + text-decoration: none; +} +#menu_tab li.nomn:hover a, +#menu_tab li:hover ul a:hover { + background: #62606a; +} +#menu_tab li:hover a { + background: #62606a url("../images/arrow.png") no-repeat right 3px; +} +#menu_tab li:hover ul a, #menu_tab .mn ul { + background: #62606a; + border-top: none; +} +/* TAB TITLE */ +#menu_tab_left .mn, #menu_tab_left ul, #menu_tab_left .mn ul { + padding: 0px 0px 0px 0px; + list-style: none; + margin: 0px 0px 0px -20px; +} +#menu_tab_left .mn li { + float: left; + position: relative; +} +#menu_tab_left li a { + background: #400027; + padding: 2px 10px 2px 10px; + color: #fff; + font-weight: bold; + line-height: 18px; +} +#menu_tab_left .mn li a { + display: block; + text-decoration: none; +} +#menu_tab_left li.view a { + background: #0B315B; + padding: 2px 10px 2px 10px; + color: #fff; + font-weight: bold; + line-height: 18px; +} +span.users { + background: url(../../images/group.png) no-repeat; +} +span.agents { + background: url(../../images/bricks.png) no-repeat; +} +span.data { + background: url(../../images/data.png) no-repeat; +} +span.alerts { + background: url(../../images/bell.png) no-repeat; +} +span.time { + background: url(../../images/hourglass.png) no-repeat; +} +span.net { + background: url(../../images/network.png) no-repeat; +} +span.master { + background: url(../../images/master.png) no-repeat; +} +span.wmi { + background: url(../../images/wmi.png) no-repeat; +} +span.prediction { + background: url(../../images/chart_bar.png) no-repeat; +} +span.plugin { + background: url(../../images/plugin.png) no-repeat; +} +span.export { + background: url(../../images/database_refresh.png) no-repeat; +} +span.snmp { + background: url(../../images/snmp.png) no-repeat; +} +span.binary { + background: url(../../images/binary.png) no-repeat; +} +span.recon { + background: url(../../images/recon.png) no-repeat; +} +span.rmess { + background: url(../../images/email_open.png) no-repeat; +} +span.nrmess { + background: url(../../images/email.png) no-repeat; +} + +/* This kind of span do not have any sense, should be replaced on PHP code +by a real img in code. They are not useful because insert too much margin around +(for example, not valid to use in the table of server view */ + +span.users, span.agents, span.data, span.alerts, span.time, span.net, +span.master, span.snmp, span.binary, span.recon { + margin-left: 4px; + margin-top: 10px; + padding: 4px 8px 12px 30px; + display: block; +} +span.rmess, span.nrmess { + margin-left: 14px; + padding: 1px 0px 10px 30px; + display: block; +} +/* New styles for data box */ +.databox, .databox_color, .databox_frame { + margin-bottom: 15px; + margin-top: 5px; + margin-left: 0px; + border: 1px solid #071924; +} +.databox { + background-color: #000; + color: #fff; +} +.databox_color { + border-left: 4px solid #071924; +} +#head_l { + float: left; + margin: 0; + padding: 0; +} +#head_r { + float: right; + text-align: right; + margin-right: 10px; + padding-top: 10px; +} +#head_m { + position: absolute; + padding-top: 7px; + padding-left: 210px; +} +span#logo_text1 { + font: bolder 3em Arial, Sans-serif; + letter-spacing: -2px; + color: #eee; +} +span#logo_text2 { + font: 3em Arial, Sans-serif; + letter-spacing: -2px; + color: #aaa; +} +.bb0 { + border-bottom: 0px; +} +.bt0 { + border-top: 0px; +} + +.action-buttons { + text-align: right; +} + +#table-add-item select, #table-add-sla select { + width: 180px; +} + +td.datos_green, td.datos_greenf9 { + background-color: #004807; + padding: 5px 5px 5px 5px; +} + +td.datos_red, td.datos_redf9 { + background-color: #652000; + padding: 5px 5px 5px 5px; +} + +td.datos_yellow, td.datos_yellowf9 { + background-color: #575A00; + padding: 5px 5px 5px 5px; +} + +td.datos_blue, td.datos_bluef9 { + background-color: #003B5A; + padding: 5px 5px 5px 5px; +} + +td.datos_grey, td.datos_greyf9 { + background-color: #303030; + padding: 5px 5px 5px 5px; +} + +td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yellowf9 { + font-size: 6.5pt; +} + +div#main_pure { + background-color: #000; + text-align: left; + margin-bottom: 25px; + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; +} + + +td.big_data { + font-size: 2em; + font-weight: bold; +} + +a.big_data { + text-decoration: none; font: bold 1em Arial, Sans-serif; +} + +#layout_trash_drop { + float: right; + width: 300px; + height: 180px; + background: #fff url("../../images/trash.png") no-repeat bottom left; +} + +#table-agent-configuration radio { + margin-right: 40px; +} + +.ui-draggable { + cursor:move; +} + +#layout_trash_drop { + float: right; +} + diff --git a/pandora_console/include/styles/pandora_red.css b/pandora_console/include/styles/pandora_red.css index d6fd37cd3c..f3d7f5845b 100644 --- a/pandora_console/include/styles/pandora_red.css +++ b/pandora_console/include/styles/pandora_red.css @@ -45,6 +45,13 @@ textarea { font-family: verdana, sans-serif; font-size: 8pt; } +textarea.conf_editor { + padding: 5px; + width: 650; + height: 350; + font-family: verdana, sans-serif; + font-size: 8pt; +} input { padding: 2px 3px 4px 3px; } @@ -80,6 +87,12 @@ h2 { font-size: 15px; } h3 { + font-size: 14px; +} +h4 { + margin-bottom: 2px; + padding-bottom: 0px; + padding-top: 5px; font-size: 13px; } a { @@ -96,6 +109,12 @@ a.white_bold { text-decoration: none; font-weight: bold; } +a.white_grey_bold { + color: #999; + text-decoration: none; + font-weight: bold; +} + a.white { color: #eee; text-decoration: none; @@ -270,6 +289,14 @@ input.search { padding-right: 21px; background: #e5e5e5 url(../../images/zoom.png) no-repeat right 3px; } +input.copy { + padding-right: 21px; + background: #e5e5e5 url(../../images/copy.png) no-repeat right 3px; +} +input.ok { + padding-right: 21px; + background: #e5e5e5 url(../../images/ok.png) no-repeat right 3px; +} table, img { border: 0px; } @@ -277,14 +304,6 @@ th, td.lb, td.lb_view { color: #fff; background-color: #786; } -td.lb, td.lb_view { - height: 16px; - padding-left: 3px; - font-weight: bold; -} -th { - background-color: #CC3333; -} td.datos, td.datost, td.datosb , td.datos_id, td.datosf9 { background-color: #fff0f0; } @@ -322,7 +341,7 @@ td.datos_jus, td.datos2_jus { text-align: center; } .f9, .f9i, .f9b, td.f9, td.f9i, td.datosf9, td.datos2f9 { - font-size: 6pt; + font-size: 6.5pt; } .f9i, .redi { font-style: italic; @@ -339,8 +358,13 @@ td.datos_jus, td.datos2_jus { color: #fff; text-align: center; } +.suc { + color: #5a8629; + background: url(../../images/suc.png) no-repeat 1px; + padding: 4px 1px 6px 30px; +} .error { - background: url(../../images/error.png) no-repeat; + background: url(../../images/err.png) no-repeat; padding: 4px 1px 6px 30px; } .red , .redb, .redi, .error { @@ -369,13 +393,6 @@ td.datos_jus, td.datos2_jus { .redb, .greenb, td.datos_id, td.datos2_id, f9b { font-weight: bold; } -.raya { - border-top: 1px solid #786; - width: 100%; -} -.raya, .noraya { - margin-bottom: -10px; -} .p10 { padding-top: 1px; padding-bottom: 0px; @@ -387,13 +404,13 @@ td.datos_jus, td.datos2_jus { .w120 { width: 120px; } -.w130 { +.w130, #table-agent-configuration select { width: 130px; } .w135 { width: 135px; } -.w155 { +.w155, #table_layout_data select { width: 155px; } .top, .top_red, .bgt, td.datost, td.datos2t { @@ -433,6 +450,26 @@ div.title_line { height: 5px; width: 762px; } +#menu_tab_frame { + background: #D84437; + width: 805px; + min-height: 22px; + padding-left: 0x; + margin-left: -25px; + float:left; + border-bottom: 1px solid #778866; +} +#menu_tab_frame_view { + background: #66AA44; + width: 805px; + min-height: 22px; + padding-left: 0x; + margin-left: -25px; + float:left; + border-bottom: 1px solid #778866; +} + + #menu_tab .mn, #menu_tab ul, #menu_tab .mn ul { padding: 0px; list-style: none; @@ -450,6 +487,15 @@ div.title_line { font-weight: bold; line-height: 18px; } +#menu_tab li.nomn_high a { + background: #799E48; + color: #fff; + padding: 2px 10px 2px 10px; + border-left: 2px solid #778866; + font-weight: bold; + line-height: 18px; +} + #menu_tab .mn li a { display: block; text-decoration: none; @@ -514,6 +560,18 @@ span.net { span.master { background: url(../../images/master.png) no-repeat; } +span.wmi { + background: url(../../images/wmi.png) no-repeat; +} +span.prediction { + background: url(../../images/chart_bar.png) no-repeat; +} +span.plugin { + background: url(../../images/plugin.png) no-repeat; +} +span.export { + background: url(../../images/database_refresh.png) no-repeat; +} span.snmp { background: url(../../images/snmp.png) no-repeat; } @@ -529,6 +587,11 @@ span.rmess { span.nrmess { background: url(../../images/email.png) no-repeat; } + +/* This kind of span do not have any sense, should be replaced on PHP code +by a real img in code. They are not useful because insert too much margin around +(for example, not valid to use in the table of server view */ + span.users, span.agents, span.data, span.alerts, span.time, span.net, span.master, span.snmp, span.binary, span.recon { margin-left: 4px; @@ -581,8 +644,20 @@ span#logo_text2 { letter-spacing: -2px; color: #aaa; } +.bb0 { + border-bottom: 0px; +} +.bt0 { + border-top: 0px; +} +.action-buttons { + text-align: right; +} +#table-add-item select, #table-add-sla select { + width: 180px; +} td.datos_green, td.datos_greenf9 { background-color: #C7EAD5; diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index f234399111..e0edabd5e5 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -18,7 +18,7 @@ require("include/config.php"); $pandora_name = 'Pandora FMS'; // Generate a dot graph definition for graphviz -function generate_dot ($simple = 0) { +function generate_dot ($simple = 0, $font_size) { global $config; global $pandora_name; @@ -43,12 +43,12 @@ function generate_dot ($simple = 0) { } // Add node - $graph .= create_node($agent , $simple)."\n\t\t"; + $graph .= create_node($agent , $simple, $font_size)."\n\t\t"; } // Create a central node if orphan nodes exist if (count ($orphans)) { - $graph .= create_pandora_node ($pandora_name); + $graph .= create_pandora_node ($pandora_name, $font_size); } // Define edges @@ -74,7 +74,7 @@ function create_edge ($head, $tail) { } // Returns a node definition -function create_node ($agent, $simple = 0) { +function create_node ($agent, $simple = 0, $font_size = 10) { $sql = sprintf ('SELECT COUNT(*) FROM tagente_estado, tagente_modulo WHERE tagente_modulo.id_agente = %d @@ -91,6 +91,12 @@ function create_node ($agent, $simple = 0) { $status_color = '#8DFF1D'; } + // Check for alert + $sql = sprintf ('SELECT COUNT(talerta_agente_modulo.id_aam) from talerta_agente_modulo, tagente_modulo, tagente WHERE tagente.id_agente = %d AND tagente.disabled = 0 AND tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo AND talerta_agente_modulo.times_fired > 0 ', $agent['id_agente']); + $alert_modules = get_db_sql ($sql); + if ($alert_modules) + $status_color = '#FFE308'; + // Short name $name = strtolower ($agent["nombre"]); if (strlen ($name) > 12) @@ -103,22 +109,28 @@ function create_node ($agent, $simple = 0) { } else { $img_node = 'images/networkmap/0.png'; } - $node = $agent['id_agente'].' [ color="'.$status_color.'", fontsize=9, style="filled", fixedsize=true, width=0.40, height=0.40, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD><IMG SRC="'.$img_node.'"/></TD></TR> + $node = $agent['id_agente'].' [ color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.40, height=0.40, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD><IMG SRC="'.$img_node.'"/></TD></TR> <TR><TD>'.$name.'</TD></TR></TABLE>>, shape="ellipse", URL="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'", tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];'; } else { - $node = $agent['id_agente'] . ' [ color="' . $status_color . '", fontsize=7, style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];'; + $node = $agent['id_agente'] . ' [ color="' . $status_color . '", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];'; } return $node; } // Returns the definition of the central module -function create_pandora_node ($name) { - $node = '0 [ color="#364D1F", fontsize=10, style="filled", fixedsize=true, width=0.8, height=0.6, label=<<TABLE BORDER="0"> - <TR><TD><IMG SRC="images/networkmap/pandora_node.png"/></TD></TR> - <TR><TD BGCOLOR="#FFFFFF">'.$name.'</TD></TR></TABLE>>, - shape="ellipse", tooltip="'.$name.'", URL="index.php?sec=estado&sec2=operation/agentes/estado_grupo" ];'; +function create_pandora_node ($name, $font_size = 10) { + global $simple; + $img = '<TR><TD><IMG SRC="images/networkmap/pandora_node.png"/></TD></TR>'; + $name = '<TR><TD BGCOLOR="#FFFFFF">'.$name.'</TD></TR>'; + $label = '<TABLE BORDER="0">'.$img.$name.'</TABLE>'; + if ($simple == 1){ + $label = ""; + } + + $node = '0 [ color="#364D1F", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.8, height=0.6, label=<'.$label.'>, + shape="ellipse", URL="index.php?sec=estado&sec2=operation/agentes/estado_grupo" ];'; return $node; } @@ -145,41 +157,43 @@ function close_group () { // Opens a graph definition function open_graph () { - global $config, $layout, $nooverlap, $pure, $zoom, $ranksep; + global $config, $layout, $nooverlap, $pure, $zoom, $ranksep, $font_size; $overlap = 'compress'; $size_x = 8; $size_y = 5.4; $size = ''; - if ($layout == "") - $layout = "radial"; - if ($layout == 'radial') $overlap = 'true'; - if (($layout == 'flat') OR ($layout == 'spring1') OR ($layout == "spring2")) + if (($layout == 'flat') OR ($layout == 'radial') OR ($layout == 'spring1') OR ($layout == "spring2")) if ($nooverlap != '') $overlap = 'scalexy'; - if ($pure == 1 && $zoom > 1 && $zoom <= 3) { + if ($pure == 1 && $zoom > 1 ) { $size_x *= $zoom; $size_y *= $zoom; } $size = $size_x . ',' . $size_y; - - - +// +/* +echo "SIZE $size <br>"; +echo "NO OVERLAP $nooverlap <br>"; +echo "LAYOUT $layout <br>"; +echo "FONTSIZE $font_size <br>"; +echo "RANKSEP $ranksep <br>"; +*/ // BEWARE: graphwiz DONT use single ('), you need double (") $head = "graph networkmap { labeljust=l; margin=0; "; - if ($nooverlap != '') + if ($nooverlap != ''){ + $head .= "overlap=\"$overlap\";"; $head .= "ranksep=\"$ranksep\";"; - $head .= "outputorder=edgesfirst; - overlap=\"$overlap\"; - ratio=fill; - root=0; - size=\"$size\"; - "; + $head .= "outputorder=edgesfirst;"; + } + $head .= "ratio=fill;"; + $head .= "root=0;"; + $head .= "size=\"$size\";"; return $head; } @@ -210,12 +224,13 @@ function set_filter () { /* Main code */ // Load variables -$layout = (string) get_parameter ('layout'); -$nooverlap = (boolean) get_parameter ('nooverlap'); +$layout = (string) get_parameter ('layout', 'radial'); +$nooverlap = (boolean) get_parameter ('nooverlap', 0); $pure = (int) get_parameter ('pure'); $zoom = (float) get_parameter ('zoom'); $ranksep = (float) get_parameter ('ranksep', 2.5); $simple = (int) get_parameter ('simple', 0); +$font_size = (int) get_parameter ('font_size', 12); // Login check $id_user = $_SESSION["id_usuario"]; @@ -242,8 +257,9 @@ if ($pure == 1) { echo '</h2>'; // Layout selection -$layout_array = array ('radial' => 'radial', +$layout_array = array ( 'circular' => 'circular', + 'radial' => 'radial', 'spring1' => 'spring 1', 'spring2' => 'spring 2', 'flat' => 'flat'); @@ -256,7 +272,7 @@ print_select ($layout_array, 'layout', $layout, '', '', ''); echo '</td>'; echo '<td valign="top">' . lang_string('No Overlap') . ' '; -print_checkbox ('nooverlap', 'nooverlap', $nooverlap); +print_checkbox ('nooverlap', '1', $nooverlap); echo '</td>'; echo '<td valign="top">' . lang_string('Simple') . ' '; @@ -279,6 +295,18 @@ if ($pure == "1") { echo '</td>'; } + +if ($nooverlap == 1){ + echo "<td>"; + echo lang_string('Distance between nodes') . ' '; + print_input_text ('ranksep', $ranksep, $alt = 'Separation between elements in the map (in Non-overlap mode)', 3, 4, 0); +} + +echo "<td>"; +echo lang_string('Font size') . ' '; +print_input_text ('font_size', $font_size, $alt = 'Font size (in pt)', 3, 4, 0); + + //echo ' Display groups <input type="checkbox" name="group" value="group" class="chk"/>'; echo '<td>'; echo '<input name="updbutton" type="submit" class="sub upd" value="'. lang_string ("update"). '">'; @@ -290,7 +318,7 @@ echo '</form>'; $filter = set_filter(); // Generate dot file -$graph = generate_dot($simple); +$graph = generate_dot ($simple, $font_size); // Generate image and map $cmd = "echo " . escapeshellarg($graph) . diff --git a/pandora_console/operation/agentes/sla_view.php b/pandora_console/operation/agentes/sla_view.php index 45f52f4267..8a7b5e010f 100644 --- a/pandora_console/operation/agentes/sla_view.php +++ b/pandora_console/operation/agentes/sla_view.php @@ -142,7 +142,8 @@ $sql_t = "SELECT tagente_modulo.id_agente_modulo, sla_max, sla_min, sla_limit, t $result_t=mysql_query($sql_t); if (mysql_num_rows ($result_t)) { $color=0; - echo "<h3>".lang_string ("User-defined SLA items")."</h3>"; + echo "<h3>".lang_string ("User-defined SLA items")." - "; + echo human_time_description_raw($config["sla_period"]). " </h3>"; echo "<table width='750' cellpadding=4 cellspacing=4 class='databox'>"; echo "<tr>"; echo "<th>" . lang_string ("type") . "</th>"; @@ -185,7 +186,7 @@ if (mysql_num_rows ($result_t)) { echo format_numeric($temp)." %</td>"; echo "<td class='$tdcolor'>"; if ($temp > $sla_limit) - echo "<img src='images/pixel_green.png' width=40 height=18 title='" . lang_label("green_light") . "'>"; + echo "<img src='images/pixel_green.png' width=40 height=18 title='" . lang_string ("green_light") . "'>"; else echo "<img src='images/pixel_red.png' width=40 height=18 title='" . lang_string ("red_light") . "'>"; } diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 84006c9f19..d599d8a9fc 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -85,13 +85,21 @@ if ($status == -1){ echo "<option value=-1>".lang_string("All"); echo "<option value=0>".lang_string("Monitors down"); echo "<option value=1>".lang_string("Monitors up"); + echo "<option value=2>".lang_string("Monitors unknown"); } elseif ($status == 0){ echo "<option value=0>".lang_string("Monitors down"); echo "<option value=-1>".lang_string("All"); + echo "<option value=1>".lang_string("Monitors up"); + echo "<option value=2>".lang_string("Monitors unknown"); +} elseif ($status == 2){ + echo "<option value=2>".lang_string("Monitors unknown"); + echo "<option value=0>".lang_string("Monitors down"); + echo "<option value=-1>".lang_string("All"); echo "<option value=1>".lang_string("Monitors up"); } else { echo "<option value=1>".lang_string("Monitors up"); echo "<option value=0>".lang_string("Monitors down"); + echo "<option value=2>".lang_string("Monitors unknown"); echo "<option value=-1>".lang_string("All"); } echo "</select>"; @@ -124,7 +132,7 @@ echo "</table>"; // Begin Build SQL sentences -$SQL_pre = "SELECT tagente_modulo.id_agente_modulo, tagente.nombre, tagente_modulo.nombre, tagente_modulo.descripcion, tagente.id_grupo, tagente.id_agente, tagente_modulo.id_tipo_modulo, tagente_modulo.module_interval "; +$SQL_pre = "SELECT tagente_modulo.id_agente_modulo, tagente.nombre, tagente_modulo.nombre, tagente_modulo.descripcion, tagente.id_grupo, tagente.id_agente, tagente_modulo.id_tipo_modulo, tagente_modulo.module_interval, tagente_estado.datos, tagente_estado.utimestamp, tagente_estado.timestamp "; $SQL_pre_count = "SELECT count(tagente_modulo.id_agente_modulo) "; @@ -154,6 +162,8 @@ if ($status == 1) $SQL .= " AND tagente_estado.estado = 0 "; elseif ($status == 0) $SQL .= " AND tagente_estado.estado = 1 "; +elseif ($status == 2) + $SQL .= " AND (UNIX_TIMESTAMP()-tagente_estado.utimestamp ) > (tagente_estado.current_interval * 2)"; // Final order $SQL .= " ORDER BY tagente.id_grupo, tagente.nombre"; @@ -193,7 +203,19 @@ if ($counter > 0){ $tdcolor="datos2"; $color =1; } - + if ($data[7] == 0){ + $my_interval = give_agentinterval($data[5]); + } else { + $my_interval = $data[7]; + } + + if ($status == 2){ + $seconds = time() - $data[9]; + + if ($seconds < ($my_interval*2)) + continue; + } + echo "<tr><td class='$tdcolor'>"; echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$data["id_agente"]."&id_agente_modulo=".$data[0]."&flag=1&tab=data&refr=60'>"; echo "<img src='images/target.png'></a>"; @@ -207,32 +229,23 @@ if ($counter > 0){ echo "<td class='$tdcolor'>". substr($data[2],0,21). "</td>"; echo "<td class='".$tdcolor."f9' title='".$data[3]."'>".substr($data[3],0,30)."</td>"; echo "<td class='$tdcolor' align='center' width=25>"; - if ($data[7] == 0){ - $my_interval = give_agentinterval($data[5]); - } else { - $my_interval = $data[7]; - } echo $my_interval; - $query_gen2='SELECT * FROM tagente_estado - WHERE id_agente_modulo = '.$data[0]; - $result_gen2=mysql_query($query_gen2); - $data2=mysql_fetch_array($result_gen2); echo "<td class='$tdcolor' align='center' width=20>"; - if ($data2["datos"] > 0){ + if ($data[8] > 0){ echo "<img src='images/pixel_green.png' width=40 height=18 title='".lang_string("Monitor up")."'>"; } else { echo "<img src='images/pixel_red.png' width=40 height=18 title='".lang_string ("Monitor down")."'>"; } echo "<td class='".$tdcolor."f9'>"; - $seconds = time() - $data2["utimestamp"]; + $seconds = time() - $data[9]; if ($seconds >= ($my_interval*2)) echo "<span class='redb'>"; else echo "<span>"; - echo human_time_comparation($data2["timestamp"]); + echo human_time_comparation($data[10]); echo "</span></td></tr>"; } echo "</table>"; diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index 505d3c1920..4b1b097c19 100644 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -102,28 +102,46 @@ echo "<tr><td colspan='2'><b>".lang_string("Alert level")."</th>"; echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$alert_level' title='$alert_level % ".lang_string("of non-fired alerts")."'>"; echo "<br><br>"; - +// Monitor checks echo "<tr>"; echo "<th colspan=2>".lang_string ("monitor_checks")."</th>"; echo "<tr><td class=datos2><b>"."Monitor checks"."</b></td>"; -echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #000;'>".$monitor_checks."</td>"; +echo "<td style='font: bold 2em Arial' class='datos2'>"; +echo "<a class='big_data' href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=-1'>"; +echo $monitor_checks."</A></td>"; + +// Monitor OK echo "<tr><td class=datos><b>"."Monitor OK"."</b></td>"; -echo "<td class=datos style='font: bold 2em Arial, Sans-serif; color: #000;'>".$monitor_ok."</td>"; +echo "<td style='font: bold 2em Arial' class='datos'>"; +echo "<a style='color:#0f0;' class='big_data' href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=1'>"; +if ($monitor_ok > 0) + echo $monitor_ok; +else + echo "-"; +echo "</A>"; + +// Monitor BAD echo "<tr><td class=datos2><b>"."Monitor BAD"."</b></td>"; -echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #f00;'>"; -echo "<a style='text-decoration: none; font: bold 1em Arial, Sans-serif; color: #f00;' href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60'>"; +echo "<td class='datos2' style='font: bold 2em Arial' >"; +echo "<a style='color:#f00;' class='big_data' href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=0'>"; if ($monitor_bad > 0) echo $monitor_bad; else echo "-"; echo "</A>"; -echo "</td></tr><tr><td class=datos><b>"."Monitor Unknown"."</b></td>"; -echo "<td class=datos style='font: bold 2em Arial, Sans-serif; color: #888;'>"; +echo "</td></tr>"; + +// Monitor unknown +echo "<tr><td class=datos>"; +echo "<b>"."Monitor Unknown"."</b></td>"; +echo "<td class='datos' style='font: bold 2em Arial' >"; +echo "<a style='color:#aaa;' class='big_data' href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2'>"; if ($monitor_unknown > 0) echo $monitor_unknown; else echo "-"; +echo "</A>"; echo "</td></tr><tr><td class=datos2><b>"."Monitor Not Init"."</b></td>"; echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #FF8C00;'>"; @@ -133,15 +151,15 @@ else echo "-"; echo "<tr><td class=datos><b>"."Alerts Fired"."</b></td>"; -echo "<td class=datos style='font: bold 2em Arial, Sans-serif; color: #ff0000;'>"; -echo "<a style='text-decoration: none; font: bold 1em Arial, Sans-serif; color: #ff0000;' href='index.php?sec=eventos&sec2=operation/events/events&search=&event_type=alert_fired'>"; +echo "<td class=datos style='font: bold 2em Arial'>"; +echo "<a style=color:#f00' class='big_data' href='index.php?sec=eventos&sec2=operation/events/events&search=&event_type=alert_fired'>"; if ($monitor_alert > 0) echo $monitor_alert; else echo "-"; echo "</A>"; echo "<tr><td class=datos2><b>"."Alerts Total"."</b></td>"; -echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #000000;'>".$monitor_alert_total; +echo "<td class=datos2 style='font: bold 2em Arial'>".$monitor_alert_total; // Data checks @@ -149,27 +167,27 @@ echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #000000;' echo "<tr><th colspan=2>".lang_string ("data_checks")."</th>"; echo "<tr><td class=datos2><b>"."Data checks"."</b></td>"; -echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #000000;'>".$data_checks; +echo "<td class=datos2 style='font: bold 2em Arial'>".$data_checks; echo "<tr><td class=datos><b>"."Data Unknown"."</b></td>"; -echo "<td class=datos style='font: bold 2em Arial, Sans-serif; color: #888;'>"; +echo "<td class=datos style='font: bold 2em Arial; color: #aaa;'>"; if ($data_unknown > 0) echo $data_unknown; else echo "-"; echo "<tr><td class=datos2><b>"."Data not init"."</b></td>"; -echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #FF8C00;'>"; +echo "<td class=datos2 style='font: bold 2em Arial'>"; if ($data_not_init > 0) echo $data_not_init; else echo "-"; echo "<tr><td class=datos><b>"."Alerts Fired"."</b></td>"; -echo "<td class=datos style='font: bold 2em Arial, Sans-serif; color: #f00;'>"; +echo "<td class=datos style='font: bold 2em Arial; color: #f00;'>"; if ($data_alert > 0) echo $data_alert; else echo "-"; echo "<tr><td class=datos2><b>"."Alerts Total"; -echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #000;'>".$data_alert_total; +echo "<td class=datos2 style='font: bold 2em Arial'>".$data_alert_total; // Summary @@ -177,12 +195,12 @@ echo "<td class=datos2 style='font: bold 2em Arial, Sans-serif; color: #000;'>". echo "<tr><th colspan='2'>".lang_string ("summary")."</th>"; echo "<tr><td class='datos2'><b>"."Total agents"."</b></td>"; -echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_agents; +echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif;'>".$total_agents; echo "<tr><td class='datos'><b>"."Total checks"."</b></td>"; -echo "<td class='datos' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_checks; +echo "<td class='datos' style='font: bold 2em Arial, Sans-serif;'>".$total_checks; echo "<tr><td class='datos2'><b>"."Server sanity"."</b></td>"; -echo "<td class='datos2' style='font: bold 1em Arial, Sans-serif; color: #000;'>"; +echo "<td class='datos2' style='font: bold 1em Arial, Sans-serif;'>"; echo format_numeric($notinit_percentage); echo "% ".lang_string("Uninitialized modules"); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 0862d4328a..5f5d8adbc2 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -44,12 +44,13 @@ if (defined ('AJAX')) { $id_agent = (int) get_parameter ('id_agent'); $agent = get_db_row ('tagente', 'id_agente', $id_agent); echo '<h3>'.$agent['nombre'].'</h3>'; - echo '<strong>'.lang_string ('IP').':</strong> '.$agent['direccion'].'<br />'; - echo '<strong>'.lang_string ('Last contact').':</strong> '.$agent['ultimo_contacto'].'<br />'; - echo '<strong>'.lang_string ('Last remote contact').':</strong> '.$agent['ultimo_contacto_remoto'].'<br />'; + echo '<strong>'.lang_string ('Main IP').':</strong> '.$agent['direccion'].'<br />'; echo '<strong>'.lang_string ('Group').':</strong> '; echo '<img src="images/groups_small/'.dame_grupo_icono ($agent['id_grupo']).'.png" /> '; echo dame_nombre_grupo ($agent['id_grupo']).'<br />'; + + echo '<strong>'.lang_string ('Last contact').':</strong> '.human_time_comparation($agent['ultimo_contacto']).'<br />'; + echo '<strong>'.lang_string ('Last remote contact').':</strong> '.human_time_comparation($agent['ultimo_contacto_remoto']).'<br />'; $sql = sprintf ('SELECT tagente_modulo.descripcion, tagente_modulo.nombre FROM tagente_estado, tagente_modulo @@ -64,15 +65,14 @@ if (defined ('AJAX')) { WHERE id_agente = %d AND id_tipo_modulo in (2, 6, 9, 18, 21, 100)', $id_agent); $total_modules = get_db_sql ($sql); - echo '<strong>'.lang_string ('Monitors down').':</strong> '.sizeof ($bad_modules).' / '.$total_modules; + + // Modules down if (sizeof ($bad_modules)) { + echo '<strong>'.lang_string ('Monitors down').':</strong> '.sizeof ($bad_modules).' / '.$total_modules; echo '<ul>'; foreach ($bad_modules as $module) { echo '<li>'; - if ($module['descripcion'] != '') - $name = $module['descripcion']; - else - $name = $module['nombre']; + $name = $module['nombre']; echo substr ($name, 0, 25); if (strlen ($name) > 25) echo '(...)'; @@ -80,7 +80,27 @@ if (defined ('AJAX')) { } echo '</ul>'; } - echo '<br />'; + + // Alerts (if present) + $sql = sprintf ('SELECT COUNT(talerta_agente_modulo.id_aam) FROM talerta_agente_modulo, tagente_modulo, tagente WHERE tagente.id_agente = %d AND tagente.disabled = 0 AND tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo AND talerta_agente_modulo.times_fired > 0 ', $id_agent); + $alert_modules = get_db_sql ($sql); + if ($alert_modules > 0){ + $sql = sprintf ('SELECT tagente_modulo.nombre, talerta_agente_modulo.last_fired FROM talerta_agente_modulo, tagente_modulo, tagente WHERE tagente.id_agente = %d AND tagente.disabled = 0 AND tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.disabled = 0 AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo AND talerta_agente_modulo.times_fired > 0 ', $id_agent); + $alerts = get_db_all_rows_sql ($sql); + echo '<strong>'.lang_string ('Alerts fired').':</strong>'; + echo "<ul>"; + foreach ($alerts as $alert_item) { + echo '<li>'; + $name = $alert_item[0]; + echo substr ($name, 0, 25); + if (strlen ($name) > 25) + echo '(...)'; + echo " "; + echo human_time_comparation($alert_item[1]); + echo '</li>'; + } + echo '</ul>'; + } exit (); } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 8f354342ed..38dbaeca38 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -389,7 +389,8 @@ if ($total_events > 0){ echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$row2["id_agente"]."&tab=alert'><img src='images/bell.png' border=0></a>"; // Group icon - echo "<td class='$tdclass' align='center'><img src='images/groups_small/".show_icon_group($id_group).".png' class='bot'></td>"; + $group_name = (string) get_db_value ('nombre', 'tgrupo', 'id_grupo', $id_group); + echo "<td class='$tdclass' align='center'><img src='images/groups_small/".show_icon_group($id_group).".png' title='$group_name' class='bot'></td>"; // for System or SNMP generated alerts } else { diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 0d3b8986d8..4a4ff34c29 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -104,7 +104,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")) { echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/index" class="mn">'.lang_string ("visual_console").'</a></li></ul></div>'; if ( isset($_GET["sec"]) && $_GET["sec"] == "visualc") { - $sql="SELECT * FROM tlayout"; + $sql="SELECT * FROM tlayout ORDER BY name"; if($res=mysql_query($sql)) while ($row = mysql_fetch_array($res)){ if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/visual_console/render_view") { diff --git a/pandora_console/operation/reporting/graph_viewer.php b/pandora_console/operation/reporting/graph_viewer.php index 55e2e9cd4d..59386d8e60 100644 --- a/pandora_console/operation/reporting/graph_viewer.php +++ b/pandora_console/operation/reporting/graph_viewer.php @@ -136,24 +136,23 @@ border=1 alt=''>"; $periods[720] = lang_string ('last_month'); $periods[4320] = lang_string ('six_months'); print_select ($periods, 'period', intval ($period / 3600), '', '', 0); + echo "<td class='datos'>"; $stackeds = array (); - $stackeds[0] = lang_string ('Area'); - $stackeds[1] = lang_string ('Stacked area'); - $stackeds[2] = lang_string ('Line'); - + $stackeds[0] = lang_string ('Area'); + $stackeds[1] = lang_string ('Stacked area'); + $stackeds[2] = lang_string ('Line'); print_select ($stackeds, 'stacked', $stacked , '', '', 0); - echo "<td class='datos'>"; + echo "<td class='datos'>"; $zooms = array(); $zooms[0] = lang_string ('Graph defined'); $zooms[1] = lang_string ('Zoom x1'); - $zooms[2] = lang_string ('Zoom x2'); - $zooms[3] = lang_string ('Zoom x3'); - + $zooms[2] = lang_string ('Zoom x2'); + $zooms[3] = lang_string ('Zoom x3'); print_select ($zooms, 'zoom', $zoom , '', '', 0); - echo "<td class='datos'>"; + echo "<td class='datos'>"; echo "<input type=submit value='".$lang_label["update"]."' class='sub upd'>"; echo "</table>"; echo "</form>"; diff --git a/pandora_console/operation/visual_console/index.php b/pandora_console/operation/visual_console/index.php index deeb06896e..f9dca6b714 100644 --- a/pandora_console/operation/visual_console/index.php +++ b/pandora_console/operation/visual_console/index.php @@ -30,7 +30,7 @@ if (comprueba_login() != 0) { echo "<h2>".$lang_label["visual_console"]." > "; echo $lang_label["summary"]."</h2>"; -$layouts = get_db_all_rows_in_table ('tlayout'); +$layouts = get_db_all_rows_in_table ('tlayout','name'); if (sizeof ($layouts) == 0) { echo "<div class='nf'>".$lang_label["no_layout_def"]."</div>"; diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php index e3a27543d4..dd8bc517b9 100644 --- a/pandora_console/operation/visual_console/render_view.php +++ b/pandora_console/operation/visual_console/render_view.php @@ -58,32 +58,22 @@ $bheight = $layout["height"]; $pure_url = "&pure=".$config["pure"]; // Render map -echo "<h1>".$layout_name."</h1>"; +echo "<h1>".$layout_name." "; if ($config["pure"] == 0){ - echo lang_string("Full screen mode"); - echo " "; echo "<a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout&refr=$refr&pure=1'>"; echo "<img src='images/monitor.png' title='".lang_string("Full screen mode")."'>"; echo "</a>"; } else { - echo lang_string("Back to normal mode"); - echo " "; echo "<a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout&pure=0&refr=$refr'>"; echo "<img src='images/monitor.png' title='".lang_string("Back to normal mode")."'>"; echo "</a>"; } -echo '<br />'; -if ($refr) { - echo '<div id="countdown">'; - echo '</div>'; -} + +echo '</h1>'; print_pandora_visual_map ($id_layout); -echo "<div style='height:30px'>"; -echo "</div>"; - $refresh_values = array (); $refresh_values[5] = "5 ". lang_string ('seconds'); $refresh_values[30] = "30 ". lang_string ('seconds'); @@ -93,12 +83,23 @@ $refresh_values[300] = "5 ". lang_string ('minutes'); $refresh_values[600] = "10 ". lang_string ('minutes'); $refresh_values[1800] = "30 ". lang_string ('minutes'); -$table->width = '300px'; +$table->width = '500px'; $table->data = array (); $table->data[0][0] = lang_string ('auto_refresh_time'); $table->data[0][1] = print_select ($refresh_values, 'refr', $refr, '', 'N/A', 0, true); $table->data[0][2] = print_submit_button (lang_string ('refresh'), '', false, 'class="sub next"', true); +echo "<div style='height:30px'>"; +echo "</div>"; + +if ($refr) { + echo '<div id="countdown">'; + echo '</div>'; +} + +echo "<div style='height:30px'>"; +echo "</div>"; + echo '<form method="post" action="index.php?sec=visualc&sec2=operation/visual_console/render_view">'; print_input_hidden ('pure', $config["pure"]); print_input_hidden ('id', $id_layout);