Merge remote-tracking branch 'origin/develop' into ent-7427-nexcon-datos-de-monitorizacion-con-origen-en-netflow
This commit is contained in:
commit
c4ef22164b
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.769-230322
|
||||
Version: 7.0NG.769-230324
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.769-230322"
|
||||
pandora_version="7.0NG.769-230324"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1023,7 +1023,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.769';
|
||||
use constant AGENT_BUILD => '230322';
|
||||
use constant AGENT_BUILD => '230324';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.769
|
||||
%define release 230322
|
||||
%define release 230324
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.769
|
||||
%define release 230322
|
||||
%define release 230324
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.769"
|
||||
PI_BUILD="230322"
|
||||
PI_BUILD="230324"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230322}
|
||||
{230324}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.769 Build 230322")
|
||||
#define PANDORA_VERSION ("7.0NG.769 Build 230324")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.769(Build 230322))"
|
||||
VALUE "ProductVersion", "(7.0NG.769(Build 230324))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.769-230322
|
||||
Version: 7.0NG.769-230324
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.769-230322"
|
||||
pandora_version="7.0NG.769-230324"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -240,7 +240,28 @@ function pandora_files_repo_operation()
|
|||
}
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
|
||||
ui_print_standard_header(
|
||||
__('Files repository'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$onheader,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Admin tools'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Extension manager'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Files repository'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
|
||||
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `ssh_status` TINYINT UNSIGNED DEFAULT 0;
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `db_status` TINYINT UNSIGNED DEFAULT 0;
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `replication_status` TINYINT UNSIGNED DEFAULT 0;
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `replication_delay` BIGINT DEFAULT 0;
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `master` TINYINT UNSIGNED DEFAULT 0;
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `utimestamp` BIGINT DEFAULT 0;
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `mysql_version` VARCHAR(10) DEFAULT '';
|
||||
ALTER TABLE `tdatabase` ADD COLUMN `pandora_version` VARCHAR(10) DEFAULT '';
|
||||
|
||||
UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1;
|
||||
UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2;
|
||||
UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3;
|
||||
|
@ -172,5 +181,6 @@ ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_critical` float(20,2) NOT NULL
|
|||
ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_warning` float(20,2) NOT NULL default 0;
|
||||
ALTER TABLE `tnetflow_filter` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `tnetflow_filter` ADD COLUMN `netflow_monitoring_interval` INT UNSIGNED NOT NULL DEFAULT 300;
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('legacy_database_ha', 1);
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php';
|
|||
echo '<style>
|
||||
:root {';
|
||||
if ($config['style'] === 'pandora') {
|
||||
echo '--login-background-color: rgba(255, 255, 255, 0.2);';
|
||||
echo '--login-background-color: rgba(255, 255, 255, 0.4);';
|
||||
echo '--login-label-color: #545454;';
|
||||
echo '--login-text-color: #000;';
|
||||
$style_theme = 'white-theme';
|
||||
|
@ -213,7 +213,7 @@ echo '<div class="login_page">';
|
|||
if (is_metaconsole() === true) {
|
||||
if (!isset($config['custom_logo_login'])) {
|
||||
html_print_image(
|
||||
'enterprise/images/custom_logo_login/login_logo.png',
|
||||
'enterprise/images/custom_logo_login/Pandora-FMS-1.png',
|
||||
false,
|
||||
[
|
||||
'class' => 'login_logo',
|
||||
|
@ -238,13 +238,13 @@ if (is_metaconsole() === true) {
|
|||
}
|
||||
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if (!isset($config['custom_logo_login'])) {
|
||||
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/login_logo_v7.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
} else {
|
||||
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
} else {
|
||||
if (empty($config['custom_logo_login']) === true) {
|
||||
html_print_image(ui_get_full_url('images/custom_logo_login/pandora_logo.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
} else {
|
||||
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
|
@ -472,17 +472,19 @@ html_print_csrf_hidden();
|
|||
echo '<div class ="img_banner_login">';
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if (empty($config['custom_splash_login']) === false && $config['custom_splash_login'] !== 'default') {
|
||||
html_print_image(
|
||||
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
|
||||
false,
|
||||
[
|
||||
'class' => 'splash-logo',
|
||||
'alt' => 'splash',
|
||||
'border' => 0,
|
||||
],
|
||||
false,
|
||||
false
|
||||
);
|
||||
if ($config['custom_splash_login'] !== 'none.png') {
|
||||
html_print_image(
|
||||
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
|
||||
false,
|
||||
[
|
||||
'class' => 'splash-logo',
|
||||
'alt' => 'splash',
|
||||
'border' => 0,
|
||||
],
|
||||
false,
|
||||
false
|
||||
);
|
||||
}
|
||||
} else {
|
||||
echo '
|
||||
<div class="loginimg-container">
|
||||
|
@ -522,10 +524,10 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
|||
if ($config['custom_title1_login']) {
|
||||
echo io_safe_output($config['custom_title1_login']);
|
||||
} else {
|
||||
echo __('ONE TOOL TO MONITOR THEM ALL');
|
||||
echo __('ONE TOOL TO RULE THEM ALL');
|
||||
}
|
||||
} else {
|
||||
echo __('ONE TOOL TO MONITOR THEM ALL');
|
||||
echo __('ONE TOOL TO RULE THEM ALL');
|
||||
}
|
||||
|
||||
echo '</span></div>';
|
||||
|
|
|
@ -184,7 +184,7 @@ if (!$double_auth_enabled
|
|||
background: "black"
|
||||
},
|
||||
width: 500,
|
||||
height: 400,
|
||||
height: 'auto',
|
||||
close: function (event, ui) {
|
||||
// Abort the ajax request
|
||||
if (typeof request != 'undefined'){
|
||||
|
|
|
@ -57,14 +57,33 @@ if ($id_field) {
|
|||
$combo_values = $field['combo_values'] ? $field['combo_values'] : '';
|
||||
$is_combo_enable = $config['is_combo_enable'];
|
||||
$is_link_enabled = $field['is_link_enabled'];
|
||||
ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, '');
|
||||
$header_title = __('Update agent custom field');
|
||||
} else {
|
||||
ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, '');
|
||||
$header_title = __('Create agent custom field');
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->class = 'databox';
|
||||
$table->id = 'configure_field';
|
||||
ui_print_standard_header(
|
||||
$header_title,
|
||||
'images/custom_field.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
|
||||
'label' => __('Custom field'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Edit'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
|
||||
echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
|
||||
|
@ -82,80 +101,96 @@ echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Informati
|
|||
echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
|
||||
echo '</div>';
|
||||
|
||||
$table = new stdClass();
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->id = 'configure_field';
|
||||
$table->width = '100%';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[1][0] = html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
35,
|
||||
100,
|
||||
true
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
35,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = __('Pass type').ui_print_help_tip(
|
||||
__('The fields with pass type enabled will be displayed like html input type pass in html'),
|
||||
true
|
||||
);
|
||||
$table->data[2][1] = __('Display on front').ui_print_help_tip(
|
||||
__('The fields with display on front enabled will be displayed into the agent details'),
|
||||
true
|
||||
);
|
||||
$table->data[2][2] = __('Link type');
|
||||
|
||||
$table->data[3][0] = html_print_checkbox_switch(
|
||||
'is_password_type',
|
||||
1,
|
||||
$is_password_type,
|
||||
true
|
||||
);
|
||||
$table->data[3][1] = html_print_checkbox_switch(
|
||||
'display_on_front',
|
||||
1,
|
||||
$display_on_front,
|
||||
true
|
||||
);
|
||||
$table->data[3][2] = html_print_checkbox_switch_extended(
|
||||
'is_link_enabled',
|
||||
1,
|
||||
$is_link_enabled,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[4][0] = __('Enabled combo');
|
||||
$table->data[5][0] = html_print_checkbox_switch_extended(
|
||||
'is_combo_enable',
|
||||
0,
|
||||
$config['is_combo_enable'],
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Display on front').ui_print_help_tip(
|
||||
__('The fields with display on front enabled will be displayed into the agent details'),
|
||||
true
|
||||
),
|
||||
html_print_checkbox_switch(
|
||||
'display_on_front',
|
||||
1,
|
||||
$display_on_front,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$table->cellstyle[4][1] = 'display: none;';
|
||||
$table->cellstyle[5][1] = 'display: none;';
|
||||
|
||||
$table->data[4][1] = __('Combo values').ui_print_help_tip(
|
||||
__('Set values separated by comma'),
|
||||
true
|
||||
);
|
||||
$table->data[5][1] = html_print_textarea(
|
||||
'combo_values',
|
||||
3,
|
||||
65,
|
||||
io_safe_output($combo_values),
|
||||
'',
|
||||
true
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Link type'),
|
||||
html_print_checkbox_switch_extended(
|
||||
'is_link_enabled',
|
||||
1,
|
||||
$is_link_enabled,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Pass type').ui_print_help_tip(
|
||||
__('The fields with pass type enabled will be displayed like html input type pass in html'),
|
||||
true
|
||||
),
|
||||
html_print_checkbox_switch(
|
||||
'is_password_type',
|
||||
1,
|
||||
$is_password_type,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Enabled combo'),
|
||||
html_print_checkbox_switch_extended(
|
||||
'is_combo_enable',
|
||||
0,
|
||||
$config['is_combo_enable'],
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Combo values').ui_print_help_tip(
|
||||
__('Set values separated by comma'),
|
||||
true
|
||||
),
|
||||
html_print_textarea(
|
||||
'combo_values',
|
||||
3,
|
||||
65,
|
||||
io_safe_output($combo_values),
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form class="max_floating_element_size" name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
|
||||
html_print_table($table);
|
||||
|
||||
if ($id_field > 0) {
|
||||
|
@ -194,65 +229,65 @@ echo '</form>';
|
|||
<script>
|
||||
$(document).ready (function () {
|
||||
if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){
|
||||
console.log('entra2');
|
||||
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
|
||||
$('#configure_field-4').show();
|
||||
$('#configure_field-3').show();
|
||||
|
||||
$('input[type=checkbox][name=is_password_type]').change(function (e) {
|
||||
dialog_message("#message_set_password");
|
||||
$('input[type=checkbox][name=is_password_type]').prop('checked', false);
|
||||
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
|
||||
$('#configure_field-4').show();
|
||||
$('#configure_field-3').show();
|
||||
e.preventDefault();
|
||||
});
|
||||
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
|
||||
if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
|
||||
dialog_message("#message_set_combo");
|
||||
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
|
||||
$('#configure_field-4').show();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
|
||||
if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
|
||||
dialog_message("#message_set_combo");
|
||||
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
|
||||
$('#configure_field-3').show();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('entra');
|
||||
$('#configure_field-3').hide();
|
||||
}
|
||||
|
||||
if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) {
|
||||
$('#configure_field-1').hide();
|
||||
$('#configure_field-3').hide();
|
||||
$('#configure_field-2').hide();
|
||||
} else {
|
||||
$('#configure_field-1').show();
|
||||
$('#configure_field-3').show();
|
||||
$('#configure_field-2').show();
|
||||
}
|
||||
|
||||
$('input[type=checkbox][name=is_link_enabled]').change(function () {
|
||||
if( $(this).is(":checked") ){
|
||||
$('#configure_field-1').hide();
|
||||
$('#configure_field-2').hide();
|
||||
$('#configure_field-3').hide();
|
||||
} else{
|
||||
$('#configure_field-1').show();
|
||||
$('#configure_field-2').show();
|
||||
$('#configure_field-3').show();
|
||||
}
|
||||
});
|
||||
|
||||
$('input[type=checkbox][name=is_combo_enable]').change(function () {
|
||||
if( $(this).is(":checked") ){
|
||||
$('#configure_field-4').show();
|
||||
$('#configure_field-3').show();
|
||||
dialog_message("#message_no_set_password");
|
||||
$('#configure_field-1').hide();
|
||||
$('#configure_field-5').hide();
|
||||
}
|
||||
else{
|
||||
$('#configure_field-4').hide();
|
||||
$('#configure_field-3').hide();
|
||||
$('#configure_field-1').show();
|
||||
$('#configure_field-5').show();
|
||||
}
|
||||
});
|
||||
$('input[type=checkbox][name=is_password_type]').change(function () {
|
||||
if( $(this).is(":checked")){
|
||||
dialog_message("#message_no_set_combo");
|
||||
$('#configure_field-3').hide();
|
||||
$('#configure_field-5').hide();
|
||||
}
|
||||
else{
|
||||
$('#configure_field-3').show();
|
||||
$('#configure_field-5').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -866,7 +866,6 @@ if ($agents !== false) {
|
|||
// Operating System icon column.
|
||||
$osIconColumn = html_print_div(
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'content' => ui_print_os_icon($agent['id_os'], false, true),
|
||||
],
|
||||
true
|
||||
|
@ -885,7 +884,6 @@ if ($agents !== false) {
|
|||
// Group icon and name column.
|
||||
$agentGroupIconColumn = html_print_div(
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'content' => ui_print_group_icon($agent['id_grupo'], true),
|
||||
],
|
||||
true
|
||||
|
|
|
@ -445,79 +445,75 @@ $tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width
|
|||
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' ';
|
||||
|
||||
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
|
||||
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||
'min_warning',
|
||||
$min_warning,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === true,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
|
||||
'max_warning',
|
||||
$max_warning,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === true,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'</span>';
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
|
||||
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||
'min_warning',
|
||||
$min_warning,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === true,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
|
||||
'max_warning',
|
||||
$max_warning,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === true,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'</span>';
|
||||
|
||||
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
|
||||
[
|
||||
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
|
||||
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
|
||||
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
|
||||
],
|
||||
[ 'class' => 'margin-top-10' ],
|
||||
true
|
||||
);
|
||||
}
|
||||
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
|
||||
[
|
||||
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
|
||||
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
|
||||
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
|
||||
],
|
||||
[ 'class' => 'margin-top-10' ],
|
||||
true
|
||||
);
|
||||
|
||||
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||
$basicThresholdsIntervalWarning = [];
|
||||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||
'warning_inverse_string',
|
||||
1,
|
||||
$warning_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$basicThresholdsIntervalWarning = [];
|
||||
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
|
||||
'warning_inverse_string',
|
||||
1,
|
||||
$warning_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $basicThresholdsIntervalWarning),
|
||||
],
|
||||
true
|
||||
);
|
||||
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $basicThresholdsIntervalWarning),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
|
||||
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||
'str_warning',
|
||||
str_replace('"', '', $str_warning),
|
||||
'',
|
||||
10,
|
||||
1024,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === false,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'</span>';
|
||||
}
|
||||
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
|
||||
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
|
||||
'str_warning',
|
||||
str_replace('"', '', $str_warning),
|
||||
'',
|
||||
10,
|
||||
1024,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === false,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'</span>';
|
||||
|
||||
|
||||
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
|
||||
|
@ -532,87 +528,84 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
|
|||
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
|
||||
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').' ';
|
||||
if ((isset($stringTypeModule) === false || $stringTypeModule === false)) {
|
||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
|
||||
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
|
||||
'min_critical',
|
||||
$min_critical,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === false,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
|
||||
'max_critical',
|
||||
$max_critical,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === false,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'</span>';
|
||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
|
||||
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
|
||||
'min_critical',
|
||||
$min_critical,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === false,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
|
||||
'max_critical',
|
||||
$max_critical,
|
||||
'',
|
||||
10,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy || $edit === false,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
).'</span>';
|
||||
|
||||
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
|
||||
[
|
||||
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
|
||||
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
|
||||
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
|
||||
],
|
||||
[ 'class' => 'margin-top-10' ],
|
||||
true
|
||||
);
|
||||
}
|
||||
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
|
||||
[
|
||||
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
|
||||
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
|
||||
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
|
||||
],
|
||||
[ 'class' => 'margin-top-10' ],
|
||||
true
|
||||
);
|
||||
|
||||
if (isset($stringTypeModule) === true && $stringTypeModule === true) {
|
||||
$basicThresholdsIntervalCritical = [];
|
||||
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
||||
'critical_inverse_string',
|
||||
1,
|
||||
$critical_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $basicThresholdsIntervalCritical),
|
||||
],
|
||||
true
|
||||
);
|
||||
$basicThresholdsIntervalCritical = [];
|
||||
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
|
||||
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
|
||||
'critical_inverse_string',
|
||||
1,
|
||||
$critical_inverse,
|
||||
true,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
|
||||
[
|
||||
'id' => 'percentage_critical',
|
||||
'content' => $divPercentageContent,
|
||||
],
|
||||
true
|
||||
);
|
||||
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
|
||||
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $basicThresholdsIntervalCritical),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
|
||||
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
|
||||
'str_critical',
|
||||
str_replace('"', '', $str_critical),
|
||||
'',
|
||||
10,
|
||||
1024,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
}
|
||||
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
|
||||
[
|
||||
'id' => 'percentage_critical',
|
||||
'content' => $divPercentageContent,
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
|
||||
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
|
||||
'str_critical',
|
||||
str_replace('"', '', $str_critical),
|
||||
'',
|
||||
10,
|
||||
1024,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
|
||||
$table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%';
|
||||
$table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left';
|
||||
|
@ -1623,6 +1616,11 @@ ui_require_jquery_file('json');
|
|||
/* <![CDATA[ */
|
||||
$(document).ready (function () {
|
||||
var disabledBecauseInPolicy = <?php echo '\''.((empty($disabledBecauseInPolicy) === true) ? '0' : '1').'\''; ?>;
|
||||
var idModuleType = '<?php echo $type_names_hash[$id_module_type]; ?>';
|
||||
if (idModuleType != '') {
|
||||
setModuleType(idModuleType);
|
||||
}
|
||||
|
||||
$("#right").click (function () {
|
||||
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
|
||||
tag_name = $(value).html();
|
||||
|
|
|
@ -704,6 +704,19 @@ if ($step == 2) {
|
|||
)
|
||||
);
|
||||
|
||||
$usr_groups = implode(
|
||||
',',
|
||||
array_keys(users_get_groups($config['id_user'], 'LM', true))
|
||||
);
|
||||
|
||||
$sql_query = sprintf(
|
||||
'SELECT id, name
|
||||
FROM talert_actions
|
||||
WHERE id_group IN (%s)
|
||||
ORDER BY name',
|
||||
$usr_groups
|
||||
);
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Default action').ui_print_help_tip(
|
||||
__('Unless they\'re left blank, the fields from the action will override those set on the template.'),
|
||||
|
@ -801,19 +814,6 @@ if ($step == 2) {
|
|||
)
|
||||
);
|
||||
|
||||
$usr_groups = implode(
|
||||
',',
|
||||
array_keys(users_get_groups($config['id_user'], 'LM', true))
|
||||
);
|
||||
|
||||
$sql_query = sprintf(
|
||||
'SELECT id, name
|
||||
FROM talert_actions
|
||||
WHERE id_group IN (%s)
|
||||
ORDER BY name',
|
||||
$usr_groups
|
||||
);
|
||||
|
||||
$table->data[5][0] = html_print_label_input_block(
|
||||
__('Condition type'),
|
||||
html_print_select(
|
||||
|
|
|
@ -445,7 +445,7 @@ if ($is_management_allowed === true
|
|||
if ($aviable_name === true) {
|
||||
$values = [
|
||||
'nombre' => $name,
|
||||
'icon' => empty($icon) ? '' : substr($icon, 0, -4),
|
||||
'icon' => $icon,
|
||||
'parent' => $id_parent,
|
||||
'disabled' => $alerts_disabled,
|
||||
'custom_id' => $custom_id,
|
||||
|
@ -513,7 +513,7 @@ if ($is_management_allowed === true && $update_group === true) {
|
|||
if ($aviable_name === true) {
|
||||
$values = [
|
||||
'nombre' => $name,
|
||||
'icon' => empty($icon) ? '' : substr($icon, 0, -4),
|
||||
'icon' => $icon,
|
||||
'parent' => ($id_parent == -1) ? 0 : $id_parent,
|
||||
'disabled' => !$alerts_enabled,
|
||||
'custom_id' => $custom_id,
|
||||
|
@ -741,12 +741,11 @@ if ($is_management_allowed === true
|
|||
|
||||
// Credential store is loaded previously in this document to avoid
|
||||
// process group tree - list forms.
|
||||
ui_print_spinner(__('Loading'));
|
||||
if ($tab == 'tree') {
|
||||
/*
|
||||
* Group tree view.
|
||||
*/
|
||||
|
||||
ui_print_spinner(__('Loading'));
|
||||
echo "<div id='tree-controller-recipient'></div>";
|
||||
} else {
|
||||
/*
|
||||
|
@ -986,7 +985,7 @@ if ($tab == 'tree') {
|
|||
true,
|
||||
'offset',
|
||||
false,
|
||||
'pagination-bottom'
|
||||
''
|
||||
);
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
|
@ -1038,6 +1037,7 @@ $tab = 'group_edition';
|
|||
|
||||
<script type="text/javascript">
|
||||
var treeController = TreeController.getController();
|
||||
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
|
||||
|
||||
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
|
||||
treeController.recipient.empty();
|
||||
|
|
|
@ -364,6 +364,11 @@ if ($access_console_node === true) {
|
|||
$sub2['godmode/setup/setup§ion=net']['text'] = __('Netflow');
|
||||
$sub2['godmode/setup/setup§ion=net']['refr'] = 0;
|
||||
}
|
||||
|
||||
if ((bool) $config['activate_sflow'] === true) {
|
||||
$sub2['godmode/setup/setup§ion=sflow']['text'] = __('Sflow');
|
||||
$sub2['godmode/setup/setup§ion=sflow']['refr'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$sub2['godmode/setup/setup§ion=ehorus']['text'] = __('eHorus');
|
||||
|
|
|
@ -297,7 +297,7 @@ if (!empty($table->data)) {
|
|||
html_print_input_hidden('multiple_delete', 1);
|
||||
ui_pagination($count_network_templates, false, $offset);
|
||||
html_print_table($table);
|
||||
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, '');
|
||||
echo "<div class='pdd_l_5px right'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo '</div>';
|
||||
|
|
|
@ -445,7 +445,7 @@ if (!empty($graphs)) {
|
|||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table($table);
|
||||
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, '');
|
||||
echo "<div class='right'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo '</form>';
|
||||
|
|
|
@ -115,6 +115,7 @@ $exception_condition_value = 10;
|
|||
$modulegroup = 0;
|
||||
$period = SECONDS_1DAY;
|
||||
$search = '';
|
||||
$full_text = 0;
|
||||
$log_number = 1000;
|
||||
// Added support for projection graphs.
|
||||
$period_pg = SECONDS_5DAY;
|
||||
|
@ -316,6 +317,7 @@ switch ($action) {
|
|||
$source = $es['source'];
|
||||
$search = $es['search'];
|
||||
$log_number = empty($es['log_number']) ? $log_number : $es['log_number'];
|
||||
$full_text = empty($es['full_text']) ? 0 : $es['full_text'];
|
||||
break;
|
||||
|
||||
case 'simple_graph':
|
||||
|
@ -1313,6 +1315,14 @@ $class = 'databox filters';
|
|||
<td >
|
||||
<?php
|
||||
html_print_input_text('search', $search, '', 40, 100);
|
||||
html_print_checkbox(
|
||||
'full_text',
|
||||
1,
|
||||
$full_text,
|
||||
false,
|
||||
false
|
||||
);
|
||||
ui_print_help_tip(__('Full context'), false);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1597,11 +1597,13 @@ switch ($action) {
|
|||
$agents_to_report = get_parameter('id_agents3');
|
||||
$source = get_parameter('source', '');
|
||||
$search = get_parameter('search', '');
|
||||
$full_text = (integer) get_parameter('full_text', 0);
|
||||
$log_number = get_parameter('log_number', '');
|
||||
|
||||
$es['source'] = $source;
|
||||
$es['id_agents'] = $agents_to_report;
|
||||
$es['search'] = $search;
|
||||
$es['full_text'] = $full_text;
|
||||
$es['log_number'] = $log_number;
|
||||
|
||||
$values['external_source'] = json_encode($es);
|
||||
|
@ -2542,11 +2544,13 @@ switch ($action) {
|
|||
$agents_to_report = get_parameter('id_agents3');
|
||||
$source = get_parameter('source', '');
|
||||
$search = get_parameter('search', '');
|
||||
$full_text = (integer) get_parameter('full_text', 0);
|
||||
$log_number = get_parameter('log_number', '');
|
||||
|
||||
$es['source'] = $source;
|
||||
$es['id_agents'] = $agents_to_report;
|
||||
$es['search'] = $search;
|
||||
$es['full_text'] = $full_text;
|
||||
$es['log_number'] = $log_number;
|
||||
|
||||
$values['external_source'] = json_encode($es);
|
||||
|
|
|
@ -137,8 +137,6 @@ echo $formHidden;
|
|||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
|
||||
|
||||
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
|
|
|
@ -63,7 +63,7 @@ if (empty($idVisualConsole) === true) {
|
|||
$idVisualConsole = get_parameter('id', 0);
|
||||
}
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === false) {
|
||||
$action_name_parameter = 'action';
|
||||
} else {
|
||||
$action_name_parameter = 'action2';
|
||||
|
@ -93,7 +93,6 @@ $activeTab = get_parameterBetweenListValues(
|
|||
'data'
|
||||
);
|
||||
|
||||
|
||||
// Visual console creation tab and actions.
|
||||
if (empty($idVisualConsole)) {
|
||||
$visualConsole = null;
|
||||
|
@ -137,7 +136,6 @@ $refr = (int) get_parameter('refr', $config['vc_refr']);
|
|||
|
||||
$id_layout = 0;
|
||||
|
||||
|
||||
// Save/Update data in DB
|
||||
global $statusProcessInDB;
|
||||
if (empty($statusProcessInDB)) {
|
||||
|
@ -798,14 +796,18 @@ if (!defined('METACONSOLE')) {
|
|||
$hash = User::generatePublicHash();
|
||||
|
||||
$buttons = [];
|
||||
|
||||
$buttons['consoles_list'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder&refr='.$refr.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Visual consoles list'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
];
|
||||
$buttons['public_link'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.ui_get_full_url('operation/visual_console/public_console.php?hash='.$hash.'&refr='.$refr.'&id_layout='.$idVisualConsole.'&id_user='.$config['id_user']).'">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public Visual Console'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'operation/visual_console/public_console.php?hash='.$hash.'&refr='.$refr.'&id_layout='.$idVisualConsole.'&id_user='.$config['id_user'],
|
||||
false,
|
||||
false,
|
||||
false
|
||||
).'">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public Visual Console'), 'class' => 'main_menu_icon invert_filter']).'</a>',
|
||||
];
|
||||
$buttons['data'] = [
|
||||
'active' => false,
|
||||
|
|
|
@ -65,7 +65,7 @@ switch ($action) {
|
|||
|
||||
$table = new stdClass();
|
||||
$table->class = 'info_table';
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
$table->head[0] = __('Map connection name');
|
||||
$table->head[1] = __('Group');
|
||||
$table->head[3] = __('Delete');
|
||||
|
@ -84,7 +84,7 @@ if ($mapsConnections !== false) {
|
|||
'<a href="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2&action=edit_connection_map&id_connection_map='.$mapsConnection['id_tmap_connection'].'">'.$mapsConnection['conection_name'].'</a>',
|
||||
ui_print_group_icon($mapsConnection['group_id'], true),
|
||||
'<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=gis&id_connection_map='.$mapsConnection['id_tmap_connection'].'&action=delete_connection"
|
||||
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>',
|
||||
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>',
|
||||
];
|
||||
$table->cellclass[][2] = 'table_action_buttons';
|
||||
}
|
||||
|
@ -95,6 +95,14 @@ html_print_table($table);
|
|||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="post">';
|
||||
html_print_input_hidden('action', 'create_connection_map');
|
||||
html_print_submit_button(__('Create'), '', false, 'class="sub next"');
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
)
|
||||
);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
|
|
@ -69,7 +69,6 @@ if ($is_management_allowed === true) {
|
|||
$table->head[4] = '';
|
||||
}
|
||||
|
||||
$table->align[1] = 'center';
|
||||
if ($is_management_allowed === true) {
|
||||
$table->align[4] = 'center';
|
||||
}
|
||||
|
@ -100,7 +99,7 @@ $table->data = [];
|
|||
foreach ($osList as $os) {
|
||||
$data = [];
|
||||
$data[] = $os['id_os'];
|
||||
$data[] = html_print_div(['class' => 'invert_filter main_menu_icon', 'content' => ui_print_os_icon($os['id_os'], false, true)], true);
|
||||
$data[] = ui_print_os_icon($os['id_os'], false, true);
|
||||
if ($is_management_allowed === true) {
|
||||
if (is_metaconsole() === true) {
|
||||
$osNameUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os'];
|
||||
|
@ -147,17 +146,41 @@ foreach ($osList as $os) {
|
|||
$table->data[] = $data;
|
||||
}
|
||||
|
||||
$tablePagination = '';
|
||||
if (isset($data) === true) {
|
||||
html_print_table($table);
|
||||
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$tablePagination = ui_pagination(
|
||||
$count_osList,
|
||||
ui_get_url_refresh(['message' => false]),
|
||||
$offset,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false,
|
||||
''
|
||||
);
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
|
||||
}
|
||||
|
||||
$buttons = '';
|
||||
if (is_metaconsole() === true) {
|
||||
echo '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
|
||||
echo "<div style='text-align:right;width:".$table->width."'>";
|
||||
html_print_submit_button(__('Create OS'), '', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
$buttons .= '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Create OS'),
|
||||
'',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
$buttons .= '</form>';
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
$buttons,
|
||||
[
|
||||
'type' => 'data_table',
|
||||
'class' => 'fixed_action_buttons',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -154,6 +154,20 @@ if (check_acl($config['id_user'], 0, 'AW')) {
|
|||
).'</a>',
|
||||
];
|
||||
}
|
||||
|
||||
if ($config['activate_sflow']) {
|
||||
$buttons['sflow'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=sflow').'">'.html_print_image(
|
||||
'images/op_recon.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Sflow'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$buttons['integria'] = [
|
||||
|
@ -277,6 +291,12 @@ switch ($section) {
|
|||
$help_header = 'setup_netflow_tab';
|
||||
break;
|
||||
|
||||
case 'sflow':
|
||||
$buttons['sflow']['active'] = true;
|
||||
$subpage = __('Sflow');
|
||||
$help_header = 'setup_flow_tab';
|
||||
break;
|
||||
|
||||
case 'ehorus':
|
||||
$buttons['ehorus']['active'] = true;
|
||||
$subpage = __('eHorus');
|
||||
|
@ -410,6 +430,10 @@ switch ($section) {
|
|||
include_once $config['homedir'].'/godmode/setup/setup_netflow.php';
|
||||
break;
|
||||
|
||||
case 'sflow':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_sflow.php';
|
||||
break;
|
||||
|
||||
case 'vis':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_visuals.php';
|
||||
break;
|
||||
|
|
|
@ -43,7 +43,7 @@ if (is_ajax() === true) {
|
|||
$table = new StdClass();
|
||||
$table->data = [];
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters table_result_auth';
|
||||
$table->class = 'databox filters table_result_auth filter-table-adv';
|
||||
$table->size['name'] = '30%';
|
||||
$table->style['name'] = 'font-weight: bold';
|
||||
|
||||
|
@ -94,7 +94,11 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w400px'
|
||||
);
|
||||
$table->data['ldap_server'] = $row;
|
||||
|
||||
|
@ -107,7 +111,11 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
10,
|
||||
100,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w400px'
|
||||
);
|
||||
$table->data['ldap_port'] = $row;
|
||||
|
||||
|
@ -126,7 +134,10 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w400px'
|
||||
);
|
||||
$table->data['ldap_version'] = $row;
|
||||
|
||||
|
@ -189,12 +200,12 @@ if (is_ajax() === true) {
|
|||
$alt = '',
|
||||
60,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$row['control'] .= ui_print_reveal_password(
|
||||
'ldap_admin_pass',
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w400px-important'
|
||||
);
|
||||
|
||||
$table->data['ldap_admin_pass'] = $row;
|
||||
|
||||
// Ldapsearch timeout.
|
||||
|
@ -208,7 +219,11 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w400px'
|
||||
);
|
||||
$table->data['ldap_search_timeout'] = $row;
|
||||
|
||||
|
@ -239,7 +254,11 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w400px'
|
||||
);
|
||||
$table->data['ldap_server_secondary'] = $row;
|
||||
|
||||
|
@ -252,7 +271,11 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
10,
|
||||
100,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w400px'
|
||||
);
|
||||
$table->data['ldap_port_secondary'] = $row;
|
||||
|
||||
|
@ -271,7 +294,10 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w400px'
|
||||
);
|
||||
$table->data['ldap_version_secondary'] = $row;
|
||||
|
||||
|
@ -334,11 +360,10 @@ if (is_ajax() === true) {
|
|||
$alt = '',
|
||||
60,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$row['control'] .= ui_print_reveal_password(
|
||||
'ldap_admin_pass_secondary',
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w400px-important'
|
||||
);
|
||||
$table->data['ldap_admin_pass_secondary'] = $row;
|
||||
break;
|
||||
|
@ -407,7 +432,11 @@ if (is_ajax() === true) {
|
|||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w400px'
|
||||
);
|
||||
$table->data['session_timeout'] = $row;
|
||||
|
||||
|
@ -421,7 +450,7 @@ require_once $config['homedir'].'/include/functions_profile.php';
|
|||
$table = new StdClass();
|
||||
$table->data = [];
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->size['name'] = '30%';
|
||||
$table->style['name'] = 'font-weight: bold';
|
||||
|
||||
|
@ -459,12 +488,15 @@ $row['control'] = html_print_select(
|
|||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w400px'
|
||||
);
|
||||
$table->data['auth'] = $row;
|
||||
|
||||
// Form.
|
||||
echo '<form id="form_setup" method="post">';
|
||||
echo '<form id="form_setup" class="max_floating_element_size" method="post">';
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
@ -478,17 +510,14 @@ html_print_csrf_hidden();
|
|||
|
||||
html_print_table($table);
|
||||
html_print_div([ 'id' => 'table_auth_result' ]);
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons w100p',
|
||||
'content' => html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
),
|
||||
]
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
|
|
@ -74,82 +74,98 @@ $table_remote->data = [];
|
|||
$table_remote->width = '100%';
|
||||
$table_remote->styleTable = 'margin-bottom: 10px;';
|
||||
$table_remote->id = 'ehorus-remote-setup';
|
||||
$table_remote->class = 'databox filters';
|
||||
$table_remote->size['name'] = '30%';
|
||||
$table_remote->style['name'] = 'font-weight: bold';
|
||||
$table_remote->style['control'] = 'display: flex;align-items: center;';
|
||||
$table_remote->class = 'databox filters filter-table-adv';
|
||||
$table_remote->size['ehorus_hostname'] = '50%';
|
||||
$table_remote->size['ehorus_port'] = '50%';
|
||||
|
||||
// Enable eHorus user configuration.
|
||||
$row = [];
|
||||
$row['name'] = ('eHorus configuration at user level');
|
||||
$row['control'] = html_print_checkbox_switch('ehorus_user_level_conf', 1, $config['ehorus_user_level_conf'], true);
|
||||
$row['ehorus_user_level_conf'] = html_print_label_input_block(
|
||||
__('eHorus configuration at user level'),
|
||||
html_print_checkbox_switch(
|
||||
'ehorus_user_level_conf',
|
||||
1,
|
||||
$config['ehorus_user_level_conf'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$table_remote->data['ehorus_user_level_conf'] = $row;
|
||||
|
||||
// User.
|
||||
$row = [];
|
||||
$row['name'] = __('User');
|
||||
$row['control'] = html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true);
|
||||
$table_remote->data['ehorus_user'] = $row;
|
||||
$row['ehorus_user'] = html_print_label_input_block(
|
||||
__('User'),
|
||||
html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true),
|
||||
['div_class' => 'ehorus-remote-setup-ehorus_user']
|
||||
);
|
||||
|
||||
// Pass.
|
||||
$row = [];
|
||||
$row['name'] = __('Password');
|
||||
$row['control'] = html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true);
|
||||
$row['control'] .= ui_print_reveal_password('ehorus_pass', true);
|
||||
$row['ehorus_pass'] = html_print_label_input_block(
|
||||
__('Password'),
|
||||
html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true),
|
||||
['div_class' => 'ehorus-remote-setup-ehorus_user']
|
||||
);
|
||||
$table_remote->data['ehorus_pass'] = $row;
|
||||
|
||||
// Directory hostname.
|
||||
$row = [];
|
||||
$row['name'] = __('API Hostname');
|
||||
$row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true);
|
||||
$table_remote->data['ehorus_hostname'] = $row;
|
||||
$row['ehorus_hostname'] = html_print_label_input_block(
|
||||
__('API Hostname'),
|
||||
html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true)
|
||||
);
|
||||
|
||||
// Directory port.
|
||||
$row = [];
|
||||
$row['name'] = __('API Port');
|
||||
$row['control'] = html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true);
|
||||
$row['ehorus_port'] = html_print_label_input_block(
|
||||
__('API Port'),
|
||||
html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true)
|
||||
);
|
||||
$table_remote->data['ehorus_port'] = $row;
|
||||
|
||||
// Request timeout.
|
||||
$row = [];
|
||||
$row['name'] = __('Request timeout');
|
||||
$row['control'] = html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true);
|
||||
$row['ehorus_req_timeout'] = html_print_label_input_block(
|
||||
__('Request timeout'),
|
||||
html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true)
|
||||
);
|
||||
$table_remote->data['ehorus_req_timeout'] = $row;
|
||||
|
||||
// Test.
|
||||
$row = [];
|
||||
$row['name'] = __('Test');
|
||||
$row['control'] = html_print_button(
|
||||
__('Start'),
|
||||
'test-ehorus',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
$test_start = '<span id="test-ehorus-spinner" class="invisible"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$test_start .= '<span id="test-ehorus-success" class="invisible"> '.html_print_image('images/status_sets/default/severity_normal.png', true).'</span>';
|
||||
$test_start .= '<span id="test-ehorus-failure" class="invisible"> '.html_print_image('images/status_sets/default/severity_critical.png', true).'</span>';
|
||||
$test_start .= ' <span id="test-ehorus-message" class="invisible"></span>';
|
||||
$row['ehorus_test'] = html_print_label_input_block(
|
||||
__('Test'),
|
||||
html_print_button(
|
||||
__('Start'),
|
||||
'test-ehorus',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
'style' => 'width: 115px;',
|
||||
],
|
||||
true
|
||||
).$test_start
|
||||
);
|
||||
$row['control'] .= '<span id="test-ehorus-spinner" class="invisible"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$row['control'] .= '<span id="test-ehorus-success" class="invisible"> '.html_print_image('images/status_sets/default/severity_normal.png', true).'</span>';
|
||||
$row['control'] .= '<span id="test-ehorus-failure" class="invisible"> '.html_print_image('images/status_sets/default/severity_critical.png', true).'</span>';
|
||||
$row['control'] .= ' <span id="test-ehorus-message" class="invisible"></span>';
|
||||
$table_remote->data['ehorus_test'] = $row;
|
||||
|
||||
// Print.
|
||||
echo '<div class="center pdd_b_20px mrgn_top_20px">';
|
||||
echo '<div class="center pdd_b_10px mrgn_btn_20px white_box max_floating_element_size">';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="http://ehorus.com">';
|
||||
if ($config['style'] === 'pandora_black' && is_metaconsole() === true) {
|
||||
html_print_image(
|
||||
'include/ehorus/images/ehorus-logo.png',
|
||||
false,
|
||||
['class' => 'w400px']
|
||||
['class' => 'w400px mrgn_top_15px']
|
||||
);
|
||||
} else {
|
||||
html_print_image(
|
||||
'include/ehorus/images/ehorus-logo-grey.png',
|
||||
false,
|
||||
['class' => 'w400px']
|
||||
['class' => 'w400px mrgn_top_15px']
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -179,7 +195,7 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) {
|
|||
ui_print_error_message($error_message);
|
||||
}
|
||||
|
||||
echo "<form method='post'>";
|
||||
echo "<form method='post' class='max_floating_element_size'>";
|
||||
// Form enable.
|
||||
echo '<div id="form_enable">';
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
@ -195,17 +211,14 @@ echo '</div>';
|
|||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons w100p',
|
||||
'content' => html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
),
|
||||
]
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
)
|
||||
);
|
||||
echo '</form>';
|
||||
|
||||
|
@ -220,8 +233,8 @@ if(!$('input:checkbox[name="ehorus_enabled"]').is(':checked'))
|
|||
|
||||
if($('input:checkbox[name="ehorus_user_level_conf"]').is(':checked'))
|
||||
{
|
||||
$('#ehorus-remote-setup-ehorus_user').hide();
|
||||
$('#ehorus-remote-setup-ehorus_pass').hide()
|
||||
$('.ehorus-remote-setup-ehorus_user').hide();
|
||||
$('.ehorus-remote-setup-ehorus_pass').hide()
|
||||
}
|
||||
|
||||
|
||||
|
@ -234,13 +247,13 @@ if($('input:checkbox[name="ehorus_user_level_conf"]').is(':checked'))
|
|||
}
|
||||
|
||||
var hideUserPass = function () {
|
||||
$('#ehorus-remote-setup-ehorus_user').hide();
|
||||
$('#ehorus-remote-setup-ehorus_pass').hide();
|
||||
$('.ehorus-remote-setup-ehorus_user').hide();
|
||||
$('.ehorus-remote-setup-ehorus_pass').hide();
|
||||
}
|
||||
|
||||
var showUserPass = function () {
|
||||
$('#ehorus-remote-setup-ehorus_user').show();
|
||||
$('#ehorus-remote-setup-ehorus_pass').show();
|
||||
$('.ehorus-remote-setup-ehorus_user').show();
|
||||
$('.ehorus-remote-setup-ehorus_pass').show();
|
||||
}
|
||||
|
||||
var handleEnable = function (event) {
|
||||
|
|
|
@ -403,6 +403,32 @@ $table->data[$i++][] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
|
||||
$table->data[$i][] = html_print_label_input_block(
|
||||
__('Enable Sflow'),
|
||||
html_print_checkbox_switch_extended(
|
||||
'activate_sflow',
|
||||
1,
|
||||
$config['activate_sflow'],
|
||||
$rbt_disabled,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
),
|
||||
);
|
||||
|
||||
$table->data[$i++][] = html_print_label_input_block(
|
||||
__('General network path'),
|
||||
html_print_input_text(
|
||||
'general_network_path',
|
||||
$config['general_network_path'],
|
||||
'',
|
||||
40,
|
||||
255,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->colspan[$i][] = 2;
|
||||
$table->data[$i++][] = html_print_label_input_block(
|
||||
__('Timezone setup'),
|
||||
|
|
|
@ -269,52 +269,102 @@ $table_remote->data = [];
|
|||
$table_remote->width = '100%';
|
||||
$table_remote->styleTable = 'margin-bottom: 10px;';
|
||||
$table_remote->id = 'integria-remote-setup';
|
||||
$table_remote->class = 'databox filters';
|
||||
$table_remote->size['name'] = '30%';
|
||||
$table_remote->style['name'] = 'font-weight: bold';
|
||||
$table_remote->style['control'] = 'display: flex;align-items: center;';
|
||||
$table_remote->class = 'databox filters filter-table-adv';
|
||||
$table_remote->size['hostname'] = '50%';
|
||||
$table_remote->size['api_pass'] = '50%';
|
||||
|
||||
// Enable eHorus user configuration.
|
||||
// Enable Integria user configuration.
|
||||
$row = [];
|
||||
$row['name'] = ('Integria configuration at user level');
|
||||
$row['control'] = html_print_checkbox_switch('integria_user_level_conf', 1, $config['integria_user_level_conf'], true);
|
||||
$row['user_level'] = html_print_label_input_block(
|
||||
__('Integria configuration at user level'),
|
||||
html_print_checkbox_switch(
|
||||
'integria_user_level_conf',
|
||||
1,
|
||||
$config['integria_user_level_conf'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$table_remote->data['integria_user_level_conf'] = $row;
|
||||
|
||||
// Integria user.
|
||||
$row = [];
|
||||
$row['name'] = __('User');
|
||||
$row['control'] = html_print_input_text('integria_user', $config['integria_user'], '', 30, 100, true);
|
||||
$table_remote->data['integria_user'] = $row;
|
||||
$row['user'] = html_print_label_input_block(
|
||||
__('User'),
|
||||
html_print_input_text(
|
||||
'integria_user',
|
||||
$config['integria_user'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_user']
|
||||
);
|
||||
|
||||
// Integria password.
|
||||
$row = [];
|
||||
$row['name'] = __('Password');
|
||||
$row['control'] = html_print_input_password('integria_pass', io_output_password($config['integria_pass']), '', 30, 100, true);
|
||||
$row['control'] .= ui_print_reveal_password('integria_pass', true);
|
||||
$row['password'] = html_print_label_input_block(
|
||||
__('Password'),
|
||||
html_print_input_password(
|
||||
'integria_pass',
|
||||
io_output_password($config['integria_pass']),
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_pass']
|
||||
);
|
||||
$table_remote->data['integria_pass'] = $row;
|
||||
|
||||
// Integria hostname.
|
||||
$row = [];
|
||||
$row['name'] = __('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true);
|
||||
$row['control'] = html_print_input_text('integria_hostname', $config['integria_hostname'], '', 30, 100, true);
|
||||
$table_remote->data['integria_hostname'] = $row;
|
||||
$row['hostname'] = html_print_label_input_block(
|
||||
__('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true),
|
||||
html_print_input_text(
|
||||
'integria_hostname',
|
||||
$config['integria_hostname'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_hostname']
|
||||
);
|
||||
|
||||
// API password.
|
||||
$row = [];
|
||||
$row['name'] = __('API Password');
|
||||
$row['control'] = html_print_input_password('integria_api_pass', io_output_password($config['integria_api_pass']), '', 30, 100, true);
|
||||
$row['control'] .= ui_print_reveal_password('integria_api_pass', true);
|
||||
$row['api_pass'] = html_print_label_input_block(
|
||||
__('API Password'),
|
||||
html_print_input_password(
|
||||
'integria_api_pass',
|
||||
io_output_password($config['integria_api_pass']),
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_api_pass']
|
||||
);
|
||||
$table_remote->data['integria_api_pass'] = $row;
|
||||
|
||||
// Request timeout.
|
||||
$row = [];
|
||||
$row['name'] = __('Request timeout');
|
||||
$row['control'] = html_print_input_text('integria_req_timeout', $config['integria_req_timeout'], '', 3, 10, true);
|
||||
$row['req_timeout'] = html_print_label_input_block(
|
||||
__('Request timeout'),
|
||||
html_print_input_text(
|
||||
'integria_req_timeout',
|
||||
$config['integria_req_timeout'],
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_req_timeout']
|
||||
);
|
||||
$table_remote->data['integria_req_timeout'] = $row;
|
||||
|
||||
$row = [];
|
||||
$row['name'] = __('Inventory');
|
||||
$row['control'] = html_print_button(
|
||||
$row['control'] = __('Inventory');
|
||||
$row['control'] .= html_print_button(
|
||||
__('Sync inventory'),
|
||||
'sync-inventory',
|
||||
false,
|
||||
|
@ -336,120 +386,132 @@ $table_alert_settings->data = [];
|
|||
$table_alert_settings->width = '100%';
|
||||
$table_alert_settings->styleTable = 'margin-bottom: 10px;';
|
||||
$table_alert_settings->id = 'integria-cr-settings-setup';
|
||||
$table_alert_settings->class = 'databox filters';
|
||||
$table_alert_settings->size['name'] = '30%';
|
||||
$table_alert_settings->style['name'] = 'font-weight: bold';
|
||||
$table_alert_settings->class = 'databox filters filter-table-adv';
|
||||
$table_alert_settings->size[0] = '50%';
|
||||
$table_alert_settings->size[1] = '50%';
|
||||
|
||||
// Alert incident title.
|
||||
$row = [];
|
||||
$row['name'] = __('Title');
|
||||
$row['control'] = html_print_input_text(
|
||||
'incident_title',
|
||||
$config['incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Title'),
|
||||
html_print_input_text(
|
||||
'incident_title',
|
||||
$config['incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data['custom_response_incident_title'] = $row;
|
||||
|
||||
// Alert incident description.
|
||||
$row = [];
|
||||
$row['name'] = __('Ticket body');
|
||||
$row['control'] = html_print_textarea(
|
||||
'incident_content',
|
||||
7,
|
||||
25,
|
||||
$config['incident_content'],
|
||||
'',
|
||||
true
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Ticket body'),
|
||||
html_print_textarea(
|
||||
'incident_content',
|
||||
3,
|
||||
25,
|
||||
$config['incident_content'],
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data['custom_response_incident_content'] = $row;
|
||||
$table_alert_settings->data[0] = $row;
|
||||
|
||||
// Alert default group.
|
||||
$row = [];
|
||||
$row['name'] = __('Group');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_group_values,
|
||||
'default_group',
|
||||
$config['default_group'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$integria_group_values,
|
||||
'default_group',
|
||||
$config['default_group'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data['custom_response_def_group'] = $row;
|
||||
|
||||
// Alert default criticity.
|
||||
$row = [];
|
||||
$row['name'] = __('Priority');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_criticity_values,
|
||||
'default_criticity',
|
||||
$config['default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$integria_criticity_values,
|
||||
'default_criticity',
|
||||
$config['default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data['custom_response_def_criticity'] = $row;
|
||||
$table_alert_settings->data[1] = $row;
|
||||
|
||||
// Alert default owner.
|
||||
$row = [];
|
||||
$row['name'] = __('Owner');
|
||||
$row['control'] = html_print_autocomplete_users_from_integria(
|
||||
'default_owner',
|
||||
$config['default_owner'],
|
||||
true
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_integria(
|
||||
'default_owner',
|
||||
$config['default_owner'],
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
$table_alert_settings->data['custom_response_def_owner'] = $row;
|
||||
|
||||
// Alert default incident type.
|
||||
$row = [];
|
||||
$row['name'] = __('Type');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_types_values,
|
||||
'incident_type',
|
||||
$config['incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$integria_types_values,
|
||||
'incident_type',
|
||||
$config['incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data['custom_response_incident_type'] = $row;
|
||||
$table_alert_settings->data[2] = $row;
|
||||
|
||||
// Alert default incident status.
|
||||
$row = [];
|
||||
$row['name'] = __('Status');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_status_values,
|
||||
'incident_status',
|
||||
$config['incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$integria_status_values,
|
||||
'incident_status',
|
||||
$config['incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data['custom_response_incident_status'] = $row;
|
||||
$table_alert_settings->data[3] = $row;
|
||||
|
||||
// Custom response settings.
|
||||
$table_cr_settings = new StdClass();
|
||||
|
@ -457,126 +519,138 @@ $table_cr_settings->data = [];
|
|||
$table_cr_settings->width = '100%';
|
||||
$table_cr_settings->styleTable = 'margin-bottom: 10px;';
|
||||
$table_cr_settings->id = 'integria-cr-settings-setup';
|
||||
$table_cr_settings->class = 'databox filters';
|
||||
$table_cr_settings->size['name'] = '30%';
|
||||
$table_cr_settings->style['name'] = 'font-weight: bold';
|
||||
$table_cr_settings->class = 'databox filters filter-table-adv';
|
||||
$table_cr_settings->size[0] = '50%';
|
||||
$table_cr_settings->size[1] = '50%';
|
||||
|
||||
// Custom response incident title.
|
||||
$row = [];
|
||||
$row['name'] = __('Title');
|
||||
$row['control'] = html_print_input_text(
|
||||
'cr_incident_title',
|
||||
$config['cr_incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Title'),
|
||||
html_print_input_text(
|
||||
'cr_incident_title',
|
||||
$config['cr_incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data['custom_response_incident_title'] = $row;
|
||||
|
||||
// Custom response incident description.
|
||||
$row = [];
|
||||
$row['name'] = __('Ticket body');
|
||||
$row['control'] = html_print_textarea(
|
||||
'cr_incident_content',
|
||||
7,
|
||||
25,
|
||||
$config['cr_incident_content'],
|
||||
'',
|
||||
true
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Ticket body'),
|
||||
html_print_textarea(
|
||||
'cr_incident_content',
|
||||
3,
|
||||
25,
|
||||
$config['cr_incident_content'],
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table_cr_settings->data['custom_response_incident_content'] = $row;
|
||||
$table_cr_settings->data[0] = $row;
|
||||
|
||||
// Custom response default group.
|
||||
$row = [];
|
||||
$row['name'] = __('Group');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_group_values,
|
||||
'cr_default_group',
|
||||
$config['cr_default_group'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$integria_group_values,
|
||||
'cr_default_group',
|
||||
$config['cr_default_group'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data['custom_response_def_group'] = $row;
|
||||
|
||||
// Custom response default criticity.
|
||||
$row = [];
|
||||
$row['name'] = __('Priority');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_criticity_values,
|
||||
'cr_default_criticity',
|
||||
$config['cr_default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$integria_criticity_values,
|
||||
'cr_default_criticity',
|
||||
$config['cr_default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data['custom_response_def_criticity'] = $row;
|
||||
$table_cr_settings->data[1] = $row;
|
||||
|
||||
// Custom response default owner.
|
||||
$row = [];
|
||||
$row['name'] = __('Owner');
|
||||
$row['control'] = html_print_autocomplete_users_from_integria(
|
||||
'cr_default_owner',
|
||||
$config['cr_default_owner'],
|
||||
true
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_integria(
|
||||
'cr_default_owner',
|
||||
$config['cr_default_owner'],
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
$table_cr_settings->data['custom_response_def_owner'] = $row;
|
||||
|
||||
// Custom response default incident type.
|
||||
$row = [];
|
||||
$row['name'] = __('Type');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_types_values,
|
||||
'cr_incident_type',
|
||||
$config['cr_incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$integria_types_values,
|
||||
'cr_incident_type',
|
||||
$config['cr_incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data['custom_response_incident_type'] = $row;
|
||||
$table_cr_settings->data[2] = $row;
|
||||
|
||||
// Custom response default incident status.
|
||||
$row = [];
|
||||
$row['name'] = __('Status');
|
||||
$row['control'] = html_print_select(
|
||||
$integria_status_values,
|
||||
'cr_incident_status',
|
||||
$config['cr_incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$integria_status_values,
|
||||
'cr_incident_status',
|
||||
$config['cr_incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data['custom_response_incident_status'] = $row;
|
||||
$table_cr_settings->data[3] = $row;
|
||||
|
||||
// Test.
|
||||
$row = [];
|
||||
$row['name'] = __('Test');
|
||||
$row['control'] = html_print_button(
|
||||
$row['control'] = __('Test');
|
||||
$row['control'] .= html_print_button(
|
||||
__('Start'),
|
||||
'test-integria',
|
||||
false,
|
||||
|
@ -594,12 +668,12 @@ $row['control'] .= ' <span id="test-integria-message" class="invisible"></s
|
|||
$table_remote->data['integria_test'] = $row;
|
||||
|
||||
// Print.
|
||||
echo '<div class="center pdd_b_20px mrgn_top_20px">';
|
||||
echo '<div class="center pdd_b_10px mrgn_btn_20px white_box max_floating_element_size">';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="http://integriaims.com">';
|
||||
html_print_image(
|
||||
'images/integria_logo.svg',
|
||||
false,
|
||||
['class' => 'w400px' ]
|
||||
['class' => 'w400px mrgn_top_15px']
|
||||
);
|
||||
echo '</a>';
|
||||
echo '<br />';
|
||||
|
@ -611,7 +685,7 @@ echo 'https://integriaims.com';
|
|||
echo '</a>';
|
||||
echo '</div>';
|
||||
|
||||
echo "<form method='post'>";
|
||||
echo "<form method='post' class='max_floating_element_size'>";
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
||||
// Form enable.
|
||||
|
@ -632,7 +706,7 @@ echo '</div>';
|
|||
if ($has_connection != false) {
|
||||
// Form alert default settings.
|
||||
echo '<div id="form_alert_settings">';
|
||||
echo '<fieldset>';
|
||||
echo '<fieldset class="mrgn_top_15px">';
|
||||
echo '<legend>'.__('Alert default values').' '.ui_print_help_icon('alert_macros', true).'</legend>';
|
||||
|
||||
html_print_table($table_alert_settings);
|
||||
|
@ -642,7 +716,7 @@ if ($has_connection != false) {
|
|||
|
||||
// Form custom response default settings.
|
||||
echo '<div id="form_custom_response_settings">';
|
||||
echo '<fieldset>';
|
||||
echo '<fieldset class="mrgn_top_15px">';
|
||||
echo '<legend>'.__('Event custom response default values').' '.ui_print_help_icon('alert_macros', true).'</legend>';
|
||||
|
||||
html_print_table($table_cr_settings);
|
||||
|
@ -650,33 +724,24 @@ if ($has_connection != false) {
|
|||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons w100p',
|
||||
'content' => html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
),
|
||||
]
|
||||
$update_button = html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons w100p',
|
||||
'content' => html_print_submit_button(
|
||||
__('Update and continue'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
),
|
||||
]
|
||||
$update_button = html_print_submit_button(
|
||||
__('Update and continue'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
html_print_action_buttons($update_button);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
|
@ -686,8 +751,8 @@ echo '</form>';
|
|||
|
||||
if($('input:checkbox[name="integria_user_level_conf"]').is(':checked'))
|
||||
{
|
||||
$('#integria-remote-setup-integria_user').hide();
|
||||
$('#integria-remote-setup-integria_pass').hide()
|
||||
$('.integria-remote-setup-integria_user').hide();
|
||||
$('.integria-remote-setup-integria_pass').hide()
|
||||
}
|
||||
|
||||
var handleUserLevel = function(event) {
|
||||
|
@ -726,13 +791,13 @@ echo '</form>';
|
|||
}
|
||||
|
||||
var hideUserPass = function () {
|
||||
$('#integria-remote-setup-integria_user').hide();
|
||||
$('#integria-remote-setup-integria_pass').hide();
|
||||
$('.integria-remote-setup-integria_user').hide();
|
||||
$('.integria-remote-setup-integria_pass').hide();
|
||||
}
|
||||
|
||||
var showUserPass = function () {
|
||||
$('#integria-remote-setup-integria_user').show();
|
||||
$('#integria-remote-setup-integria_pass').show();
|
||||
$('.integria-remote-setup-integria_user').show();
|
||||
$('.integria-remote-setup-integria_pass').show();
|
||||
}
|
||||
|
||||
var handleEnable = function (event) {
|
||||
|
|
|
@ -43,7 +43,7 @@ $table->data = [];
|
|||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Data storage path'),
|
||||
html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true)
|
||||
html_print_input_text('netflow_name_dir', $config['netflow_name_dir'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
|
@ -100,3 +100,9 @@ html_print_action_buttons(
|
|||
)
|
||||
);
|
||||
echo '</form>';
|
||||
?>
|
||||
<script>
|
||||
$("input[name=netflow_name_dir]").on("input", function() {
|
||||
$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,108 @@
|
|||
<?php
|
||||
/**
|
||||
* Setup view for sflow
|
||||
*
|
||||
* @category Setup
|
||||
* @package Pandora FMS
|
||||
* @subpackage Configuration
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
require_once 'include/functions_ui.php';
|
||||
|
||||
check_login();
|
||||
|
||||
$update = (bool) get_parameter('update');
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filter-table-adv';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Data storage path'),
|
||||
html_print_input_text('sflow_name_dir', $config['sflow_name_dir'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Daemon interval'),
|
||||
html_print_input_text('sflow_interval', $config['sflow_interval'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Daemon binary path'),
|
||||
html_print_input_text('sflow_daemon', $config['sflow_daemon'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Nfdump binary path'),
|
||||
html_print_input_text('sflow_nfdump', $config['sflow_nfdump'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$table->data[2][] = html_print_label_input_block(
|
||||
__('Nfexpire binary path'),
|
||||
html_print_input_text('sflow_nfexpire', $config['sflow_nfexpire'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$table->data[2][] = html_print_label_input_block(
|
||||
__('Maximum chart resolution'),
|
||||
html_print_input_text('sflow_max_resolution', $config['sflow_max_resolution'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$table->data[3][] = html_print_label_input_block(
|
||||
__('Disable custom live view filters'),
|
||||
html_print_checkbox_switch('sflow_disable_custom_lvfilters', 1, $config['sflow_disable_custom_lvfilters'], true)
|
||||
);
|
||||
|
||||
$table->data[3][] = html_print_label_input_block(
|
||||
__('Sflow max lifetime'),
|
||||
html_print_input_text('sflow_max_lifetime', $config['sflow_max_lifetime'], false, 50, 200, true)
|
||||
);
|
||||
|
||||
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
|
||||
$table->data[4][] = html_print_label_input_block(
|
||||
__('Name resolution for IP address'),
|
||||
html_print_checkbox_switch_extended('sflow_get_ip_hostname', 1, $config['sflow_get_ip_hostname'], false, $onclick, '', true)
|
||||
);
|
||||
|
||||
echo '<form class="max_floating_element_size" id="sflow_setup" method="post">';
|
||||
html_print_table($table);
|
||||
html_print_input_hidden('update_config', 1);
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'upd_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
)
|
||||
);
|
||||
echo '</form>';
|
||||
?>
|
||||
<script>
|
||||
$("input[name=sflow_name_dir]").on("input", function() {
|
||||
$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));
|
||||
});
|
||||
</script>
|
|
@ -50,7 +50,7 @@ try {
|
|||
[
|
||||
'id' => $tableId,
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 100%',
|
||||
'style' => 'width: 99%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'include/ajax/update_manager',
|
||||
|
@ -66,12 +66,13 @@ try {
|
|||
[
|
||||
'label' => __('Free search'),
|
||||
'type' => 'text',
|
||||
'class' => 'mw250px',
|
||||
'class' => 'w400px',
|
||||
'id' => 'free_search',
|
||||
'name' => 'free_search',
|
||||
],
|
||||
],
|
||||
],
|
||||
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar ',
|
||||
]
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
|
|
|
@ -256,133 +256,158 @@ if ((bool) is_metaconsole() === true) {
|
|||
);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="'.$action.'">';
|
||||
echo '<form method="post" action="'.$action.'" class="max_floating_element_size">';
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
||||
$i = 0;
|
||||
$table->style[$i] = 'font-weight: bolder;width:250px';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$url_update_manager = update_manager_get_url();
|
||||
|
||||
$table->data[$i][0] = __('Warp Update URL');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'url_update_manager',
|
||||
$url_update_manager,
|
||||
__('URL update manager'),
|
||||
80,
|
||||
255,
|
||||
true,
|
||||
true
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Warp Update URL'),
|
||||
html_print_input_text(
|
||||
'url_update_manager',
|
||||
$url_update_manager,
|
||||
__('URL update manager'),
|
||||
80,
|
||||
255,
|
||||
true,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Use secured Warp Update');
|
||||
$table->data[$i++][1] = html_print_input(
|
||||
[
|
||||
'type' => 'switch',
|
||||
'name' => 'secure_update_manager',
|
||||
'value' => ($secure_update_manager ?? 1),
|
||||
]
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Use secured Warp Update'),
|
||||
html_print_input(
|
||||
[
|
||||
'type' => 'switch',
|
||||
'name' => 'secure_update_manager',
|
||||
'value' => ($secure_update_manager ?? 1),
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy server');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_server',
|
||||
$update_manager_proxy_server,
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Proxy server'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
html_print_input_text(
|
||||
'update_manager_proxy_server',
|
||||
$update_manager_proxy_server,
|
||||
__('Proxy server'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy port');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_port',
|
||||
$update_manager_proxy_port,
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Proxy port'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
html_print_input_text(
|
||||
'update_manager_proxy_port',
|
||||
$update_manager_proxy_port,
|
||||
__('Proxy port'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy user');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_user',
|
||||
$update_manager_proxy_user,
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Proxy user'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
html_print_input_text(
|
||||
'update_manager_proxy_user',
|
||||
$update_manager_proxy_user,
|
||||
__('Proxy user'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy password');
|
||||
$table->data[$i++][1] = html_print_input_password(
|
||||
'update_manager_proxy_password',
|
||||
$update_manager_proxy_password,
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Proxy password'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
html_print_input_password(
|
||||
'update_manager_proxy_password',
|
||||
$update_manager_proxy_password,
|
||||
__('Proxy password'),
|
||||
80,
|
||||
60,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Allow no-consecutive patches');
|
||||
$table->data[$i++][1] = html_print_switch(
|
||||
[
|
||||
'name' => 'allow_offline_patches',
|
||||
'value' => $allow_offline_patches,
|
||||
'return' => true,
|
||||
]
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Allow no-consecutive patches'),
|
||||
html_print_switch(
|
||||
[
|
||||
'name' => 'allow_offline_patches',
|
||||
'value' => $allow_offline_patches,
|
||||
'return' => true,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Limit to LTS updates');
|
||||
$table->data[$i++][1] = html_print_switch(
|
||||
[
|
||||
'name' => 'lts_updates',
|
||||
'value' => $lts_updates,
|
||||
'return' => true,
|
||||
]
|
||||
$table->data[3][1] = html_print_label_input_block(
|
||||
__('Limit to LTS updates'),
|
||||
html_print_switch(
|
||||
[
|
||||
'name' => 'lts_updates',
|
||||
'value' => $lts_updates,
|
||||
'return' => true,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$table->data[$i][0] = __('Registration ID');
|
||||
$table->data[$i++][1] = '<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>';
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Registration ID'),
|
||||
'<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>'
|
||||
);
|
||||
|
||||
if (update_manager_verify_registration() === true && users_is_admin()) {
|
||||
$table->data[$i][0] = __('Cancel registration');
|
||||
$table->data[$i][1] = '<a href="';
|
||||
$url = '<a href="';
|
||||
if ((bool) is_metaconsole() === true) {
|
||||
$table->data[$i][1] .= ui_get_full_url(
|
||||
$url .= ui_get_full_url(
|
||||
'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup&um_disconnect_console=1'
|
||||
);
|
||||
} else {
|
||||
$table->data[$i][1] .= ui_get_full_url(
|
||||
$url .= ui_get_full_url(
|
||||
'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup&um_disconnect_console=1'
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[$i++][1] .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>';
|
||||
$url .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>';
|
||||
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Cancel registration'),
|
||||
$url
|
||||
);
|
||||
}
|
||||
|
||||
if (license_free()) {
|
||||
$config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1;
|
||||
$table->data[$i][0] = __('%s community reminder', get_product_name()).ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this %s instance', get_product_name()), true);
|
||||
$table->data[$i][1] = __('Yes').' '.html_print_radio_button('identification_reminder', 1, '', $config['identification_reminder'], true).' ';
|
||||
$table->data[$i++][1] .= __('No').' '.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true);
|
||||
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('%s community reminder', get_product_name()).ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this %s instance', get_product_name()), true),
|
||||
'<div class="inline-radio-button">
|
||||
'.__('Yes').html_print_radio_button('realtimestats', 1, '', $config['realtimestats'], true).'
|
||||
'.__('No').html_print_radio_button('realtimestats', 0, '', $config['realtimestats'], true).'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
html_print_input_hidden('action_update_url_update_manager', 1);
|
||||
html_print_input_hidden('update_config', 1);
|
||||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
)
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
|
|
@ -393,6 +393,7 @@ if ($create_user === true) {
|
|||
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
|
||||
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
|
||||
$values['time_autorefresh'] = (int) get_parameter('time_autorefresh', 0);
|
||||
$values['show_tips_startup'] = (int) get_parameter_switch('show_tips_startup');
|
||||
$dashboard = get_parameter('dashboard', '');
|
||||
$visual_console = get_parameter('visual_console', '');
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
|
@ -216,11 +216,8 @@ if ($get_double_auth_info_page) {
|
|||
$html .= '</p>';
|
||||
$html .= '</div>';
|
||||
$html .= '<br>';
|
||||
$html .= '<div class="center_align">';
|
||||
$html .= '<div class="flex flex-space-around">';
|
||||
$html .= html_print_button(__('Download the app'), 'google_authenticator_download', false, '', '', true);
|
||||
$html .= '</div>';
|
||||
$html .= '<br>';
|
||||
$html .= '<div class="center_align">';
|
||||
$html .= html_print_button(__('Continue'), 'continue_to_generate', false, '', '', true);
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -311,11 +308,11 @@ if ($get_double_auth_generation_page) {
|
|||
$html .= '<br>';
|
||||
$html .= __('QR').': <br>';
|
||||
$html .= '<div id="qr-container"></div>';
|
||||
$html .= '<br>';
|
||||
$html .= '<br><div class="flex flex-space-around">';
|
||||
$html .= html_print_button(__('Refresh code'), 'continue_to_generate', false, '', '', true);
|
||||
$html .= ' ';
|
||||
$html .= html_print_button(__('Continue'), 'continue_to_validate', false, '', '', true);
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
ob_clean();
|
||||
?>
|
||||
|
@ -453,7 +450,7 @@ if ($get_double_auth_validation_page) {
|
|||
$html .= html_print_input_text('code', '', '', 50, $secret_lenght, true);
|
||||
$html .= '<div id="code_input_message" class="red"></div>';
|
||||
$html .= '<br><br>';
|
||||
$html .= '<div id="button-container">';
|
||||
$html .= '<div id="button-container" class="flex flex-space-around">';
|
||||
$html .= html_print_button(__('Validate code'), 'continue_to_validate', false, '', '', true);
|
||||
$html .= html_print_image('images/spinner.gif', true);
|
||||
$html .= '</div>';
|
||||
|
|
|
@ -91,9 +91,8 @@ $node_id = (int) get_parameter('node_id', 0);
|
|||
|
||||
if ($get_comments === true) {
|
||||
$event = get_parameter('event', false);
|
||||
$event_rep = (int) get_parameter('event_rep', 0);
|
||||
$event_rep = get_parameter_post('event')['event_rep'];
|
||||
$group_rep = get_parameter_post('event')['group_rep'];
|
||||
$event_rep = (int) get_parameter_post('event')['event_rep'];
|
||||
$group_rep = (int) get_parameter_post('event')['group_rep'];
|
||||
|
||||
if ($event === false) {
|
||||
return __('Failed to retrieve comments');
|
||||
|
@ -126,7 +125,7 @@ if ($get_comments === true) {
|
|||
} else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) {
|
||||
$whereGrouped = sprintf(
|
||||
'`id_extra` = "%s"',
|
||||
$event['id_extra']
|
||||
io_safe_output($event['id_extra'])
|
||||
);
|
||||
} else {
|
||||
$whereGrouped = sprintf('`id_evento` = %d', $event['id_evento']);
|
||||
|
|
|
@ -1390,7 +1390,7 @@ if (check_login()) {
|
|||
false,
|
||||
'offset',
|
||||
true,
|
||||
'pagination-bottom',
|
||||
'',
|
||||
'pagination_list_modules(offset_param)',
|
||||
[
|
||||
'count' => '',
|
||||
|
@ -1692,6 +1692,18 @@ if (check_login()) {
|
|||
$where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND ';
|
||||
}
|
||||
|
||||
if (str_contains($status, '6') === true) {
|
||||
$expl = explode(',', $status);
|
||||
$exist = array_search('6', $expl);
|
||||
if (isset($exist) === true) {
|
||||
unset($expl[$exist]);
|
||||
}
|
||||
|
||||
array_push($expl, '1', '2');
|
||||
|
||||
$status = implode(',', $expl);
|
||||
}
|
||||
|
||||
$where .= sprintf(
|
||||
'tagente_estado.estado IN (%s)
|
||||
AND tagente_modulo.delete_pending = 0',
|
||||
|
|
|
@ -234,7 +234,7 @@ class ExternalTools extends HTML
|
|||
'images/change-active.svg',
|
||||
true,
|
||||
[
|
||||
'id' => 'button_sound_warning',
|
||||
'id' => 'button_sound_alert',
|
||||
'style' => 'vertical-align: middle; margin-left: 10px',
|
||||
'width' => '16',
|
||||
'title' => __('Play sound'),
|
||||
|
@ -269,7 +269,7 @@ class ExternalTools extends HTML
|
|||
'images/change-active.svg',
|
||||
true,
|
||||
[
|
||||
'id' => 'button_sound_warning',
|
||||
'id' => 'button_sound_critical',
|
||||
'style' => 'vertical-align: middle; margin-left: 10px',
|
||||
'width' => '16',
|
||||
'title' => __('Play sound'),
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230322';
|
||||
$build_version = 'PC230324';
|
||||
$pandora_version = 'v7.0NG.769';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -153,6 +153,19 @@ if (! defined('ENTERPRISE_DIR')) {
|
|||
}
|
||||
|
||||
db_select_engine();
|
||||
|
||||
if (empty($config['remote_config']) === false
|
||||
&& file_exists($config['remote_config'].'/conf/'.PANDORA_HA_FILE)
|
||||
&& filesize($config['remote_config'].'/conf/'.PANDORA_HA_FILE) > 0
|
||||
) {
|
||||
$data = file_get_contents($config['remote_config'].'/conf/'.PANDORA_HA_FILE);
|
||||
if (empty($data) === false) {
|
||||
$ip_list = explode(',', $data);
|
||||
// Connects to the first pandora_ha_dbs.conf database.
|
||||
$config['dbhost'] = trim($ip_list[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$config['dbconnection'] = db_connect();
|
||||
|
||||
require_once $ownDir.'functions_config.php';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Constants definitions.
|
||||
*
|
||||
|
@ -703,6 +704,11 @@ define('HA_ACTION_ENABLE', 6);
|
|||
define('HA_ACTION_CLEANUP', 7);
|
||||
define('HA_ACTION_RESYNC', 8);
|
||||
|
||||
define('HA_RESYNC', 1);
|
||||
define('HA_DISABLE', 5);
|
||||
define('HA_ENABLE', 6);
|
||||
|
||||
|
||||
define('HA_UNINITIALIZED', 0);
|
||||
define('HA_ONLINE', 1);
|
||||
define('HA_PENDING', 2);
|
||||
|
@ -864,6 +870,8 @@ define(
|
|||
|
||||
// Pandora FMS Enterprise license.
|
||||
define('LICENSE_FILE', 'customer_key');
|
||||
// Pandora HA database list.
|
||||
define('PANDORA_HA_FILE', 'pandora_ha_hosts.conf');
|
||||
|
||||
// Home screen values for user definition.
|
||||
define('HOME_SCREEN_DEFAULT', 'default');
|
||||
|
|
|
@ -260,6 +260,24 @@ function config_update_config()
|
|||
$error_update[] = __('Enable Netflow');
|
||||
}
|
||||
|
||||
if (config_update_value('activate_sflow', (bool) get_parameter('activate_sflow'), true) === false) {
|
||||
$error_update[] = __('Enable Sflow');
|
||||
}
|
||||
|
||||
if (config_update_value('general_network_path', get_parameter('general_network_path'), true) === false) {
|
||||
$error_update[] = __('General network path');
|
||||
} else {
|
||||
if (empty($config['netflow_name_dir']) === false && $config['netflow_name_dir'] !== '') {
|
||||
$path = get_parameter('general_network_path');
|
||||
config_update_value('netflow_path', $path.$config['netflow_name_dir']);
|
||||
}
|
||||
|
||||
if (empty($config['sflow_name_dir']) === false && $config['sflow_name_dir'] !== '') {
|
||||
$path = get_parameter('general_network_path');
|
||||
config_update_value('sflow_path', $path.$config['sflow_name_dir']);
|
||||
}
|
||||
}
|
||||
|
||||
$timezone = (string) get_parameter('timezone');
|
||||
if (empty($timezone) === true || config_update_value('timezone', $timezone, true) === false) {
|
||||
$error_update[] = __('Timezone setup');
|
||||
|
@ -456,6 +474,10 @@ function config_update_config()
|
|||
$error_update[] = __('Enable Update Manager');
|
||||
}
|
||||
|
||||
if (config_update_value('legacy_database_ha', get_parameter('legacy_database_ha'), true) === false) {
|
||||
$error_update[] = __('Legacy database HA');
|
||||
}
|
||||
|
||||
if (config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'), true) === false) {
|
||||
$error_update[] = __('Ipam Ocuppied Manager Critical');
|
||||
}
|
||||
|
@ -1501,8 +1523,13 @@ function config_update_config()
|
|||
break;
|
||||
|
||||
case 'net':
|
||||
if (config_update_value('netflow_path', get_parameter('netflow_path'), true) === false) {
|
||||
$error_update[] = __('Data storage path');
|
||||
if (config_update_value('netflow_name_dir', get_parameter('netflow_name_dir'), true) === false) {
|
||||
$error_update[] = __('Name storage path');
|
||||
} else {
|
||||
if (empty($config['general_network_path']) === false && $config['general_network_path'] !== '') {
|
||||
$name = get_parameter('netflow_name_dir');
|
||||
config_update_value('netflow_path', $config['general_network_path'].$name);
|
||||
}
|
||||
}
|
||||
|
||||
if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) {
|
||||
|
@ -1538,6 +1565,49 @@ function config_update_config()
|
|||
}
|
||||
break;
|
||||
|
||||
case 'sflow':
|
||||
if (config_update_value('sflow_name_dir', get_parameter('sflow_name_dir'), true) === false) {
|
||||
$error_update[] = __('Sflow name dir');
|
||||
} else {
|
||||
if (empty($config['general_network_path']) === false && $config['general_network_path'] !== '') {
|
||||
$name = get_parameter('sflow_name_dir');
|
||||
config_update_value('sflow_path', $config['general_network_path'].$name);
|
||||
}
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_interval', (int) get_parameter('sflow_interval'), true) === false) {
|
||||
$error_update[] = __('Daemon interval');
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_daemon', get_parameter('sflow_daemon'), true) === false) {
|
||||
$error_update[] = __('Daemon binary path');
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_nfdump', get_parameter('sflow_nfdump'), true) === false) {
|
||||
$error_update[] = __('Nfdump binary path');
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_nfexpire', get_parameter('sflow_nfexpire'), true) === false) {
|
||||
$error_update[] = __('Nfexpire binary path');
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_max_resolution', (int) get_parameter('sflow_max_resolution'), true) === false) {
|
||||
$error_update[] = __('Maximum chart resolution');
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_disable_custom_lvfilters', get_parameter('sflow_disable_custom_lvfilters'), true) === false) {
|
||||
$error_update[] = __('Disable custom live view filters');
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_max_lifetime', (int) get_parameter('sflow_max_lifetime'), true) === false) {
|
||||
$error_update[] = __('Sflow max lifetime');
|
||||
}
|
||||
|
||||
if (config_update_value('sflow_get_ip_hostname', (int) get_parameter('sflow_get_ip_hostname'), true) === false) {
|
||||
$error_update[] = __('Name resolution for IP address');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'log':
|
||||
if (config_update_value('elasticsearch_ip', get_parameter('elasticsearch_ip'), true) === false) {
|
||||
$error_update[] = __('IP ElasticSearch server');
|
||||
|
@ -2237,6 +2307,10 @@ function config_process_config()
|
|||
config_update_value('enable_update_manager', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['legacy_database_ha'])) {
|
||||
config_update_value('legacy_database_ha', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['disabled_newsletter'])) {
|
||||
config_update_value('disabled_newsletter', 0);
|
||||
}
|
||||
|
@ -2557,7 +2631,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['custom_logo_login'])) {
|
||||
config_update_value('custom_logo_login', 'login_logo_v7.png');
|
||||
config_update_value('custom_logo_login', 'Pandora-FMS-1.png');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_splash_login'])) {
|
||||
|
@ -2597,7 +2671,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['custom_title1_login'])) {
|
||||
config_update_value('custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL'));
|
||||
config_update_value('custom_title1_login', __('ONE TOOL TO RULE THEM ALL'));
|
||||
}
|
||||
|
||||
if (!isset($config['custom_title2_login'])) {
|
||||
|
@ -2621,7 +2695,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['background_opacity'])) {
|
||||
config_update_value('background_opacity', 30);
|
||||
config_update_value('background_opacity', 20);
|
||||
}
|
||||
|
||||
if (!isset($config['meta_background_opacity'])) {
|
||||
|
@ -2641,7 +2715,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['meta_custom_logo_login'])) {
|
||||
config_update_value('meta_custom_logo_login', 'pandora_logo.png');
|
||||
config_update_value('meta_custom_logo_login', 'Pandora-FMS-1.png');
|
||||
}
|
||||
|
||||
if (!isset($config['meta_custom_splash_login'])) {
|
||||
|
@ -2649,7 +2723,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['meta_custom_title1_login'])) {
|
||||
config_update_value('meta_custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL'));
|
||||
config_update_value('meta_custom_title1_login', __('ONE TOOL TO RULE THEM ALL'));
|
||||
}
|
||||
|
||||
if (!isset($config['meta_custom_title2_login'])) {
|
||||
|
@ -2768,6 +2842,28 @@ function config_process_config()
|
|||
config_update_value('activate_netflow', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['activate_sflow'])) {
|
||||
config_update_value('activate_sflow', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['general_network_path'])) {
|
||||
if ($is_windows) {
|
||||
$default = 'C:\PandoraFMS\Pandora_Server\data_in\\';
|
||||
} else {
|
||||
$default = '/var/spool/pandora/data_in/';
|
||||
}
|
||||
|
||||
config_update_value('general_network_path', $default);
|
||||
}
|
||||
|
||||
if (!isset($config['netflow_name_dir'])) {
|
||||
config_update_value('netflow_name_dir', 'netflow');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_name_dir'])) {
|
||||
config_update_value('sflow_name_dir', 'sflow');
|
||||
}
|
||||
|
||||
if (!isset($config['netflow_path'])) {
|
||||
if ($is_windows) {
|
||||
$default = 'C:\PandoraFMS\Pandora_Server\data_in\netflow';
|
||||
|
@ -2806,6 +2902,48 @@ function config_process_config()
|
|||
config_update_value('netflow_max_lifetime', '5');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_interval'])) {
|
||||
config_update_value('sflow_interval', SECONDS_10MINUTES);
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_daemon'])) {
|
||||
config_update_value('sflow_daemon', '/usr/bin/sfcapd');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_nfdump'])) {
|
||||
config_update_value('sflow_nfdump', '/usr/bin/nfdump');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_nfexpire'])) {
|
||||
config_update_value('sflow_nfexpire', '/usr/bin/nfexpire');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_max_resolution'])) {
|
||||
config_update_value('sflow_max_resolution', '50');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_disable_custom_lvfilters'])) {
|
||||
config_update_value('sflow_disable_custom_lvfilters', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_max_lifetime'])) {
|
||||
config_update_value('sflow_max_lifetime', '5');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_name_dir'])) {
|
||||
config_update_value('sflow_name_dir', 'sflow');
|
||||
}
|
||||
|
||||
if (!isset($config['sflow_path'])) {
|
||||
if ($is_windows) {
|
||||
$default = 'C:\PandoraFMS\Pandora_Server\data_in\sflow';
|
||||
} else {
|
||||
$default = '/var/spool/pandora/data_in/sflow';
|
||||
}
|
||||
|
||||
config_update_value('sflow_path', $default);
|
||||
}
|
||||
|
||||
if (!isset($config['auth'])) {
|
||||
config_update_value('auth', 'mysql');
|
||||
}
|
||||
|
|
|
@ -1494,7 +1494,8 @@ function events_get_all(
|
|||
break;
|
||||
|
||||
case EVENT_GROUP_REP_EXTRAIDS:
|
||||
// Group by events.
|
||||
// Group by events and ignore null.
|
||||
$sql_filters[] = 'AND te.id_extra IS NOT NULL AND te.id_extra <> ""';
|
||||
$group_by .= 'te.id_extra';
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -626,7 +626,7 @@ function filemanager_file_explorer(
|
|||
$table->width = '100%';
|
||||
$table->id = 'table_filemanager';
|
||||
|
||||
$table->class = (is_metaconsole() === true) ? 'databox_tactical' : 'info_table';
|
||||
$table->class = 'info_table';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
$table->colspan = [];
|
||||
$table->data = [];
|
||||
|
@ -751,7 +751,7 @@ function filemanager_file_explorer(
|
|||
&& ($readOnly === false)
|
||||
) {
|
||||
$data[4] .= '<form method="post" action="'.$url.'" style="">';
|
||||
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter" src="images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter main_menu_icon" src="../../images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
|
||||
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true);
|
||||
$data[4] .= html_print_input_hidden('delete_file', 1, true);
|
||||
|
@ -896,7 +896,7 @@ function filemanager_file_explorer(
|
|||
$uploadFileElements .= html_print_input_hidden('upload_file', 1, true);
|
||||
}
|
||||
|
||||
$uploadFileElements .= html_print_submit_button(__('Go'), 'go', false, [ 'class' => 'submitButton', 'style' => 'float:right', 'icon' => 'next'], true);
|
||||
$uploadFileElements .= html_print_submit_button(__('Go'), 'go', false, [ 'class' => 'submitButton', 'style' => 'float:right; margin-top: 10px;', 'icon' => 'next'], true);
|
||||
$uploadFileElements .= html_print_input_hidden('real_directory', $real_directory, true);
|
||||
$uploadFileElements .= html_print_input_hidden('directory', $relative_directory, true);
|
||||
$uploadFileElements .= html_print_input_hidden('hash', md5($real_directory.$relative_directory.$config['server_unique_identifier']), true);
|
||||
|
|
|
@ -3261,6 +3261,7 @@ function html_print_input_image($name, $src, $value, $style='', $return=false, $
|
|||
'onkeyup',
|
||||
'class',
|
||||
'form',
|
||||
'disabled',
|
||||
];
|
||||
|
||||
foreach ($attrs as $attribute) {
|
||||
|
@ -4787,13 +4788,16 @@ function html_print_input_file($name, $return=false, $options=false)
|
|||
if (isset($options['accept']) === true) {
|
||||
$output .= ' accept="'.$options['accept'].'"';
|
||||
}
|
||||
|
||||
$label = '';
|
||||
if (isset($options['label']) === true) {
|
||||
$label = $options['label'];
|
||||
}
|
||||
}
|
||||
|
||||
// Close input.
|
||||
$output .= '/>';
|
||||
if (is_metaconsole() === false) {
|
||||
$output .= ($options['caption'] ?? __('Select a file'));
|
||||
}
|
||||
$output .= ($options['caption'] ?? __('Select a file'));
|
||||
|
||||
$output .= '</label>';
|
||||
$output .= '<span class="inputFileSpan" id="span-'.$name.'"> </span>';
|
||||
|
@ -6097,6 +6101,8 @@ function html_print_autocomplete_users_from_integria(
|
|||
$attrs['class'] = $class;
|
||||
}
|
||||
|
||||
ui_print_help_tip(__('Type at least two characters to search the user.'), false);
|
||||
|
||||
html_print_input_text_extended(
|
||||
$name,
|
||||
$default,
|
||||
|
@ -6110,8 +6116,6 @@ function html_print_autocomplete_users_from_integria(
|
|||
);
|
||||
html_print_input_hidden($name.'_hidden', $id_agent_module);
|
||||
|
||||
ui_print_help_tip(__('Type at least two characters to search the user.'), false);
|
||||
|
||||
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -31,7 +31,7 @@ require_once $config['homedir'].'/include/functions.php';
|
|||
* @param string $active_tab Current tab or false for View page.
|
||||
* @param number $view Id of incident. Show View tab.
|
||||
*
|
||||
* @return string HTML code. Print tabs in header.
|
||||
* @return array HTML code. Print tabs in header.
|
||||
*/
|
||||
function integriaims_tabs($active_tab, $view=false)
|
||||
{
|
||||
|
|
|
@ -68,6 +68,11 @@ function menu_print_menu(&$menu)
|
|||
$sec2 = 'godmode/alerts/alert_commands';
|
||||
} else if ($sec2 === 'enterprise/godmode/setup/edit_skin') {
|
||||
$sec2 = 'enterprise/godmode/setup/setup_skins';
|
||||
} else if ($sec2 === 'operation/gis_maps/render_view') {
|
||||
$map_id = (int) get_parameter('map_id');
|
||||
if (empty($map_id) === false) {
|
||||
$sec2 .= '&map_id='.$map_id;
|
||||
}
|
||||
} else if ($sec2 === 'godmode/servers/discovery') {
|
||||
$wiz = (string) get_parameter('wiz');
|
||||
$sec2 = 'godmode/servers/discovery&wiz='.$wiz;
|
||||
|
|
|
@ -1025,9 +1025,29 @@ function netflow_get_command($options, $filter)
|
|||
// Build command.
|
||||
$command = io_safe_output($config['netflow_nfdump']).' -N';
|
||||
|
||||
// Netflow data path.
|
||||
if (isset($config['netflow_path']) && $config['netflow_path'] != '') {
|
||||
$command .= ' -R. -M '.$config['netflow_path'];
|
||||
if ($config['activate_sflow'] && $config['activate_netflow']) {
|
||||
if (isset($config['sflow_name_dir']) && $config['sflow_name_dir'] !== ''
|
||||
&& isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== ''
|
||||
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
|
||||
) {
|
||||
$command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'].':'.$config['sflow_name_dir'];
|
||||
}
|
||||
} else {
|
||||
if ($config['activate_sflow']) {
|
||||
if (isset($config['sflow_name_dir']) && $config['sflow_name_dir'] !== ''
|
||||
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
|
||||
) {
|
||||
$command .= ' -R. -M '.$config['general_network_path'].$config['sflow_name_dir'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['activate_netflow']) {
|
||||
if (isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== ''
|
||||
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
|
||||
) {
|
||||
$command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add options.
|
||||
|
@ -1035,7 +1055,6 @@ function netflow_get_command($options, $filter)
|
|||
|
||||
// Filter options.
|
||||
$command .= ' '.netflow_get_filter_arguments($filter);
|
||||
|
||||
return $command;
|
||||
}
|
||||
|
||||
|
|
|
@ -702,6 +702,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
$eventsGraph = html_print_div(
|
||||
[
|
||||
'style' => 'height: 150px;',
|
||||
'class' => 'max-graph-tree-view',
|
||||
'content' => graph_graphic_agentevents(
|
||||
$id_agente,
|
||||
'500px;',
|
||||
|
@ -934,5 +935,32 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
|
||||
}
|
||||
|
||||
$('.max-graph-tree-view').ready(function() {
|
||||
widthGraph();
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
widthGraph();
|
||||
});
|
||||
|
||||
function widthGraph () {
|
||||
var parentWidth = $('.max-graph-tree-view').parent().width();
|
||||
$('.max-graph-tree-view').children().width(parentWidth + 5);
|
||||
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'graph-counter',
|
||||
value: 1
|
||||
}).appendTo('#container');
|
||||
|
||||
|
||||
if ($('#graph-counter').val() == 1) {
|
||||
$('.max-graph-tree-view div.flot-x-axis').css('inset', '-25px').css('margin-top', '10px').css('margin-left', '10px');
|
||||
$('.max-graph-tree-view canvas.flot-base').css('height', '85px');
|
||||
$('#graph-counter').val(2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>";
|
||||
}
|
||||
|
|
|
@ -959,15 +959,39 @@ function ui_print_type_agent_icon(
|
|||
if ((int) $id_os === SATELLITE_OS_ID) {
|
||||
// Satellite.
|
||||
$options['title'] = __('Satellite');
|
||||
$output = html_print_image('images/satellite@os.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
|
||||
$output = html_print_image(
|
||||
'images/satellite@os.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter'],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
);
|
||||
} else if ($remote_contact === $contact && $remote === 0 && empty($version) === true) {
|
||||
// Network.
|
||||
$options['title'] = __('Network');
|
||||
$output = html_print_image('images/network-server@os.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
|
||||
$output = html_print_image(
|
||||
'images/network-server@os.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter'],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
// Software.
|
||||
$options['title'] = __('Software');
|
||||
$output = html_print_image('images/data-server@svg.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
|
||||
$output = html_print_image(
|
||||
'images/data-server@svg.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter'],
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
|
|
@ -226,8 +226,8 @@ $(document).ready(function() {
|
|||
resizable: false,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 450,
|
||||
width: 620,
|
||||
height: 410,
|
||||
width: 390,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
|
|
|
@ -652,10 +652,15 @@ var TreeController = {
|
|||
typeof element.icon != "undefined" &&
|
||||
element.icon.length > 0
|
||||
) {
|
||||
console.log("a");
|
||||
console.log(controller);
|
||||
$content.append(
|
||||
'<div class="node-icon"><div class="node-icon-container"><img src="' +
|
||||
(controller.baseURL.length > 0 ? controller.baseURL : "") +
|
||||
"images/" +
|
||||
(treeController.meta != undefined &&
|
||||
treeController.meta == 1
|
||||
? "../../images/"
|
||||
: "images/") +
|
||||
element.icon +
|
||||
'" class="invert_filter"/></div></div>'
|
||||
);
|
||||
|
@ -679,7 +684,10 @@ var TreeController = {
|
|||
var $deleteBtn = $(
|
||||
'<a style="float: right; margin-top: 5px;"><img src="' +
|
||||
(controller.baseURL.length > 0 ? controller.baseURL : "") +
|
||||
'images/delete.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/></a>'
|
||||
(controller.meta != undefined && controller.meta == 1
|
||||
? "../../images/"
|
||||
: "images/") +
|
||||
'delete.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/></a>'
|
||||
);
|
||||
$deleteBtn.click(function(event) {
|
||||
var ok_function = function() {
|
||||
|
@ -703,7 +711,10 @@ var TreeController = {
|
|||
var $updateicon = $(
|
||||
'<img src="' +
|
||||
(controller.baseURL.length > 0 ? controller.baseURL : "") +
|
||||
'images/edit.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/>'
|
||||
(controller.meta != undefined && controller.meta == 1
|
||||
? "../../images/"
|
||||
: "images/") +
|
||||
'edit.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/>'
|
||||
);
|
||||
var $updatebtn = $(
|
||||
'<a style="float: right; margin-top: 5px;" href = "' +
|
||||
|
|
|
@ -474,7 +474,7 @@ class Manager implements PublicLogin
|
|||
"SELECT *
|
||||
FROM tdashboard
|
||||
WHERE id = %d
|
||||
AND (id_group IN (%s) AND id_user = '') OR id_user = '%s'",
|
||||
AND ((id_group IN (%s) AND id_user = '') OR id_user = '%s')",
|
||||
$this->dashboardId,
|
||||
$this->stringGroups,
|
||||
$config['id_user']
|
||||
|
@ -1047,6 +1047,7 @@ class Manager implements PublicLogin
|
|||
'hash' => self::generatePublicHash(),
|
||||
'publicLink' => $this->publicLink,
|
||||
'dashboardGroup' => $this->dashboardFields['id_group'],
|
||||
'dashboardUser' => $this->dashboardFields['id_user'],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -269,7 +269,6 @@ class ModulesByStatus extends Widget
|
|||
'selected' => $status_selected,
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'class' => 'overflow-hidden',
|
||||
'size' => count($status_fields),
|
||||
'select_all' => false,
|
||||
'required' => true,
|
||||
|
@ -488,6 +487,18 @@ class ModulesByStatus extends Widget
|
|||
$where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND ';
|
||||
}
|
||||
|
||||
if (str_contains($status, '6') === true) {
|
||||
$expl = explode(',', $status);
|
||||
$exist = array_search('6', $expl);
|
||||
if (isset($exist) === true) {
|
||||
unset($expl[$exist]);
|
||||
}
|
||||
|
||||
array_push($expl, '1', '2');
|
||||
|
||||
$status = implode(',', $expl);
|
||||
}
|
||||
|
||||
$where .= sprintf(
|
||||
'tagente_estado.estado IN (%s)
|
||||
AND tagente_modulo.delete_pending = 0',
|
||||
|
|
|
@ -226,7 +226,7 @@ final class DonutGraph extends Item
|
|||
'module_input' => true,
|
||||
'module_name' => 'moduleId',
|
||||
'module_none' => false,
|
||||
'get_only_string_modules' => true,
|
||||
'get_only_string_modules' => false,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -235,14 +235,13 @@ final class DonutGraph extends Item
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
'sort' => false,
|
||||
'agent_id' => $values['agentId'],
|
||||
'metaconsole_id' => $values['metaconsoleId'],
|
||||
'get_only_string_modules' => true,
|
||||
'get_only_string_modules' => false,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ div#login_f {
|
|||
|
||||
#ver_num {
|
||||
width: 100%;
|
||||
color: #dddddd;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-weight: 350;
|
||||
font-size: 10px;
|
||||
|
@ -455,7 +455,7 @@ div.form_message_alert {
|
|||
width: 90%;
|
||||
clear: both;
|
||||
padding-top: 20px;
|
||||
padding-left: 40px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
div.form_message_alert ul li {
|
||||
|
@ -765,7 +765,7 @@ button.submitButton:hover {
|
|||
background-position: 0 !important;
|
||||
}
|
||||
|
||||
button.submitButton > span {
|
||||
button.submitButton:not(.mini) > span {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 15pt;
|
||||
}
|
||||
|
|
|
@ -530,15 +530,6 @@ ul li {
|
|||
width: 35px;
|
||||
}
|
||||
|
||||
/* Menu height: 601px, 720px, 735px */
|
||||
@media screen and (max-height: 750px) {
|
||||
.menu li,
|
||||
.menu li a,
|
||||
.menu li div {
|
||||
min-height: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-height: 750px) {
|
||||
.operation {
|
||||
padding-top: 10px;
|
||||
|
|
|
@ -509,6 +509,10 @@ select:-internal-list-box {
|
|||
width: 400px;
|
||||
}
|
||||
|
||||
.w400px-important {
|
||||
width: 400px !important;
|
||||
}
|
||||
|
||||
.w450px {
|
||||
width: 450px;
|
||||
}
|
||||
|
@ -11578,6 +11582,12 @@ div[role="dialog"] {
|
|||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.database_background_state {
|
||||
mask: url(../../images/database@groups.svg) no-repeat center / contain;
|
||||
-webkit-mask: url(../../images/database@groups.svg) no-repeat center / contain;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.filter-list-adv .wizard li {
|
||||
display: grid;
|
||||
}
|
||||
|
@ -11752,3 +11762,7 @@ div.relative > div > div#ui-datepicker-div {
|
|||
border-radius: 0px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.container-div-input-password:has(.w400px-important) {
|
||||
width: 400px;
|
||||
}
|
||||
|
|
|
@ -1297,8 +1297,9 @@ a.pandora_pagination:hover {
|
|||
filter: brightness(0) contrast(50%) !important;
|
||||
}
|
||||
|
||||
input[type="image"] {
|
||||
input:not(div.login_pass > input):not(div.login_nick > input[type="image"]) {
|
||||
background-color: transparent !important;
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
.databox_color {
|
||||
|
|
|
@ -12,8 +12,8 @@ span.subtitle-2 {
|
|||
border: 0 !important;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="number"] {
|
||||
input[type="text"]:not(.w100p-important),
|
||||
input[type="number"]:not(.w100p-important) {
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
|
|
|
@ -558,6 +558,16 @@ table.filter-table-adv td > div label {
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
div.filter-table-adv-manual > div.inline,
|
||||
table.filter-table-adv td > div.inline {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.filter-table-adv-manual > div.inline input,
|
||||
table.filter-table-adv td > div.inline input {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
table.filter-table-adv td > div.add-input-reverse {
|
||||
flex-direction: row-reverse;
|
||||
justify-content: flex-end;
|
||||
|
|
|
@ -407,7 +407,3 @@ div#tree-controller-recipient {
|
|||
.tree-node .node-icon.node-status {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.max-graph-tree-view {
|
||||
width: calc(100% - 100px);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.769';
|
||||
$build = '230322';
|
||||
$build = '230324';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
|
|
@ -1163,7 +1163,6 @@ foreach ($agents as $agent) {
|
|||
|
||||
$data[2] = html_print_div(
|
||||
[
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'content' => ui_print_os_icon($agent['id_os'], false, true),
|
||||
],
|
||||
true
|
||||
|
|
|
@ -791,7 +791,7 @@ function print_table(
|
|||
html_print_table($table);
|
||||
|
||||
if (count($selected_interfaces) > $config['block_size']) {
|
||||
ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, 'pagination-bottom');
|
||||
ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, '');
|
||||
}
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]);
|
||||
|
|
|
@ -21,23 +21,35 @@ global $config;
|
|||
|
||||
require_once 'include/functions_gis.php';
|
||||
|
||||
// ui_require_javascript_file('openlayers.pandora');
|
||||
$buttons['gis_maps_list'] = [
|
||||
'active' => true,
|
||||
'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image(
|
||||
'images/list.png',
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
['title' => __('GIS Maps list')]
|
||||
[
|
||||
'title' => __('GIS Maps list'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
__('GIS Maps'),
|
||||
'images/op_gis.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$buttons
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Topology maps'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('GIS Maps'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
|
|
|
@ -116,33 +116,34 @@ $controls = [
|
|||
|
||||
$layers = gis_get_layers($idMap);
|
||||
|
||||
// Render map
|
||||
// Render map.
|
||||
$has_management_acl = check_acl_restricted_all($config['id_user'], $map['group_id'], 'MW')
|
||||
|| check_acl_restricted_all($config['id_user'], $map['group_id'], 'MM');
|
||||
|
||||
$buttons = [];
|
||||
|
||||
$buttons['gis_maps_list'] = [
|
||||
'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image(
|
||||
'images/list.png',
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('GIS Maps list'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
if ($config['pure'] == 0) {
|
||||
$buttons[]['text'] = '<a href="index.php?sec=gismaps&sec2=operation/gis_maps/render_view&map_id='.$idMap.'&refr='.((int) get_parameter('refr', 0)).'&pure=1">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
|
||||
$buttons[]['text'] = '<a href="index.php?sec=gismaps&sec2=operation/gis_maps/render_view&map_id='.$idMap.'&refr='.((int) get_parameter('refr', 0)).'&pure=1">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
} else {
|
||||
$buttons[]['text'] = '<a href="index.php?sec=gismaps&sec2=operation/gis_maps/render_view&map_id='.$idMap.'&refr='.((int) get_parameter('refr', 0)).'">'.html_print_image('images/normalscreen.png', true, ['title' => __('Back to normal mode'), 'class' => 'invert_filter']).'</a>';
|
||||
$buttons[]['text'] = '<a href="index.php?sec=gismaps&sec2=operation/gis_maps/render_view&map_id='.$idMap.'&refr='.((int) get_parameter('refr', 0)).'">'.html_print_image('images/exit_fullscreen@svg.svg', true, ['title' => __('Back to normal mode'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
}
|
||||
|
||||
if ($has_management_acl) {
|
||||
if ($has_management_acl === true) {
|
||||
$hash = md5($config['dbpass'].$idMap.$config['id_user']);
|
||||
$buttons['public_link']['text'] = '<a href="'.ui_get_full_url(
|
||||
'operation/gis_maps/public_console.php?hash='.$hash.'&map_id='.$idMap.'&id_user='.$config['id_user']
|
||||
).'" target="_blank">'.html_print_image('images/camera_mc.png', true, ['title' => __('Show link to public GIS map'), 'class' => 'invert_filter']).'</a>';
|
||||
).'" target="_blank">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public GIS map'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
}
|
||||
|
||||
$times = [
|
||||
|
@ -170,17 +171,27 @@ $status = [
|
|||
$buttons[]['text'] = "<div class='mrgn_top_6px'>".__('Filter by status').': '.html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false).'</div>';
|
||||
|
||||
if ($has_management_acl) {
|
||||
$buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='.$idMap.'">'.html_print_image('images/setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).'</a>';
|
||||
$buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='.$idMap.'">'.html_print_image('images/configuration@svg.svg', true, ['title' => __('Setup'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
$buttons['setup']['godmode'] = 1;
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
__('Map').' » '.__('Map').' '.$map['map_name'],
|
||||
'images/op_gis.png',
|
||||
false,
|
||||
'render_view_tab',
|
||||
'',
|
||||
false,
|
||||
$buttons
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Topology maps'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('GIS Maps'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$map_inline_style = 'width: 100%; min-height:500px; height: calc(100vh - 80px);';
|
||||
|
|
|
@ -23,11 +23,30 @@ $update = (isset($_GET['incident_id']) === true);
|
|||
// Header tabs.
|
||||
$onheader = integriaims_tabs('create_tab', $_GET['incident_id']);
|
||||
if ($update) {
|
||||
ui_print_page_header(__('Update Integria IMS Ticket'), '', false, '', false, $onheader);
|
||||
$title_header = __('Update Integria IMS Ticket');
|
||||
} else {
|
||||
ui_print_page_header(__('Create Integria IMS Ticket'), '', false, '', false, $onheader);
|
||||
$title_header = __('Create Integria IMS Ticket');
|
||||
}
|
||||
|
||||
ui_print_standard_header(
|
||||
$title_header,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$onheader,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Issues'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => $title_header,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Check if Integria integration enabled.
|
||||
if ($config['integria_enabled'] == 0) {
|
||||
ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured'));
|
||||
|
@ -166,19 +185,14 @@ if ($update) {
|
|||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->id = 'add_alert_table';
|
||||
$table->class = 'databox filters integria_incidents_options';
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->head = [];
|
||||
|
||||
$table->data = [];
|
||||
$table->size = [];
|
||||
$table->size = [];
|
||||
$table->style[0] = 'width: 33%; padding-right: 50px; padding-left: 100px;';
|
||||
$table->style[1] = 'width: 33%; padding-right: 50px; padding-left: 50px;';
|
||||
$table->style[2] = 'width: 33%; padding-right: 100px; padding-left: 50px;';
|
||||
$table->colspan[0][0] = 2;
|
||||
$table->colspan[4][0] = 3;
|
||||
$table->colspan[6][0] = 3;
|
||||
|
||||
$help_macros = isset($_GET['from_event']) ? ui_print_help_icon('response_macros', true) : '';
|
||||
|
||||
if ($update) {
|
||||
|
@ -210,177 +224,205 @@ if ($update) {
|
|||
$input_value_resolution = 0;
|
||||
}
|
||||
|
||||
$table->data[0][0] = '<div class="label_select"><p class="input_label">'.__('Title').': '.$help_macros.'</p>';
|
||||
$table->data[0][0] .= '<div class="label_select_parent">'.html_print_input_text(
|
||||
'incident_title',
|
||||
$input_value_title,
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>';
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Title').$help_macros,
|
||||
html_print_input_text(
|
||||
'incident_title',
|
||||
$input_value_title,
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
|
||||
$integria_logo = 'images/integria_logo_gray.png';
|
||||
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
|
||||
$integria_logo = 'images/integria_logo.svg';
|
||||
}
|
||||
|
||||
$table->data[0][2] = html_print_image($integria_logo, true, ['style' => 'width: 70%; float: right;'], false);
|
||||
$table->data[0][2] = html_print_image($integria_logo, true, ['style' => 'width: 30%; float: right;'], false);
|
||||
|
||||
$table->data[1][0] = '<div class="label_select"><p class="input_label">'.__('Type').': </p>';
|
||||
$table->data[1][0] .= '<div class="label_select_parent">'.html_print_select(
|
||||
$integria_types_values,
|
||||
'type',
|
||||
$input_value_type,
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
).'</div>';
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$integria_types_values,
|
||||
'type',
|
||||
$input_value_type,
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = '<div class="label_select"><p class="input_label">'.__('Status').': </p>';
|
||||
$table->data[2][0] .= '<div class="label_select_parent">'.html_print_select(
|
||||
$integria_status_values,
|
||||
'status',
|
||||
$input_value_status,
|
||||
'',
|
||||
__('Select'),
|
||||
1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
).'</div>';
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$integria_group_values,
|
||||
'group',
|
||||
$input_value_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][1] = '<div class="label_select"><p class="input_label">'.__('Group').': </p>';
|
||||
$table->data[1][1] .= '<div class="label_select_parent">'.html_print_select(
|
||||
$integria_group_values,
|
||||
'group',
|
||||
$input_value_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
).'</div>';
|
||||
$table->data[1][2] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$integria_criticity_values,
|
||||
'criticity',
|
||||
$input_value_criticity,
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][1] = '<div class="label_select"><p class="input_label">'.__('Creator').': </p>';
|
||||
$table->data[2][1] .= '<div class="label_select_parent">'.html_print_input_text(
|
||||
'creator',
|
||||
$config['integria_user'],
|
||||
'',
|
||||
'30',
|
||||
100,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).ui_print_help_tip(__('This field corresponds to the Integria IMS user specified in Integria IMS setup'), true).'</div>';
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$integria_status_values,
|
||||
'status',
|
||||
$input_value_status,
|
||||
'',
|
||||
__('Select'),
|
||||
1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][2] = '<div class="label_select"><p class="input_label">'.__('Priority').': </p>';
|
||||
$table->data[1][2] .= '<div class="label_select_parent">'.html_print_select(
|
||||
$integria_criticity_values,
|
||||
'criticity',
|
||||
$input_value_criticity,
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
).'</div>';
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Creator').ui_print_help_tip(__('This field corresponds to the Integria IMS user specified in Integria IMS setup'), true),
|
||||
html_print_input_text(
|
||||
'creator',
|
||||
$config['integria_user'],
|
||||
'',
|
||||
'30',
|
||||
100,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][2] = '<div class="label_select"><p class="input_label">'.__('Owner').': </p>';
|
||||
$table->data[2][2] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_integria(
|
||||
'owner',
|
||||
$input_value_owner,
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
$table->data[2][2] .= '<div class="label_select_parent">'.html_print_autocomplete_users_from_integria(
|
||||
'owner',
|
||||
$input_value_owner,
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
).'</div>';
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Resolution'),
|
||||
html_print_select(
|
||||
$integria_resolution_values,
|
||||
'resolution',
|
||||
$input_value_resolution,
|
||||
'',
|
||||
'',
|
||||
1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Description').$help_macros,
|
||||
html_print_textarea(
|
||||
'incident_content',
|
||||
3,
|
||||
20,
|
||||
$input_value_content,
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[3][0] = '<div class="label_select"><p class="input_label">'.__('Resolution').': </p>';
|
||||
$table->data[5][0] = html_print_label_input_block(
|
||||
__('File name'),
|
||||
html_print_input_file('userfile', true)
|
||||
);
|
||||
|
||||
$table->data[3][0] .= '<div class="label_select_parent">'.html_print_select(
|
||||
$integria_resolution_values,
|
||||
'resolution',
|
||||
$input_value_resolution,
|
||||
'',
|
||||
'',
|
||||
1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
).'</div>';
|
||||
|
||||
$table->data[4][0] = '<div class="label_select"><p class="input_label">'.__('Description').': '.$help_macros.'</p>';
|
||||
$table->data[4][0] .= '<div class="label_select_parent">'.html_print_textarea(
|
||||
'incident_content',
|
||||
3,
|
||||
20,
|
||||
$input_value_content,
|
||||
'',
|
||||
true
|
||||
).'</div>';
|
||||
|
||||
$table->data[5][0] = '<div class="label_select"><p class="input_label">'.__('File name').':</p>';
|
||||
$table->data[5][0] .= html_print_input_file('userfile', true);
|
||||
$table->data[6][0] = '<div class="label_select"><p class="input_label">'.__('Attachment description').':</p>';
|
||||
$table->data[6][0] .= html_print_textarea(
|
||||
'file_description',
|
||||
3,
|
||||
20,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->data[6][0] = html_print_label_input_block(
|
||||
__('Attachment description'),
|
||||
html_print_textarea(
|
||||
'file_description',
|
||||
3,
|
||||
20,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
// Print forms and stuff.
|
||||
echo '<form id="create_integria_incident_form" name="create_integria_incident_form" method="POST" enctype="multipart/form-data">';
|
||||
echo '<form class="max_floating_element_size" id="create_integria_incident_form" name="create_integria_incident_form" method="POST" enctype="multipart/form-data">';
|
||||
html_print_table($table);
|
||||
|
||||
$buttons = '';
|
||||
if (!$update) {
|
||||
html_print_input_hidden('create_incident', 1);
|
||||
$buttons .= html_print_input_hidden('create_incident', 1, true);
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Create'),
|
||||
'accion',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
html_print_input_hidden('update_incident', 1);
|
||||
$buttons .= html_print_input_hidden('update_incident', 1, true);
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Update'),
|
||||
'accion',
|
||||
false,
|
||||
[ 'icon' => 'upd' ],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
html_print_action_buttons($buttons);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
echo '<div class="w100p right">';
|
||||
if ($update) {
|
||||
html_print_submit_button(__('Update'), 'accion', false, 'form="create_integria_incident_form" class="sub wand"');
|
||||
} else {
|
||||
html_print_submit_button(__('Create'), 'accion', false, 'form="create_integria_incident_form" class="sub wand"');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -50,14 +50,30 @@ $result_api_call_list = integria_api_call(
|
|||
// Return array of api call 'get_incidents'.
|
||||
$array_get_incidents = [];
|
||||
get_array_from_csv_data_all($result_api_call_list, $array_get_incidents);
|
||||
// Remove index (id)
|
||||
$array_get_incidents = $array_get_incidents[$incident_id];
|
||||
|
||||
// Remove index (id).
|
||||
$array_get_incidents = $array_get_incidents[$incident_id];
|
||||
|
||||
// Header tabs.
|
||||
$onheader = integriaims_tabs(false, $incident_id);
|
||||
ui_print_page_header($array_get_incidents[3].' - '.__('Details'), '', false, '', false, $onheader);
|
||||
|
||||
ui_print_standard_header(
|
||||
$array_get_incidents[3],
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$onheader,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Issues'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Details'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Data.
|
||||
$status = $array_get_incidents[6];
|
||||
|
@ -215,7 +231,7 @@ $table_files_section->data[1][0] .= html_print_textarea(
|
|||
true
|
||||
);
|
||||
|
||||
$table_files_section->data[2][0] .= '<div class="w100p right">'.html_print_submit_button(__('Upload'), 'accion', false, 'class="sub wand"', true).'</div>';
|
||||
$table_files_section->data[2][0] .= '<div class="w100p right">'.html_print_submit_button(__('Upload'), 'accion', false, ['icon' => 'wand', 'mode' => 'mini secondary'], true).'</div>';
|
||||
|
||||
$upload_file_form = '<div class="w100p">';
|
||||
|
||||
|
@ -268,7 +284,7 @@ $table_comments_section->data[0][0] .= html_print_textarea(
|
|||
true
|
||||
);
|
||||
|
||||
$table_comments_section->data[1][1] .= '<div class="w100p right">'.html_print_submit_button(__('Add'), 'accion', $comment_disabled, 'class="sub wand"', true).'</div>';
|
||||
$table_comments_section->data[1][1] .= '<div class="w100p right">'.html_print_submit_button(__('Add'), 'accion', $comment_disabled, ['icon' => 'wand', 'mode' => 'mini secondary'], true).'</div>';
|
||||
|
||||
// Upload comment. If ticket is closed, this action cannot be performed.
|
||||
if ($upload_comment && $array_get_incidents[6] != 7) {
|
||||
|
@ -399,8 +415,8 @@ ui_toggle(
|
|||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box white_box_opened',
|
||||
'no-border flex'
|
||||
'white-box-content',
|
||||
'w98p'
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
|
@ -412,15 +428,14 @@ ui_toggle(
|
|||
'',
|
||||
true,
|
||||
false,
|
||||
'white_box white_box_opened',
|
||||
'no-border flex'
|
||||
'white-box-content',
|
||||
'w98p'
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
|
||||
$('#details_box .white_table_graph_header').click(function(){
|
||||
$('div#details_box').toggleClass('integria_details_shadow');
|
||||
});
|
||||
|
@ -432,6 +447,5 @@ $(document).ready (function () {
|
|||
$('#dates_box .white_table_graph_header').click(function(){
|
||||
$('div#dates_box').toggleClass('integria_details_shadow');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
|
@ -18,13 +18,31 @@ require_once $config['homedir'].'/include/functions_graph.php';
|
|||
|
||||
check_login();
|
||||
|
||||
ui_print_page_header(__('Incidents').' » '.__('Statistics'), 'images/book_edit.png', false, '', false, '');
|
||||
ui_print_standard_header(
|
||||
__('Statistics'),
|
||||
'images/book_edit.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Issues'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Statistics'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if (!$config['integria_enabled']) {
|
||||
ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured'));
|
||||
exit;
|
||||
}
|
||||
|
||||
echo '<div class="info_box">';
|
||||
echo '<table width="90%">
|
||||
<tr><td valign="top" style="width:50%;"><h3>'.__('Incidents by status').'</h3>';
|
||||
echo graph_incidents_status();
|
||||
|
@ -39,3 +57,4 @@ echo '<td style="width:50%;"><h3>'.__('Incidents by user').'</h3>';
|
|||
echo graphic_incident_user();
|
||||
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
|
|
|
@ -20,13 +20,23 @@ check_login();
|
|||
|
||||
// Header tabs.
|
||||
$onheader = integriaims_tabs('list_tab');
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
__('Integria IMS Tickets'),
|
||||
'',
|
||||
false,
|
||||
'integria_tab',
|
||||
false,
|
||||
$onheader
|
||||
$onheader,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Issues'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Integria IMS Tickets'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Check if Integria integration enabled.
|
||||
|
@ -308,68 +318,100 @@ $resolution_incident = integriaims_get_details('resolution');
|
|||
// TABLE FILTERS.
|
||||
$table = new StdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->styleTable = 'margin-bottom:0px';
|
||||
$table->cellpadding = '0';
|
||||
$table->cellspacing = '0';
|
||||
$table->size = [];
|
||||
$table->size[0] = '33%';
|
||||
$table->size[1] = '33%';
|
||||
$table->size[2] = '33%';
|
||||
$table->class = 'filter-table-adv';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Text filter');
|
||||
$table->data[0][1] = html_print_input_text('incident_text', $incident_text, '', 30, 100, true);
|
||||
|
||||
$table->data[0][2] = __('Status');
|
||||
$table->data[0][3] = html_print_select(
|
||||
$status_incident,
|
||||
'incident_status',
|
||||
$incident_status,
|
||||
'',
|
||||
__('All'),
|
||||
0,
|
||||
true
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Text filter'),
|
||||
html_print_input_text('incident_text', $incident_text, '', 30, 100, true)
|
||||
);
|
||||
|
||||
$table->data[0][4] = __('Group');
|
||||
$table->data[0][5] = html_print_select(
|
||||
$group_incident,
|
||||
'incident_group',
|
||||
$incident_group,
|
||||
'',
|
||||
__('All'),
|
||||
1,
|
||||
true
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_incident,
|
||||
'incident_status',
|
||||
$incident_status,
|
||||
'',
|
||||
__('All'),
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][0] = __('Owner');
|
||||
$table->data[1][1] = html_print_autocomplete_users_from_integria('incident_owner', $incident_owner, true);
|
||||
|
||||
$table->data[1][2] = __('Creator');
|
||||
$table->data[1][3] = html_print_autocomplete_users_from_integria('incident_creator', $incident_creator, true);
|
||||
|
||||
$table->data[1][4] = __('Priority');
|
||||
$table->data[1][5] = html_print_select(
|
||||
$priority_incident,
|
||||
'incident_priority',
|
||||
$incident_priority,
|
||||
'',
|
||||
__('All'),
|
||||
-1,
|
||||
true
|
||||
$table->data[0][2] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$group_incident,
|
||||
'incident_group',
|
||||
$incident_group,
|
||||
'',
|
||||
__('All'),
|
||||
1,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = __('Resolution');
|
||||
$table->data[2][1] = html_print_select(
|
||||
$resolution_incident,
|
||||
'incident_resolution',
|
||||
$incident_resolution,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_integria(
|
||||
'incident_owner',
|
||||
$incident_owner,
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
// TODO: field type date.
|
||||
$table->data[2][2] = __('Date');
|
||||
$table->data[2][3] = html_print_input_text_extended(
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Creator'),
|
||||
html_print_autocomplete_users_from_integria(
|
||||
'incident_creator',
|
||||
$incident_creator,
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
$table->data[1][2] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$priority_incident,
|
||||
'incident_priority',
|
||||
$incident_priority,
|
||||
'',
|
||||
__('All'),
|
||||
-1,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Resolution'),
|
||||
html_print_select(
|
||||
$resolution_incident,
|
||||
'incident_resolution',
|
||||
$incident_resolution,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$input_date = '<div>';
|
||||
$input_date .= html_print_input_text_extended(
|
||||
'created_from',
|
||||
$created_from,
|
||||
'created_from',
|
||||
|
@ -381,7 +423,7 @@ $table->data[2][3] = html_print_input_text_extended(
|
|||
'placeholder="'.__('Created from').'"',
|
||||
true
|
||||
);
|
||||
$table->data[2][3] .= html_print_input_text_extended(
|
||||
$input_date .= html_print_input_text_extended(
|
||||
'created_to',
|
||||
$created_to,
|
||||
'created_to',
|
||||
|
@ -393,11 +435,12 @@ $table->data[2][3] .= html_print_input_text_extended(
|
|||
'class="mrgn_lft_5px" placeholder="'.__('Created to').'"',
|
||||
true
|
||||
);
|
||||
$input_date .= '</div>';
|
||||
|
||||
// TODO: image of Integria IMS.
|
||||
$table->data[2][4] = '';
|
||||
$table->data[2][5] = '';
|
||||
|
||||
$table->data[2][2] = html_print_label_input_block(
|
||||
__('Date'),
|
||||
$input_date
|
||||
);
|
||||
|
||||
// Send filters to get_tickets_integriaims().
|
||||
$tickets_filters = [
|
||||
|
@ -423,20 +466,48 @@ $url = ui_get_full_url(
|
|||
// ---- PRINT TABLE FILTERS ----
|
||||
$integria_incidents_form = '<form method="post" action="'.$url.'" class="pdd_0px">';
|
||||
$integria_incidents_form .= html_print_table($table, true);
|
||||
$integria_incidents_form .= '<div class="w100p right">';
|
||||
$integria_incidents_form .= '<div class="float-right mrgn_lft_5px">'.html_print_button(
|
||||
$buttons = html_print_submit_button(
|
||||
__('Filter'),
|
||||
'filter_button',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
$buttons .= html_print_button(
|
||||
__('Export to CSV'),
|
||||
'csv_export',
|
||||
false,
|
||||
"blockResubmit($(this)); location.href='operation/incidents/integriaims_export_csv.php?tickets_filters=$decode_csv'",
|
||||
'class="sub next"',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'mini secondary',
|
||||
],
|
||||
true
|
||||
).'</div>';
|
||||
$integria_incidents_form .= '<div>'.html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub filter"', true).'</div>';
|
||||
$integria_incidents_form .= '</div>';
|
||||
);
|
||||
|
||||
$integria_incidents_form .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => $buttons,
|
||||
],
|
||||
true
|
||||
);
|
||||
$integria_incidents_form .= '</form>';
|
||||
|
||||
ui_toggle($integria_incidents_form, __('Filter'), '', '', false);
|
||||
ui_toggle(
|
||||
$integria_incidents_form,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
|
||||
/*
|
||||
* Order api call 'get_incidents'.
|
||||
|
@ -552,33 +623,52 @@ foreach ($incidents_paginated as $key => $value) {
|
|||
|
||||
$table->data[$i][8] .= '<a id="link_delete_incident" href="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/list_integriaims_incidents&delete_incident='.$array_get_incidents[$key][0]).'"
|
||||
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$table->data[$i][8] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']);
|
||||
$table->data[$i][8] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']);
|
||||
$table->data[$i][8] .= '</a>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$tablePagination = '';
|
||||
// Show table incidents.
|
||||
ui_pagination(count($array_get_incidents), $url, $offset);
|
||||
if (empty($table->data) === true) {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No tickets to show').'.' ]);
|
||||
} else {
|
||||
html_print_table($table);
|
||||
ui_pagination(count($array_get_incidents), $url, $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$tablePagination = ui_pagination(
|
||||
count($array_get_incidents),
|
||||
$url,
|
||||
$offset,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false,
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
// Show button to create incident.
|
||||
echo '<form method="POST" action="'.ui_get_full_url('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident').'">';
|
||||
echo '<div class="wi100p right">';
|
||||
html_print_submit_button(__('Create'), 'create_new_incident', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'create_new_incident',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
[
|
||||
'type' => 'data_table',
|
||||
'class' => 'fixed_action_buttons',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
echo '</form>';
|
||||
|
||||
// Datapicker library for show calendar.
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
?>
|
||||
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(document).ready( function() {
|
||||
$("#created_from, #created_to").datepicker({
|
||||
|
|
|
@ -205,7 +205,7 @@ if ($access_console_node === true) {
|
|||
$sub['operation/inventory/inventory']['refr'] = 0;
|
||||
}
|
||||
|
||||
if ($config['activate_netflow']) {
|
||||
if ($config['activate_netflow'] || $config['activate_sflow']) {
|
||||
$sub['network_traffic'] = [
|
||||
'text' => __('Network'),
|
||||
'id' => 'Network',
|
||||
|
@ -213,34 +213,20 @@ if ($access_console_node === true) {
|
|||
'subtype' => 'nolink',
|
||||
'refr' => 0,
|
||||
];
|
||||
|
||||
// Initialize the submenu.
|
||||
$netflow_sub = [];
|
||||
|
||||
$netflow_sub = array_merge(
|
||||
$netflow_sub,
|
||||
[
|
||||
'operation/netflow/netflow_explorer' => [
|
||||
'text' => __('Netflow explorer'),
|
||||
'id' => 'Netflow explorer',
|
||||
],
|
||||
'operation/netflow/nf_live_view' => [
|
||||
'text' => __('Netflow Live View'),
|
||||
'id' => 'Netflow Live View',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$netflow_sub = array_merge(
|
||||
$netflow_sub,
|
||||
[
|
||||
'operation/network/network_usage_map' => [
|
||||
'text' => __('Network usage map'),
|
||||
'id' => 'Network usage map',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$netflow_sub = [
|
||||
'operation/netflow/netflow_explorer' => [
|
||||
'text' => __('Netflow explorer'),
|
||||
'id' => 'Netflow explorer',
|
||||
],
|
||||
'operation/netflow/nf_live_view' => [
|
||||
'text' => __('Netflow Live View'),
|
||||
'id' => 'Netflow Live View',
|
||||
],
|
||||
'operation/network/network_usage_map' => [
|
||||
'text' => __('Network usage map'),
|
||||
'id' => 'Network usage map',
|
||||
],
|
||||
];
|
||||
$sub['network_traffic']['sub2'] = $netflow_sub;
|
||||
}
|
||||
|
||||
|
@ -411,7 +397,7 @@ if ($access_console_node === true) {
|
|||
// INI GIS Maps.
|
||||
if ($config['activate_gis']) {
|
||||
$sub['gismaps']['text'] = __('GIS Maps');
|
||||
$sub['gismaps']['id'] = 'GIS Maps';
|
||||
$sub['gismaps']['id'] = 'GIS_Maps';
|
||||
$sub['gismaps']['type'] = 'direct';
|
||||
$sub['gismaps']['subtype'] = 'nolink';
|
||||
$sub2 = [];
|
||||
|
|
|
@ -62,7 +62,13 @@ require_once 'include/functions_visual_map.php';
|
|||
|
||||
$hash = (string) get_parameter('hash');
|
||||
$visualConsoleId = (int) get_parameter('id_layout');
|
||||
$config['id_user'] = (string) get_parameter('id_user');
|
||||
$userAccessMaintenance = null;
|
||||
if (empty($config['id_user']) === true) {
|
||||
$config['id_user'] = (string) get_parameter('id_user');
|
||||
} else {
|
||||
$userAccessMaintenance = $config['id_user'];
|
||||
}
|
||||
|
||||
$refr = (int) get_parameter('refr', ($config['refr'] ?? null));
|
||||
|
||||
if (!isset($config['pure'])) {
|
||||
|
@ -179,6 +185,7 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||
|
||||
<script type="text/javascript">
|
||||
var container = document.getElementById("visual-console-container");
|
||||
var user = "<?php echo $userAccessMaintenance; ?>";
|
||||
var props = <?php echo (string) $visualConsole; ?>;
|
||||
var items = <?php echo '['.implode(',', $visualConsoleItems).']'; ?>;
|
||||
var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>";
|
||||
|
@ -282,7 +289,9 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||
);
|
||||
|
||||
if(props.maintenanceMode != null) {
|
||||
visualConsoleManager.visualConsole.enableMaintenanceMode();
|
||||
if(props.maintenanceMode.user !== user) {
|
||||
visualConsoleManager.visualConsole.enableMaintenanceMode();
|
||||
}
|
||||
}
|
||||
|
||||
var controls = document.getElementById('vc-controls');
|
||||
|
|
|
@ -141,12 +141,15 @@ if ($aclWrite === true || $aclManage === true) {
|
|||
'edit'
|
||||
);
|
||||
|
||||
$baseUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='.$action;
|
||||
$baseUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&'.((is_metaconsole() === true) ? 'action2' : 'action').'='.$action;
|
||||
|
||||
$hash = md5($config['dbpass'].$visualConsoleId.$config['id_user']);
|
||||
|
||||
$options['public_link']['text'] = '<a href="'.ui_get_full_url(
|
||||
'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user']
|
||||
'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user'],
|
||||
false,
|
||||
false,
|
||||
false
|
||||
).'" target="_blank">'.html_print_image(
|
||||
'images/item-icon.svg',
|
||||
true,
|
||||
|
@ -280,25 +283,25 @@ if ($pure === false) {
|
|||
$class_delete = 'delete_item delete_min';
|
||||
$class_copy = 'copy_item';
|
||||
if ($config['style'] === 'pandora_black' && is_metaconsole() === false) {
|
||||
$class_camera = 'camera_min_white link-create-item';
|
||||
$class_percentile = 'percentile_item_min_white link-create-item';
|
||||
$class_module_graph = 'graph_min_white link-create-item';
|
||||
$class_donut = 'donut_graph_min_white link-create-item';
|
||||
$class_bars = 'bars_graph_min_white link-create-item';
|
||||
$class_value = 'binary_min_white link-create-item';
|
||||
$class_sla = 'auto_sla_graph_min_white link-create-item';
|
||||
$class_label = 'label_min_white link-create-item';
|
||||
$class_icon = 'icon_min_white link-create-item';
|
||||
$class_clock = 'clock_min_white link-create-item';
|
||||
$class_group = 'group_item_min_white link-create-item';
|
||||
$class_box = 'box_item_white link-create-item';
|
||||
$class_line = 'line_item_white link-create-item';
|
||||
$class_cloud = 'color_cloud_min_white link-create-item';
|
||||
$class_nlink = 'network_link_min_white link-create-item';
|
||||
$class_odometer = 'odometer_min_white link-create-item';
|
||||
$class_basic_chart = 'basic_chart_min_white link-create-item';
|
||||
$class_delete = 'delete_item_white delete_min_white';
|
||||
$class_copy = 'copy_item_white';
|
||||
$class_camera .= ' invert_filter';
|
||||
$class_percentile .= ' invert_filter';
|
||||
$class_module_graph .= ' invert_filter';
|
||||
$class_donut .= ' invert_filter';
|
||||
$class_bars .= ' invert_filter';
|
||||
$class_value .= ' invert_filter';
|
||||
$class_sla .= ' invert_filter';
|
||||
$class_label .= ' invert_filter';
|
||||
$class_icon .= ' invert_filter';
|
||||
$class_clock .= ' invert_filter';
|
||||
$class_group .= ' invert_filter';
|
||||
$class_box .= ' invert_filter';
|
||||
$class_line .= ' invert_filter';
|
||||
$class_cloud .= ' invert_filter';
|
||||
$class_nlink .= ' invert_filter';
|
||||
$class_odometer .= ' invert_filter';
|
||||
$class_basic_chart .= ' invert_filter';
|
||||
$class_delete .= ' invert_filter';
|
||||
$class_copy .= ' invert_filter';
|
||||
}
|
||||
|
||||
visual_map_print_button_editor_refactor(
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.769
|
||||
%define release 230322
|
||||
%define release 230324
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.769
|
||||
%define release 230322
|
||||
%define release 230324
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.769
|
||||
%define release 230322
|
||||
%define release 230324
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -2640,9 +2640,17 @@ CREATE TABLE IF NOT EXISTS `tdatabase` (
|
|||
`action` TINYINT UNSIGNED DEFAULT 0,
|
||||
`ssh_key` TEXT,
|
||||
`ssh_pubkey` TEXT,
|
||||
`ssh_status` TINYINT UNSIGNED DEFAULT 0,
|
||||
`last_error` TEXT,
|
||||
`db_status` TINYINT UNSIGNED DEFAULT 0,
|
||||
`replication_status` TINYINT UNSIGNED DEFAULT 0,
|
||||
`replication_delay` BIGINT DEFAULT 0,
|
||||
`master` TINYINT UNSIGNED DEFAULT 0,
|
||||
`utimestamp` BIGINT DEFAULT 0,
|
||||
`mysql_version` VARCHAR(10) DEFAULT '',
|
||||
`pandora_version` VARCHAR(10) DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `twidget`
|
||||
|
|
|
@ -72,6 +72,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('stats_interval', '60'),
|
||||
('activate_gis', '0'),
|
||||
('activate_netflow', '0'),
|
||||
('activate_sflow', '0'),
|
||||
('timezone', 'Europe/Berlin'),
|
||||
('string_purge', 7),
|
||||
('audit_purge', 15),
|
||||
|
@ -87,6 +88,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('netflow_daemon', '/usr/bin/nfcapd'),
|
||||
('netflow_nfdump', '/usr/bin/nfdump'),
|
||||
('netflow_max_resolution', '50'),
|
||||
('sflow_interval', '3600'),
|
||||
('sflow_daemon', '/usr/bin/sfcapd'),
|
||||
('sflow_nfdump', '/usr/bin/nfdump'),
|
||||
('sflow_max_resolution', '50'),
|
||||
('event_fields', 'mini_severity,evento,estado,agent_name,timestamp'),
|
||||
('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,last_status_change,graph,warn,data,timestamp'),
|
||||
('list_ACL_IPs_for_API', '127.0.0.1'),
|
||||
|
|
|
@ -260,7 +260,7 @@ if (isset($config['public_dashboard']) === true
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (check_acl_restricted_all($config['id_user'], $dashboardGroup, 'RW') === 0) {
|
||||
if ($dashboardUser !== $config['id_user'] && check_acl_restricted_all($config['id_user'], $dashboardGroup, 'RW') === 0) {
|
||||
$buttons = [
|
||||
'back_to_dashboard_list' => $back_to_dashboard_list,
|
||||
'fullscreen' => $fullscreen,
|
||||
|
|
|
@ -212,7 +212,7 @@ if (empty($dashboards) === true) {
|
|||
true,
|
||||
'offset',
|
||||
false,
|
||||
'pagination-bottom'
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.769-230322
|
||||
Version: 7.0NG.769-230324
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.769-230322"
|
||||
pandora_version="7.0NG.769-230324"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -76,6 +76,9 @@ sub pandora_shutdown () {
|
|||
# Stop the netflow daemon
|
||||
pandora_stop_netflow_daemon ();
|
||||
|
||||
# Stop the sflow daemon
|
||||
pandora_stop_sflow_daemon ();
|
||||
|
||||
# Stop server threads.
|
||||
stop_server_threads();
|
||||
|
||||
|
@ -167,6 +170,9 @@ sub pandora_startup () {
|
|||
|
||||
# Start the netflow daemon if necessary
|
||||
pandora_start_netflow_daemon ();
|
||||
|
||||
# Start the sflow daemon if necessary
|
||||
pandora_start_sflow_daemon ();
|
||||
|
||||
# Remove disabled servers
|
||||
@Servers = grep { defined ($_) } @Servers;
|
||||
|
@ -262,8 +268,8 @@ sub pandora_start_netflow_daemon () {
|
|||
|
||||
# Check if netflow is enabled
|
||||
if ($Config{'activate_netflow'} != 1) {
|
||||
logger (\%Config, " [*] Netflow daemon disabled.", 1);
|
||||
print_message (\%Config, " [*] Netflow daemon disabled.", 1);
|
||||
logger (\%Config, " [*] NetFlow daemon disabled.", 1);
|
||||
print_message (\%Config, " [*] NetFlow daemon disabled.", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -282,8 +288,8 @@ sub pandora_start_netflow_daemon () {
|
|||
return;
|
||||
}
|
||||
|
||||
logger (\%Config, "[*] Netflow daemon started.", 1);
|
||||
print_message (\%Config, "[*] Netflow daemon started.", 1);
|
||||
logger (\%Config, "[*] NetFlow daemon started.", 1);
|
||||
print_message (\%Config, "[*] NetFlow daemon started.", 1);
|
||||
}
|
||||
|
||||
########################################################################################
|
||||
|
@ -310,6 +316,62 @@ sub pandora_stop_netflow_daemon () {
|
|||
return 0;
|
||||
}
|
||||
|
||||
########################################################################################
|
||||
# Start the sflow daemon if necessary.
|
||||
########################################################################################
|
||||
sub pandora_start_sflow_daemon () {
|
||||
my $pid_file = '/var/run/pandora_sfcapd.pid';
|
||||
|
||||
# Check if sflow is enabled
|
||||
if ($Config{'activate_sflow'} != 1) {
|
||||
logger (\%Config, " [*] sFlow daemon disabled.", 1);
|
||||
print_message (\%Config, " [*] sFlow daemon disabled.", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
# Stop sfcapd if it's already running
|
||||
my $pid = pandora_stop_sflow_daemon ();
|
||||
if (pandora_stop_sflow_daemon () != 0) {
|
||||
logger (\%Config, "sfcapd (pid $pid) is already running, attempting to kill it...", 1);
|
||||
print_message (\%Config, "sfcapd (pid $pid) is already running, attempting to kill it...", 1);
|
||||
}
|
||||
|
||||
# Start sfcapd
|
||||
my $command = $Config{'sflow_daemon'} . ' -D -T all -w -t ' . $Config{'sflow_interval'} . ' -P ' . $pid_file . ' -l ' . $Config{'sflow_path'};
|
||||
if (system ("$command >/dev/null 2>&1") != 0) {
|
||||
logger (\%Config, " [E] Could not start sfcapd: $command", 1);
|
||||
print_message (\%Config, " [E] Could not start sfcapd: $command", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
logger (\%Config, "[*] sFlow daemon started.", 1);
|
||||
print_message (\%Config, "[*] sFlow daemon started.", 1);
|
||||
}
|
||||
|
||||
########################################################################################
|
||||
# Stop the sflow daemon if it's running.
|
||||
########################################################################################
|
||||
sub pandora_stop_sflow_daemon () {
|
||||
|
||||
my $pid_file = '/var/run/pandora_sfcapd.pid';
|
||||
|
||||
# Open the pid file
|
||||
if ( ! (-e $pid_file && open (PIDFILE, $pid_file))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $pid = <PIDFILE>;
|
||||
close PIDFILE;
|
||||
|
||||
# Check if sfcapd is running
|
||||
if (kill (0, $pid) > 0) {
|
||||
kill (9, $pid);
|
||||
return $pid;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub pandora_agent_autoconfiguration_scheduled($) {
|
||||
my $pa_config = shift;
|
||||
|
||||
|
|
|
@ -702,8 +702,35 @@ ncm_ssh_utility /usr/share/pandora_server/util/ncm_ssh_extension
|
|||
# Pandora FMS Daemon Watchdog execution interval in seconds (PANDORA FMS ENTERPRISE ONLY).
|
||||
ha_interval 30
|
||||
|
||||
# Pandora FMS Daemon Watchdog monitoring interval in seconds. Must be a multiple of ha_interval (PANDORA FMS ENTERPRISE ONLY).
|
||||
ha_monitoring_interval 60
|
||||
# HA operation mode. For backward compatibility with pacemaker. Do not change this value (PANDORA FMS ENTERPRISE ONLY).
|
||||
ha_mode pandora
|
||||
|
||||
# Comma separated list of HA host IPs or FQDNs (PANDORA FMS ENTERPRISE ONLY).
|
||||
#ha_hosts 172.16.0.8,172.168.0.16
|
||||
|
||||
# Database username for pandora_ha (PANDORA FMS ENTERPRISE ONLY).
|
||||
#ha_dbuser pandora
|
||||
|
||||
# Database password for pandora_ha (PANDORA FMS ENTERPRISE ONLY).
|
||||
#ha_dbpass pandora
|
||||
|
||||
# SSH username for pandora_ha (PANDORA FMS ENTERPRISE ONLY).
|
||||
#ha_sshuser pandora
|
||||
|
||||
# SSH port for pandora_ha (PANDORA FMS ENTERPRISE ONLY).
|
||||
#ha_sshport 22
|
||||
|
||||
# Absolute path to the HA slave resync script (PANDORA FMS ENTERPRISE ONLY).
|
||||
#ha_resync /usr/share/pandora_server/util/pandora_ha_resync_slave.sh
|
||||
|
||||
# Database username for HA replication (PANDORA FMS ENTERPRISE ONLY).
|
||||
#repl_dbuser pandora
|
||||
|
||||
# Database password for HA replication (PANDORA FMS ENTERPRISE ONLY).
|
||||
#repl_dbpass pandora
|
||||
|
||||
# Number of retries for connection attempts to HA databases.
|
||||
#ha_connect_retries 2
|
||||
|
||||
# Enable (1) or disable (0) Pandora FMS Alert Server.
|
||||
alertserver 0
|
||||
|
|
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.769";
|
||||
my $pandora_build = "230322";
|
||||
my $pandora_build = "230324";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -144,6 +144,12 @@ sub pandora_get_sharedconfig ($$) {
|
|||
$pa_config->{"netflow_interval"} = pandora_get_tconfig_token ($dbh, 'netflow_interval', 300);
|
||||
$pa_config->{"netflow_daemon"} = pandora_get_tconfig_token ($dbh, 'netflow_daemon', '/usr/bin/nfcapd');
|
||||
|
||||
# Sflow configuration options
|
||||
$pa_config->{"activate_sflow"} = pandora_get_tconfig_token ($dbh, 'activate_sflow', 0);
|
||||
$pa_config->{"sflow_path"} = pandora_get_tconfig_token ($dbh, 'sflow_path', '/var/spool/pandora/data_in/sflow');
|
||||
$pa_config->{"sflow_interval"} = pandora_get_tconfig_token ($dbh, 'sflow_interval', 300);
|
||||
$pa_config->{"sflow_daemon"} = pandora_get_tconfig_token ($dbh, 'sflow_daemon', '/usr/bin/nfcapd');
|
||||
|
||||
# Log module configuration
|
||||
$pa_config->{"log_dir"} = pandora_get_tconfig_token ($dbh, 'log_dir', '/var/spool/pandora/data_in/log');
|
||||
$pa_config->{"log_interval"} = pandora_get_tconfig_token ($dbh, 'log_interval', 3600);
|
||||
|
@ -555,6 +561,24 @@ sub pandora_load_config {
|
|||
|
||||
$pa_config->{"netflowserver"} = 0; # 7.0.770
|
||||
$pa_config->{"netflowserver_threads"} = 1; # 7.0.770
|
||||
$pa_config->{"ha_mode"} = "pacemaker"; # 7.0.770
|
||||
$pa_config->{"ha_file"} = undef; # 7.0.770
|
||||
$pa_config->{"ha_hosts_file"} = '/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'; # 7.0.770
|
||||
$pa_config->{"ha_connect_retries"} = 2; # 7.0.770
|
||||
$pa_config->{"ha_connect_delay"} = 1; # 7.0.770
|
||||
$pa_config->{"ha_dbuser"} = undef; # 7.0.770
|
||||
$pa_config->{"ha_dbpass"} = undef; # 7.0.770
|
||||
$pa_config->{"ha_hosts"} = undef; # 7.0.770
|
||||
$pa_config->{"ha_resync"} = '/usr/share/pandora_server/util/pandora_ha_resync_slave.sh'; # 7.0.770
|
||||
$pa_config->{"ha_resync_log"} = '/var/log/pandora/pandora_ha_resync.log'; # 7.0.770
|
||||
$pa_config->{"ha_sshuser"} = 'pandora'; # 7.0.770
|
||||
$pa_config->{"ha_sshport"} = 22; # 7.0.770
|
||||
|
||||
$pa_config->{"ha_max_splitbrain_retries"} = 2;
|
||||
$pa_config->{"ha_resync_sleep"} = 10;
|
||||
|
||||
$pa_config->{"repl_dbuser"} = undef; # 7.0.770
|
||||
$pa_config->{"repl_dbpass"} = undef; # 7.0.770
|
||||
|
||||
# Check for UID0
|
||||
if ($pa_config->{"quiet"} != 0){
|
||||
|
@ -1286,9 +1310,36 @@ sub pandora_load_config {
|
|||
}
|
||||
|
||||
# Pandora HA extra
|
||||
elsif ($parametro =~ m/^ha_mode\s(.*)/i) {
|
||||
$pa_config->{'ha_mode'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_file\s(.*)/i) {
|
||||
$pa_config->{'ha_file'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_hosts_file\s(.*)/i) {
|
||||
$pa_config->{'ha_hosts_file'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_dbuser\s(.*)/i) {
|
||||
$pa_config->{'ha_dbuser'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_dbpass\s(.*)/i) {
|
||||
$pa_config->{'ha_dbpass'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_sshuser\s(.*)/i) {
|
||||
$pa_config->{'ha_sshuser'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_sshport\s(.*)/i) {
|
||||
$pa_config->{'ha_sshport'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_hosts\s(.*)/i) {
|
||||
$pa_config->{'ha_hosts'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_resync\s(.*)/i) {
|
||||
$pa_config->{'ha_resync'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_resync_log\s(.*)/i) {
|
||||
$pa_config->{'ha_resync_log'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_pid_file\s(.*)/i) {
|
||||
$pa_config->{'ha_pid_file'} = clean_blank($1);
|
||||
}
|
||||
|
@ -1322,9 +1373,42 @@ sub pandora_load_config {
|
|||
elsif ($parametro =~ m/^netflowserver_threads\s+([0-9]*)/i) {
|
||||
$pa_config->{'netflowserver_threads'}= clean_blank($1);
|
||||
}
|
||||
|
||||
elsif ($parametro =~ m/^ha_connect_retries\s+([0-9]*)/i) {
|
||||
$pa_config->{'ha_connect_retries'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^ha_connect_delay\s+([0-9]*)/i) {
|
||||
$pa_config->{'ha_connect_delay'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^repl_dbuser\s(.*)/i) {
|
||||
$pa_config->{'repl_dbuser'} = clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^repl_dbpass\s(.*)/i) {
|
||||
$pa_config->{'repl_dbpass'} = clean_blank($1);
|
||||
}
|
||||
} # end of loop for parameter #
|
||||
|
||||
# The DB host was overridden by pandora_ha.
|
||||
if (-f $pa_config->{'ha_hosts_file'}) {
|
||||
eval {
|
||||
open(my $fh, '<', $pa_config->{'ha_hosts_file'}) or return;
|
||||
my $dbhost = <$fh>;
|
||||
chomp($dbhost);
|
||||
if (defined($dbhost) && $dbhost ne '') {
|
||||
$pa_config->{'dbhost'} = $dbhost;
|
||||
}
|
||||
close($fh);
|
||||
};
|
||||
}
|
||||
print " [*] DB Host is " . $pa_config->{'dbhost'} . "\n";
|
||||
|
||||
# ha_dbuser and ha_dbpass default to dbuser and dbpass respectively.
|
||||
$pa_config->{'ha_dbuser'} = $pa_config->{'dbuser'} unless defined($pa_config->{'ha_dbuser'});
|
||||
$pa_config->{'ha_dbpass'} = $pa_config->{'dbpass'} unless defined($pa_config->{'ha_dbpass'});
|
||||
|
||||
# repl_dbuser and repl_dbpass default to dbuser and dbpass respectively.
|
||||
$pa_config->{'repl_dbuser'} = $pa_config->{'dbuser'} unless defined($pa_config->{'repl_dbuser'});
|
||||
$pa_config->{'repl_dbpass'} = $pa_config->{'dbpass'} unless defined($pa_config->{'repl_dbpass'});
|
||||
|
||||
# Generate the encryption key after reading the passphrase.
|
||||
$pa_config->{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [$pa_config, $pa_config->{"encryption_passphrase"}]);
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ Exported Functions:
|
|||
|
||||
=item * C<pandora_event>
|
||||
|
||||
=item * C<pandora_timed_event>
|
||||
|
||||
=item * C<pandora_execute_alert>
|
||||
|
||||
=item * C<pandora_execute_action>
|
||||
|
@ -194,6 +196,7 @@ our @EXPORT = qw(
|
|||
pandora_evaluate_alert
|
||||
pandora_evaluate_snmp_alerts
|
||||
pandora_event
|
||||
pandora_timed_event
|
||||
pandora_extended_event
|
||||
pandora_execute_alert
|
||||
pandora_execute_action
|
||||
|
@ -3999,7 +4002,8 @@ Generate an event.
|
|||
|
||||
=cut
|
||||
##########################################################################
|
||||
sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$$) {
|
||||
#sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$$) {
|
||||
sub pandora_event {
|
||||
my ($pa_config, $evento, $id_grupo, $id_agente, $severity,
|
||||
$id_alert_am, $id_agentmodule, $event_type, $event_status, $dbh,
|
||||
$source, $user_name, $comment, $id_extra, $tags,
|
||||
|
@ -4116,6 +4120,28 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$$) {
|
|||
return $event_id;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
=head2 C<< pandora_timed_event (I<$time_limit>, I<@event>) >>
|
||||
|
||||
Generate an event, but no more than one every $time_limit seconds.
|
||||
|
||||
=cut
|
||||
##########################################################################
|
||||
my %TIMED_EVENTS :shared;
|
||||
sub pandora_timed_event ($@) {
|
||||
my ($time_limit, @event) = @_;
|
||||
|
||||
# Match events by message.
|
||||
my $event_msg = $event[1];
|
||||
|
||||
# Do not generate more than one event every $time_limit seconds.
|
||||
my $now = time();
|
||||
if (!defined($TIMED_EVENTS{$event_msg}) || $TIMED_EVENTS{$event_msg} + $time_limit < $now) {
|
||||
$TIMED_EVENTS{$event_msg} = $now;
|
||||
pandora_event(@event);
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
=head2 C<< pandora_extended_event (I<$pa_config>, I<$dbh>, I<$event_id>, I<$description>) >>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.769";
|
||||
my $pandora_build = "230322";
|
||||
my $pandora_build = "230324";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.769
|
||||
%define release 230322
|
||||
%define release 230324
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -55,6 +55,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/conf
|
|||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/md5
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/collections
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/netflow
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/sflow
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/trans
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/commands
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/pandora/
|
||||
|
@ -237,5 +238,6 @@ exit 0
|
|||
%{_localstatedir}/spool/pandora/data_in/collections
|
||||
%{_localstatedir}/spool/pandora/data_in/conf
|
||||
%{_localstatedir}/spool/pandora/data_in/netflow
|
||||
%{_localstatedir}/spool/pandora/data_in/sflow
|
||||
%{_localstatedir}/spool/pandora/data_in/trans
|
||||
%{_localstatedir}/spool/pandora/data_in/commands
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.769
|
||||
%define release 230322
|
||||
%define release 230324
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -62,6 +62,7 @@ mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/conf
|
|||
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/md5
|
||||
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/collections
|
||||
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/netflow
|
||||
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/sflow
|
||||
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/trans
|
||||
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/commands
|
||||
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
|
||||
|
@ -235,6 +236,7 @@ rm -Rf /usr/share/man/man1/tentacle_server.1.gz
|
|||
/var/spool/pandora/data_in/md5
|
||||
/var/spool/pandora/data_in/collections
|
||||
/var/spool/pandora/data_in/netflow
|
||||
/var/spool/pandora/data_in/sflow
|
||||
/var/spool/pandora/data_in/conf
|
||||
/var/spool/pandora/data_in/trans
|
||||
/var/spool/pandora/data_in/commands
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.769"
|
||||
PI_BUILD="230322"
|
||||
PI_BUILD="230324"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -308,6 +308,8 @@ install () {
|
|||
chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/collections
|
||||
mkdir $DESTDIR$PANDORA_SPOOL/data_in/netflow 2> /dev/null
|
||||
chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/netflow
|
||||
mkdir $DESTDIR$PANDORA_SPOOL/data_in/sflow 2> /dev/null
|
||||
chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/sflow
|
||||
mkdir $DESTDIR$PANDORA_SPOOL/data_in/trans 2> /dev/null
|
||||
chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/trans
|
||||
mkdir $DESTDIR$PANDORA_SPOOL/data_in/commands 2> /dev/null
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.769 Build 230322";
|
||||
my $version = "7.0NG.769 Build 230324";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
@ -353,6 +353,23 @@ sub pandora_purgedb ($$$) {
|
|||
else {
|
||||
log_message ('PURGE', 'netflow_max_lifetime is set to 0. Old netflow data will not be deleted.');
|
||||
}
|
||||
|
||||
# Delete old sflow data
|
||||
if ($conf->{'_sflow_max_lifetime'} > 0) {
|
||||
log_message ('PURGE', "Deleting old sflow data.");
|
||||
if (! defined ($conf->{'_sflow_path'}) || ! -d $conf->{'_sflow_path'}) {
|
||||
log_message ('!', "sflow data directory does not exist, skipping.");
|
||||
}
|
||||
elsif (! -x $conf->{'_sflow_nfexpire'}) {
|
||||
log_message ('!', "Cannot execute " . $conf->{'_sflow_nfexpire'} . ", skipping.");
|
||||
}
|
||||
else {
|
||||
`yes 2>/dev/null | $conf->{'_sflow_nfexpire'} -r "$conf->{'_sflow_path'}" -t $conf->{'_sflow_max_lifetime'}d`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
log_message ('PURGE', 'sflow_max_lifetime is set to 0. Old sflow data will not be deleted.');
|
||||
}
|
||||
|
||||
# Delete old log data
|
||||
log_message ('PURGE', "Deleting old log data.");
|
||||
|
@ -629,6 +646,21 @@ sub pandora_load_config_pdb ($) {
|
|||
$conf->{'errorlogfile'} = $conf->{'errorlog_file'};
|
||||
$conf->{'errorlogfile'} = "/var/log/pandora_server.error" unless defined ($conf->{'errorlogfile'});
|
||||
|
||||
# The DB host was overridden by pandora_ha.
|
||||
$conf->{'ha_hosts_file'} = '/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf' unless defined($conf->{'ha_hosts_file'});
|
||||
if (-f $conf->{'ha_hosts_file'}) {
|
||||
eval {
|
||||
open(my $fh, '<', $conf->{'ha_hosts_file'}) or return;
|
||||
my $dbhost = <$fh>;
|
||||
chomp($dbhost);
|
||||
if (defined($dbhost) && $dbhost ne '') {
|
||||
$conf->{'dbhost'} = $dbhost;
|
||||
}
|
||||
close($fh);
|
||||
};
|
||||
}
|
||||
print " [*] DB Host is " . $conf->{'dbhost'} . "\n";
|
||||
|
||||
# Read additional tokens from the DB
|
||||
my $dbh = db_connect ($conf->{'dbengine'}, $conf->{'dbname'}, $conf->{'dbhost'}, $conf->{'dbport'}, $conf->{'dbuser'}, $conf->{'dbpass'});
|
||||
|
||||
|
|
|
@ -34,15 +34,27 @@ my %Opts;
|
|||
# Run as a daemon.
|
||||
my $DAEMON = 0;
|
||||
|
||||
# Timeout for the HA DB lock.
|
||||
my $LOCK_TIMEOUT = 300;
|
||||
|
||||
# Avoid retry old processing orders.
|
||||
my $First_Cleanup = 1;
|
||||
|
||||
# List of known HA DB hosts.
|
||||
my @HA_DB_Hosts;
|
||||
|
||||
# Current master node.
|
||||
my $DB_Host = '';
|
||||
|
||||
# PID file.
|
||||
my $PID_FILE = '/var/run/pandora_ha.pid';
|
||||
|
||||
# Server service handler.
|
||||
my $Pandora_Service;
|
||||
|
||||
# Restart the Pandora FMS Server.
|
||||
my $Restart = 0;
|
||||
|
||||
# Controlled exit
|
||||
my $Running = 0;
|
||||
|
||||
|
@ -55,6 +67,10 @@ sub log_message($$$;$) {
|
|||
my $level = $verbosity_level;
|
||||
$level = 5 unless defined($level);
|
||||
|
||||
if ($source eq 'DEBUG' && !defined($ENV{'PANDORA_DEBUG'})) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ref($conf) eq "HASH") {
|
||||
logger($conf, 'HA (' . $source . ') ' . "$message", $level);
|
||||
}
|
||||
|
@ -169,6 +185,17 @@ sub ha_keep_pandora_running($$) {
|
|||
my ($conf, $dbh) = @_;
|
||||
my $OSNAME = $^O;
|
||||
my $control_command;
|
||||
$Pandora_Service = $conf->{'pandora_service_cmd'};
|
||||
|
||||
# A restart was requested.
|
||||
if ($Restart == 1) {
|
||||
$Restart = 0;
|
||||
|
||||
log_message($conf, 'LOG', 'Restarting Pandora service');
|
||||
$control_command = $^O eq "freebsd" ? "restart_server" : 'restart-server';
|
||||
`$Pandora_Service $control_command $ENV{'PANDORA_DBHOST'} 2>/dev/null`;
|
||||
return;
|
||||
}
|
||||
|
||||
# Check if all servers are running
|
||||
# Restart if crashed or keep interval is over.
|
||||
|
@ -185,8 +212,6 @@ sub ha_keep_pandora_running($$) {
|
|||
|
||||
my $nservers = get_db_value ($dbh, 'SELECT count(*) FROM tserver where name = ?', $conf->{'servername'});
|
||||
|
||||
$Pandora_Service = $conf->{'pandora_service_cmd'};
|
||||
|
||||
# Check if service is running
|
||||
$control_command = "status-server";
|
||||
if ($OSNAME eq "freebsd") {
|
||||
|
@ -308,6 +333,37 @@ sub ha_update_server($$) {
|
|||
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Dump the list of known databases to disk.
|
||||
################################################################################
|
||||
sub ha_dump_databases($) {
|
||||
my ($conf) = @_;
|
||||
|
||||
# HA is not configured.
|
||||
return unless defined($conf->{'ha_hosts'});
|
||||
|
||||
eval {
|
||||
open(my $fh, '>', $conf->{'ha_hosts_file'});
|
||||
print $fh $DB_Host; # The console only needs the master DB.
|
||||
close($fh);
|
||||
log_message($conf, 'DEBUG', "Dumped master database $DB_Host to disk");
|
||||
};
|
||||
log_message($conf, 'WARNING', $@) if ($@);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Read the list of known databases from disk.
|
||||
################################################################################
|
||||
sub ha_load_databases($) {
|
||||
my ($conf) = @_;
|
||||
|
||||
# HA is not configured.
|
||||
return unless defined($conf->{'ha_hosts'});
|
||||
|
||||
@HA_DB_Hosts = grep { !/^#/ } map { s/^\s+|\s+$//g; $_; } split(/,/, $conf->{'ha_hosts'});
|
||||
log_message($conf, 'DEBUG', "Loaded databases from disk (@HA_DB_Hosts)");
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Connect to ha database, falling back to direct connection to db.
|
||||
###############################################################################
|
||||
|
@ -324,9 +380,111 @@ sub ha_database_connect($) {
|
|||
}
|
||||
|
||||
###############################################################################
|
||||
# Main
|
||||
# Connect to ha database, falling back to direct connection to db.
|
||||
###############################################################################
|
||||
sub ha_main($) {
|
||||
sub ha_database_connect_pandora($) {
|
||||
my $conf = shift;
|
||||
my $dbhost = $conf->{'dbhost'};
|
||||
|
||||
# Load the list of HA databases.
|
||||
ha_load_databases($conf);
|
||||
|
||||
# Select a new master database.
|
||||
my ($dbh, $utimestamp, $max_utimestamp) = (undef, undef, -1);
|
||||
foreach my $ha_dbhost (@HA_DB_Hosts) {
|
||||
|
||||
# Retry each database ha_connect_retries times.
|
||||
for (my $i = 0; $i < $conf->{'ha_connect_retries'}; $i++) {
|
||||
eval {
|
||||
log_message($conf, 'DEBUG', "Trying database $ha_dbhost...");
|
||||
$dbh= db_connect('mysql',
|
||||
$conf->{'dbname'},
|
||||
$ha_dbhost,
|
||||
$conf->{'dbport'},
|
||||
$conf->{'ha_dbuser'},
|
||||
$conf->{'ha_dbpass'});
|
||||
log_message($conf, 'DEBUG', "Connected to database $ha_dbhost");
|
||||
};
|
||||
log_message($conf, 'WARNING', $@) if ($@);
|
||||
|
||||
# Connection successful.
|
||||
last if defined($dbh);
|
||||
|
||||
# Wait for the next retry.
|
||||
sleep($conf->{'ha_connect_delay'});
|
||||
}
|
||||
|
||||
# No luck. Try the next database.
|
||||
next unless defined($dbh);
|
||||
|
||||
eval {
|
||||
# Get the most recent utimestamp from the database.
|
||||
$utimestamp = get_db_value($dbh, 'SELECT UNIX_TIMESTAMP(MAX(keepalive)) FROM tserver');
|
||||
db_disconnect($dbh);
|
||||
|
||||
# Did we find a more recent database?
|
||||
$utimestamp = 0 unless defined($utimestamp);
|
||||
if ($utimestamp > $max_utimestamp) {
|
||||
$dbhost = $ha_dbhost;
|
||||
$max_utimestamp = $utimestamp;
|
||||
}
|
||||
};
|
||||
log_message($conf, 'WARNING', $@) if ($@);
|
||||
}
|
||||
|
||||
# Return a connection to the selected master.
|
||||
eval {
|
||||
log_message($conf, 'DEBUG', "Connecting to selected master $dbhost...");
|
||||
$dbh = db_connect('mysql',
|
||||
$conf->{'dbname'},
|
||||
$dbhost,
|
||||
$conf->{'dbport'},
|
||||
$conf->{'ha_dbuser'},
|
||||
$conf->{'ha_dbpass'});
|
||||
|
||||
# Restart if a new master was selected.
|
||||
if ($dbhost ne $DB_Host) {
|
||||
log_message($conf, 'DEBUG', "Setting master database to $dbhost");
|
||||
$DB_Host = $dbhost;
|
||||
$Restart = 1;
|
||||
}
|
||||
};
|
||||
log_message($conf, 'WARNING', $@) if ($@);
|
||||
|
||||
# Save the list of HA databases.
|
||||
ha_dump_databases($conf);
|
||||
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Return 1 if the given DB is read-only, 0 otherwise.
|
||||
###############################################################################
|
||||
sub ha_read_only($$) {
|
||||
my ($conf, $dbh) = @_;
|
||||
|
||||
my $read_only = get_db_value($dbh, 'SELECT @@global.read_only');
|
||||
return 1 if (defined($read_only) && $read_only == 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Restart the Pandora FMS Server.
|
||||
###############################################################################
|
||||
sub ha_restart_pandora($) {
|
||||
my ($config) = @_;
|
||||
|
||||
my $control_command = $^O eq 'freebsd' ?
|
||||
'restart_server' :
|
||||
'restart-server';
|
||||
`$config->{'pandora_service_cmd'} $control_command 2>/dev/null`;
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Main (Pacemaker)
|
||||
###############################################################################
|
||||
sub ha_main_pacemaker($) {
|
||||
my ($conf) = @_;
|
||||
|
||||
# Set the PID file.
|
||||
|
@ -404,6 +562,100 @@ sub ha_main($) {
|
|||
}
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Main (Pandora)
|
||||
###############################################################################
|
||||
sub ha_main_pandora($) {
|
||||
my ($conf) = @_;
|
||||
|
||||
# Set the PID file.
|
||||
$conf->{'PID'} = $PID_FILE;
|
||||
|
||||
# Log to a separate file if needed.
|
||||
$conf->{'log_file'} = $conf->{'ha_log_file'} if defined ($conf->{'ha_log_file'});
|
||||
|
||||
# Run in the background.
|
||||
ha_daemonize($conf) if ($DAEMON == 1);
|
||||
|
||||
# Main loop.
|
||||
$Running = 1;
|
||||
while ($Running) {
|
||||
my $dbh = undef;
|
||||
eval {
|
||||
|
||||
# Connect to a DB.
|
||||
log_message($conf, 'LOG', "Looking for databases");
|
||||
$dbh = ha_database_connect_pandora($conf);
|
||||
if (!defined($dbh)) {
|
||||
log_message($conf, 'LOG', 'No databases available');
|
||||
return;
|
||||
}
|
||||
|
||||
# Make the DB host available to the Pandora FMS Server.
|
||||
$ENV{'PANDORA_DBHOST'} = $DB_Host;
|
||||
|
||||
# Needed for the Enterprise module.
|
||||
$conf->{'dbhost'} = $DB_Host;
|
||||
|
||||
# Enterprise capabilities need access to the DB.
|
||||
eval {
|
||||
local $SIG{__DIE__};
|
||||
# Load enterprise components.
|
||||
enterprise_load($conf, 1);
|
||||
|
||||
# Register Enterprise logger
|
||||
enterprise_hook('pandoraha_logger', [\&log_message]);
|
||||
log_message($conf, 'LOG', 'Enterprise capabilities loaded');
|
||||
|
||||
};
|
||||
log_message($conf, 'LOG', "No enterprise capabilities: $@") if ($@);
|
||||
|
||||
log_message($conf, 'LOG', "Connected to database $DB_Host");
|
||||
enterprise_hook('pandoraha_stop_slave', [$conf, $dbh]);
|
||||
|
||||
if (ha_read_only($conf, $dbh) == 1) {
|
||||
log_message($conf, 'LOG', "The database is read-only.");
|
||||
return;
|
||||
}
|
||||
|
||||
# Check if there are updates pending.
|
||||
ha_update_server($conf, $dbh);
|
||||
|
||||
# Keep pandora running
|
||||
ha_keep_pandora_running($conf, $dbh);
|
||||
|
||||
# Keep Tentacle running
|
||||
ha_keep_tentacle_running($conf, $dbh);
|
||||
|
||||
# Are we the master?
|
||||
pandora_set_master($conf, $dbh);
|
||||
if (!pandora_is_master($conf)) {
|
||||
log_message($conf, 'LOG', $conf->{'servername'} . ' is not the current master. Skipping DB-HA actions and monitoring.');
|
||||
return;
|
||||
}
|
||||
|
||||
# Check the status of slave databases.
|
||||
enterprise_hook('pandoraha_check_slaves', [$conf, $dbh, $DB_Host, \@HA_DB_Hosts]);
|
||||
|
||||
# Update the status of HA databases.
|
||||
enterprise_hook('pandoraha_update_dbs', [$conf, $dbh, $DB_Host, \@HA_DB_Hosts]);
|
||||
|
||||
# Execute resync actions.
|
||||
enterprise_hook('pandoraha_resync_dbs', [$conf, $dbh, $DB_Host, \@HA_DB_Hosts]);
|
||||
};
|
||||
log_message($conf, 'WARNING', $@) if ($@);
|
||||
|
||||
# Cleanup.
|
||||
eval {
|
||||
db_disconnect($dbh) if defined($dbh);
|
||||
};
|
||||
|
||||
# Go to sleep.
|
||||
log_message($conf, 'LOG', "Sleep.");
|
||||
sleep($conf->{'ha_interval'});
|
||||
}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Stop pandora server
|
||||
################################################################################
|
||||
|
@ -429,7 +681,6 @@ END {
|
|||
stop();
|
||||
}
|
||||
|
||||
|
||||
$SIG{INT} = \&stop;
|
||||
$SIG{TERM} = \&stop;
|
||||
|
||||
|
@ -440,6 +691,10 @@ ha_init_pandora(\%Conf);
|
|||
ha_load_pandora_conf (\%Conf);
|
||||
|
||||
# Main
|
||||
ha_main(\%Conf);
|
||||
if (defined($Conf{'ha_mode'}) && lc($Conf{'ha_mode'}) eq 'pandora') {
|
||||
ha_main_pandora(\%Conf);
|
||||
} else {
|
||||
ha_main_pacemaker(\%Conf);
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.769 Build 230322";
|
||||
my $version = "7.0NG.769 Build 230324";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue