Merge branch 'develop' into 618-new-item-auto-sla-graph-in-visual-console-dev

pandora_console/include/functions_visual_map.php
	pandora_console/include/functions_visual_map_editor.php
This commit is contained in:
Arturo Gonzalez 2017-07-18 11:57:13 +02:00
commit e9e10d3a79
62 changed files with 833 additions and 145 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.707-170712
Version: 7.0NG.707-170718
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.0NG.707-170712"
pandora_version="7.0NG.707-170718"
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

@ -18,8 +18,7 @@ logfile /var/log/pandora/pandora_agent.log
# Interval in seconds, 300 by default
interval 300
# Debug mode only generate XML, and stop after first execution,
# and does not copy XML to server.
# Debug mode renames XML in the temp folder and continues running
debug 0
# Optional. UDP Server to receive orders from outside

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.707';
use constant AGENT_BUILD => '170712';
use constant AGENT_BUILD => '170718';
# 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.0NG.707
%define release 170712
%define release 170718
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.707
%define release 170712
%define release 170718
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.707"
PI_BUILD="170712"
PI_BUILD="170718"
OS_NAME=`uname -s`
FORCE=0

View File

@ -36,7 +36,7 @@ temporal "%ProgramFiles%\pandora_agent\temp"
# If set to __rand__ the agent will generate a random name.
#agent_name_cmd cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\agentname.vbs"
agent_name_cmd __rand__
#Parent agent_name
#parent_agent_name caprica
@ -77,7 +77,7 @@ server_port 41121
# If set to 1 disables log writing into pandora_agent.log
#disable_logfile 1
# Debug mode do not copy XML data files to server.
# Debug mode renames XML in the temp folder and continues running
# debug 1
# If set to 1 allows the agent to be configured via the web console

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{170712}
{170718}
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.0NG.707(Build 170712)")
#define PANDORA_VERSION ("7.0NG.707(Build 170718)")
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.0NG.707(Build 170712))"
VALUE "ProductVersion", "(7.0NG.707(Build 170718))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.707-170712
Version: 7.0NG.707-170718
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.0NG.707-170712"
pandora_version="7.0NG.707-170718"
package_pear=0
package_pandora=1

View File

@ -127,7 +127,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
ui_print_error_message(
__('Unsuccessful installed tables into the testing DB'));
}
else {
else {/*
if (enterprise_installed()) {
$install_tables_enterprise =
extension_db_status_execute_sql_file(
@ -139,7 +139,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
__('Unsuccessful installed enterprise tables into the testing DB'));
}
}
*/
extension_db_check_tables_differences(
$connection_test,
$connection_system,
@ -159,6 +159,7 @@ function extension_db_check_tables_differences($connection_test,
global $config;
// --------- Check the tables --------------------------------------
mysql_select_db($db_name_test, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test);
@ -170,9 +171,8 @@ function extension_db_check_tables_differences($connection_test,
//~ $tables_test = array_merge($tables_test,
//~ extension_db_status_extension_tables());
mysql_select_db($db_name_system, $connection_system);
$result = mysql_query("SHOW TABLES", $connection_system);
mysql_select_db($db_name_system, $connection_test);
$result = mysql_query("SHOW TABLES", $connection_test);
$tables_system = array();
while ($row = mysql_fetch_array ($result)) {
$tables_system[] = $row[0];
@ -227,8 +227,8 @@ function extension_db_check_tables_differences($connection_test,
mysql_select_db($db_name_system, $connection_system);
$result = mysql_query("EXPLAIN " . $table, $connection_system);
mysql_select_db($db_name_system, $connection_test);
$result = mysql_query("EXPLAIN " . $table, $connection_test);
$fields_system = array();
if (!empty($result)) {
while ($row = mysql_fetch_array ($result)) {

View File

@ -0,0 +1,2 @@
alter table tusuario add autorefresh_white_list text not null default '';
ALTER TABLE tserver_export MODIFY name varchar(600) BINARY NOT NULL default '';

View File

@ -1136,10 +1136,10 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
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', 1);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 4);
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '704');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '708');
-- ---------------------------------------------------------------------
-- Table `tplanned_downtime_agents`
@ -1168,6 +1168,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 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) signed NOT NULL default '0';
alter table tusuario add autorefresh_white_list text not null default '';
-- ---------------------------------------------------------------------
-- Table `tagente_modulo`
@ -1371,3 +1372,9 @@ CREATE TABLE IF NOT EXISTS `treset_pass` (
UPDATE tgis_map_connection SET conection_data = '{"type":"OSM","url":"http://tile.openstreetmap.org/${z}/${x}/${y}.png"}' where id_tmap_connection = 1;
ALTER TABLE tpolicy_modules MODIFY post_process double(24,15) default 0;
-- ---------------------------------------------------------------------
-- Table `tserver_export`
-- ---------------------------------------------------------------------
ALTER TABLE tserver_export MODIFY `name` varchar(600) BINARY NOT NULL default '';

View File

@ -0,0 +1,25 @@
<?php
include_once ('include/config.php');
include_once ('include/functions.php');
include_once ('include/functions_db.php');
include_once ('include/auth/mysql.php');
$id = get_parameter('get_image');
$sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = '.$id;
$result = db_get_sql($sql);
$image = strpos($result, 'data:image');
if($image === false){
echo 0;
}
else{
echo 1;
}
?>

View File

@ -32,13 +32,18 @@ if (!$config["MR"]) {
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">';
if($current_package == 0){
$build_package_version = $build_version;
}
else{
$build_package_version = $current_package;
if(enterprise_installed()){
enterprise_include_once("../include/functions_update_manager.php");
}
$current_package = update_manager_get_current_package();
if($current_package == 0){
$build_package_version = $build_version;
}
else{
$build_package_version = $current_package;
}
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_package_version, $config["MR"]));

View File

@ -191,7 +191,9 @@ config_check();
$_GET['refr'] = null;
}
if ($config['autorefresh_white_list'] !== null && array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) {
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
if ($_GET['refr']) {
@ -354,7 +356,7 @@ config_check();
var new_chat = <?php echo (int)$_SESSION['new_chat'];?>;
$(document).ready (function () {
<?php
if (($config['autorefresh_white_list'] !== null) && (array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) && (!isset($_GET["refr"]))) {
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET["refr"]))) {
?>
$("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle ();

View File

@ -119,7 +119,7 @@ $(document).ready (function () {
// Update config['skip_login_help_dialog'] to don't display more this message
if (skip_login_help) {
jQuery.get ("ajax.php",
jQuery.post ("ajax.php",
{"page": "general/login_help_dialog",
"skip_login_help": 1},
function (data) {}

View File

@ -148,7 +148,7 @@ $table_simple->colspan[6][1] = 3;
$table_simple->data[0][0] = __('Name');
$table_simple->data[0][1] = html_print_input_text_extended ('name',
io_safe_output($name), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
io_safe_input(html_entity_decode($name)), 'text-name', '', 45, 100, $disabledBecauseInPolicy, '', $largeClassDisabledBecauseInPolicy, true);
//$table_simple->data[0][1] = html_print_input_text ('name',
// io_safe_output($name), '', 45, 100, true, $disabledBecauseInPolicy);

View File

@ -32,7 +32,7 @@ $id_alert = get_parameter ("id_alert", 0); // ID given as parameter
$alert = alerts_get_alert_agent_module($id_alert);
$template = alerts_get_alert_template ($alert['id_alert_template']);
$actions = alerts_get_alert_agent_module_actions ($id_alert);
$agent_name = modules_get_agentmodule_agent_name ($alert['id_agent_module']);
$agent_alias = modules_get_agentmodule_agent_alias ($alert['id_agent_module']);
$agent = modules_get_agentmodule_agent ($alert['id_agent_module']);
$module_name = modules_get_agentmodule_name ($alert['id_agent_module']);
@ -65,7 +65,7 @@ $table_details->data[] = $data;
$data[0] = __('Agent');
$data[1] ='<a style=" font-size: 7pt;" href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent.
'" title="'.$agent_name.'"><b><span style=" font-size: 7pt;">'.$agent_name.'</span></b></a>';
'" title="'.$agent_alias.'"><b><span style=" font-size: 7pt;">'.$agent_alias.'</span></b></a>';
$table_details->data[] = $data;
$data[0] = __('Module');

View File

@ -84,7 +84,46 @@ function visual_map_main() {
//Fixed to wait the load of images.
$(window).load(function() {
$('#module').change(function(){
var txt = $("#module").val();
if(selectedItem == 'simple_value' || creationItem == 'simple_value'){
$.ajax({
async:false,
type: "POST",
url: "ajax.php",
data: {"page" : "general/check_image_module",
"get_image" : txt,
},
success: function(data) {
if(data == 0){
$("#data_image_check").html('Off');
$('#data_image_container').css('display','none');
$('#data_image_check').css('display','none');
$('#data_image_check_label').css('display','none');
$('.block_tinymce').remove();
$('#process_value_row').css('display','table-row');
if($('#process_value').val() != '0'){
$('#period_row').css('display','table-row');
}
}
else{
$('#data_image_container').css('display','inline');
$('#data_image_check').css('display','inline');
$('#data_image_check_label').css('display','inline');
$("#data_image_check").html('On');
$('#process_value_row').css('display','none');
$('#period_row').css('display','none');
$('#text-label_ifr').contents().find('#tinymce').html('_VALUE_');
$('.block_tinymce').remove();
$('#label_row').append('<div class="block_tinymce" style="background-color:#fbfbfb;position:absolute;left:0px;height:230px;width:100%;opacity:0.7;z-index:5;"></div>');
}
}
});
}
});
// Begin - Background label color changer
$( "#text-label_ifr" ).contents().find( "body" ).bind("contextmenu", function(e) {
@ -365,10 +404,32 @@ function update_button_palette_callback() {
setEventsBar(idItem, values);
break;
case 'simple_value':
$("#text_" + idItem).html(values['label']);
//checkpoint
if(($('#text-label_ifr').contents().find('#tinymce p').html() == '_VALUE_' ||
$('#text-label_ifr').contents().find('#tinymce').html() == '_VALUE_')
&& $('#data_image_check').html() != 'On'){
alert('_VALUE_ exactly value is only enable for data image. Please change label text or select a data image module.');
return;
}
$("#" + idItem).html(values['label']);
if(values['label'].replace( /<.*?>/g, '' ) == '_VALUE_'){
$("#text_" + idItem).html('<img style="width:'+values['width_data_image']+'px;" src="images/console/signes/data_image.png">');
$("#" + idItem).html('<img style="width:'+values['width_data_image']+'px;" src="images/console/signes/data_image.png">');
}
else{
$("#text_" + idItem).html(
'<table><tbody><tr><td></td></tr><tr><td><span style="" id="text_21" class="text">'+values["label"]+'</span></td></tr><tr><td></td></tr></tbody></table>'
)
$("#" + idItem).html(
'<table><tbody><tr><td></td></tr><tr><td><span style="" id="text_21" class="text">'+values["label"]+'</span></td></tr><tr><td></td></tr></tbody></table>'
)
}
//$("#simplevalue_" + idItem)
//.html($('<img></img>').attr('src', "images/spinner.gif"));
setModuleValue(idItem,values['process_simple_value'], values['period']);
setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']);
break;
case 'label':
$("#text_" + idItem).html(values['label']);
@ -514,7 +575,14 @@ function readFields() {
values['process_simple_value'] = $("select[name=process_value]").val();
values['background'] = $("#background_image").val();
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period").val();
if (values['period'] == null) {
values['period'] = undefined != $("#hidden-period").val() ? $("#hidden-period").val() : $("#period_select").val();
}
values['width'] = $("input[name=width]").val();
values['width_data_image'] = $("#data_image_width").val();
if(values['width_data_image'] != 0){
values['width'] = values['width_data_image'];
}
values['height'] = $("input[name=height]").val();
values['parent'] = $("select[name=parent]").val();
values['map_linked'] = $("select[name=map_linked]").val();
@ -568,14 +636,14 @@ function create_button_palette_callback() {
var validate = true;
switch (creationItem) {
case 'box_item':
if (($("input[name='width_box']").val() == '')) {
alert('Undefined width');
validate = false;
}
if (($("input[name='height_box']").val() == '')) {
alert('Undefined height');
validate = false;
}
if (($("input[name='width_box']").val() == '')) {
alert('Undefined width');
validate = false;
}
if (($("input[name='height_box']").val() == '')) {
alert('Undefined height');
validate = false;
}
break;
case 'group_item':
case 'static_graph':
@ -645,7 +713,7 @@ function create_button_palette_callback() {
validate = false;
}
break;
case 'module_graph':
case 'module_graph':
if (values['width_module_graph'] == '') {
alert('Undefined width');
validate = false;
@ -693,6 +761,7 @@ function create_button_palette_callback() {
create_line('step_1', values);
break;
default:
insertDB(creationItem, values);
break;
}
@ -973,6 +1042,14 @@ function toggle_item_palette() {
$( "#text-label_ifr" ).contents().find( "body" ).css("background","lightgray");
}
if(creationItem != 'simple_value'){
$("#data_image_check").html('Off');
$("#data_image_check").css('display','none');
$("#data_image_check_label").css('display','none');
$("#data_image_container").css('display','none');
$('.block_tinymce').remove();
}
}
function fill_parent_select(id_item) {
@ -1540,7 +1617,6 @@ function set_static_graph_status(idElement, image, status) {
data: parameter,
success: function (data) {
set_static_graph_status(idElement, image, data);
if($('#'+idElement+' table').css('float') == 'right' || $('#'+idElement+ ' table').css('float') == 'left'){
$('#'+idElement+ ' img').css('margin-top', parseInt($('#'+idElement).css('height'))/2 - parseInt($('#'+idElement+ ' img').css('height'))/2);
}
@ -1576,7 +1652,6 @@ function set_static_graph_status(idElement, image, status) {
suffix = ".png";
break;
}
set_image("image", idElement, image + suffix);
}
@ -1700,12 +1775,13 @@ function setModuleGraph(id_data) {
}
function setModuleValue(id_data, process_simple_value, period) {
function setModuleValue(id_data, process_simple_value, period,width_data_image) {
var parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_module_value"});
parameter.push ({name: "id_element", value: id_data});
parameter.push ({name: "period", value: period});
parameter.push ({name: "width", value: width_data_image});
parameter.push ({name: "id_visual_console", value: id_visual_console});
if (process_simple_value != undefined) {
parameter.push ({name: "process_simple_value", value: process_simple_value});
@ -1717,7 +1793,9 @@ function setModuleValue(id_data, process_simple_value, period) {
type: "POST",
dataType: 'json',
success: function (data) {
var currentValue = $("#text_" + id_data).html();
var currentValue = $("#text_" + id_data).html();
//currentValue = currentValue.replace(/_VALUE_/gi, data.value);
$("#text_" + id_data).html(currentValue);
//$("#text_" + id_data).html('Data value');
@ -2089,6 +2167,10 @@ function createItem(type, values, id_data) {
if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$image.attr('width', '70')
.attr('height', '70');
}
else{
$image.attr('width', $('#preview > img')[0].naturalWidth)
.attr('height', $('#preview > img')[0].naturalHeight);
}
}
else {
@ -2281,10 +2363,14 @@ function createItem(type, values, id_data) {
case 'simple_value':
sizeStyle = '';
imageSize = '';
if($('#data_image_check').html() == 'On'){
values['label'] = '<img style="width:'+$('#data_image_width').val()+'px;" src="images/console/signes/data_image.png">';
}
item = $('<div id="' + id_data + '" class="item simple_value" style="position: absolute; ' + sizeStyle + ' top: ' + values['top'] + 'px; left: ' + values['left'] + 'px;">' +
'<span id="text_' + id_data + '" class="text"> ' + values['label'] + '</span> ' + '</div>'
);
setModuleValue(id_data,values.process_simple_value,values.period);
setModuleValue(id_data,values.process_simple_value,values.period,values.width_data_image);
break;
case 'label':
item = $('<div id="' + id_data + '" ' +
@ -2364,6 +2450,7 @@ function addItemSelectParents(id_data, text) {
}
function insertDB(type, values) {
metaconsole = $("input[name='metaconsole']").val();
$("#saving_in_progress_dialog").dialog({
@ -2496,7 +2583,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
if (type == 'simple_value') {
setModuleValue(idElement,
values.process_simple_value,
values.period);
values.period,values.width_data_image);
}
@ -2982,6 +3069,39 @@ function eventsItems(drag) {
if ((!is_opened_palette) && (autosave)) {
toggle_item_palette();
}
if(selectedItem == 'simple_value'){
var found = $('#'+idItem).find("img");
if(found.length > 0){
$("#data_image_check").css('display','inline');
$("#data_image_check_label").css('display','inline');
$('#data_image_container').css('display','inline');
$("#data_image_check").html('On');
$('.block_tinymce').remove();
$('#label_row').append('<div class="block_tinymce" style="background-color:#fbfbfb;position:absolute;left:0px;height:230px;width:100%;opacity:0.7;z-index:5;"></div>');
$('#process_value_row').css('display','none');
$('#period_row').css('display','none');
}
else{
$("#data_image_check").html('Off');
$("#data_image_check").css('display','none');
$("#data_image_check_label").css('display','none');
$('#data_image_container').css('display','none');
$('.block_tinymce').remove();
$('#process_value_row').css('display','table-row');
if($('#process_value').val() != 0){
$('#period_row').css('display','table-row');
}
}
}
else{
$("#data_image_check").css('display','none');
$("#data_image_check_label").css('display','none');
$('#data_image_container').css('display','none');
}
});
//Set the limit of draggable in the div with id "background" and set drag

View File

@ -51,7 +51,8 @@ if (is_ajax ()) {
$row['control'] = __('Yes').'&nbsp;'.html_print_radio_button('fallback_local_auth', 1, '', $config['fallback_local_auth'], true).'&nbsp;&nbsp;';
$row['control'] .= __('No').'&nbsp;'.html_print_radio_button('fallback_local_auth', 0, '', $config['fallback_local_auth'], true);
$table->data['fallback_local_auth'] = $row;
if (enterprise_installed()) {
// Autocreate remote users
$row = array();
$row['name'] = __('Autocreate remote users');
@ -59,8 +60,7 @@ if (is_ajax ()) {
$row['control'] .= __('No').'&nbsp;'.html_print_radio_button_extended('autocreate_remote_users', 0, '', $config['autocreate_remote_users'], false, '', '', true);
$table->data['autocreate_remote_users'] = $row;
if (enterprise_installed()) {
add_enterprise_auth_autocreate_profiles($table, $type_auth);
add_enterprise_auth_autocreate_profiles($table, $type_auth);
}
}

View File

@ -221,8 +221,6 @@ if (($filter_group == 0) && ($filter_search == '')) {
$table = new stdClass();
$table->width = '100%';
$table->class = "databox filters";
if(defined('METACONSOLE'))
$table->class = "databox_filters";
$table->rowclass[0] = '';
$table->data[0][0] = '<b>' . __('Group') . '</b>';
$table->data[0][1] = html_print_select_groups(false, "AR", true,
@ -496,3 +494,10 @@ echo '</div>';
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready (function () {
console.log('sknknan');
// text-filter_search
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -268,21 +268,16 @@ if ($get_module_detail) {
foreach ($columns as $col => $attr) {
if ($attr[1] != "modules_format_data") {
$data[] = date('d F Y h:i:s A', $row['utimestamp']);
}
elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
// Its a single-data, multiline data (data snapshot) ?
// Detect string data with \n and convert to <br>'s
$datos = $row[$attr[0]];
//$datos = preg_replace ('/\n/i','<br>',$row[$attr[0]]);
//$datos = preg_replace ('/\s/i','&nbsp;',$datos);
// Because this *SHIT* of print_table monster, I cannot format properly this cells
// so, eat this, motherfucker :))
$datos = io_safe_input($datos);
$datos = preg_replace("/\n/", "</br></br>", $datos);
// I dont why, but using index (value) method, data is automatically converted to html entities ¿?
$data[] = $datos;
@ -290,7 +285,6 @@ if ($get_module_detail) {
elseif ($is_web_content_string) {
//Fixed the goliat sends the strings from web
//without HTML entities
$data[] = io_safe_input($row[$attr[0]]);
}
else {
@ -301,9 +295,6 @@ if ($get_module_detail) {
$data[] = io_safe_input($row[$attr[0]]);
}
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
//~ $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
//~ $data[] = (double) $row[$attr[0]];
switch($row['module_type']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
@ -328,17 +319,12 @@ if ($get_module_detail) {
$data[] = 'No data';
}
else {
if(is_snapshot_data($row[$attr[0]])){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
}
else{
$data[] = $row[$attr[0]];
}
if(is_snapshot_data($row[$attr[0]])){
$data[] = "<a target='_blank' href='".io_safe_input($row[$attr[0]])."'><img style='width:300px' src='".io_safe_input($row[$attr[0]])."'></a>";
}
else{
$data[] = $row[$attr[0]];
}
}
}
}

View File

@ -0,0 +1,126 @@
<?php
//Pandora FMS- http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2017 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
include_once($config['homedir'] . "/include/functions_config.php");
include_once($config['homedir'] . "/include/functions_snmp_browser.php");
require_once ($config['homedir'] . '/include/functions_network_components.php');
global $config;
if(is_ajax()){
ob_clean();
$action = (string) get_parameter ("action", "");
$target_ip = (string) get_parameter ("target_ip", '');
$community = (string) get_parameter ("community", '');
$snmp_version = (string) get_parameter ("snmp_browser_version", '');
$snmp3_auth_user = get_parameter('snmp3_browser_auth_user');
$snmp3_security_level = get_parameter('snmp3_browser_security_level');
$snmp3_auth_method = get_parameter('snmp3_browser_auth_method');
$snmp3_auth_pass = get_parameter('snmp3_browser_auth_pass');
$snmp3_privacy_method = get_parameter('snmp3_browser_privacy_method');
$snmp3_privacy_pass = get_parameter('snmp3_browser_privacy_pass');
$targets_oids = get_parameter ("oids", "");
$targets_oids = explode(",", $targets_oids);
$custom_action = get_parameter ("custom_action", "");
if ($custom_action != "") {
$custom_action = urldecode (base64_decode ($custom_action));
}
if($action == 'create_modules_snmp'){
$fail_modules = array();
foreach ($targets_oids as $key => $target_oid) {
$oid = snmp_browser_get_oid ($target_ip, $community,
htmlspecialchars_decode($target_oid), $snmp_version, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass);
$name_check = db_get_value ('name', 'tnetwork_component',
'name', $oid['oid']);
if(empty($oid['description'])) {
$description = '';
} else {
$description = io_safe_input($oid['description']);
}
if(!$name_check){
$id = network_components_create_network_component ($oid['oid'],17,1,
array ('description' => $description,
'module_interval' => 300,
'max' => 0,
'min' => 0,
'tcp_send' => $snmp_version,
'tcp_rcv' => '',
'tcp_port' => 0,
'snmp_oid' => $oid['numeric_oid'],
'snmp_community' => $community,
'id_module_group' => 3,
'id_modulo' => 2,
'id_plugin' => 0,
'plugin_user' => '',
'plugin_pass' => '',
'plugin_parameter' => '',
'macros' => '',
'max_timeout' => 0,
'max_retries' => 0,
'history_data' => '',
'dynamic_interval' => 0,
'dynamic_max' => 0,
'dynamic_min' => 0,
'dynamic_two_tailed' => 0,
'min_warning' => 0,
'max_warning' => 0,
'str_warning' => '',
'min_critical' => 0,
'max_critical' => 0,
'str_critical' => '',
'min_ff_event' => 0,
'custom_string_1' => '',
'custom_string_2' => '',
'custom_string_3' => '',
'post_process' => 0,
'unit' => '',
'wizard_level' => 'nowizard',
'macros' => '',
'critical_instructions' => '',
'warning_instructions' => '',
'unknown_instructions' => '',
'critical_inverse' => 0,
'warning_inverse' => 0,
'id_category' => 0,
'tags' => '',
'disabled_types_event' => '{"going_unknown":1}',
'min_ff_event_normal' => 0,
'min_ff_event_warning' => 0,
'min_ff_event_critical' => 0,
'each_ff' => 0));
}
if(empty($id)) {
array_push($fail_modules,$name_check);
}
}
}
echo json_encode($fail_modules);
return;
}
?>

View File

@ -455,6 +455,7 @@ switch ($action) {
$values['type'] = visual_map_get_simple_value_type(
$process_simple_value);
$values['period'] = $period;
$values['width'] = $width;
}
break;
case 'percentile_bar':
@ -953,6 +954,7 @@ switch ($action) {
//This allows min, max and avg process in a simple value
$values['type'] = visual_map_get_simple_value_type($process_simple_value);
$values['period'] = $period;
$values['width'] = $width;
break;
case 'label':
$values['type'] = LABEL;

View File

@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC170712';
$build_version = 'PC170718';
$pandora_version = 'v7.0NG.707';
// Do not overwrite default timezone set if defined.
@ -252,7 +252,7 @@ if (isset($_POST['vc_refr'])) {
//======= Autorefresh code =============================================
$select = db_process_sql("SELECT value FROM tconfig WHERE token='autorefresh_white_list'");
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['value']);
$config['autorefresh_white_list'] = array();
$config['autorefresh_white_list'] = $autorefresh_list;

View File

@ -468,6 +468,7 @@ define("OPTION_SINGLE_SELECT_TIME", 7);
define("OPTION_CUSTOM_INPUT", 8);
define("OPTION_AGENT_AUTOCOMPLETE", 9);
define("OPTION_SELECT_MULTISELECTION", 10);
define("OPTION_COLOR_PICKER", 11);
/* Transactional map constants */
define("NODE_TYPE", 0);

View File

@ -1796,6 +1796,26 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
$id_group = (int) $id_group;
}
if($_SESSION['check_acl'] != null){
if (empty ($_SESSION['check_acl']))
return 0;
$result = 0;
$acl_column = get_acl_column($access);
foreach ($_SESSION['check_acl'] as $row) {
// For each profile for this pair of group and user do...
if (isset($row[$acl_column])) {
$result += $row[$acl_column];
}
}
if ($result >= 1) {
return 1;
}
return 0;
}
$parents_id = array($id_group);
if ($id_group != 0 && $onlyOneGroup !== true) {
$group = db_get_row_filter('tgrupo', array('id_grupo' => $id_group));
@ -1844,8 +1864,13 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
OR tusuario_perfil.id_grupo = 0)", $id_user, implode(', ', $parents_id));
}
$rowdup = db_get_all_rows_sql ($query);
$_SESSION['check_acl'] = $rowdup;
if (empty ($rowdup))
return 0;

View File

@ -855,9 +855,6 @@ function config_process_config () {
config_update_value ('status_images_set', 'default');
}
if(!isset ($config['autorefresh_white_list'])){
config_update_value ('autorefresh_white_list', '');
}
// Load user session
if (isset ($_SESSION['id_usuario']))
$config["id_user"] = $_SESSION["id_usuario"];

View File

@ -164,7 +164,7 @@ function custom_graphs_print($id_graph, $height, $width, $period,
$background_color = 'white', $modules_param = array(), $homeurl = '',
$name_list = array(), $unit_list = array(), $show_last = true,
$show_max = true, $show_min = true, $show_avg = true, $ttl = 1,
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false) {
$dashboard = false, $vconsole = false, $percentil = null, $from_interface = false,$id_widget_dashboard=false) {
global $config;
@ -260,7 +260,8 @@ function custom_graphs_print($id_graph, $height, $width, $period,
$dashboard,
$vconsole,
$percentil,
$from_interface);
$from_interface,
$id_widget_dashboard);
if ($return)
return $output;

View File

@ -368,6 +368,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
}
}
}
EventZoomEnd(null,map.zoom);
}
});
}
@ -396,7 +397,7 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
}
?>
}
last_time_of_data = Math.round(new Date().getTime() / 1000); //Unixtimestamp
//Test if the user change the refresh time.
@ -405,11 +406,16 @@ function gis_activate_ajax_refresh($layers = null, $lastTimeOfData = null, $publ
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
oldRefreshAjaxIntervalSeconds = refreshAjaxIntervalSeconds;
}
EventZoomEnd(null,map.zoom);
}
$(document).ready (
function () {
idIntervalAjax = setInterval("clock_ajax_refresh()", refreshAjaxIntervalSeconds);
EventZoomEnd(null,map.zoom);
}
);
</script>

View File

@ -867,7 +867,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$only_image = false, $homeurl = '', $ttl = 1, $projection = false,
$adapt_key = '', $compare = false, $show_unknown = false,
$menu = true, $backgroundColor = 'white', $percentil = null,
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false) {
$dashboard = false, $vconsole = false, $type_graph = 'area', $fullscale = false,
$id_widget_dashboard = false) {
global $config;
global $graphic_type;
@ -932,8 +933,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$date, $unit, $baseline, $return_data, $show_title,
$projection, $adapt_key, $compare, '', '', $show_unknown,
$percentil, $dashboard, $vconsole, $type_graph, $fullscale);
if ($return_data) {
return $data_returned;
}
@ -984,6 +984,13 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
}
else {
// Color commented not to restrict serie colors
if($id_widget_dashboard){
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
$color['min']['color'] = $opcion['min'];
$color['sum']['color'] = $opcion['avg'];
$color['max']['color'] = $opcion['max'];
}
return
area_graph($flash_chart, $chart, $width, $height, $color,
$legend, $long_index,
@ -1070,7 +1077,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$prediction_period = false, $background_color = 'white',
$name_list = array(), $unit_list = array(), $show_last = true, $show_max = true,
$show_min = true, $show_avg = true, $labels = array(), $dashboard = false,
$vconsole = false, $percentil = null, $from_interface = false) {
$vconsole = false, $percentil = null, $from_interface = false, $id_widget_dashboard=false) {
global $config;
global $graphic_type;
@ -1905,6 +1912,15 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$color[15] = array('border' => '#000000',
'color' => COL_GRAPH13,
'alpha' => CHART_DEFAULT_ALPHA);
if($id_widget_dashboard){
$opcion = unserialize(db_get_value_filter('options','twidget_dashboard',array('id' => $id_widget_dashboard)));
foreach ($module_list as $key => $value) {
if(!empty($opcion[$value])){
$color[$key]['color'] = $opcion[$value];
}
}
}
$threshold_data = array();

View File

@ -1722,7 +1722,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period,
break;
//log4x
case 24:
$sql = sprintf ("SELECT datos AS data, utimestamp
$sql = sprintf ("SELECT message AS data, utimestamp
FROM tagente_datos_log4x
WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d

View File

@ -279,4 +279,111 @@ function snmp_update_translation($oid, $new_oid, $description, $post_process) {
}
}
}
/*
* Print the event filter tag cloud (enterprise feature)
* @param $filter_resume: Array with the active filters
* @param $filter_refs: Array of all arrays to humanize some tags
*/
function print_snmp_tags_active_filters ($filter_resume = array()) {
global $config;
$tags_set = array();
// Alert
if (isset($filter_resume['filter_fired'])) {
array_push ($tags_set, array(
'title' => __('Alert'),
'value' => $filter_resume['filter_fired']
));
}
// Severity
if (isset($filter_resume['filter_severity'])) {
array_push ($tags_set, array(
'title' => __('Severity'),
'value' => $filter_resume['filter_severity']
));
}
// Pagination
if ($filter_resume['pagination'] == "") {
$filter_resume['pagination'] = $config["block_size"];
}
array_push ($tags_set, array(
'title' => __('Pagination'),
'value' => $filter_resume['pagination']
));
// Free search
if (isset($filter_resume['free_search_string']) && $filter_resume['free_search_string'] != "") {
array_push ($tags_set, array(
'title' => __('Search'),
'value' => $filter_resume['free_search_string']
));
}
// Status
if (isset($filter_resume['filter_status']) && $filter_resume['filter_status'] != "") {
array_push ($tags_set, array(
'title' => __('Status'),
'value' => $filter_resume['filter_status']
));
}
// Group by
if (isset($filter_resume['group_by'])) {
if ($filter_resume['group_by'] == 0) {
array_push ($tags_set, array(
'title' => __('Group by Enterprise String / IP'),
'value' => __('No')
));
}
else {
array_push ($tags_set, array(
'title' => __('Group by Enterprise String / IP'),
'value' => __('Yes')
));
}
}
// Date from
if (isset($filter_resume['date_from_trap']) && $filter_resume['date_from_trap'] != "") {
if (isset($filter_resume['time_from_trap']) && $filter_resume['time_from_trap'] != "") {
array_push ($tags_set, array(
'title' => __('From'),
'value' => $filter_resume['date_from_trap'] . " " . $filter_resume['time_from_trap']
));
}
else {
array_push ($tags_set, array(
'title' => __('From'),
'value' => $filter_resume['date_from_trap']
));
}
}
// Date to
if (isset($filter_resume['date_to_trap']) && $filter_resume['date_to_trap'] != "") {
if (isset($filter_resume['time_to_trap']) && $filter_resume['time_to_trap'] != "") {
array_push ($tags_set, array(
'title' => __('To'),
'value' => $filter_resume['date_to_trap'] . " " . $filter_resume['time_to_trap']
));
}
else {
array_push ($tags_set, array(
'title' => __('To'),
'value' => $filter_resume['date_to_trap']
));
}
}
// Trap type
if (isset($filter_resume['trap_type'])) {
array_push ($tags_set, array(
'title' => __('Trap type'),
'value' => $filter_resume['trap_type']
));
}
$title = '';
if(!$config['pure']){
$title = isset($filter_resume['title'])
? __('Active filter') . " (" . $filter_resume['title'] . ")"
: __('Active filters');
}
if (sizeof($filter_resume) > 0) ui_print_tags_view($title, $tags_set);
}
?>

View File

@ -116,7 +116,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a
echo "</a>";
}
echo '&nbsp;<span>' . $level . '</span>';
echo html_print_checkbox("create_$sub_id", 0, false, true, false, '') .'&nbsp;<span>' . $level . '</span>';
if (isset ($sub_level['__VALUE__'])) {
echo '<span class="value" style="display: none;">&nbsp;=&nbsp;' . $sub_level['__VALUE__'] . '</span>';
}
@ -618,3 +618,137 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height
}
?>
<script type="text/javascript">
$(document).ready(function () {
$('input[name*=create_network_component]').click(function () {
var id_check = $('#ul_0').find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
if($(this).is(':checked')){
return this.id;
}
} }).get();
$('input[name*=create_network_component]').removeClass("sub add");
$('input[name*=create_network_component]').addClass("sub spinn");
var target_ip = $('#text-target_ip').val();
var community = $('#text-community').val();
var snmp_version = $('#snmp_browser_version').val();
var snmp3_auth_user = $('#text-snmp3_browser_auth_user').val();
var snmp3_security_level = $('#snmp3_browser_security_level').val();
var snmp3_auth_method = $('#snmp3_browser_auth_method').val();
var snmp3_auth_pass = $('#password-snmp3_browser_auth_pass').val();
var snmp3_privacy_method = $('#snmp3_browser_privacy_method').val();
var snmp3_privacy_pass = $('#password-snmp3_browser_privacy_pass').val();
var custom_action = $('#hidden-custom_action').val();
if (custom_action == undefined) {
custom_action = '';
}
var oids = [];
id_check.forEach(function(product, index) {
var oid = $("#"+product).siblings('a').attr('href');
if(oid.indexOf('javascript: snmpGet("')!=-1) {
oid = oid.replace('javascript: snmpGet("',"");
oid = oid.replace('");',"");
oids.push(oid);
}
});
// Prepare the AJAX call
var params = [
"target_ip=" + target_ip,
"community=" + community,
"oids=" + oids,
"snmp_browser_version=" + snmp_version,
"snmp3_browser_auth_user=" + snmp3_auth_user,
"snmp3_browser_security_level=" + snmp3_security_level,
"snmp3_browser_auth_method=" + snmp3_auth_method,
"snmp3_browser_auth_pass=" + snmp3_auth_pass,
"snmp3_browser_privacy_method=" + snmp3_privacy_method,
"snmp3_browser_privacy_pass=" + snmp3_privacy_pass,
"action=" + "create_modules_snmp",
"custom_action=" + custom_action,
"page=include/ajax/snmp_browser.ajax"
];
$.ajax({
type: "GET",
url: "ajax.php",
data: params.join ("&"),
dataType: "json",
success: function(data) {
$('input[name*=create_network_component]').removeClass("sub spinn");
$('input[name*=create_network_component]').addClass("sub add");
if(data.length !== 0){
$('#error_text').text("");
data.forEach( function(valor, indice, array) {
console.log(valor);
$('#error_text').append('<br/>'+ valor );
});
$("#dialog_error")
.dialog({
resizable: true,
draggable: true,
modal: true,
height: 300,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
}
});
} else {
$("#dialog_success")
.dialog({
resizable: true,
draggable: true,
modal: true,
height: 250,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
}
});
}
}
});
});
$('input[id^=checkbox-create]').change(function () {
if ($(this).is(':checked') ) {
$('input[name*=create_network_component]').show();
var id_input = $(this).attr("id");
id_input = id_input.split("checkbox-create_");
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
return this.id;
} }).get();
checks.forEach(function(product, index) {
$("#"+product).prop('checked', "true");
});
} else {
var id_input = $(this).attr("id");
id_input = id_input.split("checkbox-create_");
var checks = $('#ul_'+id_input[1]).find('input').map(function(){
if(this.id.indexOf('checkbox-create_')!=-1){
return this.id;
} }).get();
checks.forEach(function(product, index) {
$("#"+product).prop('checked', false);
});
}
});
});
</script>

View File

@ -1514,11 +1514,48 @@ function visual_map_print_item($mode = "read", $layoutData,
$layoutData['id_agente_modulo'], $period);
global $config;
if(get_parameter('action') == 'edit'){
echo $io_safe_output_text;
if ($type == SIMPLE_VALUE) {
//~ $returnValue_value = explode('&nbsp;', $value);
//~ if ($returnValue_value[1] != "") {
//~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1];
//~ }
//~ else {
//~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision']));
//~ }
}
else {
// If the value is a string, dont format it
if (!is_string($value)) {
//~ $value = remove_right_zeros(format_for_graph($value, $config['graph_precision']));
}
}
//$io_safe_output_text = str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
if(get_parameter('action') == 'edit'){
//html_debug($layoutData);
//echo 'Data value';
if(strip_tags($io_safe_output_text) != '_VALUE_'){
echo $io_safe_output_text;
}
else{
echo "<img style='width:".$layoutData['width']."px;' src='images/console/signes/data_image.png'>";
}
}
else{
echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
if(strip_tags($io_safe_output_text) != '_VALUE_'){
echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text);
}
else{
echo str_replace('>', ' style="width:'.$layoutData['width'].'px">',$value);
}
}
//Restore db connection
@ -1655,21 +1692,31 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY)
'id_agente_modulo', $id_module);
if ($value === false) {
$value = __('Unknown');
$value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
}
else {
if ( is_numeric($value) ) {
if ($config['simple_module_value']) {
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
if(strpos($value, 'data:image') !== false){
$value = '<img class="b64img" src="'.$value.'">';
}
else{
if ( is_numeric($value) ) {
if ($config['simple_module_value']) {
$value = remove_right_zeros(number_format($value, $config['graph_precision']));
}
}
if (!empty($unit_text)) {
$value .= " " . $unit_text;
}
$value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
}
if (!empty($unit_text)) {
$value .= " " . $unit_text;
}
}
$value = preg_replace ('/\n/i','<br>',$value);
$value = preg_replace ('/\s/i','&nbsp;',$value);
return $value;
break;
case SIMPLE_VALUE_MAX:

View File

@ -138,6 +138,7 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
var baseLayer = null;
map.events.on({"zoomend": EventZoomEnd});
map.events.on({"mouseup": EventZoomEnd});
//Define the maps layer
for (var baselayerIndex in objBaseLayers) {
@ -224,10 +225,18 @@ function js_printMap(id_div, initial_zoom, center_latitude, center_longitude, ob
.transform(map.displayProjection, map.getProjectionObject());
map.setCenter (lonLat, initial_zoom);
}
function EventZoomEnd (evt) {
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
function EventZoomEnd (evt,zoom = map.zoom) {
if(evt == null){
var actual_zoom = (zoom < 6) ? 6 : zoom;
}
else{
var actual_zoom = (evt.object.zoom < 6) ? 6 : evt.object.zoom;
}
var max_width_marker = 38;
var max_zoom_map = map.numZoomLevels;
var max_font_size = 15;
@ -258,7 +267,6 @@ function EventZoomEnd (evt) {
var new_width_marker = (actual_zoom * max_width_marker) / max_zoom_map;
var new_height_marker = (actual_zoom * max_width_marker) / max_zoom_map;
console.log(feature);
feature.style.fontSize = '' + actual_font_size + ' !important';
feature.style.graphicHeight = new_height_marker;
feature.style.graphicWidth = new_width_marker;
@ -280,6 +288,7 @@ function EventZoomEnd (evt) {
function changeShowStatus(newShowStatus) {
statusShow = newShowStatus;
hideAgentsStatus();
EventZoomEnd(null,map.zoom);
js_refreshParentLines();
}

View File

@ -656,7 +656,7 @@ input.sub[disabled] {
input.next, input.upd, input.ok, input.wand, input.delete, input.cog,
input.target, input.search, input.copy, input.add, input.graph,
input.percentile, input.binary, input.camera, input.config,
input.cancel, input.default, input.filter, input.pdf {
input.cancel, input.default, input.filter, input.pdf,input.spinn {
padding-right: 30px;
height: 23px;
@ -741,6 +741,9 @@ input.pdf:disabled {
input.camera {
background-image: url(../../images/input_camera.png) !important;
}
input.spinn {
background-image: url(../../images/spinner_green.gif) !important;
}
#toolbox #auto_save {
padding-top: 5px;

View File

@ -71,7 +71,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.707';
$build = '170712';
$build = '170718';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -141,9 +141,29 @@ $result = db_get_all_rows_sql ($sql, true);
if ($result === false) {
ui_print_empty_data( __('This agent doesn\'t have any GIS data.') );
$sql2 = sprintf ("
SELECT current_longitude AS longitude, current_latitude AS latitude, current_altitude AS altitude,
start_timestamp, description, number_of_packages, manual_placement
FROM tgis_data_status
WHERE tagente_id_agente = %d
ORDER BY start_timestamp DESC
LIMIT %d OFFSET %d", $agentId, $config['block_size'], (int)get_parameter ('offset'));
$result2 = db_get_all_rows_sql ($sql2, true);
if ($result2 === false) {
ui_print_empty_data( __('This agent doesn\'t have any GIS data.') );
} else {
$result2[0]['end_timestamp'] = date('Y-m-d H:i:s');
$result = $result2;
}
}
else {
if ($result !== false) {
if(!$countData){
$countData = 1;
}
ui_pagination ($countData, false) ;
$table->data = array();
foreach ($result as $key => $row) {

View File

@ -150,7 +150,10 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$avg_only = $show_other;
}
$period = get_parameter ("period", SECONDS_1DAY);
$period = get_parameter ("period");
if ($period == "") {
$period = get_parameter ("period_select", SECONDS_1DAY);
}
$id = get_parameter ("id", 0);
$width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH);
$height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT);

View File

@ -47,6 +47,26 @@ if (is_ajax()) {
}
else {
snmp_browser_print_tree ($snmp_tree);
echo html_print_submit_button(__('Create network components'),'create_network_component',
false, array('style' => 'display: none', 'class' => 'sub add'), true);
echo '<div id="dialog_error" style="display: none" title="Network components">';
echo "<div>";
echo "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>";
echo "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
echo "<p style='font-family:Verdana; font-size:12pt;margin-bottom: 0px'>".__('Error creating the following modules:')."</p>";
echo "<p id='error_text' style='font-family:Verdana; font-size:12pt;'></p>";
echo "</div>";
echo '</div>';
echo '<div id="dialog_success" style="display: none" title="Network components">';
echo "<div>";
echo "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>";
echo "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>";
echo "<p style='font-family:Verdana; font-size:12pt;'>".__('Modules successfully created')."</p>";
echo "</div>";
echo '</div>';
}
return;
}

View File

@ -518,15 +518,22 @@ $filter .= html_print_submit_button(__('Update'), 'search', false, 'class="sub u
$filter .= '</div>';
$filter .= '</form>';
$filter_resume = array();
$filter_resume['filter_fired'] = $alerted[$filter_fired];
$filter_resume['filter_severity'] = $severities[$filter_severity];
$filter_resume['pagination'] = $paginations[$pagination];
$filter_resume['free_search_string'] = $free_search_string;
$filter_resume['filter_status'] = $status_array[$filter_status];
$filter_resume['group_by'] = $group_by;
$filter_resume['date_from_trap'] = $date_from_trap;
$filter_resume['time_from_trap'] = $time_from_trap;
$filter_resume['date_to_trap'] = $date_to_trap;
$filter_resume['time_to_trap'] = $time_to_trap;
$filter_resume['trap_type'] = $trap_types[$trap_type];
$traps = db_get_all_rows_sql($sql);
$trapcount = (int) db_get_value_sql($sql_count);
// No traps
if (empty ($traps)) {
// Header
@ -546,6 +553,9 @@ if (empty ($traps)) {
if(!empty ($traps2)){
ui_toggle($filter, __('Toggle filter(s)'));
print_snmp_tags_active_filters($filter_resume);
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP traps in database that contains this filter') ) );
} else {
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP traps in database') ) );
@ -651,6 +661,8 @@ if (empty ($traps)) {
ui_toggle($filter, __('Toggle filter(s)'));
unset ($table);
print_snmp_tags_active_filters($filter_resume);
if (($config['dbtype'] == 'oracle') && ($traps !== false)) {
for ($i = 0; $i < count($traps); $i++) {
unset($traps[$i]['rnum']);
@ -774,7 +786,7 @@ if ($traps !== false) {
continue;
}
$data[1] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'" title="'.__('View agent details').'">';
$data[1] .= '<strong>'.($agent["alias"] ? $agent["alias"] : $agent["nombre"]).ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");'</strong></a>';
$data[1] .= '<strong>'.$agent["alias"].ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");'</strong></a>';
}
//OID
@ -1156,4 +1168,4 @@ ui_include_time_picker();
}
}
</script>
</script>

View File

@ -94,11 +94,11 @@ if (isset ($_GET["modified"]) && !$view_mode) {
//save autorefresh list
$autorefresh_list = get_parameter_post ("autorefresh_list");
if(($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')){
db_process_sql("UPDATE tconfig SET value ='' WHERE token='autorefresh_white_list'");
}else{
db_process_sql("UPDATE tconfig SET value ='".json_encode($autorefresh_list)."' WHERE token='autorefresh_white_list'");
$upd_info['autorefresh_white_list'] = "";
}
else{
$upd_info['autorefresh_white_list'] = json_encode($autorefresh_list);
}
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $id);
@ -382,8 +382,8 @@ $autorefresh_list_out['operation/visual_console/render_view'] = "render_view";
$autorefresh_list_out['operation/events/events'] = "events";
if(!isset($autorefresh_list)){
$select = db_process_sql("SELECT value FROM tconfig WHERE token='autorefresh_white_list'");
$autorefresh_list = json_decode($select[0]['value']);
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if($autorefresh_list === null){
$autorefresh_list[0] = __('None');
}else{

View File

@ -245,11 +245,12 @@ $ignored_params['refr'] = '';
//cb();
url = js_html_entity_decode( href ) + duration;
//$(document).attr ("location", url);
$.get(window.location.href.replace("render_view","pure_ajax"), function(respuestaSolicitud){
$.post(window.location.href.replace("refr=300","refr="+new_count), function(respuestaSolicitud){
$('#background_<?php echo $id_layout; ?>').html(respuestaSolicitud);
startCountDown(refr, false);
});
}
$("#main_pure").css('background-color','<?php echo $layout['background_color']; ?>');
}
});
}
@ -260,6 +261,7 @@ $ignored_params['refr'] = '';
$('select#refr').change(function (event) {
refr = Number.parseInt(event.target.value, 10);
new_count = event.target.value;
startCountDown(refr, false);
});
}
@ -278,14 +280,19 @@ $ignored_params['refr'] = '';
$(".overlay").removeClass("overlay").addClass("overlaydisabled");
$('.item:not(.icon) img').each( function() {
$('.item:not(.icon) img:not(.b64img)').each( function() {
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
$(this).css('margin-top',(parseInt($(this).parent().parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
}
else {
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
if(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2 < 0){
$(this).css('margin-left','');
$(this).css('margin-top','');
} else {
$(this).css('margin-left',(parseInt($(this).parent().parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
}
});

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.707
%define release 170712
%define release 170718
# 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.0NG.707
%define release 170712
%define release 170718
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1112,6 +1112,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`id_filter` int(10) unsigned NULL default NULL,
`session_time` int(10) signed NOT NULL default 0,
`default_event_filter` int(10) unsigned NOT NULL default 0,
`autorefresh_white_list` text not null default '',
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;
@ -1381,7 +1382,7 @@ CREATE TABLE IF NOT EXISTS `tmodule` (
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tserver_export` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`name` varchar(600) BINARY NOT NULL default '',
`preffix` varchar(100) NOT NULL default '',
`interval` int(5) unsigned NOT NULL default '300',
`ip_server` varchar(100) NOT NULL default '',

View File

@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 3),
('MR', 4),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '707'),
('current_package_enterprise', '708'),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}');
UNLOCK TABLES;

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.707-170712
Version: 7.0NG.707-170718
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.0NG.707-170712"
pandora_version="7.0NG.707-170718"
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.0NG.707";
my $pandora_build = "170712";
my $pandora_build = "170718";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.707
%define release 170712
%define release 170718
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.707
%define release 170712
%define release 170718
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.707"
PI_BUILD="170712"
PI_BUILD="170718"
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.0NG.707 PS170712";
my $version = "7.0NG.707 PS170718";
# 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.0NG.707 PS170712";
my $version = "7.0NG.707 PS170718";
# save program name for logging
my $progname = basename($0);