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

This commit is contained in:
mdtrooper 2016-04-04 12:21:56 +02:00
commit 90be5b42a6
38 changed files with 347 additions and 91 deletions

View File

@ -1,5 +1,7 @@
<a href="http://pandorafms.com"><img src="http://pandorafms.com/github/logo_2.png" align="left" hspace="10" vspace="6"></a>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. 
<br />
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.
<br />
<br />
###How to install Pandora FMS

View File

@ -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 <mysql-build@oss.oracle.com>" imported
RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 6.1dev-160330
Version: 6.1dev-160404
Architecture: all
Priority: optional
Section: admin

View File

@ -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-160404"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -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 => '160404';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 6.1dev
%define release 160330
%define release 160404
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 6.1dev
%define release 160330
%define release 160404
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="6.1dev"
PI_BUILD="160330"
PI_BUILD="160404"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{160330}
{160404}
ViewReadme
{Yes}

View File

@ -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 160404)")
string pandora_path;
string pandora_dir;

View File

@ -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 160404))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 6.1dev-160330
Version: 6.1dev-160404
Architecture: all
Priority: optional
Section: admin

View File

@ -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-160404"
package_pear=0
package_pandora=1

View File

@ -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;

View File

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

View File

@ -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') {

View File

@ -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;
}
?>

View File

@ -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) {

View File

@ -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

View File

@ -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;
}

View File

@ -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 = "<div class='parent_graph' style='width: " . $width . "px; " . $background_style . "'>";
// Set some containers to legend, graph, timestamp tooltip, etc.
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:".$font_size."pt'></p>";
// 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//]]>";

View File

@ -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); }

View File

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

View File

@ -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 = "";

View File

@ -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"]) {

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 6.1dev
%define release 160330
%define release 160404
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 6.1dev
%define release 160330
%define release 160404
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -65,7 +65,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5');
INSERT INTO tconfig (token, value) VALUES ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','6.1dev');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160330');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160404');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora');

View File

@ -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',

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 6.1dev-160330
Version: 6.1dev-160404
Architecture: all
Priority: optional
Section: admin

View File

@ -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-160404"
package_cpan=0
package_pandora=1

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 6.1dev
%define release 160330
%define release 160404
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 6.1dev
%define release 160330
%define release 160404
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="6.1dev"
PI_BUILD="160330"
PI_BUILD="160404"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB;
# version: define current version
my $version = "6.1dev PS160330";
my $version = "6.1dev PS160404";
# Pandora server configuration
my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "6.1dev PS160330";
my $version = "6.1dev PS160404";
# save program name for logging
my $progname = basename($0);
@ -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";
}
}

View File

@ -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