Merge branch 'ent-3595-discovery-fase-2' of https://brutus.artica.lan:8081/artica/pandorafms into ent-3595-discovery-fase-2
Former-commit-id: 914a944b96af8bceb26bbb89dbac25452097e20a
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.732-190320
|
||||
Version: 7.0NG.732-190325
|
||||
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.732-190320"
|
||||
pandora_version="7.0NG.732-190325"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -42,7 +42,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.732';
|
||||
use constant AGENT_BUILD => '190320';
|
||||
use constant AGENT_BUILD => '190325';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.732
|
||||
%define release 190320
|
||||
%define release 190325
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.732
|
||||
%define release 190320
|
||||
%define release 190325
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.732"
|
||||
PI_BUILD="190320"
|
||||
PI_BUILD="190325"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{190320}
|
||||
{190325}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.732(Build 190320)")
|
||||
#define PANDORA_VERSION ("7.0NG.732(Build 190325)")
|
||||
|
||||
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.732(Build 190320))"
|
||||
VALUE "ProductVersion", "(7.0NG.732(Build 190325))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.732-190320
|
||||
Version: 7.0NG.732-190325
|
||||
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.732-190320"
|
||||
pandora_version="7.0NG.732-190325"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
/godmode/servers/recorn_script.php
|
||||
/godmode/servers/manage_recontask_form.php
|
||||
/godmode/servers/manage_recontask.php
|
|
@ -9,4 +9,6 @@ ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT
|
|||
|
||||
ALTER TABLE `treport_content` ADD COLUMN `show_extended_events` tinyint(1) default '0';
|
||||
|
||||
ALTER TABLE `trecon_task` ADD COLUMN `summary` text;
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -1411,6 +1411,7 @@ ALTER TABLE trecon_task ADD `vlan_enabled` int(2) unsigned default '0';
|
|||
ALTER TABLE trecon_task ADD `wmi_enabled` tinyint(1) unsigned DEFAULT '0';
|
||||
ALTER TABLE trecon_task ADD `auth_strings` text;
|
||||
ALTER TABLE trecon_task ADD `autoconfiguration_enabled` tinyint(1) unsigned default '0';
|
||||
ALTER TABLE trecon_task ADD `summary` text;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `twidget` AND Table `twidget_dashboard`
|
||||
|
|
|
@ -44,8 +44,6 @@ if ($current_package == 0) {
|
|||
echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR']));
|
||||
|
||||
echo '</a> ';
|
||||
echo '<a class="footer">'.__('Page generated at').' '.date($config['date_format']);
|
||||
echo '</a><br /><span>® '.get_copyright_notice().'</span>';
|
||||
|
||||
if (isset($config['debug'])) {
|
||||
$cache_info = [];
|
||||
|
|
|
@ -82,7 +82,7 @@ require_once 'include/functions_notifications.php';
|
|||
$header_chat .= '</a></span></div>';
|
||||
|
||||
|
||||
// Search
|
||||
// Search.
|
||||
$acl_head_search = true;
|
||||
if ($config['acl_enterprise'] == 1 && !users_is_admin()) {
|
||||
$acl_head_search = db_get_sql(
|
||||
|
@ -94,7 +94,7 @@ require_once 'include/functions_notifications.php';
|
|||
}
|
||||
|
||||
if ($acl_head_search) {
|
||||
// Search bar
|
||||
// Search bar.
|
||||
$search_bar = '<form method="get" style="display: inline;" name="quicksearch" action="">';
|
||||
if (!isset($config['search_keywords'])) {
|
||||
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
|
||||
|
@ -116,15 +116,13 @@ require_once 'include/functions_notifications.php';
|
|||
}
|
||||
|
||||
$search_bar .= 'onfocus="javascript: if (fieldKeyWordEmpty) $(\'#keywords\').val(\'\');"
|
||||
onkeyup="javascript: fieldKeyWordEmpty = false;"
|
||||
style="margin-top:5px;" class="search_input" />';
|
||||
onkeyup="javascript: fieldKeyWordEmpty = false;" class="search_input" />';
|
||||
|
||||
// $search_bar .= 'onClick="javascript: document.quicksearch.submit()"';
|
||||
$search_bar .= "<input type='hidden' name='head_search_keywords' value='abc' />";
|
||||
$search_bar .= '</form>';
|
||||
|
||||
$header_searchbar = '<div id="header_searchbar">'.ui_print_help_tip(__('Blank characters are used as AND conditions'), true);
|
||||
$header_searchbar .= $search_bar.'</div>';
|
||||
$header_searchbar = '<div id="header_searchbar">'.$search_bar.'</div>';
|
||||
}
|
||||
|
||||
|
||||
|
@ -145,10 +143,19 @@ require_once 'include/functions_notifications.php';
|
|||
$_GET['refr'] = null;
|
||||
}
|
||||
|
||||
$select = db_process_sql("SELECT autorefresh_white_list,time_autorefresh FROM tusuario WHERE id_user = '".$config['id_user']."'");
|
||||
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
|
||||
$select = db_process_sql(
|
||||
"SELECT autorefresh_white_list,time_autorefresh
|
||||
FROM tusuario
|
||||
WHERE id_user = '".$config['id_user']."'"
|
||||
);
|
||||
|
||||
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
|
||||
$autorefresh_list = json_decode(
|
||||
$select[0]['autorefresh_white_list']
|
||||
);
|
||||
|
||||
if ($autorefresh_list !== null
|
||||
&& array_search($_GET['sec2'], $autorefresh_list) !== false
|
||||
) {
|
||||
$do_refresh = true;
|
||||
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
|
||||
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
|
||||
|
@ -157,22 +164,56 @@ require_once 'include/functions_notifications.php';
|
|||
}
|
||||
|
||||
if ($do_refresh) {
|
||||
$autorefresh_img = html_print_image('images/header_refresh_gray.png', true, ['class' => 'bot', 'alt' => 'lightning', 'title' => __('Configure autorefresh')]);
|
||||
$autorefresh_img = html_print_image(
|
||||
'images/header_refresh_gray.png',
|
||||
true,
|
||||
[
|
||||
'class' => 'bot',
|
||||
'alt' => 'lightning',
|
||||
'title' => __('Configure autorefresh'),
|
||||
]
|
||||
);
|
||||
|
||||
if ($_GET['refr']) {
|
||||
$autorefresh_txt .= ' (<span id="refrcounter">'.date('i:s', $config['refr']).'</span>)';
|
||||
if ((isset($select[0]['time_autorefresh']) === true)
|
||||
&& $select[0]['time_autorefresh'] !== 0 && !$config['refr']
|
||||
) {
|
||||
$config['refr'] = $select[0]['time_autorefresh'];
|
||||
$autorefresh_txt .= ' (<span id="refrcounter">';
|
||||
$autorefresh_txt .= date(
|
||||
'i:s',
|
||||
$config['refr']
|
||||
);
|
||||
$autorefresh_txt .= '</span>)';
|
||||
} else if ($_GET['refr']) {
|
||||
$autorefresh_txt .= ' (<span id="refrcounter">';
|
||||
$autorefresh_txt .= date('i:s', $config['refr']);
|
||||
$autorefresh_txt .= '</span>)';
|
||||
}
|
||||
|
||||
$ignored_params['refr'] = '';
|
||||
$values = get_refresh_time_array();
|
||||
|
||||
$autorefresh_additional = '<span id="combo_refr" style="display: none;">';
|
||||
$autorefresh_additional .= html_print_select($values, 'ref', '', '', __('Select'), '0', true, false, false);
|
||||
$autorefresh_additional .= html_print_select(
|
||||
$values,
|
||||
'ref',
|
||||
'',
|
||||
'',
|
||||
__('Select'),
|
||||
'0',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$autorefresh_additional .= '</span>';
|
||||
unset($values);
|
||||
|
||||
$autorefresh_link_open_img = '<a class="white autorefresh" href="'.ui_get_url_refresh($ignored_params).'">';
|
||||
|
||||
if ($_GET['refr']) {
|
||||
if ($_GET['refr']
|
||||
|| ((isset($select[0]['time_autorefresh']) === true)
|
||||
&& $select[0]['time_autorefresh'] !== 0)
|
||||
) {
|
||||
$autorefresh_link_open_txt = '<a class="autorefresh autorefresh_txt" href="'.ui_get_url_refresh($ignored_params).'">';
|
||||
} else {
|
||||
$autorefresh_link_open_txt = '<a>';
|
||||
|
@ -192,7 +233,15 @@ require_once 'include/functions_notifications.php';
|
|||
$display_counter = 'display:none';
|
||||
}
|
||||
} else {
|
||||
$autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]);
|
||||
$autorefresh_img = html_print_image(
|
||||
'images/header_refresh_disabled_gray.png',
|
||||
true,
|
||||
[
|
||||
'class' => 'bot autorefresh_disabled',
|
||||
'alt' => 'lightning',
|
||||
'title' => __('Disabled autorefresh'),
|
||||
]
|
||||
);
|
||||
|
||||
$ignored_params['refr'] = false;
|
||||
|
||||
|
@ -203,56 +252,80 @@ require_once 'include/functions_notifications.php';
|
|||
$display_counter = 'display:none';
|
||||
}
|
||||
|
||||
$header_autorefresh = '<div id="header_autorefresh">'.$autorefresh_link_open_img.$autorefresh_img.$autorefresh_link_close.'</div>';
|
||||
$header_autorefresh_counter = '<div id="header_autorefresh_counter" style="'.$display_counter.'">'.$autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional.'</div>';
|
||||
$header_autorefresh = '<div id="header_autorefresh">';
|
||||
$header_autorefresh .= $autorefresh_link_open_img;
|
||||
$header_autorefresh .= $autorefresh_img;
|
||||
$header_autorefresh .= $autorefresh_link_close;
|
||||
$header_autorefresh .= '</div>';
|
||||
|
||||
$header_autorefresh_counter = '<div id="header_autorefresh_counter" style="'.$display_counter.'">';
|
||||
$header_autorefresh_counter .= $autorefresh_link_open_txt;
|
||||
$header_autorefresh_counter .= $autorefresh_txt;
|
||||
$header_autorefresh_counter .= $autorefresh_link_close;
|
||||
$header_autorefresh_counter .= $autorefresh_additional;
|
||||
$header_autorefresh_counter .= '</div>';
|
||||
|
||||
|
||||
// Qr.
|
||||
if ($config['show_qr_code_header'] == 0) {
|
||||
$show_qr_code_header = 'display: none;';
|
||||
// Support.
|
||||
if (defined('PANDORA_ENTERPRISE')) {
|
||||
$header_support_link = 'https://support.artica.es/';
|
||||
} else {
|
||||
$show_qr_code_header = 'display: inline;';
|
||||
$header_support_link = 'https://pandorafms.com/forums/';
|
||||
}
|
||||
|
||||
$header_qr = '<div id="header_qr" style="'.$show_qr_code_header.'"><div id="qr_code_container"><a href="javascript: show_dialog_qrcode();">'.html_print_image(
|
||||
'images/qrcode_icon_gray.png',
|
||||
true,
|
||||
[
|
||||
'alt' => __('QR Code of the page'),
|
||||
'title' => __('QR Code of the page'),
|
||||
]
|
||||
).'</a></div></div>';
|
||||
$header_support = '<div id="header_support">';
|
||||
$header_support .= '<a href="'.$header_support_link.'" target="_blank">';
|
||||
$header_support .= html_print_image('/images/header_support.png', true, ['title' => __('Go to support'), 'class' => 'bot', 'alt' => 'user']);
|
||||
$header_support .= '</a></div>';
|
||||
|
||||
// Documentation.
|
||||
$header_docu = '<div id="header_support">';
|
||||
$header_docu .= '<a href="https://wiki.pandorafms.com/index.php?title=Main_Page" target="_blank">';
|
||||
$header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']);
|
||||
$header_docu .= '</a></div>';
|
||||
|
||||
|
||||
echo "<div style='display: none;' id='qrcode_container' title='".__('QR code of the page')."'>";
|
||||
echo "<div id='qrcode_container_image'></div>";
|
||||
echo '</div>';
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function() {
|
||||
$( "#qrcode_container" ).dialog({
|
||||
autoOpen: false,
|
||||
modal: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
// User.
|
||||
if (is_user_admin($config['id_user']) == 1) {
|
||||
$header_user = html_print_image('images/header_user_admin_green.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']);
|
||||
$header_user = html_print_image(
|
||||
'images/header_user_admin_green.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit my user'),
|
||||
'class' => 'bot',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$header_user = html_print_image('images/header_user_green.png', true, ['title' => __('Edit my user'), 'class' => 'bot', 'alt' => 'user']);
|
||||
$header_user = html_print_image(
|
||||
'images/header_user_green.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit my user'),
|
||||
'class' => 'bot',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span> ('.$config['id_user'].')</span></a></div>';
|
||||
|
||||
// Logout.
|
||||
$header_logout = '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">';
|
||||
$header_logout .= html_print_image('images/header_logout_gray.png', true, ['alt' => __('Logout'), 'class' => 'bot', 'title' => __('Logout')]);
|
||||
$header_logout .= html_print_image(
|
||||
'images/header_logout_gray.png',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Logout'),
|
||||
'class' => 'bot',
|
||||
'title' => __('Logout'),
|
||||
]
|
||||
);
|
||||
$header_logout .= '</a></div>';
|
||||
|
||||
echo '<div class="header_left">'.$header_autorefresh, $header_autorefresh_counter, $header_qr, $header_chat.'</div>
|
||||
<div class="header_center">'.$header_searchbar, $header_discovery, $servers_list.'</div>
|
||||
<div class="header_right">'.$header_user, $header_logout.'</div>';
|
||||
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_chat, $header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
?>
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
</div> <!-- Closes #table_header -->
|
||||
|
@ -490,7 +563,12 @@ require_once 'include/functions_notifications.php';
|
|||
);
|
||||
|
||||
<?php
|
||||
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET['refr']))) {
|
||||
if (($autorefresh_list !== null)
|
||||
&& (array_search(
|
||||
$_GET['sec2'],
|
||||
$autorefresh_list
|
||||
) !== false) && (!isset($_GET['refr']))
|
||||
) {
|
||||
$do_refresh = true;
|
||||
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
|
||||
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
|
||||
|
@ -503,23 +581,6 @@ require_once 'include/functions_notifications.php';
|
|||
if ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard' && $new_dashboard) {
|
||||
$do_refresh = false;
|
||||
}
|
||||
|
||||
if ($do_refresh) {
|
||||
?>
|
||||
$("a.autorefresh_txt").toggle ();
|
||||
$("#combo_refr").toggle ();
|
||||
href = $("a.autorefresh").attr ("href");
|
||||
<?php
|
||||
if ($select[0]['time_autorefresh']) {
|
||||
?>
|
||||
var refresh = '<?php echo $select[0]['time_autorefresh']; ?>';
|
||||
$(document).attr ("location", href + refresh);
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -547,14 +608,14 @@ require_once 'include/functions_notifications.php';
|
|||
blinkpubli();
|
||||
|
||||
<?php
|
||||
if ($_GET['refr']) {
|
||||
if ($_GET['refr'] || $do_refresh === true) {
|
||||
?>
|
||||
$("#header_autorefresh").css('padding-right', '5px');
|
||||
var refr_time = <?php echo (int) get_parameter('refr', 0); ?>;
|
||||
var t = new Date();
|
||||
t.setTime (t.getTime () +
|
||||
parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
$("#refrcounter").countdown ({until: t,
|
||||
t.setTime (t.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
$("#refrcounter").countdown ({
|
||||
until: t,
|
||||
layout: '%M%nn%M:%S%nn%S',
|
||||
labels: ['', '', '', '', '', '', ''],
|
||||
onExpiry: function () {
|
||||
|
|
|
@ -70,7 +70,7 @@ $custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
|
|||
|
||||
if (!defined('PANDORA_ENTERPRISE')) {
|
||||
$logo_title = get_product_name().' Opensource';
|
||||
$custom_logo = 'images/custom_logo/pandora_logo_head_green.png';
|
||||
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
|
||||
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
|
||||
} else {
|
||||
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) {
|
||||
|
|
|
@ -375,12 +375,12 @@ if ($create_modules) {
|
|||
$new_module_configuration_data .= "\nmodule_secname ".$snmp3_auth_user;
|
||||
$new_module_configuration_data .= "\nmodule_seclevel ".$snmp3_security_level;
|
||||
|
||||
if ($snmp3_security_level=='authNoPriv' || $snmp3_security_level=='authPriv') {
|
||||
if ($snmp3_security_level == 'authNoPriv' || $snmp3_security_level == 'authPriv') {
|
||||
$new_module_configuration_data .= "\nmodule_authpass ".$snmp3_auth_pass;
|
||||
$new_module_configuration_data .= "\nmodule_authproto ".$snmp3_auth_method;
|
||||
}
|
||||
|
||||
if ($snmp3_security_level=='authPriv') {
|
||||
if ($snmp3_security_level == 'authPriv') {
|
||||
$new_module_configuration_data .= "\nmodule_privproto ".$snmp3_privacy_method;
|
||||
$new_module_configuration_data .= "\nmodule_privpass ".$snmp3_privacy_pass;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
|
|||
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
ui_print_page_header(__('Discovery'), '', false, '', true);
|
||||
|
||||
|
||||
/**
|
||||
* Mask class names.
|
||||
|
|
|
@ -243,7 +243,7 @@ function logo_custom_enterprise($name, $logo)
|
|||
false,
|
||||
true,
|
||||
'',
|
||||
$open,
|
||||
false,
|
||||
'width:240px'
|
||||
);
|
||||
return $select;
|
||||
|
@ -259,7 +259,7 @@ function logo_custom_enterprise($name, $logo)
|
|||
false,
|
||||
true,
|
||||
'',
|
||||
$open,
|
||||
true,
|
||||
'width:240px'
|
||||
);
|
||||
return $select;
|
||||
|
@ -462,6 +462,20 @@ if (enterprise_installed()) {
|
|||
$row++;
|
||||
}
|
||||
|
||||
// Title Header
|
||||
if (enterprise_installed()) {
|
||||
$table_styles->data[$row][0] = __('Title (header)');
|
||||
$table_styles->data[$row][1] = html_print_input_text('custom_title_header', $config['custom_title_header'], '', 50, 40, true);
|
||||
$row++;
|
||||
}
|
||||
|
||||
// Subtitle Header
|
||||
if (enterprise_installed()) {
|
||||
$table_styles->data[$row][0] = __('Subtitle (header)');
|
||||
$table_styles->data[$row][1] = html_print_input_text('custom_subtitle_header', $config['custom_subtitle_header'], '', 50, 40, true);
|
||||
$row++;
|
||||
}
|
||||
|
||||
// login title1
|
||||
if (enterprise_installed()) {
|
||||
$table_styles->data[$row][0] = __('Title 1 (login)');
|
||||
|
|
|
@ -1,23 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Update Manager Offline
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; 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.
|
||||
global $config;
|
||||
|
||||
// ui_require_css_file('update_manager', 'godmode/update_manager/');
|
||||
check_login();
|
||||
|
||||
// ui_require_css_file('update_manager', 'godmode/update_manager/');
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
if (! check_acl($config['id_user'], 0, 'PM')
|
||||
&& ! is_user_admin($config['id_user'])
|
||||
) {
|
||||
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
|
@ -27,7 +43,8 @@ $baseurl = ui_get_full_url(false, false, false, false);
|
|||
|
||||
?>
|
||||
|
||||
<!-- Add the stylesheet here cause somehow the 'ui_require_css_file' is not working on the metaconsole and there is no time to fix it -->
|
||||
<!-- Add the stylesheet here cause somehow the 'ui_require_css_file'
|
||||
is not working on the metaconsole and there is no time to fix it -->
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $baseurl; ?>/godmode/update_manager/update_manager.css">
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 443 B |
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 428 B |
After Width: | Height: | Size: 564 B |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 424 B |
|
@ -34,30 +34,63 @@ $showmap = (bool) get_parameter('showmap', 0);
|
|||
if ($progress_task_discovery) {
|
||||
$id_task = get_parameter('id', 0);
|
||||
|
||||
if ($id_task !== 0) {
|
||||
$result = '';
|
||||
$result .= '<ul class="progress_task_discovery">';
|
||||
$result .= '<li><h1>'._('Overall Progress').'</h1></li>';
|
||||
$result .= '<li>';
|
||||
$result .= d3_progress_bar(
|
||||
$id_task,
|
||||
90,
|
||||
460,
|
||||
30,
|
||||
'#EA5434',
|
||||
'%',
|
||||
'',
|
||||
'#FFFFFF',
|
||||
0,
|
||||
0
|
||||
);
|
||||
if ($id_task <= 0) {
|
||||
echo json_encode(['error' => true]);
|
||||
return;
|
||||
}
|
||||
|
||||
$task = db_get_row('trecon_task', 'id_rt', $id_task);
|
||||
$global_progress = $task['status'];
|
||||
$summary = json_decode($task['summary'], true);
|
||||
|
||||
$result = '';
|
||||
$result .= '<ul class="progress_task_discovery">';
|
||||
$result .= '<li><h1>'._('Overall Progress').'</h1></li>';
|
||||
$result .= '<li>';
|
||||
$result .= d3_progress_bar(
|
||||
$id_task,
|
||||
($global_progress < 0) ? 100 : $global_progress,
|
||||
460,
|
||||
30,
|
||||
'#EA5434',
|
||||
'%',
|
||||
'',
|
||||
'#FFFFFF',
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
if ($global_progress > 0) {
|
||||
switch ($summary['step']) {
|
||||
case STEP_SCANNING:
|
||||
$str = __('Scanning network');
|
||||
break;
|
||||
|
||||
case STEP_AFT:
|
||||
$str = __('Finding AFT connectivity');
|
||||
break;
|
||||
|
||||
case STEP_TRACEROUTE:
|
||||
$str = __('Finding traceroute connectivity');
|
||||
break;
|
||||
|
||||
case STEP_GATEWAY:
|
||||
$str = __('Finding gateway connectivity');
|
||||
break;
|
||||
|
||||
default:
|
||||
$str = __('Searching for devices...');
|
||||
break;
|
||||
}
|
||||
|
||||
$result .= '</li>';
|
||||
$result .= '<li><h1>'.__('Searching devices in').' red a scanear</h1></li>';
|
||||
$result .= '<li><h1>'.$str.' ';
|
||||
$result .= $summary['c_network_name'];
|
||||
$result .= '</h1></li>';
|
||||
$result .= '<li>';
|
||||
$result .= d3_progress_bar(
|
||||
$id_task.'_2',
|
||||
30,
|
||||
$id_task.'_detail',
|
||||
$summary['c_network_percent'],
|
||||
460,
|
||||
30,
|
||||
'#2751E1',
|
||||
|
@ -67,22 +100,49 @@ if ($progress_task_discovery) {
|
|||
0,
|
||||
0
|
||||
);
|
||||
|
||||
$result .= '</li>';
|
||||
$result .= '<li><h1>'.__('Summary').'</h1></li>';
|
||||
$result .= '<li><span><b>'.__('Estimated').'</b>: total de host</span></li>';
|
||||
$result .= '<li><span><b>'.__('Discovered').'</b>: total de agentes</span></li>';
|
||||
$result .= '<li><span><b>'.__('Not alive/Not found').'</b>: total de agentes 1-2</span></li>';
|
||||
$result .= '</ul>';
|
||||
|
||||
echo $result;
|
||||
} else {
|
||||
// Error.
|
||||
ui_print_error_message(
|
||||
__('Please, select task')
|
||||
);
|
||||
}
|
||||
|
||||
$result .= '</ul>';
|
||||
|
||||
$i = 0;
|
||||
$table = new StdClasS();
|
||||
$table->class = 'databox data';
|
||||
$table->width = '75%';
|
||||
$table->styleTable = 'margin: 2em auto 0;border: 1px solid #ddd;background: white;';
|
||||
$table->rowid = [];
|
||||
$table->data = [];
|
||||
|
||||
// Content.
|
||||
$table->data[$i][0] = '<b>'.__('Hosts discovered').'</b>';
|
||||
$table->data[$i][1] = '<span id="discovered">';
|
||||
$table->data[$i][1] .= $summary['summary']['discovered'];
|
||||
$table->data[$i++][1] .= '</span>';
|
||||
|
||||
$table->data[$i][0] = '<b>'.__('Alive').'</b>';
|
||||
$table->data[$i][1] = '<span id="alive">';
|
||||
$table->data[$i][1] .= $summary['summary']['alive'];
|
||||
$table->data[$i++][1] .= '</span>';
|
||||
|
||||
$table->data[$i][0] = '<b>'.__('Not alive').'</b>';
|
||||
$table->data[$i][1] = '<span id="not_alive">';
|
||||
$table->data[$i][1] .= $summary['summary']['not_alive'];
|
||||
$table->data[$i++][1] .= '</span>';
|
||||
|
||||
$table->data[$i][0] = '<b>'.__('Responding SNMP').'</b>';
|
||||
$table->data[$i][1] = '<span id="SNMP">';
|
||||
$table->data[$i][1] .= $summary['summary']['SNMP'];
|
||||
$table->data[$i++][1] .= '</span>';
|
||||
|
||||
$table->data[$i][0] = '<b>'.__('Responding WMI').'</b>';
|
||||
$table->data[$i][1] = '<span id="WMI">';
|
||||
$table->data[$i][1] .= $summary['summary']['WMI'];
|
||||
$table->data[$i++][1] .= '</span>';
|
||||
|
||||
$result .= html_print_table($table, true);
|
||||
|
||||
echo $result;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Update Manager Ajax
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -44,6 +60,7 @@ $check_update_free_package = (bool) get_parameter('check_update_free_package');
|
|||
$install_free_package = (bool) get_parameter('install_free_package');
|
||||
$search_minor = (bool) get_parameter('search_minor');
|
||||
$unzip_free_package = (bool) get_parameter('unzip_free_package');
|
||||
$delete_desired_files = (bool) get_parameter('delete_desired_files');
|
||||
|
||||
if ($upload_file) {
|
||||
ob_clean();
|
||||
|
@ -243,8 +260,15 @@ if ($install_package) {
|
|||
return;
|
||||
}
|
||||
|
||||
update_manager_enterprise_set_version($version);
|
||||
db_pandora_audit('Update '.get_product_name(), "Update version: $version of ".get_product_name().' by '.$config['id_user']);
|
||||
enterprise_hook(
|
||||
'update_manager_enterprise_set_version',
|
||||
[$version]
|
||||
);
|
||||
|
||||
db_pandora_audit(
|
||||
'Update '.get_product_name(),
|
||||
"Update version: $version of ".get_product_name().' by '.$config['id_user']
|
||||
);
|
||||
|
||||
$return['status'] = 'success';
|
||||
echo json_encode($return);
|
||||
|
@ -591,3 +615,143 @@ if ($install_free_package) {
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Result info:
|
||||
* Types of status:
|
||||
* -1 -> Not exits file.
|
||||
* 0 -> File or directory deleted successfully.
|
||||
* 1 -> Problem delete file or directory.
|
||||
* 2 -> Not found file or directory.
|
||||
* 3 -> Don`t read file deleet_files.txt.
|
||||
* 4 -> "deleted" folder could not be created.
|
||||
* 5 -> "deleted" folder was created.
|
||||
* 6 -> The "delete files" could not be the "delete" folder.
|
||||
* 7 -> The "delete files" is moved to the "delete" folder.
|
||||
* Type:
|
||||
* f -> File
|
||||
* d -> Dir.
|
||||
* route: Path.
|
||||
*/
|
||||
|
||||
if ($delete_desired_files === true) {
|
||||
global $config;
|
||||
|
||||
// Initialize result.
|
||||
$result = [];
|
||||
$result['status_list'] = [];
|
||||
|
||||
// Flag exist folder "deleted".
|
||||
$exist_deleted = true;
|
||||
|
||||
// Route delete_files.txt.
|
||||
$route_delete_files = $config['homedir'];
|
||||
$route_delete_files .= '/extras/delete_files/delete_files.txt';
|
||||
|
||||
// Route directory deleted.
|
||||
$route_dir_deleted = $config['homedir'];
|
||||
$route_dir_deleted .= '/extras/delete_files/deleted/';
|
||||
|
||||
// Check isset directory deleted
|
||||
// if it does not exist, try to create it.
|
||||
if (is_dir($route_dir_deleted) === false) {
|
||||
$res_mkdir = mkdir($route_dir_deleted, 0777, true);
|
||||
$res = [];
|
||||
if ($res_mkdir !== true) {
|
||||
$exist_deleted = false;
|
||||
$res['status'] = 4;
|
||||
} else {
|
||||
$res['status'] = 5;
|
||||
}
|
||||
|
||||
$res['type'] = 'd';
|
||||
$res['path'] = $url_to_delete;
|
||||
array_push($result['status_list'], $res);
|
||||
}
|
||||
|
||||
// Check isset delete_files.txt.
|
||||
if (file_exists($route_delete_files) === true && $exist_deleted === true) {
|
||||
// Open file.
|
||||
$file_read = fopen($route_delete_files, 'r');
|
||||
// Check if read delete_files.txt.
|
||||
if ($file_read !== false) {
|
||||
while ($file_to_delete = stream_get_line($file_read, 65535, "\n")) {
|
||||
$file_to_delete = trim($file_to_delete);
|
||||
$url_to_delete = $config['homedir'].'/'.$file_to_delete;
|
||||
// Check is dir or file or not exists.
|
||||
if (is_dir($url_to_delete) === true) {
|
||||
$rmdir_recursive = rmdir_recursive(
|
||||
$url_to_delete,
|
||||
$result['status_list']
|
||||
);
|
||||
|
||||
array_push(
|
||||
$result['status_list'],
|
||||
$rmdir_recursive
|
||||
);
|
||||
} else if (file_exists($url_to_delete) === true) {
|
||||
$unlink = unlink($url_to_delete);
|
||||
$res = [];
|
||||
$res['status'] = ($unlink === true) ? 0 : 1;
|
||||
$res['type'] = 'f';
|
||||
$res['path'] = $url_to_delete;
|
||||
array_push($result['status_list'], $res);
|
||||
} else {
|
||||
$res = [];
|
||||
$res['status'] = 2;
|
||||
$res['path'] = $url_to_delete;
|
||||
array_push($result['status_list'], $res);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$res = [];
|
||||
$res['status'] = 3;
|
||||
$res['path'] = $url_to_delete;
|
||||
array_push($result['status_list'], $res);
|
||||
}
|
||||
|
||||
// Close file.
|
||||
fclose($route_delete_files);
|
||||
|
||||
// Move delete_files.txt to dir extras/deleted/.
|
||||
$count_scandir = count(scandir($route_dir_deleted));
|
||||
$route_move = $route_dir_deleted.'/delete_files_'.$count_scandir.'.txt';
|
||||
$res_rename = rename(
|
||||
$route_delete_files,
|
||||
$route_move
|
||||
);
|
||||
|
||||
$res = [];
|
||||
$res['status'] = ($res_rename === true) ? 7 : 6;
|
||||
$res['type'] = 'f';
|
||||
$res['path'] = $route_move;
|
||||
array_push($result['status_list'], $res);
|
||||
} else {
|
||||
if ($exist_deleted === true) {
|
||||
$res = [];
|
||||
$res['status'] = -1;
|
||||
array_push($result['status_list'], $res);
|
||||
}
|
||||
}
|
||||
|
||||
// Translation diccionary neccesary.
|
||||
$result['translation'] = [
|
||||
'title' => __('Delete files'),
|
||||
'not_file' => __('The oum has no files to remove'),
|
||||
'not_found' => __('Not found'),
|
||||
'not_deleted' => __('Not deleted'),
|
||||
'not_read' => __('The file delete_file.txt can not be read'),
|
||||
'folder_deleted_f' => __('\'deleted\' folder could not be created'),
|
||||
'folder_deleted_t' => __('\'deleted\' folder was created'),
|
||||
'move_file_f' => __(
|
||||
'The "delete files" could not be the "delete" folder'
|
||||
),
|
||||
'move_file_d' => __(
|
||||
'The "delete files" is moved to the "delete" folder'
|
||||
),
|
||||
];
|
||||
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC190320';
|
||||
$build_version = 'PC190325';
|
||||
$pandora_version = 'v7.0NG.732';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -195,6 +195,14 @@ define('AGENT_STATUS_UNKNOWN', 3);
|
|||
define('AGENT_STATUS_ALERT_FIRED', 4);
|
||||
define('AGENT_STATUS_WARNING', 2);
|
||||
|
||||
// Pseudo criticity analysis.
|
||||
define('NO_CRIT', -1);
|
||||
define('CRIT_0', 0);
|
||||
define('CRIT_1', 1);
|
||||
define('CRIT_2', 2);
|
||||
define('CRIT_3', 3);
|
||||
define('CRIT_4', 4);
|
||||
define('CRIT_5', 5);
|
||||
|
||||
// Visual maps contants.
|
||||
// The items kind.
|
||||
|
@ -506,6 +514,18 @@ define('OPTION_COLOR_PICKER', 11);
|
|||
define('NODE_TYPE', 0);
|
||||
define('ARROW_TYPE', 1);
|
||||
|
||||
// Discovery task steps.
|
||||
define('STEP_SCANNING', 1);
|
||||
define('STEP_AFT', 2);
|
||||
define('STEP_TRACEROUTE', 3);
|
||||
define('STEP_GATEWAY', 4);
|
||||
|
||||
// Networkmap node types.
|
||||
define('NODE_AGENT', 0);
|
||||
define('NODE_MODULE', 1);
|
||||
define('NODE_PANDORA', 2);
|
||||
define('NODE_GENERIC', 3);
|
||||
|
||||
// SAML attributes constants.
|
||||
define('SAML_ROLE_AND_TAG', 'eduPersonEntitlement');
|
||||
define('SAML_USER_DESC', 'commonName');
|
||||
|
|
|
@ -434,15 +434,15 @@ function agents_get_agents(
|
|||
$filter_nogroup = $filter;
|
||||
|
||||
// Get user groups
|
||||
$groups = array_keys(users_get_groups($config['id_user'], $access, false));
|
||||
$groups = array_keys(users_get_groups($config['id_user'], $access, true));
|
||||
|
||||
// If no group specified, get all user groups
|
||||
if (empty($filter['id_grupo'])) {
|
||||
if (isset($filter['id_grupo']) === false) {
|
||||
$all_groups = true;
|
||||
$filter['id_grupo'] = $groups;
|
||||
} else if (! is_array($filter['id_grupo'])) {
|
||||
$all_groups = false;
|
||||
// If group is specified but not allowed, return false
|
||||
// If group is specified but not allowed, return false.
|
||||
if (! in_array($filter['id_grupo'], $groups)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -466,11 +466,6 @@ function agents_get_agents(
|
|||
|
||||
$filter['id_group'] = $filter['id_grupo'];
|
||||
|
||||
if (in_array(0, $filter['id_grupo'])) {
|
||||
unset($filter['id_grupo']);
|
||||
unset($filter['id_group']);
|
||||
}
|
||||
|
||||
if (!is_array($fields)) {
|
||||
$fields = [];
|
||||
$fields[0] = 'id_agente';
|
||||
|
@ -578,6 +573,7 @@ function agents_get_agents(
|
|||
}
|
||||
|
||||
$sql = sprintf('%s %s', $sql, $limit_sql);
|
||||
|
||||
if ($return) {
|
||||
return $sql;
|
||||
} else {
|
||||
|
|
|
@ -896,6 +896,14 @@ function config_update_config()
|
|||
$error_update[] = __('Custom networkmap center logo');
|
||||
}
|
||||
|
||||
if (!config_update_value('custom_title_header', (string) get_parameter('custom_title_header'))) {
|
||||
$error_update[] = __('Custom title header');
|
||||
}
|
||||
|
||||
if (!config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'))) {
|
||||
$error_update[] = __('Custom subtitle header');
|
||||
}
|
||||
|
||||
if (!config_update_value('custom_title1_login', (string) get_parameter('custom_title1_login'))) {
|
||||
$error_update[] = __('Custom title1 login');
|
||||
}
|
||||
|
@ -1792,7 +1800,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['custom_logo'])) {
|
||||
config_update_value('custom_logo', 'pandora_logo_head_green.png');
|
||||
config_update_value('custom_logo', 'pandora_logo_head_4.png');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_logo_collapsed'])) {
|
||||
|
@ -1827,6 +1835,14 @@ function config_process_config()
|
|||
config_update_value('custom_mobile_console_logo', '');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_title_header'])) {
|
||||
config_update_value('custom_title_header', __('Pandora FMS'));
|
||||
}
|
||||
|
||||
if (!isset($config['custom_subtitle_header'])) {
|
||||
config_update_value('custom_subtitle_header', __('the Flexible Monitoring System'));
|
||||
}
|
||||
|
||||
if (!isset($config['custom_title1_login'])) {
|
||||
config_update_value('custom_title1_login', __('PANDORA FMS'));
|
||||
}
|
||||
|
|
|
@ -358,7 +358,7 @@ function networkmap_generate_dot(
|
|||
} else if ($group == -666) {
|
||||
$agents = false;
|
||||
} else if (!empty($ip_mask)) {
|
||||
$agents = networkmap_get_new_nodes_from_ip_mask(
|
||||
$agents = networkmap_get_nodes_from_ip_mask(
|
||||
$ip_mask
|
||||
);
|
||||
} else {
|
||||
|
@ -489,11 +489,11 @@ function networkmap_generate_dot(
|
|||
|
||||
// Create void statistics array
|
||||
$stats = [];
|
||||
|
||||
$count = 0;
|
||||
$group_nodes = 10;
|
||||
$graph .= networkmap_create_transparent_node($count);
|
||||
foreach (array_keys($orphans) as $node) {
|
||||
/*
|
||||
$count = 0;
|
||||
$group_nodes = 10;
|
||||
$graph .= networkmap_create_transparent_node($count);
|
||||
foreach (array_keys($orphans) as $node) {
|
||||
if ($group_nodes == 0) {
|
||||
$count++;
|
||||
$graph .= networkmap_create_transparent_node($count);
|
||||
|
@ -507,7 +507,8 @@ function networkmap_generate_dot(
|
|||
);
|
||||
|
||||
$group_nodes--;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Create nodes
|
||||
foreach ($nodes as $node_id => $node) {
|
||||
|
@ -714,7 +715,7 @@ function networkmap_create_edge(
|
|||
|
||||
// Option edgeURL allows node navigation.
|
||||
$edge = "\n".$head.' -- '.$tail;
|
||||
$edge .= '[color="#BDBDBD", headclip=false, tailclip=false, edgeURL=""];';
|
||||
$edge .= '[len='.$ranksep.', color="#BDBDBD", headclip=false, tailclip=false, edgeURL=""];';
|
||||
$edge .= "\n";
|
||||
|
||||
return $edge;
|
||||
|
@ -1322,16 +1323,24 @@ function networkmap_get_types($strict_user=false)
|
|||
*
|
||||
* @return array Of agents.
|
||||
*/
|
||||
function networkmap_get_new_nodes_from_ip_mask(
|
||||
function networkmap_get_nodes_from_ip_mask(
|
||||
$ip_mask,
|
||||
$return_ids_only=false
|
||||
) {
|
||||
$list_ip_masks = explode(',', $ip_mask);
|
||||
|
||||
if (empty($list_ip_masks)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$agents = [];
|
||||
foreach ($list_ip_masks as $subnet) {
|
||||
$net = explode('/', $subnet);
|
||||
|
||||
// Calculate real network address. Avoid user bad input.
|
||||
$mask = ~((1 << (32 - $net[1])) - 1);
|
||||
$network = long2ip(ip2long($net[0]) & $mask);
|
||||
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM `tagente`
|
||||
|
@ -1349,7 +1358,7 @@ function networkmap_get_new_nodes_from_ip_mask(
|
|||
) t_res
|
||||
ON t_res.`id_agent` = `tagente`.`id_agente`',
|
||||
(32 - $net[1]),
|
||||
$net[0]
|
||||
$network
|
||||
);
|
||||
|
||||
$subnet_agents = db_get_all_rows_sql($sql);
|
||||
|
@ -1553,6 +1562,7 @@ function networkmap_db_node_to_js_node(
|
|||
$item['raw_text'] = $node['style']['label'];
|
||||
$item['text'] = io_safe_output($node['style']['label']);
|
||||
$item['shape'] = $node['style']['shape'];
|
||||
|
||||
switch ($node['type']) {
|
||||
case 0:
|
||||
$color = get_status_color_networkmap($node['source_data']);
|
||||
|
@ -1689,7 +1699,9 @@ function networkmap_links_to_js_links(
|
|||
|
||||
$count = 0;
|
||||
foreach ($relations as $key => $relation) {
|
||||
if (($relation['parent_type'] == 1) && ($relation['child_type'] == 1)) {
|
||||
if (($relation['parent_type'] == NODE_MODULE)
|
||||
&& ($relation['child_type'] == NODE_MODULE)
|
||||
) {
|
||||
$id_target_agent = agents_get_agent_id_by_module_id(
|
||||
$relation['id_parent_source_data']
|
||||
);
|
||||
|
@ -1698,16 +1710,16 @@ function networkmap_links_to_js_links(
|
|||
);
|
||||
$id_target_module = $relation['id_parent_source_data'];
|
||||
$id_source_module = $relation['id_child_source_data'];
|
||||
} else if (($relation['parent_type'] == 1)
|
||||
&& ($relation['child_type'] == 0)
|
||||
} else if (($relation['parent_type'] == NODE_MODULE)
|
||||
&& ($relation['child_type'] == NODE_AGENT)
|
||||
) {
|
||||
$id_target_agent = agents_get_agent_id_by_module_id(
|
||||
$relation['id_parent_source_data']
|
||||
);
|
||||
$id_target_module = $relation['id_parent_source_data'];
|
||||
$id_source_agent = $relation['id_child_source_data'];
|
||||
} else if (($relation['parent_type'] == 0)
|
||||
&& ($relation['child_type'] == 1)
|
||||
} else if (($relation['parent_type'] == NODE_AGENT)
|
||||
&& ($relation['child_type'] == NODE_MODULE)
|
||||
) {
|
||||
$id_target_agent = $relation['id_parent_source_data'];
|
||||
$id_source_module = $relation['id_child_source_data'];
|
||||
|
@ -1747,10 +1759,10 @@ function networkmap_links_to_js_links(
|
|||
$item['target_id_db'] = (int) $target_and_source['target'];
|
||||
$item['source_id_db'] = (int) $target_and_source['source'];
|
||||
} else {
|
||||
if (($relation['parent_type'] == 1) && ($relation['child_type'] == 1)) {
|
||||
if (($relation['parent_type'] == NODE_MODULE) && ($relation['child_type'] == NODE_MODULE)) {
|
||||
$item['target_id_db'] = $id_target_agent;
|
||||
$item['source_id_db'] = $id_source_agent;
|
||||
} else if (($relation['parent_type'] == 0) && ($relation['child_type'] == 0)) {
|
||||
} else if (($relation['parent_type'] == NODE_AGENT) && ($relation['child_type'] == NODE_AGENT)) {
|
||||
$item['target_id_db'] = (int) $relation['id_parent_source_data'];
|
||||
$item['source_id_db'] = $id_source_agent;
|
||||
} else {
|
||||
|
@ -1775,7 +1787,7 @@ function networkmap_links_to_js_links(
|
|||
}
|
||||
}
|
||||
|
||||
if ($relation['child_type'] == 1) {
|
||||
if ($relation['child_type'] == NODE_MODULE) {
|
||||
$item['arrow_start'] = 'module';
|
||||
$item['status_start'] = modules_get_agentmodule_status((int) $id_source_module, false, false, null);
|
||||
$item['id_module_start'] = (int) $id_source_module;
|
||||
|
@ -1793,7 +1805,7 @@ function networkmap_links_to_js_links(
|
|||
$control1 = false;
|
||||
$control2 = false;
|
||||
|
||||
if (($relation['parent_type'] == 1) && ($relation['child_type'] == 1)) {
|
||||
if (($relation['parent_type'] == NODE_MODULE) && ($relation['child_type'] == NODE_MODULE)) {
|
||||
if (($item['status_start'] == AGENT_MODULE_STATUS_CRITICAL_BAD) || ($item['status_end'] == AGENT_MODULE_STATUS_CRITICAL_BAD)) {
|
||||
$item['link_color'] = '#FC4444';
|
||||
} else if (($item['status_start'] == AGENT_MODULE_STATUS_WARNING) || ($item['status_end'] == AGENT_MODULE_STATUS_WARNING)) {
|
||||
|
@ -1823,7 +1835,7 @@ function networkmap_links_to_js_links(
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if ($relation['child_type'] == 1) {
|
||||
} else if ($relation['child_type'] == NODE_MODULE) {
|
||||
if ($item['status_start'] == AGENT_MODULE_STATUS_CRITICAL_BAD) {
|
||||
$item['link_color'] = '#FC4444';
|
||||
} else if ($item['status_start'] == AGENT_MODULE_STATUS_WARNING) {
|
||||
|
@ -1850,7 +1862,7 @@ function networkmap_links_to_js_links(
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if ($relation['parent_type'] == 1) {
|
||||
} else if ($relation['parent_type'] == NODE_MODULE) {
|
||||
if ($item['status_end'] == AGENT_MODULE_STATUS_CRITICAL_BAD) {
|
||||
$item['link_color'] = '#FC4444';
|
||||
} else if ($item['status_end'] == AGENT_MODULE_STATUS_WARNING) {
|
||||
|
@ -1877,8 +1889,8 @@ function networkmap_links_to_js_links(
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if (($relation['parent_type'] == 3)
|
||||
&& ($relation['child_type'] == 3)
|
||||
} else if (($relation['parent_type'] == NODE_PANDORA)
|
||||
&& ($relation['child_type'] == NODE_PANDORA)
|
||||
) {
|
||||
foreach ($nodes_graph as $key2 => $node) {
|
||||
if ($relation['id_parent'] == $node['id_db']) {
|
||||
|
@ -1891,10 +1903,10 @@ function networkmap_links_to_js_links(
|
|||
$agent2 = $node['id_db'];
|
||||
}
|
||||
}
|
||||
} else if (($relation['parent_type'] == 3)
|
||||
|| ($relation['child_type'] == 3)
|
||||
} else if (($relation['parent_type'] == NODE_PANDORA)
|
||||
|| ($relation['child_type'] == NODE_PANDORA)
|
||||
) {
|
||||
if ($relation['parent_type'] == 3) {
|
||||
if ($relation['parent_type'] == NODE_PANDORA) {
|
||||
foreach ($nodes_graph as $key2 => $node) {
|
||||
if ($relation['id_parent'] == $node['id_db']) {
|
||||
$agent = $node['id_db'];
|
||||
|
@ -1902,7 +1914,7 @@ function networkmap_links_to_js_links(
|
|||
$agent2 = $node['id_db'];
|
||||
}
|
||||
}
|
||||
} else if ($relation['child_type'] == 3) {
|
||||
} else if ($relation['child_type'] == NODE_PANDORA) {
|
||||
foreach ($nodes_graph as $key2 => $node) {
|
||||
if ($relation['id_child'] == $node['id_db']) {
|
||||
$agent2 = $node['id_db'];
|
||||
|
@ -1932,8 +1944,8 @@ function networkmap_links_to_js_links(
|
|||
}
|
||||
|
||||
if ((($item['target'] == -1) || ($item['source'] == -1))
|
||||
&& $relation['parent_type'] == 1
|
||||
&& $relation['child_type'] == 1
|
||||
&& $relation['parent_type'] == NODE_MODULE
|
||||
&& $relation['child_type'] == NODE_MODULE
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1945,371 +1957,6 @@ function networkmap_links_to_js_links(
|
|||
}
|
||||
|
||||
|
||||
function networkmap_write_js_array($id, $nodes_and_relations=[], $map_dash_details=[])
|
||||
{
|
||||
global $config;
|
||||
|
||||
db_clean_cache();
|
||||
|
||||
$ent_installed = (int) enterprise_installed();
|
||||
|
||||
$networkmap = db_get_row('tmap', 'id', $id);
|
||||
|
||||
$networkmap['filter'] = json_decode($networkmap['filter'], true);
|
||||
|
||||
// Hardcoded
|
||||
$networkmap['filter']['holding_area'] = [
|
||||
500,
|
||||
500,
|
||||
];
|
||||
|
||||
echo "\n";
|
||||
echo "////////////////////////////////////////////////////////////////////\n";
|
||||
echo "// VARS FROM THE DB\n";
|
||||
echo "////////////////////////////////////////////////////////////////////\n";
|
||||
echo "\n";
|
||||
echo "var url_background_grid = '".ui_get_full_url(
|
||||
'images/background_grid.png'
|
||||
)."'\n";
|
||||
echo 'var networkmap_id = '.$id.";\n";
|
||||
|
||||
if (!empty($map_dash_details)) {
|
||||
echo 'var x_offs = '.$map_dash_details['x_offs'].";\n";
|
||||
echo 'var y_offs = '.$map_dash_details['y_offs'].";\n";
|
||||
echo 'var z_dash = '.$map_dash_details['z_dash'].";\n";
|
||||
} else {
|
||||
echo "var x_offs = null;\n";
|
||||
echo "var y_offs = null;\n";
|
||||
echo "var z_dash = null;\n";
|
||||
}
|
||||
|
||||
echo 'var networkmap_refresh_time = 1000 * '.$networkmap['source_period'].";\n";
|
||||
echo 'var networkmap_center = [ '.$networkmap['center_x'].', '.$networkmap['center_y']."];\n";
|
||||
echo 'var networkmap_dimensions = [ '.$networkmap['width'].', '.$networkmap['height']."];\n";
|
||||
|
||||
echo 'var enterprise_installed = '.$ent_installed.";\n";
|
||||
|
||||
echo 'var node_radius = '.$networkmap['filter']['node_radius'].";\n";
|
||||
|
||||
echo 'var networkmap_holding_area_dimensions = '.json_encode($networkmap['filter']['holding_area']).";\n";
|
||||
|
||||
echo "var networkmap = {'nodes': [], 'links': []};\n";
|
||||
|
||||
$nodes = $nodes_and_relations['nodes'];
|
||||
|
||||
if (empty($nodes)) {
|
||||
$nodes = [];
|
||||
}
|
||||
|
||||
$count_item_holding_area = 0;
|
||||
$count = 0;
|
||||
$nodes_graph = [];
|
||||
|
||||
foreach ($nodes as $key => $node) {
|
||||
$style = json_decode($node['style'], true);
|
||||
$node['style'] = json_decode($node['style'], true);
|
||||
|
||||
// Only agents can be show
|
||||
if (isset($node['type'])) {
|
||||
if ($node['type'] == 1) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$node['type'] = '';
|
||||
}
|
||||
|
||||
$item = networkmap_db_node_to_js_node(
|
||||
$node,
|
||||
$count,
|
||||
$count_item_holding_area
|
||||
);
|
||||
if ($item['deleted']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
echo 'networkmap.nodes.push('.json_encode($item).");\n";
|
||||
$nodes_graph[$item['id']] = $item;
|
||||
}
|
||||
|
||||
$relations = $nodes_and_relations['relations'];
|
||||
|
||||
if ($relations === false) {
|
||||
$relations = [];
|
||||
}
|
||||
|
||||
// Clean the relations and transform the module relations into
|
||||
// interfaces
|
||||
networkmap_clean_relations_for_js($relations);
|
||||
|
||||
$links_js = networkmap_links_to_js_links($relations, $nodes_graph);
|
||||
|
||||
$array_aux = [];
|
||||
foreach ($links_js as $link_js) {
|
||||
if ($link_js['deleted']) {
|
||||
unset($links_js[$link_js['id']]);
|
||||
}
|
||||
|
||||
if ($link_js['target'] == -1) {
|
||||
unset($links_js[$link_js['id']]);
|
||||
}
|
||||
|
||||
if ($link_js['source'] == -1) {
|
||||
unset($links_js[$link_js['id']]);
|
||||
}
|
||||
|
||||
if ($link_js['target'] == $link_js['source']) {
|
||||
unset($links_js[$link_js['id']]);
|
||||
}
|
||||
|
||||
if ($link_js['arrow_start'] == 'module' && $link_js['arrow_end'] == 'module') {
|
||||
echo 'networkmap.links.push('.json_encode($link_js).");\n";
|
||||
$array_aux[$link_js['id_agent_start']] = 1;
|
||||
unset($links_js[$link_js['id']]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($links_js as $link_js) {
|
||||
if (($link_js['id_agent_end'] === 0) && $array_aux[$link_js['id_agent_start']] === 1) {
|
||||
continue;
|
||||
} else {
|
||||
echo 'networkmap.links.push('.json_encode($link_js).");\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
echo "\n";
|
||||
|
||||
echo "////////////////////////////////////////////////////////////////////\n";
|
||||
echo "// INTERFACE STATUS COLORS\n";
|
||||
echo "////////////////////////////////////////////////////////////////////\n";
|
||||
|
||||
$module_color_status = [];
|
||||
$module_color_status[] = [
|
||||
'status_code' => AGENT_MODULE_STATUS_NORMAL,
|
||||
'color' => COL_NORMAL,
|
||||
];
|
||||
$module_color_status[] = [
|
||||
'status_code' => AGENT_MODULE_STATUS_CRITICAL_BAD,
|
||||
'color' => COL_CRITICAL,
|
||||
];
|
||||
$module_color_status[] = [
|
||||
'status_code' => AGENT_MODULE_STATUS_WARNING,
|
||||
'color' => COL_WARNING,
|
||||
];
|
||||
$module_color_status[] = [
|
||||
'status_code' => AGENT_STATUS_ALERT_FIRED,
|
||||
'color' => COL_ALERTFIRED,
|
||||
];
|
||||
$module_color_status_unknown = COL_UNKNOWN;
|
||||
|
||||
echo 'var module_color_status = '.json_encode($module_color_status).";\n";
|
||||
echo "var module_color_status_unknown = '".$module_color_status_unknown."';\n";
|
||||
|
||||
echo "\n";
|
||||
echo "\n";
|
||||
|
||||
echo "////////////////////////////////////////////////////////////////////\n";
|
||||
echo "// Other vars\n";
|
||||
echo "////////////////////////////////////////////////////////////////////\n";
|
||||
|
||||
echo "var translation_none = '".__('None')."';\n";
|
||||
echo "var dialog_node_edit_title = '".__('Edit node %s')."';\n";
|
||||
echo "var holding_area_title = '".__('Holding Area')."';\n";
|
||||
echo "var edit_menu = '".__('Show details and options')."';\n";
|
||||
echo "var interface_link_add = '".__('Add a interface link')."';\n";
|
||||
echo "var set_parent_link = '".__('Set parent interface')."';\n";
|
||||
echo "var set_as_children_menu = '".__('Set as children')."';\n";
|
||||
echo "var set_parent_menu = '".__('Set parent')."';\n";
|
||||
echo "var abort_relationship_menu = '".__('Abort the action of set relationship')."';\n";
|
||||
echo "var delete_menu = '".__('Delete')."';\n";
|
||||
echo "var add_node_menu = '".__('Add node')."';\n";
|
||||
echo "var set_center_menu = '".__('Set center')."';\n";
|
||||
echo "var refresh_menu = '".__('Refresh')."';\n";
|
||||
echo "var refresh_holding_area_menu = '".__('Refresh Holding area')."';\n";
|
||||
echo "var ok_button = '".__('Proceed')."';\n";
|
||||
echo "var message_to_confirm = '".__('Resetting the map will delete all customizations you have done, including manual relationships between elements, new items, etc.')."';\n";
|
||||
echo "var warning_message = '".__('WARNING')."';\n";
|
||||
echo "var ok_button = '".__('Proceed')."';\n";
|
||||
echo "var cancel_button = '".__('Cancel')."';\n";
|
||||
echo "var restart_map_menu = '".__('Restart map')."';\n";
|
||||
echo "var abort_relationship_interface = '".__('Abort the interface relationship')."';\n";
|
||||
echo "var abort_relationship_menu = '".__('Abort the action of set relationship')."';\n";
|
||||
|
||||
echo "\n";
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
|
||||
function networkmap_loadfile(
|
||||
$id=0,
|
||||
$file='',
|
||||
&$relations_param,
|
||||
$graph
|
||||
) {
|
||||
global $config;
|
||||
|
||||
$height_map = 200;
|
||||
if ((int) $id > 0) {
|
||||
$height_map = db_get_value('height', 'tmap', 'id', $id);
|
||||
}
|
||||
|
||||
$networkmap_nodes = [];
|
||||
|
||||
$relations = [];
|
||||
|
||||
$other_file = file($file);
|
||||
|
||||
// Remove the graph head
|
||||
$graph = preg_replace('/^graph .*/', '', $graph);
|
||||
// Cut in nodes the graph
|
||||
$graph = explode(']', $graph);
|
||||
|
||||
$ids = [];
|
||||
foreach ($graph as $node) {
|
||||
$line = str_replace("\n", ' ', $node);
|
||||
|
||||
if (preg_match('/([0-9]+) \[.*tooltip.*id_module=([0-9]+)/', $line, $match) != 0) {
|
||||
$ids[$match[1]] = [
|
||||
'type' => 'module',
|
||||
'id_module' => $match[2],
|
||||
];
|
||||
} else if (preg_match('/([0-9]+) \[.*tooltip.*id_agent=([0-9]+)/', $line, $match) != 0) {
|
||||
$ids[$match[1]] = [
|
||||
'type' => 'agent',
|
||||
'id_agent' => $match[2],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($other_file as $key => $line) {
|
||||
// clean line a long spaces for one space caracter
|
||||
$line = preg_replace('/[ ]+/', ' ', $line);
|
||||
|
||||
$data = [];
|
||||
|
||||
if (preg_match('/^node.*$/', $line) != 0) {
|
||||
$items = explode(' ', $line);
|
||||
$node_id = $items[1];
|
||||
$node_x = ($items[2] * 100);
|
||||
// 200 is for show more big
|
||||
$node_y = ($height_map - $items[3] * 100);
|
||||
// 200 is for show more big
|
||||
$data['id'] = $node_id;
|
||||
$data['text'] = '';
|
||||
$data['image'] = '';
|
||||
$data['width'] = 10;
|
||||
$data['height'] = 10;
|
||||
$data['id_agent'] = 0;
|
||||
|
||||
if (preg_match('/<img src=\"([^\"]*)\"/', $line, $match) == 1) {
|
||||
$image = $match[1];
|
||||
|
||||
$data['shape'] = 'image';
|
||||
$data['image'] = $image;
|
||||
$size = getimagesize($config['homedir'].'/'.$image);
|
||||
$data['width'] = $size[0];
|
||||
$data['height'] = $size[1];
|
||||
|
||||
$data['id_agent'] = 0;
|
||||
$data['id_module'] = 0;
|
||||
$data['type'] = '';
|
||||
$product_name = get_product_name();
|
||||
if (preg_match("/$product_name/", $line) != 0) {
|
||||
$data['text'] = $product_name;
|
||||
$data['id_agent'] = 0;
|
||||
} else {
|
||||
$data['type'] = $ids[$node_id]['type'];
|
||||
|
||||
switch ($ids[$node_id]['type']) {
|
||||
case 'module':
|
||||
$data['id_module'] = $ids[$node_id]['id_module'];
|
||||
$data['id_agent'] = modules_get_agentmodule_agent($ids[$node_id]['id_module']);
|
||||
|
||||
$text = modules_get_agentmodule_name($data['id_module']);
|
||||
$text = ui_print_truncate_text(
|
||||
$text,
|
||||
'agent_medium',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'...',
|
||||
false
|
||||
);
|
||||
$data['text'] = $text;
|
||||
$data['id_agent'] = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', $data['id_module']);
|
||||
break;
|
||||
|
||||
case 'agent':
|
||||
$data['id_agent'] = $ids[$node_id]['id_agent'];
|
||||
|
||||
$text = agents_get_alias($ids[$node_id]['id_agent']);
|
||||
$text = ui_print_truncate_text(
|
||||
$text,
|
||||
'agent_medium',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'...',
|
||||
false
|
||||
);
|
||||
$data['text'] = $text;
|
||||
$data['parent'] = db_get_value('id_parent', 'tagente', 'id_agente', $data['id_agent']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['shape'] = 'wtf';
|
||||
}
|
||||
|
||||
$data['coords'] = [
|
||||
$node_x,
|
||||
$node_y,
|
||||
];
|
||||
|
||||
if (strpos($node_id, 'transp_') !== false) {
|
||||
// removed the transparent nodes
|
||||
} else {
|
||||
$networkmap_nodes[$node_id] = $data;
|
||||
}
|
||||
} else if (preg_match('/^edge.*$/', $line) != 0) {
|
||||
$items = explode(' ', $line);
|
||||
$line_orig = $items[2];
|
||||
$line_dest = $items[1];
|
||||
|
||||
// $relations[$line_dest] = $line_orig;
|
||||
$relations[] = [
|
||||
'orig' => $line_orig,
|
||||
'dest' => $line_dest,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$relations_param = [];
|
||||
|
||||
foreach ($relations as $rel) {
|
||||
if (strpos($rel['orig'], 'transp_') !== false) {
|
||||
// removed the transparent nodes
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strpos($rel['dest'], 'transp_') !== false) {
|
||||
// removed the transparent nodes
|
||||
continue;
|
||||
}
|
||||
|
||||
$row = [
|
||||
'id_child' => $rel['orig'],
|
||||
'child_type' => $networkmap_nodes[$rel['orig']]['type'],
|
||||
'id_parent' => $rel['dest'],
|
||||
'parent_type' => $networkmap_nodes[$rel['dest']]['type'],
|
||||
];
|
||||
$relations_param[] = $row;
|
||||
}
|
||||
|
||||
return $networkmap_nodes;
|
||||
}
|
||||
|
||||
|
||||
function get_status_color_module_networkmap($id_agente_modulo)
|
||||
{
|
||||
$status = modules_get_agentmodule_status($id_agente_modulo);
|
||||
|
@ -2749,4 +2396,4 @@ function networkmap_load_cluetip()
|
|||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,30 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* @subpackage UI
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Functions Update Manager
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
|
||||
|
@ -988,13 +998,61 @@ function update_manger_set_deleted_message($message_id)
|
|||
{
|
||||
global $config;
|
||||
|
||||
$rollback = db_get_value('description', 'tupdate', 'svn_version', $message_id);
|
||||
$rollback = db_get_value(
|
||||
'description',
|
||||
'tupdate',
|
||||
'svn_version',
|
||||
$message_id
|
||||
);
|
||||
$users_read = json_decode($rollback, true);
|
||||
$users_read[$config['id_user']] = 1;
|
||||
|
||||
$rollback = json_encode($users_read);
|
||||
db_process_sql_update('tupdate', ['description' => $rollback ], ['svn_version' => $message_id]);
|
||||
db_process_sql_update(
|
||||
'tupdate',
|
||||
['description' => $rollback ],
|
||||
['svn_version' => $message_id]
|
||||
);
|
||||
|
||||
// Mark as read too
|
||||
// Mark as read too.
|
||||
update_manger_set_read_message($message_id, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function recursive delete directory.
|
||||
*
|
||||
* @param string $dir Directory to delete.
|
||||
* @param array $result Array result state and message.
|
||||
*
|
||||
* @return array Return result array with status 0 valid or 1 false and
|
||||
* type 'f' file and 'd' dir and route path file or directory.
|
||||
*/
|
||||
function rmdir_recursive(string $dir, array &$result)
|
||||
{
|
||||
foreach (scandir($dir) as $file) {
|
||||
if ('.' === $file || '..' === $file) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_dir($dir.'/'.$file) === true) {
|
||||
rmdir_recursive($dir.'/'.$file, $result);
|
||||
} else {
|
||||
$unlink = unlink($dir.'/'.$file);
|
||||
$res = [];
|
||||
$res['status'] = ($unlink === true) ? 0 : 1;
|
||||
$res['type'] = 'f';
|
||||
$res['path'] = $dir.'/'.$file;
|
||||
array_push($result, $res);
|
||||
}
|
||||
}
|
||||
|
||||
$rmdir = rmdir($dir);
|
||||
$res = [];
|
||||
$res['status'] = ($rmdir === true) ? 0 : 1;
|
||||
$res['type'] = 'd';
|
||||
$res['path'] = $dir;
|
||||
array_push($result, $res);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,49 @@
|
|||
/* global jQuery */
|
||||
/* global $ */
|
||||
/* global context_minimap */
|
||||
/* global minimap_w */
|
||||
/* global minimap_h */
|
||||
/* global minimap_relation */
|
||||
/* global graph */
|
||||
/* global translation */
|
||||
/* global scale */
|
||||
/* global width_svg */
|
||||
/* global height_svg */
|
||||
/* global networkmap_dimensions */
|
||||
/* global node_radius */
|
||||
/* global holding_area_dimensions */
|
||||
/* global networkmap_id */
|
||||
/* global enterprise_installed */
|
||||
/* global force */
|
||||
/* global layer_graph_nodes */
|
||||
/* global layer_graph_links */
|
||||
/* global ellipsize */
|
||||
/* global d3 */
|
||||
/* global dialog_node_edit_title */
|
||||
/* global click_menu_position_svg */
|
||||
/* global show_labels:true */
|
||||
/* global show_minimap:true */
|
||||
/* global layer_graph */
|
||||
/* global zoom_obj */
|
||||
/* global disabled_drag_zoom */
|
||||
/* global scale:true */
|
||||
/* global link */
|
||||
/* global siblingCount:true */
|
||||
/* global xRotation:true */
|
||||
/* global largeArc:true */
|
||||
/* global node */
|
||||
|
||||
/* exported delete_link */
|
||||
/* exported update_fictional_node */
|
||||
/* exported update_node_name */
|
||||
/* exported change_shape */
|
||||
/* exported add_agent_node_from_the_filter_group */
|
||||
/* exported hide_labels */
|
||||
/* exported toggle_minimap */
|
||||
/* exported over_node */
|
||||
|
||||
function draw_minimap() {
|
||||
//Clean the canvas
|
||||
// Clean the canvas.
|
||||
context_minimap.clearRect(0, 0, minimap_w, minimap_h);
|
||||
|
||||
context_minimap.beginPath();
|
||||
|
@ -20,6 +64,9 @@ function draw_minimap() {
|
|||
jQuery.each(graph.nodes, function(key, value) {
|
||||
if (typeof value == "undefined") return;
|
||||
|
||||
var center_orig_x;
|
||||
var center_orig_y;
|
||||
|
||||
context_minimap.beginPath();
|
||||
//Paint the item
|
||||
if (graph.nodes.length > 100) {
|
||||
|
@ -36,7 +83,7 @@ function draw_minimap() {
|
|||
|
||||
context_minimap.arc(center_orig_x, center_orig_y, 2, 0, Math.PI * 2, false);
|
||||
//Check if the pandora point
|
||||
if (value.id_agent == -1) {
|
||||
if (value.type == 2) {
|
||||
context_minimap.fillStyle = "#364D1F";
|
||||
} else {
|
||||
context_minimap.fillStyle = "#000";
|
||||
|
@ -96,11 +143,11 @@ function inner_minimap_box(param_x, param_y) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function set_center(id, event) {
|
||||
pos_x = width_svg / 2 - translation[0] / scale;
|
||||
pos_y = height_svg / 2 - translation[1] / scale;
|
||||
|
||||
function set_center(id) {
|
||||
var pos_x = width_svg / 2 - translation[0] / scale;
|
||||
var pos_y = height_svg / 2 - translation[1] / scale;
|
||||
var params = [];
|
||||
|
||||
params.push("set_center=1");
|
||||
params.push("id=" + id);
|
||||
params.push("x=" + pos_x);
|
||||
|
@ -111,11 +158,7 @@ function set_center(id, event) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
}
|
||||
}
|
||||
url: "ajax.php"
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -164,7 +207,7 @@ function delete_link(
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
var found = -1;
|
||||
|
@ -222,7 +265,7 @@ function update_fictional_node(id_db_node) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$("#dialog_node_edit").dialog("close");
|
||||
|
@ -262,7 +305,7 @@ function update_node_name(id_db_node) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$("#dialog_node_edit").dialog("close");
|
||||
|
@ -308,13 +351,13 @@ function change_shape(id_db_node) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
$("#shape_icon_in_progress").css("display", "none");
|
||||
if (data["correct"]) {
|
||||
$("#shape_icon_correct").css("display", "");
|
||||
|
||||
count = graph.nodes.length;
|
||||
var count = graph.nodes.length;
|
||||
|
||||
jQuery.each(graph.nodes, function(i, element) {
|
||||
if (element.id_db == id_db_node) {
|
||||
|
@ -585,7 +628,7 @@ function update_link(row_index, id_link) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
$(".edit_icon_progress_" + row_index).css("display", "none");
|
||||
|
||||
|
@ -607,12 +650,10 @@ function update_link(row_index, id_link) {
|
|||
"']"
|
||||
).prop("selected", true);
|
||||
|
||||
var id = "";
|
||||
var index = -1;
|
||||
$.each(graph.links, function(j, link) {
|
||||
if (link["id_db"] == id_link) {
|
||||
index = j;
|
||||
id = String(id_link);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -706,7 +747,7 @@ function move_to_networkmap(node) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
window.location =
|
||||
|
@ -726,6 +767,7 @@ function edit_node(data_node, dblClick) {
|
|||
|
||||
//Only select one node
|
||||
var selection = d3.selectAll(".node_selected");
|
||||
var id;
|
||||
|
||||
if (selection[0].length == 1) {
|
||||
edit_node = selection[0].pop();
|
||||
|
@ -746,12 +788,12 @@ function edit_node(data_node, dblClick) {
|
|||
.select(edit_node)
|
||||
.attr("id")
|
||||
.replace("id_node_", "");
|
||||
id_networkmap_lenght = networkmap_id.toString().length;
|
||||
id_node_length = id.length - id_networkmap_lenght;
|
||||
var id_networkmap_lenght = networkmap_id.toString().length;
|
||||
var id_node_length = id.length - id_networkmap_lenght;
|
||||
id = id.substring(0, id_node_length);
|
||||
node_selected = graph.nodes[id];
|
||||
var node_selected = graph.nodes[id];
|
||||
|
||||
selected_links = get_relations(node_selected);
|
||||
var selected_links = get_relations(node_selected);
|
||||
|
||||
$(
|
||||
"select[name='shape'] option[value='" + node_selected.shape + "']"
|
||||
|
@ -779,7 +821,7 @@ function edit_node(data_node, dblClick) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
$("#node_details-0-1").html(
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' +
|
||||
|
@ -795,7 +837,7 @@ function edit_node(data_node, dblClick) {
|
|||
addresses += data["adressess"][i] + "<br>";
|
||||
}
|
||||
} else {
|
||||
for (address in data["adressess"]) {
|
||||
for (var address in data["adressess"]) {
|
||||
addresses += address + "<br>";
|
||||
}
|
||||
}
|
||||
|
@ -826,7 +868,7 @@ function edit_node(data_node, dblClick) {
|
|||
); // It doesn't eval the possible XSS so it's ok
|
||||
$("#dialog_node_edit").dialog("open");
|
||||
|
||||
if (node_selected.id_agent == undefined || node_selected.id_agent == -2) {
|
||||
if (node_selected.id_agent == undefined || node_selected.type == 3) {
|
||||
//Fictional node
|
||||
$("#node_options-fictional_node_name").css("display", "");
|
||||
$("input[name='edit_name_fictional_node']").val(node_selected.text); // It doesn't eval the possible XSS so it's ok
|
||||
|
@ -868,7 +910,7 @@ function get_interface_data_to_table(node_selected, selected_links) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data.length == 0) {
|
||||
$("#interface_information")
|
||||
|
@ -880,10 +922,11 @@ function get_interface_data_to_table(node_selected, selected_links) {
|
|||
);
|
||||
} else {
|
||||
jQuery.each(data, function(j, interface) {
|
||||
var interf_graph;
|
||||
if (interface["graph"] == "") {
|
||||
var interf_graph = "--";
|
||||
interf_graph = "--";
|
||||
} else {
|
||||
var interf_graph = interface["graph"];
|
||||
interf_graph = interface["graph"];
|
||||
}
|
||||
$("#interface_information")
|
||||
.find("tbody")
|
||||
|
@ -955,7 +998,7 @@ function load_interfaces(selected_links) {
|
|||
type: "POST",
|
||||
async: true,
|
||||
cache: false,
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$(
|
||||
|
@ -1075,7 +1118,7 @@ function add_node() {
|
|||
}
|
||||
|
||||
function add_agent_node_from_the_filter_group() {
|
||||
agents = $("select[name='agents_filter_group']").val();
|
||||
var agents = $("select[name='agents_filter_group']").val();
|
||||
|
||||
add_agent_node(agents);
|
||||
}
|
||||
|
@ -1122,7 +1165,7 @@ function add_agent_node(agents) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$("#agent_name").val("");
|
||||
|
@ -1210,24 +1253,17 @@ function add_agent_node(agents) {
|
|||
|
||||
var temp_node = {};
|
||||
temp_node["id"] = graph.nodes.length;
|
||||
temp_node["id_db"] = data["id_node"];
|
||||
temp_node["id_agent"] = data["id_agent"];
|
||||
temp_node["id_db"] = graph.nodes.length;
|
||||
temp_node["id_agent"] = id_agent;
|
||||
temp_node["id_module"] = "";
|
||||
temp_node["px"] = data["x"];
|
||||
temp_node["py"] = data["y"];
|
||||
temp_node["x"] = data["x"];
|
||||
temp_node["y"] = data["y"];
|
||||
temp_node["px"] = x;
|
||||
temp_node["py"] = y;
|
||||
temp_node["x"] = x;
|
||||
temp_node["y"] = y;
|
||||
temp_node["z"] = 0;
|
||||
temp_node["fixed"] = true;
|
||||
temp_node["type"] = 0;
|
||||
temp_node["color"] = data["status"];
|
||||
temp_node["shape"] = data["shape"];
|
||||
temp_node["text"] = data["text"];
|
||||
temp_node["image_url"] = data["image_url"];
|
||||
temp_node["image_width"] = data["width"];
|
||||
temp_node["image_height"] = data["height"];
|
||||
temp_node["map_id"] = data["map_id"];
|
||||
temp_node["state"] = data["state"];
|
||||
temp_node["map_id"] = networkmap_id;
|
||||
|
||||
graph.nodes.push(temp_node);
|
||||
}
|
||||
|
@ -1320,9 +1356,10 @@ function delete_nodes() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
var found = -1;
|
||||
do {
|
||||
found = -1;
|
||||
jQuery.each(graph.links, function(i, element) {
|
||||
|
@ -1600,7 +1637,7 @@ function set_positions_graph() {
|
|||
}
|
||||
|
||||
function over_node(d) {
|
||||
over = d3.select("#id_node_" + d.id + networkmap_id).classed("node_over");
|
||||
var over = d3.select("#id_node_" + d.id + networkmap_id).classed("node_over");
|
||||
|
||||
in_a_node = !in_a_node;
|
||||
|
||||
|
@ -1644,7 +1681,8 @@ function clear_selection() {
|
|||
function update_networkmap() {
|
||||
if (enterprise_installed) {
|
||||
node.each(function(d) {
|
||||
if (d.id_agent != -1) {
|
||||
// Do not update Pandora FMS node.
|
||||
if (d.type != 2) {
|
||||
var params = [];
|
||||
params.push("update_node_color=1");
|
||||
params.push("id=" + d.id_db);
|
||||
|
@ -1656,7 +1694,7 @@ function update_networkmap() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
d3.select(
|
||||
"#id_node_" + d.id + networkmap_id + " .node_shape"
|
||||
|
@ -1668,7 +1706,7 @@ function update_networkmap() {
|
|||
|
||||
link.each(function(d) {
|
||||
if (d.id_module_start != 0 || d.id_module_end != 0) {
|
||||
if (d.id_module_start != 0) {
|
||||
if (d.id_module_start && d.id_module_start > 0) {
|
||||
var params = [];
|
||||
params.push("module_get_status=1");
|
||||
params.push("page=operation/agentes/pandora_networkmap.view");
|
||||
|
@ -1677,7 +1715,7 @@ function update_networkmap() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
d3.selectAll(".id_module_start_" + d.id_module_start).attr(
|
||||
"marker-start",
|
||||
|
@ -1691,7 +1729,7 @@ function update_networkmap() {
|
|||
});
|
||||
}
|
||||
|
||||
if (d.id_module_end != 0) {
|
||||
if (d.id_module_end && d.id_module_end > 0) {
|
||||
var params = [];
|
||||
params.push("module_get_status=1");
|
||||
params.push("page=operation/agentes/pandora_networkmap.view");
|
||||
|
@ -1700,7 +1738,7 @@ function update_networkmap() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
d3.selectAll(".id_module_end_" + d.id_module_end).attr(
|
||||
"marker-end",
|
||||
|
@ -1859,7 +1897,7 @@ function show_menu(item, data) {
|
|||
icon: "interface_link_children",
|
||||
disabled: function() {
|
||||
if (enterprise_installed) {
|
||||
if (data.type == 3) {
|
||||
if (data.type == 3 || data.type == 2) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -1929,7 +1967,7 @@ function show_menu(item, data) {
|
|||
icon: "interface_link_parent",
|
||||
disabled: function() {
|
||||
if (enterprise_installed) {
|
||||
if (data.type == 3) {
|
||||
if (data.type == 3 || data.type == 2) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -2015,7 +2053,8 @@ function show_menu(item, data) {
|
|||
};
|
||||
}
|
||||
|
||||
if (data.id_agent != -1) {
|
||||
// Avoid deletion if Pandora FMS node.
|
||||
if (data.type != 2) {
|
||||
items_list["delete"] = {
|
||||
name: delete_menu,
|
||||
icon: "delete",
|
||||
|
@ -2141,21 +2180,25 @@ function show_menu(item, data) {
|
|||
};
|
||||
}
|
||||
|
||||
$.contextMenu("destroy");
|
||||
$.contextMenu({
|
||||
disabled: false,
|
||||
selector: "#networkconsole_" + networkmap_id,
|
||||
// define the elements of the menu
|
||||
items: items_list
|
||||
});
|
||||
if (typeof $.contextMenu == "function") {
|
||||
$.contextMenu("destroy");
|
||||
$.contextMenu({
|
||||
disabled: false,
|
||||
selector: "#networkconsole_" + networkmap_id,
|
||||
// define the elements of the menu
|
||||
items: items_list
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//Force to show in the mouse position
|
||||
$("#networkconsole_" + networkmap_id).contextMenu({
|
||||
x: mouse[0],
|
||||
y: mouse[1]
|
||||
});
|
||||
if (typeof $("#networkconsole_" + networkmap_id).contextMenu == "function") {
|
||||
$("#networkconsole_" + networkmap_id).contextMenu({
|
||||
x: mouse[0],
|
||||
y: mouse[1]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function add_interface_link(data_parent) {
|
||||
|
@ -2205,7 +2248,7 @@ function add_interface_link(data_parent) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
var parent_name = data_parent.text;
|
||||
var child_name = child_data.text;
|
||||
|
@ -2250,32 +2293,32 @@ function add_interface_link_js() {
|
|||
cancel_set_parent_interface();
|
||||
$("#dialog_interface_link").dialog("close");
|
||||
|
||||
source_value = $("#interface_source_select").val();
|
||||
source_text = $("#interface_source_select")
|
||||
var source_value = $("#interface_source_select").val();
|
||||
var source_text = $("#interface_source_select")
|
||||
.find("option:selected")
|
||||
.text();
|
||||
target_value = $("#interface_target_select").val();
|
||||
target_text = $("#interface_target_select")
|
||||
var target_value = $("#interface_target_select").val();
|
||||
var target_text = $("#interface_target_select")
|
||||
.find("option:selected")
|
||||
.text();
|
||||
|
||||
var params = [];
|
||||
params.push("add_interface_relation=1");
|
||||
params.push("id=" + networkmap_id);
|
||||
params.push("source_value=" + source_value);
|
||||
params.push("target_value=" + target_value);
|
||||
params.push("source_text=" + source_text);
|
||||
params.push("target_text=" + target_text);
|
||||
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
|
||||
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
data: {
|
||||
page: "enterprise/operation/agentes/pandora_networkmap.view",
|
||||
add_interface_relation: 1,
|
||||
id: networkmap_id,
|
||||
source_value: source_value,
|
||||
target_value: target_value,
|
||||
source_text: source_text,
|
||||
target_text: target_text
|
||||
},
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
var temp_link = {};
|
||||
temp_link["id"] = graph.links.length;
|
||||
temp_link["status_start"] = "0";
|
||||
temp_link["status_end"] = "0";
|
||||
|
||||
|
@ -2284,8 +2327,9 @@ function add_interface_link_js() {
|
|||
if (data["type_source"] == 1) {
|
||||
temp_link["arrow_start"] = "module";
|
||||
temp_link["id_module_start"] = source_value;
|
||||
temp_link["status_start"] = data["status"];
|
||||
temp_link["link_color"] = data["status"] == "1" ? "#FC4444" : "#999";
|
||||
temp_link["status_start"] = data["status_start"];
|
||||
temp_link["link_color"] =
|
||||
data["status_start"] == "1" ? "#FC4444" : "#999";
|
||||
} else {
|
||||
temp_link["arrow_start"] = "";
|
||||
temp_link["id_agent_start"] = source_value;
|
||||
|
@ -2294,8 +2338,9 @@ function add_interface_link_js() {
|
|||
if (data["type_target"] == 1) {
|
||||
temp_link["arrow_end"] = "module";
|
||||
temp_link["id_module_end"] = target_value;
|
||||
temp_link["status_end"] = data["status"];
|
||||
temp_link["link_color"] = data["status"] == "1" ? "#FC4444" : "#999";
|
||||
temp_link["status_end"] = data["status_end"];
|
||||
temp_link["link_color"] =
|
||||
data["status_end"] == "1" ? "#FC4444" : "#999";
|
||||
} else {
|
||||
temp_link["arrow_end"] = "";
|
||||
temp_link["id_agent_end"] = target_value;
|
||||
|
@ -2325,8 +2370,8 @@ function add_interface_link_js() {
|
|||
}
|
||||
|
||||
function refresh_holding_area() {
|
||||
holding_pos_x = d3.select("#holding_area_" + networkmap_id).attr("x");
|
||||
holding_pos_y = d3.select("#holding_area_" + networkmap_id).attr("y");
|
||||
var holding_pos_x = d3.select("#holding_area_" + networkmap_id).attr("x");
|
||||
var holding_pos_y = d3.select("#holding_area_" + networkmap_id).attr("y");
|
||||
|
||||
var pos_x = parseInt(holding_pos_x) + parseInt(node_radius);
|
||||
var pos_y = parseInt(holding_pos_y) + parseInt(node_radius);
|
||||
|
@ -2342,7 +2387,7 @@ function refresh_holding_area() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
window.holding_area = data["holding_area"];
|
||||
|
@ -2510,28 +2555,29 @@ function proceed_to_restart_map() {
|
|||
text: ok_button,
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
var new_elements = [];
|
||||
new_elements[0] = $("#text-name").val();
|
||||
new_elements[1] = $("#id_group").val();
|
||||
new_elements[2] = $("#text-node_radius").val();
|
||||
new_elements[3] = $("#textarea_description").val();
|
||||
new_elements[4] = $("input[name=source]:checked").val();
|
||||
if (new_elements[4] == "group") {
|
||||
new_elements[5] = $("#checkbox-dont_show_subgroups").is(":checked");
|
||||
} else if (new_elements[4] == "recon_task") {
|
||||
new_elements[5] = $("#recon_task_id").val();
|
||||
} else {
|
||||
new_elements[5] = $("#text-ip_mask").val();
|
||||
}
|
||||
new_elements[6] = $("#method").val();
|
||||
new_elements[7] = $("#text-pos_x").val();
|
||||
new_elements[8] = $("#text-pos_y").val();
|
||||
new_elements[9] = $("#text-scale_z").val();
|
||||
new_elements[10] = $("#text-node_sep").val();
|
||||
new_elements[11] = $("#text-mindist").val();
|
||||
new_elements[12] = $("#text-rank_sep").val();
|
||||
new_elements[13] = $("#text-kval").val();
|
||||
reset_map_from_form(new_elements);
|
||||
var data = {
|
||||
params: {
|
||||
name: $("#text-name").val(),
|
||||
id_group: $("#id_group").val(),
|
||||
node_radius: $("#text-node_radius").val(),
|
||||
description: $("#textarea_description").val(),
|
||||
source: $("input[name=source]:checked").val(),
|
||||
dont_show_subgroups: $("#checkbox-dont_show_subgroups").is(
|
||||
":checked"
|
||||
),
|
||||
recon_task_id: $("#recon_task_id").val(),
|
||||
ip_mask: $("#text-ip_mask").val(),
|
||||
generation_method: $("#method").val(),
|
||||
pos_x: $("#text-pos_x").val(),
|
||||
pos_y: $("#text-pos_y").val(),
|
||||
scale_z: $("#text-scale_z").val(),
|
||||
node_sep: $("#text-node_sep").val(),
|
||||
mindist: $("#text-mindist").val(),
|
||||
rank_sep: $("#text-rank_sep").val(),
|
||||
kval: $("#text-kval").val()
|
||||
}
|
||||
};
|
||||
reset_map_from_form(data);
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -2551,26 +2597,26 @@ function proceed_to_restart_map() {
|
|||
data: params.join("&"),
|
||||
dataType: "html",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
$("#restart_map_form").html(data);
|
||||
$("#restart_map_form").dialog("open");
|
||||
$("#restart_map_form")
|
||||
.html(data)
|
||||
.dialog("open");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reset_map_from_form(new_elements) {
|
||||
var params = [];
|
||||
params.push("reset_map=1");
|
||||
params.push("map_id=" + networkmap_id);
|
||||
params.push("elems[]=" + new_elements);
|
||||
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
|
||||
var data = new_elements;
|
||||
data.map_id = networkmap_id;
|
||||
data.reset_map = 1;
|
||||
data.page = "enterprise/operation/agentes/pandora_networkmap.view";
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
data: data,
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
success: function(data) {
|
||||
url: "ajax.php",
|
||||
success: function(d) {
|
||||
window.location =
|
||||
"index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap=" +
|
||||
networkmap_id;
|
||||
|
@ -2634,7 +2680,7 @@ function set_parent(parent_data) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
//Add the relationship and paint
|
||||
|
@ -2725,23 +2771,25 @@ function init_drag_and_drop() {
|
|||
var selection = d3.selectAll(".node_selected");
|
||||
|
||||
if (enterprise_installed) {
|
||||
holding_pos_x = d3.select("#holding_area_" + networkmap_id).attr("x");
|
||||
holding_pos_y = d3.select("#holding_area_" + networkmap_id).attr("y");
|
||||
var holding_pos_x = d3
|
||||
.select("#holding_area_" + networkmap_id)
|
||||
.attr("x");
|
||||
var holding_pos_y = d3
|
||||
.select("#holding_area_" + networkmap_id)
|
||||
.attr("y");
|
||||
delete d.raw_text;
|
||||
selection.each(function(d) {
|
||||
var params = [];
|
||||
params.push("update_node=1");
|
||||
params.push("node=" + JSON.stringify(d));
|
||||
params.push("x=" + holding_pos_x);
|
||||
params.push("y=" + holding_pos_y);
|
||||
params.push(
|
||||
"page=enterprise/operation/agentes/pandora_networkmap.view"
|
||||
);
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
node: JSON.stringify(d),
|
||||
x: holding_pos_x,
|
||||
y: holding_pos_y,
|
||||
update_node: 1,
|
||||
page: "enterprise/operation/agentes/pandora_networkmap.view"
|
||||
},
|
||||
success: function(data) {
|
||||
if (d.state == "holding_area") {
|
||||
//It is out the holding area
|
||||
|
@ -2775,7 +2823,7 @@ function init_drag_and_drop() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$("#open_version_dialog").dialog();
|
||||
|
@ -2838,7 +2886,7 @@ function add_fictional_node() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$("#dialog_node_add").dialog("close");
|
||||
|
@ -3989,7 +4037,7 @@ function choose_group_for_show_agents() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "ajax.php"),
|
||||
url: "ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$("#agents_filter_group").html("");
|
||||
|
@ -4011,162 +4059,6 @@ function choose_group_for_show_agents() {
|
|||
'<option value="-1">' + translation_none + "</option>"
|
||||
);
|
||||
$("#spinner_group").css("display", "none");
|
||||
function show_networkmap_node(id_agent_param, refresh_state) {
|
||||
id_agent = id_agent_param;
|
||||
|
||||
canvas = $("#node_info");
|
||||
context_popup = canvas[0].getContext("2d");
|
||||
|
||||
dirty_popup = true;
|
||||
self.setInterval("check_popup_modification()", 1000 / 30);
|
||||
|
||||
$("#node_info").mousemove(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
module_inner = inner_module(x, y);
|
||||
|
||||
if (module_inner != null) {
|
||||
document.body.style.cursor = "pointer";
|
||||
} else {
|
||||
document.body.style.cursor = "default";
|
||||
}
|
||||
});
|
||||
|
||||
$("#node_info").mousedown(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
if (module_inner != null) {
|
||||
show_tooltip(module_inner, x, y);
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#node_info").mouseup(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
drag = false;
|
||||
drag_x = 0;
|
||||
drag_y = 0;
|
||||
dirty_popup = true;
|
||||
|
||||
document.body.style.cursor = "default";
|
||||
|
||||
module_inner = null;
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#node_info").mouseout(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
drag = false;
|
||||
drag_x = 0;
|
||||
drag_y = 0;
|
||||
dirty_popup = true;
|
||||
|
||||
document.body.style.cursor = "default";
|
||||
|
||||
module_inner = null;
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
function show_networkmap_node(id_agent_param, refresh_state) {
|
||||
id_agent = id_agent_param;
|
||||
|
||||
canvas = $("#node_info");
|
||||
context_popup = canvas[0].getContext("2d");
|
||||
|
||||
dirty_popup = true;
|
||||
self.setInterval("check_popup_modification()", 1000 / 30);
|
||||
|
||||
$("#node_info").mousemove(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
module_inner = inner_module(x, y);
|
||||
|
||||
if (module_inner != null) {
|
||||
document.body.style.cursor = "pointer";
|
||||
} else {
|
||||
document.body.style.cursor = "default";
|
||||
}
|
||||
});
|
||||
|
||||
$("#node_info").mousedown(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
if (module_inner != null) {
|
||||
show_tooltip(module_inner, x, y);
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#node_info").mouseup(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
drag = false;
|
||||
drag_x = 0;
|
||||
drag_y = 0;
|
||||
dirty_popup = true;
|
||||
|
||||
document.body.style.cursor = "default";
|
||||
|
||||
module_inner = null;
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#node_info").mouseout(function(event) {
|
||||
var x = event.pageX - $("#node_info").offset().left;
|
||||
var y = event.pageY - $("#node_info").offset().top;
|
||||
|
||||
drag = false;
|
||||
drag_x = 0;
|
||||
drag_y = 0;
|
||||
dirty_popup = true;
|
||||
|
||||
document.body.style.cursor = "default";
|
||||
|
||||
module_inner = null;
|
||||
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
pos_scroll = Math.floor(
|
||||
$("#content_node_info").width() / 2
|
||||
);
|
||||
|
||||
$("#content_node_info").scrollLeft(pos_scroll);
|
||||
|
||||
dirty_popup = true;
|
||||
check_popup_modification();
|
||||
});
|
||||
}
|
||||
pos_scroll = Math.floor($("#content_node_info").width() / 2);
|
||||
|
||||
$("#content_node_info").scrollLeft(pos_scroll);
|
||||
|
||||
dirty_popup = true;
|
||||
check_popup_modification();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -4211,7 +4103,7 @@ function get_status_node() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "../../../ajax.php"),
|
||||
url: "../../../ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
color_status_node = data["status_agent"];
|
||||
|
@ -4233,7 +4125,7 @@ function get_status_module() {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "../../../ajax.php"),
|
||||
url: "../../../ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
modules[data["id"]].status_color = data["status_color"];
|
||||
|
@ -4331,7 +4223,7 @@ function show_tooltip_content(id) {
|
|||
data: params.join("&"),
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
url: (action = "../../../ajax.php"),
|
||||
url: "../../../ajax.php",
|
||||
success: function(data) {
|
||||
if (data["correct"]) {
|
||||
$("#tooltip").html(data["content"]);
|
||||
|
@ -4351,7 +4243,7 @@ function show_tooltip(id, x, y) {
|
|||
jQuery.ajax({
|
||||
data: params1.join("&"),
|
||||
type: "POST",
|
||||
url: (action = "../../../ajax.php"),
|
||||
url: "../../../ajax.php",
|
||||
success: function(data) {
|
||||
$("#tooltip").html(data);
|
||||
$("#tooltip").css("display", "");
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
maxDelta: 6,
|
||||
interval: 50
|
||||
},
|
||||
zoomWheelEnabled: true
|
||||
zoomWheelEnabled: false
|
||||
}),
|
||||
new OpenLayers.Control.Zoom(),
|
||||
new OpenLayers.Control.ZoomBox()
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
globals $, jQuery
|
||||
*/
|
||||
|
||||
var correct_install_progress = true;
|
||||
|
||||
function form_upload(homeurl) {
|
||||
|
@ -1246,11 +1250,11 @@ function check_install_package(package, homeurl) {
|
|||
data: parameters,
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
// Print the updated files and take the scroll to the bottom
|
||||
$("#log_zone").html(data.info);
|
||||
// Print the updated files and take the scroll to the bottom.
|
||||
$("#log_zone").append(data.info);
|
||||
$("#log_zone").scrollTop($("#log_zone").prop("scrollHeight"));
|
||||
|
||||
// Change the progress bar
|
||||
// Change the progress bar.
|
||||
if (
|
||||
$("#form-offline_update ul")
|
||||
.find("li")
|
||||
|
@ -1271,14 +1275,19 @@ function check_install_package(package, homeurl) {
|
|||
.trigger("change");
|
||||
}
|
||||
|
||||
// The class loading is present until the update ends
|
||||
// The class loading is present until the update ends.
|
||||
var isInstalling = $("#form-offline_update ul")
|
||||
.find("li")
|
||||
.hasClass("loading");
|
||||
if (data.progress < 100 && isInstalling) {
|
||||
// Recursive call to check the update status
|
||||
// Recursive call to check the update status.
|
||||
check_install_package(package, homeurl);
|
||||
}
|
||||
|
||||
if (!isInstalling) {
|
||||
//Check if exist remove files.
|
||||
delete_desired_files(homeurl);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2290,3 +2299,107 @@ function remove_rr_file_to_extras(homeurl) {
|
|||
success: function(data) {}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Function delete files desired and add extras/delete_files.txt.
|
||||
*
|
||||
* @param string homeurl Url.
|
||||
*/
|
||||
function delete_desired_files(homeurl) {
|
||||
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
||||
|
||||
var parameters = {
|
||||
page: "include/ajax/update_manager.ajax",
|
||||
delete_desired_files: 1
|
||||
};
|
||||
|
||||
jQuery.ajax({
|
||||
data: parameters,
|
||||
type: "POST",
|
||||
url: home_url + "ajax.php",
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
var translation = data.translation;
|
||||
// Print the deleted files.
|
||||
// Print title.
|
||||
$("#log_zone").append(
|
||||
"</br></br><span class='log_zone_line bolder';>" +
|
||||
translation.title +
|
||||
": </span></br></br>"
|
||||
);
|
||||
$.each(data.status_list, function(key, value) {
|
||||
var log_zone_line_class = "log_zone_line ";
|
||||
var msg = "";
|
||||
switch (value.status) {
|
||||
case -1:
|
||||
//Not exits file.
|
||||
msg = translation.not_file;
|
||||
break;
|
||||
case 0:
|
||||
//File or directory deleted successfully.
|
||||
if (value.type === "f") {
|
||||
log_zone_line_class += "";
|
||||
} else {
|
||||
log_zone_line_class += "bolder";
|
||||
}
|
||||
|
||||
msg = value.path;
|
||||
break;
|
||||
case 1:
|
||||
//Problem delete file or directory.
|
||||
if (value.type === "f") {
|
||||
log_zone_line_class += "log_zone_line_error";
|
||||
} else {
|
||||
log_zone_line_class += "log_zone_line_error bolder";
|
||||
}
|
||||
|
||||
msg = value.path + " ( " + translation.not_deleted + " ) ";
|
||||
break;
|
||||
case 2:
|
||||
//Not found file or directory.
|
||||
if (value.type === "f") {
|
||||
log_zone_line_class += "log_zone_line_error";
|
||||
} else {
|
||||
log_zone_line_class += "log_zone_line_error bolder";
|
||||
}
|
||||
|
||||
msg = value.path + " ( " + translation.not_found + " ) ";
|
||||
break;
|
||||
case 3:
|
||||
//Don`t read file deleet_files.txt.
|
||||
log_zone_line_class += "log_zone_line_error bolder";
|
||||
msg = translation.not_read;
|
||||
break;
|
||||
case 4:
|
||||
//"deleted" folder could not be created.
|
||||
log_zone_line_class += "log_zone_line_error bolder";
|
||||
msg = value.path + " ( " + translation.folder_deleted_f + " ) ";
|
||||
break;
|
||||
case 5:
|
||||
//"deleted" folder was created.
|
||||
log_zone_line_class += "bolder";
|
||||
msg = translation.folder_deleted_t;
|
||||
break;
|
||||
case 6:
|
||||
//The "delete files" could not be the "delete" folder.
|
||||
log_zone_line_class += "log_zone_line_error bolder";
|
||||
msg = value.path + " ( " + translation.move_file_f + " ) ";
|
||||
break;
|
||||
case 7:
|
||||
//The "delete files" is moved to the "delete" folder.
|
||||
log_zone_line_class += "bolder";
|
||||
msg = translation.move_file_d;
|
||||
break;
|
||||
default:
|
||||
// It can not come without state.
|
||||
break;
|
||||
}
|
||||
|
||||
//Print line.
|
||||
$("#log_zone").append(
|
||||
"<span class='" + log_zone_line_class + "' >" + msg + "</span><br>"
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -389,7 +389,7 @@ ul li a:hover {
|
|||
|
||||
.button_collapse {
|
||||
height: 38px;
|
||||
background-color: #6c6c6d;
|
||||
background-color: #505050;
|
||||
width: 60px; /* This is overwritten by the classic menu (215px) */
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
|
|
|
@ -647,11 +647,10 @@ a.footer span {
|
|||
}
|
||||
|
||||
div#foot {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
text-align: center;
|
||||
background: #343434;
|
||||
height: 30px;
|
||||
clear: both;
|
||||
width: auto;
|
||||
}
|
||||
|
@ -659,7 +658,7 @@ div#foot {
|
|||
div#foot a,
|
||||
div#foot span {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-size: 8.5pt;
|
||||
font-size: 8pt;
|
||||
color: #9ca4a6;
|
||||
}
|
||||
|
||||
|
@ -1270,7 +1269,7 @@ div.title_line {
|
|||
background-color: #fff;
|
||||
border-top-right-radius: 7px;
|
||||
border-top-left-radius: 7px;
|
||||
box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
#menu_tab {
|
||||
|
@ -1374,7 +1373,6 @@ div#agent_wizard_subtabs {
|
|||
*/
|
||||
/* TAB TITLE */
|
||||
#menu_tab_left {
|
||||
/*margin-left: 0px !important;*/
|
||||
max-width: 60%;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
@ -1382,28 +1380,18 @@ div#agent_wizard_subtabs {
|
|||
#menu_tab_left .mn,
|
||||
#menu_tab_left ul,
|
||||
#menu_tab_left .mn ul {
|
||||
/* background-color: #000;*/
|
||||
color: #343434;
|
||||
/*font-weight: bold;*/
|
||||
padding: 0px 0px 0px 0px;
|
||||
list-style: none;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
#menu_tab_left .mn li {
|
||||
/* float: left;
|
||||
position: relative;
|
||||
height: 40px;
|
||||
max-height: 40px;*/
|
||||
}
|
||||
|
||||
#menu_tab_left .mn li a {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
}
|
||||
#menu_tab_left li.view a {
|
||||
color: #343434;
|
||||
/*font-weight: bold;
|
||||
font-weight: 100;
|
||||
line-height: 18px;*/
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -1421,13 +1409,8 @@ div#agent_wizard_subtabs {
|
|||
|
||||
#menu_tab_left li a,
|
||||
#menu_tab_left li span {
|
||||
/*text-transform: uppercase;*/
|
||||
color: #343434;
|
||||
font-size: 14pt;
|
||||
/*font-size: 100%;
|
||||
line-height: 20px;
|
||||
letter-spacing: 0px;*/
|
||||
font-family: "Open Sans", sans-serif;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2042,15 +2025,29 @@ div#pandora_logo_header {
|
|||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.header_title {
|
||||
font-weight: 600;
|
||||
font-size: 10.5pt;
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
}
|
||||
|
||||
.header_subtitle {
|
||||
font-size: 10pt;
|
||||
font-family: "lato-bolder", "Open Sans", sans-serif !important;
|
||||
}
|
||||
|
||||
#header_table_inner a,
|
||||
#header_table_inner span {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
}
|
||||
|
||||
#header_table_inner a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.header_left {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header_center {
|
||||
|
@ -2065,64 +2062,40 @@ div#pandora_logo_header {
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
.header_left > div,
|
||||
.header_center > div {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.header_right > div {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
#header_table_inner #header_user span {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.header_left img,
|
||||
.header_center img,
|
||||
.header_right img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#header_chat {
|
||||
padding-left: 0;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
#header_autorefresh {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#header_table_inner #header_user span {
|
||||
color: #777;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
#header_table_inner #header_user a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#header_user img {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#header_alert,
|
||||
#header_message {
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
#header_alert p,
|
||||
#header_message p {
|
||||
border-radius: 50%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 15px;
|
||||
position: relative;
|
||||
height: 15px;
|
||||
top: -5px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
vertical-align: super;
|
||||
}
|
||||
|
||||
#header_alert p {
|
||||
background-color: #ec4e1b;
|
||||
left: -12px;
|
||||
}
|
||||
|
||||
#header_message p {
|
||||
background-color: #82b92e;
|
||||
left: -9px;
|
||||
}
|
||||
|
||||
#header_alert span,
|
||||
#header_message span {
|
||||
color: #fff;
|
||||
font-size: 7pt;
|
||||
font-weight: 600;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
div#header_autorefresh_counter {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.autorefresh_disabled {
|
||||
|
@ -2134,10 +2107,21 @@ a.autorefresh_txt,
|
|||
color: #1c1c1c;
|
||||
font-size: 8.5pt;
|
||||
}
|
||||
/*
|
||||
#combo_refr select {
|
||||
margin-right: 8px;
|
||||
}*/
|
||||
|
||||
@media screen and (min-width: 1024px) and (max-width: 1200px) {
|
||||
#header_searchbar input.search_input {
|
||||
width: 135px;
|
||||
}
|
||||
.header_right > div {
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1300px) {
|
||||
.header_right > div {
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.disabled_module {
|
||||
color: #aaa;
|
||||
|
@ -2872,9 +2856,8 @@ input.search_input {
|
|||
background-color: #f2f6f7 !important;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
width: 200px;
|
||||
height: 35px;
|
||||
margin-bottom: 5px;
|
||||
width: 250px;
|
||||
height: 30px;
|
||||
margin-left: 2px;
|
||||
padding-left: 15px;
|
||||
padding-right: 40px;
|
||||
|
@ -3924,7 +3907,19 @@ div.simple_value > a > span.text p {
|
|||
font-size: 18pt;
|
||||
}
|
||||
|
||||
span.log_zone_line {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
span.log_zone_line_error {
|
||||
color: #fc4444;
|
||||
}
|
||||
|
||||
/* global */
|
||||
.bolder {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.readonly {
|
||||
background-color: #dedede !important;
|
||||
}
|
||||
|
@ -4413,28 +4408,20 @@ div#dialog_messages table th:last-child {
|
|||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
div#header_discovery {
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 15px 0px #949494;
|
||||
width: 9px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
div#header_discovery:hover {
|
||||
box-shadow: 0 0 5px 2px #949494;
|
||||
}
|
||||
|
||||
.notification-ball {
|
||||
border: #fff solid 2px;
|
||||
border-radius: 50%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.notification-ball.notification-ball-new-messages:hover {
|
||||
box-shadow: 0 0 3px #888;
|
||||
}
|
||||
|
||||
.notification-ball-no-messages {
|
||||
|
@ -4450,10 +4437,9 @@ div#header_discovery:hover {
|
|||
border: #a5a5a5 solid 1px;
|
||||
z-index: 900000;
|
||||
position: absolute;
|
||||
width: 590px;
|
||||
width: 550px;
|
||||
margin-top: -5px;
|
||||
border-radius: 5px;
|
||||
margin-left: -146px;
|
||||
}
|
||||
#notification-wrapper::before {
|
||||
content: "";
|
||||
|
@ -4465,8 +4451,7 @@ div#header_discovery:hover {
|
|||
border-width: 12px;
|
||||
border-style: solid;
|
||||
bottom: 100%;
|
||||
left: 78%;
|
||||
left: calc(78% - 2px);
|
||||
left: calc(58% - 7px);
|
||||
margin-left: -12px;
|
||||
border-bottom-color: white;
|
||||
}
|
||||
|
@ -4762,7 +4747,6 @@ input:checked + .p-slider:before {
|
|||
border: 1px solid #d7d9da;
|
||||
border-radius: 10px;
|
||||
padding: 20px 50px;
|
||||
box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4772,8 +4756,6 @@ input:checked + .p-slider:before {
|
|||
*/
|
||||
|
||||
#user_form * {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
font-size: 10pt;
|
||||
color: #4d4d4d;
|
||||
}
|
||||
|
||||
|
@ -4785,10 +4767,6 @@ input:checked + .p-slider:before {
|
|||
margin-left: 8px;
|
||||
}
|
||||
|
||||
#edit_user_profiles p {
|
||||
font-family: "Open Sans", sans-serif;
|
||||
}
|
||||
|
||||
#edit_user_profiles {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 30px;
|
||||
|
@ -4830,7 +4808,7 @@ input:checked + .p-slider:before {
|
|||
border: none;
|
||||
border-radius: 0 !important;
|
||||
border-bottom: 1px solid #343434;
|
||||
padding: 4px 0px 2px 35px;
|
||||
padding: 10px 0px 2px 35px;
|
||||
box-sizing: border-box;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left bottom 2px;
|
||||
|
@ -4839,7 +4817,7 @@ input:checked + .p-slider:before {
|
|||
}
|
||||
|
||||
.edit_user_info_right input:focus {
|
||||
font-weight: 600;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.edit_user_info_right #fullname {
|
||||
|
@ -4887,6 +4865,11 @@ input:checked + .p-slider:before {
|
|||
padding-left: 50px;
|
||||
}
|
||||
|
||||
.edit_user_timezone #zonepicker {
|
||||
width: 100%;
|
||||
height: 270px;
|
||||
}
|
||||
|
||||
.edit_user_comments #textarea_comments {
|
||||
background-color: #fbfbfb !important;
|
||||
padding-left: 10px;
|
||||
|
@ -4894,8 +4877,7 @@ input:checked + .p-slider:before {
|
|||
|
||||
.edit_user_labels {
|
||||
color: #343434 !important;
|
||||
font-weight: 600;
|
||||
font-size: 10.5pt !important;
|
||||
font-weight: bold;
|
||||
padding-right: 10px;
|
||||
margin: 0px 0px 5px 0px;
|
||||
}
|
||||
|
@ -4952,21 +4934,25 @@ input:checked + .p-slider:before {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out[multiple] option:checked {
|
||||
select#autorefresh_list_out[multiple] option:checked,
|
||||
select#autorefresh_list[multiple] option:checked {
|
||||
background: #82b92e linear-gradient(0deg, #82b92e 0%, #82b92e 100%);
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out option:checked {
|
||||
select#autorefresh_list_out option:checked,
|
||||
select#autorefresh_list option:checked {
|
||||
background-color: #82b92e;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out > option:hover {
|
||||
select#autorefresh_list_out > option:hover,
|
||||
select#autorefresh_list > option:hover {
|
||||
background-color: #cbcbcb;
|
||||
}
|
||||
|
||||
select#autorefresh_list_out:-internal-list-box {
|
||||
select#autorefresh_list_out:-internal-list-box,
|
||||
select#autorefresh_list:-internal-list-box {
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
@ -4998,7 +4984,6 @@ select#autorefresh_list_out:-internal-list-box {
|
|||
#user-notifications-wrapper {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
color: #4d4d4d;
|
||||
}
|
||||
|
||||
|
@ -5011,14 +4996,13 @@ select#autorefresh_list_out:-internal-list-box {
|
|||
display: table-row;
|
||||
}
|
||||
.table_th {
|
||||
font-weight: 600;
|
||||
font-weight: bold;
|
||||
}
|
||||
.table_th,
|
||||
.table_td {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
padding: 10px;
|
||||
font-size: 10pt;
|
||||
}
|
||||
/* Tables with 3 columns */
|
||||
.table_three_columns .table_th,
|
||||
|
|
|
@ -1057,6 +1057,9 @@ if ($searchPage) {
|
|||
if ($main_sec == false) {
|
||||
if ($sec == 'extensions') {
|
||||
$main_sec = get_parameter('extension_in_menu');
|
||||
if (empty($main_sec) === true) {
|
||||
$main_sec = $sec;
|
||||
}
|
||||
} else if ($sec == 'gextensions') {
|
||||
$main_sec = get_parameter('extension_in_menu');
|
||||
} else {
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.732';
|
||||
$build = '190311';
|
||||
$build = '190325';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -44,8 +44,9 @@ $new_empty_networkmap = get_parameter('new_empty_networkmap', false);
|
|||
if (enterprise_installed()) {
|
||||
if ($new_empty_networkmap) {
|
||||
if ($networkmaps_write || $networkmaps_manage) {
|
||||
include $config['homedir'].'/enterprise/godmode/agentes/pandora_networkmap_empty.editor.php';
|
||||
include 'pandora_networkmap_empty.editor.php';
|
||||
enterprise_include(
|
||||
'godmode/agentes/pandora_networkmap_empty.editor.php'
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -70,8 +71,8 @@ if (enterprise_installed()) {
|
|||
$name = (string) get_parameter('name', '');
|
||||
|
||||
// Default size values
|
||||
$width = 4000;
|
||||
$height = 4000;
|
||||
$width = $config['networkmap_max_width'];
|
||||
$height = $config['networkmap_max_width'];
|
||||
|
||||
$method = (string) get_parameter('method', 'fdp');
|
||||
|
||||
|
@ -232,8 +233,8 @@ if ($new_networkmap || $save_networkmap) {
|
|||
$name = (string) get_parameter('name', '');
|
||||
|
||||
// Default size values
|
||||
$width = 4000;
|
||||
$height = 4000;
|
||||
$width = $config['networkmap_max_width'];
|
||||
$height = $config['networkmap_max_width'];
|
||||
|
||||
$method = (string) get_parameter('method', 'fdp');
|
||||
|
||||
|
|
|
@ -80,6 +80,10 @@ if (is_ajax()) {
|
|||
if ($module_get_status) {
|
||||
$id = (int) get_parameter('id', 0);
|
||||
|
||||
if ($id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$return = [];
|
||||
$return['correct'] = true;
|
||||
$return['status'] = modules_get_agentmodule_status(
|
||||
|
|
|
@ -83,22 +83,42 @@ if (($date_from === '') && ($date_to === '')) {
|
|||
}
|
||||
}
|
||||
|
||||
$is_using_secondary_group = enterprise_hook('agents_is_using_secondary_groups');
|
||||
|
||||
// Group selection.
|
||||
if ($id_group > 0 && in_array($id_group, array_keys($groups))) {
|
||||
if ($propagate) {
|
||||
$childrens_str = implode(',', $childrens_ids);
|
||||
$sql_post .= " AND (id_grupo IN ($childrens_str) OR id_group IN ($childrens_str))";
|
||||
$sql_post .= " AND (id_grupo IN ($childrens_str)";
|
||||
|
||||
if ($is_using_secondary_group === 1)
|
||||
$sql_post .= " OR id_group IN ($childrens_str)";
|
||||
|
||||
$sql_post .= ")";
|
||||
} else {
|
||||
// If a group is selected and it's in the groups allowed.
|
||||
$sql_post .= " AND (id_grupo = $id_group OR id_group = $id_group)";
|
||||
$sql_post .= " AND (id_grupo = $id_group";
|
||||
|
||||
if ($is_using_secondary_group === 1)
|
||||
$sql_post .= " OR id_group = $id_group";
|
||||
|
||||
$sql_post .= ")";
|
||||
}
|
||||
} else {
|
||||
if (!users_is_admin() && !users_can_manage_group_all('ER')) {
|
||||
$sql_post .= sprintf(
|
||||
' AND (id_grupo IN (%s) OR id_group IN (%s)) ',
|
||||
implode(',', array_keys($groups)),
|
||||
implode(',', array_keys($groups))
|
||||
);
|
||||
if ($is_using_secondary_group === 1) {
|
||||
$sql_post .= sprintf(
|
||||
' AND (id_grupo IN (%s) OR id_group IN (%s)) ',
|
||||
implode(',', array_keys($groups)),
|
||||
implode(',', array_keys($groups))
|
||||
);
|
||||
}
|
||||
else {
|
||||
$sql_post .= sprintf(
|
||||
' AND (id_grupo IN (%s)) ',
|
||||
implode(',', array_keys($groups))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,33 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Events
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_events.php';
|
||||
// Event processing functions
|
||||
// Event processing functions.
|
||||
require_once $config['homedir'].'/include/functions_alerts.php';
|
||||
// Alerts processing functions
|
||||
// Alerts processing functions.
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
// Agents functions
|
||||
// Agents functions.
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
// Users functions
|
||||
// Users functions.
|
||||
require_once $config['homedir'].'/include/functions_graph.php';
|
||||
require_once $config['homedir'].'/include/functions_ui.php';
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'ER') && ! check_acl($config['id_user'], 0, 'EW') && ! check_acl($config['id_user'], 0, 'EM')) {
|
||||
if (! check_acl($config['id_user'], 0, 'ER')
|
||||
&& ! check_acl($config['id_user'], 0, 'EW')
|
||||
&& ! check_acl($config['id_user'], 0, 'EM')
|
||||
) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access event viewer'
|
||||
|
@ -36,13 +55,13 @@ if (! check_acl($config['id_user'], 0, 'ER') && ! check_acl($config['id_user'],
|
|||
return;
|
||||
}
|
||||
|
||||
// Set metaconsole mode
|
||||
// Set metaconsole mode.
|
||||
$meta = false;
|
||||
if (enterprise_installed() && defined('METACONSOLE')) {
|
||||
$meta = true;
|
||||
}
|
||||
|
||||
// Get the history mode
|
||||
// Get the history mode.
|
||||
$history = (bool) get_parameter('history', 0);
|
||||
|
||||
$readonly = false;
|
||||
|
@ -81,7 +100,7 @@ if (is_ajax()) {
|
|||
if ($event['event_type'] == 'system') {
|
||||
echo __('System');
|
||||
} else if ($event['id_agente'] > 0) {
|
||||
// Agent name
|
||||
// Agent name.
|
||||
echo agents_get_alias($event['id_agente']);
|
||||
} else {
|
||||
echo '';
|
||||
|
@ -104,7 +123,7 @@ if (is_ajax()) {
|
|||
$comment = (string) get_parameter('comment');
|
||||
$new_status = get_parameter('new_status');
|
||||
|
||||
// Set off the standby mode when close an event
|
||||
// Set off the standby mode when close an event.
|
||||
if ($new_status == 1) {
|
||||
$event = events_get_event($id);
|
||||
alerts_agent_module_standby($event['id_alert_am'], 0);
|
||||
|
@ -251,7 +270,14 @@ if (!$meta) {
|
|||
'ACL Violation',
|
||||
'Trying to access event viewer. View disabled due event replication.'
|
||||
);
|
||||
ui_print_info_message(['message' => __('Event viewer is disabled due event replication. For more information, please contact with the administrator'), 'no_close' => true]);
|
||||
ui_print_info_message(
|
||||
[
|
||||
'message' => __(
|
||||
'Event viewer is disabled due event replication. For more information, please contact with the administrator'
|
||||
),
|
||||
'no_close' => true,
|
||||
]
|
||||
);
|
||||
return;
|
||||
} else {
|
||||
$readonly = true;
|
||||
|
@ -270,16 +296,20 @@ $id_group = (int) get_parameter('id_group', 0);
|
|||
// $recursion = (bool)get_parameter('recursion', false); //Flag show in child groups
|
||||
// **********************************************************************
|
||||
$recursion = (bool) get_parameter('recursion', true);
|
||||
// Flag show in child groups
|
||||
// Flag show in child groups.
|
||||
$event_type = get_parameter('event_type', '');
|
||||
// 0 all
|
||||
// 0 all.
|
||||
$severity = (int) get_parameter('severity', -1);
|
||||
// -1 all
|
||||
// -1 all.
|
||||
$status = (int) get_parameter('status', 3);
|
||||
// -1 all, 0 only new, 1 only validated, 2 only in process, 3 only not validated,
|
||||
// -1 all, 0 only new, 1 only validated,
|
||||
// 2 only in process, 3 only not validated.
|
||||
$id_agent = (int) get_parameter('id_agent', 0);
|
||||
$pagination = (int) get_parameter('pagination', $config['block_size']);
|
||||
$event_view_hr = (int) get_parameter('event_view_hr', $history ? 0 : $config['event_view_hr']);
|
||||
$event_view_hr = (int) get_parameter(
|
||||
'event_view_hr',
|
||||
($history) ? 0 : $config['event_view_hr']
|
||||
);
|
||||
$id_user_ack = get_parameter('id_user_ack', 0);
|
||||
$group_rep = (int) get_parameter('group_rep', 1);
|
||||
$delete = (bool) get_parameter('delete');
|
||||
|
@ -313,9 +343,17 @@ if ($id_agent != 0) {
|
|||
}
|
||||
|
||||
$text_module = (string) get_parameter('module_search', '');
|
||||
$id_agent_module = get_parameter('module_search_hidden', get_parameter('id_agent_module', 0));
|
||||
$id_agent_module = get_parameter(
|
||||
'module_search_hidden',
|
||||
get_parameter('id_agent_module', 0)
|
||||
);
|
||||
if ($id_agent_module != 0) {
|
||||
$text_module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_agent_module);
|
||||
$text_module = db_get_value(
|
||||
'nombre',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$id_agent_module
|
||||
);
|
||||
if ($text_module == false) {
|
||||
$text_module = '';
|
||||
}
|
||||
|
@ -362,42 +400,42 @@ $url = 'index.php?sec=eventos&sec2=operation/events/events&'.$params;
|
|||
|
||||
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
if ($config['pure'] == 0 || $meta) {
|
||||
$pss = get_user_info($config['id_user']);
|
||||
$hashup = md5($config['id_user'].$pss['password']);
|
||||
|
||||
// Fullscreen
|
||||
// Fullscreen.
|
||||
$fullscreen['active'] = false;
|
||||
$fullscreen['text'] = '<a href="'.$url.'&pure=1">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen')]).'</a>';
|
||||
|
||||
// Event list
|
||||
// Event list.
|
||||
$list['active'] = false;
|
||||
$list['text'] = '<a href="index.php?sec=eventos&sec2=operation/events/events&pure='.$config['pure'].'">'.html_print_image('images/events_list.png', true, ['title' => __('Event list')]).'</a>';
|
||||
|
||||
// History event list
|
||||
// History event list.
|
||||
$history_list['active'] = false;
|
||||
$history_list['text'] = '<a href="index.php?sec=eventos&sec2=operation/events/events&pure='.$config['pure'].'&section=history&history=1">'.html_print_image('images/books.png', true, ['title' => __('History event list')]).'</a>';
|
||||
|
||||
// RSS
|
||||
// RSS.
|
||||
$rss['active'] = false;
|
||||
$rss['text'] = '<a href="operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&'.$params.'">'.html_print_image('images/rss.png', true, ['title' => __('RSS Events')]).'</a>';
|
||||
|
||||
// Marquee
|
||||
// Marquee.
|
||||
$marquee['active'] = false;
|
||||
$marquee['text'] = '<a href="operation/events/events_marquee.php">'.html_print_image('images/heart.png', true, ['title' => __('Marquee display')]).'</a>';
|
||||
|
||||
// CSV
|
||||
// CSV.
|
||||
$csv['active'] = false;
|
||||
$csv['text'] = '<a href="operation/events/export_csv.php?'.$params.'">'.html_print_image('images/csv_mc.png', true, ['title' => __('Export to CSV file')]).'</a>';
|
||||
|
||||
// Sound events
|
||||
// Sound events.
|
||||
$sound_event['active'] = false;
|
||||
$sound_event['text'] = '<a href="javascript: openSoundEventWindow();">'.html_print_image('images/sound.png', true, ['title' => __('Sound events')]).'</a>';
|
||||
|
||||
// If the user has administrator permission display manage tab
|
||||
// If the user has administrator permission display manage tab.
|
||||
if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) {
|
||||
// Manage events
|
||||
// Manage events.
|
||||
$manage_events['active'] = false;
|
||||
$manage_events['text'] = '<a href="index.php?sec=eventos&sec2=godmode/events/events&section=filter&pure='.$config['pure'].'">'.html_print_image('images/setup.png', true, ['title' => __('Manage events')]).'</a>';
|
||||
|
||||
|
@ -425,7 +463,7 @@ if ($config['pure'] == 0 || $meta) {
|
|||
];
|
||||
}
|
||||
|
||||
// If the history event is not ebabled, dont show the history tab
|
||||
// If the history event is not ebabled, dont show the history tab.
|
||||
if (!isset($config['metaconsole_events_history']) || $config['metaconsole_events_history'] != 1) {
|
||||
unset($onheader['history']);
|
||||
}
|
||||
|
@ -447,16 +485,6 @@ if ($config['pure'] == 0 || $meta) {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Hello there! :)
|
||||
|
||||
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
|
||||
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
|
||||
|
||||
*/
|
||||
|
||||
if (! defined('METACONSOLE')) {
|
||||
unset($onheader['history']);
|
||||
ui_print_page_header(
|
||||
|
@ -482,37 +510,55 @@ if ($config['pure'] == 0 || $meta) {
|
|||
<script type="text/javascript">
|
||||
function openSoundEventWindow() {
|
||||
url = "<?php echo ui_get_full_url('operation/events/sound_events.php'); ?>";
|
||||
window.open(url, '<?php __('Sound Alerts'); ?>','width=600, height=450, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no');
|
||||
window.open(
|
||||
url,
|
||||
'<?php __('Sound Alerts'); ?>',
|
||||
'width=600, height=450, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no'
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
// Fullscreen
|
||||
// Floating menu - Start
|
||||
// Fullscreen.
|
||||
// Floating menu - Start.
|
||||
echo '<div id="vc-controls" style="z-index: 999">';
|
||||
|
||||
echo '<div id="menu_tab">';
|
||||
echo '<ul class="mn">';
|
||||
|
||||
// Quit fullscreen
|
||||
// Quit fullscreen.
|
||||
echo '<li class="nomn">';
|
||||
echo '<a target="_top" href="'.$url.'&pure=0">';
|
||||
echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
|
||||
echo html_print_image(
|
||||
'images/normal_screen.png',
|
||||
true,
|
||||
['title' => __('Back to normal mode')]
|
||||
);
|
||||
echo '</a>';
|
||||
echo '</li>';
|
||||
|
||||
// Countdown
|
||||
// Countdown.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="vc-refr">';
|
||||
echo '<div class="vc-countdown"></div>';
|
||||
echo '<div id="vc-refr-form">';
|
||||
echo __('Refresh').':';
|
||||
echo html_print_select(get_refresh_time_array(), 'refresh', $refr, '', '', 0, true, false, false);
|
||||
echo html_print_select(
|
||||
get_refresh_time_array(),
|
||||
'refresh',
|
||||
$refr,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</li>';
|
||||
|
||||
// Console name
|
||||
// Console name.
|
||||
echo '<li class="nomn">';
|
||||
echo '<div class="vc-title">'.__('Event viewer').'</div>';
|
||||
echo '</li>';
|
||||
|
@ -521,11 +567,11 @@ if ($config['pure'] == 0 || $meta) {
|
|||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
// Floating menu - End
|
||||
// Floating menu - End.
|
||||
ui_require_jquery_file('countdown');
|
||||
}
|
||||
|
||||
// Error div for ajax messages
|
||||
// Error div for ajax messages.
|
||||
echo "<div id='show_message_error'>";
|
||||
echo '</div>';
|
||||
|
||||
|
@ -535,7 +581,7 @@ if (($section == 'validate') && ($ids[0] == -1)) {
|
|||
ui_print_error_message(__('No events selected'));
|
||||
}
|
||||
|
||||
// Process validation (pass array or single value)
|
||||
// Process validation (pass array or single value).
|
||||
if ($validate) {
|
||||
$ids = get_parameter('eventid', -1);
|
||||
$comment = get_parameter('comment', '');
|
||||
|
@ -543,7 +589,7 @@ if ($validate) {
|
|||
$ids = explode(',', $ids);
|
||||
$standby_alert = (bool) get_parameter('standby-alert');
|
||||
|
||||
// Avoid to re-set inprocess events
|
||||
// Avoid to re-set inprocess events.
|
||||
if ($new_status == 2) {
|
||||
foreach ($ids as $key => $id) {
|
||||
$event = events_get_event($id);
|
||||
|
@ -572,11 +618,11 @@ if ($validate) {
|
|||
}
|
||||
}
|
||||
|
||||
// Process deletion (pass array or single value)
|
||||
// Process deletion (pass array or single value).
|
||||
if ($delete) {
|
||||
$ids = (array) get_parameter('validate_ids', -1);
|
||||
|
||||
// Discard deleting in progress events
|
||||
// Discard deleting in progress events.
|
||||
$in_process_status = db_get_all_rows_sql(
|
||||
'
|
||||
SELECT id_evento
|
||||
|
@ -629,7 +675,6 @@ $(document).ready( function() {
|
|||
var refr = <?php echo (int) $refr; ?>;
|
||||
var pure = <?php echo (int) $config['pure']; ?>;
|
||||
var href = "<?php echo ui_get_url_refresh($ignored_params); ?>";
|
||||
// alert($(location).attr('href'));
|
||||
if (pure) {
|
||||
var startCountDown = function (duration, cb) {
|
||||
$('div.vc-countdown').countdown('destroy');
|
||||
|
@ -663,9 +708,10 @@ $(document).ready( function() {
|
|||
});
|
||||
}
|
||||
else {
|
||||
|
||||
$('#refresh').change(function () {
|
||||
$('#hidden-vc_refr').val($('#refresh option:selected').val());
|
||||
$('#hidden-vc_refr').val(
|
||||
$('#refresh option:selected').val()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -930,7 +976,7 @@ $(document).ready( function() {
|
|||
{"page" : "operation/events/events",
|
||||
"delete_event" : 1,
|
||||
"id" : id,
|
||||
"similars" : <?php echo $group_rep ? 1 : 0; ?>,
|
||||
"similars" : <?php echo ($group_rep) ? 1 : 0; ?>,
|
||||
"meta" : meta,
|
||||
"history" : history_var
|
||||
},
|
||||
|
|
|
@ -1,28 +1,44 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Events
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions.php';
|
||||
require_once $config['homedir'].'/include/functions_events.php';
|
||||
// Event processing functions
|
||||
// Event processing functions.
|
||||
require_once $config['homedir'].'/include/functions_alerts.php';
|
||||
// Alerts processing functions
|
||||
// Alerts processing functions.
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
// Agents funtions
|
||||
// Agents funtions.
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
// Users functions
|
||||
// Users functions.
|
||||
require_once $config['homedir'].'/include/functions_groups.php';
|
||||
require_once $config['homedir'].'/include/functions_graph.php';
|
||||
require_once $config['homedir'].'/include/functions_tags.php';
|
||||
|
@ -47,7 +63,12 @@ if (!$event_a && !$event_w && !$event_m) {
|
|||
return;
|
||||
}
|
||||
|
||||
$is_filter = db_get_value('id_filter', 'tusuario', 'id_user', $config['id_user']);
|
||||
$is_filter = db_get_value(
|
||||
'id_filter',
|
||||
'tusuario',
|
||||
'id_user',
|
||||
$config['id_user']
|
||||
);
|
||||
|
||||
$jump = ' ';
|
||||
|
||||
|
@ -57,7 +78,7 @@ if (is_ajax()) {
|
|||
$update_event_filter = get_parameter('update_event_filter', 0);
|
||||
$get_event_filters = get_parameter('get_event_filters', 0);
|
||||
|
||||
// Get db values of a single filter
|
||||
// Get db values of a single filter.
|
||||
if ($get_filter_values) {
|
||||
$id_filter = get_parameter('id');
|
||||
|
||||
|
@ -65,13 +86,17 @@ if (is_ajax()) {
|
|||
|
||||
$event_filter['search'] = io_safe_output($event_filter['search']);
|
||||
$event_filter['id_name'] = io_safe_output($event_filter['id_name']);
|
||||
$event_filter['tag_with'] = base64_encode(io_safe_output($event_filter['tag_with']));
|
||||
$event_filter['tag_without'] = base64_encode(io_safe_output($event_filter['tag_without']));
|
||||
$event_filter['tag_with'] = base64_encode(
|
||||
io_safe_output($event_filter['tag_with'])
|
||||
);
|
||||
$event_filter['tag_without'] = base64_encode(
|
||||
io_safe_output($event_filter['tag_without'])
|
||||
);
|
||||
|
||||
echo io_json_mb_encode($event_filter);
|
||||
}
|
||||
|
||||
// Saves an event filter
|
||||
// Saves an event filter.
|
||||
if ($save_event_filter) {
|
||||
$values = [];
|
||||
$values['id_name'] = get_parameter('id_name');
|
||||
|
@ -88,7 +113,10 @@ if (is_ajax()) {
|
|||
$values['id_user_ack'] = get_parameter('id_user_ack');
|
||||
$values['group_rep'] = get_parameter('group_rep');
|
||||
$values['tag_with'] = get_parameter('tag_with', io_json_mb_encode([]));
|
||||
$values['tag_without'] = get_parameter('tag_without', io_json_mb_encode([]));
|
||||
$values['tag_without'] = get_parameter(
|
||||
'tag_without',
|
||||
io_json_mb_encode([])
|
||||
);
|
||||
$values['filter_only_alert'] = get_parameter('filter_only_alert');
|
||||
$values['id_group_filter'] = get_parameter('id_group_filter');
|
||||
$values['date_from'] = get_parameter('date_from');
|
||||
|
@ -132,7 +160,10 @@ if (is_ajax()) {
|
|||
$values['id_user_ack'] = get_parameter('id_user_ack');
|
||||
$values['group_rep'] = get_parameter('group_rep');
|
||||
$values['tag_with'] = get_parameter('tag_with', io_json_mb_encode([]));
|
||||
$values['tag_without'] = get_parameter('tag_without', io_json_mb_encode([]));
|
||||
$values['tag_without'] = get_parameter(
|
||||
'tag_without',
|
||||
io_json_mb_encode([])
|
||||
);
|
||||
$values['filter_only_alert'] = get_parameter('filter_only_alert');
|
||||
$values['id_group_filter'] = get_parameter('id_group_filter');
|
||||
$values['date_from'] = get_parameter('date_from');
|
||||
|
@ -171,9 +202,7 @@ if (is_ajax()) {
|
|||
return;
|
||||
}
|
||||
|
||||
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
||||
// Get the tags where the user have permissions in Events reading tasks
|
||||
// Get the tags where the user have permissions in Events reading tasks.
|
||||
$tags = tags_get_user_tags($config['id_user'], $access);
|
||||
|
||||
|
||||
|
@ -183,18 +212,27 @@ if ($id_agent == 0 && !empty($text_agent)) {
|
|||
|
||||
$id_name = get_parameter('id_name', '');
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------------- */
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------ DEFAULT USER FILTER -----------------------------
|
||||
$user = $config['id_user'];
|
||||
$user_filter = db_get_value_filter('default_event_filter', 'tusuario', ['id_user' => $user]);
|
||||
$update_from_filter_table = (bool) get_parameter('update_from_filter_table', false);
|
||||
$user_filter = db_get_value_filter(
|
||||
'default_event_filter',
|
||||
'tusuario',
|
||||
['id_user' => $user]
|
||||
);
|
||||
$update_from_filter_table = (bool) get_parameter(
|
||||
'update_from_filter_table',
|
||||
false
|
||||
);
|
||||
|
||||
if ($user_filter != 0 && empty($id_name) && !$update_from_filter_table) {
|
||||
$user_default_filter = db_get_all_rows_filter('tevent_filter', ['id_filter' => $user_filter]);
|
||||
$user_default_filter = db_get_all_rows_filter(
|
||||
'tevent_filter',
|
||||
['id_filter' => $user_filter]
|
||||
);
|
||||
$user_default_filter = $user_default_filter[0];
|
||||
|
||||
// FORM
|
||||
// FORM.
|
||||
$id_name = $user_default_filter['id_name'];
|
||||
$id_group = $user_default_filter['id_group'];
|
||||
if ($user_default_filter['event_type'] != '') {
|
||||
|
@ -242,22 +280,24 @@ if ($user_filter != 0 && empty($id_name) && !$update_from_filter_table) {
|
|||
$date_to = $user_default_filter['date_to'];
|
||||
}
|
||||
|
||||
if (io_safe_output($user_default_filter['tag_with']) != '[]' && io_safe_output($user_default_filter['tag_with']) != '["0"]') {
|
||||
if (io_safe_output($user_default_filter['tag_with']) != '[]'
|
||||
&& io_safe_output($user_default_filter['tag_with']) != '["0"]'
|
||||
) {
|
||||
$tag_with = $user_default_filter['tag_with'];
|
||||
$tag_with_clean = io_safe_output($tag_with);
|
||||
$tag_with = json_decode($tag_with_clean, true);
|
||||
}
|
||||
|
||||
if (io_safe_output($user_default_filter['tag_without']) != '[]' && io_safe_output($user_default_filter['tag_without']) != '["0"]') {
|
||||
if (io_safe_output($user_default_filter['tag_without']) != '[]'
|
||||
&& io_safe_output($user_default_filter['tag_without']) != '["0"]'
|
||||
) {
|
||||
$tag_without = $user_default_filter['tag_without'];
|
||||
$tag_without_clear = io_safe_output($tag_without);
|
||||
$tag_without = json_decode($tag_without_clear, true);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
//
|
||||
// Build the condition of the events query
|
||||
// Build the condition of the events query.
|
||||
$sql_post = '';
|
||||
|
||||
$id_user = $config['id_user'];
|
||||
|
@ -265,10 +305,10 @@ $id_user = $config['id_user'];
|
|||
$filter_resume = [];
|
||||
|
||||
require 'events.build_query.php';
|
||||
// Now $sql_post have all the where condition
|
||||
//
|
||||
// Now $sql_post have all the where condition.
|
||||
// Trick to catch if any filter button has been pushed (don't collapse filter)
|
||||
// or the filter was open before click or autorefresh is in use (collapse filter)
|
||||
// or the filter was open before click
|
||||
// or autorefresh is in use (collapse filter).
|
||||
$update_pressed = get_parameter_post('update', '');
|
||||
$update_pressed = (int) !empty($update_pressed);
|
||||
|
||||
|
@ -279,9 +319,15 @@ if ($update_pressed || $open_filter) {
|
|||
unset($table);
|
||||
|
||||
$filters = events_get_event_filter_select();
|
||||
$user_groups_array = users_get_groups_for_select($config['id_user'], $access, true, true, false);
|
||||
$user_groups_array = users_get_groups_for_select(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
true,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
// Some translated words to be used from javascript
|
||||
// Some translated words to be used from javascript.
|
||||
html_print_div(
|
||||
[
|
||||
'hidden' => true,
|
||||
|
@ -289,6 +335,7 @@ html_print_div(
|
|||
'content' => __('No filter loaded'),
|
||||
]
|
||||
);
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'hidden' => true,
|
||||
|
@ -296,6 +343,7 @@ html_print_div(
|
|||
'content' => __('Filter loaded'),
|
||||
]
|
||||
);
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'hidden' => true,
|
||||
|
@ -303,6 +351,7 @@ html_print_div(
|
|||
'content' => __('Save filter'),
|
||||
]
|
||||
);
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'hidden' => true,
|
||||
|
@ -311,8 +360,10 @@ html_print_div(
|
|||
]
|
||||
);
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) {
|
||||
// Save filter div for dialog
|
||||
if (check_acl($config['id_user'], 0, 'EW')
|
||||
|| check_acl($config['id_user'], 0, 'EM')
|
||||
) {
|
||||
// Save filter div for dialog.
|
||||
echo '<div id="save_filter_layer" style="display: none">';
|
||||
$table = new StdClass;
|
||||
$table->id = 'save_filter_form';
|
||||
|
@ -333,8 +384,22 @@ if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, '
|
|||
|
||||
$data = [];
|
||||
$table->rowid[0] = 'update_save_selector';
|
||||
$data[0] = html_print_radio_button('filter_mode', 'new', '', true, true).__('New filter').'';
|
||||
$data[1] = html_print_radio_button('filter_mode', 'update', '', false, true).__('Update filter').'';
|
||||
$data[0] = html_print_radio_button(
|
||||
'filter_mode',
|
||||
'new',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
).__('New filter').'';
|
||||
|
||||
$data[1] = html_print_radio_button(
|
||||
'filter_mode',
|
||||
'update',
|
||||
'',
|
||||
false,
|
||||
true
|
||||
).__('Update filter').'';
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
@ -373,11 +438,25 @@ if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, '
|
|||
$data = [];
|
||||
$table->rowid[3] = 'update_filter_row1';
|
||||
$data[0] = __('Overwrite filter').$jump;
|
||||
// Fix : Only admin user can see filters of group ALL for update
|
||||
// Fix : Only admin user can see filters of group ALL for update.
|
||||
$_filters_update = events_get_event_filter_select(false);
|
||||
|
||||
$data[0] .= html_print_select($_filters_update, 'overwrite_filter', '', '', '', 0, true);
|
||||
$data[1] = html_print_submit_button(__('Update filter'), 'update_filter', false, 'class="sub upd"', true);
|
||||
$data[0] .= html_print_select(
|
||||
$_filters_update,
|
||||
'overwrite_filter',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Update filter'),
|
||||
'update_filter',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
@ -385,12 +464,18 @@ if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, '
|
|||
html_print_table($table);
|
||||
unset($table);
|
||||
echo '<div>';
|
||||
echo html_print_submit_button(__('Save filter'), 'save_filter', false, 'class="sub upd" style="float:right;"', true);
|
||||
echo html_print_submit_button(
|
||||
__('Save filter'),
|
||||
'save_filter',
|
||||
false,
|
||||
'class="sub upd" style="float:right;"',
|
||||
true
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
// Load filter div for dialog
|
||||
// Load filter div for dialog.
|
||||
echo '<div id="load_filter_layer" style="display: none">';
|
||||
$table = new StdClass;
|
||||
$table->id = 'load_filter_form';
|
||||
|
@ -412,8 +497,22 @@ if (!is_metaconsole()) {
|
|||
$data = [];
|
||||
$table->rowid[3] = 'update_filter_row1';
|
||||
$data[0] = __('Load filter').$jump;
|
||||
$data[0] .= html_print_select($filters, 'filter_id', '', '', __('None'), 0, true);
|
||||
$data[1] = html_print_submit_button(__('Load filter'), 'load_filter', false, 'class="sub upd"', true);
|
||||
$data[0] .= html_print_select(
|
||||
$filters,
|
||||
'filter_id',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true
|
||||
);
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Load filter'),
|
||||
'load_filter',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
true
|
||||
);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
@ -421,19 +520,23 @@ html_print_table($table);
|
|||
unset($table);
|
||||
echo '</div>';
|
||||
|
||||
// TAGS
|
||||
// TAGS.
|
||||
$tags_select_with = [];
|
||||
$tags_select_without = [];
|
||||
$tag_with_temp = [];
|
||||
$tag_without_temp = [];
|
||||
foreach ($tags as $id_tag => $tag) {
|
||||
if ((array_search($id_tag, $tag_with) === false) || (array_search($id_tag, $tag_with) === null)) {
|
||||
if ((array_search($id_tag, $tag_with) === false)
|
||||
|| (array_search($id_tag, $tag_with) === null)
|
||||
) {
|
||||
$tags_select_with[$id_tag] = ui_print_truncate_text($tag, 50, true);
|
||||
} else {
|
||||
$tag_with_temp[$id_tag] = ui_print_truncate_text($tag, 50, true);
|
||||
}
|
||||
|
||||
if ((array_search($id_tag, $tag_without) === false) || (array_search($id_tag, $tag_without) === null)) {
|
||||
if ((array_search($id_tag, $tag_without) === false)
|
||||
|| (array_search($id_tag, $tag_without) === null)
|
||||
) {
|
||||
$tags_select_without[$id_tag] = ui_print_truncate_text($tag, 50, true);
|
||||
} else {
|
||||
$tag_without_temp[$id_tag] = ui_print_truncate_text($tag, 50, true);
|
||||
|
@ -476,9 +579,31 @@ $data[0] = html_print_select(
|
|||
'width: 200px;'
|
||||
);
|
||||
|
||||
$data[1] = html_print_image('images/darrowright.png', true, ['id' => 'button-add_with', 'style' => 'cursor: pointer;', 'title' => __('Add')]);
|
||||
$data[1] .= html_print_input_hidden('tag_with', $tag_with_base64, true);
|
||||
$data[1] .= '<br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'button-remove_with', 'style' => 'cursor: pointer;', 'title' => __('Remove')]);
|
||||
$data[1] = html_print_image(
|
||||
'images/darrowright.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'button-add_with',
|
||||
'style' => 'cursor: pointer;',
|
||||
'title' => __('Add'),
|
||||
]
|
||||
);
|
||||
|
||||
$data[1] .= html_print_input_hidden(
|
||||
'tag_with',
|
||||
$tag_with_base64,
|
||||
true
|
||||
);
|
||||
|
||||
$data[1] .= '<br><br>'.html_print_image(
|
||||
'images/darrowleft.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'button-remove_with',
|
||||
'style' => 'cursor: pointer;',
|
||||
'title' => __('Remove'),
|
||||
]
|
||||
);
|
||||
|
||||
$data[2] = html_print_select(
|
||||
$tag_with_temp,
|
||||
|
@ -528,9 +653,29 @@ $data[0] = html_print_select(
|
|||
false,
|
||||
'width: 200px;'
|
||||
);
|
||||
$data[1] = html_print_image('images/darrowright.png', true, ['id' => 'button-add_without', 'style' => 'cursor: pointer;', 'title' => __('Add')]);
|
||||
$data[1] .= html_print_input_hidden('tag_without', $tag_without_base64, true);
|
||||
$data[1] .= '<br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'button-remove_without', 'style' => 'cursor: pointer;', 'title' => __('Remove')]);
|
||||
$data[1] = html_print_image(
|
||||
'images/darrowright.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'button-add_without',
|
||||
'style' => 'cursor: pointer;',
|
||||
'title' => __('Add'),
|
||||
]
|
||||
);
|
||||
$data[1] .= html_print_input_hidden(
|
||||
'tag_without',
|
||||
$tag_without_base64,
|
||||
true
|
||||
);
|
||||
$data[1] .= '<br><br>'.html_print_image(
|
||||
'images/darrowleft.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'button-remove_without',
|
||||
'style' => 'cursor: pointer;',
|
||||
'title' => __('Remove'),
|
||||
]
|
||||
);
|
||||
$data[2] = html_print_select(
|
||||
$tag_without_temp,
|
||||
'tag_without_temp',
|
||||
|
@ -549,24 +694,32 @@ $tabletags_without->data[] = $data;
|
|||
$tabletags_without->rowclass[] = '';
|
||||
|
||||
|
||||
// END OF TAGS
|
||||
// EVENTS FILTER
|
||||
// Table for filter controls
|
||||
// END OF TAGS.
|
||||
// EVENTS FILTER.
|
||||
// Table for filter controls.
|
||||
if (is_metaconsole()) {
|
||||
$events_filter = '<form id="form_filter" class="filters_form" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='.(int) get_parameter('refr', 0).'&pure='.$config['pure'].'&section='.$section.'&history='.(int) $history.'">';
|
||||
$events_filter = '<form id="form_filter" class="filters_form" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refresh='.(int) get_parameter('refresh', 0).'&pure='.$config['pure'].'&section='.$section.'&history='.(int) $history.'">';
|
||||
} else {
|
||||
$events_filter = '<form id="form_filter" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refr='.(int) get_parameter('refr', 0).'&pure='.$config['pure'].'&section='.$section.'&history='.(int) $history.'">';
|
||||
$events_filter = '<form id="form_filter" method="post" action="index.php?sec=eventos&sec2=operation/events/events&refresh='.(int) get_parameter('refresh', 0).'&pure='.$config['pure'].'&section='.$section.'&history='.(int) $history.'">';
|
||||
}
|
||||
|
||||
// Hidden field with the loaded filter name
|
||||
// Hidden field with the loaded filter name.
|
||||
$events_filter .= html_print_input_hidden('id_name', $id_name, true);
|
||||
|
||||
// Hidden open filter flag
|
||||
// If autoupdate is in use collapse filter
|
||||
// If autoupdate is in use collapse filter.
|
||||
if ($open_filter) {
|
||||
$events_filter .= html_print_input_hidden('open_filter', 'true', true);
|
||||
$events_filter .= html_print_input_hidden(
|
||||
'open_filter',
|
||||
'true',
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$events_filter .= html_print_input_hidden('open_filter', 'false', true);
|
||||
$events_filter .= html_print_input_hidden(
|
||||
'open_filter',
|
||||
'false',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -606,11 +759,11 @@ $table_advanced->rowclass[] = '';
|
|||
$data = [];
|
||||
$data[0] = __('User ack.').$jump;
|
||||
|
||||
if ($strict_user) {
|
||||
$user_users = [$config['id_user'] => $config['id_user']];
|
||||
} else {
|
||||
$user_users = users_get_user_users($config['id_user'], $access, users_can_manage_group_all());
|
||||
}
|
||||
$user_users = users_get_user_users(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
users_can_manage_group_all()
|
||||
);
|
||||
|
||||
$data[0] .= html_print_select(
|
||||
$user_users,
|
||||
|
@ -621,6 +774,7 @@ $data[0] .= html_print_select(
|
|||
0,
|
||||
true
|
||||
);
|
||||
|
||||
if (!$meta) {
|
||||
$data[1] = __('Module search').$jump;
|
||||
$data[1] .= html_print_autocomplete_modules(
|
||||
|
@ -635,27 +789,15 @@ if (!$meta) {
|
|||
);
|
||||
} else {
|
||||
$data[1] = __('Server').$jump;
|
||||
if ($strict_user) {
|
||||
$data[1] .= html_print_select(
|
||||
'',
|
||||
'server_id',
|
||||
$server_id,
|
||||
'script',
|
||||
__('All'),
|
||||
'0',
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$data[1] .= html_print_select_from_sql(
|
||||
'SELECT id, server_name FROM tmetaconsole_setup',
|
||||
'server_id',
|
||||
$server_id,
|
||||
'script',
|
||||
__('All'),
|
||||
'0',
|
||||
true
|
||||
);
|
||||
}
|
||||
$data[1] .= html_print_select_from_sql(
|
||||
'SELECT id, server_name FROM tmetaconsole_setup',
|
||||
'server_id',
|
||||
$server_id,
|
||||
'script',
|
||||
__('All'),
|
||||
'0',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table_advanced->data[] = $data;
|
||||
|
@ -668,14 +810,30 @@ $alert_events_titles = [
|
|||
'0' => __('Filter alert events'),
|
||||
'1' => __('Only alert events'),
|
||||
];
|
||||
$data[0] .= html_print_select($alert_events_titles, 'filter_only_alert', $filter_only_alert, '', '', '', true);
|
||||
$data[0] .= html_print_select(
|
||||
$alert_events_titles,
|
||||
'filter_only_alert',
|
||||
$filter_only_alert,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$data[1] = __('Block size for pagination').$jump;
|
||||
$lpagination[25] = 25;
|
||||
$lpagination[50] = 50;
|
||||
$lpagination[100] = 100;
|
||||
$lpagination[200] = 200;
|
||||
$lpagination[500] = 500;
|
||||
$data[1] .= html_print_select($lpagination, 'pagination', $pagination, '', __('Default'), $config['block_size'], true);
|
||||
$data[1] .= html_print_select(
|
||||
$lpagination,
|
||||
'pagination',
|
||||
$pagination,
|
||||
'',
|
||||
__('Default'),
|
||||
$config['block_size'],
|
||||
true
|
||||
);
|
||||
$table_advanced->data[] = $data;
|
||||
$table_advanced->rowclass[] = '';
|
||||
|
||||
|
@ -701,11 +859,11 @@ $table_advanced->rowclass[] = '';
|
|||
|
||||
$data = [];
|
||||
if (defined('METACONSOLE')) {
|
||||
$data[0] = '<fieldset class="" style="padding:0px; width: 510px;">'.'<legend style="padding:0px;">'.__('Events with following tags').'</legend>'.html_print_table($tabletags_with, true).'</fieldset>';
|
||||
$data2[1] = '<fieldset class="" style="padding:0px; width: 310px;">'.'<legend style="padding:0px;">'.__('Events without following tags').'</legend>'.html_print_table($tabletags_without, true).'</fieldset>';
|
||||
$data[0] = '<fieldset class="" style="padding:0px; width: 510px;"><legend style="padding:0px;">'.__('Events with following tags').'</legend>'.html_print_table($tabletags_with, true).'</fieldset>';
|
||||
$data2[1] = '<fieldset class="" style="padding:0px; width: 310px;"><legend style="padding:0px;">'.__('Events without following tags').'</legend>'.html_print_table($tabletags_without, true).'</fieldset>';
|
||||
} else {
|
||||
$data[0] = '<fieldset class="databox" style="padding:0px; width: 30%; ">'.'<legend>'.__('Events with following tags').'</legend>'.html_print_table($tabletags_with, true).'</fieldset>';
|
||||
$data[1] = '<fieldset class="databox" style="padding:0px; width: 30%;">'.'<legend>'.__('Events without following tags').'</legend>'.html_print_table($tabletags_without, true).'</fieldset>';
|
||||
$data[0] = '<fieldset class="databox" style="padding:0px; width: 30%; "><legend>'.__('Events with following tags').'</legend>'.html_print_table($tabletags_with, true).'</fieldset>';
|
||||
$data[1] = '<fieldset class="databox" style="padding:0px; width: 30%;"><legend>'.__('Events without following tags').'</legend>'.html_print_table($tabletags_without, true).'</fieldset>';
|
||||
}
|
||||
|
||||
$table_advanced->data[] = $data;
|
||||
|
@ -714,7 +872,7 @@ if (defined('METACONSOLE')) {
|
|||
}
|
||||
|
||||
$table_advanced->rowclass[] = '';
|
||||
// - END ADVANCE FILTER -------------------------------------------------
|
||||
// END ADVANCE FILTER -------------------------------------------------.
|
||||
$table = new stdClass();
|
||||
$table->id = 'events_filter_form';
|
||||
$table->width = '100%';
|
||||
|
@ -748,13 +906,33 @@ $data[0] .= html_print_select(
|
|||
// **********************************************************************
|
||||
$data[1] = __('Event type').$jump;
|
||||
$types = get_event_types();
|
||||
// Expand standard array to add not_normal (not exist in the array, used only for searches)
|
||||
|
||||
// Expand standard array to add not_normal
|
||||
// (not exist in the array, used only for searches).
|
||||
$types['not_normal'] = __('Not normal');
|
||||
$data[1] .= html_print_select($types, 'event_type', $event_type, '', __('All'), '', true);
|
||||
$data[1] .= html_print_select(
|
||||
$types,
|
||||
'event_type',
|
||||
$event_type,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$data[2] = __('Severity').$jump;
|
||||
$severities = get_priorities();
|
||||
$data[2] .= html_print_select($severities, 'severity', $severity, '', __('All'), '-1', true, false, false);
|
||||
$data[2] .= html_print_select(
|
||||
$severities,
|
||||
'severity',
|
||||
$severity,
|
||||
'',
|
||||
__('All'),
|
||||
'-1',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
@ -763,12 +941,27 @@ $data[0] = __('Event status').$jump;
|
|||
$fields = events_get_all_status();
|
||||
$data[0] .= html_print_select($fields, 'status', $status, '', '', '', true);
|
||||
$data[1] = __('Max. hours old').$jump;
|
||||
$data[1] .= html_print_input_text('event_view_hr', $event_view_hr, '', 5, 255, true);
|
||||
$data[1] .= html_print_input_text(
|
||||
'event_view_hr',
|
||||
$event_view_hr,
|
||||
'',
|
||||
5,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$data[2] = __('Repeated').$jump;
|
||||
$repeated_sel[0] = __('All events');
|
||||
$repeated_sel[1] = __('Group events');
|
||||
$repeated_sel[2] = __('Group agents');
|
||||
$data[2] .= html_print_select($repeated_sel, 'group_rep', $group_rep, '', '', 0, true);
|
||||
$data[2] .= html_print_select(
|
||||
$repeated_sel,
|
||||
'group_rep',
|
||||
$group_rep,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
@ -778,7 +971,14 @@ $data[0] .= html_print_input_text('source', $source, '', 35, 255, true);
|
|||
$data[1] = __('Extra ID').$jump;
|
||||
$data[1] .= html_print_input_text('id_extra', $id_extra, '', 11, 255, true);
|
||||
$data[2] = __('Comment').$jump;
|
||||
$data[2] .= html_print_input_text('user_comment', $user_comment, '', 35, 255, true);
|
||||
$data[2] .= html_print_input_text(
|
||||
'user_comment',
|
||||
$user_comment,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
@ -800,7 +1000,7 @@ $data = [];
|
|||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
// The buttons
|
||||
// The buttons.
|
||||
$data = [];
|
||||
$data[0] = '<div style="width:100%; text-align:left">';
|
||||
if ($event_w || $event_m) {
|
||||
|
@ -826,13 +1026,19 @@ $events_filter .= html_print_table($table, true);
|
|||
unset($table);
|
||||
|
||||
$botom_update = "<div style='width:100%;float:right;'>";
|
||||
$botom_update .= html_print_submit_button(__('Update'), 'update', false, 'class="sub upd" style="float:right;"', true);
|
||||
$botom_update .= html_print_submit_button(
|
||||
__('Update'),
|
||||
'update',
|
||||
false,
|
||||
'class="sub upd" style="float:right;"',
|
||||
true
|
||||
);
|
||||
$botom_update .= '</div>';
|
||||
|
||||
$events_filter .= $botom_update;
|
||||
|
||||
$events_filter .= '</form>';
|
||||
// This is the filter div
|
||||
// This is the filter div.
|
||||
$filter_resume['title'] = empty($id_name) ? __('No filter loaded') : __('Filter loaded').': '.$id_name;
|
||||
|
||||
if (is_metaconsole()) {
|
||||
|
@ -846,14 +1052,29 @@ if (is_metaconsole()) {
|
|||
}
|
||||
|
||||
|
||||
// Error div for ajax messages
|
||||
// Error div for ajax messages.
|
||||
echo "<div id='show_filter_error' style='display: none;'>";
|
||||
ui_print_error_message(__('Error creating filter.'), 'data-type_info_box="error_create_filter"');
|
||||
ui_print_error_message(__('Error creating filter is duplicated.'), 'data-type_info_box="duplicate_create_filter"');
|
||||
ui_print_success_message(__('Filter created.'), 'data-type_info_box="success_create_filter"');
|
||||
ui_print_error_message(
|
||||
__('Error creating filter.'),
|
||||
'data-type_info_box="error_create_filter"'
|
||||
);
|
||||
ui_print_error_message(
|
||||
__('Error creating filter is duplicated.'),
|
||||
'data-type_info_box="duplicate_create_filter"'
|
||||
);
|
||||
ui_print_success_message(
|
||||
__('Filter created.'),
|
||||
'data-type_info_box="success_create_filter"'
|
||||
);
|
||||
|
||||
ui_print_success_message(__('Filter updated.'), 'data-type_info_box="success_update_filter"');
|
||||
ui_print_error_message(__('Error updating filter.'), 'data-type_info_box="error_create_filter"');
|
||||
ui_print_success_message(
|
||||
__('Filter updated.'),
|
||||
'data-type_info_box="success_update_filter"'
|
||||
);
|
||||
ui_print_error_message(
|
||||
__('Error updating filter.'),
|
||||
'data-type_info_box="error_create_filter"'
|
||||
);
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
|
@ -877,7 +1098,7 @@ if ($group_rep == 0) {
|
|||
WHERE 1=1 ".$sql_post."
|
||||
$order_sql LIMIT ".$offset.','.$pagination;
|
||||
|
||||
// Extract the events by filter (or not) from db
|
||||
// Extract the events by filter (or not) from db.
|
||||
$result = db_get_all_rows_sql($sql);
|
||||
} else if ($group_rep == 1) {
|
||||
$filter_resume['duplicate'] = $group_rep;
|
||||
|
@ -905,7 +1126,7 @@ if ($group_rep == 0) {
|
|||
|
||||
// Active filter tag view call (only enterprise version)
|
||||
// It is required to pass some references to enterprise function
|
||||
// to translate the active filters
|
||||
// to translate the active filters.
|
||||
enterprise_hook(
|
||||
'print_event_tags_active_filters',
|
||||
[
|
||||
|
@ -922,8 +1143,9 @@ enterprise_hook(
|
|||
);
|
||||
|
||||
if (!empty($result)) {
|
||||
// ~ Checking the event tags exactly. The event query filters approximated tags to keep events
|
||||
// ~ with several tags
|
||||
// Checking the event tags exactly.
|
||||
// The event query filters approximated tags to keep events
|
||||
// with several tags.
|
||||
$acltags = tags_get_user_groups_and_tags($config['id_user'], $access, true);
|
||||
|
||||
foreach ($result as $key => $event_data) {
|
||||
|
@ -936,7 +1158,7 @@ if (!empty($result)) {
|
|||
|
||||
|
||||
|
||||
// Delete rnum field generated by oracle_recode_query() function
|
||||
// Delete rnum field generated by oracle_recode_query() function.
|
||||
if (($config['dbtype'] == 'oracle') && ($result !== false)) {
|
||||
for ($i = 0; $i < count($result); $i++) {
|
||||
unset($result[$i]['rnum']);
|
||||
|
@ -980,7 +1202,7 @@ enterprise_hook('close_meta_frame');
|
|||
|
||||
unset($table);
|
||||
|
||||
// Values to be used from javascript library
|
||||
// Values to be used from javascript library.
|
||||
html_print_input_hidden(
|
||||
'ajax_file',
|
||||
ui_get_full_url('ajax.php', false, false, false)
|
||||
|
@ -993,8 +1215,6 @@ ui_require_jquery_file('json');
|
|||
ui_include_time_picker();
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
/*<![CDATA[ */
|
||||
|
||||
var select_with_tag_empty = <?php echo (int) $remove_with_tag_disabled; ?>;
|
||||
var select_without_tag_empty = <?php echo (int) $remove_without_tag_disabled; ?>;
|
||||
var origin_select_with_tag_empty = <?php echo (int) $add_with_tag_disabled; ?>;
|
||||
|
@ -1031,14 +1251,15 @@ $(document).ready( function() {
|
|||
|
||||
$(id_hidden2).val(Base64.encode(jQuery.toJSON(value_store2)));
|
||||
|
||||
$("#text-date_from, #text-date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
||||
$("#text-date_from, #text-date_to").datepicker(
|
||||
{dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
||||
|
||||
// Don't collapse filter if update button has been pushed
|
||||
if ($("#hidden-open_filter").val() == 'true') {
|
||||
$("#event_control").toggle();
|
||||
}
|
||||
|
||||
// If selected is not 'none' show filter name
|
||||
// If selected is not 'none' show filter name.
|
||||
if ( $("#filter_id").val() != 0 ) {
|
||||
$("#row_name").css('visibility', '');
|
||||
$("#submit-update_filter").css('visibility', '');
|
||||
|
|
|
@ -180,9 +180,7 @@ if ($status != -1) {
|
|||
}
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->head[0] = __('Edit my User');
|
||||
$table->head_colspan[0] = 5;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
echo '<div class="user_form_title">'.__('Edit my User').'</div>';
|
||||
}
|
||||
|
||||
|
||||
|
@ -347,13 +345,12 @@ $double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user',
|
|||
if ($config['double_auth_enabled']) {
|
||||
$double_authentication = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Double authentication').'</p>';
|
||||
$double_authentication .= html_print_checkbox_switch('double_auth', 1, $double_auth_enabled, true);
|
||||
// Dialog.
|
||||
$double_authentication .= '<div id="dialog-double_auth" style="display:none"><div id="dialog-double_auth-container"></div></div>';
|
||||
}
|
||||
|
||||
if ($double_auth_enabled) {
|
||||
$double_authentication .= html_print_button(__('Show information'), 'show_info', false, 'javascript:show_double_auth_info();', '', true);
|
||||
// Dialog.
|
||||
$double_authentication .= '<div id="dialog-double_auth" style="display:none"><div id="dialog-double_auth-container"></div></div>';
|
||||
$double_authentication .= '</div>';
|
||||
}
|
||||
|
||||
if (isset($double_authentication)) {
|
||||
|
@ -552,11 +549,7 @@ echo '<form name="user_mod" method="post" action="'.ui_get_full_url().'&modi
|
|||
</div>
|
||||
<div class="user_edit_second_row white_box">
|
||||
<div class="edit_user_options">'.$language.$size_pagination.$skin.$home_screen.$event_filter.$newsletter.$newsletter_reminder.$double_authentication.'</div>
|
||||
<div class="edit_user_timezone">'.$timezone.'<div id="zonepicker" style="width: 100%; height: 400px;"></div>
|
||||
<div id="label"></div>
|
||||
<div id="pais"></div>
|
||||
<div id="pais_file"></div>
|
||||
</div>
|
||||
<div class="edit_user_timezone">'.$timezone.'<div id="zonepicker"></div></div>
|
||||
</div>
|
||||
<div class="user_edit_third_row white_box">
|
||||
<div class="edit_user_comments">'.$comments.'</div>
|
||||
|
@ -649,59 +642,102 @@ echo '</div>';
|
|||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
?>
|
||||
|
||||
<style>
|
||||
/* Styles for timezone map */
|
||||
div.olControlZoom{
|
||||
bottom:10px;
|
||||
left:10px;
|
||||
}
|
||||
div.olControlZoom a {
|
||||
display: block;
|
||||
margin: 1px;
|
||||
padding: 0;
|
||||
color: #FFF !important;
|
||||
font-size: 14pt !important;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
height: 22px;
|
||||
width: 22px;
|
||||
line-height: 19px;
|
||||
background: #82b92e;
|
||||
}
|
||||
div.olControlZoom a:hover {
|
||||
background: #76a928;
|
||||
}
|
||||
a.olControlZoomIn {
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
a.olControlZoomOut {
|
||||
border-radius: 0 0 4px 4px;
|
||||
}
|
||||
/* Overlay the popup on the map */
|
||||
.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-draggable.ui-resizable{
|
||||
z-index:9999 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
var map_unavailable = '';
|
||||
function print_map(map_unavailable){
|
||||
var img_src = "<?php echo ui_get_full_url('images/edit_user_map_not_available.jpg', false, false, false, false); ?>";
|
||||
if(map_unavailable !== true){
|
||||
$("#zonepicker").append('<img src="'+img_src+'" alt="This map is not available" title="This map is not available" style="max-width:100%; max-height: 270px;"/>').css('text-align','center');
|
||||
}else{
|
||||
var optionText = $("#timezone option:selected").val();
|
||||
$(function() {
|
||||
$("#zonepicker").timezonePicker({
|
||||
initialLat: 20,
|
||||
initialLng: 0,
|
||||
initialZoom: 2,
|
||||
onReady: function() {
|
||||
$("#zonepicker").timezonePicker('selectZone', optionText);
|
||||
},
|
||||
mapOptions: {
|
||||
maxZoom: 6,
|
||||
minZoom: 2
|
||||
},
|
||||
useOpenLayers: true
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Get the map
|
||||
var map_url = "http://a.tile.openstreetmap.org";
|
||||
// 1. Create a new XMLHttpRequest object
|
||||
var xhr = new XMLHttpRequest();
|
||||
// 2. Configure it: GET-request for the map_url
|
||||
xhr.open('GET', map_url, true);
|
||||
// 3. Send the request over the network
|
||||
xhr.send();
|
||||
// 4. This will be called after the response is received
|
||||
xhr.onload = function() {
|
||||
// analyze HTTP status of the response
|
||||
if (xhr.status == 200) {
|
||||
map_unavailable = true;
|
||||
} else {
|
||||
map_unavailable = false;
|
||||
}
|
||||
print_map(map_unavailable);
|
||||
};
|
||||
// 5. If no internet connection, it enter here (it doesn't enter in onload)
|
||||
xhr.onerror = function() {
|
||||
map_unavailable = false;
|
||||
print_map(map_unavailable);
|
||||
};
|
||||
</script>
|
||||
|
||||
<?php
|
||||
// Closes no meta condition.
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
/* Styles for timezone map */
|
||||
div.olControlZoom{
|
||||
bottom:10px;
|
||||
left:10px;
|
||||
}
|
||||
div.olControlZoom a {
|
||||
display: block;
|
||||
margin: 1px;
|
||||
padding: 0;
|
||||
color: #FFF !important;
|
||||
font-size: 14pt !important;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
height: 22px;
|
||||
width: 22px;
|
||||
line-height: 19px;
|
||||
background: #82b92e;
|
||||
}
|
||||
div.olControlZoom a:hover {
|
||||
background: #76a928;
|
||||
}
|
||||
a.olControlZoomIn {
|
||||
border-radius: 4px 4px 0 0;
|
||||
}
|
||||
a.olControlZoomOut {
|
||||
border-radius: 0 0 4px 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
var optionText = $("#timezone option:selected").val();
|
||||
$(function() {
|
||||
$("#zonepicker").timezonePicker({
|
||||
initialLat: 20,
|
||||
initialLng: 0,
|
||||
initialZoom: 2,
|
||||
onReady: function() {
|
||||
$("#zonepicker").timezonePicker('selectZone', optionText);
|
||||
},
|
||||
mapOptions: {
|
||||
maxZoom: 6,
|
||||
minZoom: 2
|
||||
},
|
||||
useOpenLayers: true
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
$("#right_autorefreshlist").click (function () {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.732
|
||||
%define release 190320
|
||||
%define release 190325
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.732
|
||||
%define release 190320
|
||||
%define release 190325
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -785,6 +785,7 @@ CREATE TABLE IF NOT EXISTS `trecon_task` (
|
|||
`wmi_enabled` tinyint(1) unsigned DEFAULT '0',
|
||||
`auth_strings` text,
|
||||
`autoconfiguration_enabled` tinyint(1) unsigned default '0',
|
||||
`summary` text,
|
||||
PRIMARY KEY (`id_rt`),
|
||||
KEY `recon_task_daemon` (`id_recon_server`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.732-190320
|
||||
Version: 7.0NG.732-190325
|
||||
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.732-190320"
|
||||
pandora_version="7.0NG.732-190325"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.732";
|
||||
my $pandora_build = "190320";
|
||||
my $pandora_build = "190325";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -473,8 +473,7 @@ sub PandoraFMS::Recon::Base::create_agent($$) {
|
|||
$self->{'pa_config'}, $self->{'pa_config'}->{'servername'},
|
||||
$host_name, $device, $self->{'group_id'}, 0, $id_os,
|
||||
'', 300, $self->{'dbh'}, undef, $location->{'longitude'},
|
||||
$location->{'latitude'}, undef, undef, undef, undef,
|
||||
undef, undef, $self->{'main_event_id'}
|
||||
$location->{'latitude'}
|
||||
);
|
||||
return undef unless defined ($agent_id) and ($agent_id > 0);
|
||||
|
||||
|
@ -835,7 +834,17 @@ sub PandoraFMS::Recon::Base::wmi_module {
|
|||
sub PandoraFMS::Recon::Base::update_progress ($$) {
|
||||
my ($self, $progress) = @_;
|
||||
|
||||
db_do ($self->{'dbh'}, 'UPDATE trecon_task SET utimestamp = ?, status = ? WHERE id_rt = ?', time (), $progress, $self->{'task_id'});
|
||||
my $stats = {};
|
||||
if (defined($self->{'summary'}) && $self->{'summary'} ne '') {
|
||||
$stats->{'summary'} = $self->{'summary'};
|
||||
}
|
||||
$stats->{'step'} = $self->{'step'};
|
||||
$stats->{'c_network_name'} = $self->{'c_network_name'};
|
||||
$stats->{'c_network_percent'} = $self->{'c_network_percent'};
|
||||
|
||||
# Store progress, last contact and overall status.
|
||||
db_do ($self->{'dbh'}, 'UPDATE trecon_task SET utimestamp = ?, status = ?, summary = ? WHERE id_rt = ?',
|
||||
time (), $progress, encode_json($stats), $self->{'task_id'});
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.732";
|
||||
my $pandora_build = "190320";
|
||||
my $pandora_build = "190325";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -15,6 +15,14 @@ use PandoraFMS::Recon::NmapParser;
|
|||
use PandoraFMS::Recon::Util;
|
||||
use Socket qw/inet_aton/;
|
||||
|
||||
# Constants.
|
||||
use constant {
|
||||
STEP_SCANNING => 1,
|
||||
STEP_AFT => 2,
|
||||
STEP_TRACEROUTE => 3,
|
||||
STEP_GATEWAY => 4
|
||||
};
|
||||
|
||||
# /dev/null
|
||||
my $DEVNULL = ($^O eq 'MSWin32') ? '/Nul' : '/dev/null';
|
||||
|
||||
|
@ -47,33 +55,33 @@ our $SYSUPTIME = ".1.3.6.1.2.1.1.3";
|
|||
our $VTPVLANIFINDEX = ".1.3.6.1.4.1.9.9.46.1.3.1.1.18.1";
|
||||
|
||||
our @ISA = ("Exporter");
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw( ) ] );
|
||||
our %EXPORT_TAGS = ( 'all' => [qw( )] );
|
||||
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
|
||||
our @EXPORT = qw(
|
||||
$DOT1DBASEBRIDGEADDRESS
|
||||
$DOT1DBASEPORTIFINDEX
|
||||
$DOT1DTPFDBADDRESS
|
||||
$DOT1DTPFDBPORT
|
||||
$IFDESC
|
||||
$IFHCINOCTECTS
|
||||
$IFHCOUTOCTECTS
|
||||
$IFINDEX
|
||||
$IFINOCTECTS
|
||||
$IFOPERSTATUS
|
||||
$IFOUTOCTECTS
|
||||
$IPADENTIFINDEX
|
||||
$IPENTADDR
|
||||
$IFNAME
|
||||
$IPNETTOMEDIAPHYSADDRESS
|
||||
$IFPHYSADDRESS
|
||||
$IPADENTIFINDEX
|
||||
$IPROUTEIFINDEX
|
||||
$IPROUTENEXTHOP
|
||||
$IPROUTETYPE
|
||||
$PRTMARKERINDEX
|
||||
$SYSDESCR
|
||||
$SYSSERVICES
|
||||
$SYSUPTIME
|
||||
$DOT1DBASEBRIDGEADDRESS
|
||||
$DOT1DBASEPORTIFINDEX
|
||||
$DOT1DTPFDBADDRESS
|
||||
$DOT1DTPFDBPORT
|
||||
$IFDESC
|
||||
$IFHCINOCTECTS
|
||||
$IFHCOUTOCTECTS
|
||||
$IFINDEX
|
||||
$IFINOCTECTS
|
||||
$IFOPERSTATUS
|
||||
$IFOUTOCTECTS
|
||||
$IPADENTIFINDEX
|
||||
$IPENTADDR
|
||||
$IFNAME
|
||||
$IPNETTOMEDIAPHYSADDRESS
|
||||
$IFPHYSADDRESS
|
||||
$IPADENTIFINDEX
|
||||
$IPROUTEIFINDEX
|
||||
$IPROUTENEXTHOP
|
||||
$IPROUTETYPE
|
||||
$PRTMARKERINDEX
|
||||
$SYSDESCR
|
||||
$SYSSERVICES
|
||||
$SYSUPTIME
|
||||
);
|
||||
|
||||
#######################################################################
|
||||
|
@ -167,6 +175,18 @@ sub new {
|
|||
snmp_version => 1,
|
||||
subnets => [],
|
||||
autoconfiguration_enabled => 0,
|
||||
|
||||
# Store progress summary - Discovery progress view.
|
||||
step => 0,
|
||||
c_network_name => '',
|
||||
c_network_percent => 0.0,
|
||||
summary => {
|
||||
SNMP => 0,
|
||||
WMI => 0,
|
||||
discovered => 0,
|
||||
alive => 0,
|
||||
not_alive => 0
|
||||
},
|
||||
@_,
|
||||
|
||||
};
|
||||
|
@ -176,25 +196,26 @@ sub new {
|
|||
|
||||
# Check SNMP params id SNMP is enabled
|
||||
if ($self->{'snmp_enabled'}) {
|
||||
|
||||
# Check SNMP version
|
||||
if ($self->{'snmp_version'} ne '1' && $self->{'snmp_version'} ne '2'
|
||||
&& $self->{'snmp_version'} ne '2c' && $self->{'snmp_version'} ne '3'
|
||||
) {
|
||||
if ( $self->{'snmp_version'} ne '1'
|
||||
&& $self->{'snmp_version'} ne '2'
|
||||
&& $self->{'snmp_version'} ne '2c'
|
||||
&& $self->{'snmp_version'} ne '3') {
|
||||
$self->{'snmp_enabled'} = 0;
|
||||
$self->call('message', "SNMP version " . $self->{'snmp_version'} . " not supported (only 1, 2, 2c and 3).", 5);
|
||||
}
|
||||
|
||||
# Check the version 3 parameters
|
||||
if ($self->{'snmp_version'} eq '3') {
|
||||
|
||||
# Fixed some vars
|
||||
$self->{'communities'} = [];
|
||||
|
||||
# SNMP v3 checks
|
||||
if (
|
||||
$self->{'snmp_security_level'} ne 'noAuthNoPriv' &&
|
||||
$self->{'snmp_security_level'} ne 'authNoPriv' &&
|
||||
$self->{'snmp_security_level'} ne 'authPriv'
|
||||
) {
|
||||
if ( $self->{'snmp_security_level'} ne 'noAuthNoPriv'
|
||||
&&$self->{'snmp_security_level'} ne 'authNoPriv'
|
||||
&&$self->{'snmp_security_level'} ne 'authPriv') {
|
||||
$self->{'snmp_enabled'} = 0;
|
||||
$self->call('message', "Invalid SNMP security level " . $self->{'snmp_security_level'} . ".", 5);
|
||||
}
|
||||
|
@ -207,6 +228,7 @@ sub new {
|
|||
$self->call('message', "Invalid SNMP authentication method " . $self->{'snmp_auth_method'} . ".", 5);
|
||||
}
|
||||
} else {
|
||||
|
||||
# Fixed some vars
|
||||
$self->{'snmp_auth_user'} = '';
|
||||
$self->{'snmp_auth_pass'} = '';
|
||||
|
@ -296,6 +318,7 @@ sub aft_connectivity($$) {
|
|||
foreach my $mac ($self->snmp_get_value_array($switch, $DOT1DTPFDBADDRESS)) {
|
||||
push(@aft, parse_mac($mac));
|
||||
}
|
||||
|
||||
# Search for matching entries.
|
||||
foreach my $aft_mac (@aft) {
|
||||
|
||||
|
@ -309,7 +332,7 @@ sub aft_connectivity($$) {
|
|||
|
||||
# Get the interface associated to the port were we found the MAC address.
|
||||
my $switch_if_name = $self->get_if_from_aft($switch, $aft_mac);
|
||||
next unless defined ($switch_if_name) and ($switch_if_name ne '');
|
||||
next unless defined($switch_if_name) and ($switch_if_name ne '');
|
||||
|
||||
# Do not connect a host to a switch twice using the same interface.
|
||||
# The switch is probably connected to another switch.
|
||||
|
@ -342,8 +365,8 @@ sub are_connected($$$$$) {
|
|||
$if_1 = "ping" if $if_1 eq '';
|
||||
$if_2 = "ping" if $if_2 eq '';
|
||||
|
||||
if (defined($self->{'connections'}->{"${dev_1}\t${if_1}\t${dev_2}\t${if_2}"}) ||
|
||||
defined($self->{'connections'}->{"${dev_2}\t${if_2}\t${dev_1}\t${if_1}"})) {
|
||||
if ( defined($self->{'connections'}->{"${dev_1}\t${if_1}\t${dev_2}\t${if_2}"})
|
||||
||defined($self->{'connections'}->{"${dev_2}\t${if_2}\t${dev_1}\t${if_1}"})) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -367,19 +390,20 @@ sub snmp_discovery($$) {
|
|||
|
||||
# Try to find the MAC with an ARP request.
|
||||
$self->get_mac_from_ip($device);
|
||||
|
||||
|
||||
# Check if the device responds to SNMP.
|
||||
if ($self->snmp_responds($device)) {
|
||||
|
||||
$self->{'summary'}->{'SNMP'} += 1;
|
||||
|
||||
# Fill the VLAN cache.
|
||||
$self->find_vlans($device);
|
||||
|
||||
|
||||
# Guess the device type.
|
||||
$self->guess_device_type($device);
|
||||
|
||||
|
||||
# Find aliases for the device.
|
||||
$self->find_aliases($device);
|
||||
|
||||
|
||||
# Find interfaces for the device.
|
||||
$self->find_ifaces($device);
|
||||
|
||||
|
@ -655,12 +679,12 @@ sub get_if_from_ip($$$) {
|
|||
|
||||
# Get the port associated to the IP address.
|
||||
my $if_index = $self->snmp_get_value($device, "$IPROUTEIFINDEX.$ip_addr");
|
||||
return '' unless defined ($if_index);
|
||||
return '' unless defined($if_index);
|
||||
|
||||
# Get the name of the interface associated to the port.
|
||||
my $if_name = $self->snmp_get_value($device, "$IFNAME.$if_index");
|
||||
return '' unless defined ($if_name);
|
||||
|
||||
return '' unless defined($if_name);
|
||||
|
||||
$if_name =~ s/"//g;
|
||||
return $if_name;
|
||||
}
|
||||
|
@ -686,12 +710,12 @@ sub get_if_from_mac($$$) {
|
|||
|
||||
# Get the name of the interface associated to the port.
|
||||
my $if_name = $self->snmp_get_value($device, "$IFNAME.$if_index");
|
||||
return '' unless defined ($if_name);
|
||||
|
||||
return '' unless defined($if_name);
|
||||
|
||||
$if_name =~ s/"//g;
|
||||
return $if_name;
|
||||
}
|
||||
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -718,13 +742,13 @@ sub get_if_from_port($$$) {
|
|||
########################################################################################
|
||||
sub get_if_ip($$$) {
|
||||
my ($self, $device, $if_index) = @_;
|
||||
|
||||
|
||||
my @output = $self->snmp_get($device, $IPADENTIFINDEX);
|
||||
foreach my $line (@output) {
|
||||
chomp ($line);
|
||||
chomp($line);
|
||||
return $1 if ($line =~ m/^$IPADENTIFINDEX.(\S+)\s+=\s+\S+:\s+$if_index$/);
|
||||
}
|
||||
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -748,7 +772,7 @@ sub get_if_mac($$$) {
|
|||
########################################################################################
|
||||
sub get_if_type($$$) {
|
||||
my ($self, $device, $if_index) = @_;
|
||||
|
||||
|
||||
my $type = $self->snmp_get_value($device, "$IFTYPE.$if_index");
|
||||
return '' unless defined($type);
|
||||
|
||||
|
@ -769,7 +793,7 @@ sub get_ip_from_mac($$) {
|
|||
}
|
||||
|
||||
########################################################################################
|
||||
# Attemtps to find
|
||||
# Attemtps to find
|
||||
########################################################################################
|
||||
sub get_mac_from_ip($$) {
|
||||
my ($self, $host) = @_;
|
||||
|
@ -824,7 +848,7 @@ sub get_routes($) {
|
|||
}
|
||||
|
||||
# Replace 0.0.0.0 with the default gateway's IP.
|
||||
return unless defined ($self->{'default_gw'});
|
||||
return unless defined($self->{'default_gw'});
|
||||
foreach my $route (@{$self->{'routes'}}) {
|
||||
$route->{gw} = $self->{'default_gw'} if ($route->{'gw'} eq '0.0.0.0');
|
||||
}
|
||||
|
@ -906,12 +930,15 @@ sub guess_device_type($$) {
|
|||
# L2?
|
||||
my $device_type;
|
||||
if ($service_bits[1] == 1) {
|
||||
|
||||
# L3?
|
||||
if ($service_bits[2] == 1) {
|
||||
|
||||
# Bridge MIB?
|
||||
if (defined($bridge_mib)) {
|
||||
$device_type = 'switch';
|
||||
} else {
|
||||
|
||||
# L7?
|
||||
if ($service_bits[6] == 1) {
|
||||
$device_type = 'host';
|
||||
|
@ -919,8 +946,8 @@ sub guess_device_type($$) {
|
|||
$device_type = 'router';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
}else {
|
||||
|
||||
# Bridge MIB?
|
||||
if (defined($bridge_mib)) {
|
||||
$device_type = 'switch';
|
||||
|
@ -928,14 +955,16 @@ sub guess_device_type($$) {
|
|||
$device_type = 'host';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
}else {
|
||||
|
||||
# L3?
|
||||
if ($service_bits[2] == 1) {
|
||||
|
||||
# L4?
|
||||
if ($service_bits[3] == 1) {
|
||||
$device_type = 'switch';
|
||||
} else {
|
||||
|
||||
# L7?
|
||||
if ($service_bits[6] == 1) {
|
||||
$device_type = 'host';
|
||||
|
@ -943,8 +972,8 @@ sub guess_device_type($$) {
|
|||
$device_type = 'router';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
}else {
|
||||
|
||||
# Printer MIB?
|
||||
my $printer_mib = $self->snmp_get_value($device, $PRTMARKERINDEX);
|
||||
if (defined($printer_mib)) {
|
||||
|
@ -1016,7 +1045,7 @@ sub is_switch_connected($$$) {
|
|||
# Check for aliases!
|
||||
$device = $self->{'aliases'}->{$device} if defined($self->{'aliases'}->{$device});
|
||||
|
||||
return 1 if defined ($self->{'switch_to_switch'}->{"${device}\t${iface}"});
|
||||
return 1 if defined($self->{'switch_to_switch'}->{"${device}\t${iface}"});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1069,8 +1098,8 @@ sub mark_connected($$;$$$) {
|
|||
}
|
||||
|
||||
# Prevent parent-child loops.
|
||||
if (!defined($self->{'parents'}->{$parent}) ||
|
||||
$self->{'parents'}->{$parent} ne $child) {
|
||||
if (!defined($self->{'parents'}->{$parent})
|
||||
||$self->{'parents'}->{$parent} ne $child) {
|
||||
|
||||
# A parent-child relationship is always created to help complete the map with
|
||||
# layer 3 information.
|
||||
|
@ -1097,8 +1126,10 @@ sub mark_switch_connected($$$) {
|
|||
sub mark_visited($$) {
|
||||
my ($self, $device) = @_;
|
||||
|
||||
$self->{'visited_devices'}->{$device} = { 'addr' => { $device => '' },
|
||||
'type' => 'host' };
|
||||
$self->{'visited_devices'}->{$device} = {
|
||||
'addr' => { $device => '' },
|
||||
'type' => 'host'
|
||||
};
|
||||
}
|
||||
|
||||
########################################################################################
|
||||
|
@ -1121,8 +1152,8 @@ sub snmp_responds($$) {
|
|||
return 1 if($self->is_snmp_discovered($device));
|
||||
|
||||
return ($self->{'snmp_version'} eq "3")
|
||||
? $self->snmp_responds_v3($device)
|
||||
: $self->snmp_responds_v122c($device);
|
||||
? $self->snmp_responds_v3($device)
|
||||
: $self->snmp_responds_v122c($device);
|
||||
}
|
||||
|
||||
########################################################################################
|
||||
|
@ -1221,11 +1252,7 @@ sub remote_arp($$) {
|
|||
##############################################################################
|
||||
sub ping ($$$) {
|
||||
my ($self, $host) = @_;
|
||||
my ($timeout, $retries, $packets) = (
|
||||
$self->{'icmp_timeout'},
|
||||
$self->{'icmp_checks'},
|
||||
1,
|
||||
);
|
||||
my ($timeout, $retries, $packets) = ($self->{'icmp_timeout'},$self->{'icmp_checks'},1,);
|
||||
|
||||
# Windows
|
||||
if (($^O eq "MSWin32") || ($^O eq "MSWin32-x64") || ($^O eq "cygwin")){
|
||||
|
@ -1237,11 +1264,12 @@ sub ping ($$$) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
# Solaris
|
||||
if ($^O eq "solaris"){
|
||||
my $ping_command = $host =~ /\d+:|:\d+/ ? "ping -A inet6" : "ping";
|
||||
for (my $i = 0; $i < $retries; $i++) {
|
||||
|
||||
# Note: There is no timeout option.
|
||||
`$ping_command -s -n $host 56 $packets >/dev/null 2>&1`;
|
||||
return 1 if ($? == 0);
|
||||
|
@ -1249,11 +1277,12 @@ sub ping ($$$) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
# FreeBSD
|
||||
if ($^O eq "freebsd"){
|
||||
my $ping_command = $host =~ /\d+:|:\d+/ ? "ping6" : "ping -t $timeout";
|
||||
for (my $i = 0; $i < $retries; $i++) {
|
||||
|
||||
# Note: There is no timeout option for ping6.
|
||||
`$ping_command -q -n -c $packets $host >/dev/null 2>&1`;
|
||||
return 1 if ($? == 0);
|
||||
|
@ -1263,9 +1292,10 @@ sub ping ($$$) {
|
|||
}
|
||||
|
||||
# NetBSD
|
||||
if ($^O eq "netbsd"){
|
||||
if ($^O eq "netbsd"){
|
||||
my $ping_command = $host =~ /\d+:|:\d+/ ? "ping6" : "ping -w $timeout";
|
||||
for (my $i = 0; $i < $retries; $i++) {
|
||||
|
||||
# Note: There is no timeout option for ping6.
|
||||
`$ping_command -q -n -c $packets $host >/dev/null 2>&1`;
|
||||
if ($? == 0) {
|
||||
|
@ -1275,11 +1305,11 @@ sub ping ($$$) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
# Assume Linux by default.
|
||||
my $ping_command = $host =~ /\d+:|:\d+/ ? "ping6" : "ping";
|
||||
for (my $i = 0; $i < $retries; $i++) {
|
||||
`$ping_command -q -W $timeout -n -c $packets $host >/dev/null 2>&1`;
|
||||
`$ping_command -q -W $timeout -n -c $packets $host >/dev/null 2>&1`;
|
||||
return 1 if ($? == 0);
|
||||
}
|
||||
|
||||
|
@ -1295,11 +1325,13 @@ sub scan_subnet($) {
|
|||
|
||||
my @subnets = @{$self->get_subnets()};
|
||||
foreach my $subnet (@subnets) {
|
||||
$self->{'c_network_percent'} = 0;
|
||||
$self->{'c_network_name'} = $subnet;
|
||||
|
||||
# Clean blanks.
|
||||
$subnet =~ s/\s+//g;
|
||||
|
||||
my $net_addr = new NetAddr::IP ($subnet);
|
||||
my $net_addr = new NetAddr::IP($subnet);
|
||||
if (!defined($net_addr)) {
|
||||
$self->call('message', "Invalid network: $subnet", 3);
|
||||
next;
|
||||
|
@ -1312,46 +1344,68 @@ sub scan_subnet($) {
|
|||
# fping scan.
|
||||
if (-x $self->{'fping'} && $net_addr->num() > 1) {
|
||||
$self->call('message', "Calling fping...", 5);
|
||||
|
||||
|
||||
my @hosts = `"$self->{'fping'}" -ga "$subnet" 2>DEVNULL`;
|
||||
next if (scalar(@hosts) == 0);
|
||||
|
||||
|
||||
$self->{'summary'}->{'discovered'} += scalar(@hosts);
|
||||
|
||||
my $step = 50.0 / scalar(@subnets) / scalar(@hosts); # The first 50% of the recon task approx.
|
||||
my $subnet_step = 100.0 / scalar(@hosts);
|
||||
foreach my $line (@hosts) {
|
||||
chomp($line);
|
||||
|
||||
my @temp = split(/ /, $line);
|
||||
next if (scalar(@temp) != 1); # Junk is shown for broadcast addresses.
|
||||
if (scalar(@temp) != 1) {
|
||||
|
||||
# Junk is shown for broadcast addresses.
|
||||
# Increase summary.not_alive hosts.
|
||||
$self->{'summary'}->{'not_alive'} += 1;
|
||||
next;
|
||||
}
|
||||
my $host = $temp[0];
|
||||
|
||||
# Skip network and broadcast addresses.
|
||||
next if ($host eq $network->addr() || $host eq $broadcast->addr());
|
||||
|
||||
|
||||
# Increase self summary.alive hosts.
|
||||
$self->{'summary'}->{'alive'} += 1;
|
||||
$self->call('message', "Scanning host: $host", 5);
|
||||
$self->call('update_progress', ceil($progress));
|
||||
$progress += $step;
|
||||
|
||||
$self->{'c_network_percent'} += $subnet_step;
|
||||
|
||||
$self->snmp_discovery($host);
|
||||
|
||||
# Add wmi scan if enabled.
|
||||
$self->wmi_scan($host) if ($self->{'wmi_enabled'} == 1);
|
||||
}
|
||||
}
|
||||
|
||||
# ping scan.
|
||||
else {
|
||||
my @hosts = map { (split('/', $_))[0] } $net_addr->hostenum;
|
||||
next if (scalar(@hosts) == 0);
|
||||
|
||||
|
||||
$self->{'summary'}->{'discovered'} += scalar(@hosts);
|
||||
|
||||
my $step = 50.0 / scalar(@subnets) / scalar(@hosts); # The first 50% of the recon task approx.
|
||||
my $subnet_step = 100.0 / scalar(@hosts);
|
||||
foreach my $host (@hosts) {
|
||||
|
||||
|
||||
$self->call('message', "Scanning host: $host", 5);
|
||||
$self->call('update_progress', ceil($progress));
|
||||
$progress += $step;
|
||||
|
||||
|
||||
# Check if the host is up.
|
||||
next if ($self->ping($host) == 0);
|
||||
|
||||
if ($self->ping($host) == 0) {
|
||||
$self->{'summary'}->{'not_alive'} += 1;
|
||||
next;
|
||||
}
|
||||
|
||||
$self->{'summary'}->{'alive'} += 1;
|
||||
$self->{'c_network_percent'} += $subnet_step;
|
||||
|
||||
$self->snmp_discovery($host);
|
||||
|
||||
# Add wmi scan if enabled.
|
||||
|
@ -1373,6 +1427,8 @@ sub scan($) {
|
|||
|
||||
# Find devices.
|
||||
$self->call('message', "[1/5] Scanning the network...", 3);
|
||||
$self->{'step'} = STEP_SCANNING;
|
||||
$self->call('update_progress', $progress);
|
||||
$self->scan_subnet();
|
||||
|
||||
# Read the local ARP cache.
|
||||
|
@ -1381,20 +1437,23 @@ sub scan($) {
|
|||
# Get a list of found hosts.
|
||||
my @hosts = @{$self->get_hosts()};
|
||||
if (scalar(@hosts) > 0 && $self->{'parent_detection'} == 1) {
|
||||
# Delete previous connections.
|
||||
|
||||
# Delete previous connections.
|
||||
$self->call('delete_connections');
|
||||
|
||||
|
||||
# Connectivity from address forwarding tables.
|
||||
$self->call('message', "[1/4] Finding address forwarding table connectivity...", 3);
|
||||
$self->{'step'} = STEP_AFT;
|
||||
($progress, $step) = (50, 20.0 / scalar(@hosts)); # From 50% to 70%.
|
||||
for (my $i = 0; defined($hosts[$i]); $i++) {
|
||||
$self->call('update_progress', $progress);
|
||||
$progress += $step;
|
||||
$self->aft_connectivity($hosts[$i]);
|
||||
}
|
||||
|
||||
|
||||
# Connect hosts that are still unconnected using traceroute.
|
||||
$self->call('message', "[3/4] Finding traceroute connectivity.", 3);
|
||||
$self->{'step'} = STEP_TRACEROUTE;
|
||||
($progress, $step) = (70, 20.0 / scalar(@hosts)); # From 70% to 90%.
|
||||
foreach my $host (@hosts) {
|
||||
$self->call('update_progress', $progress);
|
||||
|
@ -1402,9 +1461,10 @@ sub scan($) {
|
|||
next if ($self->has_parent($host) || $self->has_children($host));
|
||||
$self->traceroute_connectivity($host);
|
||||
}
|
||||
|
||||
|
||||
# Connect hosts that are still unconnected using known gateways.
|
||||
$self->call('message', "[4/4] Finding host to gateway connectivity.", 3);
|
||||
$self->{'step'} = STEP_GATEWAY;
|
||||
($progress, $step) = (90, 10.0 / scalar(@hosts)); # From 70% to 90%.
|
||||
$self->get_routes(); # Update the route cache.
|
||||
foreach my $host (@hosts) {
|
||||
|
@ -1416,8 +1476,9 @@ sub scan($) {
|
|||
}
|
||||
|
||||
# Done!
|
||||
$self->{'step'} = '';
|
||||
$self->call('update_progress', -1);
|
||||
|
||||
|
||||
# Print debug information on found devices.
|
||||
$self->call('message', "[Summary]", 3);
|
||||
foreach my $host (@hosts) {
|
||||
|
@ -1425,7 +1486,7 @@ sub scan($) {
|
|||
next unless defined($device);
|
||||
|
||||
# Print device information.
|
||||
my $dev_info = "Device: " . $device->{'type'} . " (";
|
||||
my $dev_info = "Device: " . $device->{'type'} . " (";
|
||||
foreach my $ip_address ($self->get_addresses($host)) {
|
||||
$dev_info .= "$ip_address,";
|
||||
}
|
||||
|
@ -1473,8 +1534,8 @@ sub snmp_get($$$) {
|
|||
if (scalar(@vlans) == 0) {
|
||||
my $command = $self->snmp_get_command($device, $oid, $community);
|
||||
@output = `$command`;
|
||||
}
|
||||
else {
|
||||
}else {
|
||||
|
||||
# Handle duplicate lines.
|
||||
my %output_hash;
|
||||
foreach my $vlan (@vlans) {
|
||||
|
@ -1528,7 +1589,7 @@ sub snmp_get_value($$$) {
|
|||
|
||||
my @output = $self->snmp_get($device, $oid);
|
||||
foreach my $line (@output) {
|
||||
chomp ($line);
|
||||
chomp($line);
|
||||
return $1 if ($line =~ /^$oid\s+=\s+\S+:\s+(.*)$/);
|
||||
}
|
||||
|
||||
|
@ -1544,7 +1605,7 @@ sub snmp_get_value_array($$$) {
|
|||
|
||||
my @output = $self->snmp_get($device, $oid);
|
||||
foreach my $line (@output) {
|
||||
chomp ($line);
|
||||
chomp($line);
|
||||
push(@values, $1) if ($line =~ /^$oid\S*\s+=\s+\S+:\s+(.*)$/);
|
||||
}
|
||||
|
||||
|
@ -1575,22 +1636,20 @@ sub traceroute_connectivity($$) {
|
|||
# Perform a traceroute.
|
||||
my $nmap_args = '-nsP -PE --traceroute --max-retries '.$self->{'icmp_checks'}.' --host-timeout '.$self->{'icmp_timeout'}.'s -T'.$self->{'recon_timing_template'};
|
||||
my $np = PandoraFMS::Recon::NmapParser->new();
|
||||
eval {
|
||||
$np->parsescan($self->{'nmap'}, $nmap_args, ($host));
|
||||
};
|
||||
eval {$np->parsescan($self->{'nmap'}, $nmap_args, ($host));};
|
||||
return if ($@);
|
||||
|
||||
|
||||
# Get hops to the host.
|
||||
my ($h) = $np->all_hosts ();
|
||||
return unless defined ($h);
|
||||
my @hops = $h->all_trace_hops ();
|
||||
my ($h) = $np->all_hosts();
|
||||
return unless defined($h);
|
||||
my @hops = $h->all_trace_hops();
|
||||
|
||||
# Skip the target host.
|
||||
pop(@hops);
|
||||
|
||||
|
||||
# Reverse the host order (closest hosts first).
|
||||
@hops = reverse(@hops);
|
||||
|
||||
|
||||
# Look for parents.
|
||||
my $device = $host;
|
||||
for (my $i = 0; $i < $self->{'parent_recursion'}; $i++) {
|
||||
|
@ -1601,7 +1660,7 @@ sub traceroute_connectivity($$) {
|
|||
$self->call('create_agent', $parent);
|
||||
|
||||
$self->call('message', "Host $device is one hop away from host $parent.", 5);
|
||||
$self->mark_connected($parent, '', $device, '');
|
||||
$self->mark_connected($parent, '', $device, '');
|
||||
|
||||
# Move on to the next hop.
|
||||
$device = $parent;
|
||||
|
@ -1643,7 +1702,10 @@ sub wmi_scan {
|
|||
my $auth = $self->responds_to_wmi($target);
|
||||
return unless defined($auth);
|
||||
|
||||
$self->{'summary'}->{'WMI'} += 1;
|
||||
|
||||
$self->call('message', "[".$target."] WMI available.", 10);
|
||||
|
||||
# Create the agent if it does not exist.
|
||||
my $agent_id = $self->call('create_agent', $target);
|
||||
next unless defined($agent_id);
|
||||
|
@ -1651,56 +1713,19 @@ sub wmi_scan {
|
|||
# CPU.
|
||||
my @cpus = $self->wmi_get_value_array($target, $auth, 'SELECT DeviceId FROM Win32_Processor', 0);
|
||||
foreach my $cpu (@cpus) {
|
||||
$self->call(
|
||||
'wmi_module',
|
||||
(
|
||||
$agent_id,
|
||||
$target,
|
||||
"SELECT LoadPercentage FROM Win32_Processor WHERE DeviceId='$cpu'",
|
||||
$auth,
|
||||
1,
|
||||
"CPU Load $cpu",
|
||||
"Load for $cpu (%)",
|
||||
'generic_data'
|
||||
)
|
||||
);
|
||||
$self->call('wmi_module',($agent_id,$target,"SELECT LoadPercentage FROM Win32_Processor WHERE DeviceId='$cpu'",$auth,1,"CPU Load $cpu","Load for $cpu (%)",'generic_data'));
|
||||
}
|
||||
|
||||
# Memory.
|
||||
my $mem = $self->wmi_get_value($target, $auth, 'SELECT FreePhysicalMemory FROM Win32_OperatingSystem', 0);
|
||||
if (defined($mem)) {
|
||||
$self->call('wmi_module',
|
||||
(
|
||||
$agent_id,
|
||||
$target,
|
||||
"SELECT FreePhysicalMemory, TotalVisibleMemorySize FROM Win32_OperatingSystem",
|
||||
$auth,
|
||||
0,
|
||||
'FreeMemory',
|
||||
'Free memory',
|
||||
'generic_data',
|
||||
'KB'
|
||||
)
|
||||
);
|
||||
$self->call('wmi_module',($agent_id,$target,"SELECT FreePhysicalMemory, TotalVisibleMemorySize FROM Win32_OperatingSystem",$auth,0,'FreeMemory','Free memory','generic_data','KB'));
|
||||
}
|
||||
|
||||
# Disk.
|
||||
my @units = $self->wmi_get_value_array($target, $auth, 'SELECT DeviceID FROM Win32_LogicalDisk', 0);
|
||||
foreach my $unit (@units) {
|
||||
$self->call(
|
||||
'wmi_module',
|
||||
(
|
||||
$agent_id,
|
||||
$target,
|
||||
"SELECT FreeSpace FROM Win32_LogicalDisk WHERE DeviceID='$unit'",
|
||||
$auth,
|
||||
1,
|
||||
"FreeDisk $unit",
|
||||
'Available disk space in kilobytes',
|
||||
'generic_data',
|
||||
'KB'
|
||||
)
|
||||
);
|
||||
$self->call('wmi_module',($agent_id,$target,"SELECT FreeSpace FROM Win32_LogicalDisk WHERE DeviceID='$unit'",$auth,1,"FreeDisk $unit",'Available disk space in kilobytes','generic_data','KB'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.732
|
||||
%define release 190320
|
||||
%define release 190325
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.732
|
||||
%define release 190320
|
||||
%define release 190325
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.732"
|
||||
PI_BUILD="190320"
|
||||
PI_BUILD="190325"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -34,7 +34,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.732 PS190320";
|
||||
my $version = "7.0NG.732 PS190325";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.732 PS190320";
|
||||
my $version = "7.0NG.732 PS190325";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|