Merge branch '62-meter-un-salto-de-linea-entre-las-opciones-modules-first-y-agents-firsts-de-forma-que-se-anineen-bien' of https://192.168.50.5:8081/artica/pandorafms into 62-meter-un-salto-de-linea-entre-las-opciones-modules-first-y-agents-firsts-de-forma-que-se-anineen-bien

This commit is contained in:
enriquecd 2017-02-21 12:54:48 +01:00
commit 26627e0613
63 changed files with 15178 additions and 10761 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{170217}
{170221}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0dev(Build 170217)")
#define PANDORA_VERSION ("7.0dev(Build 170221)")
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", "(7.0dev(Build 170217))"
VALUE "ProductVersion", "(7.0dev(Build 170221))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

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

View File

@ -218,35 +218,52 @@ function mainAgentsModules() {
if($agents_id[0] != -1){
$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 {
$agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents);
$filter_module_group = array('disabled' => 0);
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, false);
if ($module == false) {
unset($agents[$count]);
}
$count++;
}
$total_pagination = count($agents);
}
$filter_module_group = array('disabled' => 0);
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++;
}
$total_pagination = count($agents);
if($agents_id[0] != -1){
$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);
}
}
}
}
else{
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false);
$filter_module_group, true, true);
}
$modules_by_name = array();
@ -396,7 +413,7 @@ function mainAgentsModules() {
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>" .
ui_print_truncate_text(io_safe_output($agent['nombre']), 'agent_size_text_small', true, true, true, '...', 'font-size:10px; font-weight: bold;') .
"</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;
@ -408,6 +425,7 @@ function mainAgentsModules() {
}
$match = false;
foreach ($module['id'] as $module_id) {
if (!$match && array_key_exists($module_id,$agent_modules)) {
$status = modules_get_agentmodule_status($module_id);
@ -438,9 +456,14 @@ function mainAgentsModules() {
case AGENT_MODULE_STATUS_UNKNOWN:
ui_print_status_image ('module_unknown.png', modules_get_last_value($module_id), false, array('width' => '20px', 'height' => '20px'));
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'));
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 "</td>";
@ -467,6 +490,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_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_NOTINIT . ";'></div></td><td>" . __("Cell turns grey when the module is in 'not initialize' status") . "</td></tr>";
echo "</table>";
echo "</div>";
@ -563,7 +587,7 @@ extensions_add_main_function('mainAgentsModules');
);
});
$("#id_agents2").change (function(){
$("#id_agents2").click (function(){
selection_agent_module();
});
@ -591,7 +615,6 @@ extensions_add_main_function('mainAgentsModules');
});
selection_agent_module();
});
function selection_agent_module() {
@ -614,6 +637,6 @@ extensions_add_main_function('mainAgentsModules');
}
},
"json"
);
);
}
</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 ('days_autodisable_deletion', '30');
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`
@ -185,7 +185,7 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
-- ---------------------------------------------------------------------
ALTER TABLE tusuario ADD COLUMN `id_filter` int(10) unsigned NULL default NULL;
ALTER TABLE tusuario ADD COLUMN CONSTRAINT `fk_id_filter` FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN `session_time` int(10) unsigned NOT NULL default '0';
ALTER TABLE tusuario ADD COLUMN `session_time` int(10) signed NOT NULL default '0';
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`

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 ('days_autodisable_deletion', '30');
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`
@ -107,7 +107,7 @@ ALTER TABLE tevent_filter ADD COLUMN date_to date DEFAULT NULL;
-- ---------------------------------------------------------------------
ALTER TABLE tusuario ADD COLUMN id_filter int(10) unsigned default NULL;
ALTER TABLE tusuario ADD COLUMN CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
ALTER TABLE tusuario ADD COLUMN session_time int(10) NOT NULL default '0';
ALTER TABLE tusuario ADD COLUMN session_time INTEGER NOT NULL default '0';
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`

View File

@ -1075,7 +1075,7 @@ if ($update_module || $create_module) {
$throw_unknown_events = (bool)get_parameter('throw_unknown_events', false);
//Set the event type that can show.
$disabled_types_event = array(EVENTS_GOING_UNKNOWN => (int)!$throw_unknown_events);
$disabled_types_event = array(EVENTS_GOING_UNKNOWN => (int)$throw_unknown_events);
$disabled_types_event = io_json_mb_encode($disabled_types_event);
$module_macro_names = (array) get_parameter('module_macro_names', array());

View File

@ -147,28 +147,26 @@ foreach ($filters as $filter) {
href='index.php?sec=geventos&sec2=godmode/events/events&section=filter&delete=1&id=".$filter['id_filter']."&offset=0&pure=".$config['pure']."'>" .
html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "</a>" .
html_print_checkbox_extended ('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true);
array_push ($table->data, $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 {
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"))
echo "<div style='padding-bottom: 20px; text-align: right; width:100%;'>";
else
@ -181,11 +179,11 @@ echo "</div>";
<script type="text/javascript">
function check_all_checkboxes() {
if ($("input[name=all_delete]").attr('checked')) {
$(".check_delete").attr('checked', true);
if ($("#checkbox-all_delete").prop("checked")) {
$(".check_delete").prop('checked', true);
}
else {
$(".check_delete").attr('checked', false);
$(".check_delete").prop('checked', false);
}
}
</script>

View File

@ -149,7 +149,7 @@ echo "<td style='vertical-align: top;'>".__('Modules')."</td>";
echo "</tr><tr>";
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>".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 "<td colspan='3'>";
echo "<table cellpadding='4'><tr>";

View File

@ -142,6 +142,7 @@ switch ($action) {
case 'general':
case 'network_interfaces_report':
case 'availability':
case 'event_report_log':
case 'availability_graph':
case 'agent_module':
$get_data_editor = true;
@ -193,7 +194,9 @@ switch ($action) {
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
break;
case 'event_report_log':
$period = $item['period'];
$description = $item['description'];
case 'simple_graph':
$only_avg = isset($style['only_avg']) ? (bool) $style['only_avg'] : true;
$percentil = isset($style['percentil']) ? $config['percentil'] : 0;
@ -569,6 +572,7 @@ switch ($action) {
case 'MTBF':
case 'MTTR':
case 'simple_baseline_graph':
case 'event_report_log':
$label = (isset($style['label'])) ? $style['label'] : '';
break;
default:
@ -632,7 +636,12 @@ You can of course remove the warnings, that's why we include the source and do n
echo '<input type="hidden" id="type" name="type" value="' . $type . '" />';
}
?>
<?php
$text = __('This type of report brings a lot of data loading, it is recommended to use it for scheduled reports and not for real-time view.');
echo '<a id="log_help_tip" style="visibility: hidden;" href="javascript:" class="tip" >' . html_print_image ("images/tip.png", true, array('title' => $text)) . '</a>';
?>
</td>
</tr>
<tr id="row_name" style="" class="datos">
@ -2534,6 +2543,7 @@ function chooseType() {
$("#row_last_value").hide();
$("#row_filter_search").hide();
$("#row_percentil").hide();
$("#log_help_tip").css("visibility", "hidden");
$("#agents_row").hide();
$("#select_agent_modules").hide();
$("#modules_row").hide();
@ -2556,6 +2566,30 @@ function chooseType() {
$('#agent_autocomplete_events').show();
switch (type) {
case 'event_report_group':
$("#row_description").show();
$("#row_period").show();
$("#row_servers").show();
$("#row_group").show();
$("#row_show_in_two_columns").show();
$("#row_event_filter").show();
$("#row_event_graphs").show();
$("#row_event_graph_by_agent").show();
$("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show();
$("#row_event_graph_by_validated").show();
$("#row_filter_search").show();
break;
case 'event_report_log':
$("#log_help_tip").css("visibility", "visible");
$("#row_description").show();
$("#row_period").show();
$("#row_agent").show();
break;
case 'simple_graph':
$("#row_time_compare_overlapped").show();
$("#row_only_avg").show();

View File

@ -95,12 +95,26 @@ if (defined('METACONSOLE')) {
$table->align[1] = 'left';
}
$table->class = 'databox filters';
$table->size[0] = '20%';
$table->size[1] = '20%';
$table->size[1] = '50%';
$table->data = array ();
$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);
$table->data[0][1] = html_print_input_text('name', $visualConsoleName,
'', 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:');
$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[4][0] = __('Background color');
if($action == 'new'){
$table->data[4][1] .= html_print_input_text ('background_color', 'white', '', 8, 8, true);
if ($action == 'new') {
$table->data[4][1] .= html_print_input_text ('background_color',
'white', '', 8, 8, true);
}
else{
$table->data[4][1] .= html_print_input_text ('background_color', $background_color, '', 8, 8, true);
else {
$table->data[4][1] .= html_print_input_text ('background_color',
$background_color, '', 8, 8, true);
}
$table->data[5][0] = __('Size - (Width x Height)');
if($action == 'new'){
$table->data[5][1] = '<button id="modsize" 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] = '<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) .
' x ' .
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">' .
html_print_input_text('width', 1024, '', 10, 10, true , false) .
' x ' .
html_print_input_text('height', 768, '', 10, 10, true, false).'</span>';
if($action == 'new'){
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.'<button id="getsize" style="margin-left:20px;" value="modsize">Set default size</button>'.'</span>';
}
else{
$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][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') {
$textButtonSubmit = __('Save');
$classButtonSubmit = 'sub wand';
@ -166,18 +175,10 @@ else {
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if($action == 'new'){
html_print_submit_button ($textButtonSubmit, 'update_layout', false,
'class="' . $classButtonSubmit . '"');
}
else{
html_print_submit_button ($textButtonSubmit, 'update_layout', false,
'class="' . $classButtonSubmit . '"');
}
echo '</div>';
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
html_print_submit_button ($textButtonSubmit, 'update_layout', false,
'class="' . $classButtonSubmit . '"');
echo '</div>';
echo "</form>";
?>
@ -188,46 +189,60 @@ echo "</form>";
$(document).ready (function () {
$("#modsize").click(function(event){
event.preventDefault();
$("#modsize").click(function(event){
event.preventDefault();
if($('.opt').css('visibility') == 'hidden'){
$('.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=height]').val($('#imagen').height());
});
});
$("#getsize").click(function(event){
event.preventDefault();
$("#background").change(function() {
$('#imagen').attr('src','images/console/background/'+$('#background').val());
$('#imagen').width(230);
$('#imagen').show();
});
$( "input[type=submit]" ).click(function( event ) {
if($( "#getsize" ).css('visibility')=='hidden'){
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
}
});
$("#file-background_image").change(function(){
readURL(this);
});
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
});
$("#background").click(function(event){
$('#imagen').attr('src','images/console/background/'+$('#background').val());
});
$( "input[type=submit]" ).click(function( event ) {
if($( "#getsize" ).css('visibility')=='hidden'){
$('input[name=width]').val($('#imagen').width());
$('input[name=height]').val($('#imagen').height());
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#imagen').attr('src', e.target.result);
$('#imagen').width(230);
$('#imagen').show();
}
reader.readAsDataURL(input.files[0]);
}
}
});
$("#file-background_image").change(function(event){
$('#back').submit();
});
$("#text-background_color").attachColorPicker();
$("#imgInp").change(function(){
readURL(this);
});
$("#text-background_color").attachColorPicker();
});

View File

@ -971,18 +971,18 @@ function loadFieldsFromDB(item) {
}
if (key == 'type_graph') {
$("select[name=type_graph]").val(val);
}
$("select[name=type_graph]").val(val);
}
if (key == 'label_position') {
$('#labelposup'+" img").attr('src','/pandora_console/images/label_up.png');
$('#labelposdown'+" img").attr('src','/pandora_console/images/label_down.png');
$('#labelposleft'+" img").attr('src','/pandora_console/images/label_left.png');
$('#labelposright'+" img").attr('src','/pandora_console/images/label_right.png');
$('.labelpos').attr('sel','no');
$('#labelpos'+val+" img").attr('src','/pandora_console/images/label_'+$('#labelpos'+val).attr('id').replace('labelpos','')+'_2.png');
$('#labelpos'+val).attr('sel','yes');
}
if (key == 'label_position') {
$('#labelposup'+" img").attr('src','/pandora_console/images/label_up.png');
$('#labelposdown'+" img").attr('src','/pandora_console/images/label_down.png');
$('#labelposleft'+" img").attr('src','/pandora_console/images/label_left.png');
$('#labelposright'+" img").attr('src','/pandora_console/images/label_right.png');
$('.labelpos').attr('sel','no');
$('#labelpos'+val+" img").attr('src','/pandora_console/images/label_'+$('#labelpos'+val).attr('id').replace('labelpos','')+'_2.png');
$('#labelpos'+val).attr('sel','yes');
}
if (key == 'image') {
//Load image preview
@ -1165,7 +1165,14 @@ function setAspectRatioBackground(side) {
success: function(data) {
old_width = parseInt($("#background").css('width').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_height = data[1];
@ -2975,23 +2982,45 @@ function eventsBackground() {
$('#background').bind('resizestop', function(event, ui) {
if (!is_opened_palette) {
unselectAll();
var launch_message = false;
var dont_resize = false;
var values = {};
values['width'] = $('#background').css('width').replace('px', '');
values['height'] = $('#background').css('height').replace('px', '');
var actual_width = $('#background').css('width').replace('px', '');
var actual_height = $('#background').css('height').replace('px', '');
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;
}
values['width'] = actual_width;
values['height'] = actual_height;
if (!dont_resize) {
updateDB('background', 0, values, 'resizestop');
width = ui.size['width'];
height = ui.size['height'];
updateDB('background', 0, values, 'resizestop');
original_width = ui.originalSize['width'];
original_height = ui.originalSize['height'];
move_elements_resize(original_width, original_height, width, height);
width = ui.size['width'];
height = ui.size['height'];
original_width = ui.originalSize['width'];
original_height = ui.originalSize['height'];
move_elements_resize(original_width, original_height, width, height);
$('#background_grid').css('width', width);
$('#background_grid').css('height', height);
$('#background_grid').css('width', width);
$('#background_grid').css('height', height);
}
if (launch_message)
alert($('#hidden-message_size').val());
}
});

View File

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

View File

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

View File

@ -176,7 +176,7 @@ if ($create_user) {
}
$values["not_login"] = (bool)get_parameter ('not_login', false);
$values["strict_acl"] = (bool)get_parameter ('strict_acl', false);
$values["session_time"] = get_parameter('session_time', 0);
$values["session_time"] = (int)get_parameter('session_time', 0);
if ($id == '') {
ui_print_error_message (__('User ID cannot be empty'));
@ -280,7 +280,7 @@ if ($update_user) {
}
$values["not_login"] = (bool)get_parameter ('not_login', false);
$values["strict_acl"] = (bool)get_parameter ('strict_acl', false);
$values["session_time"] = get_parameter('session_time', 0);
$values["session_time"] = (int)get_parameter('session_time', 0);
$res1 = update_user ($id, $values);

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
*/
$build_version = 'PC170217';
$build_version = 'PC170221';
$pandora_version = 'v7.0dev';
// Do not overwrite default timezone set if defined.
@ -166,7 +166,7 @@ if (!isset($config['inventory_changes_blacklist'])) {
//NEW UPDATE MANAGER URL
if (!isset($config['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')) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,8 @@
.btn.active.focus {
outline: none;
}
#files-table a.file-link span.glyphicon {
#files-table a.file-link span.glyphicon,
#files-table span.file-link span.glyphicon {
vertical-align: middle;
font-size: x-large;
margin-right: 10px;
@ -24,3 +25,47 @@ div.term-container div.terminal {
-moz-border-radius: 4px;
border-radius: 4px;
}
.glyphicon-refresh-animate {
-animation: spin 1s infinite linear;
-webkit-animation: spin2 1s infinite linear;
}
@-webkit-keyframes spin2 {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes spin {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}
@-webkit-keyframes spin {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}
@-o-keyframes spin {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}
@keyframes spin {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1391,6 +1391,29 @@ function agents_get_interval ($id_agent) {
return (int) db_get_value ('intervalo', 'tagente', 'id_agente', $id_agent);
}
/**
* Get all data of agent.
*
* @param Agent object.
*
* @return The interval value and status of last contact
*/
function agents_get_interval_status ($agent) {
$return = '';
$last_time = strtotime ($agent["ultimo_contacto"]);
$now = time ();
$diferencia = $now - $last_time;
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt'));
$min_interval = modules_get_agentmodule_mininterval($agent['id_agente']);
$return = $time;
if ($diferencia > ($min_interval["min_interval"] * 2))
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
return $return;
}
/**
* Get the operating system of an agent.
*

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 : '');
}
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['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['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['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.': '.__('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.': '.__('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 {
$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
/*if ($baseline) {

View File

@ -2490,6 +2490,11 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
}
}
function modules_get_agentmodule_mininterval($id_agent) {
$sql = sprintf('SELECT min(current_interval) min_interval from tagente_estado where id_agente = %d', $id_agent);
return db_get_row_sql($sql);
}
function get_same_modules ($agents, $modules) {
$modules_to_report = array();
if ($modules != "") {

View File

@ -165,6 +165,12 @@ function reporting_make_reporting_data($report = null, $id_report,
$force_width_chart,
$force_height_chart);
break;
case 'event_report_log':
$report['contents'][] =
reporting_log(
$report,
$content);
break;
case 'general':
$report['contents'][] =
reporting_general(

View File

@ -174,6 +174,9 @@ function reporting_html_print_report($report, $mini = false, $report_info = 1) {
case 'availability':
reporting_html_availability($table, $item);
break;
case 'event_report_log':
reporting_html_log($table, $item);
break;
case 'availability_graph':
reporting_html_availability_graph($table, $item);
break;
@ -1403,7 +1406,9 @@ function reporting_html_agent_module($table, $item) {
$row['agent_name']),
true, array('width' => '20px', 'height' => '20px'));
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(
'module_alertsfired.png',
__("%s in %s : ALERTS FIRED",
@ -1411,6 +1416,14 @@ function reporting_html_agent_module($table, $item) {
$row['agent_name']),
true, array('width' => '20px', 'height' => '20px'));
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>";
}
@ -1429,6 +1442,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_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_NOTINIT . ";'></div></td><td>" . __("Cell turns grey when the module is in 'not initialize' status") . "</td></tr>";
$table_data .= "</table>";
$table_data .= "</div>";

View File

@ -633,8 +633,6 @@ function reports_get_report_types ($template = false, $not_editor = false) {
}
}
if (!$template) {
$types['agent_configuration'] = array('optgroup' => __('Configuration'),
'name' => __('Agent configuration'));
@ -651,6 +649,11 @@ function reports_get_report_types ($template = false, $not_editor = false) {
$types['netflow_summary'] = array('optgroup' => __('Netflow'),
'name' => __('Netflow summary table'));
}
if ($config['enterprise_installed']) {
$types['event_report_log'] = array('optgroup' => __('Log'),
'name' => __('Log report'));
}
return $types;
}

View File

@ -2411,16 +2411,10 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
$separator_class = "separator_view";
}
$buffer = '<div id="'.$type2.'" style=""><div id="menu_tab_left">';
$buffer .= '<ul class="mn"><li class="' . $type . '">&nbsp;' . '&nbsp; ';
if(strpos($title, "Monitoring » Services »") != -1){
$title = str_replace("Monitoring » Services » Service Map » ",'',$title);
}
$buffer .= '<span style="margin-right:10px;">' .
ui_print_truncate_text($title, $numChars);

View File

@ -123,7 +123,7 @@ function visual_map_print_item($mode = "read", $layoutData,
}
$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>';
if($height == 0){
@ -2462,22 +2462,13 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
if(get_parameter('pure')==1){
echo 'width:100%;height:100%;position:absolute;';
}
echo 'background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
style="margin:0px auto;';
if(get_parameter('pure')==1){
echo 'top: 50%;
transform: translate(-0%, -50%);
-webkit-transform: translate(-0%, -50%);';
}
echo 'text-align:;
z-index: 0;
position:relative;
width:' . $mapWidth . 'px;
height:' . $mapHeight . 'px;">';
echo 'background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
style="margin:0px auto;text-align:
z-index: 0;
position:relative;
width:' . $mapWidth . 'px;
height:' . $mapHeight . 'px;">';
echo "<img src='" .
ui_get_full_url($backgroundImage) . "' width='100%' height='100%' />";

View File

@ -168,20 +168,22 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
<div id="label_box_arrow" style="text-align:center;width:120px;height:110px;margin-top:50px;">
<span>Label position</span>
<div class="labelpos" id="labelposup" position="up" style="width:20px;height:20px;margin-top:10px;margin-left:45px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_up.png" style="height:100%;width:100%;"></div>
<div class="labelpos" id="labelposleft" position="left" style="position:relative;top:-5px;width:20px;height:20px;margin-top:15px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_left.png" style="height:100%;width:100%;"></div>
<div style="font-weight:bold;width:40px;height:20px;position:relative;margin-left:35px;margin-top:-24px;cursor: default;"><span style="float:left;margin-top:3px;margin-left:5px;">Object</span></div>
<div class="labelpos" id="labelposright" position="right" style="top:2px;width:20px;height:20px;position:relative;margin-left:90px;margin-top:-24px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_right.png" style="height:100%;width:100%;"></div>
<div class="labelpos" sel="yes" id="labelposdown" position="down" style="width:20px;height:20px;position:relative;margin-left:45px;margin-top:10px;cursor: pointer;"><img src="'.$config['homeurl'].'images/label_down_2.png" style="height:100%;width:100%;"></div>
<div class="labelpos" id="labelposup" position="up" style="width:20px;height:20px;margin-top:10px;margin-left:45px;cursor: pointer;">
'. html_print_image ('images/label_up.png', true, array('style'=>'height:100%;width:100%;')). '
</div>
<div class="labelpos" id="labelposleft" position="left" style="position:relative;top:-5px;width:20px;height:20px;margin-top:15px;cursor: pointer;">
'. html_print_image ('images/label_left.png', true, array('style'=>'height:100%;width:100%;')). '
</div>
<div style="font-weight:bold;width:40px;height:20px;position:relative;margin-left:35px;margin-top:-24px;cursor: default;">
<span style="float:left;margin-top:3px;margin-left:5px;">Object</span>
</div>
<div class="labelpos" id="labelposright" position="right" style="top:2px;width:20px;height:20px;position:relative;margin-left:90px;margin-top:-24px;cursor: pointer;">
'. html_print_image ('images/label_right.png', true, array('style'=>'height:100%;width:100%;')). '
</div>
<div class="labelpos" sel="yes" id="labelposdown" position="down" style="width:20px;height:20px;position:relative;margin-left:45px;margin-top:10px;cursor: pointer;">
'. html_print_image ('images/label_down_2.png', true, array('style'=>'height:100%;width:100%;')). '
</div>
</div>
</td>
<td align="left" style="">' .
html_print_input_text('label', '', '', 20, 200, true) . '</td>';

View File

@ -1537,7 +1537,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
hoverable: true,
clickable: true,
borderWidth:1,
borderColor: '#666',
borderColor: '#C1C1C1',
tickColor: background_color,
markings: markings,
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'));
}
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) {
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());
$('#menu_' + graph_id)
.css('left',plot.width() - $('#menu_'+graph_id).width() + 10);
.css('left',width - $('#menu_'+graph_id).width());
$('#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) {
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 top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height;
var left_pos = 380;
var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width;
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);
}, false);

View File

@ -246,7 +246,6 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
"style='display: none; " .
"text-align: center; " .
"width: " . $menu_width . "px; ".
"border: solid 1px #666; ".
"border-bottom: 0px; " .
"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>";

View File

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

View File

@ -508,12 +508,12 @@ if (! isset ($config['id_user'])) {
</script>
<?php
}
set_time_limit((int)$PHPmax_execution_time);
ini_set('upload_max_filesize', $PHPupload_max_filesize);
ini_set('memory_limit', $PHPmemory_limit);
}
set_time_limit((int)$PHPmax_execution_time);
ini_set('upload_max_filesize', $PHPupload_max_filesize);
ini_set('memory_limit', $PHPmemory_limit);
//==========================================================
//-------- SET THE CUSTOM CONFIGS OF USER ------------------

View File

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

View File

@ -41,6 +41,7 @@ $section = (string) get_parameter_get('section');
<title>eHorus client</title>
<link rel="stylesheet" href="../../include/ehorus/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../../include/ehorus/css/style.css" type="text/css" />
<link rel="stylesheet" href="../../include/ehorus/css/xterm.css" type="text/css" />
<script type="text/javascript" src="../../include/ehorus/bundle.min.js"></script>
</head>
<body>

View File

@ -599,23 +599,14 @@ foreach ($agents as $agent) {
$data[4] = ui_print_group_icon ($agent["id_grupo"], true);
$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[7] = $alert_img;
$last_time = strtotime ($agent["ultimo_contacto"]);
$now = time ();
$diferencia = $now - $last_time;
$time = ui_print_timestamp ($last_time, true, array('style' => 'font-size:6.5pt'));
$style = '';
if ($diferencia > ($agent["intervalo"] * 2))
$data[8] = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
else
$data[8] = $time;
$data[8] = agents_get_interval_status ($agent);
// This old code was returning "never" on agents without modules, BAD !!
// And does not print outdated agents in red. WRONG !!!!

View File

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

View File

@ -202,38 +202,39 @@ else {
}
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">
function check_all_checkboxes() {
if ($("input[name=all_delete]").attr('checked')) {
$(".check_delete").attr('checked', true);
if ($("input[name=all_delete]").prop('checked')) {
$(".check_delete").prop('checked', true);
}
else {
$(".check_delete").attr('checked', false);
$(".check_delete").prop('checked', false);
}
}
</script>

View File

@ -132,6 +132,9 @@ if ($view_graph) {
if (check_acl ($config['id_user'], 0, "RW")) {
$options = array(
'graph_list' => array('active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">' .
html_print_image("images/list.png", true, array ("title" => __('Graph list'))) .'</a>'),
'main' => array('active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=main&edit_graph=1&id=' . $id_graph . '">' .
html_print_image("images/chart.png", true, array ("title" => __('Main data'))) .'</a>'),
@ -161,10 +164,10 @@ if ($view_graph) {
}
// Header
ui_print_page_header (__('Reporting') . " &raquo; " .
__('Custom graphs') . " - " . $graph['name'],
"images/chart.png", false, "", false, $options);
ui_print_page_header ($graph['name'],
"images/chart.png", false, "", false, $options);
$graph_return = custom_graphs_print($id_graph, $height, $width, $period, $stacked, true, $unixdate, false, 'white',
array(), '', array(), array(), true, true, true, true, 1, false, false, $percentil, false);
if ($graph_return){

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0dev
%define release 170217
%define release 170221
%define httpd_name httpd
# User and Group under which Apache is running
%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 ('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_build','PD170217');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170221');
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

@ -1155,7 +1155,7 @@ CREATE TABLE tusuario (
metaconsole_assigned_server NUMBER(10, 0) DEFAULT 0,
metaconsole_access_node NUMBER(10, 0) DEFAULT 0,
strict_acl NUMBER(5,0) DEFAULT 0,
session_time NUMBER(10,0) DEFAULT 0,
session_time INTEGER DEFAULT 0,
CONSTRAINT t_usuario_metaconsole_acc_cons CHECK (metaconsole_access IN ('basic','advanced'))
);

View File

@ -1068,7 +1068,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`metaconsole_access_node` tinyint(1) unsigned NOT NULL default 0,
`strict_acl` tinyint(1) unsigned NOT NULL DEFAULT 0,
`id_filter` int(10) unsigned NULL default NULL,
`session_time` int(10) unsigned NOT NULL default 0,
`session_time` int(10) signed NOT NULL default 0,
CONSTRAINT `fk_filter_id` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter (`id_filter`) ON DELETE SET NULL,
UNIQUE KEY `id_user` (`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0dev-170217
Version: 7.0dev-170221
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="7.0dev-170217"
pandora_version="7.0dev-170221"
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 = "7.0dev";
my $pandora_build = "170217";
my $pandora_build = "170221";
our $VERSION = $pandora_version." ".$pandora_build;
# 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->{"server_threshold"} = 30;
$pa_config->{"alert_threshold"} = 60;
$pa_config->{"graph_precision"} = 1;
$pa_config->{"log_file"} = "/var/log/pandora_server.log";
$pa_config->{"errorlog_file"} = "/var/log/pandora_server.error";
$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) {
$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) {
$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'});
}
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
# id_agent macros to the alert.
@ -3965,6 +3972,13 @@ sub generate_status_event ($$$$$$$$) {
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
my %macros = (
_module_ => safe_output($module->{'nombre'}),

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0dev
%define release 170217
%define release 170221
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0dev
%define release 170217
%define release 170221
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

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

View File

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