Merge branch 'develop' into feature/alias_friendly_name

This commit is contained in:
Alejandro Gallardo Escobar 2017-02-20 18:52:18 +01:00
commit 58617c00aa
45 changed files with 297 additions and 202 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0dev-170217 Version: 7.0dev-170220
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="7.0dev-170217" pandora_version="7.0dev-170220"
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 => '7.0dev'; use constant AGENT_VERSION => '7.0dev';
use constant AGENT_BUILD => '170217'; use constant AGENT_BUILD => '170220';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0dev %define version 7.0dev
%define release 170217 %define release 170220
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 7.0dev %define version 7.0dev
%define release 170217 %define release 170220
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0dev" PI_VERSION="7.0dev"
PI_BUILD="170217" PI_BUILD="170220"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{170217} {170220}
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 ("7.0dev(Build 170217)") #define PANDORA_VERSION ("7.0dev(Build 170220)")
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", "(7.0dev(Build 170217))" VALUE "ProductVersion", "(7.0dev(Build 170220))"
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: 7.0dev-170217 Version: 7.0dev-170220
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="7.0dev-170217" pandora_version="7.0dev-170220"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -218,35 +218,52 @@ function mainAgentsModules() {
if($agents_id[0] != -1){ if($agents_id[0] != -1){
$agents = $agents_id; $agents = $agents_id;
$all_modules = array();
$total_pagination = count($agents);
foreach ($modules_selected as $key => $value) {
$all_modules[$value] = io_safe_output(modules_get_agentmodule_name($value));
}
} }
else { else {
$agents = ''; $agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0)); $agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents); $agents = array_keys($agents);
$filter_module_group = array('disabled' => 0); }
if ($modulegroup > 0) { $filter_module_group = array('disabled' => 0);
$filter_module_group['id_module_group'] = $modulegroup;
if ($modulegroup > 0) {
$filter_module_group['id_module_group'] = $modulegroup;
}
$count = 0;
foreach ($agents as $agent) {
$module = agents_get_modules($agent, false,
$filter_module_group, true, true);
if ($module == false) {
unset($agents[$count]);
} }
$count = 0; $count++;
foreach ($agents as $agent) { }
$module = agents_get_modules($agent, false, $total_pagination = count($agents);
$filter_module_group, true, false);
if ($module == false) { if($agents_id[0] != -1){
unset($agents[$count]); $all_modules = array();
foreach ($modules_selected as $key => $value) {
//$all_modules[$value] = io_safe_output(modules_get_agentmodule_name($value));
$name = modules_get_agentmodule_name($value);
$sql = "SELECT id_agente_modulo
FROM tagente_modulo
WHERE nombre = '". $name ."';";
$result_sql = db_get_all_rows_sql($sql);
if(is_array($result_sql)){
foreach ($result_sql as $key => $value) {
$all_modules[$value['id_agente_modulo']] = io_safe_output($name);
}
} }
$count++;
} }
$total_pagination = count($agents); }
else{
$all_modules = agents_get_modules($agents, false, $all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false); $filter_module_group, true, true);
} }
$modules_by_name = array(); $modules_by_name = array();
@ -400,7 +417,7 @@ function mainAgentsModules() {
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>" . <a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>" .
$alias['alias'] . $alias['alias'] .
"</a></td>"; "</a></td>";
$agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, false); $agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true);
$nmodules = 0; $nmodules = 0;
@ -412,6 +429,7 @@ function mainAgentsModules() {
} }
$match = false; $match = false;
foreach ($module['id'] as $module_id) { foreach ($module['id'] as $module_id) {
if (!$match && array_key_exists($module_id,$agent_modules)) { if (!$match && array_key_exists($module_id,$agent_modules)) {
$status = modules_get_agentmodule_status($module_id); $status = modules_get_agentmodule_status($module_id);
@ -442,9 +460,14 @@ function mainAgentsModules() {
case AGENT_MODULE_STATUS_UNKNOWN: case AGENT_MODULE_STATUS_UNKNOWN:
ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
break; break;
case 4: case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT:
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
ui_print_status_image ('module_alertsfired.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px')); ui_print_status_image ('module_alertsfired.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
break; break;
case 4:
ui_print_status_image ('module_no_data.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
break;
} }
echo '</a>'; echo '</a>';
echo "</td>"; echo "</td>";
@ -471,6 +494,7 @@ function mainAgentsModules() {
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module has a warning status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module has a warning status") . "</td></tr>";
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module has a normal status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module has a normal status") . "</td></tr>";
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module has an unknown status") . "</td></tr>"; echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module has an unknown status") . "</td></tr>";
echo "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NOTINIT . ";'></div></td><td>" . __("Cell turns grey when the module is in 'not initialize' status") . "</td></tr>";
echo "</table>"; echo "</table>";
echo "</div>"; echo "</div>";
@ -567,7 +591,7 @@ extensions_add_main_function('mainAgentsModules');
); );
}); });
$("#id_agents2").change (function(){ $("#id_agents2").click (function(){
selection_agent_module(); selection_agent_module();
}); });
@ -595,7 +619,6 @@ extensions_add_main_function('mainAgentsModules');
}); });
selection_agent_module(); selection_agent_module();
}); });
function selection_agent_module() { function selection_agent_module() {
@ -618,6 +641,6 @@ extensions_add_main_function('mainAgentsModules');
} }
}, },
"json" "json"
); );
} }
</script> </script>

View File

@ -157,7 +157,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 0); INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 0);
UPDATE tconfig SET value = 'https://firefly.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents` -- Table `tplanned_downtime_agents`

View File

@ -80,7 +80,7 @@ INSERT INTO tconfig (token, value) VALUES ('big_operation_step_datos_purge', '10
INSERT INTO tconfig (token, value) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO tconfig (token, value) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO tconfig (token, value) VALUES ('days_autodisable_deletion', '30'); INSERT INTO tconfig (token, value) VALUES ('days_autodisable_deletion', '30');
INSERT INTO tconfig (token, value) VALUES ('MR', 0); INSERT INTO tconfig (token, value) VALUES ('MR', 0);
UPDATE tconfig SET value = 'https://firefly.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents` -- Table `tplanned_downtime_agents`

View File

@ -152,23 +152,21 @@ foreach ($filters as $filter) {
} }
if (isset($data)) { if (isset($data)) {
html_print_table ($table); echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/events&amp;pure=".$config['pure']."'>";
html_print_input_hidden('multiple_delete', 1);
html_print_table ($table);
if(!is_metaconsole())
echo "<div style='padding-bottom: 20px; text-align: right;'>";
else
echo "<div style='float:right; '>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo "</div>";
echo "</form>";
} }
else { else {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined filters') ) ); ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined filters') ) );
} }
if (isset($data)) {
echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/events&amp;pure=".$config['pure']."'>";
html_print_input_hidden('multiple_delete', 1);
if(!is_metaconsole())
echo "<div style='padding-bottom: 20px; text-align: right;'>";
else
echo "<div style='float:right; '>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo "</div>";
echo "</form>";
}
if(!defined("METACONSOLE")) if(!defined("METACONSOLE"))
echo "<div style='padding-bottom: 20px; text-align: right; width:100%;'>"; echo "<div style='padding-bottom: 20px; text-align: right; width:100%;'>";
else else
@ -181,11 +179,11 @@ echo "</div>";
<script type="text/javascript"> <script type="text/javascript">
function check_all_checkboxes() { function check_all_checkboxes() {
if ($("input[name=all_delete]").attr('checked')) { if ($("#checkbox-all_delete").prop("checked")) {
$(".check_delete").attr('checked', true); $(".check_delete").prop('checked', true);
} }
else { else {
$(".check_delete").attr('checked', false); $(".check_delete").prop('checked', false);
} }
} }
</script> </script>

View File

@ -150,7 +150,7 @@ echo "<td style='vertical-align: top;'>".__('Modules')."</td>";
echo "</tr><tr>"; echo "</tr><tr>";
echo "<td>".html_print_select (agents_get_group_agents(), 'id_agents[]', 0, false, '', '', true, true, true, '', false, '')."</td>"; echo "<td>".html_print_select (agents_get_group_agents(), 'id_agents[]', 0, false, '', '', true, true, true, '', false, '')."</td>";
echo "<td style='vertical-align: center; text-align: center;'>" . html_print_image("images/darrowright.png", true) . "</td>"; echo "<td style='vertical-align: center; text-align: center;'>" . html_print_image("images/darrowright.png", true) . "</td>";
echo "<td>".html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px;')."</td>"; echo "<td>".html_print_select (array (), 'module[]', 0, false, '', 0, true, true, true, '', false, '')."</td>";
echo "</tr><tr>"; echo "</tr><tr>";
echo "<td colspan='3'>"; echo "<td colspan='3'>";
echo "<table cellpadding='4'><tr>"; echo "<table cellpadding='4'><tr>";

View File

@ -95,12 +95,26 @@ if (defined('METACONSOLE')) {
$table->align[1] = 'left'; $table->align[1] = 'left';
} }
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->size[0] = '20%';
$table->size[1] = '20%';
$table->size[1] = '50%';
$table->data = array (); $table->data = array ();
$table->data[0][0] = __('Name:') . $table->data[0][0] = __('Name:') .
ui_print_help_tip(__("Use [ or ( as first character, for example '[*] Map name', to render this map name in main menu"), true); ui_print_help_tip(__("Use [ or ( as first character, for example '[*] Map name', to render this map name in main menu"), true);
$table->data[0][1] = html_print_input_text('name', $visualConsoleName, $table->data[0][1] = html_print_input_text('name', $visualConsoleName,
'', 80, 100, true); '', 80, 100, true);
$table->rowspan[0][2] = 6;
if ($action == 'new') {
$table->data[0][2] = '<img id="imagen" style="display:none;"
src="">';
}
else {
$table->data[0][2] = '<img id="imagen" style="width:230px;"
src="images/console/background/'.$background.'">';
}
$table->data[1][0] = __('Group:'); $table->data[1][0] = __('Group:');
$groups = users_get_groups ($config['id_user'], 'RW'); $groups = users_get_groups ($config['id_user'], 'RW');
@ -125,36 +139,31 @@ $table->data[3][0] = __('Background image');
$table->data[3][1] = html_print_input_file('background_image',true); $table->data[3][1] = html_print_input_file('background_image',true);
$table->data[4][0] = __('Background color'); $table->data[4][0] = __('Background color');
if($action == 'new'){ if ($action == 'new') {
$table->data[4][1] .= html_print_input_text ('background_color', 'white', '', 8, 8, true); $table->data[4][1] .= html_print_input_text ('background_color',
'white', '', 8, 8, true);
} }
else{ else {
$table->data[4][1] .= html_print_input_text ('background_color', $background_color, '', 8, 8, true); $table->data[4][1] .= html_print_input_text ('background_color',
$background_color, '', 8, 8, true);
} }
$table->data[5][0] = __('Size - (Width x Height)'); $table->data[5][0] = __('Size - (Width x Height)');
if($action == 'new'){ $table->data[5][1] = '<button id="modsize"
$table->data[5][1] = '<button id="modsize" style="margin-right:20px;" value="modsize">Set custom size</button>'; style="margin-right:20px;" value="modsize">' .
} __('Set custom size') . '</button>';
else{
$table->data[5][1] = '<button id="modsize" style="margin-right:20px;" value="modsize">Set custom size</button>';
}
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.html_print_input_text('width', 1024, '', 10, 10, true , false) . $table->data[5][1] .= '<span class="opt" style="visibility:hidden;">' .
' x ' . html_print_input_text('width', 1024, '', 10, 10, true , false) .
' x ' .
html_print_input_text('height', 768, '', 10, 10, true, false).'</span>'; html_print_input_text('height', 768, '', 10, 10, true, false).'</span>';
if($action == 'new'){ $table->data[5][1] .= '<span class="opt" style="visibility:hidden;">
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.'<button id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>'.'</span>'; <button id="getsize" style="margin-left:20px;"
} value="modsize">' . __('Set default size') .
else{ '</button></span>';
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.'<button id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>'.'</span>';
}
$table->data[5][2] = '<img id="imagen" style="display:none" src="images/console/background/'.$background.'">';
$table->data[0][3] = $table->data[0][4] = $table->data[0][5] = '';
if ($action == 'new') { if ($action == 'new') {
$textButtonSubmit = __('Save'); $textButtonSubmit = __('Save');
$classButtonSubmit = 'sub wand'; $classButtonSubmit = 'sub wand';
@ -166,18 +175,10 @@ else {
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: ' . $table->width . '">';
if($action == 'new'){ html_print_submit_button ($textButtonSubmit, 'update_layout', false,
html_print_submit_button ($textButtonSubmit, 'update_layout', false, 'class="' . $classButtonSubmit . '"');
'class="' . $classButtonSubmit . '"'); echo '</div>';
}
else{
html_print_submit_button ($textButtonSubmit, 'update_layout', false,
'class="' . $classButtonSubmit . '"');
}
echo '</div>';
echo "</form>"; echo "</form>";
?> ?>
@ -188,46 +189,60 @@ echo "</form>";
$(document).ready (function () { $(document).ready (function () {
$("#modsize").click(function(event){ $("#modsize").click(function(event){
event.preventDefault(); event.preventDefault();
if($('.opt').css('visibility') == 'hidden'){ if($('.opt').css('visibility') == 'hidden'){
$('.opt').css('visibility','visible'); $('.opt').css('visibility','visible');
} }
if ($('#imagen').attr('src') != '') {
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
}
});
$("#getsize").click(function(event){
event.preventDefault();
$('input[name=width]').val($('#imagen').width()); $('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height()); $('input[name=height]').val($('#imagen').height());
});
}); $("#background").change(function() {
$('#imagen').attr('src','images/console/background/'+$('#background').val());
$('#imagen').width(230);
$('#imagen').show();
});
$("#getsize").click(function(event){ $( "input[type=submit]" ).click(function( event ) {
event.preventDefault(); if($( "#getsize" ).css('visibility')=='hidden'){
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
}
});
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
}); $("#file-background_image").change(function(){
readURL(this);
});
$("#background").click(function(event){ function readURL(input) {
$('#imagen').attr('src','images/console/background/'+$('#background').val()); if (input.files && input.files[0]) {
}); var reader = new FileReader();
reader.onload = function (e) {
$( "input[type=submit]" ).click(function( event ) { $('#imagen').attr('src', e.target.result);
$('#imagen').width(230);
if($( "#getsize" ).css('visibility')=='hidden'){ $('#imagen').show();
$('input[name=width]').val($('#imagen').width()); }
$('input[name=height]').val($('#imagen').height()); reader.readAsDataURL(input.files[0]);
}
} }
$("#imgInp").change(function(){
readURL(this);
});
}); $("#text-background_color").attachColorPicker();
$("#file-background_image").change(function(event){
$('#back').submit();
});
$("#text-background_color").attachColorPicker();
}); });

View File

@ -971,18 +971,18 @@ function loadFieldsFromDB(item) {
} }
if (key == 'type_graph') { if (key == 'type_graph') {
$("select[name=type_graph]").val(val); $("select[name=type_graph]").val(val);
} }
if (key == 'label_position') { if (key == 'label_position') {
$('#labelposup'+" img").attr('src','/pandora_console/images/label_up.png'); $('#labelposup'+" img").attr('src','/pandora_console/images/label_up.png');
$('#labelposdown'+" img").attr('src','/pandora_console/images/label_down.png'); $('#labelposdown'+" img").attr('src','/pandora_console/images/label_down.png');
$('#labelposleft'+" img").attr('src','/pandora_console/images/label_left.png'); $('#labelposleft'+" img").attr('src','/pandora_console/images/label_left.png');
$('#labelposright'+" img").attr('src','/pandora_console/images/label_right.png'); $('#labelposright'+" img").attr('src','/pandora_console/images/label_right.png');
$('.labelpos').attr('sel','no'); $('.labelpos').attr('sel','no');
$('#labelpos'+val+" img").attr('src','/pandora_console/images/label_'+$('#labelpos'+val).attr('id').replace('labelpos','')+'_2.png'); $('#labelpos'+val+" img").attr('src','/pandora_console/images/label_'+$('#labelpos'+val).attr('id').replace('labelpos','')+'_2.png');
$('#labelpos'+val).attr('sel','yes'); $('#labelpos'+val).attr('sel','yes');
} }
if (key == 'image') { if (key == 'image') {
//Load image preview //Load image preview
@ -1166,6 +1166,13 @@ function setAspectRatioBackground(side) {
old_width = parseInt($("#background").css('width').replace('px', '')); old_width = parseInt($("#background").css('width').replace('px', ''));
old_height = parseInt($("#background").css('height').replace('px', '')); old_height = parseInt($("#background").css('height').replace('px', ''));
if (old_width < 1024) {
old_width = 1024;
}
if (old_height < 768) {
old_height = 768;
}
img_width = data[0]; img_width = data[0];
img_height = data[1]; img_height = data[1];
@ -2976,22 +2983,44 @@ function eventsBackground() {
if (!is_opened_palette) { if (!is_opened_palette) {
unselectAll(); unselectAll();
var launch_message = false;
var dont_resize = false;
var values = {}; var values = {};
values['width'] = $('#background').css('width').replace('px', ''); var actual_width = $('#background').css('width').replace('px', '');
values['height'] = $('#background').css('height').replace('px', ''); var actual_height = $('#background').css('height').replace('px', '');
updateDB('background', 0, values, 'resizestop'); if (actual_width < 1024) {
actual_width = 1024;
$('#background').css('width', 1024);
launch_message = true;
dont_resize = true;
}
if (actual_height < 768) {
actual_height = 768;
$('#background').css('height', 768);
launch_message = true;
dont_resize = true;
}
width = ui.size['width']; values['width'] = actual_width;
height = ui.size['height']; values['height'] = actual_height;
original_width = ui.originalSize['width']; if (!dont_resize) {
original_height = ui.originalSize['height']; updateDB('background', 0, values, 'resizestop');
move_elements_resize(original_width, original_height, width, height); width = ui.size['width'];
height = ui.size['height'];
$('#background_grid').css('width', width); original_width = ui.originalSize['width'];
$('#background_grid').css('height', height); original_height = ui.originalSize['height'];
move_elements_resize(original_width, original_height, width, height);
$('#background_grid').css('width', width);
$('#background_grid').css('height', height);
}
if (launch_message)
alert($('#hidden-message_size').val());
} }
}); });

View File

@ -140,6 +140,7 @@ $backgroundSizes = getimagesize(
html_print_input_hidden('background_original_width', $backgroundSizes[0]); html_print_input_hidden('background_original_width', $backgroundSizes[0]);
html_print_input_hidden('background_original_height', $backgroundSizes[1]); html_print_input_hidden('background_original_height', $backgroundSizes[1]);
html_print_input_hidden('id_visual_console', $visualConsole['id']); html_print_input_hidden('id_visual_console', $visualConsole['id']);
html_print_input_hidden('message_size', __('Please min size recommend is 1024x768'));
// Loading dialog // Loading dialog

View File

@ -174,7 +174,7 @@ switch ($activeTab) {
if ($uploadOK == 1) { if ($uploadOK == 1) {
if (move_uploaded_file($_FILES["background_image"]["tmp_name"], $target_file)) { if (move_uploaded_file($_FILES["background_image"]["tmp_name"], $target_file)) {
$background = $_FILES["background_image"]["name"]; $background = $nameImage;
$values['background'] = $background; $values['background'] = $background;
$error2 = chmod($target_file, 0644); $error2 = chmod($target_file, 0644);
$uploadOK = $error2; $uploadOK = $error2;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC170217'; $build_version = 'PC170220';
$pandora_version = 'v7.0dev'; $pandora_version = 'v7.0dev';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.
@ -166,7 +166,7 @@ if (!isset($config['inventory_changes_blacklist'])) {
//NEW UPDATE MANAGER URL //NEW UPDATE MANAGER URL
if (!isset($config['url_update_manager'])) { if (!isset($config['url_update_manager'])) {
config_update_value('url_update_manager', config_update_value('url_update_manager',
'https://firefly.artica.es/pandoraupdate7/server.php'); 'https://licensing.artica.es/pandoraupdate7/server.php');
} }
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {

View File

@ -755,12 +755,12 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
. __('Avg') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])) . ($unit ? ' ' . $unit : ''); . __('Avg') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])) . ($unit ? ' ' . $unit : '');
} }
else if (!$avg_only) { else if (!$avg_only) {
$legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['max']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['max']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['max']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['max']['min'], $config['graph_precision'])).' '.$unit; $legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['max']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['max']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['max']['min'], $config['graph_precision'])).' '.$unit;
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
$legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['min']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['min']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['min']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['min']['min'], $config['graph_precision'])).' '.$unit; $legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['min']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['min']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['min']['min'], $config['graph_precision'])).' '.$unit;
} }
else { else {
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit; $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
} }
//Baseline was replaced by compare graph feature //Baseline was replaced by compare graph feature
/*if ($baseline) { /*if ($baseline) {

View File

@ -1409,7 +1409,9 @@ function reporting_html_agent_module($table, $item) {
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'));
break; break;
case AGENT_STATUS_ALERT_FIRED: case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT:
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
$table_data .= ui_print_status_image( $table_data .= ui_print_status_image(
'module_alertsfired.png', 'module_alertsfired.png',
__("%s in %s : ALERTS FIRED", __("%s in %s : ALERTS FIRED",
@ -1417,6 +1419,14 @@ function reporting_html_agent_module($table, $item) {
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'));
break; break;
case 4:
$table_data .= ui_print_status_image(
'module_no_data.png',
__("%s in %s : Not initialize",
$module_name,
$row['agent_name']),
true, array('width' => '20px', 'height' => '20px'));
break;
} }
$table_data .= "</td>"; $table_data .= "</td>";
} }
@ -1435,6 +1445,7 @@ function reporting_html_agent_module($table, $item) {
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module has a warning status") . "</td></tr>"; $table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_WARNING . ";'></div></td><td>" . __("Yellow cell when the module has a warning status") . "</td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module has a normal status") . "</td></tr>"; $table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NORMAL . ";'></div></td><td>" . __("Green cell when the module has a normal status") . "</td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module has an unknown status") . "</td></tr>"; $table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_UNKNOWN . ";'></div></td><td>" . __("Grey cell when the module has an unknown status") . "</td></tr>";
$table_data .= "<tr><td class='legend_square_simple'><div style='background-color: " . COL_NOTINIT . ";'></div></td><td>" . __("Cell turns grey when the module is in 'not initialize' status") . "</td></tr>";
$table_data .= "</table>"; $table_data .= "</table>";
$table_data .= "</div>"; $table_data .= "</div>";

View File

@ -123,7 +123,7 @@ function visual_map_print_item($mode = "read", $layoutData,
} }
$agentname = agents_get_name(agents_get_module_id ($id_module)); $agentname = agents_get_name(agents_get_module_id ($id_module));
$label = str_replace($agentname,ui_print_truncate_text($agentname, 'agent_small', false, true, false, '…', false),$label); $label = str_replace(ui_print_truncate_text($agentname, 'agent_small', false, true, false, '…', false), $agentname, $label);
$text = '<span id="text_' . $id . '" class="text">' . $label .'</span>'; $text = '<span id="text_' . $id . '" class="text">' . $label .'</span>';
if($height == 0){ if($height == 0){

View File

@ -1537,7 +1537,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
hoverable: true, hoverable: true,
clickable: true, clickable: true,
borderWidth:1, borderWidth:1,
borderColor: '#666', borderColor: '#C1C1C1',
tickColor: background_color, tickColor: background_color,
markings: markings, markings: markings,
color: legend_color color: legend_color
@ -2198,10 +2198,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src')); set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src'));
} }
adjust_menu(graph_id, plot, parent_height); adjust_menu(graph_id, plot, parent_height, width);
} }
function adjust_menu(graph_id, plot, parent_height) { function adjust_menu(graph_id, plot, parent_height, width) {
if ($('#'+graph_id+' .xAxis .tickLabel').eq(0).css('width') != undefined) { if ($('#'+graph_id+' .xAxis .tickLabel').eq(0).css('width') != undefined) {
left_ticks_width = $('#'+graph_id+' .xAxis .tickLabel').eq(0).css('width').split('px')[0]; left_ticks_width = $('#'+graph_id+' .xAxis .tickLabel').eq(0).css('width').split('px')[0];
} }
@ -2234,7 +2234,7 @@ function adjust_menu(graph_id, plot, parent_height) {
//$('#legend_' + graph_id).css('width',plot.width()); //$('#legend_' + graph_id).css('width',plot.width());
$('#menu_' + graph_id) $('#menu_' + graph_id)
.css('left',plot.width() - $('#menu_'+graph_id).width() + 10); .css('left',width - $('#menu_'+graph_id).width());
$('#menu_' + graph_id).show(); $('#menu_' + graph_id).show();
} }
@ -2251,10 +2251,10 @@ function set_watermark(graph_id, plot, watermark_src) {
if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) { if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) {
down_ticks_height = $('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height').split('px')[0]; down_ticks_height = $('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height').split('px')[0];
} }
//var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width; var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width;
//var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height;
var left_pos = 380;
var top_pos = 6; var top_pos = 6;
//var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height;
//var left_pos = 380;
context.drawImage(this, left_pos, top_pos); context.drawImage(this, left_pos, top_pos);
}, false); }, false);

View File

@ -246,7 +246,6 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
"style='display: none; " . "style='display: none; " .
"text-align: center; " . "text-align: center; " .
"width: " . $menu_width . "px; ". "width: " . $menu_width . "px; ".
"border: solid 1px #666; ".
"border-bottom: 0px; " . "border-bottom: 0px; " .
"padding: 4px 4px 4px 4px;margin-bottom:5px;'> "padding: 4px 4px 4px 4px;margin-bottom:5px;'>
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross_grey.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>"; <a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross_grey.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";

View File

@ -1560,7 +1560,7 @@ function show_menu(item, data) {
var selection = d3.selectAll('.node_selected'); var selection = d3.selectAll('.node_selected');
selection = selection[0]; selection = selection[0];
if (selection.length > 1) { if (selection.length > 1) {
alert("Yo no tengo dedo, por eso no poido trabajo, una ayuda, amorfa"); alert("Only one-one relations (one father, one son)");
} }
else { else {
add_interface_link(data); add_interface_link(data);
@ -1603,7 +1603,7 @@ function show_menu(item, data) {
var selection = d3.selectAll('.node_selected'); var selection = d3.selectAll('.node_selected');
selection = selection[0]; selection = selection[0];
if (selection.length > 1) { if (selection.length > 1) {
alert("Yo no tengo dedo, por eso no poido trabajo"); alert("Only one-one relations (one father, one son)");
} }
else { else {
set_parent(data); set_parent(data);

View File

@ -71,7 +71,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0dev'; $version = '7.0dev';
$build = '170217'; $build = '170220';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -601,7 +601,7 @@ foreach ($agents as $agent) {
$data[4] = ui_print_group_icon ($agent["id_grupo"], true); $data[4] = ui_print_group_icon ($agent["id_grupo"], true);
$agent['not_init_count'] = $agent['notinit_count']; $agent['not_init_count'] = $agent['notinit_count'];
$data[5] = reporting_tiny_stats($agent, true, ' ', ':', $strict_user); $data[5] = reporting_tiny_stats($agent, true, 'agent', ':', $strict_user);
$data[6] = $status_img; $data[6] = $status_img;

View File

@ -126,7 +126,7 @@ if (is_ajax ()) {
$id_group = (int) get_parameter('id_module_group'); $id_group = (int) get_parameter('id_module_group');
$id_agents = get_parameter('id_agents'); $id_agents = get_parameter('id_agents');
$selection = get_parameter('selection'); $selection = get_parameter('selection');
if(!isset($id_agents)){ if(isset($id_agents)){
$agents = implode(",", $id_agents); $agents = implode(",", $id_agents);
} }

View File

@ -202,38 +202,39 @@ else {
} }
array_push ($table->data, $data); array_push ($table->data, $data);
} }
html_print_table($table);
}
echo "<table width='100%'>";
echo "<tr>";
echo "<td>";
echo "<div style='float: right;'>";
if (!empty($messages)) {
if ($show_sent)
echo '<form method="post" style="float:right;" action="index.php?sec=workspace&amp;sec2=operation/messages/message_list&show_sent=1&amp;multiple_delete=1">';
else
echo '<form method="post" action="index.php?sec=workspace&amp;sec2=operation/messages/message_list&amp;multiple_delete=1">';
html_print_submit_button(__('Delete'), 'delete_btn',
false, 'class="sub delete"');
echo "</form>";
}
echo '<form method="post" style="float:right;" action="index.php?sec=workspace&sec2=operation/messages/message_edit">';
html_print_submit_button (__('Create message'), 'create', false, 'class="sub next" style="margin-right:5px;"');
echo "</form>";
echo "</div>";
echo "</td>";
echo "</tr>";
echo "</table>";
}
if (!empty($messages)) {
if ($show_sent) {
echo '<form method="post" action="index.php?sec=workspace&amp;sec2=operation/messages/message_list&show_sent=1">';
}
else {
echo '<form method="post" action="index.php?sec=workspace&amp;sec2=operation/messages/message_list">';
}
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
echo "<div style='float: right;'>";
html_print_submit_button(__('Delete'), 'delete_btn',
false, 'class="sub delete"');
echo "</div>";
echo "</form>";
}
echo "<div style='float: right;'>";
echo '<form method="post" style="float:right;" action="index.php?sec=workspace&sec2=operation/messages/message_edit">';
html_print_submit_button (__('Create message'), 'create', false, 'class="sub next" style="margin-right:5px;"');
echo "</form>";
echo "</div>";
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function check_all_checkboxes() { function check_all_checkboxes() {
if ($("input[name=all_delete]").attr('checked')) { if ($("input[name=all_delete]").prop('checked')) {
$(".check_delete").attr('checked', true); $(".check_delete").prop('checked', true);
} }
else { else {
$(".check_delete").attr('checked', false); $(".check_delete").prop('checked', false);
} }
} }
</script> </script>

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0dev %define version 7.0dev
%define release 170217 %define release 170220
# 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 7.0dev %define version 7.0dev
%define release 170217 %define release 170220
%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

@ -66,7 +66,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 ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc'); INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev'); INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170217'); INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170220');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0'); INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora'); INSERT INTO tconfig (token, value) VALUES ('style','pandora');

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0dev-170217 Version: 7.0dev-170220
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="7.0dev-170217" pandora_version="7.0dev-170220"
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 = "7.0dev"; my $pandora_version = "7.0dev";
my $pandora_build = "170217"; my $pandora_build = "170220";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash
@ -200,6 +200,7 @@ sub pandora_load_config {
$pa_config->{"umask"} = "0007"; # environment settings umask applied over chmod (A & (not B)) $pa_config->{"umask"} = "0007"; # environment settings umask applied over chmod (A & (not B))
$pa_config->{"server_threshold"} = 30; $pa_config->{"server_threshold"} = 30;
$pa_config->{"alert_threshold"} = 60; $pa_config->{"alert_threshold"} = 60;
$pa_config->{"graph_precision"} = 1;
$pa_config->{"log_file"} = "/var/log/pandora_server.log"; $pa_config->{"log_file"} = "/var/log/pandora_server.log";
$pa_config->{"errorlog_file"} = "/var/log/pandora_server.error"; $pa_config->{"errorlog_file"} = "/var/log/pandora_server.error";
$pa_config->{"networktimeout"} = 5; # By default, not in config file yet $pa_config->{"networktimeout"} = 5; # By default, not in config file yet
@ -692,6 +693,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^alert_threshold\s+([0-9]*)/i) { elsif ($parametro =~ m/^alert_threshold\s+([0-9]*)/i) {
$pa_config->{"alert_threshold"} = clean_blank($1); $pa_config->{"alert_threshold"} = clean_blank($1);
} }
elsif ($parametro =~ m/^graph_precision\s+([0-9]*)/i) {
$pa_config->{"graph_precision"} = clean_blank($1);
}
elsif ($parametro =~ m/^network_timeout\s+([0-9]*)/i) { elsif ($parametro =~ m/^network_timeout\s+([0-9]*)/i) {
$pa_config->{'networktimeout'}= clean_blank($1); $pa_config->{'networktimeout'}= clean_blank($1);
} }

View File

@ -947,6 +947,13 @@ sub pandora_execute_action ($$$$$$$$$;$) {
$group = get_db_single_row ($dbh, 'SELECT * FROM tgrupo WHERE id_grupo = ?', $agent->{'id_grupo'}); $group = get_db_single_row ($dbh, 'SELECT * FROM tgrupo WHERE id_grupo = ?', $agent->{'id_grupo'});
} }
if (is_numeric($data)) {
my $data_precision = $pa_config->{'graph_precision'};
$data = sprintf("%.$data_precision" . "f", $data);
$data =~ s/0+$//;
$data =~ s/\.+$//;
}
# Thanks to people of Cordoba univ. for the patch for adding module and # Thanks to people of Cordoba univ. for the patch for adding module and
# id_agent macros to the alert. # id_agent macros to the alert.
@ -3966,6 +3973,13 @@ sub generate_status_event ($$$$$$$$) {
return; return;
} }
if (is_numeric($data)) {
my $data_precision = $pa_config->{'graph_precision'};
$data = sprintf("%.$data_precision" . "f", $data);
$data =~ s/0+$//;
$data =~ s/\.+$//;
}
# Replace macros # Replace macros
my %macros = ( my %macros = (
_module_ => safe_output($module->{'nombre'}), _module_ => safe_output($module->{'nombre'}),

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0dev %define version 7.0dev
%define release 170217 %define release 170220
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 7.0dev %define version 7.0dev
%define release 170217 %define release 170220
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0dev" PI_VERSION="7.0dev"
PI_BUILD="170217" PI_BUILD="170220"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

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 = "7.0dev PS170217"; my $version = "7.0dev PS170220";
# 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 = "7.0dev PS170217"; my $version = "7.0dev PS170220";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);