From 1d5afbb36a2e00ba9ad573baff280bd8c51e616c Mon Sep 17 00:00:00 2001 From: fermin831 Date: Fri, 17 Mar 2017 11:23:28 +0100 Subject: [PATCH 01/46] Added _alert_unkown_instructions_ macro --- pandora_console/include/help/en/help_alert_macros.php | 1 + pandora_console/include/help/es/help_alert_macros.php | 1 + pandora_console/include/help/ja/help_alert_macros.php | 1 + pandora_server/lib/PandoraFMS/Core.pm | 3 +++ 4 files changed, 6 insertions(+) diff --git a/pandora_console/include/help/en/help_alert_macros.php b/pandora_console/include/help/en/help_alert_macros.php index 6753e2c59a..a1e5e6269b 100644 --- a/pandora_console/include/help/en/help_alert_macros.php +++ b/pandora_console/include/help/en/help_alert_macros.php @@ -60,6 +60,7 @@ Besides the defined module macros, the following macros are available:
  • _moduletags_: URLs associated to the module’s tags.
  • _alert_critical_instructions_: Instructions for CRITICAL status contained in the module.
  • _alert_warning_instructions_: Instructions for WARNING status contained in the module.
  • +
  • _alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.
  • _modulegraph_nh_: (>=6.0) (Only for alerts that use the command eMail) Returns an image encoded in base64 of a module’s graph with a period of n hours (eg. _modulegraph_24h_). A correct setup of the connection between the server and the console's API is required. diff --git a/pandora_console/include/help/es/help_alert_macros.php b/pandora_console/include/help/es/help_alert_macros.php index f4c8f476d9..007c4ef24e 100644 --- a/pandora_console/include/help/es/help_alert_macros.php +++ b/pandora_console/include/help/es/help_alert_macros.php @@ -60,6 +60,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
  • _moduletags_: URLs asociadas a los tags de módulos.
  • _alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.
  • _alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.
  • +
  • _alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.
  • _modulegraph_nh_: (>=6.0) (Solo para alertas que usen el comando eMail) Devuelve una imagen codificada en base64 de una gráfica del módulo con un período de n horas (eg. _modulegraph_24h_). Requiere de una configuración correcta de la conexión del servidor a la consola vía api, diff --git a/pandora_console/include/help/ja/help_alert_macros.php b/pandora_console/include/help/ja/help_alert_macros.php index 15b892651c..a020d7a233 100644 --- a/pandora_console/include/help/ja/help_alert_macros.php +++ b/pandora_console/include/help/ja/help_alert_macros.php @@ -59,6 +59,7 @@
  • _moduletags_ : モジュールタグに関連付けられた URL。
  • _alert_critical_instructions_: モジュールの障害状態時手順。
  • _alert_warning_instructions_: モジュールの警告状態時手順。
  • +
  • _alert_unknown_instructions_: Instructions for UNKNOWN status contained in the module.
  • _modulegraph_nh_: (>=6.0) (eMailコマンドを使うアラートのみ) n で示す期間の base64 でエンコードされたモジュールグラフを返します。(例: _modulegraph_24h_) サーバとコンソールの API の設定が正しくできている必要があります。この設定は、サーバの設定ファイルで行います。
  • diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 19717beae2..5a182c4cfc 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -560,6 +560,7 @@ sub pandora_process_alert ($$$$$$$$;$) { $alert->{'critical_instructions'} = $critical_instructions; $alert->{'warning_instructions'} = $warning_instructions; + $alert->{'unknown_instructions'} = $unknown_instructions; # Generate an event if ($table eq 'tevent_alert') { @@ -769,6 +770,7 @@ sub pandora_execute_alert ($$$$$$$$$;$) { $alert->{'critical_instructions'} = $critical_instructions; $alert->{'warning_instructions'} = $warning_instructions; + $alert->{'unknown_instructions'} = $unknown_instructions; # Execute actions my $event_generated = 0; @@ -994,6 +996,7 @@ sub pandora_execute_action ($$$$$$$$$;$) { _alert_text_severity_ => get_priority_name($alert->{'priority'}), _alert_critical_instructions_ => $alert->{'critical_instructions'}, _alert_warning_instructions_ => $alert->{'warning_instructions'}, + _alert_unknown_instructions_ => $alert->{'unknown_instructions'}, _groupcontact_ => (defined ($group)) ? $group->{'contact'} : '', _groupcustomid_ => (defined ($group)) ? $group->{'custom_id'} : '', _groupother_ => (defined ($group)) ? $group->{'other'} : '', From 2b74fbe57ea20bb7b01c0c9308b8fe1d27d68bde Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 27 Mar 2017 15:32:05 +0200 Subject: [PATCH 02/46] Modified menu position to fit it with ACL enterprise --- pandora_console/include/functions_menu.php | 40 ++++++++++++++++- pandora_console/include/styles/menu.css | 43 ------------------- pandora_console/include/styles/pandora.css | 2 +- .../include/styles/pandora_black.css | 2 +- .../include/styles/pandora_green_old.css | 2 +- 5 files changed, 42 insertions(+), 47 deletions(-) diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 6915fd76a2..1dbaecae0b 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -49,6 +49,9 @@ function menu_print_menu (&$menu) { '') . '>'; + // Use $config because a global var is required because normal + // and godmode menu are painted separately + if (!isset($config['count_main_menu'])) $config['count_main_menu'] = 0; foreach ($menu as $mainsec => $main) { $extensionInMenuParameter = (string) get_parameter ('extension_in_menu',''); @@ -369,6 +372,12 @@ function menu_print_menu (&$menu) { $sub_title = ''; } + // Added a top on inline styles + $top = menu_calculate_top($config['count_main_menu'], $count_sub, $count_sub2); + if ($top !== 0) { + $display = rtrim($display, "'"); + $display .= "top: " . $top . "px;'"; + } //Add submenu2 to submenu string $submenu_output .= "