";
$single_table .= "";
$single_table .= " ";
@@ -491,6 +508,12 @@ if($edit_container){
$table->data[] = $data;
$table->rowclass[] = '';
+ $data = array();
+ $data[0] = __('Type of graph');
+ $data[1] = html_print_select ($type_graphs, 'simple_type_graph2', "","","",0,true);
+ $table->data[] = $data;
+ $table->rowclass[] = '';
+
$data = array();
$data[0] = __('Only average');
$data[1] = html_print_checkbox('only_avg_2', 1, false,true);
@@ -610,29 +633,31 @@ echo html_print_input_hidden('id_agent', 0);
$(document).ready (function () {
$("input[name=add_single]").click (function () {
var id_agent_module = $("#id_agent_module").val();
- if(id_agent_module !== '0'){
- var id_agent = $("#hidden-id_agent").attr('value');
- var time_lapse = $("#hidden-period_single").attr('value');
+ if(id_agent_module !== '0'){
+ var id_agent = $("#hidden-id_agent").attr('value');
+ var time_lapse = $("#hidden-period_single").attr('value');
+ var simple_type_graph = $("#simple_type_graph option:selected").attr('value');
var only_avg = $("#checkbox-only_avg").prop("checked");
- var fullscale = $("#checkbox-fullscale").prop("checked");
+ var fullscale = $("#checkbox-fullscale").prop("checked");
var id_container = ;
- jQuery.post ("ajax.php",
- {"page" : "godmode/reporting/create_container",
- "add_single" : 1,
+ jQuery.post ("ajax.php",
+ {"page" : "godmode/reporting/create_container",
+ "add_single" : 1,
"id_agent" : id_agent,
"id_agent_module" : id_agent_module,
"time_lapse" : time_lapse,
+ "simple_type_graph": simple_type_graph,
"only_avg" : only_avg,
- "fullscale" : fullscale,
+ "fullscale" : fullscale,
"id_container" : id_container,
- },
- function (data, status) {
- var url = location.href.replace('&update_container=1', "");
- url = url.replace('&delete_item=1', "");
- location.href = url.replace('&add_container=1', "&id="+id_container);
- }
+ },
+ function (data, status) {
+ var url = location.href.replace('&update_container=1', "");
+ url = url.replace('&delete_item=1', "");
+ location.href = url.replace('&add_container=1', "&id="+id_container);
+ }
);
- }
+ }
});
$("input[name=add_custom]").click (function () {
@@ -647,7 +672,7 @@ echo html_print_input_hidden('id_agent', 0);
"time_lapse" : time_lapse,
"id_custom" : id_custom,
"id_container" : id_container,
- "fullscale" : fullscale,
+ "fullscale" : fullscale,
},
function (data, status) {
var url = location.href.replace('&update_container=1', "");
@@ -664,10 +689,11 @@ echo html_print_input_hidden('id_agent', 0);
var time_lapse = $("#hidden-period_dynamic").attr('value');
var group = $("#container_id_group1").val();
var module_group = $("#combo_modulegroup").val();
+ var simple_type_graph2 = $("#simple_type_graph2 option:selected").attr('value');
var tag = $("#tag").val();
- var only_avg = $("#checkbox-only_avg_2").prop("checked");
- var id_container = ;
- var fullscale = $("#checkbox-fullscale_3").prop("checked");
+ var only_avg = $("#checkbox-only_avg_2").prop("checked");
+ var id_container = ;
+ var fullscale = $("#checkbox-fullscale_3").prop("checked");
jQuery.post ("ajax.php",
{"page" : "godmode/reporting/create_container",
"add_dynamic" : 1,
@@ -676,6 +702,7 @@ echo html_print_input_hidden('id_agent', 0);
"module_group" : module_group,
"agent_alias" : agent_alias,
"module_name" : module_name,
+ "simple_type_graph2": simple_type_graph2,
"tag" : tag,
"id_container" : id_container,
"only_avg" : only_avg,
diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js
index 99917c5f40..5d06dfe0d7 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -374,8 +374,7 @@ function update_button_palette_callback() {
}
-
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
$("#image_" + idItem).attr('width', 70);
@@ -503,7 +502,7 @@ function update_button_palette_callback() {
}
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
$("#image_" + idItem).attr('width', 70);
@@ -626,6 +625,14 @@ function update_button_palette_callback() {
setBarsGraph(idItem, values);
break;
+
+ case 'clock':
+
+ $("#text_" + idItem).html(values['label']);
+ $("#image_" + idItem).attr("src", "images/spinner.gif");
+ setClock(idItem, values);
+ break;
+
case 'auto_sla_graph':
if($('input[name=width]').val() == ''){
alert('Undefined width');
@@ -679,7 +686,7 @@ function update_button_palette_callback() {
}
$("#image_" + idItem).attr('src', "images/spinner.gif");
if ((values['width'] == 0) || (values['height'] == 0)) {
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
$("#image_" + idItem).attr('width', 70);
@@ -856,6 +863,9 @@ function readFields() {
values['label_position'] = $(".labelpos[sel=yes]").attr('position');
values['show_statistics'] = $("input[name=show_statistics]").is(':checked') ? 1 : 0;
values['show_on_top'] = $("input[name=show_on_top]").is(':checked') ? 1 : 0;
+ values['time_format'] = $("select[name=time_format]").val();
+ values['timezone'] = $("select[name=timezone]").val();
+ values['clock_animation'] = $("select[name=clock_animation]").val();
if (is_metaconsole()) {
values['metaconsole'] = 1;
@@ -1216,6 +1226,7 @@ function toggle_item_palette() {
activeToolboxButton('simple_value', true);
activeToolboxButton('label', true);
activeToolboxButton('icon', true);
+ activeToolboxButton('clock', true);
activeToolboxButton('percentile_item', true);
activeToolboxButton('group_item', true);
activeToolboxButton('box_item', true);
@@ -1247,6 +1258,7 @@ function toggle_item_palette() {
activeToolboxButton('simple_value', false);
activeToolboxButton('label', false);
activeToolboxButton('icon', false);
+ activeToolboxButton('clock', false);
activeToolboxButton('percentile_item', false);
activeToolboxButton('group_item', false);
activeToolboxButton('box_item', false);
@@ -1557,7 +1569,14 @@ function loadFieldsFromDB(item) {
$("#percentile_item_row_6 .ColorPickerDivSample")
.css('background-color', val);
}
-
+
+ if (key == 'clock_animation')
+ $("select[name=clock_animation]").val(val);
+ if (key == 'time_format')
+ $("select[name=time_format]").val(val);
+ if (key == 'timezone')
+ $("select[name=timezone]").val(val);
+
if (key == 'value_show') {
$("select[name=value_show]").val(val);
}
@@ -1868,6 +1887,15 @@ function hiddenFields(item) {
$("#line_width_row").css('display', 'none');
$("#line_width_row." + item).css('display', '');
+
+ $("#timezone_row").css('display', 'none');
+ $("#timezone_row." + item).css('display', '');
+
+ $("#timeformat_row").css('display', 'none');
+ $("#timeformat_row." + item).css('display', '');
+
+ $("#clock_animation_row").css('display', 'none');
+ $("#clock_animation_row." + item).css('display', '');
$("#line_case").css('display', 'none');
$("#line_case." + item).css('display', '');
@@ -1908,7 +1936,7 @@ function cleanFields(item) {
$("input[name='grid_color']").val('#000000');
$("input[name='resume_color']").val('#000000');
$("input[name='border_width']").val(3);
- $("input[name='fill_color']").val('#ffffff');
+ $("input[name='fill_color']").val('#000000');
$("input[name='line_width']").val(3);
$("input[name='line_color']").val('#000000');
$("select[name=type_percentile]").val('');
@@ -1917,6 +1945,9 @@ function cleanFields(item) {
$("input[name=percentile_label]").val('');
$(".ColorPickerDivSample").css('background-color', '#FFF');
$("input[name=show_on_top]").prop("checked", false);
+ $("select[name='time_format']").val('time');
+ $("select[name='timezone']").val('Europe/Madrid');
+ $("select[name='clock_animation']").val('analogic_1');
$("#preview").empty();
@@ -2102,6 +2133,84 @@ function setBarsGraph(id_data, values) {
});
}
+function setClock(id_data, values) {
+ var url_hack_metaconsole = '';
+ if (is_metaconsole()) {
+ url_hack_metaconsole = '../../';
+ }
+
+ parameter = Array();
+
+ parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
+ parameter.push ({name: "action", value: "get_module_type_string"});
+ parameter.push ({name: "time_format", value: values['time_format']});
+ parameter.push ({name: "timezone", value: values['timezone']});
+ parameter.push ({name: "clock_animation", value: values['clock_animation']});
+ parameter.push ({name: "label", value: values['label']});
+ parameter.push ({name: "width", value: values['width_percentile']});
+ parameter.push ({name: "always_on_top", value: values['always_on_top']});
+ parameter.push ({name: "id_element", value: id_data});
+ parameter.push ({name: "id_visual_console", value: id_visual_console});
+ jQuery.ajax({
+ url: get_url_ajax(),
+ data: parameter,
+ type: "POST",
+ dataType: 'json',
+ success: function (data) {
+
+ if(values['clock_animation'] == 'analogic_1'){
+ $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/clock.png');
+ }
+ else{
+ $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/digital-clock.png');
+ }
+
+ if (values['width_percentile'] == 0) {
+ if(values['clock_animation'] == 'analogic_1'){
+ $("#" + id_data + " img").css('width', 200 + 'px');
+ $("#" + id_data + " img").css('height', 240 + 'px');
+ }
+ else{
+ $("#" + id_data + " img").css('width', 200 + 'px');
+
+ if(values['time_format'] == 'time'){
+ $("#" + id_data + " img").css('height', 71 + 'px');
+ }
+ else{
+ $("#" + id_data + " img").css('height', 91 + 'px');
+ }
+
+ }
+
+ }
+ else{
+ if(values['clock_animation'] == 'analogic_1'){
+ $("#" + id_data + " img").css('width', values['width_percentile'] + 'px');
+ $("#" + id_data + " img").css('height', parseInt(values['width_percentile'])+40 + 'px');
+ }
+ else{
+ $("#" + id_data + " img").css('width', values['width_percentile'] + 'px');
+
+ if(values['time_format'] == 'time'){
+ $("#" + id_data + " img").css('height', parseInt(values['width_percentile'])/3.9+20 + 'px');
+ }
+ else{
+ $("#" + id_data + " img").css('height', parseInt(values['width_percentile'])/3.9+40 + 'px');
+ }
+ }
+
+ }
+
+ if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){
+ $('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2);
+ }
+ else{
+ $('#'+id_data+ ' img').css('margin-left', parseInt($('#'+id_data).css('width'))/2 - parseInt($('#'+id_data+ ' img').css('width'))/2);
+ }
+ }
+ });
+}
+
function setModuleGraph(id_data) {
var parameter = Array();
@@ -2719,7 +2828,9 @@ function createItem(type, values, id_data) {
break;
case 'group_item':
+
class_type = "group_item";
+
img_src = "images/spinner.gif";
@@ -2797,25 +2908,20 @@ function createItem(type, values, id_data) {
if ((values['width'] == 0) || (values['height'] == 0)) {
// Do none
- if(values['image'] != '' && values['image'] != 'none'){
-
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if(values['image'] != '' && values['image'] != 'none'){
+ if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
+ $image.attr('width', '70')
+ .attr('height', '70');
+ }
+ else{
+ $image.attr('width', values['naturalWidth'])
+ .attr('height', values['naturalHeight']);
+ }
+ }
+ else{
$image.attr('width', '70')
.attr('height', '70');
}
- else{
- $image.attr('width', $('#preview > img')[0].naturalWidth)
- .attr('height', $('#preview > img')[0].naturalHeight);
- }
-
-
- }
- else{
- $image.attr('width', '70')
- .attr('height', '70');
- }
-
-
}
else {
$image.attr('width', values['width'])
@@ -2917,13 +3023,13 @@ function createItem(type, values, id_data) {
if(values['image'] != '' && values['image'] != 'none'){
// Do none
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
$image.attr('width', '70')
.attr('height', '70');
}
else{
- $image.attr('width', $('#preview > img')[0].naturalWidth)
- .attr('height', $('#preview > img')[0].naturalHeight);
+ $image.attr('width', values['naturalWidth'])
+ .attr('height', values['naturalHeight']);
}
}
else{
@@ -2962,7 +3068,7 @@ function createItem(type, values, id_data) {
case 'static_graph':
class_type = "static_graph";
-
+
img_src = "images/spinner.gif";
item = $('
')
@@ -3008,13 +3114,13 @@ function createItem(type, values, id_data) {
if ((values['width'] == 0) || (values['height'] == 0)) {
// Do none
if(values['image'] != '' && values['image'] != 'none'){
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
$image.attr('width', '70')
.attr('height', '70');
}
else{
- $image.attr('width', $('#preview > img')[0].naturalWidth)
- .attr('height', $('#preview > img')[0].naturalHeight);
+ $image.attr('width', values['naturalWidth'])
+ .attr('height', values['naturalHeight']);
}
}
else{
@@ -3141,13 +3247,13 @@ function createItem(type, values, id_data) {
if(values['image'] != '' && values['image'] != 'none'){
// Do none
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalHeight'] > 150){
$image.attr('width', '70')
.attr('height', '70');
}
else{
- $image.attr('width', $('#preview > img')[0].naturalWidth)
- .attr('height', $('#preview > img')[0].naturalHeight);
+ $image.attr('width', values['naturalWidth'])
+ .attr('height', values['naturalHeight']);
}
}
else{
@@ -3396,7 +3502,43 @@ function createItem(type, values, id_data) {
}
- setBarsGraph(id_data, values);
+ setBarsGraph(id_data, values);
+ break;
+ case 'clock':
+ sizeStyle = '';
+ imageSize = '';
+
+ if(values['label_position'] == 'up'){
+ item = $('' +
+ '
' +
+ '
' +
+ '
'
+ );
+ }
+ else if(values['label_position'] == 'down'){
+ item = $('' +
+ '
' +
+ '
' +
+ '
'
+ );
+ }
+ else if(values['label_position'] == 'left'){
+ item = $('' +
+ '
' +
+ '
' +
+ '
'
+ );
+ }
+ else if(values['label_position'] == 'right'){
+ item = $('' +
+ '
' +
+ '
' +
+ '
'
+ );
+ }
+
+ setClock(id_data, values);
+
break;
case 'simple_value':
sizeStyle = '';
@@ -3422,7 +3564,7 @@ function createItem(type, values, id_data) {
break;
case 'icon':
if ((values['width'] == 0) || (values['height'] == 0)) {
- if($('#preview > img').attr('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
+ if(values['naturalWidth'] == null || values['naturalWidth'] > 150 || values['naturalWidth'] > 150){
sizeStyle = 'width: ' + '70' + 'px; height: ' + '70' + 'px;';
imageSize = 'width="' + '70' + '" height="' + '70' + '"';
}
@@ -3527,6 +3669,10 @@ function insertDB(type, values) {
success: function (data) {
if (data['correct']) {
id = data['id_data'];
+ if((type === 'group_item') || (type === 'icon') || (type === 'static_graph')){
+ values['naturalWidth'] = $('#preview > img')[0].naturalWidth;
+ values['naturalHeight'] = $('#preview > img')[0].naturalHeight;
+ }
createItem(type, values, id);
addItemSelectParents(id, data['text']);
//Reload all events for the item and new item.
@@ -3623,6 +3769,7 @@ function updateDB_visual(type, idElement , values, event, top, left) {
case 'icon':
case 'module_graph':
case 'bars_graph':
+ case 'clock':
case 'auto_sla_graph':
case 'donut_graph':
@@ -3866,7 +4013,12 @@ function copyDB(idItem) {
values = data['values'];
type = data['type'];
id = data['id_data'];
-
+
+ if((type === 'group_item') || (type === 'icon') || (type === 'static_graph')){
+ values['naturalWidth'] = $('#image_'+idItem).prop('naturalWidth');
+ values['naturalHeight'] = $('#image_'+idItem).prop('naturalHeight');
+ }
+
createItem(type, values, id);
addItemSelectParents(id, data['text']);
@@ -4111,6 +4263,15 @@ function eventsItems(drag) {
activeToolboxButton('delete_item', true);
activeToolboxButton('show_grid', false);
}
+ if ($(divParent).hasClass('clock')) {
+ creationItem = null;
+ selectedItem = 'clock';
+ idItem = $(divParent).attr('id');
+ activeToolboxButton('copy_item', true);
+ activeToolboxButton('edit_item', true);
+ activeToolboxButton('delete_item', true);
+ activeToolboxButton('show_grid', false);
+ }
if ($(divParent).hasClass('handler_start')) {
idItem = $(divParent).attr('id')
.replace("handler_start_", "");
@@ -4295,6 +4456,9 @@ function eventsItems(drag) {
if ($(event.target).hasClass('icon')) {
selectedItem = 'icon';
}
+ if ($(event.target).hasClass('clock')) {
+ selectedItem = 'clock';
+ }
if ($(event.target).hasClass('handler_start')) {
selectedItem = 'handler_start';
}
@@ -4617,6 +4781,10 @@ function click_button_toolbox(id) {
toolbuttonActive = creationItem = 'icon';
toggle_item_palette();
break;
+ case 'clock':
+ toolbuttonActive = creationItem = 'clock';
+ toggle_item_palette();
+ break;
case 'group_item':
toolbuttonActive = creationItem = 'group_item';
toggle_item_palette();
@@ -4658,6 +4826,7 @@ function click_button_toolbox(id) {
activeToolboxButton('simple_value', false);
activeToolboxButton('label', false);
activeToolboxButton('icon', false);
+ activeToolboxButton('clock', false);
activeToolboxButton('service', false);
activeToolboxButton('group_item', false);
activeToolboxButton('auto_sla_graph', false);
@@ -4691,6 +4860,7 @@ function click_button_toolbox(id) {
activeToolboxButton('simple_value', true);
activeToolboxButton('label', true);
activeToolboxButton('icon', true);
+ activeToolboxButton('clock', true);
activeToolboxButton('group_item', true);
activeToolboxButton('auto_sla_graph', true);
activeToolboxButton('donut_graph', true);
@@ -4744,6 +4914,7 @@ function click_button_toolbox(id) {
}
break;
}
+ $('.ColorPickerDivSample').css('background-color',"black");
}
function showPreview(image) {
diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php
index 8f25bdb3a4..479269af08 100755
--- a/pandora_console/godmode/setup/setup_visuals.php
+++ b/pandora_console/godmode/setup/setup_visuals.php
@@ -248,6 +248,18 @@ if(enterprise_installed()) {
$row++;
}
+if(enterprise_installed()) {
+ $table_styles->data[$row][0] = __('Docs URL (login)');
+ $table_styles->data[$row][1] = html_print_input_text ('custom_docs_url', $config["custom_docs_url"], '', 50, 50, true);
+ $row++;
+}
+
+if(enterprise_installed()) {
+ $table_styles->data[$row][0] = __('Support URL (login)');
+ $table_styles->data[$row][1] = html_print_input_text ('custom_support_url', $config["custom_support_url"], '', 50, 50, true);
+ $row++;
+}
+
$table_styles->data[$row][0] = __('Disable logo in graphs');
$table_styles->data[$row][1] = __('Yes') . ' ' .
html_print_radio_button_extended ('fixed_graph', 1, '', $config["fixed_graph"], $open, '','',true) .
@@ -475,8 +487,8 @@ if (!enterprise_installed()) {
$disabled_graph_precision = true;
}
-$table_chars->data[$row][0] = __('Data precision for reports');
-$table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown in reports. It must be a number between 0 and 5'), true);
+$table_chars->data[$row][0] = __('Data precision for reports and visual consoles');
+$table_chars->data[$row][0] .= ui_print_help_tip(__('Number of decimals shown in reports and visual consoles. It must be a number between 0 and 5'), true);
$table_chars->data[$row][1] = html_print_input_text ('graph_precision', $config["graph_precision"], '', 5, 5, true, $disabled_graph_precision, false, "onChange=\"change_precision()\"");
$row++;
diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php
index afd33b961e..37291e2ce3 100644
--- a/pandora_console/godmode/users/configure_user.php
+++ b/pandora_console/godmode/users/configure_user.php
@@ -152,7 +152,7 @@ if ($create_user) {
}
$values = array ();
- $id = (string) get_parameter ('id_user');
+ $values['id_user'] = (string) get_parameter ('id_user');
$values['fullname'] = (string) get_parameter ('fullname');
$values['firstname'] = (string) get_parameter ('firstname');
$values['lastname'] = (string) get_parameter ('lastname');
@@ -220,15 +220,14 @@ if ($create_user) {
$new_user = true;
}
else {
- $info = 'FullName: ' . $values['fullname'] . ' Firstname: ' . $values['firstname'] .
- ' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
- ' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
- ' Is_admin: ' . $values['is_admin'] .
- ' Language: ' . $values['language'] .
- ' Block size: ' . $values['block_size'] . ' Interactive Charts: ' . $values['flash_chart'];
-
+ $info =
+ '{"Id_user":"' . $values['id_user'] . '","FullName":"' . $values['fullname'] . '","Firstname":"'. $values['firstname'] .'","Lastname":"'. $values['lastname'] . '","Email":"' . $values['email'] . '","Phone":"' . $values['phone'] . '","Comments":"' . $values['comments'] .'","Is_admin":"' . $values['is_admin'] .'","Language":"' . $values['language'] . '","Block size":"' . $values['block_size'] . '","Interactive Charts":"' . $values['flash_chart'].'"';
+
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
- $info .= ' Skin: ' . $values['id_skin'];
+ $info .= ',"Skin":"' . $values['id_skin'].'"}';
+ }
+ else{
+ $info .= '}';
}
switch ($config['dbtype']) {
@@ -278,6 +277,7 @@ if ($create_user) {
if ($update_user) {
$values = array ();
+ $values['id_user'] = (string) get_parameter ('id_user');
$values['fullname'] = (string) get_parameter ('fullname');
$values['firstname'] = (string) get_parameter ('firstname');
$values['lastname'] = (string) get_parameter ('lastname');
@@ -362,21 +362,40 @@ if ($update_user) {
}
}
else {
- $info = 'FullName: ' . $values['fullname'] . ' Firstname: ' . $values['firstname'] .
- ' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] .
- ' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
- ' Is_admin: ' . $values['is_admin'] .
- ' Language: ' . $values['language'] .
- ' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart'] .
- ' Section: ' . $values['section'];
+
+ $has_skin = false;
+ $has_wizard = false;
+
+ $info = '{"id_user":"'.$values['id_user'].'",
+ "FullName":"' . $values['fullname'] .'",
+ "Firstname":"' . $values['firstname'] .'",
+ "Lastname":"' . $values['lastname'] . '",
+ "Email":"' . $values['email'] . '",
+ "Phone":"' . $values['phone'] . '",
+ "Comments":"' . $values['comments'] . '",
+ "Is_admin":"' . $values['is_admin'] . '",
+ "Language":"' . $values['language'] . '",
+ "Block size":"' . $values['block_size'] . '",
+ "Flash Chats":"' . $values['flash_chart'] . '",
+ "Section":"' . $values['section'].'"';
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
- $info .= ' Skin: ' . $values['id_skin'];
+ $info .= ',"Skin":"' . $values['id_skin'].'"';
+ $has_skin = true;
}
if(enterprise_installed() && defined('METACONSOLE')) {
- $info .= ' Wizard access: ' . $values['metaconsole_access'];
+ $info .= ',"Wizard access":"' . $values['metaconsole_access'].'"}';
+ $has_wizard = true;
}
+ elseif($has_skin){
+ $info .= '}';
+ }
+
+ if(!$has_skin && !$has_wizard){
+ $info .= '}';
+ }
+
db_pandora_audit("User management", "Updated user ".io_safe_input($id),
false, false, $info);
diff --git a/pandora_console/images/clock-tab.disabled.png b/pandora_console/images/clock-tab.disabled.png
new file mode 100644
index 0000000000..cd889bc875
Binary files /dev/null and b/pandora_console/images/clock-tab.disabled.png differ
diff --git a/pandora_console/images/clock-tab.png b/pandora_console/images/clock-tab.png
new file mode 100644
index 0000000000..0a0cbee9db
Binary files /dev/null and b/pandora_console/images/clock-tab.png differ
diff --git a/pandora_console/images/console/signes/clock.png b/pandora_console/images/console/signes/clock.png
new file mode 100644
index 0000000000..b226abd1e9
Binary files /dev/null and b/pandora_console/images/console/signes/clock.png differ
diff --git a/pandora_console/images/console/signes/digital-clock.png b/pandora_console/images/console/signes/digital-clock.png
new file mode 100644
index 0000000000..97a6f9349d
Binary files /dev/null and b/pandora_console/images/console/signes/digital-clock.png differ
diff --git a/pandora_console/images/firts_task/icono-cluster-activo.png b/pandora_console/images/firts_task/icono-cluster-activo.png
new file mode 100644
index 0000000000..49720af75d
Binary files /dev/null and b/pandora_console/images/firts_task/icono-cluster-activo.png differ
diff --git a/pandora_console/images/networkmap/so_cluster.png b/pandora_console/images/networkmap/so_cluster.png
new file mode 100644
index 0000000000..e515c9e7a8
Binary files /dev/null and b/pandora_console/images/networkmap/so_cluster.png differ
diff --git a/pandora_console/images/os_icons/so_big_icons/so_cluster.png b/pandora_console/images/os_icons/so_big_icons/so_cluster.png
new file mode 100644
index 0000000000..4b85e5f049
Binary files /dev/null and b/pandora_console/images/os_icons/so_big_icons/so_cluster.png differ
diff --git a/pandora_console/images/os_icons/so_cluster.png b/pandora_console/images/os_icons/so_cluster.png
new file mode 100644
index 0000000000..5f76cd1615
Binary files /dev/null and b/pandora_console/images/os_icons/so_cluster.png differ
diff --git a/pandora_console/images/os_icons/so_cluster_small.png b/pandora_console/images/os_icons/so_cluster_small.png
new file mode 100644
index 0000000000..8f5a3c9c5f
Binary files /dev/null and b/pandora_console/images/os_icons/so_cluster_small.png differ
diff --git a/pandora_console/include/ajax/graph.ajax.php b/pandora_console/include/ajax/graph.ajax.php
index 33effe1f83..75499d6e13 100644
--- a/pandora_console/include/ajax/graph.ajax.php
+++ b/pandora_console/include/ajax/graph.ajax.php
@@ -159,6 +159,9 @@ if ($get_graphs){
if($period > 1){
$value['time_lapse'] = $period;
}
+
+ $type_graph = ($value['type_graph'])? "line" : "area";
+
switch ($value['type']) {
case 'simple_graph':
if ($contador > 0) {
@@ -195,9 +198,8 @@ if ($get_graphs){
null,
false,
false,
- 'area',
- $value['fullscale']
- );
+ $type_graph,
+ $value['fullscale']);
$contador --;
}
// $table .= "";
@@ -339,9 +341,8 @@ if ($get_graphs){
null,
false,
false,
- 'area',
- $value['fullscale']
- );
+ $type_graph,
+ $value['fullscale']);
$contador --;
}
}
diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php
index 3c5d64a437..e22a4ca266 100755
--- a/pandora_console/include/ajax/module.php
+++ b/pandora_console/include/ajax/module.php
@@ -283,6 +283,14 @@ if ($get_module_detail) {
if ($attr[1] != "modules_format_data") {
$data[] = date('d F Y h:i:s A', $row['utimestamp']);
}
+ elseif(is_snapshot_data($row[$attr[0]])){
+ if($config['command_snapshot']){
+ $data[] = " ";
+ }
+ else{
+ $data[] = "".wordwrap(io_safe_input($row[$attr[0]]),60," \n",true)." ";
+ }
+ }
elseif (($config['command_snapshot'] == '0') && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
// Its a single-data, multiline data (data snapshot) ?
@@ -342,21 +350,11 @@ if ($get_module_detail) {
$data[] = 'No data';
}
else {
- if(is_snapshot_data($row[$attr[0]])){
- if($config['command_snapshot']){
- $data[] = " ";
- }
- else{
- $data[] = "".wordwrap(io_safe_input($row[$attr[0]]),60," \n",true)." ";
- }
- }
- else{
- $data_macro = modules_get_unit_macro($row[$attr[0]],$unit);
- if($data_macro){
- $data[] = $data_macro;
- } else {
- $data[] = $row[$attr[0]];
- }
+ $data_macro = modules_get_unit_macro($row[$attr[0]],$unit);
+ if($data_macro){
+ $data[] = $data_macro;
+ } else {
+ $data[] = $row[$attr[0]];
}
}
}
@@ -472,6 +470,7 @@ if ($list_modules) {
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
$id_agente = $id_agent = (int)get_parameter('id_agente', 0);
+ $show_notinit = (int)get_parameter('show_notinit', 0);
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agent;
$selectTypeUp = '';
$selectTypeDown = '';
@@ -592,6 +591,13 @@ if ($list_modules) {
if (!empty($status_text_monitor)) {
$status_text_monitor_sql .= $status_text_monitor . '%';
}
+
+ if(!$show_notinit){
+ $monitor_filter = AGENT_MODULE_STATUS_NO_DATA;
+ }
+ else{
+ $monitor_filter = -15;
+ }
//Count monitors/modules
switch ($config["dbtype"]) {
@@ -610,7 +616,7 @@ if ($list_modules) {
AND tagente_estado.estado != %d
AND tagente_modulo.%s
ORDER BY tagente_modulo.id_module_group , %s %s",
- $id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
+ $id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
$status_module_group_filter, $order['field'], $order['order']);
break;
case "postgresql":
@@ -632,7 +638,7 @@ if ($list_modules) {
tagente_modulo.nombre
ORDER BY tagente_modulo.id_module_group , %s %s",
$id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql,
- $tags_sql, AGENT_MODULE_STATUS_NO_DATA,$status_module_group_filter,$order['field'],
+ $tags_sql, $monitor_filter,$status_module_group_filter,$order['field'],
$order['order']);
break;
case "oracle":
@@ -650,7 +656,7 @@ if ($list_modules) {
AND tagente_estado.estado != %d
AND tagente_modulo.%s
ORDER BY tagente_modulo.id_module_group , %s %s
- ", $id_agente, $status_text_monitor_sql, $status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
+ ", $id_agente, $status_text_monitor_sql, $status_filter_sql, $tags_sql, $monitor_filter,
$status_module_group_filter,$order['field'], $order['order']);
break;
}
@@ -679,7 +685,7 @@ if ($list_modules) {
AND tagente_estado.estado != %d
AND tagente_modulo.%s
ORDER BY tmodule_group.name , %s %s",
- $id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
+ $id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
$status_module_group_filter, $order['field'], $order['order']);
break;
@@ -698,7 +704,7 @@ if ($list_modules) {
AND tagente_estado.estado != %d
AND tagente_modulo.%s
ORDER BY tmodule_group.name , %s %s",
- $id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, AGENT_MODULE_STATUS_NO_DATA,
+ $id_agente, $status_text_monitor_sql,$status_module_group_filter,$status_filter_sql, $tags_sql, $monitor_filter,
$status_module_group_filter, $order['field'], $order['order']);
break;
// If Dbms is Oracle then field_list in sql statement has to be recoded. See oracle_list_all_field_table()
@@ -721,7 +727,7 @@ if ($list_modules) {
AND tagente_estado.estado != %d
AND tagente_modulo.%s
ORDER BY tmodule_group.name , %s %s
- ", $id_agente, $status_text_monitor_sql, $tags_sql, $status_filter_sql, AGENT_MODULE_STATUS_NO_DATA,
+ ", $id_agente, $status_text_monitor_sql, $tags_sql, $status_filter_sql, $monitor_filter,
$status_module_group_filter, $order['field'], $order['order']);
break;
}
diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php
index 05e6f7fc4c..461c20298a 100755
--- a/pandora_console/include/ajax/visual_console_builder.ajax.php
+++ b/pandora_console/include/ajax/visual_console_builder.ajax.php
@@ -102,7 +102,7 @@ $parent = get_parameter('parent', null);
$map_linked = get_parameter('map_linked', null);
$map_linked_weight = get_parameter('map_linked_weight', null);
$element_group = get_parameter('element_group', null);
-$width_percentile = get_parameter('width_percentile', null);
+$width_percentile = get_parameter('width_percentile', 0);
$bars_graph_height = get_parameter('bars_graph_height', null);
$max_percentile = get_parameter('max_percentile', null);
$height_module_graph = get_parameter('height_module_graph', null);
@@ -145,6 +145,10 @@ $type_graph = get_parameter('type_graph', 'area');
$label_position = get_parameter('label_position', 'down');
$show_statistics = get_parameter('show_statistics', 0);
+$clock_animation = get_parameter('clock_animation', 'analogic_1');
+$time_format = get_parameter('time_format', 'time');
+$timezone = get_parameter('timezone', 'Europe/Madrid');
+
switch ($action) {
case 'get_font':
$return = array();
@@ -735,6 +739,23 @@ switch ($action) {
$values['width'] = $width;
}
+ break;
+ case 'clock':
+ if ($clock_animation !== null) {
+ $values['clock_animation'] = $clock_animation;
+ }
+ if ($time_format !== null) {
+ $values['time_format'] = $time_format;
+ }
+ if ($timezone !== null) {
+ $values['timezone'] = $timezone;
+ }
+ if ($width !== null) {
+ $values['width'] = $width_percentile;
+ }
+ if ($fill_color !== null) {
+ $values['fill_color'] = $fill_color;
+ }
break;
default:
if (enterprise_installed()) {
@@ -782,6 +803,13 @@ switch ($action) {
unset($values['width']);
unset($values['id_agent']);
break;
+ case 'clock':
+ unset($values['clock_animation']);
+ unset($values['time_format']);
+ unset($values['timezone']);
+ unset($values['fill_color']);
+ unset($values['width']);
+ break;
case 'box_item':
unset($values['border_width']);
unset($values['border_color']);
@@ -843,6 +871,7 @@ switch ($action) {
case 'simple_value':
case 'label':
case 'icon':
+ case 'clock':
case 'auto_sla_graph':
case 'donut_graph':
$elementFields = db_get_row_filter('tlayout_data',
@@ -945,6 +974,9 @@ switch ($action) {
$elementFields['width_module_graph'] = $elementFields['width'];
$elementFields['height_module_graph'] = $elementFields['height'];
break;
+ case 'clock':
+ $elementFields['width_percentile'] = $elementFields['width'];
+ break;
case 'bars_graph':
$elementFields['width_percentile'] = $elementFields['width'];
$elementFields['bars_graph_height'] = $elementFields['height'];
@@ -1120,6 +1152,14 @@ switch ($action) {
$values['border_color'] = $grid_color;
$values['id_agent'] = $id_agent_string;
break;
+ case 'clock':
+ $values['type'] = CLOCK;
+ $values['width'] = $width_percentile;
+ $values['clock_animation'] = $clock_animation;
+ $values['fill_color'] = $fill_color;
+ $values['time_format'] = $time_format;
+ $values['timezone'] = $timezone;
+ break;
case 'auto_sla_graph':
$values['type'] = AUTO_SLA_GRAPH;
$values['period'] = $event_max_time_row;
@@ -1183,7 +1223,7 @@ switch ($action) {
}
break;
}
-
+
$idData = db_process_sql_insert('tlayout_data', $values);
$return = array();
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 0c92c75b67..6d1ce48f62 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
-$build_version = 'PC180131';
+$build_version = 'PC180210';
$pandora_version = 'v7.0NG.718';
// Do not overwrite default timezone set if defined.
diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php
index cc89ce8a0a..cb0069cf10 100644
--- a/pandora_console/include/constants.php
+++ b/pandora_console/include/constants.php
@@ -201,6 +201,7 @@ define('CIRCULAR_PROGRESS_BAR', 15);
define('CIRCULAR_INTERIOR_PROGRESS_BAR', 16);
define('DONUT_GRAPH', 17);
define('BARS_GRAPH', 18);
+define('CLOCK', 19);
//Some styles
define('MIN_WIDTH', 300);
define('MIN_HEIGHT', 120);
@@ -315,12 +316,15 @@ define ('MODULE_PLUGIN', 4);
define ('MODULE_PREDICTION', 5);
define ('MODULE_WMI', 6);
define ('MODULE_WEB', 7);
-define ('MODULE_WUX', 8);
+define ('MODULE_WUX', 8);
/* Type of Modules of Prediction */
define ('MODULE_PREDICTION_SERVICE', 2);
define ('MODULE_PREDICTION_SYNTHETIC', 3);
define ('MODULE_PREDICTION_NETFLOW', 4);
+define ('MODULE_PREDICTION_CLUSTER', 5);
+define ('MODULE_PREDICTION_CLUSTER_AA', 6);
+define ('MODULE_PREDICTION_CLUSTER_AP', 7);
/* SNMP CONSTANTS */
define('SNMP_DIR_MIBS', "attachment/mibs");
diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php
index 5dceaa9387..2557ae3db2 100644
--- a/pandora_console/include/functions.php
+++ b/pandora_console/include/functions.php
@@ -1810,7 +1810,7 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup = false) {
}
if ($id_group != 0 || $onlyOneGroup === true) {
- $groups_list_acl = users_get_groups ($id_user, 'AR', false, true, null);
+ $groups_list_acl = users_get_groups ($id_user, $access, false, true, null);
}
else{
$groups_list_acl = get_users_acl($id_user);
@@ -2143,18 +2143,7 @@ function is_image_data ($data) {
* Looks for two or more carriage returns.
*/
function is_snapshot_data ($data) {
-
- // TODO IDEA: In the future, we can set a variable in setup
- // to define how many \n must have a snapshot to define it's
- // a snapshot. I think two or three is a good value anyway.
-
- $temp = array();
- $count = preg_match_all ("/\n/", $data, $temp);
-
- if ( ($count > 2) || (is_image_data($data)) )
- return 1;
- else
- return 0;
+ return is_image_data($data);
}
/**
@@ -2775,6 +2764,12 @@ function register_pass_change_try ($id_user, $success) {
$values['success'] = $success;
db_process_sql_insert('treset_pass_history', $values);
}
+
+function isJson($string) {
+ json_decode($string);
+ return (json_last_error() == JSON_ERROR_NONE);
+}
+
/**
* returns true or false if it is a valid ip
* checking ipv4 and ipv6 or resolves the name dns
diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php
index 577dfe82f1..6c1938e4d8 100644
--- a/pandora_console/include/functions_alerts.php
+++ b/pandora_console/include/functions_alerts.php
@@ -1746,11 +1746,22 @@ function get_group_alerts($id_group, $filter = '', $options = false,
$filter .= '';
break;
}
+
+ //WHEN SELECT ALL TAGS TO FILTER ALERTS
+
+ $modules_tags = count(db_process_sql('select * from ttag'));
+
+ $modules_user_tags = count(explode(",", $tag));
+
+ if($modules_tags != $modules_user_tags){
+ if ($tag) {
+ $filter .= ' AND (id_agent_module IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN ('.$tag.')))';
+ }
- if ($tag) {
- $filter .= ' AND (id_agent_module IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN ('.$tag.')))';
}
-
+
+ //WHEN SELECT ALL TAGS TO FILTER ALERTS
+
if($action_filter){
$filter .= ' AND (talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions where id_alert_action = '.$action_filter.'))';
}
diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php
index 71dd08e199..c817482f96 100644
--- a/pandora_console/include/functions_config.php
+++ b/pandora_console/include/functions_config.php
@@ -512,6 +512,11 @@ function config_update_config () {
$error_update[] = __('Custom title2 login');
if (!config_update_value ('login_background', (string) get_parameter ('login_background')))
$error_update[] = __('Login background');
+
+ if (!config_update_value ('custom_docs_url', (string) get_parameter ('custom_docs_url')))
+ $error_update[] = __('Custom Docs url');
+ if (!config_update_value ('custom_support_url', (string) get_parameter ('custom_support_url')))
+ $error_update[] = __('Custom support url');
if (!config_update_value ('meta_custom_logo', (string) get_parameter ('meta_custom_logo')))
$error_update[] = __('Custom logo metaconsole');
@@ -525,6 +530,11 @@ function config_update_config () {
$error_update[] = __('Custom title2 login metaconsole');
if (!config_update_value ('meta_login_background', (string) get_parameter ('meta_login_background')))
$error_update[] = __('Login background metaconsole');
+
+ if (!config_update_value ('meta_custom_docs_url', (string) get_parameter ('meta_custom_docs_url')))
+ $error_update[] = __('Custom Docs url');
+ if (!config_update_value ('meta_custom_support_url', (string) get_parameter ('meta_custom_support_url')))
+ $error_update[] = __('Custom support url');
if (!config_update_value ('vc_refr', get_parameter('vc_refr')))
$error_update[] = __('Default interval for refresh on Visual Console');
@@ -1185,6 +1195,22 @@ function config_process_config () {
if (!isset ($config["custom_title2_login"])) {
config_update_value ('custom_title2_login', __('NEXT GENERATION'));
}
+
+ if (!isset ($config["custom_docs_url"])) {
+ config_update_value ('custom_docs_url', 'http://wiki.pandorafms.com/');
+ }
+
+ if (!isset ($config["custom_support_url"])) {
+ config_update_value ('custom_support_url', 'https://support.artica.es');
+ }
+
+ if (!isset ($config["meta_custom_docs_url"])) {
+ config_update_value ('meta_custom_docs_url', 'http://wiki.pandorafms.com/index.php?title=Main_Page');
+ }
+
+ if (!isset ($config["meta_custom_support_url"])) {
+ config_update_value ('meta_custom_support_url', 'https://support.artica.es');
+ }
if (!isset ($config["meta_custom_logo"])) {
config_update_value ('meta_custom_logo', 'logo_pandora_metaconsola.png');
diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index 14353cc48b..31cfde5fa7 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -2283,7 +2283,7 @@ function events_page_details ($event, $server = "") {
$data = array();
$data[0] = __('Instructions');
- $data[1] = events_display_instructions ($event['event_type'], $events, true);
+ $data[1] = events_display_instructions ($event['event_type'], $event, true);
$table_details->data[] = $data;
$data = array();
diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php
index 4156dca4ed..3eac34d8b1 100644
--- a/pandora_console/include/functions_graph.php
+++ b/pandora_console/include/functions_graph.php
@@ -2046,23 +2046,47 @@ function graphic_combined_module ($module_list, $weight_list, $period,
}
foreach ($module_list as $key => $value) {
- $agent_name = io_safe_output( modules_get_agentmodule_agent_name ($value) );
- $alias = db_get_value ("alias","tagente","nombre",$agent_name);
- $module_name = io_safe_output( modules_get_agentmodule_name ($value) );
-
- if ($flash_charts){
- $module_name_list[$key] = '' . $alias . " / " . $module_name. ' ';
+ if (is_metaconsole()) {
+ $server = metaconsole_get_connection_by_id ($value['server']);
+ metaconsole_connect($server);
+ $value = $value['module'];
}
- else{
- $module_name_list[$key] = $alias . " / " . $module_name;
+ if ($labels[$value] != ''){
+ $module_name_list[$key] = $labels[$value];
+ }
+ else {
+ $agent_name = io_safe_output( modules_get_agentmodule_agent_name ($value) );
+ $alias = db_get_value ("alias","tagente","nombre",$agent_name);
+ $module_name = io_safe_output( modules_get_agentmodule_name ($value) );
+
+ if ($flash_charts){
+ $module_name_list[$key] = '' . $alias . " / " . $module_name. ' ';
+ }
+ else{
+ $module_name_list[$key] = $alias . " / " . $module_name;
+ }
+ }
+ if (is_metaconsole()) {
+ metaconsole_restore_db();
}
}
if (!is_null($percentil) && $percentil) {
foreach ($module_list as $key => $value) {
+ if (is_metaconsole()) {
+ $server = metaconsole_get_connection_by_id ($value['server']);
+ metaconsole_connect($server);
+ $value = $value['module'];
+ }
+
$agent_name = io_safe_output( modules_get_agentmodule_agent_name ($value) );
$alias = db_get_value ("alias","tagente","nombre",$agent_name);
$module_name = io_safe_output( modules_get_agentmodule_name ($value) );
+
+ if (is_metaconsole()) {
+ metaconsole_restore_db();
+ }
+
$module_name_list['percentil'.$key] = __('Percentile %dº', $config['percentil']) . __(' of module ') . $agent_name .' / ' . $module_name . ' (' . $percentil_result[$key][0] . ' ' . $unit . ') ';
$series_type[$key] = 'line';
}
@@ -2465,42 +2489,46 @@ function fullscale_data_combined($module_list, $period, $date, $flash_charts, $p
foreach ($module_list as $key_module => $value_module) {
if (!is_null($percentil) && $percentil) {
- $array_percentil = array();
+ $array_percentil = array();
}
- $previous_data = modules_get_previous_data ($value_module, $datelimit);
- $data_uncompress = db_uncompress_module_data($value_module, $datelimit, $date);
+ if (is_metaconsole()) {
+ $server = metaconsole_get_connection_by_id ($value_module['server']);
+ metaconsole_connect($server);
+ $previous_data = modules_get_previous_data ($value_module['module'], $datelimit);
+ $data_uncompress = db_uncompress_module_data($value_module['module'], $datelimit, $date);
+ metaconsole_restore_db();
+ }
+ else{
+ $previous_data = modules_get_previous_data ($value_module, $datelimit);
+ $data_uncompress = db_uncompress_module_data($value_module, $datelimit, $date);
+ }
foreach ($data_uncompress as $key_data => $value_data) {
foreach ($value_data['data'] as $k => $v) {
- if($flash_charts) {
- $real_date = date("Y M d H:i:s", $v['utimestamp']);
- }
- else{
- $real_date = $v['utimestamp'];
- }
-
+ $real_date = $v['utimestamp'];
+
if(!isset($v['datos'])){
- $v['datos'] = $previous_data;
+ $v['datos'] = $previous_data;
}
else{
- $previous_data = $v['datos'];
+ $previous_data = $v['datos'];
}
if (!is_null($percentil) && $percentil) {
- $array_percentil[] = $v['datos'];
+ $array_percentil[] = $v['datos'];
}
-
+
$data_all[$real_date][$key_module] = $v['datos'];
}
}
if (!is_null($percentil) && $percentil) {
- $percentil_value = get_percentile($config['percentil'], $array_percentil);
- $percentil_result[$key_module] = array_fill (0, count($data_all), $percentil_value);
- if(count($data_all) > $count_data_all){
- $count_data_all = count($data_all);
- }
+ $percentil_value = get_percentile($config['percentil'], $array_percentil);
+ $percentil_result[$key_module] = array_fill (0, count($data_all), $percentil_value);
+ if(count($data_all) > $count_data_all){
+ $count_data_all = count($data_all);
+ }
}
}
@@ -2512,25 +2540,34 @@ function fullscale_data_combined($module_list, $period, $date, $flash_charts, $p
}
}
- $data_prev = array();
-
+ $data_prev = array();
+ $data_all_rev = array();
ksort($data_all);
+
foreach ($data_all as $key => $value) {
- foreach ($module_list as $key_module => $value_module) {
- if(!isset($value[$key_module])){
- $data_all[$key][$key_module] = $data_prev[$key_module];
- }
- else{
- $data_prev[$key_module] = $value[$key_module];
- }
+ if($flash_charts) {
+ $real_date = date("Y M d H:i:s", $key);
}
+ else{
+ $real_date = $key;
+ }
+
+ foreach ($module_list as $key_module => $value_module) {
+ if(!isset($value[$key_module])){
+ $data_all[$key][$key_module] = $data_prev[$key_module];
+ }
+ else{
+ $data_prev[$key_module] = $value[$key_module];
+ }
+ }
+ $data_all_rev[$real_date] = $data_all[$key];
}
if (!is_null($percentil) && $percentil) {
- $data_all['percentil'] = $percentil_result;
+ $data_all_rev['percentil'] = $percentil_result;
}
- return $data_all;
+ return $data_all_rev;
}
/**
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index 0822169265..b940072a6a 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -1649,6 +1649,11 @@ function modules_is_unit_macro($macro) {
return false;
}
+function modules_get_last_contact ($id_agentmodule) {
+ return db_get_value ('utimestamp', 'tagente_estado',
+ 'id_agente_modulo', $id_agentmodule);
+}
+
/**
* Get the current value of an agent module.
*
diff --git a/pandora_console/include/functions_os.php b/pandora_console/include/functions_os.php
index 8862b87db7..f9f7e407ec 100755
--- a/pandora_console/include/functions_os.php
+++ b/pandora_console/include/functions_os.php
@@ -74,4 +74,8 @@ function os_get_os() {
return $op_systems;
}
+
+function os_get_icon($id_os) {
+ return db_get_value ('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
+}
?>
diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php
index 622814ef7f..20238c8b23 100644
--- a/pandora_console/include/functions_tags.php
+++ b/pandora_console/include/functions_tags.php
@@ -1432,8 +1432,12 @@ function tags_checks_event_acl($id_user, $id_group, $access, $tags = array(), $c
AND id_perfil IN (
SELECT id_perfil
FROM tperfil
- WHERE ".get_acl_column($access)." = 1)
- AND id_grupo = ".$id_group;
+ WHERE ".get_acl_column($access)." = 1)";
+
+ if(isset($id_group)){
+ $sql .= "AND id_grupo = ".$id_group;
+ }
+
$user_has_perm_without_tags = db_get_all_rows_sql ($sql);
if ($user_has_perm_without_tags) {
diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php
index 1909a88e46..2bea03cd42 100755
--- a/pandora_console/include/functions_users.php
+++ b/pandora_console/include/functions_users.php
@@ -140,6 +140,9 @@ function users_get_groups_for_select($id_user, $privilege = "AR", $returnAllGro
}
function get_group_ancestors($group_id, $groups) {
+ if($group_id == 0) {
+ return 0;
+ }
if (!isset($groups[$group_id])) {
return null;
@@ -151,17 +154,13 @@ function get_group_ancestors($group_id, $groups) {
return $group_id;
}
- if ($parent == 0) {
- return 0;
- }
-
$r = get_group_ancestors($parent, $groups);
if (is_array($r)) {
- $r = array_merge(array($parent), $r);
+ $r = array_merge(array($group_id), $r);
}
else {
- $r = array($parent, $r);
+ $r = array($group_id, $r);
}
return $r;
@@ -300,8 +299,7 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
}
foreach ($groups as $group) {
- $parents = get_group_ancestors($group["id_grupo"],$groups);
-
+ $parents = get_group_ancestors($group["parent"],$groups);
if (is_array($parents)) {
foreach ($parents as $parent) {
if ( (isset($forest_acl[$parent])) && ($groups[$parent]["propagate"] == 1)) {
@@ -325,7 +323,6 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup
}
}
}
-
// Update the group cache.
$group_cache[$id_user] = $forest_acl;
}
@@ -403,13 +400,13 @@ function old_users_get_groups ($id_user = false, $privilege = "AR", $returnAllGr
// Admin.
if (is_user_admin($id_user)) {
$groups = db_get_all_rows_sql ("SELECT * FROM tgrupo ORDER BY nombre");
- }
+ }
// Per-group permissions.
else {
$query = sprintf("SELECT tgrupo.*, tperfil.*, tusuario_perfil.tags FROM tgrupo, tusuario_perfil, tperfil
WHERE (tgrupo.id_grupo = tusuario_perfil.id_grupo OR tusuario_perfil.id_grupo = 0)
AND tusuario_perfil.id_perfil = tperfil.id_perfil
- AND tusuario_perfil.id_usuario = '%s' ORDER BY nombre", $id_user);
+ AND tusuario_perfil.id_usuario = '%s' ORDER BY tgrupo.nombre", $id_user);
$groups = db_get_all_rows_sql ($query);
// Get children groups.
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index 1efe60b615..fbb0327986 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -112,6 +112,9 @@ function visual_map_print_item($mode = "read", $layoutData,
$fill_color = $layoutData['fill_color'];
$label_position = $layoutData['label_position'];
$show_on_top = $layoutData['show_on_top'];
+ $clock_animation = $layoutData['clock_animation'];
+ $time_format = $layoutData['time_format'];
+ $timezone = $layoutData['timezone'];
if($show_on_top){
$show_on_top_index = 10;
@@ -154,6 +157,35 @@ function visual_map_print_item($mode = "read", $layoutData,
else {
$tableheight0 = $height;
}
+
+ if ($layoutData['width'] == 0){
+ switch($type) {
+ case 19:
+ if($layoutData['clock_animation'] == 'analogic_1'){
+ $himg = '200';
+ $wimg ='200';
+ }
+ else{
+ $himg = '60';
+ $wimg ='200';
+ }
+ break;
+ }
+ }
+ else{
+ switch($type) {
+ case 19:
+ if($layoutData['clock_animation'] == 'analogic_1'){
+ $himg = $width;
+ $wimg = $width;
+ }
+ else{
+ $himg = $width/3.9;
+ $wimg = $width;
+ }
+ break;
+ }
+ }
if ($layoutData['width'] == 0 || $layoutData['height'] == 0) {
switch($type) {
@@ -1426,6 +1458,125 @@ function visual_map_print_item($mode = "read", $layoutData,
case BOX_ITEM:
$z_index = 1;
break;
+ case CLOCK:
+ if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
+ if($width == 0){
+ if ($layoutData['id_metaconsole'] != 0) {
+ if($layoutData['clock_animation'] == 'analogic_1'){
+ $img = ' ';
+ }
+ else{
+
+ if($layoutData['time_format'] = 'time'){
+ $img = ' ';
+ }
+ else{
+ $img = ' ';
+ }
+ }
+ }
+ else{
+ if($layoutData['clock_animation'] == 'analogic_1'){
+ $img = ' ';
+ }
+ else{
+
+ if($layoutData['time_format'] == 'time'){
+ $img = ' ';
+ }
+ else{
+ $img = ' ';
+ }
+ }
+ }
+ }
+ else{
+ if ($layoutData['id_metaconsole'] != 0) {
+
+ if($layoutData['clock_animation'] == 'analogic_1'){
+ $img = ' ';
+ }
+ else{
+
+ if($layoutData['time_format'] == 'time'){
+ $img = ' ';
+ }
+ else{
+ $img = ' ';
+ }
+
+ }
+
+ }
+ else{
+ if($layoutData['clock_animation'] == 'analogic_1'){
+ $img = ' ';
+ }
+ else{
+ if($layoutData['time_format'] == 'time'){
+ $img = ' ';
+ }
+ else{
+ $img = ' ';
+ }
+ }
+ }
+ }
+ }
+ else{
+ if($layoutData['clock_animation'] == 'analogic_1'){
+
+ if ($width == 0) {
+ if ($layoutData['label_position']=='left') {
+ $img = '' .print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ elseif ($layoutData['label_position']=='right') {
+ $img = '' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ else {
+ $img = '' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ }
+ else{
+ if ($layoutData['label_position']=='left') {
+ $img = '' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ elseif ($layoutData['label_position']=='right') {
+ $img = '' .print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ else {
+ $img ='' . print_clock_analogic_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ }
+
+ }
+ elseif($layoutData['clock_animation'] == 'digital_1'){
+
+ if ($width == 0) {
+ if ($layoutData['label_position']=='left') {
+ $img = '' .print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ elseif ($layoutData['label_position']=='right') {
+ $img = '' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ else {
+ $img = '' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ }
+ else{
+ if ($layoutData['label_position']=='left') {
+ $img = '' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ elseif ($layoutData['label_position']=='right') {
+ $img = '' .print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ else {
+ $img ='' . print_clock_digital_1 ($layoutData['time_format'], $layoutData['timezone'],$layoutData['clock_animation'],$layoutData['width'],$layoutData['height'],$layoutData['id'],$layoutData['fill_color']).'
';
+ }
+ }
+ }
+ }
+ break;
case AUTO_SLA_GRAPH:
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
if($width == 0 || $height == 0){
@@ -1517,6 +1668,9 @@ function visual_map_print_item($mode = "read", $layoutData,
case ICON:
$class .= "icon";
break;
+ case CLOCK:
+ $class .= "clock";
+ break;
case BOX_ITEM:
$class .= "box_item";
break;
@@ -1585,6 +1739,68 @@ function visual_map_print_item($mode = "read", $layoutData,
case STATIC_GRAPH:
case GROUP_ITEM:
+
+ if (! defined ('METACONSOLE')) {
+ }
+ else {
+ // For each server defined and not disabled:
+ $servers = db_get_all_rows_sql ('SELECT *
+ FROM tmetaconsole_setup
+ WHERE disabled = 0');
+ if ($servers === false)
+ $servers = array();
+
+ $result = array();
+ $count_modules = 0;
+ foreach ($servers as $server) {
+ // If connection was good then retrieve all data server
+ if (metaconsole_connect($server) == NOERR)
+ $connection = true;
+ else
+ $connection = false;
+
+ $result_server = db_get_all_rows_sql ($sql);
+
+ if (!empty($result_server)) {
+
+ // Create HASH login info
+ $pwd = $server['auth_token'];
+ $auth_serialized = json_decode($pwd,true);
+
+ if (is_array($auth_serialized)) {
+ $pwd = $auth_serialized['auth_token'];
+ $api_password = $auth_serialized['api_password'];
+ $console_user = $auth_serialized['console_user'];
+ $console_password = $auth_serialized['console_password'];
+ }
+
+ $user = $config['id_user'];
+ $user_rot13 = str_rot13($config['id_user']);
+ $hashdata = $user.$pwd;
+ $hashdata = md5($hashdata);
+ $url_hash = '&' .
+ 'loginhash=auto&' .
+ 'loginhash_data=' . $hashdata . '&' .
+ 'loginhash_user=' . $user_rot13;
+
+ foreach ($result_server as $result_element_key => $result_element_value) {
+
+ $result_server[$result_element_key]['server_id'] = $server['id'];
+ $result_server[$result_element_key]['server_name'] = $server['server_name'];
+ $result_server[$result_element_key]['server_url'] = $server['server_url'].'/';
+ $result_server[$result_element_key]['hashdata'] = $hashdata;
+ $result_server[$result_element_key]['user'] = $config['id_user'];
+
+ $count_modules++;
+
+ }
+
+ $result = array_merge($result, $result_server);
+ }
+
+ }
+ }
+
if (($layoutData['image'] != null && $layoutData['image'] != 'none') || $layoutData['show_statistics'] == 1) {
@@ -1608,7 +1824,7 @@ function visual_map_print_item($mode = "read", $layoutData,
if (!modules_is_boolean($layoutData['id_agente_modulo'])) {
$img_style_title .=
" " . __("Last value: ")
- . remove_right_zeros(number_format($value, $config['graph_precision']));
+ . remove_right_zeros(number_format($value, $config['graph_precision'])).$unit_text;
}
}
@@ -1781,6 +1997,13 @@ function visual_map_print_item($mode = "read", $layoutData,
echo io_safe_output($text);
}
+ if (! defined ('METACONSOLE')) {
+ }
+ else {
+ metaconsole_restore_db();
+ }
+
+
break;
case PERCENTILE_BAR:
@@ -1958,6 +2181,19 @@ function visual_map_print_item($mode = "read", $layoutData,
echo $img;
+ if ($layoutData['label_position']=='down') {
+ echo io_safe_output($text);
+ }
+ elseif($layoutData['label_position']=='left' || $layoutData['label_position']=='right') {
+ echo io_safe_output($text);
+ }
+ break;
+ case CLOCK:
+ if ($layoutData['label_position']=='up') {
+ echo io_safe_output($text);
+ }
+ echo $img;
+
if ($layoutData['label_position']=='down') {
echo io_safe_output($text);
}
@@ -3390,18 +3626,24 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
if ($returnAllGroup) {
$groups = users_get_groups ($id_user, 'VR', true, true);
} else {
- if(!empty($filter['group'])) {
- $permissions_group = users_get_groups ($id_user, 'VR', false, true);
- if(empty($permissions_group)){
- $permissions_group = users_get_groups ($id_user, 'VM', false, true);
- }
- $groups = array_intersect_key($filter['group'], $permissions_group);
- } else {
- $groups = users_get_groups ($id_user, 'VR', false, true);
- if(empty($groups)) {
- $groups = users_get_groups ($id_user, 'VM', false, true);
+ if(users_is_admin($id_user)){
+ $groups = users_get_groups ($id_user, 'VR', true, true);
+ }
+ else{
+ if(!empty($filter['group'])) {
+ $permissions_group = users_get_groups ($id_user, 'VR', false, true);
+ if(empty($permissions_group)){
+ $permissions_group = users_get_groups ($id_user, 'VM', false, true);
+ }
+ $groups = array_intersect_key($filter['group'], $permissions_group);
+ } else {
+ $groups = users_get_groups ($id_user, 'VR', false, true);
+ if(empty($groups)) {
+ $groups = users_get_groups ($id_user, 'VM', false, true);
+ }
}
}
+
unset($filter['group']);
}
@@ -3422,7 +3664,6 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
}
$layouts = db_get_all_rows_filter ('tlayout', $where);
-
if ($layouts == false)
return array ();
@@ -3662,6 +3903,10 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
case MODULE_GRAPH:
$text = __('Module graph');
break;
+ case 'clock':
+ case CLOCK:
+ $text = __('Clock');
+ break;
case 'bars_graph':
case BARS_GRAPH:
$text = __('Bars graph');
@@ -3810,6 +4055,9 @@ function visual_map_type_in_js($type) {
case ICON:
return 'icon';
break;
+ case CLOCK:
+ return 'clock';
+ break;
case SIMPLE_VALUE_MAX:
return 'simple_value';
break;
diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php
index c19dad87df..c9e8074dc1 100755
--- a/pandora_console/include/functions_visual_map_editor.php
+++ b/pandora_console/include/functions_visual_map_editor.php
@@ -59,6 +59,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
a text to replace '(_VALUE_)' and the value of the module will be printed at the end."), true),
'label' => __('Label'),
'icon' => __('Icon'),
+ 'clock' => __('Clock'),
'group_item' => __('Group'),
'box_item' => __('Box'),
'line_item' => __('Line'));
@@ -136,11 +137,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['fill_color_row'] = array();
- $form_items['fill_color_row']['items'] = array('datos', 'box_item');
+ $form_items['fill_color_row']['items'] = array('datos', 'box_item','clock');
$form_items['fill_color_row']['html'] =
'' . __('Fill color') . ' ' .
'' .
- html_print_input_text_extended ('fill_color', '#ffffff',
+ html_print_input_text_extended ('fill_color', '#000000',
'text-fill_color', '', 7, 7, false, '',
'class="fill_color"', true) .
' ';
@@ -162,7 +163,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
'datos',
'group_item',
'auto_sla_graph',
- 'bars_graph');
+ 'bars_graph',
+ 'clock');
$form_items['label_row']['html'] =
'' . __('Label') . '
@@ -203,6 +205,45 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
' .
html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', 'none', true) .
' ';
+
+ $form_items['clock_animation_row'] = array();
+ $form_items['clock_animation_row']['items'] = array('clock');
+ $form_items['clock_animation_row']['html'] = '' .
+ __('Clock animation') . '
+ '. html_print_select (
+ array ('analogic_1' => __('Simple analogic'),
+ 'digital_1' => __('Simple digital')),
+ 'clock_animation', '', '', 0, 'analogic_1', true, false, false) . ' ';
+
+ $form_items['timeformat_row'] = array();
+ $form_items['timeformat_row']['items'] = array('clock');
+ $form_items['timeformat_row']['html'] = '' .
+ __('Time format') . '
+ '. html_print_select (
+ array ('time' => __('Only time'),
+ 'timedate' => __('Time and date')),
+ 'time_format', '', '', 0, 'time', true, false, false) . ' ';
+
+ $zone_name = array('Africa' => __('Africa'), 'America' => __('America'), 'Antarctica' => __('Antarctica'), 'Arctic' => __('Arctic'), 'Asia' => __('Asia'), 'Atlantic' => __('Atlantic'), 'Australia' => __('Australia'), 'Europe' => __('Europe'), 'Indian' => __('Indian'), 'Pacific' => __('Pacific'), 'UTC' => __('UTC'));
+ $zone_selected = 'Europe';
+
+ $timezones = timezone_identifiers_list();
+ foreach ($timezones as $timezone) {
+ if (strpos($timezone, $zone_selected) !== false) {
+ $timezone_n[$timezone] = $timezone;
+ }
+ }
+
+
+ $form_items['timezone_row'] = array();
+ $form_items['timezone_row']['items'] = array('clock');
+ $form_items['timezone_row']['html'] = '' .
+ __('Time zone') . '
+ '.
+ html_print_select($zone_name, 'zone', $zone_selected, 'show_timezone();', '', '', true).
+ " ". html_print_select($timezone_n, 'timezone','', '', '', '', true).
+ ' ';
+
$form_items['enable_link_row'] = array();
@@ -454,7 +495,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items['percentile_bar_row_1'] = array();
- $form_items['percentile_bar_row_1']['items'] = array('percentile_bar', 'percentile_item', 'datos', 'donut_graph', 'bars_graph');
+ $form_items['percentile_bar_row_1']['items'] = array('percentile_bar', 'percentile_item', 'datos', 'donut_graph', 'bars_graph','clock');
$form_items['percentile_bar_row_1']['html'] = '' .
__('Width') . '
' . html_print_input_text('width_percentile', 0, '', 3, 5, true) . ' ';
@@ -613,7 +654,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items_advance['position_row']['items'] = array('static_graph',
'percentile_bar', 'percentile_item', 'module_graph',
'simple_value', 'label', 'icon', 'datos', 'box_item',
- 'auto_sla_graph', 'bars_graph');
+ 'auto_sla_graph', 'bars_graph','clock');
$form_items_advance['position_row']['html'] = '
' . __('Position') . '
(' . html_print_input_text('left', '0', '', 3, 5, true) .
@@ -788,6 +829,25 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
});
+
+ function show_timezone () {
+ zone = $("#zone").val();
+
+ $.ajax({
+ type: "POST",
+ url: "ajax.php",
+ data: "page=godmode/setup/setup&select_timezone=1&zone=" + zone,
+ dataType: "json",
+ success: function(data) {
+ $("#timezone").empty();
+ jQuery.each (data, function (id, value) {
+ timezone = value;
+ var timezone_country = timezone.replace (/^.*\//g, "");
+ $("select[name='timezone']").append($("").val(timezone).html(timezone_country));
+ });
+ }
+ });
+ }
+ body {
+ background: #fff;
+ }
+
+ svg{
+ stroke: #000;
+ font-family: \"HelveticaNeue-Light\", \"Helvetica Neue Light\", \"Helvetica Neue\", Helvetica, Arial, \"Lucida Grande\", sans-serif;
+ }
+
+ #rim {
+ fill: none;
+ stroke: #999;
+ stroke-width: 3px;
+ }
+
+ .second-hand{
+ stroke-width:3;
+
+ }
+
+ .minute-hand{
+ stroke-width:8;
+ stroke-linecap:round;
+ }
+
+ .hour-hand{
+ stroke-width:12;
+ stroke-linecap:round;
+ }
+
+ .hands-cover{
+ stroke-width:3;
+ fill:#fff;
+ }
+
+ .second-tick{
+ stroke-width:3;
+ fill:#000;
+ }
+
+ .hour-tick{
+ stroke-width:8; //same as the miute hand
+ }
+
+ .second-label{
+ font-size: 12px;
+ }
+
+ .hour-label{
+ font-size: 24px;
+ }
+ }
+ ";
+
+ $tz = $timezone;
+ $timestamp = time();
+ $dt = new DateTime("now", new DateTimeZone($tz)); //first argument "must" be a string
+ $dt->setTimestamp($timestamp); //adjust the object to correct timestamp
+
+ $dateTimeZoneOption = new DateTimeZone(date_default_timezone_get());
+ $dateTimeZonePandora = new DateTimeZone($timezone);
+
+ $dateTimeOption = new DateTime("now", $dateTimeZoneOption);
+ $dateTimePandora = new DateTime("now", $dateTimeZonePandora);
+
+ $timeOffset = $dateTimeZonePandora->getOffset($dateTimeOption);
+
+ $output .= include_javascript_d3(true);
+
+ if($width == 0){
+ $date_width = 200;
+ }
+ else{
+ $date_width = $width;
+ }
+
+ $output .= '';
+
+ if($time_format == 'timedate'){
+ $output .= $dt->format('d / m / Y').' - ';
+
+ }
+
+ $output .= $dt->format('a').'
';
+
+
+
+ $output .= "";
+
+ $timezone_short = explode("/", $timezone);
+ $timezone_short_end = end($timezone_short);
+
+ $output .= ''.$timezone_short_end.'
';
+
+ return $output;
+
+
+}
+
+function print_clock_digital_1 ($time_format, $timezone, $clock_animation,$width,$height,$id_element,$color) {
+ global $config;
+ $output .= "";
+
+ $output .= include_javascript_d3(true);
+ $tz = $timezone;
+ $timestamp = time();
+ $dt = new DateTime("now", new DateTimeZone($tz)); //first argument "must" be a string
+ $dt->setTimestamp($timestamp); //adjust the object to correct timestamp
+
+ $dateTimeZoneOption = new DateTimeZone(date_default_timezone_get());
+ $dateTimeZonePandora = new DateTimeZone($timezone);
+
+ $dateTimeOption = new DateTime("now", $dateTimeZoneOption);
+ $dateTimePandora = new DateTime("now", $dateTimeZonePandora);
+
+ $timeOffset = $dateTimeZonePandora->getOffset($dateTimeOption);
+
+ $output .= include_javascript_d3(true);
+
+ if($width == 0){
+ $date_width = 200;
+ }
+ else{
+ $date_width = $width;
+ }
+
+ if($time_format == 'timedate'){
+ $output .= '';
+ $output .= $dt->format('d / m / Y').'
';
+ }
+
+ $output .=
+
+ '
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ';
+
+
+
+ $output .= "";
+
+ $timezone_short = explode("/", $timezone);
+ $timezone_short_end = end($timezone_short);
+
+ $output .= ''.$timezone_short_end.'
';
+
+ return $output;
+
+}
+
?>
diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js
index b315fae318..98d4a54557 100644
--- a/pandora_console/include/graphs/pandora.d3.js
+++ b/pandora_console/include/graphs/pandora.d3.js
@@ -2089,4 +2089,254 @@ function print_donut_graph (recipient, width, height, module_data, resume_color)
slice.exit().remove();
}
+}
+
+function printClockAnalogic1 (time_format, timezone, clock_animation,width,height,id_element,color) {
+
+ if(width != 0){
+ width = width-20;
+ height = width-20;
+ }
+
+
+ if(width == 0){
+ width = 180;
+ height = 180;
+ }
+
+var radians = 0.0174532925,
+ clockRadius = width/2,
+ margin = 10,
+ width = (clockRadius+margin)*2,
+ height = (clockRadius+margin)*2,
+ hourHandLength = 2*clockRadius/3,
+ minuteHandLength = clockRadius,
+ secondHandLength = clockRadius-12,
+ secondHandBalance = 30,
+ secondTickStart = clockRadius;
+ secondTickLength = -10,
+ hourTickStart = clockRadius,
+ hourTickLength = -18,
+ secondLabelRadius = clockRadius + 16,
+ secondLabelYOffset = 5,
+ hourLabelRadius = clockRadius - 40,
+ hourLabelYOffset = 7;
+
+var hourScale = d3.scale.linear()
+ .range([0,330])
+ .domain([0,11]);
+
+var minuteScale = secondScale = d3.scale.linear()
+ .range([0,354])
+ .domain([0,59]);
+
+var handData = [
+ {
+ type:'hour',
+ value:0,
+ length:-hourHandLength,
+ scale:hourScale
+ },
+ {
+ type:'minute',
+ value:0,
+ length:-minuteHandLength,
+ scale:minuteScale
+ },
+ {
+ type:'second',
+ value:0,
+ length:-secondHandLength,
+ scale:secondScale,
+ balance:secondHandBalance
+ }
+];
+
+function drawClock(){ //create all the clock elements
+ updateData(timezone); //draw them in the correct starting position
+ var svg = d3.select("#clock_"+id_element).append("svg")
+ .attr("width", width)
+ .attr("height", height);
+
+ var face = svg.append('g')
+ .attr('id','clock-face')
+ .attr('transform','translate(' + (clockRadius + margin) + ',' + (clockRadius + margin) + ')');
+
+ //add marks for seconds
+ face.selectAll('.second-tick')
+ .data(d3.range(0,60)).enter()
+ .append('line')
+ .attr('class', 'second-tick')
+ .attr('x1',0)
+ .attr('x2',0)
+ .attr('y1',secondTickStart)
+ .attr('y2',secondTickStart + secondTickLength)
+ .attr('stroke',color)
+ .attr('transform',function(d){
+ return 'rotate(' + secondScale(d) + ')';
+ });
+ //and labels
+
+ // face.selectAll('.second-label')
+ // .data(d3.range(5,61,5))
+ // .enter()
+ // .append('text')
+ // .attr('class', 'second-label')
+ // .attr('text-anchor','middle')
+ // .attr('x',function(d){
+ // return secondLabelRadius*Math.sin(secondScale(d)*radians);
+ // })
+ // .attr('y',function(d){
+ // return -secondLabelRadius*Math.cos(secondScale(d)*radians) + secondLabelYOffset;
+ // })
+ // .text(function(d){
+ // return d;
+ // });
+
+ //... and hours
+ face.selectAll('.hour-tick')
+ .data(d3.range(0,12)).enter()
+ .append('line')
+ .attr('class', 'hour-tick')
+ .attr('x1',0)
+ .attr('x2',0)
+ .attr('y1',hourTickStart)
+ .attr('y2',hourTickStart + hourTickLength)
+ .attr('stroke',color)
+ .attr('transform',function(d){
+ return 'rotate(' + hourScale(d) + ')';
+ });
+
+ face.selectAll('.hour-label')
+ .data(d3.range(3,13,3))
+ .enter()
+ .append('text')
+ .attr('class', 'hour-label')
+ .attr('text-anchor','middle')
+ .attr('stroke',color)
+ .attr('x',function(d){
+ return hourLabelRadius*Math.sin(hourScale(d)*radians);
+ })
+ .attr('y',function(d){
+ return -hourLabelRadius*Math.cos(hourScale(d)*radians) + hourLabelYOffset;
+ })
+ .text(function(d){
+ return d;
+ });
+
+
+ var hands = face.append('g').attr('id','clock-hands');
+
+ face.append('g').attr('id','face-overlay')
+ .append('circle').attr('class','hands-cover')
+ .attr('stroke',color)
+ .attr('x',0)
+ .attr('y',0)
+ .attr('r',clockRadius/20);
+
+ hands.selectAll('line')
+ .data(handData)
+ .enter()
+ .append('line')
+ .attr('stroke',color)
+ .attr('class', function(d){
+ return d.type + '-hand';
+ })
+ .attr('x1',0)
+ .attr('y1',function(d){
+ return d.balance ? d.balance : 0;
+ })
+ .attr('x2',0)
+ .attr('y2',function(d){
+ return d.length;
+ })
+ .attr('transform',function(d){
+ return 'rotate('+ d.scale(d.value) +')';
+ });
+}
+
+function moveHands(){
+ d3.select("#clock_"+id_element+' #clock-hands').selectAll('line')
+ .data(handData)
+ .transition()
+ .attr('transform',function(d){
+ return 'rotate('+ d.scale(d.value) +')';
+ });
+}
+
+function updateData(tz){
+
+ var d = new Date();
+ var dt = d.getTime();
+ os = d.getTimezoneOffset();
+ tz = parseInt(tz) + parseInt(os * 60);
+ var t = new Date((dt + (tz * 1000)));
+
+ handData[0].value = (t.getHours() % 12) + t.getMinutes()/60 ;
+ handData[1].value = t.getMinutes();
+ handData[2].value = t.getSeconds();
+}
+
+drawClock();
+
+setInterval(function(){
+ updateData(timezone);
+ moveHands();
+}, 1000);
+
+d3.select(self.frameElement).style("height", height + "px");
+
+$('#clock_'+id_element).css('margin-top','0');
+
+}
+
+function printClockDigital1 (time_format, timezone, clock_animation,width,height,id_element,color) {
+
+var svgUnderlay = d3.select("#clock_"+id_element+" svg"),
+ svgOverlay = d3.select("#clock_"+id_element),
+ svg = d3.selectAll("#clock_"+id_element+" svg");
+
+svgUnderlay.attr("id", "underlay_"+id_element);
+svgOverlay.attr("id", "overlay_"+id_element);
+
+var digit = svg.selectAll(".digit"),
+ separator = svg.selectAll(".separator circle");
+
+var digitPattern = [
+ [1,0,1,1,0,1,1,1,1,1],
+ [1,0,0,0,1,1,1,0,1,1],
+ [1,1,1,1,1,0,0,1,1,1],
+ [0,0,1,1,1,1,1,0,1,1],
+ [1,0,1,0,0,0,1,0,1,0],
+ [1,1,0,1,1,1,1,1,1,1],
+ [1,0,1,1,0,1,1,0,1,1]
+];
+
+(function tick() {
+
+ var tz = timezone;
+ var d = new Date();
+ var dt = d.getTime();
+ os = d.getTimezoneOffset();
+ tz = parseInt(tz) + parseInt(os * 60);
+ var t = new Date((dt + (tz * 1000)));
+
+ var now = new Date,
+ hours = t.getHours(),
+ minutes = t.getMinutes(),
+ seconds = t.getSeconds();
+
+ digit = digit.data([hours / 10 | 0, hours % 10, minutes / 10 | 0, minutes % 10, seconds / 10 | 0, seconds % 10]);
+ digit.select("path:nth-child(1)").classed("lit", function(d) { return digitPattern[0][d]; });
+ digit.select("path:nth-child(2)").classed("lit", function(d) { return digitPattern[1][d]; });
+ digit.select("path:nth-child(3)").classed("lit", function(d) { return digitPattern[2][d]; });
+ digit.select("path:nth-child(4)").classed("lit", function(d) { return digitPattern[3][d]; });
+ digit.select("path:nth-child(5)").classed("lit", function(d) { return digitPattern[4][d]; });
+ digit.select("path:nth-child(6)").classed("lit", function(d) { return digitPattern[5][d]; });
+ digit.select("path:nth-child(7)").classed("lit", function(d) { return digitPattern[6][d]; });
+ separator.classed("lit", seconds & 1);
+
+ setTimeout(tick, 1000 - now % 1000);
+})();
+
}
\ No newline at end of file
diff --git a/pandora_console/include/help/en/help_alert_macros.php b/pandora_console/include/help/en/help_alert_macros.php
index 248638fb91..d724d35e0e 100644
--- a/pandora_console/include/help/en/help_alert_macros.php
+++ b/pandora_console/include/help/en/help_alert_macros.php
@@ -61,6 +61,17 @@ Besides the defined module macros, the following macros are available:
_modulegraphth_nh_:Same operation as the previous macro only with the critical and warning thresholds of the module provided they are defined.
_modulegroup_: Module’s group name.
_modulestatus_: Module status.
+_moduledata_X_: Last data of module X (module name, cannot have white spaces).
+_alert_name_: Alert name.
+_alert_priority_: Alert’s numeric priority.
+_alert_text_severity_: Priority level, in text, for the alert (Maintenance, Informational, Normal Minor, Major, Critical).
+_event_text_severity_: (Only event alerts) Text event (which triggered the alert) severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).
+_event_id_: (Only event alerts) ID of the event that triggered the alert.
+_event_description_: (Only event alerts) The textual description of the Pandora FMS event.
+_id_agent_: Agent’s ID, useful for building a direct URL that redirects to a Pandora FMS console webpage.
+_id_group_ : Agent group ID.
+_id_module_ : ID of module.
+_id_alert_: Alert’s numeric ID (unique), used to correlate the alert with third party software.
_moduletags_: URLs asociadas a los tags de módulos.
_name_tag_: Names of the tags related to the module.
_phone_tag_: Phone numbers related to the module’s tags.
diff --git a/pandora_console/include/help/en/help_module_definition.php b/pandora_console/include/help/en/help_module_definition.php
index 81bdaf95ea..d9cef4610c 100644
--- a/pandora_console/include/help/en/help_module_definition.php
+++ b/pandora_console/include/help/en/help_module_definition.php
@@ -4,13 +4,17 @@
*/
?>
Module definition
-
-There are three modes for an agent:
-
+Agents can be configured from the console in three working modes:
- Learning mode: All the modules sent by the agent are accepted. If modules are not defined, they will be automatically defined by the system. It is recommended to activate the agents in this mode and change it once the user is familiar with Pandora FMS. From version 4.0.3, in this mode, Pandora console collect all the configuration specified by the agent configuration file the first time and thereafter any changes should be made through console, will not catch changes in config file.
+
+ Learning mode: If the XML received from the software agent contains new modules, they will be automatically created. This is the default behavior.
+
- Normal mode: The modules in this mode must be configured manually. The self definition of the modules is not allowed in this mode.
+
+ Normal mode: No new modules will be created that arrive in XML if they have not been previously declared in the console.
+
- Autodisable mode: It behaves exactly the same as an agent in learning mode: when the first XML reaches it, the first agent is created and, on each report, if there are new modules they can also be added automatically. Nevertheless, when all modules from an agent that are in autodisable mode are also marked as unknown, the agent is automatically disabled. In any case, if the agent reports again, it gets enabled again on its own.
+
+ Autodisable mode: Similar to learning mode, in this mode, also, if all modules pass to unknown state the agent will be automatically disabled, going to be enabled again if it receives new information.
+
diff --git a/pandora_console/include/help/es/help_alert_macros.php b/pandora_console/include/help/es/help_alert_macros.php
index f2defd4991..9de6c52564 100644
--- a/pandora_console/include/help/es/help_alert_macros.php
+++ b/pandora_console/include/help/es/help_alert_macros.php
@@ -9,6 +9,68 @@
Además de las macros de módulo definidas, las siguientes macros están disponibles:
+_field1_: Campo 1 definido por el usuario.
+_field2_: Campo 2 definido por el usuario.
+_field3_: Campo 3 definido por el usuario.
+_field4_: Campo 4 definido por el usuario.
+_field5_: Campo 5 definido por el usuario.
+_field6_: Campo 6 definido por el usuario.
+_field7_: Campo 7 definido por el usuario.
+_field8_: Campo 8 definido por el usuario.
+_field9_: Campo 9 definido por el usuario.
+_field10_: Campo 10 definido por el usuario.
+_agent_: Nombre del agente que disparó la alerta.
+_agentcustomfield_n _: Campo personalizado número n del agente (eg. _agentcustomfield_9_).
+_agentcustomid_: ID personalizado del agente.
+_agentdescription_: Descripción del agente que disparó la alerta.
+_agentgroup_: Nombre del grupo del agente.
+_agentstatus_: Estado actual del agente.
+_agentos_: Sistema operativo del agente.
+_address_: Dirección del agente que disparó la alerta.
+_timestamp_: Hora y fecha en que se disparó la alerta.
+_timezone_: Area Nombre _timestamp_ que representa en.
+_data_: Dato que hizo que la alerta se disparase.
+_prevdata_: Dato previo antes de disparase la alerta.
+_alert_description_: Descripción de la alerta.
+_alert_threshold_: Umbral de la alerta.
+_alert_times_fired_: Número de veces que se ha disparado la alerta.
+_module_: Nombre del módulo.
+_modulecustomid_: ID personalizado del módulo.
+_modulegroup_: Nombre del grupo del módulo.
+_moduledescription_: Descripcion del modulo.
+_modulestatus_: Estado del módulo.
+_moduledata_X_: Último dato del módulo X (nombre del módulo, no puede tener espacios).
+_alert_name_: Nombre de la alerta.
+_alert_priority_: Prioridad numérica de la alerta.
+_alert_text_severity_: Prioridad en texto de la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).
+_eventt_text_severity_: (Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).
+_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.
+_event_description_: (Sólo en alertas de evento) la descripción textual del evento que disparó la alerta.
+_id_agent_: ID del agente, util para construir URL de acceso a la consola de Pandora.
+_id_group_ : Id del grupo de agente.
+_id_module_ : ID del módulo.
+_id_alert_: ID de la alerta, util para correlar la alerta en herramientas de terceros.
+_policy_: Nombre de la política a la que pertenece el módulo (si aplica).
+_interval_: Intervalo de la ejecución del módulo.
+_target_ip_: Dirección IP del objetivo del módulo.
+_target_port_: Puerto del objetivo del módulo.
+_plugin_parameters_: Parámetros del plugin del módulo.
+_server_ip_ : Ip del servidor al que el agente está asignado.
+_server_name_ : Nombre del servidor al que el agente está asignado.
+_groupcontact_: Información de contacto del grupo. Se configura al crear el grupo.
+_groupcustomid_: ID personalizado del grupo.
+_groupother_: Otra información sobre el grupo. Se configura al crear el grupo.
+_name_tag_: Nombre de los tags asociados al módulo.
+_email_tag_: Emails asociados a los tags de módulos.
+_phone_tag_: Teléfonos asociados a los tags de módulos.
+_moduletags_: URLs asociadas a los tags de módulos.
+_alert_critical_instructions_: Instrucciones contenidas en el módulo para un estado CRITICAL.
+_alert_warning_instructions_: Instrucciones contenidas en el módulo para un estado WARNING.
+_alert_unknown_instructions_: Instrucciones contenidas en el módulo para un estado UNKNOWN.
+_modulegraph_n h_: (>=6.0) (Solo para alertas que usen el comando eMail )
+Devuelve una imagen codificada en base64 de una gráfica del módulo con un período de n horas (eg. _modulegraph_24h_).
+Requiere de una configuración correcta de la conexión del servidor a la consola vía api,
+la cual se realiza en el fichero de configuración del servidor.
_address_: Dirección del agente que disparó la alerta.
_address_n_ : La dirección del agente que corresponde a la posicion indicada en "n" ejemplo: address_1_ , address_2_
@@ -73,8 +135,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
_target_ip_: Dirección IP del objetivo del módulo.
_target_port_: Puerto del objetivo del módulo.
_timestamp_: Hora y fecha en que se disparó la alerta.
- _timezone_: Area Nombre _timestamp_ que representa en.
-
+ _timezone_: Area Nombre _timestamp_ que representa en.
diff --git a/pandora_console/include/help/es/help_module_definition.php b/pandora_console/include/help/es/help_module_definition.php
index ff85f8b326..303fe1d188 100644
--- a/pandora_console/include/help/es/help_module_definition.php
+++ b/pandora_console/include/help/es/help_module_definition.php
@@ -4,14 +4,17 @@
*/
?>
Definición de módulo
-
-
-Existen tres modos para un agente:
-
+Los agentes pueden configurarse desde la consola en tres modos de trabajo:
- Modo aprendizaje: Si el XML recibido del agente software contiene nuevos módulos, éstos serán automáticamente creados. Este es el comportamiento por defecto.
+
+ Modo aprendizaje: Si el XML recibido del agente software contiene nuevos módulos, éstos serán automáticamente creados. Este es el comportamiento por defecto.
+
- Modo normal: No se crearán nuevos módulos que lleguen en el XML si no han sido declarados previamente en la consola.
+
+ Modo normal: No se crearán nuevos módulos que lleguen en el XML si no han sido declarados previamente en la consola.
+
- Modo auto deshabilitado: Similar al modo aprendizaje, en este modo, además, si todos los módulos pasan a estado desconocido el agente se deshabilitará automáticamente, pasando a habilitarse de nuevo si recibe nueva información.
+
+ Modo autodeshabilitado: Similar al modo aprendizaje, en este modo, además, si todos los módulos pasan a estado desconocido el agente se deshabilitará automáticamente, pasando a habilitarse de nuevo si recibe nueva información.
+
diff --git a/pandora_console/include/help/ja/help_alert_macros.php b/pandora_console/include/help/ja/help_alert_macros.php
index 5c14073067..7f158b5b03 100644
--- a/pandora_console/include/help/ja/help_alert_macros.php
+++ b/pandora_console/include/help/ja/help_alert_macros.php
@@ -45,6 +45,7 @@
_alert_text_severity_ : テキストでのアラートの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)
_event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)
_event_id_ : (イベントアラートのみ) アラート発生元のイベントID
+_event_description_: (イベントアラートのみ) Pandora FMS イベントの説明 です。
_event_extra_id_: (Only event alerts) Extra id.
_event_cfX_ : (Only event alerts) Key of the event custom field that fired the alert.
_id_agent_ : エージェントのID / Webコンソールへのリンクを生成するのに便利です
diff --git a/pandora_console/include/help/ja/help_module_definition.php b/pandora_console/include/help/ja/help_module_definition.php
index 570c7cd236..d7b14bb889 100644
--- a/pandora_console/include/help/ja/help_module_definition.php
+++ b/pandora_console/include/help/ja/help_module_definition.php
@@ -4,13 +4,17 @@
*/
?>
モジュール定義
-
-エージェントには、次の2つのモードがあります:
+Agents can be configured from the console in three working modes:
- 学習モード: エージェントから通知されるモジュール情報を受け取ります。モジュールが定義されていない場合は自動的にそれが追加されます。エージェントの設定でこのモードを有効にすることをお勧めします。Pandora FMS が使いやすいです。 バージョン 4.0.3 からは、このモードの場合、コンソールが初回はエージェント設定ファイルの全設定内容を読み込みますが、その後はコンソールから変更可能で設定ファイル側の変更は反映されません。
-
+
+ Learning mode: If the XML received from the software agent contains new modules, they will be automatically created. This is the default behavior.
+
- 通常モード: このモードでは、モジュール設定を手動で実施する必要があります。自動設定は行われません。
+
+ Normal mode: No new modules will be created that arrive in XML if they have not been previously declared in the console.
+
- Autodisable mode: In terms of creating agents and modules it behaves exactly the same as an agent in learning mode: when the first XML reaches it, the first agent is created and, on each report, if there are new modules they can also be added automatically. Nevertheless, when all modules from an agent that are in autodisable mode are also marked as unknown, the agent is automatically disabled. In any case, if the agent reports again, it gets enabled again on its own.
+
+ Autodisable mode: Similar to learning mode, in this mode, also, if all modules pass to unknown state the agent will be automatically disabled, going to be enabled again if it receives new information.
+
diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js
index 843835bae5..8fc943835c 100644
--- a/pandora_console/include/javascript/functions_pandora_networkmap.js
+++ b/pandora_console/include/javascript/functions_pandora_networkmap.js
@@ -2078,10 +2078,16 @@ function add_interface_link_js() {
success: function (data) {
if (data['correct']) {
var temp_link = {};
+ temp_link['status_start'] = "0";
+ temp_link['status_end'] = "0";
+
temp_link['id_db'] = data['id_db_link'];
+
if (data['type_source'] == 1) {
temp_link['arrow_start'] = "module";
temp_link['id_module_start'] = source_value;
+ temp_link["status_start"] = data['status'];
+ temp_link["link_color"] = (data['status'] == "1") ? "#FC4444" : "#999";
}
else {
temp_link['arrow_start'] = "";
@@ -2091,15 +2097,14 @@ function add_interface_link_js() {
if (data['type_target'] == 1) {
temp_link['arrow_end'] = "module";
temp_link['id_module_end'] = target_value;
+ temp_link["status_end"] = data['status'];
+ temp_link["link_color"] = (data['status'] == "1") ? "#FC4444" : "#999";
}
else {
temp_link['arrow_end'] = "";
temp_link['id_agent_end'] = target_value;
temp_link['id_module_end'] = 0;
}
- temp_link['status_start'] = "0";
- temp_link['status_end'] = "0";
-
temp_link['text_start'] = data['text_start'];
temp_link['text_end'] = data['text_end'];
@@ -2112,9 +2117,9 @@ function add_interface_link_js() {
temp_link['source'] = graph.nodes[j];
}
});
-
+
graph.links.push(temp_link);
-
+
draw_elements_graph();
init_drag_and_drop();
set_positions_graph();
diff --git a/pandora_console/include/styles/firts_task.css b/pandora_console/include/styles/firts_task.css
index 9bcac64f51..63ed752579 100755
--- a/pandora_console/include/styles/firts_task.css
+++ b/pandora_console/include/styles/firts_task.css
@@ -7,6 +7,18 @@
background-color: #ececec;
border-radius: 3px 3px 3px 3px;
}
+div.new_task_cluster
+{
+ margin-top: 30px;
+ left: 20px;
+ width: 60%;
+ border-radius: 3px 3px 3px 3px;
+}
+
+div.new_task_cluster, div.new_task_cluster > div
+{
+ background-color: #ececec;
+}
.title_task
{
@@ -24,6 +36,14 @@
height:100%;
float:left;
}
+.image_task_cluster
+{
+ width:20%;
+ height:100%;
+ float:left;
+ margin-left: 50px;
+ margin-top: 50px;
+}
.image_task>img {
margin-top: 35%;
margin-left: 15%;
@@ -36,6 +56,14 @@
height: 100%;
padding-right: 25px;
}
+.text_task_cluster
+{
+ width: 70%;
+ height: 100%;
+ padding-right: 25px;
+ margin-left:270px;
+ padding-top:10px;
+}
.text_task>p
{
margin-top: 4%;
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index 04f11bf691..40f86f5e1a 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -829,6 +829,12 @@ input.icon_min {
input.icon_min[disabled] {
background: #fefefe url(../../images/photo.disabled.png) no-repeat center !important;
}
+input.clock_min {
+ background: #fefefe url(../../images/clock-tab.png) no-repeat center !important;
+}
+input.clock_min[disabled] {
+ background: #fefefe url(../../images/clock-tab.disabled.png) no-repeat center !important;
+}
input.box_item {
background: #fefefe url(../../images/box_item.png) no-repeat center !important;
}
@@ -4233,7 +4239,7 @@ div#footer_help{
left: 90% !important;
}
-.graph_conteiner_inside > .parent_graph > .noresizevc{
+.graph_conteiner_inside > .parent_graph > .graph{
width: 90% !important;
}
@@ -4369,8 +4375,14 @@ div#footer_help{
.route {
fill: none;
transition: all 2s ease-in-out;
+<<<<<<< HEAD
+=======
}
+.limit_scroll{
+ max-width: 800px;
+ overflow-x:scroll;
+}
#is_favourite ul.container{
display: flex;
flex-direction: row;
@@ -4451,3 +4463,12 @@ form ul.form_flex li ul li{
height: 50px;
width: 100%;
}
+
+#modal_module_popup_close:hover{
+ cursor: pointer;
+}
+
+.modal_module_list:hover{
+ cursor: pointer;
+>>>>>>> develop
+}
\ No newline at end of file
diff --git a/pandora_console/index.php b/pandora_console/index.php
index e2c7f8c059..ed9eb48f9d 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -475,7 +475,18 @@ if (! isset ($config['id_user'])) {
db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']);
$_SESSION['id_usuario'] = $nick_in_db;
$config['id_user'] = $nick_in_db;
- config_prepare_session();
+
+ // Check if connection goes through F5 balancer. If it does, then don't call config_prepare_session() or user will be back to login all the time
+ $prepare_session = true;
+ foreach ($_COOKIE as $key=>$value) {
+ if (preg_match('/BIGipServer*/',$key) ) {
+ $prepare_session = false;
+ }
+ }
+ if ($prepare_session){
+ config_prepare_session();
+ }
+
if (is_user_admin($config['id_user'])) {
// PHP configuration values
$PHPupload_max_filesize = config_return_in_bytes(ini_get('upload_max_filesize'));
diff --git a/pandora_console/install.php b/pandora_console/install.php
index f075fae4a4..454490e2bc 100755
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -71,7 +71,7 @@
isWaitingDoubleAuth()) {
if ($user->validateDoubleAuthCode()) {
// Logged. Refresh the page
- header('Refresh:0');
+ header('Location: .');
return;
}
else {
@@ -181,7 +181,7 @@ switch ($action) {
}
else {
// Logged. Refresh the page
- header('Refresh:0');
+ header('Location: .');
return;
}
diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php
index 441197e393..d7a546a96a 100644
--- a/pandora_console/operation/menu.php
+++ b/pandora_console/operation/menu.php
@@ -105,6 +105,8 @@ if (!empty($sub2)) {
$sub["snmpconsole"]["subtype"] = "nolink";
}
+enterprise_hook ('cluster_menu');
+
if (!empty($sub)) {
$menu_operation["estado"]["text"] = __('Monitoring');
$menu_operation["estado"]["sec2"] = "operation/agentes/tactical";
diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php
index 47f52d0cd8..66879ad456 100644
--- a/pandora_console/operation/users/user_edit.php
+++ b/pandora_console/operation/users/user_edit.php
@@ -382,6 +382,7 @@ $autorefresh_list_out['operation/snmpconsole/snmp_view'] = "snmp_view";
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = "networkmap";
$autorefresh_list_out['operation/visual_console/render_view'] = "render_view";
$autorefresh_list_out['operation/events/events'] = "events";
+$autorefresh_list_out['enterprise/godmode/reporting/cluster_view'] = "cluster_view";
if(!isset($autorefresh_list)){
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
diff --git a/pandora_console/operation/visual_console/public_console.php b/pandora_console/operation/visual_console/public_console.php
index 21cd1333b9..ba3cdfd9d3 100755
--- a/pandora_console/operation/visual_console/public_console.php
+++ b/pandora_console/operation/visual_console/public_console.php
@@ -241,7 +241,12 @@ $ignored_params['refr'] = '';
$('.item > div').each( function() {
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
- $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
+ if($(this).attr('id').indexOf('clock') || $(this).attr('id').indexOf('overlay')){
+ $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
+ }
+ else{
+ $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
+ }
$(this).css('margin-left','');
}
else {
diff --git a/pandora_console/operation/visual_console/pure_ajax.php b/pandora_console/operation/visual_console/pure_ajax.php
index e9e248b578..c0367649d3 100644
--- a/pandora_console/operation/visual_console/pure_ajax.php
+++ b/pandora_console/operation/visual_console/pure_ajax.php
@@ -204,19 +204,20 @@ $ignored_params['refr'] = '';
});
- $('.item > div').each(function(){
- if($(this).css('float')=='left' || $(this).css('float')=='right'){
-
-
- $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
- $(this).css('margin-left','');
-
+ $('.item > div').each( function() {
+ if ($(this).css('float')=='left' || $(this).css('float')=='right') {
+ if($(this).attr('id').indexOf('clock') || $(this).attr('id').indexOf('overlay')){
+ $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
+ }
+ else{
+ $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
+ }
+ $(this).css('margin-left','');
}
- else{
+ else {
$(this).css('margin-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
-
});
$('.item > a > div').each(function(){
diff --git a/pandora_console/operation/visual_console/render_view.php b/pandora_console/operation/visual_console/render_view.php
index 31b78dd052..4e3429ad9b 100755
--- a/pandora_console/operation/visual_console/render_view.php
+++ b/pandora_console/operation/visual_console/render_view.php
@@ -312,7 +312,12 @@ $ignored_params['refr'] = '';
$('.item > div').each( function() {
if ($(this).css('float')=='left' || $(this).css('float')=='right') {
- $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
+ if($(this).attr('id').indexOf('clock') || $(this).attr('id').indexOf('overlay')){
+ $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
+ }
+ else{
+ $(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2-15)+'px');
+ }
$(this).css('margin-left','');
}
else {
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index bb87049251..7aaf356d24 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.718
-%define release 180131
+%define release 180210
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 9f1e00902f..0651e12af7 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.718
-%define release 180131
+%define release 180210
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index 4309a52e5f..b43432c7b4 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -605,6 +605,7 @@ CREATE TABLE IF NOT EXISTS `tcontainer_item` (
`agent` varchar(100) NOT NULL default '',
`module` varchar(100) NOT NULL default '',
`id_tag` integer(10) unsigned NOT NULL DEFAULT 0,
+ `type_graph` tinyint(1) unsigned NOT NULL DEFAULT 0,
`fullscale` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id_ci`),
FOREIGN KEY (`id_container`) REFERENCES tcontainer(`id_container`)
@@ -1373,6 +1374,10 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
`id_layout_linked_weight` int(10) NOT NULL default '0',
`element_group` int(10) NOT NULL default '0',
`show_on_top` tinyint(1) NOT NULL default '0',
+ `clock_animation` varchar(60) NOT NULL default "analogic_1",
+ `time_format` varchar(60) NOT NULL default "time",
+ `timezone` varchar(60) NOT NULL default "Europe/Madrid",
+
PRIMARY KEY(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
@@ -3028,3 +3033,51 @@ CREATE TABLE IF NOT EXISTS `treset_pass` (
`reset_time` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `tcluster`
+-- ---------------------------------------------------------------------
+
+create table IF NOT EXISTS `tcluster`(
+ `id` int unsigned not null auto_increment,
+ `name` tinytext not null default '',
+ `cluster_type` enum('AA','AP') not null default 'AA',
+ `description` text not null default '',
+ `group` int(10) unsigned NOT NULL default '0',
+ `id_agent` int(10) unsigned NOT NULL,
+ PRIMARY KEY (`id`),
+ FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
+ ON UPDATE CASCADE
+) engine=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `tcluster_item`
+-- ---------------------------------------------------------------------
+
+create table IF NOT EXISTS `tcluster_item`(
+ `id` int unsigned not null auto_increment,
+ `name` tinytext not null default '',
+ `item_type` enum('AA','AP') not null default 'AA',
+ `critical_limit` int unsigned NOT NULL default '0',
+ `warning_limit` int unsigned NOT NULL default '0',
+ `is_critical` tinyint(2) unsigned NOT NULL default '0',
+ `id_cluster` int unsigned,
+ PRIMARY KEY (`id`),
+ FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
+ ON DELETE SET NULL ON UPDATE CASCADE
+) engine=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `tcluster_agent`
+-- ---------------------------------------------------------------------
+
+create table IF NOT EXISTS `tcluster_agent`(
+ `id_cluster` int unsigned not null,
+ `id_agent` int(10) unsigned not null,
+ PRIMARY KEY (`id_cluster`,`id_agent`),
+ FOREIGN KEY (`id_agent`) REFERENCES tagente(`id_agente`)
+ ON UPDATE CASCADE,
+ FOREIGN KEY (`id_cluster`) REFERENCES tcluster(`id`)
+ ON UPDATE CASCADE
+) engine=InnoDB DEFAULT CHARSET=utf8;
+
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index 3f0595e134..23239e8585 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -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', 11),
+('MR', 12),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
-('current_package_enterprise', '718'),
+('current_package_enterprise', '719'),
('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}');
UNLOCK TABLES;
@@ -141,7 +141,8 @@ INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES
(17, 'Router', 'Generic router', 'so_router.png'),
(18, 'Switch', 'Generic switch', 'so_switch.png'),
(19, 'Satellite', 'Satellite agent', 'satellite.png'),
-(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png');
+(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png'),
+(21, 'Cluster', 'Cluster agent', 'so_cluster.png');
UNLOCK TABLES;
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 5cc48d9c4c..1dfc1123fb 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-server
-Version: 7.0NG.718-180131
+Version: 7.0NG.718-180210
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 3faace6fdf..f31b156e87 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.718-180131"
+pandora_version="7.0NG.718-180210"
package_cpan=0
package_pandora=1
diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new
index e62d1b9b9b..a002d4b91c 100644
--- a/pandora_server/conf/pandora_server.conf.new
+++ b/pandora_server/conf/pandora_server.conf.new
@@ -120,6 +120,7 @@ snmp_pdu_address 0
#snmp_forward_privProtocol
#snmp_forward_privPassword
#snmp_forward_secLevel
+#snmp_forward_community
# Activate (1) Pandora Network Server
@@ -622,6 +623,9 @@ syslog_max 65535
# Sync timeout
#sync_timeout 10
+# Address
+# sync_address
+
# Target LogStash server, to allow Dataserver and SyslogServer store log information in ElasticSearch
#logstash_host ip
#logstash_port 10514
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 65ef0d377a..202e5bb6ca 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.718";
-my $pandora_build = "180131";
+my $pandora_build = "180210";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index ed45f9200b..8f1877349e 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -31,7 +31,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.718";
-my $pandora_build = "180131";
+my $pandora_build = "180210";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
@@ -427,7 +427,14 @@ sub print_module {
if (ref ($data->{value}) eq "ARRAY") {
$xml_module .= "\t\n";
foreach (@{$data->{value}}) {
- $xml_module .= "\t{value} . "]]> \n";
+ if ((ref($_) eq "HASH") && defined($_->{value})) {
+ $xml_module .= "\t\n";
+ $xml_module .= "\t\t{value} . "]]> \n";
+ if (defined($_->{timestamp})) {
+ $xml_module .= "\t\t{timestamp} . "]]> \n";
+ }
+ $xml_module .= "\t \n";
+ }
}
$xml_module .= "\t \n";
}
diff --git a/pandora_server/lib/PandoraFMS/PredictionServer.pm b/pandora_server/lib/PandoraFMS/PredictionServer.pm
index 9266a7e283..1862930267 100644
--- a/pandora_server/lib/PandoraFMS/PredictionServer.pm
+++ b/pandora_server/lib/PandoraFMS/PredictionServer.pm
@@ -196,6 +196,27 @@ sub exec_prediction_module ($$$$) {
return;
}
+ # Cluster status module.
+ if ($agent_module->{'prediction_module'} == 5) {
+ logger ($pa_config, "Executing cluster status module " . $agent_module->{'nombre'}, 10);
+ enterprise_hook ('exec_cluster_status_module', [$pa_config, $agent_module, $server_id, $dbh]);
+ return;
+ }
+
+ # Cluster active-active module.
+ if ($agent_module->{'prediction_module'} == 6) {
+ logger ($pa_config, "Executing cluster active-active module " . $agent_module->{'nombre'}, 10);
+ enterprise_hook ('exec_cluster_aa_module', [$pa_config, $agent_module, $server_id, $dbh]);
+ return;
+ }
+
+ # Cluster active-passive module.
+ if ($agent_module->{'prediction_module'} == 7) {
+ logger ($pa_config, "Executing cluster active-passive module " . $agent_module->{'nombre'}, 10);
+ enterprise_hook ('exec_cluster_ap_module', [$pa_config, $agent_module, $server_id, $dbh]);
+ return;
+ }
+
# Get a full hash for target agent_module record reference ($target_module)
my $target_module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $agent_module->{'custom_integer_1'});
return unless defined $target_module;
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 508422be78..865a33bd1a 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.718
-%define release 180131
+%define release 180210
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 4fdde3131a..3d320c7ef1 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.718
-%define release 180131
+%define release 180210
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index e1317cdd16..bbd7369eac 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.718"
-PI_BUILD="180131"
+PI_BUILD="180210"
MODE=$1
if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index b7516f3907..abd7e70604 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB;
# version: define current version
-my $version = "7.0NG.718 PS180131";
+my $version = "7.0NG.718 PS180210";
# Pandora server configuration
my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 580588ccb6..f0e2fe85ba 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
-my $version = "7.0NG.718 PS180131";
+my $version = "7.0NG.718 PS180210";
# save program name for logging
my $progname = basename($0);