Merge remote-tracking branch 'origin/develop' into ent-11471-integracion-pandora-integria
This commit is contained in:
commit
a29497f659
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.772-230712
|
||||
Version: 7.0NG.772-230717
|
||||
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.772-230712"
|
||||
pandora_version="7.0NG.772-230717"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1031,7 +1031,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.772';
|
||||
use constant AGENT_BUILD => '230712';
|
||||
use constant AGENT_BUILD => '230717';
|
||||
|
||||
# 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.772
|
||||
%define release 230712
|
||||
%define release 230717
|
||||
|
||||
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.772
|
||||
%define release 230712
|
||||
%define release 230717
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.772"
|
||||
PI_BUILD="230712"
|
||||
PI_BUILD="230717"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230712}
|
||||
{230717}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.772 Build 230712")
|
||||
#define PANDORA_VERSION ("7.0NG.772 Build 230717")
|
||||
|
||||
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.772(Build 230712))"
|
||||
VALUE "ProductVersion", "(7.0NG.772(Build 230717))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.772-230712
|
||||
Version: 7.0NG.772-230717
|
||||
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.772-230712"
|
||||
pandora_version="7.0NG.772-230717"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -1692,3 +1692,14 @@ enterprise/godmode/modules/manage_inventory_modules_form.php
|
|||
enterprise/operation/inventory/inventory.php
|
||||
include/test.js
|
||||
include/web2image.js
|
||||
enterprise/meta/monitoring/wizard/wizard.agent.php
|
||||
enterprise/meta/monitoring/wizard/wizard.create_agent.php
|
||||
enterprise/meta/monitoring/wizard/wizard.create_module.php
|
||||
enterprise/meta/monitoring/wizard/wizard.main.php
|
||||
enterprise/meta/monitoring/wizard/wizard.manage_alert.php
|
||||
enterprise/meta/monitoring/wizard/wizard.module.local.php
|
||||
enterprise/meta/monitoring/wizard/wizard.module.network.php
|
||||
enterprise/meta/monitoring/wizard/wizard.module.web.php
|
||||
enterprise/meta/monitoring/wizard/wizard.php
|
||||
enterprise/meta/monitoring/wizard/wizard.update_agent.php
|
||||
enterprise/meta/monitoring/wizard/wizard.update_module.php
|
|
@ -34,6 +34,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$notifications_numbers['notifications'],
|
||||
$notifications_numbers['last_id']
|
||||
).'</div>';
|
||||
$header_welcome = '';
|
||||
if (check_acl($config['id_user'], $group, 'AW')) {
|
||||
$header_welcome .= '<div id="welcome-icon-header">';
|
||||
$header_welcome .= html_print_image(
|
||||
'images/wizard@svg.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'title' => __('Welcome dialog'),
|
||||
'id' => 'Welcome-dialog',
|
||||
'alt' => __('Welcome dialog'),
|
||||
'style' => 'cursor: pointer;',
|
||||
]
|
||||
);
|
||||
$header_welcome .= '</div>';
|
||||
}
|
||||
|
||||
// ======= Servers List ===============================================
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
|
||||
|
@ -461,7 +477,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
} else {
|
||||
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
|
||||
<div class="header_center">'.$header_searchbar.'</div>
|
||||
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
}
|
||||
?>
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
|
@ -904,6 +920,44 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$("#agent_access").css("display","");
|
||||
});
|
||||
|
||||
$("#welcome-icon-header").click(function () {
|
||||
if (!$('#welcome_modal_window').length){
|
||||
$(document.body).append('<div id="welcome_modal_window"></div>');
|
||||
$(document.body).append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'include/styles/new_installation_welcome_window.css') );
|
||||
}
|
||||
// Clean DOM.
|
||||
load_modal({
|
||||
target: $('#welcome_modal_window'),
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
modal: {
|
||||
title: "<?php echo __('Welcome to').' '.io_safe_output(get_product_name()); ?>",
|
||||
cancel: '<?php echo __('Do not show anymore'); ?>',
|
||||
ok: '<?php echo __('Close'); ?>'
|
||||
},
|
||||
onshow: {
|
||||
page: 'include/ajax/welcome_window',
|
||||
method: 'loadWelcomeWindow',
|
||||
},
|
||||
oncancel: {
|
||||
page: 'include/ajax/welcome_window',
|
||||
title: "<?php echo __('Cancel Configuration Window'); ?>",
|
||||
method: 'cancelWelcome',
|
||||
confirm: function (fn) {
|
||||
confirmDialog({
|
||||
title: '<?php echo __('Are you sure?'); ?>',
|
||||
message: '<?php echo __('Are you sure you want to cancel this tutorial?'); ?>',
|
||||
ok: '<?php echo __('OK'); ?>',
|
||||
cancel: '<?php echo __('Cancel'); ?>',
|
||||
onAccept: function() {
|
||||
// Continue execution.
|
||||
fn();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
<?php if (enterprise_installed()) { ?>
|
||||
// Feedback.
|
||||
$("#feedback-header").click(function () {
|
||||
|
|
|
@ -100,21 +100,23 @@ if ($initial && users_is_admin()) {
|
|||
);
|
||||
}
|
||||
|
||||
$welcome = !$initial;
|
||||
try {
|
||||
$welcome_window = new WelcomeWindow($welcome);
|
||||
if ($welcome_window !== null) {
|
||||
$welcome_window->run();
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
$welcome = !$initial;
|
||||
try {
|
||||
$welcome_window = new WelcomeWindow($welcome);
|
||||
if ($welcome_window !== null) {
|
||||
$welcome_window->run();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$welcome = false;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$welcome = false;
|
||||
}
|
||||
|
||||
try {
|
||||
if (isset($_SESSION['showed_tips_window']) === false) {
|
||||
$tips_window = new TipsWindow();
|
||||
if ($tips_window !== null) {
|
||||
$tips_window->run();
|
||||
$tips_window->run();
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
|
|
@ -80,7 +80,7 @@ if (isset($_POST['template_id']) === true) {
|
|||
$values = [
|
||||
'id_agente' => $id_agente,
|
||||
'id_tipo_modulo' => $row2['type'],
|
||||
'descripcion' => __('Created by template ').$name_template.' . '.$row2['description'],
|
||||
'descripcion' => $row2['description'],
|
||||
'max' => $row2['max'],
|
||||
'min' => $row2['min'],
|
||||
'module_interval' => $row2['module_interval'],
|
||||
|
|
|
@ -460,6 +460,18 @@ if ($id_agente) {
|
|||
|
||||
$templatetab['active'] = ($tab === 'template');
|
||||
|
||||
// Policy tab.
|
||||
$policyTab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=policy&id_agente='.$id_agente,
|
||||
'image' => 'images/policy@svg.svg',
|
||||
'title' => __('Manage policy'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$policyTab['active'] = ($tab === 'policy');
|
||||
|
||||
// Inventory.
|
||||
$inventorytab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/hardware-software-component@svg.svg',
|
||||
|
@ -638,6 +650,7 @@ if ($id_agente) {
|
|||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
|
@ -654,11 +667,11 @@ if ($id_agente) {
|
|||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -725,6 +738,11 @@ if ($id_agente) {
|
|||
$tab_name = __('Inventory');
|
||||
break;
|
||||
|
||||
case 'policy':
|
||||
$help_header = 'policy_tab';
|
||||
$tab_name = __('Policies');
|
||||
break;
|
||||
|
||||
case 'plugins':
|
||||
$help_header = 'plugins_tab';
|
||||
$tab_name = __('Agent plugins');
|
||||
|
@ -2428,6 +2446,10 @@ switch ($tab) {
|
|||
include 'inventory_manager.php';
|
||||
break;
|
||||
|
||||
case 'policy':
|
||||
enterprise_include('operation/agentes/policy_manager.php');
|
||||
break;
|
||||
|
||||
default:
|
||||
if (enterprise_hook('switch_agent_tab', [$tab])) {
|
||||
// This will make sure that blank pages will have at least some
|
||||
|
|
|
@ -1072,16 +1072,20 @@ if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
|||
function () {
|
||||
$(".actions", this).css ("visibility", "hidden");
|
||||
});
|
||||
|
||||
|
||||
$("#ag_group").click (
|
||||
function () {
|
||||
$(this).css ("width", "auto");
|
||||
$(this).css ("min-width", "100px");
|
||||
});
|
||||
|
||||
|
||||
$("#ag_group").blur (function () {
|
||||
$(this).css ("width", "100px");
|
||||
});
|
||||
|
||||
|
||||
var show_deploy_agent = "<?php echo get_parameter('show_deploy_agent', 0); ?>";
|
||||
if (show_deploy_agent !== '0'){
|
||||
$('#button-modal_deploy_agent').click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -40,6 +40,8 @@ $table->size = [];
|
|||
$table->style[0] = 'width: 50%';
|
||||
$table->style[1] = 'width: 50%';
|
||||
|
||||
$modules = [];
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
|
@ -79,8 +81,6 @@ if (is_metaconsole() === true) {
|
|||
}
|
||||
}
|
||||
|
||||
$modules = [];
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Module'),
|
||||
html_print_select(
|
||||
|
|
|
@ -86,31 +86,39 @@ if ($do_operation) {
|
|||
$groups = users_get_groups();
|
||||
|
||||
$table = new stdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->style[4] = 'font-weight: bold';
|
||||
$table->style[6] = 'font-weight: bold';
|
||||
|
||||
// Source selection
|
||||
$table->id = 'source_table';
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'source_id_group',
|
||||
$source_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
|
||||
// Source selection.
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'source_id_group',
|
||||
$source_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[0][2] = __('Group recursion');
|
||||
$table->data[0][3] = html_print_checkbox('source_recursion', 1, $source_recursion, true, false);
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox('source_recursion', 1, $source_recursion, true, false)
|
||||
);
|
||||
|
||||
$status_list = [];
|
||||
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||
|
@ -118,37 +126,52 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
|||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data[0][4] = __('Status');
|
||||
$table->data[0][5] = html_print_select(
|
||||
$status_list,
|
||||
'status_agents_source',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_agents_source',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
$table->data[0][6] = __('Agent');
|
||||
$table->data[0][6] .= ' <span id="source_agent_loading" class="invisible">';
|
||||
$table->data[0][6] .= html_print_image('images/spinner.png', true);
|
||||
$table->data[0][6] .= '</span>';
|
||||
// $table->data[0][7] = html_print_select (agents_get_group_agents ($source_id_group, false, "none"),
|
||||
// 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
|
||||
|
||||
$agents = ( $source_id_group ? agents_get_group_agents($source_id_group, false, 'none') : agents_get_group_agents(array_keys(users_get_groups($config['id_user'], 'AW', false))) );
|
||||
$table->data[0][7] = html_print_select($agents, 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
|
||||
|
||||
echo '<form '.'action="index.php?'.'sec=gmassive&'.'sec2=godmode/massive/massive_operations&'.'option=copy_modules" '.'id="manage_config_form" '.'method="post">';
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Agent').' <span id="source_agent_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
|
||||
html_print_select(
|
||||
$agents,
|
||||
'source_id_agent',
|
||||
$source_id_agent,
|
||||
false,
|
||||
__('Select'),
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=copy_modules" id="manage_config_form" method="post" class="max_floating_element_size">';
|
||||
echo '<fieldset id="fieldset_source">';
|
||||
echo '<legend>';
|
||||
echo '<span>'.__('Source');
|
||||
echo '</legend>';
|
||||
echo '<legend><span>'.__('Source').'</span></legend>';
|
||||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
|
||||
// Target selection
|
||||
|
||||
unset($table);
|
||||
// Target selection.
|
||||
$table = new stdClass();
|
||||
$table->id = 'target_table';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
|
||||
$modules = [];
|
||||
|
@ -169,66 +192,64 @@ foreach ($agent_alerts as $alert) {
|
|||
}
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->data['tags'][0] = __('Tags');
|
||||
$table->data['tags'][1] = html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
$table->colspan[0][0] = 2;
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Tags'),
|
||||
html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'overflow-x: hidden;white-space: nowrap;max-width: 1136px;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['operations'][0] = __('Operations');
|
||||
$table->data['operations'][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data['operations'][1] .= html_print_checkbox('copy_modules', 1, true, true);
|
||||
$table->data['operations'][1] .= html_print_label(__('Copy modules'), 'checkbox-copy_modules', true);
|
||||
$table->data['operations'][1] .= '</span><br />';
|
||||
|
||||
$table->data['operations'][1] .= '<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">';
|
||||
$table->data['operations'][1] .= html_print_checkbox('copy_alerts', 1, true, true);
|
||||
$table->data['operations'][1] .= html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true);
|
||||
$table->data['operations'][1] .= '</span>';
|
||||
|
||||
$table->data['form_modules_filter'][0] = __('Filter Modules');
|
||||
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
|
||||
|
||||
$table->data[1][0] = __('Modules');
|
||||
$table->data[1][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data[1][1] .= html_print_select(
|
||||
$modules,
|
||||
'target_modules[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Operations'),
|
||||
'<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">'.html_print_checkbox('copy_modules', 1, true, true).html_print_label(__('Copy modules'), 'checkbox-copy_modules', true).'</span><span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">'.html_print_checkbox('copy_alerts', 1, true, true).html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true).'</span>'
|
||||
);
|
||||
$table->data[1][1] .= '</span>';
|
||||
$table->data[1][1] .= '<span class="without_modules'.(! empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data[1][1] .= '<em>'.__('No modules for this agent').'</em>';
|
||||
$table->data[1][1] .= '</span>';
|
||||
|
||||
$table->data[2][0] = __('Alerts');
|
||||
$table->data[2][1] = '<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">';
|
||||
$table->data[2][1] .= html_print_select(
|
||||
$alerts,
|
||||
'target_alerts[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Filter Modules'),
|
||||
html_print_input_text('filter_modules', '', '', 20, 255, true)
|
||||
);
|
||||
|
||||
$table->colspan[2][0] = 2;
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Modules'),
|
||||
'<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">'.html_print_select(
|
||||
$modules,
|
||||
'target_modules[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
).'</span><span class="without_modules'.(! empty($modules) ? ' invisible' : '').'"><em>'.__('No modules for this agent').'</em></span>'
|
||||
);
|
||||
|
||||
$table->colspan[3][0] = 2;
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Alerts'),
|
||||
'<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">'.html_print_select(
|
||||
$alerts,
|
||||
'target_alerts[]',
|
||||
0,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
).'</span><span class="without_alerts'.(! empty($modules) ? ' invisible' : '').'"><em>'.__('No alerts for this agent').'</em></span>'
|
||||
);
|
||||
$table->data[2][1] .= '</span>';
|
||||
$table->data[2][1] .= '<span class="without_alerts'.(! empty($modules) ? ' invisible' : '').'">';
|
||||
$table->data[2][1] .= '<em>'.__('No alerts for this agent').'</em>';
|
||||
$table->data[2][1] .= '</span>';
|
||||
|
||||
echo '<div id="modules_loading" class="loading invisible">';
|
||||
html_print_image('images/spinner.png');
|
||||
|
@ -240,35 +261,50 @@ echo '<legend><span>'.__('Targets').'</span></legend>';
|
|||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
|
||||
|
||||
// Destiny selection
|
||||
unset($table);
|
||||
// Destiny selection.
|
||||
$table = new stdClass();
|
||||
$table->id = 'destiny_table';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
$table->size[0] = '20%';
|
||||
$table->size[1] = '30%';
|
||||
$table->size[2] = '20%';
|
||||
$table->size[3] = '30%';
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'destiny_id_group',
|
||||
$destiny_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'destiny_id_group',
|
||||
$destiny_id_group,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[0][2] = __('Group recursion');
|
||||
$table->data[0][3] = html_print_checkbox(
|
||||
'destiny_recursion',
|
||||
1,
|
||||
$destiny_recursion,
|
||||
true,
|
||||
false
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox(
|
||||
'destiny_recursion',
|
||||
1,
|
||||
$destiny_recursion,
|
||||
true,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Filter Agents'),
|
||||
html_print_input_text('filter_agents', '', '', 20, 255, true)
|
||||
);
|
||||
|
||||
$status_list = [];
|
||||
|
@ -278,32 +314,30 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
|||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data[1][0] = __('Status');
|
||||
$table->data[1][1] = html_print_select(
|
||||
$status_list,
|
||||
'status_agents_destiny',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_agents_destiny',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['form_agents_filter'][0] = __('Filter Agents');
|
||||
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||
|
||||
$table->data[2][0] = __('Agent');
|
||||
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
||||
$table->data[2][0] .= html_print_image('images/spinner.png', true);
|
||||
$table->data[2][0] .= '</span>';
|
||||
|
||||
$agents = [];
|
||||
if ($source_id_agent) {
|
||||
$agents = ( $destiny_id_group ? agents_get_group_agents($destiny_id_group, false, 'none') : agents_get_group_agents(array_keys(users_get_groups($config['id_user'], 'AW', false))) );
|
||||
unset($agents[$source_id_agent]);
|
||||
}
|
||||
|
||||
$table->data[2][1] = html_print_select($agents, 'destiny_id_agent[]', 0, false, '', '', true, true);
|
||||
$table->colspan[2][0] = 2;
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Agent').'<span id="destiny_agent_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
|
||||
html_print_select($agents, 'destiny_id_agent[]', 0, false, '', '', true, true)
|
||||
);
|
||||
|
||||
echo '<fieldset id="fieldset_destiny"'.($source_id_agent ? '' : ' class="invisible"').'>';
|
||||
echo '<legend><span>'.__('To agent(s)').'</span></legend>';
|
||||
|
|
|
@ -310,45 +310,47 @@ foreach ($module_types as $type) {
|
|||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
|
||||
$table->data['selection_mode'][0] = __('Selection mode');
|
||||
$table->data['selection_mode'][1] = '<span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br>';
|
||||
$table->data['selection_mode'][1] .= '<span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true);
|
||||
|
||||
$table->rowclass['form_modules_1'] = 'select_modules_row';
|
||||
$table->data['form_modules_1'][0] = __('Module type');
|
||||
$table->data['form_modules_1'][0] .= '<span id="module_loading" class="invisible">';
|
||||
$table->data['form_modules_1'][0] .= html_print_image('images/spinner.png', true);
|
||||
$table->data['form_modules_1'][0] .= '</span>';
|
||||
$types[0] = __('All');
|
||||
$table->colspan['form_modules_1'][1] = 2;
|
||||
$table->data['form_modules_1'][1] = html_print_select(
|
||||
$types,
|
||||
'module_type',
|
||||
'',
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Selection mode'),
|
||||
'<div class="flex"><span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br><span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'</div>'
|
||||
);
|
||||
$table->data['form_modules_1'][3] = __('Select all modules of this type').' '.html_print_checkbox_extended(
|
||||
'force_type',
|
||||
'type',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'class="mrgn_right_40px"',
|
||||
true,
|
||||
''
|
||||
|
||||
$table->rowclass[1] = 'select_modules_row';
|
||||
$types[0] = __('All');
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Module type').'<span id="module_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
|
||||
html_print_select(
|
||||
$types,
|
||||
'module_type',
|
||||
'',
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Select all modules of this type'),
|
||||
html_print_checkbox_extended(
|
||||
'force_type',
|
||||
'type',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'class="mrgn_right_40px"',
|
||||
true,
|
||||
''
|
||||
)
|
||||
);
|
||||
|
||||
$modules = [];
|
||||
|
@ -368,52 +370,59 @@ foreach ($names as $name) {
|
|||
$modules[$name['nombre']] = $name['nombre'];
|
||||
}
|
||||
|
||||
$table->rowclass['form_agents_1'] = 'select_agents_row';
|
||||
$table->data['form_agents_1'][0] = __('Agent group');
|
||||
$table->rowclass[2] = 'select_agents_row';
|
||||
$groups = users_get_groups($config['id_user'], 'AW', false);
|
||||
$groups[0] = __('All');
|
||||
$table->colspan['form_agents_1'][1] = 2;
|
||||
$table->data['form_agents_1'][1] = html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'groups_select',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).' '.__('Group recursion').' '.html_print_checkbox('recursion', 1, false, true, false);
|
||||
$table->data['form_agents_1'][3] = __('Select all modules of this group').' '.html_print_checkbox_extended(
|
||||
'force_group',
|
||||
'group',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'class="mrgn_right_40px"',
|
||||
true
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Agent group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'groups_select',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).' '.__('Group recursion').' '.html_print_checkbox('recursion', 1, false, true, false)
|
||||
);
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Select all modules of this group'),
|
||||
html_print_checkbox_extended(
|
||||
'force_group',
|
||||
'group',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'class="mrgn_right_40px"',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_modules_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_4'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_4'][0] = __('Tags');
|
||||
$table->data['form_modules_4'][1] = html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
$table->rowclass[3] = 'select_modules_row select_modules_row_2';
|
||||
$table->colspan[3][0] = 2;
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Tags'),
|
||||
html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'overflow-x: hidden;white-space: nowrap;max-width: 1136px;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowclass['form_agents_2'] = 'select_agents_row';
|
||||
$table->data['form_agents_2'][0] = __('Status');
|
||||
$table->colspan['form_agents_2'][1] = 2;
|
||||
$status_list = [];
|
||||
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||
|
@ -421,166 +430,194 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
|||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data['form_agents_2'][1] = html_print_select(
|
||||
$status_list,
|
||||
'status_agents',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Module Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_module',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_MODULE_STATUS_ALL,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
$table->data['form_agents_2'][3] = '';
|
||||
|
||||
$table->rowclass['form_modules_3'] = '';
|
||||
$table->data['form_modules_3'][0] = __('Module Status');
|
||||
$table->colspan['form_modules_3'][1] = 2;
|
||||
$status_list = [];
|
||||
$status_list[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_MODULE_STATUS_WARNING] = __('Warning');
|
||||
$status_list[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
|
||||
$status_list[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_MODULE_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
|
||||
$table->data['form_modules_3'][1] = html_print_select(
|
||||
$status_list,
|
||||
'status_module',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_MODULE_STATUS_ALL,
|
||||
true
|
||||
$table->cellclass[4][1] = 'select_agents_row';
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_list,
|
||||
'status_agents',
|
||||
'selected',
|
||||
'',
|
||||
__('All'),
|
||||
AGENT_STATUS_ALL,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
$table->data['form_modules_3'][3] = '';
|
||||
|
||||
$table->rowstyle['form_modules_filter'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_filter'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_filter'][0] = __('Filter Modules');
|
||||
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
|
||||
|
||||
$table->rowstyle['form_modules_2'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
|
||||
$table->data['form_modules_2'][0] = __('Modules');
|
||||
$table->data['form_modules_2'][1] = html_print_select(
|
||||
$modules,
|
||||
'module_name[]',
|
||||
$module_name,
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_modules_2'][2] = __('When select modules');
|
||||
$table->data['form_modules_2'][2] .= '<br>';
|
||||
$table->data['form_modules_2'][2] .= html_print_select(
|
||||
[
|
||||
'common' => __('Show common agents'),
|
||||
'all' => __('Show all agents'),
|
||||
],
|
||||
'agents_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
$table->rowclass[5] = 'select_modules_row select_modules_row_2';
|
||||
$table->data[5][0] = html_print_label_input_block(
|
||||
__('Filter Modules'),
|
||||
html_print_input_text('filter_modules', '', '', 20, 255, true)
|
||||
);
|
||||
$table->data['form_modules_2'][3] = html_print_select(
|
||||
[],
|
||||
'agents[]',
|
||||
$agents_select,
|
||||
false,
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
|
||||
$table->data[5][1] = html_print_label_input_block(
|
||||
__('When select modules'),
|
||||
html_print_select(
|
||||
[
|
||||
'common' => __('Show common agents'),
|
||||
'all' => __('Show all agents'),
|
||||
],
|
||||
'agents_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowclass[6] = 'select_modules_row select_modules_row_2';
|
||||
$table->data[6][0] = html_print_label_input_block(
|
||||
__('Modules'),
|
||||
html_print_select(
|
||||
$modules,
|
||||
'module_name[]',
|
||||
$module_name,
|
||||
false,
|
||||
__('Select'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'")
|
||||
);
|
||||
|
||||
$table->data[6][1] = html_print_label_input_block(
|
||||
__('Agents'),
|
||||
html_print_select(
|
||||
[],
|
||||
'agents[]',
|
||||
$agents_select,
|
||||
false,
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
|
||||
$tags = tags_get_user_tags();
|
||||
$table->rowstyle['form_agents_4'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_4'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_4'][0] = __('Tags');
|
||||
$table->data['form_agents_4'][1] = html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
$table->rowclass[7] = 'select_agents_row select_agents_row_2';
|
||||
$table->colspan[7][0] = 2;
|
||||
$table->data[7][0] = html_print_label_input_block(
|
||||
__('Tags'),
|
||||
html_print_select(
|
||||
$tags,
|
||||
'tags[]',
|
||||
$tags_name,
|
||||
false,
|
||||
__('Any'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'overflow-x: hidden;white-space: nowrap;max-width: 1136px;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowstyle['form_agents_filter'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_filter'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_filter'][0] = __('Filter Agents');
|
||||
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||
|
||||
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
|
||||
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
|
||||
$table->data['form_agents_3'][0] = __('Agents');
|
||||
$table->data['form_agents_3'][1] = html_print_select(
|
||||
$agents,
|
||||
'id_agents[]',
|
||||
$agents_id,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_agents_3'][2] = __('When select agents');
|
||||
$table->data['form_agents_3'][2] .= '<br>';
|
||||
$table->data['form_agents_3'][2] .= html_print_select(
|
||||
[
|
||||
'common' => __('Show common modules'),
|
||||
'all' => __('Show all modules'),
|
||||
'unknown' => __('Show unknown and not init modules'),
|
||||
],
|
||||
'modules_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data['form_agents_3'][3] = html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
$modules_select,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
$table->rowclass[8] = 'select_agents_row select_agents_row_2';
|
||||
$table->data[8][0] = html_print_label_input_block(
|
||||
__('Filter Agents'),
|
||||
html_print_input_text('filter_agents', '', '', 20, 255, true)
|
||||
);
|
||||
|
||||
$table->data[8][1] = html_print_label_input_block(
|
||||
__('When select agents'),
|
||||
html_print_select(
|
||||
[
|
||||
'common' => __('Show common modules'),
|
||||
'all' => __('Show all modules'),
|
||||
'unknown' => __('Show unknown and not init modules'),
|
||||
],
|
||||
'modules_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowclass[9] = 'select_agents_row select_agents_row_2';
|
||||
$table->data[9][0] = html_print_label_input_block(
|
||||
__('Agents'),
|
||||
html_print_select(
|
||||
$agents,
|
||||
'id_agents[]',
|
||||
$agents_id,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:100%;white-space: nowrap;max-width: 1136px;'
|
||||
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'")
|
||||
);
|
||||
|
||||
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
|
||||
$table->data[9][1] = html_print_label_input_block(
|
||||
__('Modules'),
|
||||
html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
$modules_select,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form method="post" class="max_floating_element_size" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
|
||||
html_print_table($table);
|
||||
|
||||
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
|
||||
|
@ -617,7 +654,9 @@ $(document).ready (function () {
|
|||
$("#module_name").trigger('change');
|
||||
} else {
|
||||
$("#module_name option").prop('selected', false);
|
||||
$("#module_name").trigger('change');
|
||||
if ($('#agents_selection_mode :selected').val() === 'all'){
|
||||
$("#module_name").trigger('change');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -760,14 +799,6 @@ $(document).ready (function () {
|
|||
else if (this.id == "checkbox-recursion") {
|
||||
$("#groups_select").trigger("change");
|
||||
}
|
||||
else {
|
||||
if (this.checked) {
|
||||
$(".select_agents_row_2").css('display', 'none');
|
||||
}
|
||||
else {
|
||||
$(".select_agents_row_2").css('display', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -174,6 +174,13 @@ if ($access_console_node === true) {
|
|||
}
|
||||
|
||||
$sub = [];
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
$sub['wizard']['text'] = __('Configuration wizard');
|
||||
$sub['wizard']['id'] = 'conf_wizard';
|
||||
$sub['wizard']['type'] = 'direct';
|
||||
$sub['wizard']['subtype'] = 'nolink_no_arrow';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub['templates']['text'] = __('Templates');
|
||||
$sub['templates']['id'] = 'Templates';
|
||||
|
@ -620,3 +627,55 @@ if ((bool) $config['pure'] === false) {
|
|||
}
|
||||
|
||||
echo '<div id="about-div"></div>';
|
||||
// Need to be here because the translate string.
|
||||
if (check_acl($config['id_user'], $group, 'AW')) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$("#conf_wizard").click(function() {
|
||||
$("#conf_wizard").addClass("selected");
|
||||
|
||||
if (!$("#welcome_modal_window").length) {
|
||||
$(document.body).append('<div id="welcome_modal_window"></div>');
|
||||
$(document.body).append(
|
||||
$('<link rel="stylesheet" type="text/css" />').attr(
|
||||
"href",
|
||||
"include/styles/new_installation_welcome_window.css"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
load_modal({
|
||||
target: $('#welcome_modal_window'),
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
modal: {
|
||||
title: "<?php echo __('Welcome to').' '.io_safe_output(get_product_name()); ?>",
|
||||
cancel: '<?php echo __('Do not show anymore'); ?>',
|
||||
ok: '<?php echo __('Close'); ?>'
|
||||
},
|
||||
onshow: {
|
||||
page: 'include/ajax/welcome_window',
|
||||
method: 'loadWelcomeWindow',
|
||||
},
|
||||
oncancel: {
|
||||
page: 'include/ajax/welcome_window',
|
||||
title: "<?php echo __('Cancel Configuration Window'); ?>",
|
||||
method: 'cancelWelcome',
|
||||
confirm: function (fn) {
|
||||
confirmDialog({
|
||||
title: '<?php echo __('Are you sure?'); ?>',
|
||||
message: '<?php echo __('Are you sure you want to cancel this tutorial?'); ?>',
|
||||
ok: '<?php echo __('OK'); ?>',
|
||||
cancel: '<?php echo __('Cancel'); ?>',
|
||||
onAccept: function() {
|
||||
// Continue execution.
|
||||
fn();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
|
|
@ -38,6 +38,9 @@ require_once $config['homedir'].'/include/db/oracle.php';
|
|||
// Login check.
|
||||
check_login();
|
||||
|
||||
// Validate enterprise.
|
||||
$is_enterprise = enterprise_installed();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'RW')
|
||||
&& ! check_acl($config['id_user'], 0, 'RM')
|
||||
) {
|
||||
|
@ -3682,25 +3685,28 @@ $class = 'databox filters';
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_landscape" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Show item in landscape format (only PDF)');
|
||||
<?php
|
||||
if ($is_enterprise) {
|
||||
?>
|
||||
</td>
|
||||
<td><?php html_print_checkbox_switch('landscape', 1, $landscape); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_pagebreak" class="datos">
|
||||
<td class="bolder">
|
||||
<tr id="row_landscape" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Show item in landscape format (only PDF)');
|
||||
?>
|
||||
</td>
|
||||
<td><?php html_print_checkbox_switch('landscape', 1, $landscape); ?></td>
|
||||
</tr>
|
||||
<tr id="row_pagebreak" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Page break at the end of the item (only PDF)');
|
||||
?>
|
||||
</td>
|
||||
<td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
echo __('Page break at the end of the item (only PDF)');
|
||||
?>
|
||||
</td>
|
||||
<td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td>
|
||||
</tr>
|
||||
|
||||
}
|
||||
?>
|
||||
<tr id="row_agents_inventory_display_options" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
|
|
|
@ -681,15 +681,19 @@ $table->data[$i++][] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
$help_tip = ui_print_help_tip(
|
||||
__('This log is recommended to be DISABLED by default due to the large amount of debug data it generates.'),
|
||||
true
|
||||
);
|
||||
$table->data[$i][] = html_print_label_input_block(
|
||||
__('Enable console log'),
|
||||
__('Enable console log').$help_tip,
|
||||
html_print_checkbox_switch(
|
||||
'console_log_enabled',
|
||||
1,
|
||||
$config['console_log_enabled'],
|
||||
true
|
||||
).ui_print_input_placeholder(
|
||||
__('Log location').': pandora_console/log/console.log',
|
||||
__('Log location').': /var/log/php-fpm/error.log',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
|
|
@ -1137,6 +1137,9 @@ class DiscoveryTaskList extends HTML
|
|||
case DISCOVERY_CLOUD_AWS_S3:
|
||||
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&sub=s3&page=0';
|
||||
|
||||
case DISCOVERY_CLOUD_GCP_COMPUTE_ENGINE:
|
||||
return 'wiz=cloud&mode=gcp&ki='.$task['auth_strings'].'&sub=compute&page=0';
|
||||
|
||||
default:
|
||||
return 'wiz=cloud';
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>EB094270-FB38-4A58-BE94-D40EA44EA568</title>
|
||||
<g id="Agentes" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="1.a1-Agentes---Listado" transform="translate(-362.500000, -268.000000)" fill="#C1CCDC">
|
||||
<g id="Contenido" transform="translate(310.000000, 188.000000)">
|
||||
<g transform="translate(20.000000, 20.000000)" id="Agentes">
|
||||
<g id="Content" transform="translate(29.308511, 20.000000)">
|
||||
<g id="Top" transform="translate(0.191489, 0.000000)">
|
||||
<g id="Icons/Light/24/example" transform="translate(3.000000, 40.000000)">
|
||||
<circle id="Oval" cx="6" cy="6" r="6"></circle>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -17,6 +17,8 @@ $save_custom_graph = (bool) get_parameter('save_custom_graph');
|
|||
$print_custom_graph = (bool) get_parameter('print_custom_graph', false);
|
||||
$print_sparse_graph = (bool) get_parameter('print_sparse_graph');
|
||||
$get_graphs = (bool) get_parameter('get_graphs_container');
|
||||
$width = get_parameter('width', 0);
|
||||
$height = get_parameter('height', 0);
|
||||
|
||||
if ($save_custom_graph) {
|
||||
$return = [];
|
||||
|
@ -25,8 +27,6 @@ if ($save_custom_graph) {
|
|||
$name = get_parameter('name', '');
|
||||
$description = get_parameter('description', '');
|
||||
$stacked = get_parameter('stacked', CUSTOM_GRAPH_LINE);
|
||||
$width = get_parameter('width', 0);
|
||||
$height = get_parameter('height', 0);
|
||||
$events = get_parameter('events', 0);
|
||||
$period = get_parameter('period', 0);
|
||||
$fullscale = get_parameter('fullscale', 0);
|
||||
|
@ -126,6 +126,8 @@ if ($print_sparse_graph) {
|
|||
'force_interval' => '',
|
||||
'time_interval' => 300,
|
||||
'array_data_create' => 0,
|
||||
'height' => $height,
|
||||
'width' => $width,
|
||||
];
|
||||
|
||||
echo grafico_modulo_sparse($params);
|
||||
|
|
|
@ -97,6 +97,18 @@ if (check_login()) {
|
|||
return;
|
||||
}
|
||||
|
||||
$id_plugin = get_parameter('id_plugin', 0);
|
||||
$id_module_plugin = db_get_value(
|
||||
'id_plugin',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$get_module_macros
|
||||
);
|
||||
if ($id_plugin !== $id_module_plugin) {
|
||||
$get_plugin_macros = true;
|
||||
$get_module_macros = 0;
|
||||
}
|
||||
|
||||
if ($get_plugin_macros) {
|
||||
if (https_is_running()) {
|
||||
header('Content-type: application/json');
|
||||
|
|
|
@ -182,6 +182,7 @@ try {
|
|||
|
||||
if ($method == 'snmp_browser_create_modules') {
|
||||
// Get target ids from form.
|
||||
$use_agent_ip = get_parameter('use_agent_ip', '');
|
||||
$id_items = get_parameter('id_item2', null);
|
||||
$id_target = null;
|
||||
if (empty($id_items) === false) {
|
||||
|
@ -209,7 +210,8 @@ try {
|
|||
$module_target,
|
||||
$snmp_conf_values,
|
||||
$id_target,
|
||||
$server_to_exec
|
||||
$server_to_exec,
|
||||
$use_agent_ip
|
||||
);
|
||||
|
||||
// Return fail modules for error/success message.
|
||||
|
|
|
@ -0,0 +1,190 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to schedule tasks on Pandora FMS Console
|
||||
*
|
||||
* @category Wizard
|
||||
* @package Pandora FMS
|
||||
* @subpackage Host&Devices
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 PandoraFMS S.L.
|
||||
* 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.
|
||||
require_once '../functions.php';
|
||||
require_once '../functions_welcome_wizard.php';
|
||||
global $config;
|
||||
|
||||
$check_web = get_parameter('check_web', 0);
|
||||
$check_connectivity = get_parameter('check_connectivity', 0);
|
||||
$create_net_scan = get_parameter('create_net_scan', 0);
|
||||
$create_mail_alert = get_parameter('create_mail_alert', 0);
|
||||
$create_unknown_template_alert = get_parameter('create_unknown_template_alert', 0);
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
if ($check_web) {
|
||||
include_once '../functions_api.php';
|
||||
include_once '../functions_servers.php';
|
||||
|
||||
$status_webserver = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_WEB], 'status')['status'];
|
||||
if ($status_webserver === '1') {
|
||||
$name = array_keys(servers_get_names())[0];
|
||||
$id_group = get_parameter('id_group', 4);
|
||||
|
||||
$array_other['data'] = [
|
||||
'Web monitoring',
|
||||
'',
|
||||
2,
|
||||
$id_group,
|
||||
0,
|
||||
30,
|
||||
30,
|
||||
9,
|
||||
$name,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__('Agent Web monitoring created on welcome'),
|
||||
];
|
||||
|
||||
$id_agent = api_set_new_agent(0, '', $array_other, '', true);
|
||||
if ($id_agent > 0) {
|
||||
$module_name = get_parameter('module_name', 'Web_monitoring_module');
|
||||
$text_to_search = get_parameter('text_to_search', '');
|
||||
$url_goliat = get_parameter('url_goliat', 'https://pandorafms.com/en/');
|
||||
$module_latency = create_module_latency_goliat($id_agent, $module_name, $id_group, $url_goliat, $text_to_search);
|
||||
$module_status = create_module_status_goliat($id_agent, $module_name, $id_group, $url_goliat, $text_to_search);
|
||||
if ($module_latency > 0 && $module_status > 0) {
|
||||
ui_print_success_message(__('Your check has been created, <a href='.ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agent).'>click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('The Name is not valid for the modules.'));
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Web server is not enabled.'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_connectivity) {
|
||||
include_once '../functions_api.php';
|
||||
include_once '../functions_servers.php';
|
||||
|
||||
$status_newtwork = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_NETWORK], 'status')['status'];
|
||||
$status_pluggin = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_PLUGIN], 'status')['status'];
|
||||
if ($status_newtwork === '1' && $status_pluggin === '1') {
|
||||
$name = array_keys(servers_get_names())[0];
|
||||
$id_group = get_parameter('id_group', 4);
|
||||
$agent_name = get_parameter('agent_name', __('Agent check connectivity'));
|
||||
|
||||
$array_other['data'] = [
|
||||
$agent_name,
|
||||
'',
|
||||
2,
|
||||
$id_group,
|
||||
0,
|
||||
30,
|
||||
30,
|
||||
9,
|
||||
$name,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
__('Basic connectivity'),
|
||||
];
|
||||
|
||||
$id_agent = api_set_new_agent(0, '', $array_other, '', true);
|
||||
if ($id_agent > 0) {
|
||||
$ip_target = get_parameter('ip_target', '127.0.0.1');
|
||||
$basic_network = create_module_basic_network($id_agent, $id_group, $ip_target);
|
||||
$latency_network = create_module_latency_network($id_agent, $id_group, $ip_target);
|
||||
$packet_lost = create_module_packet_lost($id_agent, $id_group, $ip_target);
|
||||
if ($basic_network > 0 && $latency_network > 0 && $packet_lost > 0) {
|
||||
ui_print_success_message(__('Your check has been created, <a href='.ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agent).'>click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('The Name is not valid for the modules.'));
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Web server is not enabled.'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($create_net_scan) {
|
||||
$ip_target = get_parameter('ip_target', '192.168.10.0/24');
|
||||
$id_net_scan = create_net_scan($ip_target);
|
||||
if ($id_net_scan > 0) {
|
||||
$id_recon_server = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_DISCOVERY], 'id_server')['id_server'];
|
||||
ui_print_success_message(__('Basic net created and scan in progress. <a href='.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist&server_id='.$id_recon_server.'&force='.$id_net_scan).'>Click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
|
||||
} else {
|
||||
ui_print_error_message(__('Basic net already exists. <a href='.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'>Click here to view the data</a>'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($create_mail_alert) {
|
||||
include_once '../functions_alerts.php';
|
||||
$id_action = db_get_row_filter('talert_actions', ['name' => 'Email to '.$config['id_user']], 'id')['id'];
|
||||
if (!$id_action) {
|
||||
$al_action = alerts_get_alert_action($id);
|
||||
$id_action = alerts_clone_alert_action(1, $al_action['id_group'], 'Email to '.$config['id_user']);
|
||||
}
|
||||
|
||||
$id_alert_template = get_parameter('id_condition', 0);
|
||||
$id_agent_module = get_parameter('id_agent_module', 0);
|
||||
|
||||
$exist = db_get_value_sql(
|
||||
sprintf(
|
||||
'SELECT COUNT(id)
|
||||
FROM talert_template_modules
|
||||
WHERE id_agent_module = %d
|
||||
AND id_alert_template = %d
|
||||
AND id_policy_alerts = 0
|
||||
',
|
||||
$id_agent_module,
|
||||
$id_alert_template
|
||||
)
|
||||
);
|
||||
|
||||
if ($exist > 0) {
|
||||
ui_print_error_message(__('Alert already exists. <a href='.ui_get_full_url('index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure=0').'>Click here to view the data</a>'));
|
||||
} else {
|
||||
$id = alerts_create_alert_agent_module($id_agent_module, $id_alert_template);
|
||||
if ($id !== false) {
|
||||
$values = [];
|
||||
$values['fires_min'] = (int) get_parameter('fires_min');
|
||||
$values['fires_max'] = (int) get_parameter('fires_max');
|
||||
$values['module_action_threshold'] = (int) 300;
|
||||
|
||||
$alert_created = alerts_add_alert_agent_module_action($id, $id_action, $values);
|
||||
}
|
||||
}
|
||||
|
||||
if ($alert_created === true) {
|
||||
ui_print_success_message(__('Congratulations, you have already created a simple alert. <a href='.ui_get_full_url('index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure=0').'>You can see it.</a> Pandora FMS alerts are very flexible, you can do many more things with them, we recommend you to read the <a href="https://pandorafms.com/manual/start?id=en/documentation/04_using/01_alerts">documentation</a> for more information. You can create advanced alerts from <a href='.ui_get_full_url('index.php?sec=galertas&sec2=godmode/alerts/alert_actions').'>here</a>.'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($create_unknown_template_alert) {
|
||||
if (is_array(alerts_get_alert_templates(['name' => io_safe_input('Unknown condition')]))) {
|
||||
echo 1;
|
||||
} else {
|
||||
echo create_template_alert_unknown();
|
||||
}
|
||||
}
|
|
@ -35,6 +35,13 @@ if (is_ajax() === false) {
|
|||
}
|
||||
|
||||
$ajaxPage = 'include/ajax/welcome_window';
|
||||
// Ajax controller.
|
||||
$method = get_parameter('method', '');
|
||||
|
||||
if ($method === 'loadWelcomeWindow') {
|
||||
unset($config['welcome_state']);
|
||||
}
|
||||
|
||||
|
||||
// Control call flow.
|
||||
try {
|
||||
|
@ -44,9 +51,6 @@ try {
|
|||
exit;
|
||||
}
|
||||
|
||||
// Ajax controller.
|
||||
$method = get_parameter('method', '');
|
||||
|
||||
if (method_exists($welcome_actions, $method) === true) {
|
||||
if ($welcome_actions->ajaxMethod($method) === true) {
|
||||
$welcome_actions->{$method}();
|
||||
|
|
|
@ -129,6 +129,14 @@ if (empty($apiPassword) === true
|
|||
// Compat.
|
||||
$config['id_user'] = 'admin';
|
||||
$correctLogin = true;
|
||||
// Bypass credentials if server-auth and api-pass are correct.
|
||||
} else if (($config['server_unique_identifier'] === get_parameter('server_auth'))
|
||||
&& ($api_password === $apiPassword)
|
||||
&& ((bool) isInACL($ipOrigin) === true)
|
||||
) {
|
||||
$config['id_usuario'] = 'admin';
|
||||
$config['id_user'] = 'admin';
|
||||
$correctLogin = true;
|
||||
} else if ((bool) isInACL($ipOrigin) === true) {
|
||||
// External access.
|
||||
// Token is valid. Bypass the credentials.
|
||||
|
|
|
@ -165,6 +165,9 @@ $hack_metaconsole = (is_metaconsole() === true) ? '../../' : '';
|
|||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.symbol.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.exportdata.pandora.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.axislabels.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
||||
<script type="text/javascript">
|
||||
var phpTimezone = "<?php echo date_default_timezone_get(); ?>";
|
||||
</script>
|
||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/pandora.flot.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/chartjs/chart.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
||||
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/chartjs/chartjs-plugin-datalabels.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230712';
|
||||
$build_version = 'PC230717';
|
||||
$pandora_version = 'v7.0NG.772';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -4348,6 +4348,11 @@ function generator_chart_to_pdf(
|
|||
curl_close($curl);
|
||||
|
||||
$page->setHtml($response);
|
||||
/*
|
||||
//For debug url with parameters.
|
||||
$navigation = $page->navigate($url.'?data='.urlencode(json_encode($data)));
|
||||
$navigation->waitForNavigation(Page::DOM_CONTENT_LOADED);
|
||||
*/
|
||||
|
||||
// Dynamic.
|
||||
$dynamic_height = $page->evaluate('document.getElementById("container-chart-generator-item").clientHeight')->getReturnValue();
|
||||
|
|
|
@ -455,7 +455,7 @@ function alerts_delete_alert_action($id_alert_action)
|
|||
*
|
||||
* @return mixed Id of the cloned action or false in case of fail.
|
||||
*/
|
||||
function alerts_clone_alert_action($id_alert_action, $id_group)
|
||||
function alerts_clone_alert_action($id_alert_action, $id_group, $copy_name='')
|
||||
{
|
||||
$id_alert_action = safe_int($id_alert_action, 1);
|
||||
if (empty($id_alert_action)) {
|
||||
|
@ -474,7 +474,13 @@ function alerts_clone_alert_action($id_alert_action, $id_group)
|
|||
|
||||
unset($action['id']);
|
||||
|
||||
return alerts_create_alert_action($action['name'].' '.__('copy'), $action['id_alert_command'], $action);
|
||||
if ($copy_name !== '') {
|
||||
$copy_name = $copy_name;
|
||||
} else {
|
||||
$copy_name = $action['name'].' '.__('copy');
|
||||
}
|
||||
|
||||
return alerts_create_alert_action($copy_name, $action['id_alert_command'], $action);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1916,7 +1916,7 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
|
|||
*
|
||||
* @param $thrash3 Don't use.
|
||||
*/
|
||||
function api_set_new_agent($id_node, $thrash2, $other, $trhash3)
|
||||
function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -2038,13 +2038,17 @@ function api_set_new_agent($id_node, $thrash2, $other, $trhash3)
|
|||
}
|
||||
}
|
||||
|
||||
returnData(
|
||||
'string',
|
||||
[
|
||||
'type' => 'string',
|
||||
'data' => $id_agente,
|
||||
]
|
||||
);
|
||||
if ($return === false) {
|
||||
returnData(
|
||||
'string',
|
||||
[
|
||||
'type' => 'string',
|
||||
'data' => $id_agente,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
return $id_agente;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
returnError($e->getMessage());
|
||||
return;
|
||||
|
|
|
@ -671,6 +671,7 @@ function html_print_select_groups(
|
|||
step: params.page || 1,
|
||||
strict: "<?php echo $strict_user; ?>",
|
||||
not_condition: $('#not_condition_switch').prop('checked'),
|
||||
returnAllGroup: <?php echo (int) $returnAllGroup; ?>
|
||||
}
|
||||
|
||||
return query;
|
||||
|
@ -7141,3 +7142,44 @@ function html_print_code_picker(
|
|||
echo $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function html_print_wizard_diagnosis(
|
||||
$title,
|
||||
$id_button,
|
||||
$description='',
|
||||
$status=true,
|
||||
$return=false,
|
||||
) {
|
||||
$button = '';
|
||||
if ($status === true) {
|
||||
$status = 'Connected';
|
||||
$img = '/images/configuration@svg.svg';
|
||||
} else {
|
||||
$status = 'Disconnected';
|
||||
$img = '/images/change-active.svg';
|
||||
}
|
||||
|
||||
$button = html_print_image(
|
||||
$img,
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter float-right mrgn_right_10px',
|
||||
'id' => $id_button,
|
||||
]
|
||||
);
|
||||
|
||||
$output = '<div class="rectangle rectangle_'.$status.'">
|
||||
<span class="status '.$status.'">'.__($status).$button.'</span>
|
||||
<div class="title">'.html_print_image('/images/circle_title.svg', true, ['class' => 'invert_filter']).'<span>'.$title.'</span></div>
|
||||
<div class="description">
|
||||
<span>'.$description.'</span>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
if ($return === true) {
|
||||
return $output;
|
||||
} else {
|
||||
echo $output;
|
||||
}
|
||||
}
|
|
@ -330,6 +330,8 @@ function menu_print_menu(&$menu)
|
|||
|
||||
if (isset($sub['subtype']) && $sub['subtype'] == 'nolink') {
|
||||
$submenu_output .= '<div class=" SubNoLink '.$sub_tree_class.'"><span class="w70p span_has_menu_text">'.$sub['text'].'</span><div class="w21p arrow_menu_down"></div></div>';
|
||||
} else if (isset($sub['subtype']) && $sub['subtype'] == 'nolink_no_arrow') {
|
||||
$submenu_output .= '<div class=" SubNoLink '.$sub_tree_class.'"><span class="w70p span_has_menu_text">'.$sub['text'].'</span><div class="w21p"></div></div>';
|
||||
} else if (isset($sub['subtype']) && $sub['subtype'] == 'new_blank') {
|
||||
$submenu_output .= '<a href="'.$subsec2.'" target="_blank"><div class="'.$sub_tree_class.'">'.$sub['text'].'</div></a>';
|
||||
} else {
|
||||
|
|
|
@ -743,7 +743,8 @@ function modules_create_agent_module(
|
|||
string $name,
|
||||
array $values=[],
|
||||
bool $disableACL=false,
|
||||
$tags=false
|
||||
$tags=false,
|
||||
$use_agent_ip=false,
|
||||
) {
|
||||
global $config;
|
||||
|
||||
|
@ -785,6 +786,10 @@ function modules_create_agent_module(
|
|||
return ERR_EXIST;
|
||||
}
|
||||
|
||||
if ($use_agent_ip === true) {
|
||||
$values['ip_target'] = agents_get_address($id_agent);
|
||||
}
|
||||
|
||||
// Encrypt passwords.
|
||||
if (isset($values['plugin_pass']) === true) {
|
||||
// Avoid two times encryption.
|
||||
|
|
|
@ -1411,3 +1411,24 @@ function servers_get_master()
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if all servers are up.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function check_all_servers_up()
|
||||
{
|
||||
$status = true;
|
||||
|
||||
$servers = servers_get_info();
|
||||
|
||||
foreach ($servers as $server) {
|
||||
if ($server['status'] !== '1') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
|
|
@ -1291,7 +1291,8 @@ function snmp_browser_create_modules_snmp(
|
|||
string $module_target,
|
||||
array $snmp_values,
|
||||
?array $id_target,
|
||||
?string $server_to_exec=null
|
||||
?string $server_to_exec=null,
|
||||
?string $use_agent_ip=''
|
||||
) {
|
||||
$target_ip = null;
|
||||
$target_port = null;
|
||||
|
@ -1350,6 +1351,12 @@ function snmp_browser_create_modules_snmp(
|
|||
}
|
||||
}
|
||||
|
||||
if (empty($use_agent_ip) === false) {
|
||||
$use_agent_ip = true;
|
||||
} else {
|
||||
$use_agent_ip = false;
|
||||
}
|
||||
|
||||
$fail_modules = [];
|
||||
|
||||
foreach ($targets_oids as $key => $target_oid) {
|
||||
|
@ -1514,7 +1521,7 @@ function snmp_browser_create_modules_snmp(
|
|||
'history_data' => 1,
|
||||
];
|
||||
foreach ($id_target as $agent) {
|
||||
$ids[] = modules_create_agent_module($agent, $oid['oid'], $values);
|
||||
$ids[] = modules_create_agent_module($agent, $oid['oid'], $values, false, false, $use_agent_ip);
|
||||
}
|
||||
} else if ($module_target == 'policy') {
|
||||
// Policies only in enterprise version.
|
||||
|
@ -1803,6 +1810,16 @@ function snmp_browser_print_create_module_massive(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Use agent IP'),
|
||||
html_print_checkbox(
|
||||
'use_agent_ip',
|
||||
1,
|
||||
false,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$output .= html_print_table($table, true);
|
||||
|
||||
// SNMP extradata.
|
||||
|
|
|
@ -795,8 +795,14 @@ function tags_get_acl_tags(
|
|||
|
||||
$acltags = [];
|
||||
foreach ($raw_acltags as $group => $taglist) {
|
||||
if (empty($id_group) === false && array_key_exists($group, $id_group) === false) {
|
||||
continue;
|
||||
if ($return_mode === 'module_condition') {
|
||||
if (!empty($id_group) && !in_array($group, $id_group)) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (empty($id_group) === false && array_key_exists($group, $id_group) === false) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($taglist)) {
|
||||
|
|
|
@ -650,16 +650,28 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
// Agent name.
|
||||
$row = [];
|
||||
$row['title'] = __('Agent name');
|
||||
$row['data'] = html_print_anchor(
|
||||
[
|
||||
'href' => 'javascript:void(0)',
|
||||
'title' => __('Click here for view this agent'),
|
||||
'class' => 'font_11',
|
||||
'content' => $cellName,
|
||||
'onClick' => "sendHash('".$urlAgent."')",
|
||||
],
|
||||
true
|
||||
);
|
||||
if (is_metaconsole() === true) {
|
||||
$row['data'] = html_print_anchor(
|
||||
[
|
||||
'href' => 'javascript:void(0)',
|
||||
'title' => __('Click here for view this agent'),
|
||||
'class' => 'font_11',
|
||||
'content' => $cellName,
|
||||
'onClick' => "sendHash('".$urlAgent."')",
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$row['data'] = html_print_anchor(
|
||||
[
|
||||
'href' => $urlAgent,
|
||||
'title' => __('Click here for view this agent'),
|
||||
'class' => 'font_11',
|
||||
'content' => $cellName,
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->data['name'] = $row;
|
||||
|
||||
|
|
|
@ -3324,6 +3324,32 @@ function ui_print_module_status(
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns html code to print a shape for a module.
|
||||
*
|
||||
* @param integer $color Hex color.
|
||||
* @param boolean $return True or false.
|
||||
* @param string $class Custom class or use defined.
|
||||
* @param string $div_content Content.
|
||||
*
|
||||
* @return string HTML code for shape.
|
||||
*/
|
||||
function ui_print_diagnosis_status(
|
||||
$color,
|
||||
$return=false,
|
||||
$class='status_rounded_rectangles',
|
||||
$div_content=''
|
||||
) {
|
||||
$output = '<div style="background: '.$color.'" class="'.$class.'">'.$div_content.'</div>';
|
||||
|
||||
if ($return === false) {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the shape of an image by assigning it a CSS class. Prints an image with CSS representing a status.
|
||||
*
|
||||
|
@ -4343,7 +4369,8 @@ function ui_print_datatable(array $parameters)
|
|||
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
|
||||
$(".action_buttons_right_content").html("<div class=\"pagination-child-div\"></div>");
|
||||
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").attr("style","margin-right: 10px;"));
|
||||
let original_styles = $("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").attr("style");
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_paginate.paging_simple_numbers").attr("style", original_styles + " margin-right: 10px;"));
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_length"));
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dt-buttons"));
|
||||
$(".pagination-child-div").append($("#'.$table_id.'_wrapper > .dataTables_filter"));
|
||||
|
|
|
@ -0,0 +1,568 @@
|
|||
<?php
|
||||
/**
|
||||
* Agents Functions.
|
||||
*
|
||||
* @category Agents functions.
|
||||
* @package Pandora FMS
|
||||
* @subpackage User interface.
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 PandoraFMS 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.
|
||||
|
||||
|
||||
/**
|
||||
* Create_module_latency_goliat and return module id.
|
||||
*
|
||||
* @param mixed $id_agent Id agent.
|
||||
* @param mixed $module_name Module name.
|
||||
* @param mixed $id_group Id group.
|
||||
* @param mixed $url_search Url to search.
|
||||
* @param mixed $string_search Text to search.
|
||||
*
|
||||
* @return interger Module id.
|
||||
*/
|
||||
function create_module_latency_goliat($id_agent, $module_name, $id_group, $url_search, $string_search='')
|
||||
{
|
||||
if ($string_search !== '') {
|
||||
$str_search = 'check_string '.$string_search.'';
|
||||
}
|
||||
|
||||
include_once 'include/functions_modules.php';
|
||||
|
||||
$array_values = [
|
||||
'id_tipo_modulo' => '30',
|
||||
'descripcion' => '',
|
||||
'max' => '0',
|
||||
'min' => '0',
|
||||
'snmp_oid' => '',
|
||||
'snmp_community' => 'public',
|
||||
'id_module_group' => $id_group,
|
||||
'module_interval' => '300',
|
||||
'module_ff_interval' => '0',
|
||||
'ip_target' => '',
|
||||
'tcp_port' => '0',
|
||||
'tcp_rcv' => '',
|
||||
'tcp_send' => '',
|
||||
'id_export' => '0',
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '0',
|
||||
'plugin_parameter' => 'task_begin
|
||||
get '.$url_search.'
|
||||
resource 1
|
||||
'.$str_search.'
|
||||
task_end',
|
||||
'id_plugin' => '0',
|
||||
'post_process' => '0',
|
||||
'prediction_module' => '0',
|
||||
'max_timeout' => '0',
|
||||
'max_retries' => '0',
|
||||
'disabled' => '',
|
||||
'id_modulo' => '7',
|
||||
'custom_id' => '',
|
||||
'history_data' => '1',
|
||||
'dynamic_interval' => '0',
|
||||
'dynamic_max' => '0',
|
||||
'dynamic_min' => '0',
|
||||
'dynamic_two_tailed' => '0',
|
||||
'parent_module_id' => '0',
|
||||
'min_warning' => '0',
|
||||
'max_warning' => '0',
|
||||
'str_warning' => '',
|
||||
'min_critical' => '0',
|
||||
'max_critical' => '0',
|
||||
'str_critical' => '',
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_integer_1' => '0',
|
||||
'custom_integer_2' => '0',
|
||||
'min_ff_event' => '0',
|
||||
'min_ff_event_normal' => '0',
|
||||
'min_ff_event_warning' => '0',
|
||||
'min_ff_event_critical' => '0',
|
||||
'ff_type' => '0',
|
||||
'each_ff' => '0',
|
||||
'ff_timeout' => '0',
|
||||
'unit' => '',
|
||||
'macros' => '',
|
||||
'quiet' => '0',
|
||||
'cps' => '0',
|
||||
'critical_instructions' => '',
|
||||
'warning_instructions' => '',
|
||||
'unknown_instructions' => '',
|
||||
'critical_inverse' => '0',
|
||||
'warning_inverse' => '0',
|
||||
'percentage_critical' => '0',
|
||||
'percentage_warning' => '0',
|
||||
'cron_interval' => '* * * * *',
|
||||
'id_category' => '0',
|
||||
'disabled_types_event' => '{\"going_unknown\":0}',
|
||||
'module_macros' => 'W10=',
|
||||
'warning_time' => '0',
|
||||
];
|
||||
return modules_create_agent_module($id_agent, $module_name.'_latency', $array_values);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create_module_status_goliat and return module id.
|
||||
*
|
||||
* @param mixed $id_agent Id agent.
|
||||
* @param mixed $module_name Module name.
|
||||
* @param mixed $id_group Id group.
|
||||
* @param mixed $url_search Url to search.
|
||||
* @param mixed $string_search Text to search.
|
||||
*
|
||||
* @return interger Module id.
|
||||
*/
|
||||
function create_module_status_goliat($id_agent, $module_name, $id_group, $url_search, $string_search='')
|
||||
{
|
||||
if ($string_search !== '') {
|
||||
$str_search = 'check_string '.$string_search.' ';
|
||||
}
|
||||
|
||||
include_once 'include/functions_modules.php';
|
||||
|
||||
$array_values = [
|
||||
'id_tipo_modulo' => '31',
|
||||
'descripcion' => '',
|
||||
'max' => '0',
|
||||
'min' => '0',
|
||||
'snmp_oid' => '',
|
||||
'snmp_community' => 'public',
|
||||
'id_module_group' => $id_group,
|
||||
'module_interval' => '300',
|
||||
'module_ff_interval' => '0',
|
||||
'ip_target' => '',
|
||||
'tcp_port' => '0',
|
||||
'tcp_rcv' => '',
|
||||
'tcp_send' => '',
|
||||
'id_export' => '0',
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '0',
|
||||
'plugin_parameter' => 'task_begin
|
||||
get '.$url_search.'
|
||||
resource 1
|
||||
'.$str_search.'
|
||||
task_end',
|
||||
'id_plugin' => '0',
|
||||
'post_process' => '0',
|
||||
'prediction_module' => '0',
|
||||
'max_timeout' => '0',
|
||||
'max_retries' => '0',
|
||||
'disabled' => '',
|
||||
'id_modulo' => '7',
|
||||
'custom_id' => '',
|
||||
'history_data' => '1',
|
||||
'dynamic_interval' => '0',
|
||||
'dynamic_max' => '0',
|
||||
'dynamic_min' => '0',
|
||||
'dynamic_two_tailed' => '0',
|
||||
'parent_module_id' => '0',
|
||||
'min_warning' => '0',
|
||||
'max_warning' => '0',
|
||||
'str_warning' => '',
|
||||
'min_critical' => '0',
|
||||
'max_critical' => '0',
|
||||
'str_critical' => '',
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_integer_1' => '0',
|
||||
'custom_integer_2' => '0',
|
||||
'min_ff_event' => '0',
|
||||
'min_ff_event_normal' => '0',
|
||||
'min_ff_event_warning' => '0',
|
||||
'min_ff_event_critical' => '0',
|
||||
'ff_type' => '0',
|
||||
'each_ff' => '0',
|
||||
'ff_timeout' => '0',
|
||||
'unit' => '',
|
||||
'macros' => '',
|
||||
'quiet' => '0',
|
||||
'cps' => '0',
|
||||
'critical_instructions' => '',
|
||||
'warning_instructions' => '',
|
||||
'unknown_instructions' => '',
|
||||
'critical_inverse' => '0',
|
||||
'warning_inverse' => '0',
|
||||
'percentage_critical' => '0',
|
||||
'percentage_warning' => '0',
|
||||
'cron_interval' => '* * * * *',
|
||||
'id_category' => '0',
|
||||
'disabled_types_event' => '{\"going_unknown\":0}',
|
||||
'module_macros' => 'W10=',
|
||||
'warning_time' => '0',
|
||||
];
|
||||
return modules_create_agent_module($id_agent, $module_name.'_status', $array_values);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create module basic network and return module id.
|
||||
*
|
||||
* @param mixed $id_agent Id agent.
|
||||
* @param mixed $id_group Id group.
|
||||
* @param mixed $ip_target Ip target.
|
||||
*
|
||||
* @return interger Module id.
|
||||
*/
|
||||
function create_module_basic_network($id_agent, $id_group, $ip_target)
|
||||
{
|
||||
include_once 'include/functions_modules.php';
|
||||
|
||||
$array_values = [
|
||||
'id_tipo_modulo' => '6',
|
||||
'descripcion' => 'Basic network check (ping)',
|
||||
'max' => '0',
|
||||
'min' => '0',
|
||||
'snmp_oid' => '',
|
||||
'snmp_community' => 'public',
|
||||
'id_module_group' => $id_group,
|
||||
'module_interval' => '300',
|
||||
'module_ff_interval' => '0',
|
||||
'ip_target' => $ip_target,
|
||||
'tcp_port' => '0',
|
||||
'tcp_rcv' => '',
|
||||
'tcp_send' => '',
|
||||
'id_export' => '0',
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '0',
|
||||
'plugin_parameter' => '',
|
||||
'id_plugin' => '0',
|
||||
'post_process' => '0',
|
||||
'prediction_module' => '0',
|
||||
'max_timeout' => '0',
|
||||
'max_retries' => '0',
|
||||
'disabled' => '',
|
||||
'id_modulo' => '2',
|
||||
'custom_id' => '',
|
||||
'history_data' => '1',
|
||||
'dynamic_interval' => '0',
|
||||
'dynamic_max' => '0',
|
||||
'dynamic_min' => '0',
|
||||
'dynamic_two_tailed' => '0',
|
||||
'parent_module_id' => '0',
|
||||
'min_warning' => '0',
|
||||
'max_warning' => '0',
|
||||
'str_warning' => '',
|
||||
'min_critical' => '0',
|
||||
'max_critical' => '0',
|
||||
'str_critical' => '',
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_integer_1' => '0',
|
||||
'custom_integer_2' => '0',
|
||||
'min_ff_event' => '0',
|
||||
'min_ff_event_normal' => '0',
|
||||
'min_ff_event_warning' => '0',
|
||||
'min_ff_event_critical' => '0',
|
||||
'ff_type' => '0',
|
||||
'each_ff' => '0',
|
||||
'ff_timeout' => '0',
|
||||
'unit' => '',
|
||||
'macros' => '',
|
||||
'quiet' => '0',
|
||||
'cps' => '0',
|
||||
'critical_instructions' => '',
|
||||
'warning_instructions' => '',
|
||||
'unknown_instructions' => '',
|
||||
'critical_inverse' => '0',
|
||||
'warning_inverse' => '0',
|
||||
'percentage_critical' => '0',
|
||||
'percentage_warning' => '0',
|
||||
'cron_interval' => '* * * * *',
|
||||
'id_category' => '0',
|
||||
'disabled_types_event' => '{\"going_unknown\":0}',
|
||||
'module_macros' => 'W10=',
|
||||
'warning_time' => '0',
|
||||
];
|
||||
return modules_create_agent_module($id_agent, 'Basic_Network_Check', $array_values);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create module latency network and return module id.
|
||||
*
|
||||
* @param mixed $id_agent Id agent.
|
||||
* @param mixed $id_group Id group.
|
||||
* @param mixed $ip_target Ip target.
|
||||
*
|
||||
* @return interger Module id.
|
||||
*/
|
||||
function create_module_latency_network($id_agent, $id_group, $ip_target)
|
||||
{
|
||||
include_once 'include/functions_modules.php';
|
||||
|
||||
$array_values = [
|
||||
'id_tipo_modulo' => '7',
|
||||
'descripcion' => 'Basic network connectivity check to measure network latency in miliseconds',
|
||||
'max' => '0',
|
||||
'min' => '0',
|
||||
'snmp_oid' => '',
|
||||
'snmp_community' => 'public',
|
||||
'id_module_group' => $id_group,
|
||||
'module_interval' => '300',
|
||||
'module_ff_interval' => '0',
|
||||
'ip_target' => $ip_target,
|
||||
'tcp_port' => '0',
|
||||
'tcp_rcv' => '',
|
||||
'tcp_send' => '',
|
||||
'id_export' => '0',
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '0',
|
||||
'plugin_parameter' => '',
|
||||
'id_plugin' => '0',
|
||||
'post_process' => '0',
|
||||
'prediction_module' => '0',
|
||||
'max_timeout' => '0',
|
||||
'max_retries' => '0',
|
||||
'disabled' => '',
|
||||
'id_modulo' => '2',
|
||||
'custom_id' => '',
|
||||
'history_data' => '1',
|
||||
'dynamic_interval' => '0',
|
||||
'dynamic_max' => '0',
|
||||
'dynamic_min' => '0',
|
||||
'dynamic_two_tailed' => '1',
|
||||
'parent_module_id' => '0',
|
||||
'min_warning' => '0',
|
||||
'max_warning' => '0',
|
||||
'str_warning' => '',
|
||||
'min_critical' => '0',
|
||||
'max_critical' => '0',
|
||||
'str_critical' => '',
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_integer_1' => '0',
|
||||
'custom_integer_2' => '0',
|
||||
'min_ff_event' => '0',
|
||||
'min_ff_event_normal' => '0',
|
||||
'min_ff_event_warning' => '0',
|
||||
'min_ff_event_critical' => '0',
|
||||
'ff_type' => '0',
|
||||
'each_ff' => '0',
|
||||
'ff_timeout' => '0',
|
||||
'unit' => '',
|
||||
'macros' => '',
|
||||
'quiet' => '0',
|
||||
'cps' => '0',
|
||||
'critical_instructions' => '',
|
||||
'warning_instructions' => '',
|
||||
'unknown_instructions' => '',
|
||||
'critical_inverse' => '0',
|
||||
'warning_inverse' => '0',
|
||||
'percentage_critical' => '0',
|
||||
'percentage_warning' => '0',
|
||||
'cron_interval' => '* * * * *',
|
||||
'id_category' => '0',
|
||||
'disabled_types_event' => '{\"going_unknown\":0}',
|
||||
'module_macros' => 'W10=',
|
||||
'warning_time' => '0',
|
||||
];
|
||||
return modules_create_agent_module($id_agent, 'Basic_Network_Latency', $array_values);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create module packet lost and return module id.
|
||||
*
|
||||
* @param mixed $id_agent Id agent.
|
||||
* @param mixed $id_group Id group.
|
||||
* @param mixed $ip_target Ip target.
|
||||
*
|
||||
* @return interger Module id.
|
||||
*/
|
||||
function create_module_packet_lost($id_agent, $id_group, $ip_target)
|
||||
{
|
||||
include_once 'include/functions_modules.php';
|
||||
|
||||
$array_values = [
|
||||
'id_tipo_modulo' => '1',
|
||||
'descripcion' => 'Basic network connectivity check to measure packet loss in %',
|
||||
'max' => '0',
|
||||
'min' => '0',
|
||||
'snmp_oid' => '',
|
||||
'snmp_community' => 'public',
|
||||
'id_module_group' => $id_group,
|
||||
'module_interval' => '300',
|
||||
'module_ff_interval' => '0',
|
||||
'ip_target' => '',
|
||||
'tcp_port' => '0',
|
||||
'tcp_rcv' => '',
|
||||
'tcp_send' => '',
|
||||
'id_export' => '0',
|
||||
'plugin_user' => '',
|
||||
'plugin_pass' => '0',
|
||||
'plugin_parameter' => '',
|
||||
'id_plugin' => '9',
|
||||
'post_process' => '0',
|
||||
'prediction_module' => '0',
|
||||
'max_timeout' => '0',
|
||||
'max_retries' => '0',
|
||||
'disabled' => '',
|
||||
'id_modulo' => '4',
|
||||
'custom_id' => '',
|
||||
'history_data' => '1',
|
||||
'dynamic_interval' => '0',
|
||||
'dynamic_max' => '0',
|
||||
'dynamic_min' => '0',
|
||||
'dynamic_two_tailed' => '1',
|
||||
'parent_module_id' => '0',
|
||||
'min_warning' => '0',
|
||||
'max_warning' => '0',
|
||||
'str_warning' => '',
|
||||
'min_critical' => '0',
|
||||
'max_critical' => '0',
|
||||
'str_critical' => '',
|
||||
'custom_string_1' => '',
|
||||
'custom_string_2' => '',
|
||||
'custom_string_3' => '',
|
||||
'custom_integer_1' => '0',
|
||||
'custom_integer_2' => '0',
|
||||
'min_ff_event' => '0',
|
||||
'min_ff_event_normal' => '0',
|
||||
'min_ff_event_warning' => '0',
|
||||
'min_ff_event_critical' => '0',
|
||||
'ff_type' => '0',
|
||||
'each_ff' => '0',
|
||||
'ff_timeout' => '0',
|
||||
'unit' => '',
|
||||
'macros' => '{"1":{"macro":"_field1_","desc":"Test time","help":"","value":"8","hide":""},"2":{"macro":"_field2_","desc":"Target IP","help":"","value":"'.$ip_target.'","hide":""}}',
|
||||
'quiet' => '0',
|
||||
'cps' => '0',
|
||||
'critical_instructions' => '',
|
||||
'warning_instructions' => '',
|
||||
'unknown_instructions' => '',
|
||||
'critical_inverse' => '0',
|
||||
'warning_inverse' => '0',
|
||||
'percentage_critical' => '0',
|
||||
'percentage_warning' => '0',
|
||||
'cron_interval' => '* * * * *',
|
||||
'id_category' => '0',
|
||||
'disabled_types_event' => '{\"going_unknown\":0}',
|
||||
'module_macros' => 'W10=',
|
||||
'warning_time' => '0',
|
||||
];
|
||||
return modules_create_agent_module($id_agent, 'Basic_Network_Packetloss', $array_values);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create module packet lost and return module id.
|
||||
*
|
||||
* @param string $ip_target Ip and red mask.
|
||||
*
|
||||
* @return interger Module id.
|
||||
*/
|
||||
function create_net_scan($ip_target)
|
||||
{
|
||||
global $config;
|
||||
include_once $config['homedir'].'/godmode/wizards/HostDevices.class.php';
|
||||
$HostDevices = new HostDevices(1);
|
||||
$id_recon_server = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_DISCOVERY], 'id_server')['id_server'];
|
||||
|
||||
$_POST = [
|
||||
'page' => '1',
|
||||
'interval_manual_defined' => '1',
|
||||
'interval_select' => '-1',
|
||||
'interval_text' => '0',
|
||||
'interval' => '0',
|
||||
'interval_units' => '1',
|
||||
'taskname' => __('Basic network'),
|
||||
'id_recon_server' => $id_recon_server,
|
||||
'network' => $ip_target,
|
||||
'id_group' => '8',
|
||||
'comment' => __('Created on welcome'),
|
||||
];
|
||||
$task_created = $HostDevices->parseNetScan();
|
||||
if ($task_created === true) {
|
||||
$HostDevicesFinal = new HostDevices(2);
|
||||
$_POST = [
|
||||
'task' => $HostDevices->task['id_rt'],
|
||||
'page' => '2',
|
||||
'recon_ports' => '',
|
||||
'auto_monitor' => 'on',
|
||||
'id_network_profile' => ['0' => '2'],
|
||||
'review_results' => 'on',
|
||||
'review_limited' => '0',
|
||||
'snmp_enabled' => 'on',
|
||||
'snmp_version' => '1',
|
||||
'snmp_skip_non_enabled_ifs' => 'on',
|
||||
'community' => '',
|
||||
'snmp_context' => '',
|
||||
'snmp_auth_user' => '',
|
||||
'snmp_security_level' => 'authNoPriv',
|
||||
'snmp_auth_method' => 'MD5',
|
||||
'snmp_auth_pass' => '',
|
||||
'snmp_privacy_method' => 'AES',
|
||||
'snmp_privacy_pass' => '',
|
||||
'os_detect' => 'on',
|
||||
'resolve_names' => 'on',
|
||||
'parent_detection' => 'on',
|
||||
'parent_recursion' => 'on',
|
||||
'vlan_enabled' => 'on',
|
||||
];
|
||||
|
||||
$task_final_created = $HostDevicesFinal->parseNetScan();
|
||||
if ($task_final_created === true) {
|
||||
$net_scan_id = $HostDevices->task['id_rt'];
|
||||
unset($HostDevices, $HostDevicesFinal);
|
||||
return $net_scan_id;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create new template unknown.
|
||||
*
|
||||
* @return boolean 1 correct create 0 bad create.
|
||||
*/
|
||||
function create_template_alert_unknown()
|
||||
{
|
||||
$name = io_safe_input(__('Unknown condition'));
|
||||
$type = 'critical';
|
||||
$values = [
|
||||
'description' => __('This is a generic alert template to fire on UNKNOWN condition'),
|
||||
'max_value' => 0,
|
||||
'min_value' => 0,
|
||||
'id_group' => 0,
|
||||
'priority' => 4,
|
||||
'wizard_level' => 'nowizard',
|
||||
'time_threshold' => '300',
|
||||
'min_alerts_reset_counter' => 1,
|
||||
'schedule' => '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}',
|
||||
'recovery_notify' => true,
|
||||
'field2' => '[PANDORA] Alert for UNKNOWN status on _agent_ / _module_',
|
||||
'field2_recovery' => '[PANDORA] Alert RECOVERED for UNKNOWN status on _agent_ / _module_',
|
||||
'field3' => '<div style="background-color: #eaf0f6; font-family: Arial, Helvetica, sans-serif; padding: 30px; margin: 0;"><table style="max-width: 560px; background-color: white; border-radius: 10px; padding: 10px 20px 40px;" cellspacing="0" cellpadding="0" align="center"><thead><tr><td style="padding: 0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank" rel="noopener"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td><td style="padding: 0px 0px 5px;"><p style="text-align: right; color: #223549; font-weight: bold; line-height: 36px; padding: 0px; font-size: 12px;">Automatic alert system</p></td></tr><tr><td style="padding: 0px 0px 5px;" colspan="2"><hr style="border: 1px solid #f5f5f5; width: 100%; margin: 0px;"></td></tr></thead><tbody><tr><td colspan="2"><img style="display: block; margin-left: auto; margin-right: auto; width: 105px; margin-top: 20px; padding: 0px;" src="https://pandorafms.com/wp-content/uploads/2022/03/Warning-news.png" width="105px"></td></tr><tr><td colspan="2"><p style="font-size: 24px; text-align: center; color: #223549; padding: 0px 10%; line-height: 34px; margin: 20px 0px;">We have bad news for you, something is on <span style="text-transform: uppercase; font-weight: 800;">UNKNOWN</span> status!</p><div><!-- [if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius: 100px; max-width: 50%; margin-top: 0px; font-weight: bold;" href="_homeurl_">Go to Pandora FMS Console</a><!-- [if mso]></center></v:rect><![endif]--></div></td></tr><tr><td colspan="2"><div style="background-color: #f6f6f6; border-radius: 10px; padding: 10px 20px; margin-top: 40px;"><p style="font-size: 18px; line-height: 30px; color: #223549;">Monitoring details</p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Data: <span style="font-weight: 400!important;">_data_ <em>(warning)</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Agent: <span style="font-weight: 400!important;">_agent_ <em>_address_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Module: <span style="font-weight: 400!important;">_module_ <em>_moduledescription_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Timestamp: <span style="font-weight: 400!important;">_timestamp_</span></p></div></td></tr><tr><td style="padding: 20px 0px;" colspan="2"><p style="font-size: 18px; line-height: 30px; color: #223549;">This is a graph of latest 24hr data for this module</p><p style="font-weight: 400!important;">_modulegraph_24h_</p></td></tr></tbody></table><div style="text-align: center; margin-top: 10px;"><p style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;"><a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/en/contact/">Contact Us</a> | <a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/community/forums/forum/english/">Support</a> | <a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/manual/en/start">Docs</a></p></div></div>',
|
||||
'field3_recovery' => '<div style="background-color:#EAF0F6; font-family: Arial, Helvetica, sans-serif; padding:30px; margin:0;"><table style="max-width:560px; background-color:white; border-radius:10px; padding:10px 20px 40px;" cellspacing="0" cellpadding="0" align="center"><thead><tr><td style="padding:0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td><td style="padding:0px 0px 5px;"><p style="text-align:right; color:#223549; font-weight:700; line-height:36px; padding:0px; font-size:12px;">Automatic alert system</p></td></tr><tr><td colspan="2" style="padding:0px 0px 5px;"><hr style="border: 1px solid #f5f5f5; width:100%; margin:0px;"></td></tr></thead><tbody><tr><td colspan="2"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Good-news.png" style="display: block; margin-left: auto; margin-right: auto; width:105px; margin-top:20px; padding:0px;" width="105px"></td></tr><tr><td colspan="2"><p style="font-size:24px; text-align:center; color:#223549; padding:0px 10%; line-height:34px; margin:20px 0px;">We have good news for you, alert has been <span style="text-transform:uppercase; font-weight:800;">recovered</span></p><div><!--[if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius:100px; max-width:50%; margin-top:0px; font-weight:700;" href="_homeurl_">Go to Pandora FMS Console</a><!--[if mso]></center></v:rect><![endif]--></div></td></tr><tr><td colspan="2"><div style="background-color:#F6F6F6; border-radius:10px; padding:10px 20px; margin-top:40px;"><p style="font-size:18px; line-height:30px; color:#223549;">Monitoring details</p><p style="font-size:15px; color:#333333; font-weight:800; line-height:15px;">Data: <span style="font-weight:400!important;">_data_ <em>(normal)</em></span></p><p style="font-size:15px; color:#333333; font-weight:800; line-height:15px;">Agent: <span style="font-weight:400!important;">_agent_ <em>_address_</em></span></p><p style="font-size:15px; color:#333333; font-weight:800; line-height:15px;">Module: <span style="font-weight:400!important;">_module_ <em>_moduledescription_</em></span></p><p style="font-size:15px; color:#333333; font-weight:800; line-height:15px;">Timestamp: <span style="font-weight:400!important;">_timestamp_</span></p></div></td></tr><tr><td style="padding:20px 0px;" colspan="2"><p style="font-size:18px; line-height:30px; color:#223549;">This is a graph of latest 24hr data for this module</p><p style="font-weight:400!important;">_modulegraph_24h_</p></td></tr></tbody></table><div style="text-align:center; margin-top:10px;"><p style="font-size:12px; text-decoration: none; font-weight:400; color:#777;"><a href="https://pandorafms.com/en/contact/" style="font-size:12px; text-decoration: none; font-weight:400; color:#777;">Contact Us</a> | <a href="https://pandorafms.com/community/forums/forum/english/" style="font-size:12px; text-decoration: none; font-weight:400; color:#777;">Support</a> | <a href="https://pandorafms.com/manual/en/start" style="font-size:12px; text-decoration: none; font-weight:400; color:#777;">Docs</a></p></div></div>',
|
||||
];
|
||||
|
||||
$result = alerts_create_alert_template($name, $type, $values);
|
||||
return $result;
|
||||
}
|
|
@ -150,7 +150,7 @@ function d3_tree_map_graph($data, $width=700, $height=700, $return=false)
|
|||
}
|
||||
|
||||
|
||||
function d3_sunburst_graph($data, $width=700, $height=700, $return=false, $tooltip=true)
|
||||
function d3_sunburst_graph($data, $width=700, $height=700, $return=false, $tooltip=true, $id_container=false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -158,6 +158,8 @@ function d3_sunburst_graph($data, $width=700, $height=700, $return=false, $toolt
|
|||
$data = json_encode($data);
|
||||
}
|
||||
|
||||
$id_container = ($id_container === false) ? '#sunburst' : $id_container;
|
||||
|
||||
$output = "<div id=\"sunburst\" style='overflow: hidden;'></div>";
|
||||
$output .= include_javascript_d3(true);
|
||||
$output .= '<style type="text/css">
|
||||
|
@ -167,7 +169,7 @@ function d3_sunburst_graph($data, $width=700, $height=700, $return=false, $toolt
|
|||
}
|
||||
</style>';
|
||||
$output .= "<script language=\"javascript\" type=\"text/javascript\">
|
||||
sunburst('#sunburst', $data, '$width', '$height', '$tooltip');
|
||||
sunburst('$id_container', $data, '$width', '$height', '$tooltip');
|
||||
</script>";
|
||||
|
||||
if (!$return) {
|
||||
|
|
|
@ -540,12 +540,6 @@ class ModuleIconWidget extends Widget
|
|||
|
||||
$output = '';
|
||||
|
||||
$id_group = \agents_get_agent_group($this->values['agentId']);
|
||||
|
||||
$modulesAgent = \modules_get_agentmodule_agent(
|
||||
$this->values['moduleId']
|
||||
);
|
||||
|
||||
$data_module = \modules_get_last_value(
|
||||
$this->values['moduleId']
|
||||
);
|
||||
|
@ -574,33 +568,37 @@ class ModuleIconWidget extends Widget
|
|||
// General div.
|
||||
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
|
||||
|
||||
$sql = 'SELECT min_warning,
|
||||
max_warning,
|
||||
min_critical,
|
||||
max_critical,
|
||||
str_warning,
|
||||
str_critical
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = '.(int) $this->values['moduleId'];
|
||||
$sql_data = db_get_row_sql($sql);
|
||||
$status = \modules_get_agentmodule_status($this->values['moduleId']);
|
||||
|
||||
$last = modules_get_last_value($this->values['moduleId']);
|
||||
switch ($status) {
|
||||
case 1:
|
||||
case 4:
|
||||
// Critical or critical alert (BAD).
|
||||
$color_icon .= '_bad.png';
|
||||
break;
|
||||
|
||||
$color_icon = '_ok';
|
||||
if (($last >= $sql_data['min_warning']) && ($last < $sql_data['max_warning'])) {
|
||||
$color_icon = '_warning';
|
||||
case 0:
|
||||
// Normal (OK).
|
||||
$color_icon .= '_ok.png';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 10:
|
||||
// Warning or warning alert.
|
||||
$color_icon .= '_warning.png';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Unknown.
|
||||
default:
|
||||
$color_icon .= '.png';
|
||||
// Default is Grey (Other).
|
||||
break;
|
||||
}
|
||||
|
||||
if ($last >= $sql_data['max_warning']) {
|
||||
$color_icon = '_bad';
|
||||
}
|
||||
|
||||
// Div image.
|
||||
$style_icon = 'flex: 0 1 '.$sizeIcon.'px;';
|
||||
|
||||
$output .= '<div class="pdd_l_15px pdd_r_15px '.$margin_bottom.'" style="flex: 0 1 '.$sizeIcon.'px; height: '.$sizeIcon.'px;">';
|
||||
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_25px" style="flex: 0 1 '.$sizeIcon.'px; height: '.$sizeIcon.'px;">';
|
||||
$output .= html_print_image(
|
||||
'images/console/icons/'.$icon.$color_icon.'.png',
|
||||
'images/console/icons/'.$icon.$color_icon,
|
||||
true,
|
||||
['width' => $sizeIcon]
|
||||
);
|
||||
|
|
|
@ -433,7 +433,14 @@ class ServiceMapWidget extends Widget
|
|||
);
|
||||
} else {
|
||||
include_once $config['homedir'].'/include/graphs/functions_d3.php';
|
||||
servicemap_print_sunburst($this->values['serviceId'], $size['width'], $size['height'], false);
|
||||
$id_container = '#container_servicemap_'.$this->values['serviceId'].'_'.$this->cellId.' #sunburst';
|
||||
servicemap_print_sunburst(
|
||||
$this->values['serviceId'],
|
||||
$size['width'],
|
||||
$size['height'],
|
||||
false,
|
||||
$id_container
|
||||
);
|
||||
}
|
||||
|
||||
$output .= ob_get_clean();
|
||||
|
|
|
@ -86,3 +86,29 @@
|
|||
#welcome_form li.extra {
|
||||
padding-bottom: 2.5em;
|
||||
}
|
||||
|
||||
#li-div_diagnosis,
|
||||
#li-div_task_todo,
|
||||
#li-div_wizard_agent {
|
||||
border-left: unset !important;
|
||||
}
|
||||
|
||||
#div_diagnosis > label,
|
||||
#div_task_todo > label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
button.buttonButton.onlyIcon.fail,
|
||||
button.submitButton.onlyIcon.fail {
|
||||
mask: url(../../images/fail@svg.svg) no-repeat center / contain;
|
||||
-webkit-mask: url(../../images/fail@svg.svg) no-repeat center / contain;
|
||||
}
|
||||
|
||||
.select2-container .select2-container--default .select2-container--open {
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
#div_wizard_agent > .select2 {
|
||||
width: 75% !important;
|
||||
max-width: 75% !important;
|
||||
}
|
||||
|
|
|
@ -10804,6 +10804,10 @@ button.ui-button.ui-widget.submit-cancel:active {
|
|||
border-color: #96a2bf;
|
||||
}
|
||||
|
||||
.cursor-default {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.hasColorPicker {
|
||||
z-index: 10;
|
||||
}
|
||||
|
@ -11910,10 +11914,6 @@ span.help_icon_15px > img {
|
|||
height: 15px !important;
|
||||
}
|
||||
|
||||
.select2-dropdown {
|
||||
z-index: 1116 !important;
|
||||
}
|
||||
|
||||
.icon_connection_check {
|
||||
width: 65px !important;
|
||||
height: 65px !important;
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
position: absolute;
|
||||
left: -100000px;
|
||||
width: 100%;
|
||||
z-index: 1115;
|
||||
z-index: 1118;
|
||||
}
|
||||
.select2-results {
|
||||
display: block;
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.772';
|
||||
$build = '230712';
|
||||
$build = '230717';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ if ((bool) check_acl($config['id_user'], $id_grupo, 'AR') === false && (bool) ch
|
|||
require_once $config['homedir'].'/include/functions_graph.php';
|
||||
|
||||
$draw_alerts = get_parameter('draw_alerts', 0);
|
||||
$period = get_parameter('period', SECONDS_1HOUR);
|
||||
$period = (string) get_parameter('period', SECONDS_2HOUR);
|
||||
$width = get_parameter('width', 555);
|
||||
$height = get_parameter('height', 245);
|
||||
$label = get_parameter('label', '');
|
||||
|
@ -53,8 +53,8 @@ $start_date = get_parameter('start_date', date('Y-m-d'));
|
|||
$draw_events = get_parameter('draw_events', 0);
|
||||
$modules = get_parameter('modules', []);
|
||||
$filter = get_parameter('filter', 0);
|
||||
$combined = get_parameter('combined', 1);
|
||||
$option_type = get_parameter('option_type', 0);
|
||||
$combined = get_parameter('combined', 0);
|
||||
$option_type = get_parameter('option_type', 2);
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Get modules of agent sorted as:
|
||||
|
@ -176,11 +176,12 @@ foreach ($modules_boolean as $i => $m) {
|
|||
|
||||
|
||||
$list_modules = ($modules_networkmap_no_proc + $modules_others + $modules_boolean);
|
||||
asort($list_modules);
|
||||
// ----------------------------------------------------------------------
|
||||
if (empty($modules)) {
|
||||
// Selected the first 6 modules.
|
||||
$module_ids = array_keys($list_modules);
|
||||
$module_ids = array_slice($module_ids, 0, 6);
|
||||
$module_ids = array_slice($module_ids, 0, 12);
|
||||
$modules = $module_ids;
|
||||
}
|
||||
|
||||
|
@ -301,7 +302,7 @@ $htmlForm .= html_print_div(
|
|||
|
||||
$htmlForm .= '</form>';
|
||||
|
||||
ui_toggle($htmlForm, __('Filter graphs'), __('Toggle filter(s)'), '', false);
|
||||
ui_toggle($htmlForm, __('Filter graphs'), __('Toggle filter(s)'), '', true);
|
||||
|
||||
$utime = get_system_time();
|
||||
$current = date('Y-m-d', $utime);
|
||||
|
@ -316,13 +317,17 @@ if ($combined) {
|
|||
// Pass the $modules before the ajax call.
|
||||
echo '<div class="combined-graph-container center w100p white_box"'.'data-period="'.$period.'"'.'data-stacked="'.CUSTOM_GRAPH_LINE.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
|
||||
} else {
|
||||
echo '<div class="content-graphs flex wrap bg-white">';
|
||||
foreach ($modules as $id_module) {
|
||||
$title = modules_get_agentmodule_name($id_module);
|
||||
$unit = modules_get_unit($id_module);
|
||||
|
||||
echo '<div class="graph w100p padding10" style="max-width: 480px;">';
|
||||
echo '<h4>'.$title.'</h4>';
|
||||
echo '<div class="sparse-graph-container center w100p"'.'data-id_module="'.$id_module.'"'.'data-period="'.$period.'"'.'data-draw_events="'.(int) $draw_events.'"'.'data-title="'.$title.'"'.'data-draw_alerts="'.(int) $draw_alerts.'"'.'data-date="'.$date.'"'.'data-unit="'.$unit.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
|
||||
echo '<div class="sparse-graph-container" data-id_module="'.$id_module.'"'.'data-period="'.$period.'"'.'data-draw_events="'.(int) $draw_events.'"'.'data-title="'.$title.'"'.'data-draw_alerts="'.(int) $draw_alerts.'"'.'data-date="'.$date.'"'.'data-unit="'.$unit.'"'.'data-date="'.$date.'"'.'data-height="'.$height.'"'.'>'.html_print_image('images/spinner.gif', true).'</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo "<div class='both'></div>";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.772
|
||||
%define release 230712
|
||||
%define release 230717
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.772
|
||||
%define release 230712
|
||||
%define release 230717
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.772
|
||||
%define release 230712
|
||||
%define release 230717
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.772-230712
|
||||
Version: 7.0NG.772-230717
|
||||
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.772-230712"
|
||||
pandora_version="7.0NG.772-230717"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -659,6 +659,12 @@ syslog_threads 2
|
|||
# Maximum number of lines queued by the Syslog Server's producer on each run (PANDORA FMS ENTERPRISE ONLY).
|
||||
syslog_max 65535
|
||||
|
||||
# Blacklist regexp filter for the Syslog Server (PANDORA FMS ENTERPRISE ONLY).
|
||||
# syslog_blacklist [regex]
|
||||
|
||||
# Whitelist regexp filter for the Syslog Server (PANDORA FMS ENTERPRISE ONLY).
|
||||
# syslog_whitelist .*
|
||||
|
||||
# Sync Server
|
||||
#syncserver
|
||||
|
||||
|
|
|
@ -658,6 +658,12 @@ syslog_threads 2
|
|||
# Maximum number of lines queued by the Syslog Server's producer on each run (PANDORA FMS ENTERPRISE ONLY).
|
||||
syslog_max 65535
|
||||
|
||||
# Blacklist regexp filter for the Syslog Server (PANDORA FMS ENTERPRISE ONLY).
|
||||
# syslog_blacklist [regex]
|
||||
|
||||
# Whitelist regexp filter for the Syslog Server (PANDORA FMS ENTERPRISE ONLY).
|
||||
# syslog_whitelist .*
|
||||
|
||||
# Sync Server
|
||||
#syncserver
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.772";
|
||||
my $pandora_build = "230712";
|
||||
my $pandora_build = "230717";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -515,6 +515,8 @@ sub pandora_load_config {
|
|||
$pa_config->{"syslog_file"} = '/var/log/messages/'; # 7.0.716
|
||||
$pa_config->{"syslog_max"} = 65535; # 7.0.716
|
||||
$pa_config->{"syslog_threads"} = 4; # 7.0.716
|
||||
$pa_config->{"syslog_blacklist"} = undef; # 7.0.773
|
||||
$pa_config->{"syslog_whitelist"} = undef; # 7.0 773
|
||||
|
||||
# External .enc files for XML::Parser.
|
||||
$pa_config->{"enc_dir"} = ""; # > 6.0SP4
|
||||
|
@ -1254,6 +1256,12 @@ sub pandora_load_config {
|
|||
elsif ($parametro =~ m/^syslog_threads\s+([0-9]*)/i) {
|
||||
$pa_config->{'syslog_threads'}= clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^syslog_blacklist\s+(.*)/i) {
|
||||
$pa_config->{'syslog_blacklist'}= clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^syslog_whitelist\s+(.*)/i) {
|
||||
$pa_config->{'syslog_whitelist'}= clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^thread_log\s+([0-1])/i) {
|
||||
$pa_config->{'thread_log'}= clean_blank($1);
|
||||
}
|
||||
|
|
|
@ -1561,8 +1561,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
|
|||
|
||||
my $params = {};
|
||||
$params->{"apipass"} = $pa_config->{"console_api_pass"};
|
||||
$params->{"user"} ||= $pa_config->{"console_user"};
|
||||
$params->{"pass"} ||= $pa_config->{"console_pass"};
|
||||
$params->{"server_auth"} = $pa_config->{"server_unique_identifier"};
|
||||
$params->{"op"} = "get";
|
||||
$params->{"op2"} = "module_graph";
|
||||
$params->{"id"} = $module->{'id_agente_modulo'};
|
||||
|
@ -1707,8 +1706,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
|
|||
|
||||
my $params = {};
|
||||
$params->{"apipass"} = $pa_config->{"console_api_pass"};
|
||||
$params->{"user"} ||= $pa_config->{"console_user"};
|
||||
$params->{"pass"} ||= $pa_config->{"console_pass"};
|
||||
$params->{"server_auth"} = $pa_config->{"server_unique_identifier"};
|
||||
$params->{"op"} = "set";
|
||||
$params->{"op2"} = "send_report";
|
||||
$params->{"other_mode"} = "url_encode_separator_|;|";
|
||||
|
@ -1739,8 +1737,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
|
|||
|
||||
my $params = {};
|
||||
$params->{"apipass"} = $pa_config->{"console_api_pass"};
|
||||
$params->{"user"} ||= $pa_config->{"console_user"};
|
||||
$params->{"pass"} ||= $pa_config->{"console_pass"};
|
||||
$params->{"server_auth"} = $pa_config->{"server_unique_identifier"};
|
||||
$params->{"op"} = "set";
|
||||
$params->{"op2"} = "send_report";
|
||||
$params->{"other_mode"} = "url_encode_separator_|;|";
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.772";
|
||||
my $pandora_build = "230712";
|
||||
my $pandora_build = "230717";
|
||||
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.772
|
||||
%define release 230712
|
||||
%define release 230717
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.772
|
||||
%define release 230712
|
||||
%define release 230717
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.772"
|
||||
PI_BUILD="230712"
|
||||
PI_BUILD="230717"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.772 Build 230712";
|
||||
my $version = "7.0NG.772 Build 230717";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.772 Build 230712";
|
||||
my $version = "7.0NG.772 Build 230717";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue