Merge branch 'develop' of github.com:pandorafms/pandorafms into develop

This commit is contained in:
mdtrooper 2014-09-23 13:03:02 +02:00
commit e6a31eb47c
37 changed files with 451 additions and 59 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 5.1-140922 Version: 5.1-140923
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="5.1-140922" pandora_version="5.1-140923"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '5.1'; use constant AGENT_VERSION => '5.1';
use constant AGENT_BUILD => '140922'; use constant AGENT_BUILD => '140923';
# Commands to retrieve total memory information in kB # Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => { use constant TOTALMEMORY_CMDS => {

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 5.1 %define version 5.1
%define release 140922 %define release 140923
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 5.1 %define version 5.1
%define release 140922 %define release 140923
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{140922} {140923}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("5.1(Build 140922)") #define PANDORA_VERSION ("5.1(Build 140923)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(5.1(Build 140922))" VALUE "ProductVersion", "(5.1(Build 140923))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -372,8 +372,16 @@ Pandora_Wmi::getOSName () {
dhGetValue (L"%s", &name, quickfix, dhGetValue (L"%s", &name, quickfix,
L".Caption"); L".Caption");
ret = name; if (name != NULL) {
dhFreeString (name); // Remove the (R) character.
for (int i = 0; i < strlen(name); i++) {
if ((unsigned char)name[i] == 0xAE) {
name[i] = ' ';
}
}
ret = name;
dhFreeString (name);
}
} NEXT_THROW (quickfix); } NEXT_THROW (quickfix);
} catch (string errstr) { } catch (string errstr) {
@ -406,6 +414,12 @@ Pandora_Wmi::getOSVersion () {
L".CSDVersion"); L".CSDVersion");
if (version != NULL) { if (version != NULL) {
// Remove the (R) character.
for (int i = 0; i < strlen(version); i++) {
if ((unsigned char)version[i] == 0xAE) {
version[i] = ' ';
}
}
ret = version; ret = version;
dhFreeString (version); dhFreeString (version);
} }

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 5.1-140922 Version: 5.1-140923
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="5.1-140922" pandora_version="5.1-140923"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -259,6 +259,11 @@ UPDATE FROM `network_component` SET `post_process`= 0.000000115740741 WHERE `id_
UPDATE FROM `network_component` SET `unit`= 'day' WHERE `id_nc`=53; UPDATE FROM `network_component` SET `unit`= 'day' WHERE `id_nc`=53;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `network_component` -- Table `tnetwork_component`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE `tnetwork_component` MODIFY COLUMN `post_process` DOUBLE(18,15) DEFAULT 0; ALTER TABLE `tnetwork_component` MODIFY COLUMN `post_process` DOUBLE(24,15) DEFAULT 0;
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
-- ---------------------------------------------------------------------
ALTER TABLE `tagente_modulo` MODIFY COLUMN `post_process` DOUBLE(24,15) DEFAULT 0;

View File

@ -39,7 +39,8 @@ if (tags_has_user_acl_tags()) {
// Site news ! // Site news !
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
echo '<div id="left_column_logon_ok" id="leftcolumn">'; //echo '<div id="left_column_logon_ok" id="leftcolumn">';
echo '<div style="width:50%; float:left;" id="leftcolumn">';
//////////////////NEWS BOARD///////////////////////////// //////////////////NEWS BOARD/////////////////////////////
echo '<div id="news_board">'; echo '<div id="news_board">';
@ -164,7 +165,8 @@ echo '</div>';
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Site stats (global!) // Site stats (global!)
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
echo '<div id="right_column_logon_ok" id="rightcolumn">'; //echo '<div id="right_column_logon_ok" id="rightcolumn">';
echo '<div style="width:30%; float:left;" id="rightcolumn">';
$data = reporting_get_group_stats (); $data = reporting_get_group_stats ();
/////////////// ///////////////

View File

@ -739,6 +739,14 @@ $(document).ready (function () {
event.preventDefault(); event.preventDefault();
} }
}); });
//validate post_process. Change ',' by '.'
$("#submit-updbutton").click (function () {
validate_post_process();
});
$("#submit-crtbutton").click (function () {
validate_post_process();
});
}); });
@ -961,6 +969,12 @@ function delete_relation (num_row, id_relation) {
} }
} }
function validate_post_process() {
var post_process = $("#text-post_process").val();
var new_post_process = post_process.replace(',','.');
$("#text-post_process").val(new_post_process);
}
/* End of relationship javascript */ /* End of relationship javascript */
/* ]]> */ /* ]]> */

View File

@ -85,7 +85,13 @@ $max_critical = (float) get_parameter ('max_critical');
$str_critical = (string) get_parameter ('str_critical'); $str_critical = (string) get_parameter ('str_critical');
$ff_event = (int) get_parameter ('ff_event'); $ff_event = (int) get_parameter ('ff_event');
$history_data = (bool) get_parameter ('history_data'); $history_data = (bool) get_parameter ('history_data');
$post_process = (float) get_parameter('post_process');
// Don't read as (float) because it lost it's decimals when put into MySQL
// where are very big and PHP uses scientific notation, p.e:
// 1.23E-10 is 0.000000000123
$post_process = (string) get_parameter ('post_process', 0.0);
$unit = (string) get_parameter('unit'); $unit = (string) get_parameter('unit');
$id = (int) get_parameter ('id'); $id = (int) get_parameter ('id');
$wizard_level = get_parameter ('wizard_level', 'nowizard'); $wizard_level = get_parameter ('wizard_level', 'nowizard');

View File

@ -100,3 +100,19 @@ $table->colspan['tcp_receive'][1] = 3;
push_table_row ($data, 'tcp_receive'); push_table_row ($data, 'tcp_receive');
?> ?>
<script type="text/javascript">
$(document).ready (function () {
$("#submit-upd").click (function () {
validate_post_process();
});
$("#submit-crt").click (function () {
validate_post_process();
});
});
function validate_post_process() {
var post_process = $("#text-post_process").val();
var new_post_process = post_process.replace(',','.');
$("#text-post_process").val(new_post_process);
}
</script>

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC140922'; $build_version = 'PC140923';
$pandora_version = 'v5.1'; $pandora_version = 'v5.1';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -152,7 +152,7 @@ function custom_graphs_get_user ($id_user = 0, $only_names = false, $returnAllGr
function custom_graphs_print($id_graph, $height, $width, $period, function custom_graphs_print($id_graph, $height, $width, $period,
$stacked = null, $return = false, $date = 0, $only_image = false, $stacked = null, $return = false, $date = 0, $only_image = false,
$background_color = 'white', $modules_param = array()) { $background_color = 'white', $modules_param = array(), $homeurl = '') {
global $config; global $config;
@ -210,7 +210,7 @@ function custom_graphs_print($id_graph, $height, $width, $period,
$stacked, $stacked,
$date, $date,
$only_image, $only_image,
'', $homeurl,
1, 1,
false, false,
false, false,

View File

@ -5,6 +5,11 @@
?> ?>
<h1>Post process</h1> <h1>Post process</h1>
Post process is a numeric value used after get data to numerical post process in a multiplier operation. For example a data with a value of 1000 with a Post Process value of 1024 will result in a definitive data of 1024000 value. This is useful to normalize data, convert between units, etc. This also can be used to divide, using a multiplier below 1 value, like, for example, 0.001 that will divide current value by 1000. Post process is a numeric value used after get data to numerical post process in a multiplier operation. For example a data with a value of 1000 with a Post Process value of 1024 will result in a definitive data of 1024000 value. This is useful to normalize data, convert between units, etc. This also can be used to divide, using a multiplier below 1 value, like, for example, 0.001 that will divide current value by 1000. Some other interesting examples are:
<li>Convert timeticks (SNMP) to Days: 0.000000115740741
<li>Convert bytes into MegaBytes: 0,00000095367432
<li>Convert bytes into GigaBytes: 0,00000000093132
<li>Convert megabits in megabytes: 0,125
<li>
<br /><br /> <br /><br />
An empty value, or 0, will disable the usage of post process (default). An empty value, or 0, will disable the usage of post process (default).

View File

@ -6,5 +6,13 @@
<h1>Posprocesado</h1> <h1>Posprocesado</h1>
El posprocesado es un valor numérico usado después de obtener el dato para posprocesar dicho dato de forma numérica en una multiplicación. Por ejemplo, datos con un valor de 1000 con un valor de Posprocesado de 1024 darán como resultado un valor final de 1024000. Esto es útil para normalizar los datos, convertir entre unidades, etc. Esto también se puede usar para dividir, usando un valor de multiplicador inferior a 1, como, por ejemplo, 0.001 que dividirá el valor actual por 1000. El posprocesado es un valor numérico usado después de obtener el dato para posprocesar dicho dato de forma numérica en una multiplicación. Por ejemplo, datos con un valor de 1000 con un valor de Posprocesado de 1024 darán como resultado un valor final de 1024000. Esto es útil para normalizar los datos, convertir entre unidades, etc. Esto también se puede usar para dividir, usando un valor de multiplicador inferior a 1, como, por ejemplo, 0.001 que dividirá el valor actual por 1000.
Algunos ejemplos interesantes, son por ejemplo:<br>
<li>Convertir timeticks (SNMP) a Dias: 0.000000115740741
<li>Convertir bytes en MegaBytes: 0,00000095367432
<li>Convertir bytes en GigaBytes: 0,00000000093132
<li>Convertir megabits en megabytes: 0,125
<br /><br /> <br /><br />
Un valor vacío o &laquo;0&raquo; desactivará el uso del posprocesado (predeterminado). Un valor vacío o &laquo;0&raquo; desactivará el uso del posprocesado (predeterminado).

View File

@ -22,9 +22,9 @@ function snmpBrowse () {
var snmp3_auth_user = $('#text-snmp3_browser_auth_user').val(); var snmp3_auth_user = $('#text-snmp3_browser_auth_user').val();
var snmp3_security_level = $('#snmp3_browser_security_level').val(); var snmp3_security_level = $('#snmp3_browser_security_level').val();
var snmp3_auth_method = $('#snmp3_browser_auth_method').val(); var snmp3_auth_method = $('#snmp3_browser_auth_method').val();
var snmp3_auth_pass = $('#text-snmp3_browser_auth_pass').val(); var snmp3_auth_pass = $('#password-snmp3_browser_auth_pass').val();
var snmp3_privacy_method = $('#snmp3_browser_privacy_method').val(); var snmp3_privacy_method = $('#snmp3_browser_privacy_method').val();
var snmp3_privacy_pass = $('#text-snmp3_browser_privacy_pass').val(); var snmp3_privacy_pass = $('#password-snmp3_browser_privacy_pass').val();
var ajax_url = $('#hidden-ajax_url').val(); var ajax_url = $('#hidden-ajax_url').val();
// Prepare the AJAX call // Prepare the AJAX call

View File

@ -2724,7 +2724,7 @@ table#policy_modules td * {
} }
#news_board { #news_board {
width: 750px; width: 530px;
} }
#right_column_logon_ok { #right_column_logon_ok {

View File

@ -63,7 +63,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '5.1'; $version = '5.1';
$build = '140922'; $build = '140923';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -379,7 +379,7 @@ $filter = array(
"id_agente" => $id_agente, "id_agente" => $id_agente,
"id_tipo_modulo" => (int)db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_snmp_proc") "id_tipo_modulo" => (int)db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_snmp_proc")
); );
$modules = agents_get_modules ($id_agente, $columns, $filter); $modules = agents_get_modules($id_agente, $columns, $filter);
if (! empty($modules)) { if (! empty($modules)) {
$table_interface = new stdClass(); $table_interface = new stdClass();
@ -387,7 +387,8 @@ if (! empty($modules)) {
$table_interface->class = 'databox'; $table_interface->class = 'databox';
$table_interface->width = '100%'; $table_interface->width = '100%';
$table_interface->style = array(); $table_interface->style = array();
$table_interface->style[1] = 'width: 30px;'; $table_interface->style['interface_status'] = 'width: 30px;';
$table_interface->style['interface_graph'] = 'width: 20px;';
$table_interface->head = array(); $table_interface->head = array();
$options = array( $options = array(
"class" => "closed", "class" => "closed",
@ -396,7 +397,7 @@ if (! empty($modules)) {
$table_interface->head[0] = html_print_image("images/go.png", true, $options) . "&nbsp;&nbsp;"; $table_interface->head[0] = html_print_image("images/go.png", true, $options) . "&nbsp;&nbsp;";
$table_interface->head[0] .= '<span style="vertical-align: middle;">' . __('Interface information') .' (SNMP)</span>'; $table_interface->head[0] .= '<span style="vertical-align: middle;">' . __('Interface information') .' (SNMP)</span>';
$table_interface->head_colspan = array(); $table_interface->head_colspan = array();
$table_interface->head_colspan[0] = 4; $table_interface->head_colspan[0] = 5;
$table_interface->data = array(); $table_interface->data = array();
foreach ($modules as $key => $module) { foreach ($modules as $key => $module) {
@ -405,7 +406,7 @@ if (! empty($modules)) {
if (preg_match ("/_(.+)$/", (string)$module['nombre'], $matches)) { if (preg_match ("/_(.+)$/", (string)$module['nombre'], $matches)) {
if ($matches[1]) { if ($matches[1]) {
$interface_name = $matches[1]; $interface_name = $matches[1];
$module_id = $module['id_agente_modulo']; $module_id = $module['id_agente_modulo'];
$db_status = modules_get_agentmodule_status($module_id); $db_status = modules_get_agentmodule_status($module_id);
$module_value = modules_get_last_value ($module_id); $module_value = modules_get_last_value ($module_id);
@ -428,12 +429,59 @@ if (! empty($modules)) {
$description = $matches[0]; $description = $matches[0];
} }
} }
// Get the ifInOctets and ifOutOctets modules of the interface
$columns = array(
"id_agente_modulo",
"nombre"
);
$interface_traffic_modules = agents_get_modules($id_agente, $columns, "nombre LIKE 'if%Octets_$interface_name'");
if (!empty($interface_traffic_modules) && count($interface_traffic_modules) >= 2) {
$interface_traffic_modules_aux = array('in' => '', 'out' => '');
foreach ($interface_traffic_modules as $interface_traffic_module) {
if (preg_match ("/if(.+)Octets_$interface_name$/i", (string)$interface_traffic_module['nombre'], $matches)) {
if (strtolower($matches[1]) == 'in') {
$interface_traffic_modules_aux['in'] = $interface_traffic_module['id_agente_modulo'];
}
elseif (strtolower($matches[1]) == 'out') {
$interface_traffic_modules_aux['out'] = $interface_traffic_module['id_agente_modulo'];
}
}
}
if (!empty($interface_traffic_modules_aux['in']) && !empty($interface_traffic_modules_aux['out'])) {
$interface_traffic_modules = $interface_traffic_modules_aux;
}
else {
$interface_traffic_modules = false;
}
}
else {
$interface_traffic_modules = false;
}
if ($interface_traffic_modules != false) {
$params = array(
'interface_name' => $interface_name,
'agent_id' => $id_agente,
'traffic_module_in' => $interface_traffic_modules_aux['in'],
'traffic_module_out' => $interface_traffic_modules_aux['out']
);
$params_json = json_encode($params);
$params_encoded = base64_encode($params_json);
$win_handle = dechex(crc32($module_id.$interface_name));
$graph_link = "<a href=\"javascript:winopeng('operation/agentes/interface_traffic_graph_win.php?params=$params_encoded','$win_handle')\">" .
html_print_image("images/chart_curve.png", true, array("title" => __('Interface traffic'))) . "</a>";
}
else {
$graph_link = "";
}
$data = array(); $data = array();
$data[0] = "<strong>" . $interface_name . "</strong>"; $data['interface_name'] = "<strong>" . $interface_name . "</strong>";
$data[1] = $status; $data['interface_status'] = $status;
$data[2] = $ip_target; $data['interface_graph'] = $graph_link;
$data[3] = $description; $data['interface_ip'] = $ip_target;
$data['interface_mac'] = $description;
$table_interface->data[] = $data; $table_interface->data[] = $data;
} }
} }
@ -446,17 +494,18 @@ if (! empty($modules)) {
$(document).ready (function () { $(document).ready (function () {
$("#agent_interface_info").find("tbody").hide(); $("#agent_interface_info").find("tbody").hide();
$("#agent_interface_info").find("thead").click (function () { $("#agent_interface_info").find("thead").click (function () {
var arrow = $("#agent_interface_info").find("thead").find("img"); var arrow = $("#agent_interface_info").find("thead").find("img");
if (arrow.hasClass("closed")) { if (arrow.hasClass("closed")) {
arrow.removeClass("closed"); arrow.removeClass("closed");
arrow.prop("src", "images/down.png"); arrow.prop("src", "images/down.png");
$("#agent_interface_info").find("tbody").show(); $("#agent_interface_info").find("tbody").show();
} else { } else {
arrow.addClass("closed"); arrow.addClass("closed");
arrow.prop("src", "images/go.png"); arrow.prop("src", "images/go.png");
$("#agent_interface_info").find("tbody").hide(); $("#agent_interface_info").find("tbody").hide();
} }
}); })
.css('cursor', 'pointer');
}); });
</script> </script>
<?php <?php

View File

@ -0,0 +1,272 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
if (! isset($_SESSION['id_usuario'])) {
session_start();
session_write_close();
}
// Global & session management
require_once ('../../include/config.php');
require_once ('../../include/auth/mysql.php');
require_once ($config['homedir'] . '/include/functions.php');
require_once ($config['homedir'] . '/include/functions_db.php');
require_once ($config['homedir'] . '/include/functions_reporting.php');
require_once ($config['homedir'] . '/include/functions_graph.php');
require_once ($config['homedir'] . '/include/functions_custom_graphs.php');
require_once ($config['homedir'] . '/include/functions_modules.php');
// Hash login process
if (! isset ($config['id_user']) && get_parameter("loginhash", 0)) {
$loginhash_data = get_parameter("loginhash_data", "");
$loginhash_user = get_parameter("loginhash_user", "");
if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.$config["loginhash_pwd"])) {
db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']);
$_SESSION['id_usuario'] = $loginhash_user;
$config["id_user"] = $loginhash_user;
$hash_connection_data = true;
}
}
check_login();
$user_language = get_user_language($config['id_user']);
if (file_exists ('../../include/languages/'.$user_language.'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('../../include/languages/'.$user_language.'.mo'));
$l10n->load_tables();
}
echo '<link rel="stylesheet" href="../../include/styles/pandora.css" type="text/css"/>';
$params_json = base64_decode((string) get_parameter('params'));
$params = json_decode($params_json, true);
$interface_name = (string) $params['interface_name'];
$agent_id = (int) $params['agent_id'];
$interface_traffic_modules = array(
'in' => (int) $params['traffic_module_in'],
'out' => (int) $params['traffic_module_out']
);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
// Parsing the refresh before sending any header
$refresh = (int) get_parameter('refresh', SECONDS_10MINUTES);
if ($refresh > 0) {
$query = ui_get_url_refresh(false);
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pandora FMS Graph (<?php echo agents_get_name($agent_id) . ' - ' . $interface_name; ?>)</title>
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
<script type='text/javaScript' src='../../include/javascript/calendar.js'></script>
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-1.9.0.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript'>
<!--
window.onload = function() {
// Hack to repeat the init process to period select
var periodSelectId = $('[name="period"]').attr('class');
period_select_init(periodSelectId);
};
function show_others() {
if (!$("#checkbox-avg_only").attr('checked')) {
$("#hidden-show_other").val(1);
}
else {
$("#hidden-show_other").val(0);
}
}
//-->
</script>
</head>
<body bgcolor="#ffffff" style='background:#ffffff;'>
<?php
// Get input parameters
$period = (int) get_parameter('period', SECONDS_1HOUR);
$width = (int) get_parameter("width", 555);
$height = (int) get_parameter("height", 245);
$start_date = (string) get_parameter("start_date", date("Y-m-d"));
$zoom = (int) get_parameter ("zoom", 1);
$baseline = get_parameter ("baseline", 0);
if ($zoom > 1) {
$height = $height * ($zoom / 2.1);
$width = $width * ($zoom / 1.4);
echo "<script type='text/javascript'>window.resizeTo($width + 120, $height + 320);</script>";
}
$current = date("Y-m-d");
if ($start_date != $current)
$date = strtotime($start_date);
else
$date = $utime;
$urlImage = ui_get_full_url(false);
if ($config['flash_charts'] == 1)
echo '<div style="margin-left: 70px; padding-top: 10px;">';
else
echo '<div style="margin-left: 50px; padding-top: 10px;">';
$modules = array($interface_traffic_modules['in'], $interface_traffic_modules['out']);
custom_graphs_print(0, $height, $width, $period, null, false, $date, false, 'white', $modules, $config['homeurl']);
echo '</div>';
///////////////////////////
// SIDE MENU
///////////////////////////
$side_layer_params = array();
// TOP TEXT
$side_layer_params['top_text'] = "<div style='color: white; width: 100%; text-align: center; font-weight: bold; vertical-align: top;'>" . html_print_image('images/config_mc.png', true, array('width' => '16px')) . ' ' . __('Pandora FMS Graph configuration menu') . "</div>";
$side_layer_params['body_text'] = "<div class='menu_sidebar_outer'>";
$side_layer_params['body_text'] .=__('Please, make your changes and apply with the <i>Reload</i> button');
// MENU
$side_layer_params['body_text'] .= '<form method="get" action="interface_traffic_graph_win.php">';
$side_layer_params['body_text'] .= html_print_input_hidden("params", base64_encode($params_json), true);
if (isset($hash_connection_data)) {
$side_layer_params['body_text'] .= html_print_input_hidden("loginhash", "auto", true);
$side_layer_params['body_text'] .= html_print_input_hidden("loginhash_data", $loginhash_data, true);
$side_layer_params['body_text'] .= html_print_input_hidden("loginhash_user", $loginhash_user, true);
}
// FORM TABLE
$table = html_get_predefined_table('transparent', 2);
$table->width = '98%';
$table->id = 'stat_win_form_div';
$table->style[0] = 'text-align:left; padding: 7px;';
$table->style[1] = 'text-align:left;';
$table->styleTable = 'border-spacing: 4px;';
$table->class = 'alternate';
$data = array();
$data[0] = __('Refresh time');
$data[1] = html_print_extended_select_for_time("refresh", $refresh, '', '', 0, 7, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = __('Begin date');
$data[1] = html_print_input_text ("start_date", substr ($start_date, 0, 10),'', 15, 255, true);
$data[1] .= html_print_image ("images/calendar_view_day.png", true, array ("onclick" => "scwShow(scwID('text-start_date'),this);", "style" => 'vertical-align: bottom;'));
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = __('Time range');
$data[1] = html_print_extended_select_for_time('period', $period, '', '', 0, 7, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = __('Zoom factor');
$options = array();
$options[$zoom] = 'x'.$zoom;
$options[1] = 'x1';
$options[2] = 'x2';
$options[3] = 'x3';
$options[4] = 'x4';
$data[1] = html_print_select($options, "zoom", $zoom, '', '', 0, true);
$table->data[] = $data;
$table->rowclass[] = '';
$form_table = html_print_table($table, true);
unset($table);
$table->id = 'stat_win_form';
$table->width = '100%';
$table->cellspacing = 2;
$table->cellpadding = 2;
$table->class = 'databox';
$data = array();
$data[0] = html_print_div(array('content' => $form_table, 'style' => 'overflow: auto; height: 220px'), true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = '<div style="width:100%; text-align:right;">' . html_print_submit_button (__('Reload'), "submit", false, 'class="sub upd"', true) . "</div>";
$table->data[] = $data;
$table->rowclass[] = '';
$side_layer_params['body_text'] .= html_print_table($table, true);
$side_layer_params['body_text'] .= '</form>';
$side_layer_params['body_text'] .= '</div>'; // outer
// ICONS
$side_layer_params['icon_closed'] = '/images/graphmenu_arrow_hide.png';
$side_layer_params['icon_open'] = '/images/graphmenu_arrow.png';
// SIZE
$side_layer_params['width'] = 500;
// POSITION
$side_layer_params['position'] = 'left';
html_print_side_layer($side_layer_params);
// Hidden div to forced title
html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true));
?>
</body>
</html>
<script>
<?php
//Resize window when show the overview graph.
if ($config['flash_charts']) {
?>
var show_overview = false;
var height_window;
var width_window;
$(document).ready(function() {
height_window = $(window).height();
width_window = $(window).width();
});
$("*").filter(function() {
if (typeof(this.id) == "string")
return this.id.match(/menu_overview_graph.*/);
else
return false;
}).click(function() {
show_overview = !show_overview;
});
<?php
}
?>
forced_title_callback();
</script>

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 5.1 %define version 5.1
%define release 140922 %define release 140923
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 5.1 %define version 5.1
%define release 140922 %define release 140923
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -203,7 +203,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
`plugin_pass` text, `plugin_pass` text,
`plugin_parameter` text, `plugin_parameter` text,
`id_plugin` int(10) default '0', `id_plugin` int(10) default '0',
`post_process` double(18,15) default 0, `post_process` double(24,15) default 0,
`prediction_module` bigint(14) default '0', `prediction_module` bigint(14) default '0',
`max_timeout` int(4) unsigned default '0', `max_timeout` int(4) unsigned default '0',
`max_retries` int(4) unsigned default '0', `max_retries` int(4) unsigned default '0',
@ -707,7 +707,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` (
`custom_string_3` text, `custom_string_3` text,
`custom_integer_1` int(10) default 0, `custom_integer_1` int(10) default 0,
`custom_integer_2` int(10) default 0, `custom_integer_2` int(10) default 0,
`post_process` double(18,15) default 0, `post_process` double(24,15) default 0,
`unit` text, `unit` text,
`wizard_level` enum('basic','advanced','nowizard') default 'nowizard', `wizard_level` enum('basic','advanced','nowizard') default 'nowizard',
`macros` text, `macros` text,

View File

@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('graph_res','5'), ('graph_res','5'),
('step_compact','1'), ('step_compact','1'),
('db_scheme_version','5.1'), ('db_scheme_version','5.1'),
('db_scheme_build','PD140922'), ('db_scheme_build','PD140923'),
('show_unknown','0'), ('show_unknown','0'),
('show_lastalerts','1'), ('show_lastalerts','1'),
('style','pandora'), ('style','pandora'),

View File

@ -1,10 +1,10 @@
package: pandorafms-server package: pandorafms-server
Version: 5.1-140922 Version: 5.1-140923
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin
Installed-Size: 640 Installed-Size: 640
Maintainer: Miguel de Dios <miguel.dedios@artica.es> Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Homepage: http://pandorafms.org/ Homepage: http://pandorafms.org/
Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, snmp-mibs-downloader, libjson-perl, libnet-telnet-perl Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, snmp-mibs-downloader, libjson-perl, libnet-telnet-perl, libencode-locale-perl
Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server. Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server.

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="5.1-140922" pandora_version="5.1-140923"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -516,7 +516,7 @@ sub main() {
pandora_startup (); pandora_startup ();
# Start thread to execute server tasks on the master server # Start thread to execute server tasks on the master server
threads->create('pandora_server_tasks', (\%Config))->detach() if ($Config{"master"} == 1); threads->create('pandora_server_tasks', (\%Config))->detach() if ($Config{"pandora_master"} == 1);
# Generate 'going up' events # Generate 'going up' events
foreach my $server (@Servers) { foreach my $server (@Servers) {

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "5.1"; my $pandora_version = "5.1";
my $pandora_build = "140922"; my $pandora_build = "140923";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 5.1 %define version 5.1
%define release 140922 %define release 140923
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}
@ -28,7 +28,7 @@ Requires: perl-XML-Simple perl-XML-Twig net-snmp-utils
Requires: perl-NetAddr-IP net-snmp net-tools Requires: perl-NetAddr-IP net-snmp net-tools
Requires: perl-IO-Socket-INET6 perl-Socket6 perl-Net-Telnet Requires: perl-IO-Socket-INET6 perl-Socket6 perl-Net-Telnet
Requires: nmap wmic sudo perl-JSON Requires: nmap wmic sudo perl-JSON
Requires: perl-Time-HiRes Requires: perl-Time-HiRes perl-Encode-Locale
%description %description
Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments.

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 5.1 %define version 5.1
%define release 140922 %define release 140923
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}
@ -26,6 +26,7 @@ Requires: perl-DBI perl-DBD-mysql perl-libwww-perl
Requires: perl-NetAddr-IP net-snmp net-tools perl-XML-Twig Requires: perl-NetAddr-IP net-snmp net-tools perl-XML-Twig
Requires: nmap wmic sudo perl-HTML-Tree perl-XML-Simple perl-Net-Telnet Requires: nmap wmic sudo perl-HTML-Tree perl-XML-Simple perl-Net-Telnet
Requires: perl-IO-Socket-INET6 perl-Socket6 snmp-mibs perl-JSON Requires: perl-IO-Socket-INET6 perl-Socket6 snmp-mibs perl-JSON
Requires: perl-Encode-Locale
%description %description

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "5.1 PS140922"; my $version = "5.1 PS140923";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -34,7 +34,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "5.1 PS140922"; my $version = "5.1 PS140923";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);