From fdeb89f4f3856688f4279011d1b8ffeda79e1cca Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 30 Mar 2016 00:01:39 +0200 Subject: [PATCH 01/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8be1382079..e3e9e6ddfe 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160329 +Version: 6.1dev-160330 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index e0527a44d5..3ecc00536a 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160329" +pandora_version="6.1dev-160330" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 418c0e9395..f6ffbe0dd8 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160329'; +use constant AGENT_BUILD => '160330'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index ce49c0982c..4cb802a22e 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160329 +%define release 160330 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 44ca4d8a74..a949f3fcd5 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160329 +%define release 160330 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 387ea09553..ca6858e55f 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160329" +PI_BUILD="160330" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c1d53be169..2fee1ea6c9 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160329} +{160330} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 699aba0038..0e47e0252c 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160329)") +#define PANDORA_VERSION ("6.1dev(Build 160330)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 243098ffb7..60a638bf9d 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160329))" + VALUE "ProductVersion", "(6.1dev(Build 160330))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 6a0c3adb9e..79cfe81c6d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160329 +Version: 6.1dev-160330 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index fac407aa3a..3c51153d93 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160329" +pandora_version="6.1dev-160330" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 16d7163196..7b301decf0 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160329'; +$build_version = 'PC160330'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 35880bac80..e448a26dba 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Wed, 30 Mar 2016 09:21:44 +0200 Subject: [PATCH 02/54] Fixed problems with stop tentacle server, doen't stop all procesess. Tiquet: #3488 (cherry picked from commit 0210afa536d0d495aeead215d4c37a4a98dae442) --- pandora_server/util/tentacle_serverd | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pandora_server/util/tentacle_serverd b/pandora_server/util/tentacle_serverd index f356738a4c..9462f4c6a0 100755 --- a/pandora_server/util/tentacle_serverd +++ b/pandora_server/util/tentacle_serverd @@ -51,6 +51,16 @@ function get_pid { echo $TENTACLE_PID } +function get_all_pid { + # This sets COLUMNS to XXX chars, because if command is run + # in a "strech" term, ps aux don't report more than COLUMNS + # characters and this will not work. + COLUMNS=300 + TENTACLE_PIDS=`ps aux | grep "$TENTACLE_PATH$TENTACLE_DAEMON" | grep -v grep | awk '{ print $2 }'` + TENTACLE_PID="${TENTACLE_PIDS//\\n/' '}" + echo $TENTACLE_PID +} + # Pandora server settings PANDORA_SERVER_PATH="/var/spool/pandora/data_in" @@ -110,14 +120,14 @@ case "$1" in ;; stop) - TENTACLE_PID=`get_pid` + TENTACLE_PID=`get_all_pid` if [ -z "$TENTACLE_PID" ]; then echo "Tentacle Server does not seem to be running" rc_exit # running stop on a service already stopped or not running else kill $TENTACLE_PID sleep 1 - _PID=`get_pid` + _PID=`get_all_pid` if [ "$_PID" = "$TENTACLE_PID" ]; then echo "Tentacle Server could not be stopped" From 0b725ba2fc7cdb85397ee9d25c6807e76909848e Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 30 Mar 2016 11:18:30 +0200 Subject: [PATCH 03/54] Fixed warning in pandora_manage(CLI). Tiquet: #3496 (cherry picked from commit ccf7da77a9e0cf503c2558e09562f7a7478d374d) --- pandora_server/util/pandora_manage.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1cefae5fbf..7905f35823 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -3881,7 +3881,7 @@ sub cli_locate_agent () { } } - if (defined(@list_servers)) { + if (scalar(@list_servers) > 0) { $list_names_servers = join(',',@list_servers); print_log "[INFO] The agent: $agent_name find in server with IDS: $list_names_servers\n\n"; } From 1facd4d69f5db994b7cc2723bf90777ca672644b Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 30 Mar 2016 13:05:08 +0200 Subject: [PATCH 04/54] Some fixes in the skins. --- pandora_console/include/functions_ui.php | 131 +++++++++++------------ 1 file changed, 65 insertions(+), 66 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index f4b14d1be9..a94edba05e 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -93,7 +93,7 @@ function ui_print_truncate_text($text, $numChars = GENERIC_SIZE_TEXT, $showTextI else { echo $text; } - } + } $text = io_safe_output($text); if (mb_strlen($text, "UTF-8") > ($numChars)) { @@ -134,10 +134,10 @@ function ui_print_truncate_text($text, $numChars = GENERIC_SIZE_TEXT, $showTextI } } else { - if ($style !== false) { + if ($style !== false) { $truncateText = '' . $text . ''; } - else { + else { $truncateText = $text; } } @@ -183,7 +183,7 @@ function printSmallFont ($string, $return = true) { } } -/** +/** * Prints a generic message between tags. * * @param mixed The string message or array ('title', 'message', 'icon', 'no_close', 'force_style') to be displayed @@ -267,7 +267,7 @@ function ui_print_message ($message, $class = '', $attributes = '', $return = fa ' . $text_title . ' '; if (!$no_close_bool) { - //Use the no_meta parameter because this image is only in the base console + //Use the no_meta parameter because this image is only in the base console $output .= '' . html_print_image('images/blade.png', true, false, false, false, true) . ''; } @@ -296,11 +296,11 @@ function ui_print_message ($message, $class = '', $attributes = '', $return = fa return $output; else echo $output; - + return ''; } -/** +/** * Prints an error message. * * @param mixed The string error message or array ('title', 'message', 'icon', 'no_close') to be displayed @@ -315,7 +315,7 @@ function ui_print_error_message ($message, $attributes = '', $return = false, $t return ui_print_message ($message, 'error', $attributes, $return, $tag); } -/** +/** * Prints an operation success message. * * @param mixed The string message or array ('title', 'message', 'icon', 'no_close') to be displayed @@ -330,7 +330,7 @@ function ui_print_success_message ($message, $attributes = '', $return = false, return ui_print_message ($message, 'suc', $attributes, $return, $tag); } -/** +/** * Prints an operation info message. * * @param mixed The string message or array ('title', 'message', 'icon', 'no_close') to be displayed @@ -349,10 +349,10 @@ function ui_print_empty_data($message, $attributes = '', $return = false, $tag = return ui_print_message ($message, 'info', $attributes, $return, $tag); } -/** +/** * Evaluates a result using empty() and then prints an error or success message * - * @param mixed The results to evaluate. 0, NULL, false, '' or + * @param mixed The results to evaluate. 0, NULL, false, '' or * array() is bad, the rest is good * @param mixed The string or array ('title', 'message') to be displayed if the result was good * @param mixed The string or array ('title', 'message') to be displayed if the result was bad @@ -378,7 +378,7 @@ function ui_print_result_message ($result, $good = '', $bad = '', $attributes = } } -/** +/** * Prints an warning message. * * @param mixed The string warning message or array ('title', 'message', 'icon', 'no_close') to be displayed @@ -517,7 +517,7 @@ function ui_print_tags_warning ($return = false) { } } -/** +/** * Print group icon within a link * * @param int Group id @@ -543,7 +543,7 @@ function ui_print_group_icon ($id_group, $return = false, $path = "groups_small" if (defined('METACONSOLE')) $link = false; - if ($link) + if ($link) $output = ''; if ($config['show_group_name']) { @@ -559,7 +559,7 @@ function ui_print_group_icon ($id_group, $return = false, $path = "groups_small" } } - if ($link) + if ($link) $output .= ''; if (!$return) @@ -568,7 +568,7 @@ function ui_print_group_icon ($id_group, $return = false, $path = "groups_small" return $output; } -/** +/** * Print group icon within a link. Other version. * * @param int Group id @@ -587,7 +587,7 @@ function ui_print_group_icon_path ($id_group, $return = false, $path = "images/g $style = 'width: 16px; height: 16px;'; $output = ''; - if ($link) + if ($link) $output = ''; if (empty ($icon)) @@ -595,7 +595,7 @@ function ui_print_group_icon_path ($id_group, $return = false, $path = "images/g else $output .= ''.groups_get_name ($id_group, true).''; - if ($link) + if ($link) $output .= ''; if (!$return) @@ -604,12 +604,12 @@ function ui_print_group_icon_path ($id_group, $return = false, $path = "images/g return $output; } -/** +/** * Get the icon of an operating system. * * @param int Operating system id * @param bool Whether to also append the name of the OS after the icon - * @param bool Whether to return or echo the result + * @param bool Whether to return or echo the result * @param bool Whether to apply skin or not * * @return string HTML with icon of the OS @@ -636,8 +636,7 @@ function ui_print_os_icon ($id_os, $name = true, $return = false, return "-"; } } - - if ($apply_skin) { + else if ($apply_skin) { if ($only_src) { $output = html_print_image("images/" . $subfolter . "/" . $icon, true, $options, true, $relative); } @@ -690,7 +689,7 @@ function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_mediu } if ($link) { - $url = $server_url . 'index.php?sec=estado&'. + $url = $server_url . 'index.php?sec=estado&'. 'sec2=operation/agentes/ver_agente&' . 'id_agente=' . $id_agent.$extra_params; @@ -710,7 +709,7 @@ function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_mediu echo $output; } -/** +/** * Formats a row from the alert table and returns an array usable in the table function * * @param array A valid (non empty) row from the alert table @@ -769,12 +768,12 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f } if ($alert['disabled']) { - $disabledHtmlStart = ''; + $disabledHtmlStart = ''; $disabledHtmlEnd = ''; $styleDisabled = "font-style: italic; color: #aaaaaa;"; } else { - $disabledHtmlStart = ''; + $disabledHtmlStart = ''; $disabledHtmlEnd = ''; $styleDisabled = ""; } @@ -802,7 +801,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f else { $img = 'images/policies.png'; - $data[$index['policy']] = '' . + $data[$index['policy']] = '' . html_print_image($img,true, array('title' => $policyInfo['name'])) . ''; } @@ -813,7 +812,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $data[$index['standby']] = ''; if (isset ($alert["standby"]) && $alert["standby"] == 1) { $data[$index['standby']] = html_print_image ('images/bell_pause.png', true, array('title' => __('Standby on'))); - } + } if (!defined('METACONSOLE')) { // Force alert execution @@ -821,7 +820,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f if ($alert["force_execution"] == 0) { $data[$index['force_execution']] = '' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'))) . ''; - } + } else { $data[$index['force_execution']] = '' . html_print_image("images/refresh.png", true) . ''; @@ -832,7 +831,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f if ($agent == 0) { $data[$index['module_name']] .= ui_print_truncate_text(isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[…]', 'font-size: 7.2pt'); - } + } else { if (defined('METACONSOLE')) { $agent_name = $alert['agent_name']; @@ -851,7 +850,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $data[$index['agent_name']] .= ui_print_agent_name ($id_agent, true, 'agent_medium', $styleDisabled . " $agent_style", false, $console_url, $url_hash, $agent_name); } else { - $data[$index['agent_name']] .= ui_print_agent_name ($id_agent, true, 'agent_medium', $styleDisabled, false, $console_url, $url_hash); + $data[$index['agent_name']] .= ui_print_agent_name ($id_agent, true, 'agent_medium', $styleDisabled, false, $console_url, $url_hash); } } @@ -932,7 +931,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f } /** - * Prints a substracted string, length specified by cutoff, the full string will be in a rollover. + * Prints a substracted string, length specified by cutoff, the full string will be in a rollover. * * @param string The string to be cut * @param int At how much characters to cut @@ -1050,7 +1049,7 @@ function ui_print_alert_template_example ($id_alert_template, $return = false, $ * * @param string Id of the help article * @param bool Whether to return or output the result - * @param string Home url if its necessary + * @param string Home url if its necessary * @param string Image path * * @return string The help tip @@ -1063,7 +1062,7 @@ function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = $home_url = "../../" . $home_url; } - $output = html_print_image ($image, true, + $output = html_print_image ($image, true, array ("class" => "img_help", "title" => __('Help'), "onclick" => "open_help ('" . $help_id . "','" . $home_url . "')")); @@ -1257,7 +1256,7 @@ function ui_require_jquery_file ($name, $path = 'include/javascript/', $echo_tag * @param string Callback will fill this with the current buffer. * @param bitfield Callback will fill this with a bitfield (see ob_start) * - * @return string String to return to the browser + * @return string String to return to the browser */ function ui_process_page_head ($string, $bitfield) { global $config; @@ -1286,7 +1285,7 @@ function ui_process_page_head ($string, $bitfield) { $_GET['sec2'] == 'enterprise/dashboard/main_dashboard') { $query = ui_get_url_refresh (false, false); - $output .= ''; } @@ -1357,7 +1356,7 @@ function ui_process_page_head ($string, $bitfield) { $exists_css = false; if ($login_ok and $isFunctionSkins !== ENTERPRISE_NOT_HOOK) { - //Checks if user's skin is available + //Checks if user's skin is available $exists_skin = enterprise_hook('skins_is_path_set'); if ($exists_skin) { $skin_path = enterprise_hook('skins_get_skin_path'); @@ -1369,15 +1368,15 @@ function ui_process_page_head ($string, $bitfield) { if ($exists_css) { foreach ($skin_styles as $filename => $name) { $style = substr ($filename, 0, strlen ($filename) - 4); - $config['css'][$style] = $skin_path . 'include/styles/' . $filename; + $config['css'][$style] = $skin_path . 'include/styles/' . $filename; } - } + } //Otherwise assign default and user's css else { //User style should go last so it can rewrite common styles $config['css'] = array_merge (array ( - "common" => "include/styles/common.css", - "menu" => "include/styles/menu.css", + "common" => "include/styles/common.css", + "menu" => "include/styles/menu.css", $config['style'] => "include/styles/" . $config['style'] . ".css"), $config['css']); } @@ -1552,7 +1551,7 @@ function ui_process_page_body ($string, $bitfield) { return $output; } -/** +/** * Prints a pagination menu to browse into a collection of data. * * @param int $count Number of elements in the collection. @@ -1562,7 +1561,7 @@ function ui_process_page_body ($string, $bitfield) { * taken from $_REQUEST['offset'] * @param int $pagination Current pagination size. If a user requests a larger * pagination than config["block_size"] - * @param bool $return Whether to return or print this + * @param bool $return Whether to return or print this * @param string $offset_name The name of parameter for the offset. * @param bool $print_total_items Show the text with the total items. By default true. * @@ -1596,8 +1595,8 @@ function ui_pagination ($count, $url = false, $offset = 0, /* URL passed render links with some parameter &offset - Offset records passed to next page - &counter - Number of items to be blocked - Pagination needs $url to build the base URL to render links, its a base url, like + &counter - Number of items to be blocked + Pagination needs $url to build the base URL to render links, its a base url, like " http://pandora/index.php?sec=godmode&sec2=godmode/admin_access_logs " */ $block_limit = PAGINATION_BLOCKS_LIMIT; // Visualize only $block_limit blocks @@ -1793,7 +1792,7 @@ function ui_pagination ($count, $url = false, $offset = 0, return $output; } -/** +/** * Prints only a tip button which shows a text when the user puts the mouse over it. * * @param string Complete text to show in the tip @@ -1804,8 +1803,8 @@ function ui_pagination ($count, $url = false, $offset = 0, */ function ui_print_session_action_icon ($action, $return = false) { $key_icon = array( - 'acl' => 'images/delete.png', - 'agent' => 'images/agent.png', + 'acl' => 'images/delete.png', + 'agent' => 'images/agent.png', 'module' => 'images/module.png', 'alert' => 'images/bell.png', 'incident' => 'images/default_list.png', @@ -1831,7 +1830,7 @@ function ui_print_session_action_icon ($action, $return = false) { $output = ''; foreach($key_icon as $key => $icon) { if (stristr($action, $key) !== false) { - $output = html_print_image($icon, true, array('title' => $action)) . ' '; + $output = html_print_image($icon, true, array('title' => $action)) . ' '; break; } } @@ -1841,7 +1840,7 @@ function ui_print_session_action_icon ($action, $return = false) { echo $output; } -/** +/** * Prints only a tip button which shows a text when the user puts the mouse over it. * * @param string Complete text to show in the tip @@ -1889,7 +1888,7 @@ function ui_debug ($var, $backtrace = true) { foreach ($traces as $trace) { $trace_id++; - /* Many classes are used to allow better customization. + /* Many classes are used to allow better customization. Please, do not remove them */ echo '
  • '; if (isset ($trace['class'])) @@ -1947,7 +1946,7 @@ function ui_print_moduletype_icon ($id_moduletype, $return = false, $relative = $type = db_get_row ("ttipo_modulo", "id_tipo", (int) $id_moduletype, array ("descripcion", "icon")); if ($type === false) { $type = array (); - $type["descripcion"] = __('Unknown type'); + $type["descripcion"] = __('Unknown type'); $type["icon"] = 'b_down.png'; } $imagepath = 'images/'.$type["icon"]; @@ -1987,7 +1986,7 @@ function ui_print_module_warn_value ($max_warning, $min_warning, $str_warning, $ } else { $data .= __("N/A"); - } + } $data .= " - "; @@ -2032,7 +2031,7 @@ function ui_get_status_images_path () { $imageset = $config["status_images_set"]; - if (strpos ($imageset, ",") === false) + if (strpos ($imageset, ",") === false) $imageset .= ",40x18"; list ($imageset, $sizes) = preg_split ("/\,/", $imageset); @@ -2049,7 +2048,7 @@ function ui_get_status_images_path () { * Prints an image representing a status. * * @param string - * @param string + * @param string * @param bool Whether to return an output string or echo now (optional, echo by default). * @param array options to set image attributes: I.E.: style * @param Path of the image, if not provided use the status path @@ -2158,7 +2157,7 @@ function ui_toggle($code, $name, $title = '', $hidden_default = true, $return = function ui_get_url_refresh ($params = false, $relative = true, $add_post = true) { // Agent selection filters and refresh global $config; - + // slerena, 8/Ene/2015 - Need to put index.php on URL which have it. if (strpos($_SERVER['REQUEST_URI'], 'index.php') === false) $url = ''; @@ -2381,7 +2380,7 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal * @param boolean Return (false will print using a echo) * @param boolean help (Help ID to print the Help link) * @param boolean Godmode (false = operation mode). - * @param string Options (HTML code for make tabs or just a brief info string + * @param string Options (HTML code for make tabs or just a brief info string * @return string Header HTML */ @@ -2399,7 +2398,7 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $type = "view"; $type2 = "menu_tab_frame_view"; $separator_class = "separator"; - } + } else { $type = "view"; $type2 = "menu_tab_frame_view"; @@ -2411,7 +2410,7 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "", $buffer .= '
    •  ' . '  '; - $buffer .= '' . + $buffer .= '' . ui_print_truncate_text($title, 38); if ($help != "") $buffer .= "
      " . @@ -2627,7 +2626,7 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "", * * - $parameters['javascript_function_action_after_select_js_call'] The * call of this function to call after user select a agent into the - * list in the autocomplete field. Instead the + * list in the autocomplete field. Instead the * $parameters['javascript_function_action_after_select'], this is * overwrite the previous element. And this is necesary when you need * to set some params in your custom function. @@ -3214,7 +3213,7 @@ function ui_print_agent_autocomplete_input($parameters) { server_id = ui.item.id_server; } - + //Put the name $(this).val(agent_name); @@ -3535,7 +3534,7 @@ function ui_get_error ($error_code) { case 'error_dbconfig': $title = __('Problem with Pandora FMS database'); $message = __('Cannot connect to the database, please check your database setup in the include/config.php file.

      - Probably your database, hostname, user or password values are incorrect or + Probably your database, hostname, user or password values are incorrect or the database server is not running.').'

      '; $message .= ''; $message .= '' . __('DB ERROR') . ':
      '; @@ -3577,9 +3576,9 @@ function ui_get_error ($error_code) { break; case 'error_perms': $title = __('Bad permission for include/config.php'); - $message = __('For security reasons, config.php must have restrictive permissions, and "other" users - should not read it or write to it. It should be written only for owner - (usually www-data or http daemon user), normal operation is not possible until you change + $message = __('For security reasons, config.php must have restrictive permissions, and "other" users + should not read it or write to it. It should be written only for owner + (usually www-data or http daemon user), normal operation is not possible until you change permissions for include/config.php file. Please do it, it is for your security.'); break; } @@ -3700,4 +3699,4 @@ function ui_print_module_string_value($value, $id_agente_module, return $salida; } -?> +?> \ No newline at end of file From 11623b5c9253f9dab3af18251d6b635a7dfa65c8 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 30 Mar 2016 14:55:57 +0200 Subject: [PATCH 05/54] Fixed checks in availability reports TICKETS #3449 --- pandora_console/include/functions_modules.php | 78 +++++++++++++++++++ .../include/functions_reporting.php | 14 ++-- 2 files changed, 86 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index a729a043c7..71c277350c 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -2240,4 +2240,82 @@ function modules_get_first_contact_date($id_agent_module) { return $first_date; } + +/** + * Get the unknown time status of a module in a period. + * If there is more than 1 days between data, there is some unknown time modules + * + * @param int id_agent_module. + * @param int ending interval timestamp + * @param int interval duration + * + * @return int unknown seconds. + */ +function modules_get_unknown_time ($id_agent_module, $date, $period){ + + // TODO REMOVE THE TIME IN PLANNED DOWNTIME + + if (empty($id_agent_module) || empty($date)) + return false; + + // Set initial conditions + $unknown_seconds = 0; + $datelimit = $date - $period; + $search_in_history_db = db_search_in_history_db($datelimit); + + // Get interval data + $sql = sprintf ('SELECT utimestamp + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp > %d AND utimestamp <= %d', + $id_agent_module, $datelimit, $date); + $sql .= ' ORDER BY utimestamp ASC'; + $interval_data = db_get_all_rows_sql ($sql, $search_in_history_db); + + $previous_data = modules_get_previous_data ($id_agent_module, $datelimit); + + // All alternatives on first data + if ($previous_data === false && $interval_data === false) { + return false; + } else if($previous_data !== false && $interval_data === false) { + if (($date - $previous_data['utimestamp']) <= SECONDS_1DAY) { + return 0; + } + if (($previous_data['utimestamp'] + SECONDS_1DAY) >= $datelimit) { + return $date - ($previous_data['utimestamp'] + SECONDS_1DAY); + } else { + return $period; + } + } else if ($previous_data === false && $interval_data !== false) { + $first_data = array_shift ($interval_data); + $unknown_seconds += $first_data['utimestamp'] - $datelimit; + array_unshift ($interval_data, $first_data); + } else { + $first_data = array_shift ($interval_data); + if (($previous_data['utimestamp'] + SECONDS_1DAY) >= $first_data['utimestamp']) { + if (($previous_data['utimestamp'] + SECONDS_1DAY) >= $datelimit) { + $unknown_seconds += $previous_data['utimestamp'] + SECONDS_1DAY - $first_data['utimestamp']; + } else { + $unknown_seconds += $first_data['utimestamp'] - $datetime; + } + } + array_unshift ($interval_data, $first_data); + } + + // Put utimestamp like last data + $last_data['utimestamp'] = $date; + array_push ($interval_data, $last_data); + $previous_data = array_shift ($previous_data); + + // Check if all datas have data maximum one day before + foreach ($interval_data as $data) { + $previous_1day = $previous_data['utimestamp'] + SECONDS_1DAY; + if ($previous_1day >= $data['utimestamp']) { + $unknown_period += $previous_1day - $data['utimestamp']; + } + $previous_data = $data; + } + + return $unknown_seconds; +} ?> diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a89347801d..b6b0136a07 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3859,11 +3859,11 @@ function reporting_availability($report, $content) { $content['time_from'], $content['time_to']); - $count_checks = modules_get_count_datas( - $item['id_agent_module'], - $report["datetime"] - $content['period'], - $report["datetime"]); - + $item['interval_agent_module'] = modules_get_interval ($item['id_agent_module']); + $unknown_seconds = modules_get_unknown_time ($item['id_agent_module'], $report["datetime"], $content['period']); + if ($unknown_seconds !== false) { + $count_checks = (int)(($content['period'] - $unknown_seconds)/$item['interval_agent_module']); + } if ($sla_value === false) { $row['checks'] = __('Unknown'); @@ -3887,11 +3887,13 @@ function reporting_availability($report, $content) { $row['failed'] = format_numeric($percent_fail * $count_checks / 100, 0); - + $row['poling_time'] = "-"; + if ($percent_ok > 0) { $row['poling_time'] = human_time_description_raw( ($percent_ok * $count_checks / 100) * modules_get_interval($item['id_agent_module']), true); + } $row['time_unavaliable'] = "-"; if ($percent_fail > 0) { From 3ebfa6ae46285940b2b910e0cac942c0cbe75257 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 31 Mar 2016 00:01:44 +0200 Subject: [PATCH 06/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e3e9e6ddfe..ebd7806cb0 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160330 +Version: 6.1dev-160331 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 3ecc00536a..186d6bf6f1 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160330" +pandora_version="6.1dev-160331" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f6ffbe0dd8..0917ce2a6e 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160330'; +use constant AGENT_BUILD => '160331'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 4cb802a22e..e4e18ff8a9 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160330 +%define release 160331 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a949f3fcd5..008a409573 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160330 +%define release 160331 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ca6858e55f..ab49646a1c 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160330" +PI_BUILD="160331" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2fee1ea6c9..7f1c1e09a0 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160330} +{160331} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0e47e0252c..359f703cf6 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160330)") +#define PANDORA_VERSION ("6.1dev(Build 160331)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 60a638bf9d..b44c5f7d06 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160330))" + VALUE "ProductVersion", "(6.1dev(Build 160331))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 79cfe81c6d..a9fb931ee0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160330 +Version: 6.1dev-160331 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 3c51153d93..5514c5950d 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160330" +pandora_version="6.1dev-160331" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7b301decf0..d7d10d893c 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160330'; +$build_version = 'PC160331'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e448a26dba..ce269ac122 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
      Date: Thu, 31 Mar 2016 12:59:12 +0200 Subject: [PATCH 07/54] Update Dockerfile Added SSH client --- extras/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/Dockerfile b/extras/Dockerfile index 70c172095c..fcd39254fb 100644 --- a/extras/Dockerfile +++ b/extras/Dockerfile @@ -10,7 +10,7 @@ RUN mkdir /docker-entrypoint-initdb.d # File::Copy # Sys::Hostname # Data::Dumper -RUN apt-get update && apt-get install -y perl pwgen git --no-install-recommends && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y perl pwgen git openssh-client --no-install-recommends && rm -rf /var/lib/apt/lists/* # gpg: key 5072E1F5: public key "MySQL Release Engineering " imported RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 From c861aa908a16c06583e1c87c23265516c2712e4d Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 31 Mar 2016 13:55:30 +0200 Subject: [PATCH 08/54] Added contact information to README.md. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2d3384cfb2..f32881f8c1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ Pandora FMS is a monitoring software for IT infrastructure management which includes network equipment, Windows and Unix servers, virtual infrastructure and all different kind of applications. It has a large amount of features, making it a new generation software which discovers all the monitoring issues that an organization may need. 
      +For community support you can visit our forums at http://forums.pandorafms.org. Visit our community page at http://pandorafms.org and if you need commercial information or/and professional support visit http://pandorafms.com. +

      ###How to install Pandora FMS From 63cdcb1288538ec313b306990d5facd7b00c5ebf Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 1 Apr 2016 00:01:19 +0200 Subject: [PATCH 09/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ebd7806cb0..d919a5d384 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160331 +Version: 6.1dev-160401 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 186d6bf6f1..93c2d6c825 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160331" +pandora_version="6.1dev-160401" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 0917ce2a6e..552a966122 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160331'; +use constant AGENT_BUILD => '160401'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index e4e18ff8a9..27657b2314 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160331 +%define release 160401 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 008a409573..3bb03f256d 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160331 +%define release 160401 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ab49646a1c..ce0e221438 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160331" +PI_BUILD="160401" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7f1c1e09a0..368aef3edf 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160331} +{160401} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 359f703cf6..b625ccb347 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160331)") +#define PANDORA_VERSION ("6.1dev(Build 160401)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b44c5f7d06..e8c8fc2dfb 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160331))" + VALUE "ProductVersion", "(6.1dev(Build 160401))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a9fb931ee0..2f08155e70 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160331 +Version: 6.1dev-160401 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 5514c5950d..777ebffd23 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160331" +pandora_version="6.1dev-160401" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d7d10d893c..e60c3241cb 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160331'; +$build_version = 'PC160401'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index ce269ac122..830e2976c2 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
      Date: Fri, 1 Apr 2016 12:46:47 +0900 Subject: [PATCH 10/54] Changed column type of 'tagente_estado.status_changes' to unsigned. (Fixed ff_threshold evaluation.) Because of column type difference bettween 'tagente_estado.status_changes' and 'tagente_modulo.min_ff_event', it didn't work correctly with over 127. --- .../extras/pandoradb_migrate_6.0_to_6.1.mysql.sql | 6 ++++++ pandora_console/pandoradb.sql | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql index 831efe6859..3fd09188fa 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql @@ -9,3 +9,9 @@ ALTER TABLE talert_templates ADD COLUMN `min_alerts_reset_counter` tinyint(1) DE -- ---------------------------------------------------------------------- ALTER TABLE tserver ADD COLUMN `server_keepalive` int(11) DEFAULT 0; + +-- ---------------------------------------------------------------------- +-- Table `tagente_estado` +-- ---------------------------------------------------------------------- + +ALTER TABLE tagente_estado MODIFY `status_changes` tinyint(4) unsigned default 0; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 125185cf84..9112659467 100755 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -150,7 +150,7 @@ CREATE TABLE IF NOT EXISTS `tagente_estado` ( `current_interval` int(8) unsigned NOT NULL default '0', `running_by` smallint(4) unsigned default '0', `last_execution_try` bigint(20) NOT NULL default '0', - `status_changes` tinyint(4) default 0, + `status_changes` tinyint(4) unsigned default 0, `last_status` tinyint(4) default 0, `last_known_status` tinyint(4) default 0, `last_error` int(4) NOT NULL default '0', From d9600bb10ea32d9b907de2b7b485d17671d3e1cf Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Fri, 1 Apr 2016 09:59:06 +0200 Subject: [PATCH 11/54] Fixed problems with kill procesess with tentacle. Tiquet: #3487 --- pandora_server/util/tentacle_serverd | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pandora_server/util/tentacle_serverd b/pandora_server/util/tentacle_serverd index 9462f4c6a0..b3f84a9349 100755 --- a/pandora_server/util/tentacle_serverd +++ b/pandora_server/util/tentacle_serverd @@ -24,6 +24,12 @@ # Description: Tentacle Server startup script ### END INIT INFO +# Uses a wait limit before sending a KILL signal, before trying to stop +# Pandora FMS server nicely. Some big systems need some time before close +# all pending tasks / threads. + +export MAXWAIT=60 + # Check for SUSE status scripts if [ -f /etc/rc.status ] then @@ -126,14 +132,23 @@ case "$1" in rc_exit # running stop on a service already stopped or not running else kill $TENTACLE_PID - sleep 1 - _PID=`get_all_pid` + + while [ $COUNTER -lt $MAXWAIT ] + do + _PID=`get_all_pid` + if [ "$_PID" != "$SATELLITE_PID" ] + then + COUNTER=$MAXWAIT + fi + COUNTER=`expr $COUNTER + 1` + sleep 1 + done - if [ "$_PID" = "$TENTACLE_PID" ]; then - echo "Tentacle Server could not be stopped" - rc_failed + if [ "$_PID" = "$TENTACLE_PID" ] + then + kill -9 $TENTACLE_PID > /dev/null 2>&1 fi - + echo "Stopping Tentacle Server" rc_status -v fi From 7e52e0e4e6f78d079f9967fda2b11dcc7c12138b Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 2 Apr 2016 00:01:25 +0200 Subject: [PATCH 12/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d919a5d384..25f9a38f81 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160401 +Version: 6.1dev-160402 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 93c2d6c825..e979436ee2 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160401" +pandora_version="6.1dev-160402" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 552a966122..7243d9db42 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160401'; +use constant AGENT_BUILD => '160402'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 27657b2314..e88349cd93 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160401 +%define release 160402 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3bb03f256d..b4200b0d37 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160401 +%define release 160402 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ce0e221438..07729b8a7e 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160401" +PI_BUILD="160402" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 368aef3edf..f8817ed443 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160401} +{160402} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b625ccb347..8959e9fe1a 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160401)") +#define PANDORA_VERSION ("6.1dev(Build 160402)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e8c8fc2dfb..8f00eb567b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160401))" + VALUE "ProductVersion", "(6.1dev(Build 160402))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2f08155e70..fba5df23c6 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160401 +Version: 6.1dev-160402 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 777ebffd23..fe6ade5501 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160401" +pandora_version="6.1dev-160402" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e60c3241cb..3061ff7f27 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160401'; +$build_version = 'PC160402'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 830e2976c2..f6531d9063 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
      Date: Sun, 3 Apr 2016 00:01:12 +0200 Subject: [PATCH 13/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 25f9a38f81..8c575eb3f6 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160402 +Version: 6.1dev-160403 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index e979436ee2..c053640d3a 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160402" +pandora_version="6.1dev-160403" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 7243d9db42..003d64ff55 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160402'; +use constant AGENT_BUILD => '160403'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index e88349cd93..19ae36e2ba 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160402 +%define release 160403 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index b4200b0d37..f17b8cff1c 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160402 +%define release 160403 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 07729b8a7e..ece83fe5c5 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160402" +PI_BUILD="160403" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index f8817ed443..02b4203501 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160402} +{160403} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 8959e9fe1a..168f828d8c 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160402)") +#define PANDORA_VERSION ("6.1dev(Build 160403)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 8f00eb567b..f452d84388 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160402))" + VALUE "ProductVersion", "(6.1dev(Build 160403))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index fba5df23c6..de7c9f038d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160402 +Version: 6.1dev-160403 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index fe6ade5501..a6948c889f 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160402" +pandora_version="6.1dev-160403" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3061ff7f27..e29478be8a 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160402'; +$build_version = 'PC160403'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f6531d9063..9d1b86be63 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
      Date: Mon, 4 Apr 2016 00:01:12 +0200 Subject: [PATCH 14/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8c575eb3f6..bfbbebba7e 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160403 +Version: 6.1dev-160404 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index c053640d3a..b61927cd9d 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160403" +pandora_version="6.1dev-160404" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 003d64ff55..49cdb9f1a6 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160403'; +use constant AGENT_BUILD => '160404'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 19ae36e2ba..c5f50a0c9b 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160403 +%define release 160404 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index f17b8cff1c..8bfb6eccf0 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160403 +%define release 160404 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index ece83fe5c5..2ebb485a6a 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160403" +PI_BUILD="160404" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 02b4203501..c260215145 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160403} +{160404} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 168f828d8c..44535f03c9 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160403)") +#define PANDORA_VERSION ("6.1dev(Build 160404)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f452d84388..f23fb32f5b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160403))" + VALUE "ProductVersion", "(6.1dev(Build 160404))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index de7c9f038d..0c3de5a19b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160403 +Version: 6.1dev-160404 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index a6948c889f..1cc28be48c 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160403" +pandora_version="6.1dev-160404" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e29478be8a..8d9456e8b7 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160403'; +$build_version = 'PC160404'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9d1b86be63..87d1775152 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
      Date: Mon, 4 Apr 2016 15:43:51 +0900 Subject: [PATCH 15/54] Fix reporting format for exportdata - for 'data', timestamp should be timestamp of data - for 'avg', timestamp should be averaging period --- pandora_console/operation/agentes/exportdata.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index 5a9fdc7369..7c16ac5623 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -124,7 +124,7 @@ if (!empty ($export_btn) && !empty ($module)) { } $work_end = $end - $period + $work_period; - $work_start = $end - $work_period; + $work_start = $work_end - $work_period; //Buffer to get data, anyway this will report a memory exhaustin $flag_last_time_slice = false; @@ -166,7 +166,14 @@ if (!empty ($export_btn) && !empty ($module)) { $output .= $divider; $output .= $module['data']; $output .= $divider; - $output .= date ("Y-m-d G:i:s", $work_start ) . ' - ' . date ("Y-m-d G:i:s", $module['utimestamp']); + switch($export_type) { + case "data": + $output .= date("Y-m-d G:i:s", $module['utimestamp']); + break; + case "avg": + $output .= date ("Y-m-d G:i:s", $work_start) . ' - ' . date ("Y-m-d G:i:s", $work_end); + break; + } $output .= $rowend; } @@ -196,6 +203,7 @@ if (!empty ($export_btn) && !empty ($module)) { else { $work_end = $work_end + $work_period; } + $work_start = $work_end - $work_period; } unset ($output); $output = ""; From d4ebe9761cabde7ccfed411a8fecbf47f2ba6cff Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 4 Apr 2016 09:06:21 +0200 Subject: [PATCH 16/54] Fixed output of two CLI funtions. Tiquet: #3510 --- pandora_server/util/pandora_manage.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 4add9a615d..d8ff260b19 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -3209,6 +3209,7 @@ sub cli_get_agent_group() { my $id_group = get_agent_group ($dbh_metaconsole, $id_agent); my $group_name = get_group_name ($dbh_metaconsole, $id_group); my $metaconsole_name = enterprise_hook('get_metaconsole_setup_server_name',[$dbh, $server]); + $agent_name = safe_output($agent_name); print "[INFO] Server: $metaconsole_name Agent: $agent_name Name Group: $group_name\n\n"; } } @@ -3257,6 +3258,7 @@ sub cli_get_agent_group_id() { } else { my $id_group = get_agent_group ($dbh_metaconsole, $id_agent); + $agent_name = safe_output($agent_name); print "Server: $metaconsole_name Agent: $agent_name ID Group: $id_group\n\n"; } } From 1bb1344530d4601448543d3118a8970dcc7cbcb3 Mon Sep 17 00:00:00 2001 From: Akihiro Uchida Date: Mon, 4 Apr 2016 16:15:39 +0900 Subject: [PATCH 17/54] Evade zero division PHP Warning due to float overflow by factor --- pandora_console/include/graphs/pChart/pDraw.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/graphs/pChart/pDraw.class.php b/pandora_console/include/graphs/pChart/pDraw.class.php index 814f4ec824..300d2f49ba 100755 --- a/pandora_console/include/graphs/pChart/pDraw.class.php +++ b/pandora_console/include/graphs/pChart/pDraw.class.php @@ -2556,6 +2556,7 @@ if (floor($Value2) == 0) { return(0); } if (is_infinite($Value2)) { return(0); } if ($Value2 == 0.0) { return(0); } + if ($Value1 > $Value2) { return(0); } if ($this->mod_check($Value1, $Value2)) { return(0); } if (floor($Value2) != 0) { return($Value1 % $Value2); } From 5756d7281ebf45d99060fc6106b99d08de2fc2b5 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 4 Apr 2016 10:06:34 +0200 Subject: [PATCH 18/54] Substituted lines for intervals in modules graphs TICKETS #3392 --- pandora_console/include/functions_graph.php | 2 +- pandora_console/include/graphs/fgraph.php | 14 +- .../include/graphs/flot/pandora.flot.js | 182 ++++++++++++++---- .../include/graphs/functions_flot.php | 38 +++- 4 files changed, 185 insertions(+), 51 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f6402da5e5..bf08732ef2 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -893,7 +893,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $config['font_size'], $unit, $ttl, $series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false, $series_suffix_str, $menu, - $backgroundColor, $dashboard, $vconsole); + $backgroundColor, $dashboard, $vconsole, $agent_module_id); } } elseif ($config['type_module_charts'] === 'line') { diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 12b249d036..c026abb795 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -218,7 +218,7 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key = '', $force_integer = false, $series_suffix_str = '', $menu = true, $backgroundColor = 'white', - $dashboard = false, $vconsole = false) { + $dashboard = false, $vconsole = false, $agent_module_id = 0) { setup_watermark($water_mark, $water_mark_file, $water_mark_url); @@ -257,7 +257,9 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $series_suffix_str, $menu, $backgroundColor, - $dashboard); + $dashboard, + false, + $agent_module_id); } else { if ($vconsole) { @@ -281,7 +283,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $menu, $backgroundColor, $dashboard, - $vconsole); + $vconsole, + $agent_module_id); } else { $graph = array(); @@ -316,7 +319,7 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white', - $dashboard = false, $vconsole = false) { + $dashboard = false, $vconsole = false, $agent_module_id) { setup_watermark($water_mark, $water_mark_file, $water_mark_url); @@ -368,7 +371,8 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, true, $backgroundColor, $dashboard, - $vconsole); + $vconsole, + $agent_module_id); } else { //Stack the data diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 45283b24a2..02b41961f3 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -804,7 +804,9 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, colors, type, serie_types, water_mark, width, max_x, homeurl, unit, font_size, menu, events, event_ids, legend_events, alerts, alert_ids, legend_alerts, yellow_threshold, red_threshold, - force_integer, separator, separator2, series_suffix_str, vconsole) { + force_integer, separator, separator2, + yellow_up, red_up, yellow_inverse, red_inverse, + series_suffix_str, vconsole) { var threshold = true; var thresholded = false; @@ -861,14 +863,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, for (i = 0; i < values.length; i++) { var serie = values[i].split(separator); var aux = new Array(); - var critical_min = new Array(); - var warning_min = new Array(); $.each(serie, function(i, v) { aux.push([i, v]); - if (threshold) { - critical_min.push([i,red_threshold]); - warning_min.push([i,yellow_threshold]); - } }); switch (serie_types[i]) { @@ -961,21 +957,77 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, var threshold_data = new Array(); if (threshold) { - // Warning and critical treshold - threshold_data.push({ - id: 'critical_min', - data: critical_min, - label: null, - color: critical, - lines: { show: true, fill: false, lineWidth:3} - }); - threshold_data.push({ - id: 'warning_min', - data: warning_min, - label: null, - color: warning, - lines: { show: true, fill: false, lineWidth:3} - }); + // Warning interval + if (yellow_inverse) { + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, 0]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + } else { + if (yellow_up == 0) { + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + } else { + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} + }); + } + } + // Critical interval + if (red_inverse) { + threshold_data.push({ // barWidth will be correct on draw time + id: 'critical_up', + data: [[max_x, red_up]], + label: null, + color: critical, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + threshold_data.push({ // barWidth will be correct on draw time + id: 'critical_down', + data: [[max_x, 0]], + label: null, + color: critical, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + } else { + if (red_up == 0) { + threshold_data.push({ // barWidth will be correct on draw time + id: 'critical_up', + data: [[max_x, red_threshold]], + label: null, + color: critical, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + } else { + threshold_data.push({ + id: 'critical_normal', + data: [[max_x, red_threshold]], + label: null, + color: critical, + bars: {show: true, align: "left", barWidth: (red_up - red_threshold), lineWidth: 0, horizontal: true} + }); + } + } + } // The first execution, the graph data is the base data @@ -1082,7 +1134,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, new_steps = parseInt(factor * steps); - plot = $.plot($('#' + graph_id), datas, + plot = $.plot($('#' + graph_id), data_base, $.extend(true, {}, options, { xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to}, xaxes: [ { @@ -1092,6 +1144,15 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, } ], legend: { show: false } })); + if (thresholded) { + var zoom_data_threshold = new Array (); + + zoom_data_threshold = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, + yellow_threshold, red_threshold, yellow_up, red_up); + plot.setData(zoom_data_threshold); + plot.draw(); + } + $('#menu_cancelzoom_' + graph_id) .attr('src', homeurl + '/images/zoom_cross_grey.png'); @@ -1535,23 +1596,22 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, datas = new Array(); if (thresholded) { - thresholded = false; - } - else { - $.each(threshold_data, function() { - datas.push(this); + $.each(data_base, function() { + // Prepared to turning series + //if(showed[this.id.split('_')[1]]) { + datas.push(this); + //} }); + thresholded = false; + } else { + //pocoyo + datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, + yellow_threshold, red_threshold, yellow_up, red_up); thresholded = true; } - $.each(data_base, function() { - // Prepared to turning series - //if(showed[this.id.split('_')[1]]) { - datas.push(this); - //} - }); - - plot = $.plot($('#' + graph_id), datas, options); + plot.setData(datas); + plot.draw(); plot.setSelection(currentRanges); }); @@ -1568,6 +1628,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, .attr('src', homeurl + '/images/zoom_cross.disabled.png'); overview.clearSelection(); currentRanges = null; + + thresholded = false; }); // Adjust the menu image on top of the plot @@ -1735,3 +1797,51 @@ function number_format(number, force_integer, unit) { return number + ' ' + shorts[pos] + unit; } +function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshold, + red_threshold, yellow_up, red_up) { + + var datas = new Array (); + + $.each(data_base, function() { + // Prepared to turning series + //if(showed[this.id.split('_')[1]]) { + datas.push(this); + //} + }); + + // Resize the warning and critical interval + $.each(threshold_data, function() { + if (/_up/.test(this.id)){ + this.bars.barWidth = y_max - this.data[0][1]; + } + if (/_down/.test(this.id)){ + var end; + if (/critical/.test(this.id)) { + end = red_threshold; + } else { + end = yellow_threshold; + } + this.bars.barWidth = end - y_min; + this.data[0][1] = y_min; + } + if (/_normal/.test(this.id)){ + var end; + if (/critical/.test(this.id)) { + end = red_up; + } else { + end = yellow_up; + } + if (this.data[0][1] < y_min) { + this.bars.barWidth = end - y_min; + this.data[0][1] = y_min; + end = this.bars.barWidth + this.data[0][1]; + } + if (end > y_max) { + this.bars.barWidth = y_max - this.data[0][1]; + } + } + datas.push(this); + }); + + return datas; +} diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index b3dbb11096..f618aba3b9 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -94,7 +94,7 @@ function flot_area_stacked_graph($chart_data, $width, $height, $color, $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false) { + $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { global $config; @@ -102,7 +102,7 @@ function flot_area_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, - $menu, $background_color, $dashboard, $vconsole); + $menu, $background_color, $dashboard, $vconsole, $agent_module_id); } function flot_area_simple_graph($chart_data, $width, $height, $color, @@ -110,7 +110,7 @@ function flot_area_simple_graph($chart_data, $width, $height, $color, $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false) { + $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { global $config; @@ -118,7 +118,7 @@ function flot_area_simple_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'area_simple', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, - $menu, $background_color, $dashboard, $vconsole); + $menu, $background_color, $dashboard, $vconsole, $agent_module_id); } function flot_line_stacked_graph($chart_data, $width, $height, $color, @@ -126,7 +126,7 @@ function flot_line_stacked_graph($chart_data, $width, $height, $color, $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false) { + $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { global $config; @@ -134,7 +134,7 @@ function flot_line_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, 'line_stacked', $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str, - $menu, $background_color, $dashboard, $vconsole); + $menu, $background_color, $dashboard, $vconsole, $agent_module_id); } function flot_line_simple_graph($chart_data, $width, $height, $color, @@ -142,7 +142,7 @@ function flot_line_simple_graph($chart_data, $width, $height, $color, $serie_types = array(), $chart_extra_data = array(), $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $force_integer = false, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false) { + $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { global $config; @@ -157,7 +157,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $type, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $force_integer, $series_suffix_str = '', $menu = true, - $background_color = 'white', $dashboard = false, $vconsole = false) { + $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { global $config; @@ -189,9 +189,25 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, $return = "
      "; // Set some containers to legend, graph, timestamp tooltip, etc. $return .= "

      "; + + + // Get other required module datas to draw warning and critical + if ($agent_module_id == 0) { + $yellow_up = 0; + $red_up = 0; + $yellow_inverse = false; + $red_inverse = false; + } else { + $module_data = db_get_row_sql ('SELECT * FROM tagente_modulo WHERE id_agente_modulo = ' . $agent_module_id); + $yellow_up = $module_data['max_warning']; + $red_up = $module_data['max_critical']; + $yellow_inverse = !($module_data['warning_inverse'] == 0); + $red_inverse = !($module_data['critical_inverse'] == 0); + } + if ($menu) { $threshold = false; - if ($yellow_threshold != 0 || $red_threshold != 0) { + if ($yellow_threshold != $yellow_up || $red_threshold != $red_up) { $threshold = true; } @@ -426,6 +442,10 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, "$force_integer, \n" . "'$separator', \n" . "'$separator2', \n" . + "'$yellow_up', \n" . + "'$red_up', \n" . + "'$yellow_inverse', \n" . + "'$red_inverse', \n" . "'$series_suffix_str', '$vconsole');"; $return .= "\n//]]>"; From 57190faf76ba75db147f9f4d5348e28ed3c3b894 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 4 Apr 2016 12:14:57 +0200 Subject: [PATCH 19/54] Fixed sql fail in snmp console TICKETS #3504 --- pandora_console/operation/snmpconsole/snmp_view.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index a8f9310390..096853ea47 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -201,6 +201,14 @@ switch ($config["dbtype"]) { break; } +if (empty ($address_by_user_groups)) { + $address_by_user_groups = array (); + array_unshift ($address_by_user_groups, "\"\""); +} +if (empty ($all_address_agents)) { + $all_address_agents = array (); + array_unshift ($all_address_agents, "\"\""); +} //Make query to extract traps of DB. switch ($config["dbtype"]) { From 5d650ef45d4d60da945356ac9ac739305cb123a9 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 4 Apr 2016 12:21:15 +0200 Subject: [PATCH 20/54] Fixed lost tooltip (about quiet) in the form of agents. (cherry picked from commit a345dcc9eb609b4dff67d845a6b610b0301d2c74) --- pandora_console/godmode/agentes/agent_manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 01e9eccb7d..20cd96aa5c 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -391,9 +391,9 @@ $table->data[2][3] = html_print_input_text ('url_description', $url_description, '', 45, 255, true); $table->data[3][2] = __('Quiet'); -$table->data[3][3] .= ui_print_help_tip( +$table->data[3][3] = ui_print_help_tip( __('The agent still runs but the alerts and events will be stop'), true); -$table->data[3][3] = html_print_checkbox('quiet', 1, $quiet, true); +$table->data[3][3] .= html_print_checkbox('quiet', 1, $quiet, true); ui_toggle(html_print_table ($table, true), __('Advanced options')); unset($table); From baf2497d99da0f17226568bc0f1879c7726acdec Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 4 Apr 2016 13:30:47 +0200 Subject: [PATCH 21/54] Updated migrate sql script to add integria alert changes TICKETS #3091 --- .../pandoradb_migrate_5.1_to_6.0.mysql.sql | 13 +++++++++++++ .../pandoradb_migrate_5.1_to_6.0.oracle.sql | 13 +++++++++++++ .../pandoradb_migrate_5.1_to_6.0.postgreSQL.sql | 16 +++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index 9ee648599a..96d6fe5469 100644 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -58,6 +58,7 @@ ALTER TABLE `tusuario` ADD COLUMN `strict_acl` tinyint(1) DEFAULT 0; -- Table `talert_commands` -- --------------------------------------------------------------------- UPDATE `talert_commands` SET `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE `id` = 1 AND `name` = 'eMail'; +UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket'; -- --------------------------------------------------------------------- -- Table `tconfig` @@ -189,3 +190,15 @@ ALTER TABLE tgraph_source ADD COLUMN `id_server` int(11) NOT NULL default 0; -- --------------------------------------------------------------------- ALTER TABLE tevent_filter ADD COLUMN `id_agent_module` int(25) DEFAULT 0; ALTER TABLE tevent_filter ADD COLUMN `id_agent` int(25) DEFAULT 0; + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +UPDATE talert_actions SET `field4` = 'integria', + `field5` = '_agent_: _alert_name_', + `field6` = '1', + `field7` = '3', + `field8` = 'copy@dom.com', + `field9` = 'admin', + `field10` = '_alert_description_' +WHERE `id` = 4 AND `id_alert_command` = 11; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql index e6154b0af4..61dc9267fd 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql @@ -58,6 +58,7 @@ ALTER TABLE tusuario ADD COLUMN strict_acl NUMBER(5, 0) DEFAULT 0; -- Table `talert_commands` -- --------------------------------------------------------------------- UPDATE talert_commands SET fields_descriptions = '["Destination address","Subject","Text","","","","","","",""]', fields_values = '["\",\"\",\"_html_editor_\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id = 1 AND name = 'eMail'; +UPDATE talert_commands SET fields_descriptions = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', fields_values = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE id = 11 AND name = 'Integria IMS Ticket'; -- --------------------------------------------------------------------- -- Table `tconfig` @@ -131,3 +132,15 @@ ALTER TABLE tevent_filter ADD COLUMN id_agent int(25) DEFAULT 0; -- --------------------------------------------------------------------- ALTER TABLE tgraph_source ADD COLUMN label VARCHAR2(150) DEFAULT ''; ALTER TABLE tgraph_source ADD COLUMN "id_server" BIGINT NOT NULL default 0; + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +UPDATE talert_actions SET field4 = 'integria', + field5 = '_agent_: _alert_name_', + field6 = '1', + field7 = '3', + field8 = 'copy@dom.com', + field9 = 'admin', + field10 = '_alert_description_' +WHERE id = 4 AND id_alert_command = 11; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql index 2baccd29a4..23cc028679 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql @@ -56,6 +56,7 @@ ALTER TABLE "tusuario" ADD COLUMN "strict_acl" SMALLINT DEFAULT 0; -- Table `talert_commands` -- --------------------------------------------------------------------- UPDATE "talert_commands" SET "fields_descriptions" = '[\"Destination address\",\"Subject\",\"Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]', "fields_values" = '[\"\",\"\",\"_html_editor_\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE "id" = 1 AND "name" = 'eMail'; +UPDATE "talert_commands" SET "fields_descriptions" = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', "fields_values" = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE "id" = 11 AND "name" = 'Integria IMS Ticket'; -- --------------------------------------------------------------------- -- Table `tconfig` @@ -126,4 +127,17 @@ ALTER TABLE tevent_filter ADD COLUMN id_agent int(25) DEFAULT 0; -- Table `tgraph_source` -- --------------------------------------------------------------------- ALTER TABLE tgraph_source ADD COLUMN label VARCHAR2(150) DEFAULT ''; -ALTER TABLE tgraph_source ADD COLUMN id_graph NUMBER(19, 0) DEFAULT 0; \ No newline at end of file +ALTER TABLE tgraph_source ADD COLUMN id_graph NUMBER(19, 0) DEFAULT 0; + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +UPDATE "talert_actions" SET "field4" = 'integria', + "field5" = '_agent_: _alert_name_', + "field6" = '1', + "field7" = '3', + "field8" = 'copy@dom.com', + "field9" = 'admin', + "field10" = '_alert_description_' +WHERE "id" = 4 AND "id_alert_command" = 11; + From 5e848da19ab87158ebad220eb87c6d58b691be97 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 4 Apr 2016 13:51:21 +0200 Subject: [PATCH 22/54] Revert "Updated migrate sql script to add integria alert changes TICKETS #3091" This reverts commit baf2497d99da0f17226568bc0f1879c7726acdec. --- .../pandoradb_migrate_5.1_to_6.0.mysql.sql | 13 ------------- .../pandoradb_migrate_5.1_to_6.0.oracle.sql | 13 ------------- .../pandoradb_migrate_5.1_to_6.0.postgreSQL.sql | 16 +--------------- 3 files changed, 1 insertion(+), 41 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index 96d6fe5469..9ee648599a 100644 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -58,7 +58,6 @@ ALTER TABLE `tusuario` ADD COLUMN `strict_acl` tinyint(1) DEFAULT 0; -- Table `talert_commands` -- --------------------------------------------------------------------- UPDATE `talert_commands` SET `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE `id` = 1 AND `name` = 'eMail'; -UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket'; -- --------------------------------------------------------------------- -- Table `tconfig` @@ -190,15 +189,3 @@ ALTER TABLE tgraph_source ADD COLUMN `id_server` int(11) NOT NULL default 0; -- --------------------------------------------------------------------- ALTER TABLE tevent_filter ADD COLUMN `id_agent_module` int(25) DEFAULT 0; ALTER TABLE tevent_filter ADD COLUMN `id_agent` int(25) DEFAULT 0; - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -UPDATE talert_actions SET `field4` = 'integria', - `field5` = '_agent_: _alert_name_', - `field6` = '1', - `field7` = '3', - `field8` = 'copy@dom.com', - `field9` = 'admin', - `field10` = '_alert_description_' -WHERE `id` = 4 AND `id_alert_command` = 11; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql index 61dc9267fd..e6154b0af4 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql @@ -58,7 +58,6 @@ ALTER TABLE tusuario ADD COLUMN strict_acl NUMBER(5, 0) DEFAULT 0; -- Table `talert_commands` -- --------------------------------------------------------------------- UPDATE talert_commands SET fields_descriptions = '["Destination address","Subject","Text","","","","","","",""]', fields_values = '["\",\"\",\"_html_editor_\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id = 1 AND name = 'eMail'; -UPDATE talert_commands SET fields_descriptions = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', fields_values = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE id = 11 AND name = 'Integria IMS Ticket'; -- --------------------------------------------------------------------- -- Table `tconfig` @@ -132,15 +131,3 @@ ALTER TABLE tevent_filter ADD COLUMN id_agent int(25) DEFAULT 0; -- --------------------------------------------------------------------- ALTER TABLE tgraph_source ADD COLUMN label VARCHAR2(150) DEFAULT ''; ALTER TABLE tgraph_source ADD COLUMN "id_server" BIGINT NOT NULL default 0; - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -UPDATE talert_actions SET field4 = 'integria', - field5 = '_agent_: _alert_name_', - field6 = '1', - field7 = '3', - field8 = 'copy@dom.com', - field9 = 'admin', - field10 = '_alert_description_' -WHERE id = 4 AND id_alert_command = 11; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql index 23cc028679..2baccd29a4 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql @@ -56,7 +56,6 @@ ALTER TABLE "tusuario" ADD COLUMN "strict_acl" SMALLINT DEFAULT 0; -- Table `talert_commands` -- --------------------------------------------------------------------- UPDATE "talert_commands" SET "fields_descriptions" = '[\"Destination address\",\"Subject\",\"Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]', "fields_values" = '[\"\",\"\",\"_html_editor_\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE "id" = 1 AND "name" = 'eMail'; -UPDATE "talert_commands" SET "fields_descriptions" = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', "fields_values" = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE "id" = 11 AND "name" = 'Integria IMS Ticket'; -- --------------------------------------------------------------------- -- Table `tconfig` @@ -127,17 +126,4 @@ ALTER TABLE tevent_filter ADD COLUMN id_agent int(25) DEFAULT 0; -- Table `tgraph_source` -- --------------------------------------------------------------------- ALTER TABLE tgraph_source ADD COLUMN label VARCHAR2(150) DEFAULT ''; -ALTER TABLE tgraph_source ADD COLUMN id_graph NUMBER(19, 0) DEFAULT 0; - --- --------------------------------------------------------------------- --- Table `talert_actions` --- --------------------------------------------------------------------- -UPDATE "talert_actions" SET "field4" = 'integria', - "field5" = '_agent_: _alert_name_', - "field6" = '1', - "field7" = '3', - "field8" = 'copy@dom.com', - "field9" = 'admin', - "field10" = '_alert_description_' -WHERE "id" = 4 AND "id_alert_command" = 11; - +ALTER TABLE tgraph_source ADD COLUMN id_graph NUMBER(19, 0) DEFAULT 0; \ No newline at end of file From 61280b2ad998e2da408da7dcc72c07b0189d54fc Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 4 Apr 2016 13:57:30 +0200 Subject: [PATCH 23/54] Updated migrate sql script to add integria alert changes TICKETS #3091 --- .../pandoradb_migrate_6.0_to_6.1.mysql.sql | 19 +++++++++++++++++++ .../pandoradb_migrate_6.0_to_6.1.oracle.sql | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql index 3fd09188fa..f6c5709604 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql @@ -15,3 +15,22 @@ ALTER TABLE tserver ADD COLUMN `server_keepalive` int(11) DEFAULT 0; -- ---------------------------------------------------------------------- ALTER TABLE tagente_estado MODIFY `status_changes` tinyint(4) unsigned default 0; + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +UPDATE talert_actions SET `field4` = 'integria', + `field5` = '_agent_: _alert_name_', + `field6` = '1', + `field7` = '3', + `field8` = 'copy@dom.com', + `field9` = 'admin', + `field10` = '_alert_description_' +WHERE `id` = 4 AND `id_alert_command` = 11; + +-- --------------------------------------------------------------------- +-- Table `talert_commands` +-- --------------------------------------------------------------------- +UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket'; + + diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql index 1ede58f9cb..6c32126e8d 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql @@ -9,3 +9,20 @@ ALTER TABLE talert_templates ADD COLUMN min_alerts_reset_counter NUMBER(5, 0) DE -- ---------------------------------------------------------------------- ALTER TABLE tserver ADD COLUMN server_keepalive NUMBER(10, 0) DEFAULT 0; + +-- --------------------------------------------------------------------- +-- Table `talert_actions` +-- --------------------------------------------------------------------- +UPDATE talert_actions SET field4 = 'integria', + field5 = '_agent_: _alert_name_', + field6 = '1', + field7 = '3', + field8 = 'copy@dom.com', + field9 = 'admin', + field10 = '_alert_description_' +WHERE id = 4 AND id_alert_command = 11; + +-- --------------------------------------------------------------------- +-- Table `talert_commands` +-- --------------------------------------------------------------------- +UPDATE talert_commands SET fields_descriptions = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', fields_values = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE id = 11 AND name = 'Integria IMS Ticket'; From d46b8a92ea61320e1308e4f0c9a5cceffa37441d Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 4 Apr 2016 16:48:02 +0200 Subject: [PATCH 24/54] Firts change of logs in delete agent. Tiquet: #3511 (cherry picked from commit 9076f4bda11c1ecdffec9875891eacc4dd177a94) --- pandora_server/util/pandora_manage.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d8ff260b19..310f034809 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -973,7 +973,6 @@ sub cli_delete_agent() { my $agent_name = @ARGV[2]; $agent_name = decode_entities($agent_name); - print_log "[INFO] Deleting agent '$agent_name'\n\n"; if (is_metaconsole($conf) == 1) { my $agents_groups = enterprise_hook('get_metaconsole_agent',[$dbh, $agent_name]); @@ -981,6 +980,7 @@ sub cli_delete_agent() { if (scalar(@{$agents_groups}) != 0) { foreach my $agent (@{$agents_groups}) { my $return = enterprise_hook('delete_metaconsole_agent',[$dbh,$agent->{'id_agente'}]); + print_log "[INFO] Deleting agent '$agent_name' \n\n"; } } my $servers = enterprise_hook('get_metaconsole_setup_servers',[$dbh]); @@ -996,6 +996,7 @@ sub cli_delete_agent() { next; } else { + print_log "[INFO] Deleting agent '$agent_name' in ID server: '$server'\n\n"; pandora_delete_agent($dbh_metaconsole,$id_agent,$conf); } } @@ -1005,6 +1006,7 @@ sub cli_delete_agent() { my $id_agent = get_agent_id($dbh,$agent_name); exist_check($id_agent,'agent',$agent_name); + print_log "[INFO] Deleting agent '$agent_name'\n\n"; pandora_delete_agent($dbh,$id_agent,$conf); } } From e71402e3992cd02f628a179be6fad9ee5c2733f8 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 4 Apr 2016 18:41:37 +0200 Subject: [PATCH 25/54] Improved critical and warning superposition in module graphs TICKETS #3515 --- .../include/graphs/flot/pandora.flot.js | 227 +++++++++++++++--- 1 file changed, 199 insertions(+), 28 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 02b41961f3..f8aed50e04 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -954,35 +954,155 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, // showed[i] = true; } + //Array with points to be painted var threshold_data = new Array(); - + //Array with some interesting points + var extremes = new Array (); + + yellow_threshold = parseFloat (yellow_threshold); + yellow_up = parseFloat (yellow_up); + red_threshold = parseFloat (red_threshold); + red_up = parseFloat (red_up); + if (threshold) { - // Warning interval - if (yellow_inverse) { - threshold_data.push({ // barWidth will be correct on draw time - id: 'warning_up', - data: [[max_x, yellow_up]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} - }); - threshold_data.push({ // barWidth will be correct on draw time - id: 'warning_down', - data: [[max_x, 0]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} - }); - } else { - if (yellow_up == 0) { + // Warning interval. Change extremes depends on critical interval + if (yellow_inverse && red_inverse) { + if (yellow_threshold > red_threshold) { + // C: |-------- ------| + // W: |········===· ···| + if (yellow_threshold > red_up) { + yellow_threshold = red_up; + } + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_threshold; + extremes['warning_normal_fdown_2'] = yellow_threshold; + } + if (yellow_up < red_up) { + // C: |-------- ---| + // W: |····· ·======···| + if (yellow_up < red_threshold) { + yellow_up = red_up; + } + threshold_data.push({ + id: 'warning_normal_fup', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: red_up - yellow_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fup_1'] = red_up; + extremes['warning_normal_fup_2'] = yellow_up; + } + // If warning is under critical completely do not paint anything yellow + // C: |-------- -----| + // W: |···· ···| + + } else if (yellow_inverse && !red_inverse) { + if (yellow_threshold > red_up) { + // C: | ----- | + // W: |====·····=== ===| threshold_data.push({ // barWidth will be correct on draw time - id: 'warning_up', - data: [[max_x, yellow_threshold]], + id: 'warning_down', + data: [[max_x, 0]], label: null, color: warning, bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} }); + extremes['warning_down'] = red_threshold; + + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_up; + extremes['warning_normal_fdown_2'] = yellow_threshold; + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_up'] = yellow_up; + } else if (red_threshold > yellow_up){ + // C: | ----- | + // W: |=== ===·····==| + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, 0]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = yellow_threshold; + + threshold_data.push({ + id: 'warning_normal_fup', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_up - red_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fup_1'] = yellow_up; + extremes['warning_normal_fup_2'] = red_threshold; + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_up'] = yellow_up; } else { + // C: | -------- | + // W: |==· ···=======| + if (yellow_threshold > red_threshold) { + yellow_threshold = red_threshold; + } + if (yellow_up < red_up) { + yellow_up = red_up; + } + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, 0]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = yellow_threshold; + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_up'] = yellow_up; + } + } else if (!yellow_inverse && red_inverse) { + if (red_up > yellow_threshold && red_threshold < yellow_up) { + // C: |----- ------| + // W: | ··======· | + if (yellow_threshold < red_threshold) { + yellow_threshold = red_threshold; + } + if (yellow_up > red_up) { + yellow_up = red_up; + } + threshold_data.push({ id: 'warning_normal', data: [[max_x, yellow_threshold]], @@ -990,6 +1110,58 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, color: warning, bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = yellow_up; + } + } + // If warning is under critical completely do not paint anything yellow + // C: |-------- -----| or // C: |-------- -----| + // W: | ···· | // W: | ·· | + else { + if (red_threshold > yellow_threshold && red_up < yellow_up ) { + // C: | ------ | + // W: | ==······==== | + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: red_threshold - yellow_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = yellow_threshold; + extremes['warning_normal_fdown_2'] = red_threshold; + + threshold_data.push({ + id: 'warning_normal_fup', + data: [[max_x, red_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_up - red_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fup_1'] = red_up; + extremes['warning_normal_fup_2'] = yellow_up; + } else if (red_threshold < yellow_threshold && red_up > yellow_up) { + // If warning is under critical completely do not paint anything yellow + // C: | -------- | + // W: | ···· | + } else { + // C: | -------- | or // C: | ------ | + // W: | ==·· | // W: | ···==== | + if ((yellow_up > red_threshold) && (yellow_up < red_up)) { + yellow_up = red_threshold; + } + if ((yellow_threshold < red_up) && (yellow_threshold > red_threshold)) { + yellow_threshold = red_up; + } + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = yellow_up; } } // Critical interval @@ -1148,7 +1320,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, var zoom_data_threshold = new Array (); zoom_data_threshold = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, - yellow_threshold, red_threshold, yellow_up, red_up); + yellow_threshold, red_threshold, extremes, red_up); plot.setData(zoom_data_threshold); plot.draw(); } @@ -1604,9 +1776,8 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, }); thresholded = false; } else { - //pocoyo datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, - yellow_threshold, red_threshold, yellow_up, red_up); + yellow_threshold, red_threshold, extremes, red_up); thresholded = true; } @@ -1798,7 +1969,7 @@ function number_format(number, force_integer, unit) { return number + ' ' + shorts[pos] + unit; } function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshold, - red_threshold, yellow_up, red_up) { + red_threshold, extremes, red_up) { var datas = new Array (); @@ -1809,7 +1980,7 @@ function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshol //} }); - // Resize the warning and critical interval + // Resize the threshold data $.each(threshold_data, function() { if (/_up/.test(this.id)){ this.bars.barWidth = y_max - this.data[0][1]; @@ -1819,7 +1990,7 @@ function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshol if (/critical/.test(this.id)) { end = red_threshold; } else { - end = yellow_threshold; + end = extremes[this.id]; } this.bars.barWidth = end - y_min; this.data[0][1] = y_min; @@ -1829,7 +2000,7 @@ function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshol if (/critical/.test(this.id)) { end = red_up; } else { - end = yellow_up; + end = extremes[this.id + '_2']; } if (this.data[0][1] < y_min) { this.bars.barWidth = end - y_min; From 82b34dc84774deca79204ea9592c4a055903e4aa Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 4 Apr 2016 19:00:35 +0200 Subject: [PATCH 26/54] Fixed N/A warning or critical in module graphs TICKETS #3392 --- pandora_console/include/graphs/flot/pandora.flot.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index f8aed50e04..cfdc6edbcb 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -954,6 +954,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, // showed[i] = true; } + // If threshold and up are the same, that critical or warning is disabled + if (yellow_threshold == yellow_up) yellow_inverse = false; + if (red_threshold == red_up) red_inverse = false; + //Array with points to be painted var threshold_data = new Array(); //Array with some interesting points From caf3f70c0f046131227325c484d3c9b37931250d Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 5 Apr 2016 00:01:21 +0200 Subject: [PATCH 27/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index bfbbebba7e..6e3062f7db 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160404 +Version: 6.1dev-160405 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index b61927cd9d..981439628b 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160404" +pandora_version="6.1dev-160405" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 49cdb9f1a6..a97fad6114 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160404'; +use constant AGENT_BUILD => '160405'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index c5f50a0c9b..331d12a933 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160404 +%define release 160405 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 8bfb6eccf0..cf67219db6 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160404 +%define release 160405 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 2ebb485a6a..f3d55c0066 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160404" +PI_BUILD="160405" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c260215145..c3acdd1f00 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160404} +{160405} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 44535f03c9..172d1710be 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160404)") +#define PANDORA_VERSION ("6.1dev(Build 160405)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f23fb32f5b..776b1da784 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160404))" + VALUE "ProductVersion", "(6.1dev(Build 160405))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 0c3de5a19b..5412ec63ab 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160404 +Version: 6.1dev-160405 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 1cc28be48c..de2b220317 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160404" +pandora_version="6.1dev-160405" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 8d9456e8b7..ea43d61cf1 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160404'; +$build_version = 'PC160405'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 87d1775152..122c84cb83 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
      Date: Tue, 5 Apr 2016 14:03:15 +0200 Subject: [PATCH 28/54] Fixed problems with undefined max interval on module graphs TICKETS #3392 --- .../include/graphs/flot/pandora.flot.js | 570 +++++++++++++----- 1 file changed, 416 insertions(+), 154 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index cfdc6edbcb..f500fa4df0 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -967,69 +967,63 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, yellow_up = parseFloat (yellow_up); red_threshold = parseFloat (red_threshold); red_up = parseFloat (red_up); + var yellow_only_min = ((yellow_up == 0) && (yellow_threshold != 0)); + red_only_min = ((red_up == 0) && (red_threshold != 0)); if (threshold) { // Warning interval. Change extremes depends on critical interval if (yellow_inverse && red_inverse) { - if (yellow_threshold > red_threshold) { + if (red_only_min && yellow_only_min) { + // C: |-------- | + // W: |········==== | + + if (yellow_threshold > red_threshold) { + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_threshold; + extremes['warning_normal_fdown_2'] = yellow_threshold; + } + } else if (!red_only_min && yellow_only_min) { // C: |-------- ------| - // W: |········===· ···| + // W: |········===· | + if (yellow_threshold > red_up) { yellow_threshold = red_up; } - threshold_data.push({ - id: 'warning_normal_fdown', - data: [[max_x, red_threshold]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: yellow_threshold - red_threshold, lineWidth: 0, horizontal: true} - }); - extremes['warning_normal_fdown_1'] = red_threshold; - extremes['warning_normal_fdown_2'] = yellow_threshold; - } - if (yellow_up < red_up) { - // C: |-------- ---| - // W: |····· ·======···| - if (yellow_up < red_threshold) { - yellow_up = red_up; + if (yellow_threshold > red_threshold) { + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_threshold; + extremes['warning_normal_fdown_2'] = yellow_threshold; + } + } else if (red_only_min && !yellow_only_min) { + // C: |------- | + // W: |·······==== ===| + if (red_threshold < yellow_threshold) { + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_threshold; + extremes['warning_normal_fdown_2'] = yellow_threshold; } - threshold_data.push({ - id: 'warning_normal_fup', - data: [[max_x, yellow_up]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: red_up - yellow_up, lineWidth: 0, horizontal: true} - }); - extremes['warning_normal_fup_1'] = red_up; - extremes['warning_normal_fup_2'] = yellow_up; - } - // If warning is under critical completely do not paint anything yellow - // C: |-------- -----| - // W: |···· ···| - - } else if (yellow_inverse && !red_inverse) { - if (yellow_threshold > red_up) { - // C: | ----- | - // W: |====·····=== ===| - threshold_data.push({ // barWidth will be correct on draw time - id: 'warning_down', - data: [[max_x, 0]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} - }); - extremes['warning_down'] = red_threshold; - - threshold_data.push({ - id: 'warning_normal_fdown', - data: [[max_x, red_up]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: yellow_threshold - red_up, lineWidth: 0, horizontal: true} - }); - extremes['warning_normal_fdown_1'] = red_up; - extremes['warning_normal_fdown_2'] = yellow_threshold; + if (yellow_up < red_threshold) { + yellow_up = red_threshold; + } threshold_data.push({ // barWidth will be correct on draw time id: 'warning_up', data: [[max_x, yellow_up]], @@ -1038,154 +1032,422 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} }); extremes['warning_up'] = yellow_up; - } else if (red_threshold > yellow_up){ - // C: | ----- | - // W: |=== ===·····==| - threshold_data.push({ // barWidth will be correct on draw time - id: 'warning_down', - data: [[max_x, 0]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} - }); - extremes['warning_down'] = yellow_threshold; - threshold_data.push({ - id: 'warning_normal_fup', - data: [[max_x, yellow_up]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: yellow_up - red_threshold, lineWidth: 0, horizontal: true} - }); - extremes['warning_normal_fup_1'] = yellow_up; - extremes['warning_normal_fup_2'] = red_threshold; - - threshold_data.push({ // barWidth will be correct on draw time - id: 'warning_up', - data: [[max_x, yellow_up]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} - }); - extremes['warning_up'] = yellow_up; } else { - // C: | -------- | - // W: |==· ···=======| + if (yellow_threshold > red_threshold) { + // C: |-------- ------| + // W: |········===· ···| + if (yellow_threshold > red_up) { + yellow_threshold = red_up; + } + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_threshold; + extremes['warning_normal_fdown_2'] = yellow_threshold; + } + if (yellow_up < red_up) { + // C: |-------- ---| + // W: |····· ·======···| + if (yellow_up < red_threshold) { + yellow_up = red_up; + } + threshold_data.push({ + id: 'warning_normal_fup', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: red_up - yellow_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fup_1'] = red_up; + extremes['warning_normal_fup_2'] = yellow_up; + } + // If warning is under critical completely do not paint anything yellow + // C: |-------- -----| + // W: |···· ···| + } + } else if (yellow_inverse && !red_inverse) { + if (red_only_min && yellow_only_min) { + // C: | -----| + // W: |============··· | if (yellow_threshold > red_threshold) { yellow_threshold = red_threshold; } - if (yellow_up < red_up) { - yellow_up = red_up; - } - threshold_data.push({ // barWidth will be correct on draw time id: 'warning_down', - data: [[max_x, 0]], + data: [[max_x, yellow_threshold]], label: null, color: warning, bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} }); extremes['warning_down'] = yellow_threshold; + } else if (!red_only_min && yellow_only_min) { + // C: | ---- | + // W: |======····=== | + + if (yellow_threshold > red_up) { + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_up; + extremes['warning_normal_fdown_2'] = yellow_threshold; + } + + if (yellow_threshold > red_threshold) { + yellow_threshold = red_threshold; + } + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = yellow_threshold; + + } else if (red_only_min && !yellow_only_min) { + if (yellow_threshold < red_threshold) { + // C: | -----| + // W: |======= ===·····| + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = yellow_threshold; + + if (red_threshold > yellow_up) { + threshold_data.push({ + id: 'warning_normal_fup', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: red_threshold - yellow_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fup_1'] = yellow_up; + extremes['warning_normal_fup_2'] = red_threshold; + } + } else { + // C: | ------------| + // W: |=====·· ········| + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, red_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = red_threshold; + } + } else { + if (yellow_threshold > red_up) { + // C: | ----- | + // W: |====·····=== ===| + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, red_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = red_threshold; + + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, red_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_threshold - red_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = red_up; + extremes['warning_normal_fdown_2'] = yellow_threshold; + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_up'] = yellow_up; + } else if (red_threshold > yellow_up){ + // C: | ----- | + // W: |=== ===·····==| + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = yellow_threshold; + + threshold_data.push({ + id: 'warning_normal_fup', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_up - red_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fup_1'] = yellow_up; + extremes['warning_normal_fup_2'] = red_threshold; + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_up'] = yellow_up; + } else { + // C: | -------- | + // W: |==· ···=======| + if (yellow_threshold > red_threshold) { + yellow_threshold = red_threshold; + } + if (yellow_up < red_up) { + yellow_up = red_up; + } + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_down', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_down'] = yellow_threshold; + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', + data: [[max_x, yellow_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + extremes['warning_up'] = yellow_up; + } + } + } else if (!yellow_inverse && red_inverse) { + if (yellow_only_min && red_only_min) { + // C: |----- | + // W: | ··============| + if (yellow_threshold < red_threshold) { + yellow_threshold = red_threshold; + } threshold_data.push({ // barWidth will be correct on draw time id: 'warning_up', - data: [[max_x, yellow_up]], + data: [[max_x, yellow_threshold]], label: null, color: warning, bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} }); - extremes['warning_up'] = yellow_up; - } - } else if (!yellow_inverse && red_inverse) { - if (red_up > yellow_threshold && red_threshold < yellow_up) { - // C: |----- ------| - // W: | ··======· | + extremes['warning_up'] = yellow_threshold; + + } else if (!yellow_only_min && red_only_min) { + // C: |----- | + // W: | ··======== | if (yellow_threshold < red_threshold) { yellow_threshold = red_threshold; } - if (yellow_up > red_up) { - yellow_up = red_up; + if (yellow_up > red_threshold) { + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = yellow_up; + } + } else if (yellow_only_min && !red_only_min) { + // C: |----- ------| + // W: | ··======······| + if (yellow_threshold < red_threshold) { + yellow_threshold = red_threshold; + } + if (yellow_threshold < red_up) { + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (red_up - yellow_threshold), lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = red_up; + } + // If warning is under critical completely do not paint anything yellow + // C: |-------- -----| + // W: | ···| + } else { + if (red_up > yellow_threshold && red_threshold < yellow_up) { + // C: |----- ------| + // W: | ··======· | + if (yellow_threshold < red_threshold) { + yellow_threshold = red_threshold; + } + if (yellow_up > red_up) { + yellow_up = red_up; + } + + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = yellow_up; } - - threshold_data.push({ - id: 'warning_normal', - data: [[max_x, yellow_threshold]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} - }); - extremes['warning_normal_1'] = yellow_threshold; - extremes['warning_normal_2'] = yellow_up; } } // If warning is under critical completely do not paint anything yellow // C: |-------- -----| or // C: |-------- -----| // W: | ···· | // W: | ·· | else { - if (red_threshold > yellow_threshold && red_up < yellow_up ) { - // C: | ------ | - // W: | ==······==== | - threshold_data.push({ - id: 'warning_normal_fdown', - data: [[max_x, yellow_threshold]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: red_threshold - yellow_threshold, lineWidth: 0, horizontal: true} - }); - extremes['warning_normal_fdown_1'] = yellow_threshold; - extremes['warning_normal_fdown_2'] = red_threshold; - - threshold_data.push({ - id: 'warning_normal_fup', - data: [[max_x, red_up]], - label: null, - color: warning, - bars: {show: true, align: "left", barWidth: yellow_up - red_up, lineWidth: 0, horizontal: true} - }); - extremes['warning_normal_fup_1'] = red_up; - extremes['warning_normal_fup_2'] = yellow_up; - } else if (red_threshold < yellow_threshold && red_up > yellow_up) { - // If warning is under critical completely do not paint anything yellow - // C: | -------- | - // W: | ···· | - } else { - // C: | -------- | or // C: | ------ | - // W: | ==·· | // W: | ···==== | - if ((yellow_up > red_threshold) && (yellow_up < red_up)) { + if (red_only_min && yellow_only_min) { + if (yellow_threshold < red_threshold) { + // C: | ---------| + // W: | =====·········| + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (red_threshold - yellow_threshold), lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = red_threshold; + } + } else if (red_only_min && !yellow_only_min) { + // C: | ---------| + // W: | =====··· | + if (yellow_up > red_threshold) { yellow_up = red_threshold; } - if ((yellow_threshold < red_up) && (yellow_threshold > red_threshold)) { + if (yellow_threshold < red_threshold) { + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = yellow_up; + } + } else if (!red_only_min && yellow_only_min) { + // C: | ------- | + // W: | ==·······=====| + + if (yellow_threshold < red_threshold) { + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: red_threshold - yellow_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = yellow_threshold; + extremes['warning_normal_fdown_2'] = red_threshold; + } + + if (yellow_threshold < red_up) { yellow_threshold = red_up; } - threshold_data.push({ - id: 'warning_normal', + + threshold_data.push({ // barWidth will be correct on draw time + id: 'warning_up', data: [[max_x, yellow_threshold]], label: null, color: warning, - bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} }); - extremes['warning_normal_1'] = yellow_threshold; - extremes['warning_normal_2'] = yellow_up; + extremes['warning_up'] = yellow_threshold; + + } else { + if (red_threshold > yellow_threshold && red_up < yellow_up ) { + // C: | ------ | + // W: | ==······==== | + threshold_data.push({ + id: 'warning_normal_fdown', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: red_threshold - yellow_threshold, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fdown_1'] = yellow_threshold; + extremes['warning_normal_fdown_2'] = red_threshold; + + threshold_data.push({ + id: 'warning_normal_fup', + data: [[max_x, red_up]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: yellow_up - red_up, lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_fup_1'] = red_up; + extremes['warning_normal_fup_2'] = yellow_up; + } else if (red_threshold < yellow_threshold && red_up > yellow_up) { + // If warning is under critical completely do not paint anything yellow + // C: | -------- | + // W: | ···· | + } else { + // C: | -------- | or // C: | ------ | + // W: | ==·· | // W: | ···==== | + if ((yellow_up > red_threshold) && (yellow_up < red_up)) { + yellow_up = red_threshold; + } + if ((yellow_threshold < red_up) && (yellow_threshold > red_threshold)) { + yellow_threshold = red_up; + } + threshold_data.push({ + id: 'warning_normal', + data: [[max_x, yellow_threshold]], + label: null, + color: warning, + bars: {show: true, align: "left", barWidth: (yellow_up - yellow_threshold), lineWidth: 0, horizontal: true} + }); + extremes['warning_normal_1'] = yellow_threshold; + extremes['warning_normal_2'] = yellow_up; + } } } // Critical interval - if (red_inverse) { - threshold_data.push({ // barWidth will be correct on draw time - id: 'critical_up', - data: [[max_x, red_up]], - label: null, - color: critical, - bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} - }); + if (red_inverse) { + if (!red_only_min) { + threshold_data.push({ // barWidth will be correct on draw time + id: 'critical_up', + data: [[max_x, red_up]], + label: null, + color: critical, + bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} + }); + } threshold_data.push({ // barWidth will be correct on draw time id: 'critical_down', - data: [[max_x, 0]], + data: [[max_x, red_threshold]], label: null, color: critical, bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} }); } else { - if (red_up == 0) { + if (red_up == 0 && red_threshold != 0) { threshold_data.push({ // barWidth will be correct on draw time id: 'critical_up', data: [[max_x, red_threshold]], From 9d28f99ae9fc0ca5669ad007e1952b8afa83036e Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 6 Apr 2016 00:01:14 +0200 Subject: [PATCH 29/54] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6e3062f7db..40c5c17a25 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.1dev-160405 +Version: 6.1dev-160406 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 981439628b..c14d309e9c 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160405" +pandora_version="6.1dev-160406" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a97fad6114..3c9c06296e 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.1dev'; -use constant AGENT_BUILD => '160405'; +use constant AGENT_BUILD => '160406'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 331d12a933..11be24dc2f 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160405 +%define release 160406 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index cf67219db6..1c30bc0121 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 6.1dev -%define release 160405 +%define release 160406 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index f3d55c0066..a8792b6529 100644 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="6.1dev" -PI_BUILD="160405" +PI_BUILD="160406" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c3acdd1f00..c7e85da67f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{160405} +{160406} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 172d1710be..11c41769f4 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("6.1dev(Build 160405)") +#define PANDORA_VERSION ("6.1dev(Build 160406)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 776b1da784..0b3b1ecc9c 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(6.1dev(Build 160405))" + VALUE "ProductVersion", "(6.1dev(Build 160406))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 5412ec63ab..cf9f782532 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.1dev-160405 +Version: 6.1dev-160406 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index de2b220317..7d49198b50 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="6.1dev-160405" +pandora_version="6.1dev-160406" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ea43d61cf1..e25e856121 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC160405'; +$build_version = 'PC160406'; $pandora_version = 'v6.1dev'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 122c84cb83..4529c7e196 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
      Date: Wed, 6 Apr 2016 10:30:59 +0200 Subject: [PATCH 30/54] Fixed a single error on module graphs TICKETS #3526 --- pandora_console/include/graphs/flot/pandora.flot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index f500fa4df0..97e6a449cd 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1198,19 +1198,19 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, data: [[max_x, yellow_up]], label: null, color: warning, - bars: {show: true, align: "left", barWidth: yellow_up - red_threshold, lineWidth: 0, horizontal: true} + bars: {show: true, align: "left", barWidth: red_threshold - yellow_up, lineWidth: 0, horizontal: true} }); extremes['warning_normal_fup_1'] = yellow_up; extremes['warning_normal_fup_2'] = red_threshold; threshold_data.push({ // barWidth will be correct on draw time id: 'warning_up', - data: [[max_x, yellow_up]], + data: [[max_x, red_up]], label: null, color: warning, bars: {show: true, align: "left", barWidth: 1, lineWidth: 0, horizontal: true} }); - extremes['warning_up'] = yellow_up; + extremes['warning_up'] = red_up; } else { // C: | -------- | // W: |==· ···=======| From 497e56510ad0e4fdfc59baa68f6adc976039bfe7 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 6 Apr 2016 11:07:26 +0200 Subject: [PATCH 31/54] Fixed error when log in as admin with saml login method. --- pandora_console/index.php | 157 ++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 81 deletions(-) diff --git a/pandora_console/index.php b/pandora_console/index.php index 1a0f617f4c..fa99a340b3 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -36,7 +36,7 @@ if ($develop_bypass != 1) { exit; } } - + if (filesize("include/config.php") == 0) { include ("install.php"); exit; @@ -99,7 +99,7 @@ if (!empty ($config["https"]) && empty ($_SERVER['HTTPS'])) { if (sizeof ($_REQUEST)) //Some (old) browsers don't like the ?&key=var $query .= '?1=1'; - + //We don't clean these variables up as they're only being passed along foreach ($_GET as $key => $value) { if ($key == 1) @@ -110,11 +110,11 @@ if (!empty ($config["https"]) && empty ($_SERVER['HTTPS'])) { $query .= '&'.$key.'='.$value; } $url = ui_get_full_url($query); - + // Prevent HTTP response splitting attacks // http://en.wikipedia.org/wiki/HTTP_response_splitting $url = str_replace ("\n", "", $url); - + header ('Location: '.$url); exit; //Always exit after sending location headers } @@ -140,10 +140,10 @@ echo '' . "\n"; //This starts the page head. In the call back function, things from $page['head'] array will be processed into the head ob_start ('ui_process_page_head'); -// Enterprise main +// Enterprise main enterprise_include ('index.php'); -// This tag is included in the buffer passed to ui_process_page_head so +// This tag is included in the buffer passed to ui_process_page_head so // technically it can be stripped echo '' . "\n"; @@ -165,12 +165,12 @@ $process_login = false; $change_pass = get_parameter_post('renew_password', 0); if ($change_pass == 1) { - + $password_old = (string) get_parameter_post ('old_password', ''); $password_new = (string) get_parameter_post ('new_password', ''); $password_confirm = (string) get_parameter_post ('confirm_new_password', ''); $id = (string) get_parameter_post ('login', ''); - + $changed_pass = login_update_password_check ($password_old, $password_new, $password_confirm, $id); } @@ -188,40 +188,40 @@ if (strlen($search) > 0) { if (! isset ($config['id_user'])) { if (isset ($_GET["login"])) { include_once('include/functions_db.php'); //Include it to use escape_string_sql function - + $config["auth_error"] = ""; //Set this to the error message from the authorization mechanism $nick = get_parameter_post ("nick"); //This is the variable with the login $pass = get_parameter_post ("pass"); //This is the variable with the password $nick = db_escape_string_sql($nick); $pass = db_escape_string_sql($pass); - + //Since now, only the $pass variable are needed unset ($_GET['pass'], $_POST['pass'], $_REQUEST['pass']); - + // If the auth_code exists, we assume the user has come through the double auth page if (isset ($_POST['auth_code'])) { $double_auth_success = false; - + // The double authentication is activated and the user has surpassed the first step (the login). // Now the authentication code provided will be checked. if (isset ($_SESSION['prepared_login_da'])) { if (isset ($_SESSION['prepared_login_da']['id_user']) && isset ($_SESSION['prepared_login_da']['timestamp'])) { - + // The user has a maximum of 5 minutes to introduce the double auth code $dauth_period = SECONDS_2MINUTES; $now = time(); $dauth_time = $_SESSION['prepared_login_da']['timestamp']; - + if ($now - $dauth_period < $dauth_time) { // Nick $nick = $_SESSION["prepared_login_da"]['id_user']; // Code $code = (string) get_parameter_post ("auth_code"); - + if (!empty($code)) { $result = validate_double_auth_code($nick, $code); - + if ($result === true) { // Double auth success $double_auth_success = true; @@ -231,7 +231,7 @@ if (! isset ($config['id_user'])) { $login_screen = 'double_auth'; // Error message $config["auth_error"] = __("Invalid code"); - + if (!isset($_SESSION['prepared_login_da']['attempts'])) $_SESSION['prepared_login_da']['attempts'] = 0; $_SESSION['prepared_login_da']['attempts']++; @@ -242,7 +242,7 @@ if (! isset ($config['id_user'])) { $login_screen = 'double_auth'; // Error message $config["auth_error"] = __("The code shouldn't be empty"); - + if (!isset($_SESSION['prepared_login_da']['attempts'])) $_SESSION['prepared_login_da']['attempts'] = 0; $_SESSION['prepared_login_da']['attempts']++; @@ -251,7 +251,7 @@ if (! isset ($config['id_user'])) { else { // Expired login unset ($_SESSION['prepared_login_da']); - + // Error message $config["auth_error"] = __('Expired login'); } @@ -259,7 +259,7 @@ if (! isset ($config['id_user'])) { else { // If the code doesn't exist, remove the prepared login unset ($_SESSION['prepared_login_da']); - + // Error message $config["auth_error"] = __('Login error'); } @@ -269,10 +269,10 @@ if (! isset ($config['id_user'])) { // Error message $config["auth_error"] = __('Login error'); } - + // Remove the authenticator code unset ($_POST['auth_code'], $code); - + if (!$double_auth_success) { $login_failed = true; require_once ('general/login_page.php'); @@ -288,15 +288,10 @@ if (! isset ($config['id_user'])) { $nick_in_db = $_SESSION["prepared_login_da"]['id_user']; $expired_pass = false; } - else if (($config['auth'] == 'saml') && $login_button_saml) { - if (is_user_admin($nick)) { - $nick_in_db = $nick; - } - else { - include_once(ENTERPRISE_DIR . "/include/auth/saml.php"); - $saml_user_id = saml_process_user_login(); - $nick_in_db = $saml_user_id; - } + else if (($config['auth'] == 'saml') && $login_button_saml && !is_user_admin($nick)) { + include_once(ENTERPRISE_DIR . "/include/auth/saml.php"); + $saml_user_id = saml_process_user_login(); + $nick_in_db = $saml_user_id; } else { // process_user_login is a virtual function which should be defined in each auth file. @@ -304,27 +299,27 @@ if (! isset ($config['id_user'])) { // The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it // process_user_login should return false in case of errors or invalid login, the nickname if correct $nick_in_db = process_user_login ($nick, $pass); - + $expired_pass = false; - + if (($nick_in_db != false) && ((!is_user_admin($nick) || $config['enable_pass_policy_admin'])) && (defined('PANDORA_ENTERPRISE')) && ($config['enable_pass_policy'])) { include_once(ENTERPRISE_DIR . "/include/auth/mysql.php"); - + $blocked = login_check_blocked($nick); - + if ($blocked) { require_once ('general/login_page.php'); db_pandora_audit("Password expired", "Password expired: ".$nick, $nick); while (@ob_end_flush ()); exit (""); } - + //Checks if password has expired $check_status = check_pass_status($nick, $pass); - + switch ($check_status) { case PASSSWORD_POLICIES_FIRST_CHANGE: //first change case PASSSWORD_POLICIES_EXPIRED: //pass expired @@ -334,10 +329,10 @@ if (! isset ($config['id_user'])) { } } } - + if (($nick_in_db !== false) && $expired_pass) { //login ok and password has expired - + require_once ('general/login_page.php'); db_pandora_audit("Password expired", "Password expired: " . $nick, $nick); @@ -346,7 +341,7 @@ if (! isset ($config['id_user'])) { } else if (($nick_in_db !== false) && (!$expired_pass)) { //login ok and password has not expired - + // Double auth check if ((!isset ($double_auth_success) || !$double_auth_success) && is_double_auth_enabled($nick_in_db)) { // Store this values in the session to know if the user login was correct @@ -355,24 +350,24 @@ if (! isset ($config['id_user'])) { 'timestamp' => time(), 'attempts' => 0 ); - + // Load the page to introduce the double auth code $login_screen = 'double_auth'; require_once ('general/login_page.php'); while (@ob_end_flush ()); exit (""); } - + //login ok and password has not expired $process_login = true; - + echo ""; - + if (!isset($_GET["sec2"]) && !isset($_GET["sec"])) { // Avoid the show homepage when the user go to // a specific section of pandora // for example when timeout the sesion - + unset ($_GET["sec2"]); $_GET["sec"] = "general/logon_ok"; $home_page =''; @@ -424,24 +419,24 @@ if (! isset ($config['id_user'])) { $_GET["sec"] = "general/logon_ok"; } } - + } - + db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']); $_SESSION['id_usuario'] = $nick_in_db; $config['id_user'] = $nick_in_db; - + //========================================================== //-------- SET THE CUSTOM CONFIGS OF USER ------------------ - + config_user_set_custom_config(); //========================================================== - + //Remove everything that might have to do with people's passwords or logins unset ($pass, $login_good); - + $user_language = get_user_language($config['id_user']); - + $l10n = NULL; if (file_exists ('./include/languages/' . $user_language . '.mo')) { $l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$user_language.'.mo')); @@ -450,11 +445,11 @@ if (! isset ($config['id_user'])) { } else { //login wrong $blocked = false; - + if ((!is_user_admin($nick) || $config['enable_pass_policy_admin']) && defined('PANDORA_ENTERPRISE')) { $blocked = login_check_blocked($nick); } - + if (!$blocked) { if (defined('PANDORA_ENTERPRISE')) { login_check_failed($nick); //Checks failed attempts @@ -477,7 +472,7 @@ if (! isset ($config['id_user'])) { elseif (isset ($_GET["loginhash"])) { $loginhash_data = get_parameter("loginhash_data", ""); $loginhash_user = str_rot13(get_parameter("loginhash_user", "")); - + if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) { db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']); $_SESSION['id_usuario'] = $loginhash_user; @@ -530,12 +525,12 @@ extensions_load_extensions ($process_login); if ($process_login) { /* Call all extensions login function */ extensions_call_login_function (); - + unset($_SESSION['new_update']); - + require_once("include/functions_update_manager.php"); enterprise_include_once("include/functions_update_manager.php"); - + if ($config["autoupdate"] == 1) { if (enterprise_installed()) { $result = update_manager_check_online_enterprise_packages_available(); @@ -545,12 +540,12 @@ if ($process_login) { } if ($result) $_SESSION['new_update'] = 'new'; - + } - + //Set the initial global counter for chat. users_get_last_global_counter('session'); - + $config['logged'] = true; } //---------------------------------------------------------------------- @@ -564,7 +559,7 @@ if (isset($_SERVER['HTTP_REFERER'])) $chunks = explode('?', $old_page); if (count($chunks) == 2) { $chunks = explode('&', $chunks[1]); - + foreach ($chunks as $chunk) { if (strstr($chunk, 'sec=') !== false) { $old_sec = str_replace('sec=', '', $chunk); @@ -599,15 +594,15 @@ if ($old_global_counter_chat != $now_global_counter_chat) { if (get_parameter ('login', 0) !== 0) { // Display news dialog include_once("general/news_dialog.php"); - + // Display login help info dialog // If it's configured to not skip this if (!isset($config['skip_login_help_dialog']) || $config['skip_login_help_dialog'] == 0) { - + include_once("general/login_help_dialog.php"); } - + } // Header @@ -643,7 +638,7 @@ if ($searchPage) { } else { if ($page != "") { - + $main_sec = get_sec($sec); if ($main_sec == false) { if ($sec == 'extensions') @@ -657,19 +652,19 @@ else { $sec2 = ''; } $page .= '.php'; - + // Enterprise ACL check if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $main_sec, $sec, true,$sec2)) == false) { - + require ("general/noaccess.php"); - + } else { $sec = $main_sec; if (file_exists ($page)) { if (! extensions_is_extension ($page)) { - + require_once($page); } else { @@ -678,12 +673,12 @@ else { else extensions_call_main_function (basename ($page)); } - } + } else { ui_print_error_message(__('Sorry! I can\'t find the page!')); } } - } + } else { //home screen chosen by the user $home_page =''; @@ -692,9 +687,9 @@ else { $home_page = io_safe_output($user_info['section']); $home_url = $user_info['data_section']; } - - - + + + if ($home_page != '') { switch ($home_page) { case 'Event list': @@ -726,7 +721,7 @@ else { if (($home_url == '') || ($id_visualc == false)) { $str = 'sec=visualc&sec2=operation/visual_console/index&refr=60'; } - else + else $str = 'sec=visualc&sec2=operation/visual_console/render_view&id='.$id_visualc .'&refr=60'; parse_str($str, $res); foreach ($res as $key => $param) { @@ -742,7 +737,7 @@ else { } if (isset($_GET['sec2'])) { $file = $_GET['sec2'] . '.php'; - + if (!file_exists ($file)) { unset($_GET['sec2']); require('general/logon_ok.php'); @@ -803,15 +798,15 @@ require('include/php_to_js_values.php');