Merge branch 'develop' into ipmi-recon

This commit is contained in:
Robert Nelson 2015-05-26 16:49:54 -07:00
commit 6cb383b2e1
64 changed files with 371979 additions and 513148 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 6.0dev-150525 Version: 6.0dev-150527
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="6.0dev-150525" pandora_version="6.0dev-150527"
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 => '6.0dev'; use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150525'; use constant AGENT_BUILD => '150527';
# 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 6.0dev %define version 6.0dev
%define release 150525 %define release 150527
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 6.0dev %define version 6.0dev
%define release 150525 %define release 150527
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
{150525} {150527}
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 ("6.0dev(Build 150525)") #define PANDORA_VERSION ("6.0dev(Build 150527)")
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", "(6.0dev(Build 150525))" VALUE "ProductVersion", "(6.0dev(Build 150527))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 6.0dev-150525 Version: 6.0dev-150527
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="6.0dev-150525" pandora_version="6.0dev-150527"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -508,6 +508,9 @@ switch ($action) {
break; break;
default: default:
if (enterprise_installed()) { if (enterprise_installed()) {
if ($image !== null) {
$values['image'] = $image;
}
enterprise_ajax_update_values($action, $type, $values); enterprise_ajax_update_values($action, $type, $values);
} }
break; break;

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC150525'; $build_version = 'PC150527';
$pandora_version = 'v6.0dev'; $pandora_version = 'v6.0dev';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -464,30 +464,20 @@ function human_time_description_raw ($seconds, $exactly = false, $units = 'large
$returnTime .= "$hours $hoursString "; $returnTime .= "$hours $hoursString ";
} }
$mins = floor($seconds / SECONDS_1MINUTE); $mins = floor($seconds / 60);
if ($mins != 0) { if ($mins != 0) {
$seconds = $seconds - ($mins * SECONDS_1MINUTE); $seconds = $seconds - ($mins * 60);
if ($hours == 0) {
$returnTime .= "$mins $minutesString "; $returnTime .= "$mins $minutesString ";
} }
else {
$returnTime = sprintf("%02d",$hours) . ':' . $seconds = (int) $seconds;
sprintf("%02d",$mins);
}
}
if ($seconds != 0) { if ($seconds != 0) {
if ($hours == 0) {
$returnTime .= "$seconds $secondsString "; $returnTime .= "$seconds $secondsString ";
} }
else {
$returnTime = sprintf("%02d",$hours) . ':' .
sprintf("%02d",$mins) . ':' .
sprintf("%02d",$seconds);
}
}
$return = ' '; $return = ' ';

View File

@ -1458,7 +1458,7 @@ function config_check () {
} }
if ($_SESSION['new_update'] == 'new') { if ($_SESSION['new_update'] == 'new') {
set_pandora_error_for_header( set_pandora_error_for_header(
__('There is a new update please go to menu Administration and into extensions <a style="font-weight:bold;" href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online">go to Update Manager</a> for more details.'), __('There is a new update available. Please<a style="font-weight:bold;" href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online"> go to Administration:Setup:Update Manager</a> for more details.'),
__("New update of Pandora Console")); __("New update of Pandora Console"));
} }
} }

View File

@ -2141,14 +2141,8 @@ function modules_get_count_datas($id_agent_module, $date_init, $date_end) {
return ($diff / $interval); return ($diff / $interval);
} }
function modules_get_data_with_value($id_agent_module, $date_init, function modules_get_count_data_with_value($id_agent_module, $date_init,
$date_end, $value, $split_interval = false) { $date_end, $value) {
global $config;
// TODO REMOVE THE TIME IN PLANNED DOWNTIME
// TODO FOR OTHER KIND OF DATA
if (!is_numeric($date_init)) { if (!is_numeric($date_init)) {
$date_init = strtotime($date_init); $date_init = strtotime($date_init);
@ -2158,58 +2152,50 @@ function modules_get_data_with_value($id_agent_module, $date_init,
$date_end = strtotime($date_end); $date_end = strtotime($date_end);
} }
$sql = " $sql = "SELECT *
SELECT *
FROM tagente_datos FROM tagente_datos
WHERE WHERE
datos = " . (int)$value . " id_agente_modulo = " . (int)$id_agent_module . "
AND id_agente_modulo = " . (int)$id_agent_module . "
AND (utimestamp >= " . $date_init . " AND utimestamp <= " . $date_end . ")"; AND (utimestamp >= " . $date_init . " AND utimestamp <= " . $date_end . ")";
$data = db_get_all_rows_sql($sql, $data = db_get_all_rows_sql($sql, $config['history_db_enabled']);
$config['history_db_enabled']);
if (empty($data)) { if (empty($data)) {
$data = array(); $data = array();
} }
if ($split_interval) {
$temp = array();
$previous_utimestamp = false;
foreach ($data as $row) {
if ($previous_utimestamp === false) {
$previous_utimestamp = $row['utimestamp'];
$temp[] = $row;
}
else {
$diff = $row['utimestamp'] - $previous_utimestamp;
$interval = modules_get_interval($id_agent_module); $interval = modules_get_interval($id_agent_module);
if ($diff > $interval) { $total_time_with_value = 0;
$fake_count = (int)($diff / $interval); $on_value_detected = false;
$timestamp_with_value = null;
$fake = $row; foreach ($data as $row) {
for ($iterator = 1; $iterator <= $fake_count; $iterator++) { if ($row['datos'] == $value) {
$fake['utimestamp'] = $previous_utimestamp + ($iterator * $interval); if (!$on_value_detected) {
$temp[] = $fake; $timestamp_with_value = $row['utimestamp'];
$on_value_detected = true;
} }
} }
else { else {
$temp[] = $row; if ($on_value_detected) {
} $total_time_with_value
+= $row['utimestamp'] - $timestamp_with_value;
$previous_utimestamp = $row['utimestamp']; $on_value_detected = false;
$data = $temp;
} }
} }
} }
return $data; if ($on_value_detected && !empty($data)) {
$total_time_with_value
+= $date_end - $timestamp_with_value;
} }
return $total_time_with_value / $interval;
}
function modules_get_first_contact_date($id_agent_module) { function modules_get_first_contact_date($id_agent_module) {
global $config; global $config;

View File

@ -3715,12 +3715,11 @@ function reporting_availability($report, $content) {
$percent_ok = 0; $percent_ok = 0;
} }
else { else {
$count_fails = count( $count_fails = modules_get_count_data_with_value(
modules_get_data_with_value(
$item['id_agent_module'], $item['id_agent_module'],
$report["datetime"] - $content['period'], $report["datetime"] - $content['period'],
$report["datetime"], $report["datetime"],
0, true)); 0);
$percent_ok = (($count_checks - $count_fails) * 100) / $count_checks; $percent_ok = (($count_checks - $count_fails) * 100) / $count_checks;
$percent_fail = 100 - $percent_ok; $percent_fail = 100 - $percent_ok;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150525 %define release 150527
# 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 6.0dev %define version 6.0dev
%define release 150525 %define release 150527
%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

@ -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','6.0dev'), ('db_scheme_version','6.0dev'),
('db_scheme_build','PD150525'), ('db_scheme_build','PD150527'),
('show_unknown','0'), ('show_unknown','0'),
('show_lastalerts','1'), ('show_lastalerts','1'),
('style','pandora'), ('style','pandora'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 6.0dev-150525 Version: 6.0dev-150527
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="6.0dev-150525" pandora_version="6.0dev-150527"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

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 = "6.0dev"; my $pandora_version = "6.0dev";
my $pandora_build = "150525"; my $pandora_build = "150527";
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 6.0dev %define version 6.0dev
%define release 150525 %define release 150527
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0dev %define version 6.0dev
%define release 150525 %define release 150527
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

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 = "6.0dev PS150525"; my $version = "6.0dev PS150527";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "6.0dev PS150525"; my $version = "6.0dev PS150527";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);