Merge remote-tracking branch 'origin/develop' into ent-3595-discovery-fase-2

Former-commit-id: 8dd2601c41392e8b252b2a719d16deef5b6398c7
This commit is contained in:
fbsanchez 2019-03-13 09:52:00 +01:00
commit 750c64fbd7
85 changed files with 1738 additions and 891 deletions

View File

@ -1,10 +1,10 @@
package: pandorafms-agent-unix
Version: 4.0.1
Version: 7.0
Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Homepage: http://pandorafms.org/
Maintainer: ÁRTICA ST <info@artica.es>
Homepage: https://pandorafms.org/
Depends: coreutils, perl, unzip
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

@ -1,10 +1,10 @@
package: pandorafms-agent
Version: 4.0
Version: 7.0
Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Maintainer: ÁRTICA ST <info@artica.es>
Homepage: http://pandorafms.org/
Depends: coreutils, perl
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

@ -1,10 +1,10 @@
package: pandorafms-agent-unix
Version: 7.0NG.732-190306
Version: 7.0NG.732-190313
Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Maintainer: ÁRTICA ST <info@artica.es>
Homepage: http://pandorafms.org/
Depends: coreutils, perl, unzip
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.732-190306"
pandora_version="7.0NG.732-190313"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.732';
use constant AGENT_BUILD => '190306';
use constant AGENT_BUILD => '190313';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.732"
PI_BUILD="190306"
PI_BUILD="190313"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190306}
{190313}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.732(Build 190306)")
#define PANDORA_VERSION ("7.0NG.732(Build 190313)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.732(Build 190306))"
VALUE "ProductVersion", "(7.0NG.732(Build 190313))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.732-190306
Version: 7.0NG.732-190313
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.732-190306"
pandora_version="7.0NG.732-190313"
package_pear=0
package_pandora=1
@ -149,7 +149,7 @@ if [ $package_pear -eq 1 ]
then
echo "Make the package \"php-xml-rpc\"."
cd temp_package
dh-make-pear --maintainer "Miguel de Dios <miguel.dedios@artica.es>" XML_RPC
dh-make-pear --maintainer "ÁRTICA ST <info@artica.es>" XML_RPC
cd php-xml-rpc-*
dpkg-buildpackage -rfakeroot
cd ..

View File

@ -1,5 +1,7 @@
START TRANSACTION;
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';
COMMIT;
COMMIT;

View File

@ -106,7 +106,9 @@ function get_value_sum($arr)
{
foreach ($arr as $clave) {
foreach ($clave as $valor) {
$result += $valor;
if (is_numeric($valor) === true) {
$result += $valor;
}
}
}

View File

@ -1199,13 +1199,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 25);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 26);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '732');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '733');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
-- ---------------------------------------------------------------------
@ -2037,3 +2037,7 @@ INSERT INTO `tnotification_user` (`id_mensaje`, `id_user`) SELECT `id_mensaje`,
-- ----------------------------------------------------------------------
INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Application.VMware', 'Discovery&#x20;Application&#x20;script&#x20;to&#x20;monitor&#x20;VMware&#x20;technologies&#x20;&#40;ESXi,&#x20;VCenter,&#x20;VSphere&#41;', '/usr/share/pandora_server/util/recon_scripts/vmware-plugin.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Discovery.Cloud', 'Discovery&#x20;Cloud&#x20;script&#x20;to&#x20;monitor&#x20;Cloud&#x20;technologies&#x20;&#40;AWS.EC2,&#x20;AWS.S3,&#x20;AWS.RDS,&#x20RDS,&#x20AWS.EKS&#41;', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
-- ----------------------------------------------------------------------
-- Add column in table `tagent_custom_fields`
-- ----------------------------------------------------------------------
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';

View File

@ -30,6 +30,33 @@ require_once 'include/functions_notifications.php';
$notifications_numbers['last_id']
).'</div>';
// ======= Servers List ===============================================
$servers_list = '<div id="servers_list">';
$servers = [];
$servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver');
if ($servers['all'] != 0) {
$servers['up'] = (int) servers_check_status();
$servers['down'] = ($servers['all'] - $servers['up']);
if ($servers['up'] == 0) {
// All Servers down or no servers at all.
$servers_check_img = html_print_image('images/header_down_gray.png', true, ['alt' => 'cross', 'class' => 'bot', 'title' => __('All systems').': '.__('Down')]);
} else if ($servers['down'] != 0) {
// Some servers down.
$servers_check_img = html_print_image('images/header_warning_gray.png', true, ['alt' => 'error', 'class' => 'bot', 'title' => $servers['down'].' '.__('servers down')]);
} else {
// All servers up.
$servers_check_img = html_print_image('images/header_ready_gray.png', true, ['alt' => 'ok', 'class' => 'bot', 'title' => __('All systems').': '.__('Ready')]);
}
unset($servers);
// Since this is the header, we don't like to trickle down variables.
$servers_check_img_link = '<a class="white" href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60">';
$servers_check_img_link .= $servers_check_img;
$servers_check_img_link .= '</a>';
};
$servers_list .= $servers_check_img_link.'</div>';
// ======= Alerts ===============================================
$check_minor_release_available = false;
@ -48,7 +75,7 @@ require_once 'include/functions_notifications.php';
}
// Chat messages
// Chat messages.
$header_chat = "<div id='header_chat'><span id='icon_new_messages_chat' style='display: none;'>";
$header_chat .= "<a href='index.php?sec=workspace&sec2=operation/users/webchat'>";
$header_chat .= html_print_image('images/header_chat_gray.png', true, ['title' => __('New chat message')]);
@ -180,7 +207,7 @@ require_once 'include/functions_notifications.php';
$header_autorefresh_counter = '<div id="header_autorefresh_counter" style="'.$display_counter.'">'.$autorefresh_link_open_txt.$autorefresh_txt.$autorefresh_link_close.$autorefresh_additional.'</div>';
// qr
// Qr.
if ($config['show_qr_code_header'] == 0) {
$show_qr_code_header = 'display: none;';
} else {
@ -209,7 +236,7 @@ require_once 'include/functions_notifications.php';
});
</script>
<?php
// User
// 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']);
} else {
@ -218,13 +245,13 @@ require_once 'include/functions_notifications.php';
$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
// 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 .= '</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.'</div>
<div class="header_center">'.$header_searchbar, $header_discovery, $servers_list.'</div>
<div class="header_right">'.$header_user, $header_logout.'</div>';
?>
</div> <!-- Closes #table_header_inner -->

View File

@ -82,42 +82,30 @@ if (!empty($page) && !empty($sec)) {
}
$login_body_style = '';
// Overrides the default background with the defined by the user
// Overrides the default background with the defined by the user.
if (!empty($config['login_background'])) {
$background_url = 'images/backgrounds/'.$config['login_background'];
$login_body_style = "style=\"background-image: url('$background_url');\"";
$login_body_style = "style=\"background:linear-gradient(74deg, #02020255 36%, transparent 36%), url('".$background_url."');\"";
}
// Get the custom icons
// Get the custom icons.
$docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo();
echo '<div id="login_body" '.$login_body_style.'>';
echo '<div id="header_login">';
echo '<div id="icon_custom_pandora">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (isset($config['custom_logo'])) {
echo '<img src="enterprise/images/custom_logo/'.$config['custom_logo'].'" alt="monitoring_console">';
} else {
echo '<img src="images/custom_logo/pandora_logo_head_4.png" alt="monitoring_console">';
}
} else {
echo '<img src="images/custom_logo/pandora_logo_head_3.png" alt="monitoring_console">';
}
echo '</div>';
echo '<div id="list_icon_docs_support"><ul style="line-height: 36px;">';
echo '<div id="list_icon_docs_support"><ul>';
if ($docs_logo !== false) {
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
}
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
echo '<li><a href="'.$config['custom_docs_url'].'" target="_blank">'.__('Docs').'</li>';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($support_logo !== false) {
echo '<li id="li_margin_left"><a href="'.$config['custom_support_url'].'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
}
echo '<li><a style="color: white; font-size:inherit;" href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
echo '<li><a href="'.$config['custom_support_url'].'" target="_blank">'.__('Support').'</li>';
} else {
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
echo '<li>'.__('Support').'</li>';
@ -151,7 +139,8 @@ if (defined('METACONSOLE')) {
html_print_image('images/custom_logo_login/'.$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";
// I comment this in case in the future we put a logo without text.
// echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";.
}
echo '</a></div>';
@ -167,9 +156,6 @@ switch ($login_screen) {
if ($config['auth'] == 'saml') {
echo '<div id="log_nick" class="login_nick" style="display: none;">';
echo '<div>';
html_print_image('/images/usuario_login.png', false);
echo '</div>';
html_print_input_text_extended(
'nick',
'',
@ -184,9 +170,6 @@ switch ($login_screen) {
echo '</div>';
echo '<div id="log_pass" class="login_pass" style="display: none;">';
echo '<div>';
html_print_image('/images/candado_login.png', false);
echo '</div>';
html_print_input_text_extended(
'pass',
'',
@ -202,54 +185,48 @@ switch ($login_screen) {
);
echo '</div>';
echo '<div id="log_button" class="login_button" style="display: none; margin-bottom: 20px;">';
echo '<div id="log_button" class="login_button" style="display: none;">';
html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="sub next_login"');
echo '</div>';
echo '<div class="login_button" id="remove_button" style="margin-bottom: 20px;">';
echo '<div class="login_button" id="remove_button">';
echo '<input type="button" id="input_saml" value="Login as admin" onclick="show_normal_menu()">';
echo '</div>';
echo '<div class="login_button">';
echo '<div class="login_button login_button_saml">';
html_print_submit_button(__('Login with SAML'), 'login_button_saml', false, '');
echo '</div>';
} else {
echo '<div class="login_nick">';
echo '<div>';
html_print_image('/images/usuario_login.png', false);
echo '</div>';
html_print_input_text_extended(
'nick',
'',
'nick',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('User').'"'
);
html_print_input_text_extended(
'nick',
'',
'nick',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('User').'"'
);
echo '</div>';
echo '<div class="login_pass">';
echo '<div>';
html_print_image('/images/candado_login.png', false);
echo '</div>';
html_print_input_text_extended(
'pass',
'',
'pass',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('Password').'"',
false,
true
);
html_print_input_text_extended(
'pass',
'',
'pass',
'',
'',
'',
false,
'',
'autocomplete="off" placeholder="'.__('Password').'"',
false,
true
);
echo '</div>';
echo '<div class="login_button">';
html_print_submit_button(__('Login'), 'login_button', false, 'class="sub next_login"');
html_print_submit_button(__('Login'), 'login_button', false, 'class="sub next_login"');
echo '</div>';
}
break;
@ -289,9 +266,9 @@ switch ($login_screen) {
if ($config['enterprise_installed']) {
if ($config['reset_pass_option']) {
$reset_pass_link = 'reset_pass.php';
// Reset password link
echo '<div style="width:70%; height:40px; margin-right:auto; margin-left:auto; margin-top:20px; text-align:center;">';
echo '<a style="color: white !important;" href="index.php?reset=true&first=true">'.__('Forgot your password?');
// Reset password link.
echo '<div class="reset_password">';
echo '<a href="index.php?reset=true&first=true">'.__('Forgot your password?');
echo '</a>';
echo '</div>';
}
@ -544,7 +521,7 @@ ui_require_jquery_file('jquery-ui.min');
?>
<?php
// Hidden div to forced title
// Hidden div to forced title.
html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true]);
// html_print_div(array('id' => 'modal_alert', 'hidden' => true));

View File

@ -708,6 +708,13 @@ foreach ($fields as $field) {
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
true
);
$combo = [];
$combo = $field['combo_values'];
$combo = explode(',', $combo);
$combo_values = [];
foreach ($combo as $value) {
$combo_values[$value] = $value;
}
$custom_value = db_get_value_filter(
'description',
@ -747,6 +754,28 @@ foreach ($fields as $field) {
);
}
if ($field['combo_values'] !== '') {
$data[1] = html_print_select(
$combo_values,
'customvalue_'.$field['id_field'],
$custom_value,
'',
__('None'),
'',
true,
false,
false,
'',
false,
false,
false,
false,
false,
'',
false
);
};
array_push($table->data, $data);
}
@ -757,7 +786,7 @@ if (!empty($fields)) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
// The context help about the learning mode
// The context help about the learning mode.
if ($modo == 0) {
echo "<span id='modules_not_learning_mode_context_help' style=''>";
} else {

View File

@ -25,13 +25,16 @@ $id_field = (int) get_parameter('id_field', 0);
$name = (string) get_parameter('name', '');
$display_on_front = (bool) get_parameter('display_on_front', 0);
$is_password_type = (bool) get_parameter('is_password_type', 0);
// Header
$is_combo_enable = (bool) get_parameter('is_combo_enable', 0);
$combo_values = (string) get_parameter('combo_values', '');
// Header.
if ($id_field) {
$field = db_get_row_filter('tagent_custom_fields', ['id_field' => $id_field]);
$name = $field['name'];
$display_on_front = $field['display_on_front'];
$is_password_type = $field['is_password_type'];
$combo_values = $field['combo_values'];
$is_combo_enable = $config['is_combo_enable'];
ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, '');
} else {
ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, '');
@ -40,17 +43,87 @@ if ($id_field) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->id = 'configure_field';
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold';
$table->style[6] = 'font-weight: bold';
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
echo '</div>';
echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot unset the enable combo until you clear the combo values and click on update.').'</p>';
echo '</div>';
echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
echo '</div>';
echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
$table->data[0][1] = html_print_input_text(
'name',
$name,
'',
35,
100,
true
);
$table->data[0][2] = __('Pass type').ui_print_help_tip(__('The fields with pass type enabled will be displayed like html input type pass in html'), true);
$table->data[0][3] = html_print_checkbox('is_password_type', 1, $is_password_type, true);
$table->data[1][0] = __('Pass type').ui_print_help_tip(
__('The fields with pass type enabled will be displayed like html input type pass in html'),
true
);
$table->data[1][1] = html_print_checkbox_switch(
'is_password_type',
1,
$is_password_type,
true
);
$table->data[0][4] = __('Display on front').ui_print_help_tip(__('The fields with display on front enabled will be displayed into the agent details'), true);
$table->data[0][5] = html_print_checkbox('display_on_front', 1, $display_on_front, true);
$table->data[2][0] = __('Display on front').ui_print_help_tip(
__('The fields with display on front enabled will be displayed into the agent details'),
true
);
$table->data[2][1] = html_print_checkbox_switch(
'display_on_front',
1,
$display_on_front,
true
);
$table->data[3][0] = __('Enabled combo');
$table->data[3][1] = html_print_checkbox_switch_extended(
'is_combo_enable',
0,
$config['is_combo_enable'],
false,
'',
'',
true
);
$table->rowstyle[4] = 'display: none;';
$table->data[4][0] = __('Combo values').ui_print_help_tip(
__('Set values separated by comma'),
true
);
$table->data[4][1] = html_print_input_text(
'combo_values',
io_safe_output($combo_values),
'',
35,
200,
true
);
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
html_print_table($table);
@ -67,3 +140,67 @@ if ($id_field) {
echo '</div>';
echo '</form>';
?>
<script>
$(document).ready (function () {
if($('input[type=hidden][name=update_field]').val() == 1 && $('input[type=text][name=combo_values]').val() != ''){
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
$('input[type=checkbox][name=is_password_type]').change(function (e) {
dialog_message("#message_set_password");
$('input[type=checkbox][name=is_password_type]').prop('checked', false);
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
e.preventDefault();
});
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
if($('input[type=text][name=combo_values]').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
dialog_message("#message_set_combo");
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
e.preventDefault();
}
});
}
$('input[type=checkbox][name=is_combo_enable]').change(function () {
if( $(this).is(":checked") ){
$('#configure_field-4').show();
dialog_message("#message_no_set_password");
$('#configure_field-1').hide();
}
else{
$('#configure_field-4').hide();
$('#configure_field-1').show();
}
});
$('input[type=checkbox][name=is_password_type]').change(function () {
if( $(this).is(":checked")){
dialog_message("#message_no_set_combo");
$('#configure_field-3').hide();
}
else{
$('#configure_field-3').show();
}
});
});
function dialog_message(message_id) {
$(message_id)
.css("display", "inline")
.dialog({
modal: true,
show: "blind",
hide: "blind",
width: "400px",
buttons: {
Close: function() {
$(this).dialog("close");
}
}
});
}
</script>

View File

@ -26,7 +26,7 @@ if (!check_acl($config['id_user'], 0, 'PM')) {
return;
}
// Header
// Header.
ui_print_page_header(__('Agents custom fields manager'), 'images/custom_field.png', false, '', true, '');
$create_field = (bool) get_parameter('create_field');
@ -36,10 +36,12 @@ $id_field = (int) get_parameter('id_field', 0);
$name = (string) get_parameter('name', '');
$display_on_front = (int) get_parameter('display_on_front', 0);
$is_password_type = (int) get_parameter('is_password_type', 0);
$combo_values = (string) get_parameter('combo_values', '');
$combo_value_selected = (string) get_parameter('combo_value_selected', '');
// Create field
// Create field.
if ($create_field) {
// Check if name field is empty
// Check if name field is empty.
if ($name == '') {
ui_print_error_message(__('The name must not be empty'));
} else if ($name == db_get_value('name', 'tagent_custom_fields', 'name', $name)) {
@ -51,20 +53,22 @@ if ($create_field) {
'name' => $name,
'display_on_front' => $display_on_front,
'is_password_type' => $is_password_type,
'combo_values' => $combo_values,
]
);
ui_print_success_message(__('Field successfully created'));
}
}
// Update field
// Update field.
if ($update_field) {
// Check if name field is empty
// Check if name field is empty.
if ($name != '') {
$values = [
'name' => $name,
'display_on_front' => $display_on_front,
'is_password_type' => $is_password_type,
'combo_values' => $combo_values,
];
$result = db_process_sql_update('tagent_custom_fields', $values, ['id_field' => $id_field]);
@ -79,7 +83,7 @@ if ($update_field) {
}
}
// Delete field
// Delete field.
if ($delete_field) {
$result = db_process_sql_delete(
'tagent_custom_fields',

View File

@ -431,7 +431,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
str_replace('"', '', $str_warning),
'',
10,
255,
1024,
true,
$disabledBecauseInPolicy,
false,
@ -484,7 +484,7 @@ if (modules_is_string_type($id_module_type) || $edit) {
str_replace('"', '', $str_critical),
'',
10,
255,
1024,
true,
$disabledBecauseInPolicy,
false,

View File

@ -1,17 +1,32 @@
<?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @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
global $config;
check_login();
@ -51,15 +66,22 @@ if (is_ajax()) {
}
if (!is_metaconsole()) {
// Header
ui_print_page_header(__('Module groups defined in %s', get_product_name()), 'images/module_group.png', false, '', true, '');
// Header.
ui_print_page_header(
__('Module groups defined in %s', get_product_name()),
'images/module_group.png',
false,
'',
true,
''
);
}
$create_group = (bool) get_parameter('create_group');
$update_group = (bool) get_parameter('update_group');
$delete_group = (bool) get_parameter('delete_group');
// Create group
// Create group.
if ($create_group) {
$name = (string) get_parameter('name');
$icon = (string) get_parameter('icon');
@ -70,22 +92,29 @@ if ($create_group) {
if ($name) {
if (!$check) {
$result = db_process_sql_insert('tmodule_group', ['name' => $name]);
$result = db_process_sql_insert(
'tmodule_group',
['name' => $name]
);
if ($result) {
ui_print_success_message(__('Group successfully created'));
} else {
ui_print_error_message(__('There was a problem creating group'));
ui_print_error_message(
__('There was a problem creating group')
);
}
} else {
ui_print_error_message(__('Each module group must have a different name'));
ui_print_error_message(
__('Each module group must have a different name')
);
}
} else {
ui_print_error_message(__('Module group must have a name'));
}
}
// Update group
// Update group.
if ($update_group) {
$id_group = (int) get_parameter('id_group');
$name = (string) get_parameter('name');
@ -98,38 +127,79 @@ if ($update_group) {
if ($name) {
if (!$check || $subcheck == $name) {
$result = db_process_sql_update('tmodule_group', ['name' => $name], ['id_mg' => $id_group]);
$result = db_process_sql_update(
'tmodule_group',
['name' => $name],
['id_mg' => $id_group]
);
if ($result !== false) {
ui_print_success_message(__('Group successfully updated'));
} else {
ui_print_error_message(__('There was a problem modifying group'));
ui_print_error_message(
__('There was a problem modifying group')
);
}
} else {
ui_print_error_message(__('Each module group must have a different name'));
ui_print_error_message(
__('Each module group must have a different name')
);
}
} else {
ui_print_error_message(__('Module group must have a name'));
}
}
// Delete group
// Delete group.
if ($delete_group) {
$id_group = (int) get_parameter('id_group');
$result = db_process_sql_delete('tmodule_group', ['id_mg' => $id_group]);
if ($result) {
$result = db_process_sql_update('tagente_modulo', ['id_module_group' => 0], ['id_module_group' => $id_group]);
db_process_sql_update('tpolicy_modules', ['id_module_group' => 0], ['id_module_group' => $id_group]);
db_process_sql_update('tcontainer_item', ['id_module_group' => 0], ['id_module_group' => $id_group]);
db_process_sql_update('tnetwork_component', ['id_module_group' => 0], ['id_module_group' => $id_group]);
db_process_sql_update('treport_content', ['id_module_group' => 0], ['id_module_group' => $id_group]);
db_process_sql_update('tnetwork_map', ['id_module_group' => 0], ['id_module_group' => $id_group]);
db_process_sql_update('tlocal_component', ['id_module_group' => 0], ['id_module_group' => $id_group]);
db_process_sql_update('treport_content_template', ['id_module_group' => 0], ['id_module_group' => $id_group]);
$result = db_process_sql_update(
'tagente_modulo',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
db_process_sql_update(
'tpolicy_modules',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
db_process_sql_update(
'tcontainer_item',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
db_process_sql_update(
'tnetwork_component',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
db_process_sql_update(
'treport_content',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
db_process_sql_update(
'tnetwork_map',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
db_process_sql_update(
'tlocal_component',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
db_process_sql_update(
'treport_content_template',
['id_module_group' => 0],
['id_module_group' => $id_group]
);
// A group with no modules can be deleted, to avoid a message error then do the follwing
// A group with no modules can be deleted,
// to avoid a message error then do the follwing.
if ($result !== false) {
$result = true;
}
@ -150,36 +220,15 @@ $offset = (int) get_parameter('offset', 0);
ui_pagination($total_groups, $url, $offset);
switch ($config['dbtype']) {
case 'mysql':
$sql = 'SELECT *
FROM tmodule_group
ORDER BY name ASC
LIMIT '.$offset.', '.$config['block_size'];
break;
case 'postgresql':
$sql = 'SELECT *
FROM tmodule_group
ORDER BY name ASC
LIMIT '.$config['block_size'].' OFFSET '.$offset;
break;
case 'oracle':
$set = [];
$set['limit'] = $config['block_size'];
$set['offset'] = $offset;
$sql = 'SELECT *
FROM tmodule_group
ORDER BY name ASC';
$sql = oracle_recode_query($sql, $set);
break;
}
$sql = 'SELECT *
FROM tmodule_group
ORDER BY name ASC
LIMIT '.$offset.', '.$config['block_size'];
$groups = db_get_all_rows_sql($sql);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
@ -210,11 +259,21 @@ if (!empty($groups)) {
html_print_table($table);
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined module groups') ]);
ui_print_info_message(
[
'no_close' => true,
'message' => __('There are no defined module groups'),
]
);
}
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group">';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Create module group'), 'crt', false, 'class="sub next"');
html_print_submit_button(
__('Create module group'),
'crt',
false,
'class="sub next"'
);
echo '</div>';
echo '</form>';

View File

@ -1,17 +1,32 @@
<?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @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-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 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
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -34,7 +49,8 @@ if (is_ajax()) {
if ($get_agents) {
$id_group = (int) get_parameter('id_group', 0);
// Is is possible add keys prefix to avoid auto sorting in js object conversion
// Is is possible add keys prefix to avoid auto
// sorting in js object conversion.
$keys_prefix = (string) get_parameter('keys_prefix', '');
if ($id_group == 0) {
@ -62,7 +78,7 @@ if (is_ajax()) {
);
}
// Add keys prefix
// Add keys prefix.
if ($keys_prefix !== '') {
foreach ($agents as $k => $v) {
$agents[$keys_prefix.$k] = $v;
@ -92,8 +108,8 @@ function process_manage_add($id_alert_template, $id_agents, $module_names)
foreach ($module_names as $module) {
foreach ($id_agents as $id_agent) {
$module_id = modules_get_agentmodule_id($module, $id_agent);
$modules_id[] = $module_id['id_agente_modulo'];
$module_id = modules_get_agentmodule_id($module, $id_agent);
$modules_id[] = $module_id['id_agente_modulo'];
}
}
@ -148,6 +164,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = true;
}
$table = new stdClass();
$table->id = 'add_table';
$table->class = 'databox filters';
$table->width = '100%';
@ -251,10 +268,10 @@ html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
echo '</div>';
echo '</form>';
// TODO: Change to iu_print_error system
// TODO: Change to iu_print_error system.
echo '<h3 class="error invisible" id="message"> </h3>';
// Hack to translate text "none" in PHP to javascript
// Hack to translate text "none" in PHP to javascript.
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
ui_require_jquery_file('form');
@ -270,42 +287,40 @@ $(document).ready (function () {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_alerts").serializeArray().length;
var count_parameters =
get_parameters_count + post_parameters_count;
if (count_parameters > limit_parameters_massive) {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
return false;
}
});
$("#checkbox-recursion").click(function () {
$("#id_group").trigger("change");
});
$("#id_agents").change(agent_changed_by_multiple_agents);
$("#id_group").change (function () {
var $select = $("#id_agents").enable ();
$("#agent_loading").show ();
$("option", $select).remove ();
jQuery.post ("ajax.php",
{"page" : "godmode/massive/massive_add_alerts",
"get_agents" : 1,
"id_group" : this.value,
"recursion" : $("#checkbox-recursion").is(":checked") ? 1 : 0,
// Add a key prefix to avoid auto sorting in js object conversion
// Add a key prefix to avoid auto sorting in js object conversion.
"keys_prefix" : "_"
},
function (data, status) {
options = "";
jQuery.each (data, function (id, value) {
// Remove keys_prefix from the index
// Remove keys_prefix from the index.
id = id.substring(1);
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_agents").append (options);
@ -315,40 +330,39 @@ $(document).ready (function () {
"json"
);
});
$("#id_group").value = "0";
$("#id_group").click (
function () {
$(this).css ("width", "auto");
});
$("#id_group").blur (function () {
$(this).css ("width", "180px");
});
$("#id_agents").click (
function () {
$(this).css ("width", "auto");
});
$("#id_agents").blur (function () {
$(this).css ("width", "180px");
});
$("#module").click (
function () {
$(this).css ("width", "auto");
});
$("#module").blur (function () {
$(this).css ("width", "180px");
});
$("#modules_selection_mode").change (function() {
$("#id_agents").trigger('change');
});
});
/* ]]> */
</script>

View File

@ -689,6 +689,13 @@ foreach ($fields as $field) {
__('This field allows url insertion using the BBCode\'s url tag').'.<br />'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.<br /><br />'.__('e.g.: [url=google.com]Google web search[/url]'),
true
);
$combo = [];
$combo = $field['combo_values'];
$combo = explode(',', $combo);
$combo_values = [];
foreach ($combo as $value) {
$combo_values[$value] = $value;
}
$custom_value = db_get_value_filter('description', 'tagent_custom_data', ['id_field' => $field['id_field'], 'id_agent' => $id_agente]);
@ -714,6 +721,28 @@ foreach ($fields as $field) {
$data[1] = html_print_textarea('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
}
if ($field['combo_values'] !== '') {
$data[1] = html_print_select(
$combo_values,
'customvalue_'.$field['id_field'],
$custom_value,
'',
__('No change'),
'',
true,
false,
false,
'',
false,
false,
false,
false,
false,
'',
false
);
};
array_push($table->data, $data);
}

View File

@ -562,7 +562,7 @@ $table->data['edit1'][1] = '<table width="100%">';
'',
'',
5,
255,
1024,
true
);
$table->data['edit1'][1] .= '</td>';
@ -631,7 +631,7 @@ $table->data['edit1'][1] = '<table width="100%">';
'',
'',
5,
255,
1024,
true
);
$table->data['edit1'][3] .= '</td>';

View File

@ -190,7 +190,7 @@ $table->data[4][1] .= html_print_input_text(
$str_warning,
'',
5,
64,
1024,
true
).'</span>';
$table->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
@ -225,7 +225,7 @@ $table->data[5][1] .= html_print_input_text(
$str_critical,
'',
5,
64,
1024,
true
).'</span>';
$table->data[5][1] .= '<br /><em>'.__('Inverse interval').'</em>';

View File

@ -134,7 +134,6 @@ if (is_ajax()) {
set_unless_defined($config['double_auth_enabled'], false);
$row = [];
$row['name'] = __('Double authentication').ui_print_help_tip(__('If this option is enabled, the users can use double authentication with their accounts'), true);
$row['control'] = html_print_input_hidden('double_auth_enabled', 0);
$row['control'] .= html_print_checkbox_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
$table->data['double_auth_enabled'] = $row;

View File

@ -1,18 +1,23 @@
<?php
/**
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* 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.
// Warning: This file may be required into the metaconsole's setup
// Load global vars
global $config;
check_login();
@ -23,7 +28,7 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
return;
}
// Check custom field
// Check custom field.
$custom_field = db_get_value('name', 'tagent_custom_fields', 'name', $config['ehorus_custom_field']);
$custom_field_exists = !empty($custom_field);
$custom_field_created = null;
@ -36,7 +41,7 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) {
$custom_field_exists = $custom_field_created = $result;
}
// Enable table
// Enable table.
$table_enable = new StdClass();
$table_enable->data = [];
$table_enable->width = '100%';
@ -45,15 +50,13 @@ $table_enable->class = 'databox filters';
$table_enable->size['name'] = '30%';
$table_enable->style['name'] = 'font-weight: bold';
// Enable eHorus
// Enable eHorus.
$row = [];
$row['name'] = __('Enable eHorus');
$row['control'] = __('Enabled').'&nbsp;'.html_print_radio_button('ehorus_enabled', 1, '', $config['ehorus_enabled'], true).'&nbsp;&nbsp;';
$row['control'] .= __('Disabled').'&nbsp;'.html_print_radio_button('ehorus_enabled', 0, '', $config['ehorus_enabled'], true);
$row['button'] = html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"', true);
$row['control'] = html_print_checkbox_switch('ehorus_enabled', 1, $config['ehorus_enabled'], true);
$table_enable->data['ehorus_enabled'] = $row;
// Remote config table
// Remote config table.
$table_remote = new StdClass();
$table_remote->data = [];
$table_remote->width = '100%';
@ -63,40 +66,40 @@ $table_remote->class = 'databox filters';
$table_remote->size['name'] = '30%';
$table_remote->style['name'] = 'font-weight: bold';
// User
// User.
$row = [];
$row['name'] = __('User');
$row['control'] = html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true);
$table_remote->data['ehorus_user'] = $row;
// Pass
// Pass.
$row = [];
$row['name'] = __('Password');
$row['control'] = html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true);
$table_remote->data['ehorus_pass'] = $row;
// Directory hostname
// Directory hostname.
$row = [];
$row['name'] = __('API Hostname');
$row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true);
$row['control'] .= ui_print_help_tip(__('Hostname of the eHorus API').'. '.__('Without protocol and port').'. '.__('e.g., portal.ehorus.com'), true);
$table_remote->data['ehorus_hostname'] = $row;
// Directory port
// Directory port.
$row = [];
$row['name'] = __('API Port');
$row['control'] = html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true);
$row['control'] .= ui_print_help_tip(__('e.g., 18080'), true);
$table_remote->data['ehorus_port'] = $row;
// Request timeout
// Request timeout.
$row = [];
$row['name'] = __('Request timeout');
$row['control'] = html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true);
$row['control'] .= ui_print_help_tip(__('Time in seconds to set the maximum time of the requests to the eHorus API').'. '.__('0 to disable'), true);
$table_remote->data['ehorus_req_timeout'] = $row;
// Test
// Test.
$row = [];
$row['name'] = __('Test');
$row['control'] = html_print_button(__('Start'), 'test-ehorus', false, '', 'class="sub next"', true);
@ -106,7 +109,7 @@ $row['control'] .= '<span id="test-ehorus-failure" style="display:none;">&nbsp;'
$row['control'] .= '&nbsp;<span id="test-ehorus-message" style="display:none;"></span>';
$table_remote->data['ehorus_test'] = $row;
// Print
// Print.
echo '<div style="text-align: center; padding-bottom: 20px;">';
echo '<a target="_blank" rel="noopener noreferrer" href="http://ehorus.com">';
html_print_image('include/ehorus/images/ehorus-logo-grey.png');
@ -136,13 +139,13 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) {
ui_print_error_message($error_message);
}
// Form enable
// Form enable.
echo '<form id="form_enable" method="post">';
html_print_input_hidden('update_config', 1);
html_print_table($table_enable);
echo '</form>';
// Form remote
// Form remote.
if ($config['ehorus_enabled']) {
echo '<form id="form_remote" method="post">';
echo '<fieldset>';
@ -159,6 +162,9 @@ if ($config['ehorus_enabled']) {
?>
<script type="text/javascript">
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
$('form#form_remote').hide();
$('form#form_enable').css('margin-bottom','20px');
var showFields = function () {
$('form#form_remote').show();
}
@ -166,10 +172,17 @@ if ($config['ehorus_enabled']) {
$('form#form_remote').hide();
}
var handleEnable = function (event) {
if (event.target.value == '1') showFields();
else hideFields();
var is_checked = $('input:checkbox[name="ehorus_enabled"]').is(':checked');
if (event.target.value == '1' && is_checked) {
showFields();
$('input:checkbox[name="ehorus_enabled"]').attr('checked', false);
}
else {
hideFields();
$('input:checkbox[name="ehorus_enabled"]').attr('checked', true);
};
}
$('input:radio[name="ehorus_enabled"]').change(handleEnable);
$('input:checkbox[name="ehorus_enabled"]').change(handleEnable);
var handleTest = function (event) {
var user = $('input#text-ehorus_user').val();

View File

@ -1,17 +1,23 @@
<?php
/**
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* 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 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
global $config;
check_login();
@ -269,12 +275,10 @@ $table->data[37][0] = __('Audit log directory').ui_print_help_tip(__('Directory
$table->data[37][1] = html_print_input_text('auditdir', io_safe_output($config['auditdir']), '', 30, 100, true);
$table->data[38][0] = __('Set alias as name by default in agent creation');
$table->data[38][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('alias_as_name', 1, '', $config['alias_as_name'], true).'&nbsp;&nbsp;';
$table->data[38][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('alias_as_name', 0, '', $config['alias_as_name'], true);
$table->data[38][1] = html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true);
$table->data[39][0] = __('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true);
$table->data[39][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('unique_ip', 1, '', $config['unique_ip'], true).'&nbsp;&nbsp;';
$table->data[39][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('unique_ip', 0, '', $config['unique_ip'], true);
$table->data[39][1] = html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';

View File

@ -1,16 +1,23 @@
<?php
/**
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* 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;
require_once 'include/functions_ui.php';
@ -55,21 +62,19 @@ $table->data[5][0] = '<b>'.__('Maximum chart resolution').'</b>'.ui_print_help_t
$table->data[5][1] = html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true);
$table->data[6][0] = '<b>'.__('Disable custom live view filters').'</b>'.ui_print_help_tip(__('Disable the definition of custom filters in the live view. Only existing filters can be used.'), true);
$table->data[6][1] = __('Yes').'&nbsp;&nbsp;'.html_print_radio_button('netflow_disable_custom_lvfilters', 1, '', $config['netflow_disable_custom_lvfilters'], true).'&nbsp;&nbsp;&nbsp;';
$table->data[6][1] .= __('No').'&nbsp;&nbsp;'.html_print_radio_button('netflow_disable_custom_lvfilters', 0, '', $config['netflow_disable_custom_lvfilters'], true);
$table->data[6][1] = html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true);
$table->data[7][0] = '<b>'.__('Netflow max lifetime').'</b>'.ui_print_help_tip(__('Sets the maximum lifetime for netflow data in days.'), true);
$table->data[7][1] = html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true);
$table->data[8][0] = '<b>'.__('Name resolution for IP address').'</b>'.ui_print_help_tip(__('Resolve the IP addresses to get their hostnames.'), true);
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$table->data[8][1] = __('Yes').'&nbsp;&nbsp;'.html_print_radio_button_extended('netflow_get_ip_hostname', 1, '', $config['netflow_get_ip_hostname'], false, $onclick, '', true).'&nbsp;&nbsp;&nbsp;';
$table->data[8][1] .= __('No').'&nbsp;&nbsp;'.html_print_radio_button('netflow_get_ip_hostname', 0, '', $config['netflow_get_ip_hostname'], true);
$table->data[8][1] = html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true);
echo '<form id="netflow_setup" method="post">';
html_print_table($table);
// Update button
// Update button.
echo '<div class="action-buttons" style="width:100%;">';
html_print_input_hidden('update_config', 1);
html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"');

View File

@ -964,7 +964,7 @@ $row++;
__('Custom report front page. It will be applied to all reports and templates by default.'),
true
);
$table_other->data[$row][1] = html_print_checkbox(
$table_other->data[$row][1] = html_print_checkbox_switch(
'custom_report_front',
1,
$config['custom_report_front'],
@ -1438,12 +1438,12 @@ $(document).ready (function () {
// Juanma (06/05/2014) New feature: Custom front page for reports
var custom_report = $('#checkbox-custom_report_front')
.prop('checked');
display_custom_report_front(custom_report,$('#checkbox-custom_report_front').parent().parent().parent().parent().attr('id'));
display_custom_report_front(custom_report,$('#checkbox-custom_report_front').parent().parent().parent().parent().parent().attr('id'));
$("#checkbox-custom_report_front").click( function() {
$("#checkbox-custom_report_front").change( function() {
var custom_report = $('#checkbox-custom_report_front')
.prop('checked');
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().attr('id'));
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id'));
});
$(".databox.filters").css('margin-bottom','-10px');
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 690 B

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 669 B

After

Width:  |  Height:  |  Size: 454 B

View File

@ -54,6 +54,7 @@ $table_events = get_parameter('table_events', 0);
$total_events = (bool) get_parameter('total_events');
$total_event_graph = (bool) get_parameter('total_event_graph');
$graphic_event_group = (bool) get_parameter('graphic_event_group');
$get_table_response_command = (bool) get_parameter('get_table_response_command');
if ($get_event_name) {
$event_id = get_parameter('event_id');
@ -116,6 +117,7 @@ if ($get_response_target) {
}
echo events_get_response_target($event_id, $response_id, $server_id);
return;
}
@ -129,6 +131,7 @@ if ($get_response) {
}
echo json_encode($event_response);
return;
}
@ -136,6 +139,7 @@ if ($perform_event_response) {
global $config;
$command = get_parameter('target', '');
$response_id = get_parameter('response_id');
$event_response = db_get_row('tevent_response', 'id', $response_id);
@ -148,7 +152,11 @@ if ($perform_event_response) {
'nano',
];
$server_data = db_get_row('tserver', 'id_server', $event_response['server_to_exec']);
$server_data = db_get_row(
'tserver',
'id_server',
$event_response['server_to_exec']
);
if (in_array(strtolower($command), $commandExclusions)) {
echo 'Only stdin/stdout commands are supported';
@ -234,13 +242,29 @@ if ($dialogue_event_response) {
);
echo '</div><br>';
echo "<div id='response_loading_command_".$out_iterator."' style='display:none'>".html_print_image('images/spinner.gif', true).'</div>';
echo "<div id='response_loading_command_".$out_iterator."' style='display:none'>";
echo html_print_image(
'images/spinner.gif',
true
);
echo '</div>';
echo "<br><div id='response_out_".$out_iterator."' style='text-align:left'></div>";
if ($end) {
echo "<br><div id='re_exec_command_".$out_iterator."' style='display:none;'>";
html_print_button(__('Execute again'), 'btn_str', false, 'execute_event_response(false);', "class='sub next'");
echo "<span id='execute_again_loading' style='display:none'>".html_print_image('images/spinner.gif', true).'</span>';
html_print_button(
__('Execute again'),
'btn_str',
false,
'execute_event_response(false);',
"class='sub next'"
);
echo "<span id='execute_again_loading' style='display:none'>";
echo html_print_image(
'images/spinner.gif',
true
);
echo '</span>';
echo '</div>';
}
} else {
@ -796,3 +820,67 @@ if ($graphic_event_group) {
echo $prueba;
return;
}
if ($get_table_response_command) {
global $config;
$response_id = get_parameter('event_response_id');
$params_string = db_get_value(
'params',
'tevent_response',
'id',
$response_id
);
$params = explode(',', $params_string);
$table = new stdClass;
$table->id = 'events_responses_table_command';
$table->width = '90%';
$table->styleTable = 'text-align:center; margin: 0 auto;';
$table->style = [];
$table->style[0] = 'text-align:center;';
$table->style[1] = 'text-align:center;';
$table->head = [];
$table->head[0] = __('Parameters');
$table->head[0] .= ui_print_help_tip(
__('These commands will apply to all selected events'),
true
);
$table->head[1] = __('Value');
if (isset($params) === true
&& is_array($params) === true
) {
foreach ($params as $key => $value) {
$table->data[$key][0] = $value;
$table->data[$key][1] = html_print_input_text(
$value.'-'.$key,
'',
'',
50,
255,
true,
false,
false,
'',
'response_command_input'
);
}
}
echo '<form id="form_response_command">';
echo html_print_table($table, true);
echo '</form>';
echo html_print_submit_button(
__('Execute'),
'enter_command',
false,
'class="sub next" style="float:right; margin-top:15px; margin-right:25px;"',
true
);
return;
}

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC190306';
$build_version = 'PC190313';
$pandora_version = 'v7.0NG.732';
// Do not overwrite default timezone set if defined.

View File

@ -1828,11 +1828,11 @@ function config_process_config()
}
if (!isset($config['custom_title1_login'])) {
config_update_value('custom_title1_login', __('WELCOME TO PANDORA FMS'));
config_update_value('custom_title1_login', __('PANDORA FMS'));
}
if (!isset($config['custom_title2_login'])) {
config_update_value('custom_title2_login', __('NEXT GENERATION'));
config_update_value('custom_title2_login', __('ONE TOOL TO MONITOR THEM ALL'));
}
if (!isset($config['custom_docs_url'])) {

View File

@ -26,7 +26,7 @@
* ============================================================================
*/
require_once $config['homedir'].'/include/functions_ui.php';
require_once $config['homedir'].'/include/functions_ui.php';
require_once $config['homedir'].'/include/functions_tags.php';
require_once $config['homedir'].'/include/functions.php';
enterprise_include_once('meta/include/functions_events_meta.php');
@ -2513,9 +2513,8 @@ function events_page_custom_fields($event)
{
global $config;
//
// Custom fields.
//
$table = new stdClass;
$table->cellspacing = 2;
$table->cellpadding = 2;
$table->width = '100%';
@ -2666,9 +2665,8 @@ function events_page_details($event, $server='')
$serverstring = '';
}
//
// Details.
//
$table_details = new stdClass;
$table_details->width = '100%';
$table_details->data = [];
$table_details->head = [];
@ -3136,9 +3134,8 @@ function events_page_general($event)
global $group_rep;
//
// General.
//
$table_general = new stdClass;
$table_general->cellspacing = 2;
$table_general->cellpadding = 2;
$table_general->width = '100%';
@ -3300,11 +3297,10 @@ function events_page_general($event)
*/
function events_page_comments($event, $childrens_ids=[])
{
//
// Comments.
//
global $config;
$table_comments = new stdClass;
$table_comments->width = '100%';
$table_comments->data = [];
$table_comments->head = [];
@ -3319,7 +3315,9 @@ function events_page_comments($event, $childrens_ids=[])
$event_comments_array = json_decode($event_comments, true);
// Show the comments more recent first.
$event_comments_array = array_reverse($event_comments_array);
if (is_array($event_comments_array)) {
$event_comments_array = array_reverse($event_comments_array);
}
if (empty($event_comments_array)) {
$comments_format = 'old';
@ -3337,11 +3335,15 @@ function events_page_comments($event, $childrens_ids=[])
$table_comments->data[] = $data;
}
foreach ($event_comments_array as $c) {
$data[0] = '<b>'.$c['action'].' by '.$c['id_user'].'</b>';
$data[0] .= '<br><br><i>'.date($config['date_format'], $c['utimestamp']).'</i>';
$data[1] = $c['comment'];
$table_comments->data[] = $data;
if (isset($event_comments_array) === true
&& is_array($event_comments_array) === true
) {
foreach ($event_comments_array as $c) {
$data[0] = '<b>'.$c['action'].' by '.$c['id_user'].'</b>';
$data[0] .= '<br><br><i>'.date($config['date_format'], $c['utimestamp']).'</i>';
$data[1] = $c['comment'];
$table_comments->data[] = $data;
}
}
break;

View File

@ -121,13 +121,13 @@ if (!function_exists('mime_content_type')) {
global $config;
if (isset($config['homedir_filemanager'])) {
$homedir_filemanager = io_safe_output($config['homedir_filemanager']);
$homedir_filemanager = trim(io_safe_output($config['homedir_filemanager']));
} else {
$homedir_filemanager = $config['homedir'];
$homedir_filemanager = trim($config['homedir']);
}
$sec2 = get_parameter('sec2');
if ($sec2 == 'enterprise/godmode/agentes/collections') {
if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') {
$homedir_filemanager .= '/attachment/collection/';
}

View File

@ -506,8 +506,6 @@ function menu_add_extras(&$menu)
$menu_extra['workspace']['sub']['operation/incidents/incident_detail']['text'] = __('Manage incident');
$menu_extra['reporting']['sub']['godmode/reporting/visual_console_builder']['text'] = __('Manage visual console');
// Duplicate extensions as sec=extension to check it from url
foreach ($menu as $k => $m) {
if (!isset($m['sub'])) {
@ -645,6 +643,7 @@ function menu_get_sec_pages($sec, $menu_hash=false)
/**
* Get the pages in a section2
* $menu
*
* @param string sec code
* @param string menu hash. All the menu structure (For example

View File

@ -1441,18 +1441,21 @@ function clean_duplicate_links($relations)
}
$final_links = [];
/*
---------------------------------------------------------------- */
/*
--------------------- Clean duplicate links -------------------- */
// ----------------------------------------------------------------
// --------------------- Clean duplicate links --------------------
// ----------------------------------------------------------------
$duplicated = false;
$index_to_del = 0;
$index = 0;
if (is_array($segregation_links['aa'])) {
if (isset($segregation_links['aa']) === true
&& is_array($segregation_links['aa']) === true
) {
foreach ($segregation_links['aa'] as $link) {
foreach ($segregation_links['aa'] as $link2) {
if ($link['id_parent'] == $link2['id_child'] && $link['id_child'] == $link2['id_parent']) {
if ($link['id_parent'] == $link2['id_child']
&& $link['id_child'] == $link2['id_parent']
) {
if (enterprise_installed()) {
delete_link($segregation_links['aa'][$index_to_del]);
}
@ -1474,15 +1477,17 @@ function clean_duplicate_links($relations)
$duplicated = false;
$index_to_del = 0;
$index2 = 0;
if (is_array($segregation_links['mm'])) {
if (isset($segregation_links['mm']) === true
&& is_array($segregation_links['mm']) === true
) {
foreach ($segregation_links['mm'] as $link) {
foreach ($segregation_links['mm'] as $link2) {
if ($link['id_parent'] == $link2['id_child'] && $link['id_child'] == $link2['id_parent']) {
if ($link['id_parent'] == $link2['id_child']
&& $link['id_child'] == $link2['id_parent']
) {
if (enterprise_installed()) {
delete_link($segregation_links['mm'][$index_to_del]);
}
// unset($segregation_links['mm'][$index_to_del]);
}
$index_to_del++;
@ -1499,10 +1504,15 @@ function clean_duplicate_links($relations)
$duplicated = false;
$index_to_del = 0;
$index3 = 0;
if (is_array($segregation_links['ff'])) {
if (isset($segregation_links['ff']) === true
&& is_array($segregation_links['ff']) === true
) {
foreach ($segregation_links['ff'] as $link) {
foreach ($segregation_links['ff'] as $link2) {
if ($link['id_parent'] == $link2['id_child'] && $link['id_child'] == $link2['id_parent']) {
if ($link['id_parent'] == $link2['id_child']
&& $link['id_child'] == $link2['id_parent']
) {
if (enterprise_installed()) {
delete_link($segregation_links['ff'][$index_to_del]);
}
@ -1524,24 +1534,24 @@ function clean_duplicate_links($relations)
$final_links['am'] = $segregation_links['am'];
/*
---------------------------------------------------------------- */
/*
----------------- AA, AM and MM links management --------------- */
/*
------------------ Priority: ----------------------------------- */
/*
-------------------- 1 -> MM (module - module) ----------------- */
/*
-------------------- 2 -> AM (agent - module) ------------------ */
/*
-------------------- 3 -> AA (agent - agent) ------------------- */
// ----------------------------------------------------------------
----------------------------------------------------------------
----------------- AA, AM and MM links management ---------------
------------------ Priority: -----------------------------------
-------------------- 1 -> MM (module - module) -----------------
-------------------- 2 -> AM (agent - module) ------------------
-------------------- 3 -> AA (agent - agent) -------------------
----------------------------------------------------------------
*/
$final_links2 = [];
$index = 0;
$l3_link = [];
$agent1 = 0;
$agent2 = 0;
if (is_array($segregation_links['mm'])) {
if (isset($final_links['mm']) === true
&& is_array($final_links['mm']) === true
) {
foreach ($final_links['mm'] as $rel_mm) {
$module_parent = $rel_mm['id_parent_source_data'];
$module_children = $rel_mm['id_child_source_data'];
@ -1551,8 +1561,10 @@ function clean_duplicate_links($relations)
$l3_link = $rel_aa;
$id_p_source_data = (int) $rel_aa['id_parent_source_data'];
$id_c_source_data = (int) $rel_aa['id_child_source_data'];
if ((($id_p_source_data == $agent1) && ($id_c_source_data == $agent2))
|| (($id_p_source_data == $agent2) && ($id_c_source_data == $agent1))
if ((($id_p_source_data == $agent1)
&& ($id_c_source_data == $agent2))
|| (($id_p_source_data == $agent2)
&& ($id_c_source_data == $agent1))
) {
if (enterprise_installed()) {
delete_link($final_links['aa'][$key]);
@ -1571,7 +1583,9 @@ function clean_duplicate_links($relations)
$same_m = [];
$index = 0;
if (is_array($final_links2['am'])) {
if (isset($final_links2['am']) === true
&& is_array($final_links2['am']) === true
) {
foreach ($final_links2['am'] as $rel_am) {
foreach ($final_links2['am'] as $rel_am2) {
if (($rel_am['id_child_source_data'] == $rel_am2['id_child_source_data'])
@ -1589,7 +1603,9 @@ function clean_duplicate_links($relations)
$index = 0;
$l3_link = [];
$have_l3 = false;
if (is_array($final_links2['aa'])) {
if (isset($final_links2['aa']) === true
&& is_array($final_links2['aa']) === true
) {
foreach ($final_links2['aa'] as $key => $rel_aa) {
$l3_link = $rel_aa;
foreach ($same_m as $rel_am) {
@ -1614,25 +1630,33 @@ function clean_duplicate_links($relations)
$final_links3['ff'] = $final_links2['ff'];
$cleaned_links = [];
if (is_array($final_links3['aa'])) {
if (isset($final_links3['aa']) === true
&& is_array($final_links3['aa']) === true
) {
foreach ($final_links3['aa'] as $link) {
$cleaned_links[] = $link;
}
}
if (is_array($final_links3['am'])) {
if (isset($final_links3['am']) === true
&& is_array($final_links3['am']) === true
) {
foreach ($final_links3['am'] as $link) {
$cleaned_links[] = $link;
}
}
if (is_array($final_links3['mm'])) {
if (isset($final_links3['mm']) === true
&& is_array($final_links3['mm']) === true
) {
foreach ($final_links3['mm'] as $link) {
$cleaned_links[] = $link;
}
}
if (is_array($final_links3['ff'])) {
if (isset($final_links3['ff']) === true
&& is_array($final_links3['ff']) === true
) {
foreach ($final_links3['ff'] as $link) {
$cleaned_links[] = $link;
}
@ -1788,7 +1812,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
init_drag_and_drop();
init_minimap();
function_open_minimap();
$(document.body).on("mouseleave",
".context-menu-list",
function(e) {
@ -1815,7 +1839,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
<div id="dialog_node_edit" style="display: none;" title="<?php echo __('Edit node'); ?>">
<div style="text-align: left; width: 100%;">
<?php
$table = null;
$table = new stdClass();
$table->id = 'node_details';
$table->width = '100%';
@ -1836,7 +1860,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
false
);
$table = null;
$table = new stdClass();
$table->id = 'interface_information';
$table->width = '100%';
@ -1860,7 +1884,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
true
);
$table = null;
$table = new stdClass();
$table->id = 'node_options';
$table->width = '100%';
@ -1878,7 +1902,24 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
'',
0,
true
).'&nbsp;'.'<span id="shape_icon_in_progress" style="display: none;">'.html_print_image('images/spinner.gif', true).'</span>'.'<span id="shape_icon_correct" style="display: none;">'.html_print_image('images/dot_green.png', true).'</span>'.'<span id="shape_icon_fail" style="display: none;">'.html_print_image('images/dot_red.png', true).'</span>';
);
$table->data[0][1] .= '&nbsp;<span id="shape_icon_in_progress" style="display: none;">';
$table->data[0][1] .= html_print_image(
'images/spinner.gif',
true
);
$table->data[0][1] .= '</span><span id="shape_icon_correct" style="display: none;">';
$table->data[0][1] .= html_print_image(
'images/dot_green.png',
true
);
$table->data[0][1] .= '</span><span id="shape_icon_fail" style="display: none;">';
$table->data[0][1] .= html_print_image(
'images/dot_red.png',
true
);
$table->data[0][1] .= '</span>';
$table->data['node_name'][0] = __('Name');
$table->data['node_name'][1] = html_print_input_text(
'edit_name_node',
@ -1933,7 +1974,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
true
);
$table = null;
$table = new stdClass();
$table->id = 'relations_table';
$table->width = '100%';
@ -2048,7 +2089,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
<div id="dialog_node_add" style="display: none;" title="<?php echo __('Add node'); ?>">
<div style="text-align: left; width: 100%;">
<?php
$table = null;
$table = new stdClass();
$table->width = '100%';
$table->data = [];
@ -2091,7 +2132,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
false
);
$table = null;
$table = new stdClass();
$table->width = '100%';
$table->data = [];
$table->data[0][0] = __('Group');
@ -2141,7 +2182,7 @@ function show_networkmap($id=0, $user_readonly=false, $nodes_and_relations=[], $
true
);
$table = null;
$table = new stdClass();
$table->width = '100%';
$table->data = [];
$table->data[0][0] = __('Name');

File diff suppressed because it is too large Load Diff

View File

@ -1026,16 +1026,14 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
array_push($table1->data, $data);
if ($show_extended_events == 1 && events_has_extended_info($event['id_evento'])) {
$extended_events = events_get_extended_events($event['id_evento']);
foreach ($extended_events as $extended_event) {
$extended_data = [];
$extended_data[] = "<td colspan='5'><font style='font-style: italic;'>".io_safe_output($extended_event['description'])."</font></td><td><font style='font-size: 6pt; font-style: italic;'>".date($config['date_format'], $extended_event['utimestamp'])."</font></td>";
$extended_data[] = "<td colspan='5'><font style='font-style: italic;'>".io_safe_output($extended_event['description'])."</font></td><td><font style='font-size: 6pt; font-style: italic;'>".date($config['date_format'], $extended_event['utimestamp']).'</font></td>';
array_push($table1->data, $extended_data);
}
}
}
@ -1234,16 +1232,14 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$table1->data[] = $data;
if ($show_extended_events == 1 && events_has_extended_info($event['id_evento'])) {
$extended_events = events_get_extended_events($event['id_evento']);
foreach ($extended_events as $extended_event) {
$extended_data = [];
$extended_data[] = "<td colspan='3'><font style='font-style: italic;'>".io_safe_output($extended_event['description'])."</font></td><td><font style='font-style: italic;'>".date($config['date_format'], $extended_event['utimestamp'])."</font></td>";
$extended_data[] = "<td colspan='3'><font style='font-style: italic;'>".io_safe_output($extended_event['description'])."</font></td><td><font style='font-style: italic;'>".date($config['date_format'], $extended_event['utimestamp']).'</font></td>';
array_push($table1->data, $extended_data);
}
}
}
}
@ -2025,16 +2021,14 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
array_push($table1->data, $data);
if ($show_extended_events == 1 && events_has_extended_info($event['id_evento'])) {
$extended_events = events_get_extended_events($event['id_evento']);
foreach ($extended_events as $extended_event) {
$extended_data = [];
$extended_data[] = "<td colspan='4'><font style='font-style: italic;'>".io_safe_output($extended_event['description'])."</font></td><td><font style='font-size: 6pt; font-style: italic;'>".date($config['date_format'], $extended_event['utimestamp'])."</font></td>";
$extended_data[] = "<td colspan='4'><font style='font-style: italic;'>".io_safe_output($extended_event['description'])."</font></td><td><font style='font-size: 6pt; font-style: italic;'>".date($config['date_format'], $extended_event['utimestamp']).'</font></td>';
array_push($table1->data, $extended_data);
}
}
}
@ -4578,7 +4572,7 @@ function reporting_get_event_histogram($events, $text_header_event=false)
[],
true,
$ttl,
false,
true,
false
);
@ -4799,7 +4793,10 @@ function reporting_html_planned_downtimes_table($planned_downtimes)
$table = new StdClass();
$table->width = '99%';
$table->title = __('This SLA has been affected by the following planned downtimes');
$table->title = __('This SLA has been affected by the following planned downtimes').ui_print_help_tip(
__('If the duration of the planned downtime is less than 5 minutes it will not be represented in the graph'),
true
);
$table->head = [];
$table->head[0] = __('Name');
$table->head[1] = __('Description');

View File

@ -1,21 +1,41 @@
<?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @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) 2013 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.
require_once $config['homedir'].'/include/functions_config.php';
enterprise_include_once($config['homedir'].'/enterprise/include/pdf_translator.php');
enterprise_include_once($config['homedir'].'/enterprise/include/functions_metaconsole.php');
enterprise_include_once(
$config['homedir'].'/enterprise/include/pdf_translator.php'
);
enterprise_include_once(
$config['homedir'].'/enterprise/include/functions_metaconsole.php'
);
// Date format for nfdump
// Date format for nfdump.
global $nfdump_date_format;
$nfdump_date_format = 'Y/m/d.H:i:s';
@ -27,16 +47,23 @@ $nfdump_date_format = 'Y/m/d.H:i:s';
* @param id string Level ID. Do not set, used for recursion.
* @param depth string Branch depth. Do not set, used for recursion.
*/
function snmp_browser_print_tree($tree, $id=0, $depth=0, $last=0, $last_array=[], $sufix=false, $checked=[])
{
function snmp_browser_print_tree(
$tree,
$id=0,
$depth=0,
$last=0,
$last_array=[],
$sufix=false,
$checked=[]
) {
static $url = false;
// Get the base URL for images
// Get the base URL for images.
if ($url === false) {
$url = ui_get_full_url('operation/tree', false, false, false);
}
// Leaf
// Leaf.
if (empty($tree['__LEAVES__'])) {
return;
}
@ -134,8 +161,19 @@ function snmp_browser_print_tree($tree, $id=0, $depth=0, $last=0, $last_array=[]
*
* @return array The SNMP tree.
*/
function snmp_browser_get_tree($target_ip, $community, $starting_oid='.', $version='2c', $snmp3_auth_user='', $snmp3_security_level='', $snmp3_auth_method='', $snmp3_auth_pass='', $snmp3_privacy_method='', $snmp3_privacy_pass='', $server_to_exec=0)
{
function snmp_browser_get_tree(
$target_ip,
$community,
$starting_oid='.',
$version='2c',
$snmp3_auth_user='',
$snmp3_security_level='',
$snmp3_auth_method='',
$snmp3_auth_pass='',
$snmp3_privacy_method='',
$snmp3_privacy_pass='',
$server_to_exec=0
) {
global $config;
if ($target_ip == '') {
@ -303,14 +341,33 @@ function snmp_browser_get_tree($target_ip, $community, $starting_oid='.', $versi
/**
* Retrieve data for the specified OID.
*
* @param target_ip string IP of the SNMP agent.
* @param community string SNMP community to use.
* @param target_oid SNMP OID to query.
* @param string $target_ip IP of the SNMP agent.
* @param string $community SNMP community to use.
* @param string $target_oid SNMP OID to query.
* @param string $version Version SNMP.
* @param string $snmp3_auth_user User snmp3.
* @param string $snmp3_security_level Security level snmp3.
* @param string $snmp3_auth_method Method snmp3.
* @param string $snmp3_auth_pass Pass snmp3.
* @param string $snmp3_privacy_method Privicy method snmp3.
* @param string $snmp3_privacy_pass Pass Method snmp3.
* @param integer $server_to_exec Execute with other server.
*
* @return array OID data.
* @return mixed OID data.
*/
function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c', $snmp3_auth_user='', $snmp3_security_level='', $snmp3_auth_method='', $snmp3_auth_pass='', $snmp3_privacy_method='', $snmp3_privacy_pass='')
{
function snmp_browser_get_oid(
$target_ip,
$community,
$target_oid,
$version='2c',
$snmp3_auth_user='',
$snmp3_security_level='',
$snmp3_auth_method='',
$snmp3_auth_pass='',
$snmp3_privacy_method='',
$snmp3_privacy_pass='',
$server_to_exec=0
) {
global $config;
if ($target_oid == '') {
@ -348,10 +405,38 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c'
break;
}
if ($version == '3') {
exec($snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, $output, $rc);
if ($server_to_exec != 0) {
$sql = sprintf(
'SELECT ip_address FROM tserver WHERE id_server = %d',
$server_to_exec
);
$server_data = db_get_row_sql($sql);
if ($version == '3') {
$command = $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir;
} else {
$command = $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir;
}
exec(
'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"',
$output,
$rc
);
} else {
exec($snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, $output, $rc);
if ($version == '3') {
exec(
$snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir,
$output,
$rc
);
} else {
exec(
$snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir,
$output,
$rc
);
}
}
if ($rc != 0) {
@ -359,7 +444,7 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c'
}
foreach ($output as $line) {
// Separate the OID from the value
// Separate the OID from the value.
$full_oid = explode('=', $line);
if (! isset($full_oid[1])) {
break;
@ -368,7 +453,7 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c'
$oid = trim($full_oid[0]);
$oid_data['numeric_oid'] = $oid;
// Translate the OID
// Translate the OID.
if (empty($config['snmptranslate'])) {
switch (PHP_OS) {
case 'FreeBSD':
@ -387,10 +472,20 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c'
$snmptranslate_bin = $config['snmptranslate'];
}
exec(
$snmptranslate_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Td '.escapeshellarg($oid),
$translate_output
);
if ($server_to_exec != 0) {
$command_output = $snmptranslate_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Td '.escapeshellarg($oid);
exec(
'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command_output.'"',
$translate_output,
$rc
);
} else {
exec(
$snmptranslate_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Td '.escapeshellarg($oid),
$translate_output
);
}
foreach ($translate_output as $line) {
if (preg_match('/SYNTAX\s+(.*)/', $line, $matches) == 1) {
$oid_data['syntax'] = $matches[1];
@ -403,7 +498,7 @@ function snmp_browser_get_oid($target_ip, $community, $target_oid, $version='2c'
}
}
// Parse the description. First search for it in custom values
// Parse the description. First search for it in custom values.
$custom_data = db_get_row('ttrap_custom_values', 'oid', $oid);
if ($custom_data === false) {
$translate_output = implode('', $translate_output);

View File

@ -476,7 +476,7 @@ function visual_map_print_item(
}
} else if ($is_a_link_to_other_visualconsole) {
if (!is_metaconsole()) {
$url = $config['homeurl'].'index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
$url = $config['homeurl'].'index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
} else {
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$layoutData['id_layout_linked'].'&refr=0';
}
@ -567,7 +567,7 @@ function visual_map_print_item(
if (METACONSOLE == 1) {
$url = $config['homeurl'].'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$layoutData['id_layout_linked'].'&refr=300';
} else {
$url = $config['homeurl'].'index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
$url = $config['homeurl'].'index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
}
} else {
if (METACONSOLE == 1) {
@ -581,7 +581,7 @@ function visual_map_print_item(
case LABEL:
if ($layoutData['id_layout_linked'] != 0) {
// Link to a map
$url = $config['homeurl'].'index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
$url = $config['homeurl'].'index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
}
break;
@ -590,7 +590,7 @@ function visual_map_print_item(
if ($layoutData['id_layout_linked'] != 0) {
// Link to a map
if (empty($layoutData['id_metaconsole'])) {
$url = 'index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
$url = 'index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
} else {
$pure = get_parameter('pure', 0);
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_visualmap='.$layoutData['id_layout_linked'].'&refr=0';
@ -638,7 +638,7 @@ function visual_map_print_item(
} else if ($layoutData['id_layout_linked'] > 0) {
// Link to a map
if (empty($layoutData['id_metaconsole'])) {
$url = 'index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
$url = 'index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;pure='.$config['pure'].'&amp;id='.$layoutData['id_layout_linked'];
} else {
$pure = get_parameter('pure', 0);
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_visualmap='.$layoutData['id_layout_linked'].'&refr=0';

View File

@ -748,7 +748,7 @@ function flot_slicesbar_graph(
if ($widgets) {
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'px; height: '.$height."px;'></div>";
} else {
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'px; height: '.$height."px;'></div>";
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'%; height: '.$height."px;'></div>";
}
}

View File

@ -52,6 +52,7 @@ Apart from the defined module macros, the following macros are also available:
<li>_event_extra_id_ : (Only event alerts) Extra id.</li>
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
<li>_event_text_severity_: (Only event alerts) Event text severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
<li>_field1_: User defined field 1.</li>
<li>_field2_: User defined field 2.</li>
<li>_field3_: User defined field 3.</li>

View File

@ -37,6 +37,7 @@ Besides the defined module macros, the following macros are available:
<li>_event_extra_id_: (Only event alerts) Extra id.</li>
<li>_event_id_: (Only event alerts) ID of the event that triggered the alert.</li>
<li>_event_text_severity_: (Only event alerts) Event text severity (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
<li>_field1_: User defined field 1.</li>
<li>_field2_: User defined field 2.</li>
<li>_field3_: User defined field 3.</li>

View File

@ -54,6 +54,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
<li>_event_extra_id_ : (Solo alertas de evento) Id extra.</li>
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_event_text_severity_: (Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_eventTimestamp_: Timestamp en el que se creo el evento.</li>
<li>_field1_: Campo 1 definido por el usuario.</li>
<li>_field2_: Campo 2 definido por el usuario.</li>
<li>_field3_: Campo 3 definido por el usuario.</li>

View File

@ -37,6 +37,7 @@ Además de las macros de módulo definidas, las siguientes macros están disponi
<li>_event_extra_id_ : (Solo alertas de evento) Id extra.</li>
<li>_event_id_: (Solo alertas de evento) Id del evento que disparó la alerta.</li>
<li>_event_text_severity_:(Solo alertas de evento) Prioridad en texto de el evento que dispara la alerta (Maintenance, Informational, Normal Minor, Warning, Major, Critical).</li>
<li>_eventTimestamp_: Timestamp en el que se creo el evento.</li>
<li>_field1_: Campo 1 definido por el usuario.</li>
<li>_field2_: Campo 2 definido por el usuario.</li>
<li>_field3_: Campo 3 definido por el usuario.</li>

View File

@ -53,6 +53,7 @@ email アクションを設定するには、_field1_ (送信先アドレス)、
<li>_event_extra_id_: (イベントアラートのみ) 拡張 ID</li>
<li>_event_id_ : (イベントアラートのみ) アラート発生元のイベントID</li>
<li>_event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
<li>_field1_ : ユーザ定義フィールド1</li>
<li>_field2_ : ユーザ定義フィールド2</li>
<li>_field3_ : ユーザ定義フィールド3</li>

View File

@ -37,6 +37,7 @@
<li>_event_extra_id_: (Only event alerts) Extra id.</li>
<li>_event_id_ : (イベントアラートのみ) アラート発生元のイベントID</li>
<li>_event_text_severity_ : (イベントアラートのみ) イベント(アラートの発生元)のテキストでの重要度 (Maintenance, Informational, Normal Minor, Warning, Major, Critical)</li>
<li>_eventTimestamp_: Timestamp in which the event was created.</li>
<li>_field1_ : ユーザ定義フィールド1</li>
<li>_field2_ : ユーザ定義フィールド2</li>
<li>_field3_ : ユーザ定義フィールド3</li>

View File

@ -241,6 +241,7 @@ function show_massive_response_dialog(
},
close: function(event, ui) {
$(".chk_val").prop("checked", false);
$("#event_response_command_window").dialog("close");
},
width: response["modal_width"],
height: response["modal_height"]
@ -375,7 +376,12 @@ function add_row_param(id_table, param) {
}
// Get an event response from db
function get_response_target(event_id, response_id, server_id) {
function get_response_target(
event_id,
response_id,
server_id,
response_command
) {
var ajax_file = $("#hidden-ajax_file").val();
var target = "";
@ -400,15 +406,21 @@ function get_response_target(event_id, response_id, server_id) {
}
});
// Replace the custom params macros
// Replace the custom params macros.
var response_params = get_response_params(response_id);
if (response_params.length > 1 || response_params[0] != "") {
for (i = 0; i < response_params.length; i++) {
target = target.replace(
"_" + response_params[i] + "_",
$("#" + response_params[i]).val()
);
if (!response_command) {
target = target.replace(
"_" + response_params[i] + "_",
$("#" + response_params[i]).val()
);
} else {
target = target.replace(
"_" + response_params[i] + "_",
response_command[response_params[i] + "-" + i]
);
}
}
}
@ -459,10 +471,6 @@ function perform_response_massive(target, response_id, out_iterator) {
$("#response_loading_command_" + out_iterator).show();
$("#response_out_" + out_iterator).html("");
var finished = 0;
var time = Math.round(+new Date() / 1000);
var timeout = time + 10;
var params = [];
params.push("page=include/ajax/events");
params.push("perform_event_response=1");
@ -487,7 +495,7 @@ function perform_response_massive(target, response_id, out_iterator) {
return false;
}
// Change the status of an event to new, in process or validated
// Change the status of an event to new, in process or validated.
function event_change_status(event_ids) {
var ajax_file = $("#hidden-ajax_file").val();
@ -681,3 +689,53 @@ function show_events_group_agent(id_insert, id_agent, server_id) {
}
});
}
function show_event_response_command_dialog(id, response, total_checked) {
var ajax_file = $("#hidden-ajax_file").val();
var params = [];
params.push("page=include/ajax/events");
params.push("get_table_response_command=1");
params.push("event_response_id=" + id);
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
dataType: "html",
success: function(data) {
$("#event_response_command_window")
.hide()
.empty()
.append(data)
.dialog({
resizable: true,
draggable: true,
modal: false,
open: function() {
$("#response_loading_dialog").hide();
$("#button-submit_event_response").show();
},
width: 600,
height: 300
})
.show();
$("#submit-enter_command").on("click", function(e) {
e.preventDefault();
var response_command = [];
$(".response_command_input").each(function() {
response_command[$(this).attr("name")] = $(this).val();
});
check_massive_response_event(
id,
response,
total_checked,
response_command
);
});
}
});
}

View File

@ -164,6 +164,7 @@ function snmpGet(oid) {
var snmp3_privacy_method = $("#snmp3_browser_privacy_method").val();
var snmp3_privacy_pass = $("#password-snmp3_browser_privacy_pass").val();
var ajax_url = $("#hidden-ajax_url").val();
var server_to_exec = $("#server_to_exec").val();
// Check for a custom action
var custom_action = $("#hidden-custom_action").val();
@ -183,6 +184,7 @@ function snmpGet(oid) {
"snmp3_browser_auth_pass=" + snmp3_auth_pass,
"snmp3_browser_privacy_method=" + snmp3_privacy_method,
"snmp3_browser_privacy_pass=" + snmp3_privacy_pass,
"server_to_exec=" + server_to_exec,
"action=" + "snmpget",
"custom_action=" + custom_action,
"page=operation/snmpconsole/snmp_browser"

View File

@ -29,41 +29,11 @@ div#error_buttons a {
width: 100%;
z-index: -9999;
position: absolute;
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
background: linear-gradient(74deg, #02020255 36%, transparent 36%),
url("../../images/backgrounds/background_pandora_console_keys.jpg");
background-repeat: repeat;
}
/*@media screen and (max-width: 1024px) { /* Specific to this particular image */
/* #login_body {
left: 50%;
margin-left: -512px; /* 50% */
/* }
}
@media screen and (max-width: 1100px) { /* Specific to this particular image */
/* #login_body {
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
background-repeat: repeat;
}
}
@media screen and (max-width: 1400px) { /* Specific to this particular image */
/* #login_body {
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
background-repeat: repeat;
}
}
@media screen and (max-width: 2000px) { /* Specific to this particular image */
/* #login_body {
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
background-repeat: repeat;
}
}
@media screen and (min-width: 2000px) { /* Specific to this particular image */
/* #login_body {
background-image: url("../../images/backgrounds/background_pandora_console_keys.jpg");
background-repeat: repeat;
}
}*/
p.log_in {
color: #fff !important;
padding: 0px 10px;
@ -77,7 +47,6 @@ h1#log_f {
}
div#error_login {
text-align: center;
margin-top: 5px;
margin-left: 5px;
width: 75%;
@ -104,8 +73,11 @@ div#login_f {
width: 100%;
position: absolute;
bottom: 10px;
color: #fff;
color: #878787;
text-align: center;
font-family: "Open Sans", sans-serif;
font-weight: 700;
font-size: 8.5pt;
}
/*
@ -118,23 +90,17 @@ div#login_f {
div#header_login {
width: 100%;
height: 65px;
background-color: rgba(255, 255, 255, 0.06);
}
div#icon_custom_pandora {
float: left;
margin-top: 5px;
margin-left: 4%;
}
div#list_icon_docs_support {
float: right;
margin-top: 8px;
margin-right: 4%;
float: left;
margin-top: 25px;
margin-left: 5%;
}
div#list_icon_docs_support ul {
margin-top: 5px;
line-height: 36px;
}
div#list_icon_docs_support ul li {
@ -145,6 +111,11 @@ div#list_icon_docs_support ul li {
font-size: 10pt;
}
div#list_icon_docs_support ul li a {
color: #979797;
font-size: 10pt;
}
li#li_margin_left {
margin-left: 30px;
}
@ -162,14 +133,6 @@ div.login_page {
float: left;
}
div.login_page form {
border-right: 1px solid #868686;
padding-top: 30px;
padding-bottom: 50px;
min-width: 400px;
max-height: 600px;
}
div.login_logo_icon {
margin-bottom: 40px;
text-align: center;
@ -177,7 +140,7 @@ div.login_logo_icon {
div.login_logo_icon img {
margin: 0 auto;
width: 150px;
max-width: 70%;
}
div.login_double_auth_code,
@ -186,27 +149,36 @@ div.login_pass {
margin: 0 auto;
width: 70%;
height: 40px;
background-color: rgba(255, 255, 255, 0.2) !important;
margin-bottom: 25px;
min-width: 260px;
background-color: #fff;
opacity: 0.77;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
div.login_nick img,
div.login_pass img {
vertical-align: middle;
margin: 3px;
div.login_nick input {
background-image: url("../../images/usuario_login.png");
}
div.login_pass input {
background-image: url("../../images/candado_login.png");
}
div.login_nick input,
div.login_pass input {
background-color: rgba(255, 255, 255, 0) !important;
border: 0px !important;
color: white !important;
border-radius: 0px;
width: 89%;
color: #343434;
border-radius: 3px;
width: 100%;
height: 40px;
font-size: 9pt;
padding: 0px !important;
font-size: 10pt;
padding: 0px 0px 0px 35px !important;
background-repeat: no-repeat;
background-size: 27px;
background-position: left center;
font-family: "Open Sans", sans-serif;
box-sizing: border-box;
}
div.login_nick input:focus,
@ -224,46 +196,76 @@ div.login_pass input:-webkit-autofill:focus,
div.login_pass input:-webkit-autofill:active {
transition: background-color 10000s ease-in-out 0s;
-webkit-box-shadow: 0 0 0px 0px transparent inset !important;
-webkit-text-fill-color: white !important;
-webkit-text-fill-color: #343434 !important;
border: 0px;
width: 89%;
}
div.login_nick input::-webkit-input-placeholder,
div.login_pass input::-webkit-input-placeholder {
color: white;
color: #343434;
}
div.login_pass img,
div.login_nick img {
width: 30px;
}
div.login_pass div,
div.login_nick div {
float: left;
width: 11%;
}
div.login_button {
div.login_button,
div.login_button_saml {
margin: 0 auto;
width: 70%;
width: 40%;
height: 40px;
background-color: rgb(25, 25, 25);
border: 1px solid white;
min-width: 260px;
margin-bottom: 20px;
}
div.login_button input {
width: 100%;
background-color: rgb(25, 25, 25) !important;
background-color: #82b92e !important;
text-align: center;
border: 0px;
border-radius: 0px;
height: 40px;
padding: 0px;
font-size: 9pt;
color: white;
font-size: 11pt;
color: #fff !important;
border: 1px solid #82b92e;
border-radius: 3px;
}
div.login_button_saml input {
border: 1px solid #fff;
background-color: #fff !important;
color: #000 !important;
background-image: url("../../images/saml_login.png");
background-repeat: no-repeat;
background-position: right 5% center;
}
div.login_button input:hover {
background-color: #fff !important;
color: #000 !important;
border: 1px solid #fff !important;
}
div.login_button_saml input:hover {
background-image: url("../../images/saml_login_hover.png");
background-color: transparent !important;
color: #fff !important;
border: 1px solid #fff !important;
}
#remove_button input {
background-image: url("../../images/user_login.png") !important;
background-repeat: no-repeat;
background-position: right 5% center;
}
#remove_button input:hover {
background-image: url("../../images/user_login_hover.png") !important;
}
.login_back input {
background-image: url("../../images/back_login.png") !important;
background-position: left 5% center !important;
}
.login_back input:hover {
background-image: url("../../images/back_login_hover.png") !important;
}
div.login_data {
@ -307,6 +309,21 @@ div.img_banner_login img {
min-height: 50%;
}
.reset_password {
width: 70%;
height: 40px;
margin-right: auto;
margin-left: auto;
margin-top: 20px;
text-align: center;
}
.reset_password a {
color: #ddd !important;
font-family: "Open Sans", sans-serif;
font-size: 8.5pt;
}
@media all and (max-width: 1200px) {
span.span1 {
font-size: 30pt;

View File

@ -128,8 +128,8 @@
</div>
<div style='height: 10px'>
<?php
$version = '7.0NG.732';
$build = '190306';
$version = '7.0NG.732';
$build = '190313';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -1,18 +1,35 @@
<?php
// ______ __ _______ _______ _______
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
//
// ============================================================================
// Copyright (c) 2007-2010 Artica Soluciones Tecnologicas, http://www.artica.es
// This code is NOT free software. This code is NOT licenced under GPL2 licence
// You cannnot redistribute it without written permission of copyright holder.
// ============================================================================
// Load global variables
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @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.
* ============================================================================
*/
global $config;
// Check user credentials
// Check user credentials.
check_login();
$id = (int) get_parameter('id_networkmap', 0);
@ -63,8 +80,7 @@ if ($edit_networkmap) {
} else {
$id_group = $values['id_group'];
// ACL for the network map
// $networkmap_read = check_acl ($config['id_user'], $id_group, "MR");
// ACL for the network map.
$networkmap_write = check_acl($config['id_user'], $id_group, 'MW');
$networkmap_manage = check_acl($config['id_user'], $id_group, 'MM');
@ -221,7 +237,7 @@ if (!empty($result)) {
if ($not_found) {
ui_print_error_message(__('Not found networkmap.'));
} else {
$table = null;
$table = new stdClass();
$table->id = 'form_editor';
$table->width = '98%';

View File

@ -1,15 +1,32 @@
<?php
// ______ __ _______ _______ _______
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
//
// ============================================================================
// Copyright (c) 2007-2010 Artica Soluciones Tecnologicas, http://www.artica.es
// This code is NOT free software. This code is NOT licenced under GPL2 licence
// You cannnot redistribute it without written permission of copyright holder.
// ============================================================================
// Load global variables
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @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.
* ============================================================================
*/
global $config;
require_once 'include/functions_pandora_networkmap.php';
@ -19,9 +36,9 @@ require_once 'include/functions_modules.php';
$public_hash = get_parameter('hash', false);
// Try to authenticate by hash on public dashboards
// Try to authenticate by hash on public dashboards.
if ($public_hash === false) {
// Login check
// Login check.
check_login();
} else {
$validate_hash = enterprise_hook(
@ -33,7 +50,10 @@ if ($public_hash === false) {
]
);
if ($validate_hash === false || $validate_hash === ENTERPRISE_NOT_HOOK) {
db_pandora_audit('Invalid public hash', 'Trying to access report builder');
db_pandora_audit(
'Invalid public hash',
'Trying to access report builder'
);
include 'general/noaccess.php';
exit;
}
@ -117,7 +137,7 @@ if (is_ajax()) {
);
$row['style'] = json_decode($row['style'], true);
$row['style']['shape'] = $shape;
// WORK AROUND FOR THE JSON ENCODE WITH FOR EXAMPLE Ñ OR Á
// WORK AROUND FOR THE JSON ENCODE WITH FOR EXAMPLE Ñ OR Á.
$row['style']['label'] = 'json_encode_crash_with_ut8_chars';
$row['style']['color'] = $color;
$row['style']['networkmap'] = $networkmap;
@ -215,52 +235,17 @@ if (is_ajax()) {
if ($get_tooltip_content) {
$id = (int) get_parameter('id', 0);
// Get all module from agent
switch ($config['dbtype']) {
case 'mysql':
case 'postgresql':
$sql = sprintf(
'
SELECT *
FROM tagente_estado, tagente_modulo
LEFT JOIN tmodule_group
ON tmodule_group.id_mg = tagente_modulo.id_module_group
WHERE tagente_modulo.id_agente_modulo = '.$id.'
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND tagente_modulo.disabled = 0
AND tagente_modulo.delete_pending = 0
AND tagente_estado.utimestamp != 0'
);
break;
// If Dbms is Oracle then field_list in sql statement has to be recoded. See oracle_list_all_field_table()
case 'oracle':
$fields_tagente_estado = oracle_list_all_field_table(
'tagente_estado',
'string'
);
$fields_tagente_modulo = oracle_list_all_field_table(
'tagente_modulo',
'string'
);
$fields_tmodule_group = oracle_list_all_field_table(
'tmodule_group',
'string'
);
$sql = sprintf(
'
SELECT '.$fields_tagente_estado.', '.$fields_tagente_modulo.', '.$fields_tmodule_group.' FROM tagente_estado, tagente_modulo
LEFT JOIN tmodule_group
ON tmodule_group.id_mg = tagente_modulo.id_module_group
WHERE tagente_modulo.id_agente_modulo = '.$id.'
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND tagente_modulo.disabled = 0
AND tagente_modulo.delete_pending = 0
AND tagente_estado.utimestamp != 0'
);
break;
}
$sql = sprintf(
'SELECT *
FROM tagente_estado, tagente_modulo
LEFT JOIN tmodule_group
ON tmodule_group.id_mg = tagente_modulo.id_module_group
WHERE tagente_modulo.id_agente_modulo = '.$id.'
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND tagente_modulo.disabled = 0
AND tagente_modulo.delete_pending = 0
AND tagente_estado.utimestamp != 0'
);
$modules = db_get_all_rows_sql($sql);
if (empty($modules)) {
@ -377,7 +362,7 @@ if (is_ajax()) {
$return['content'] .= '<b>'.__('Status: ').'</b>'.ui_print_status_image($status, $title, true).'<br />';
if ($module['id_tipo_modulo'] == 24) {
// log4x
// Log4x.
switch ($module['datos']) {
case 10:
$salida = 'TRACE';
@ -410,7 +395,7 @@ if (is_ajax()) {
break;
}
$salida = "<span style='$style'>$salida</span>";
$salida = "<span style='".$style."'>".$salida.'</span>';
} else {
if (is_numeric($module['datos'])) {
$salida = format_numeric($module['datos']);
@ -513,7 +498,7 @@ if (is_ajax()) {
include_once 'include/functions_agents.php';
$id = (int) get_parameter('id', 0);
// q is what autocomplete plugin gives
// Q is what autocomplete plugin gives.
$string = (string) get_parameter('q');
$agents = db_get_all_rows_filter(
@ -586,8 +571,7 @@ if (is_ajax()) {
$filter = json_encode($array_filter);
// ACL for the network map
// $networkmap_read = check_acl ($config['id_user'], $networkmap['id_group'], "MR");
// ACL for the network map.
$networkmap_write = check_acl($config['id_user'], $networkmap['id_group'], 'MW');
$networkmap_manage = check_acl($config['id_user'], $networkmap['id_group'], 'MM');
@ -641,7 +625,7 @@ if (is_ajax()) {
return;
}
// Popup
// Popup.
$get_status_node = (bool) get_parameter('get_status_node', false);
$get_status_module = (bool) get_parameter(
'get_status_module',
@ -765,7 +749,7 @@ if (is_ajax()) {
// --------------END AJAX------------------------------------------------
$id = (int) get_parameter('id_networkmap', 0);
// Print some params to handle it in js
// Print some params to handle it in js.
html_print_input_hidden('product_name', get_product_name());
html_print_input_hidden('center_logo', ui_get_full_url(ui_get_logo_to_center_networkmap()));
@ -819,7 +803,7 @@ if ($networkmap === false) {
return;
} else {
// ACL for the network map
// ACL for the network map.
$networkmap_read = check_acl($config['id_user'], $networkmap['id_group'], 'MR');
$networkmap_write = check_acl($config['id_user'], $networkmap['id_group'], 'MW');
$networkmap_manage = check_acl($config['id_user'], $networkmap['id_group'], 'MM');
@ -837,11 +821,11 @@ if ($networkmap === false) {
$pure = (int) get_parameter('pure', 0);
// Main code
// Main code.
if ($pure == 1) {
$buttons['screen'] = [
'active' => false,
'text' => '<a href="index.php?sec=networkmapconsole&amp;'.'sec2=operation/agentes/pandora_networkmap&amp;'.'tab=view&amp;id_networkmap='.$id.'">'.html_print_image(
'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap&amp;tab=view&amp;id_networkmap='.$id.'">'.html_print_image(
'images/normal_screen.png',
true,
['title' => __('Normal screen')]
@ -851,7 +835,7 @@ if ($networkmap === false) {
if (!$dash_mode) {
$buttons['screen'] = [
'active' => false,
'text' => '<a href="index.php?sec=networkmapconsole&amp;'.'sec2=operation/agentes/pandora_networkmap&amp;'.'pure=1&amp;tab=view&amp;id_networkmap='.$id.'">'.html_print_image(
'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap&amp;pure=1&amp;tab=view&amp;id_networkmap='.$id.'">'.html_print_image(
'images/full_screen.png',
true,
['title' => __('Full screen')]
@ -859,7 +843,7 @@ if ($networkmap === false) {
];
$buttons['list'] = [
'active' => false,
'text' => '<a href="index.php?sec=networkmapconsole&amp;'.'sec2=operation/agentes/pandora_networkmap">'.html_print_image(
'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap">'.html_print_image(
'images/list.png',
true,
['title' => __('List of networkmap')]
@ -902,21 +886,16 @@ if ($networkmap === false) {
<script>
$(document).ready(function() {
$("*").on("click", function(){
if($("[aria-describedby=dialog_node_edit]").css('display') == 'block'){
$('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'});
}
else{
$('#foot').css({'position':'','top':'0'});
}
if($("[aria-describedby=dialog_node_edit]").css('display') == 'block'){
$('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'});
}
else{
$('#foot').css({'position':'','top':'0'});
}
});
$("[aria-describedby=dialog_node_edit]").on('dialogclose', function(event) {
$('#foot').css({'position':'','top':'0'});
$('#foot').css({'position':'','top':'0'});
});

View File

@ -88,6 +88,16 @@ $sort = get_parameter('sort', 'none');
$id_module = (int) get_parameter('id_module', 0);
$ag_custom_fields = (array) get_parameter('ag_custom_fields', []);
$module_option = (int) get_parameter('module_option', 1);
$autosearch = false;
// It is validated if it receives parameters different from those it has by default
if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|| $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4
|| $modulegroup !== -1 || $tag_filter !== 0 || $sortField !== ''
|| $sort !== 'none' || $id_module !== 0 || $module_option !== 1
) {
$autosearch = true;
}
if (!is_metaconsole()) {
$ag_group = (int) get_parameter('ag_group', 0);
@ -969,10 +979,8 @@ $sql = 'SELECT
ORDER BY '.$order['field'].' '.$order['order'].'
LIMIT '.$offset.','.$limit_sql;
// When you enter for the first time you have less than 4 query params in the url
$first_interaction = count($_GET) > 4;
// We do not show the modules until the user searches with the filter
if ($first_interaction) {
if ($autosearch) {
if (! defined('METACONSOLE')) {
$result = db_get_all_rows_sql($sql);
@ -1057,6 +1065,7 @@ if (($config['dbtype'] == 'oracle') && ($result !== false)) {
}
}
// Start Build List Result
//
if (!empty($result)) {

View File

@ -988,6 +988,10 @@ if ($group_rep == 2) {
'A maximum of %s event custom responses can be selected',
$config['max_execution_event_response']
).'</span>';
echo '<span id="max_custom_selected" style="display:none; color:#FC4444; line-height: 200%;">';
echo __(
'Please, select an event'
).'</span>';
echo '</div>';
}
}
@ -995,12 +999,14 @@ if ($group_rep == 2) {
?>
<script type="text/javascript">
function execute_event_response(event_list_btn) {
function execute_event_response(event_list_btn) {
$('#max_custom_event_resp_msg').hide();
$('#max_custom_selected').hide();
var response_id = $('select[name=response_id]').val();
if (!isNaN(response_id)) { // It is a custom response
var response = get_response(response_id);
@ -1015,59 +1021,58 @@ if ($group_rep == 2) {
var total_checked = $(".chk_val:checked").length;
// Limit number of events to apply custom responses to for performance reasons
// Check select an event.
if(total_checked == 0){
$('#max_custom_selected').show();
return;
}
// Limit number of events to apply custom responses
// to for performance reasons.
if (total_checked > <?php echo $config['max_execution_event_response']; ?> ) {
$('#max_custom_event_resp_msg').show();
return;
}
var response_command = [];
$(".response_command_input").each(function() {
response_command[$(this).attr("name")] = $(this).val();
});
if (event_list_btn) {
$('#button-submit_event_response').hide(function() {
$('#response_loading_dialog').show(function() {
var check_params = get_response_params(
response_id
);
$(".chk_val").each(function() {
if ($(this).is(":checked")) {
event_id = $(this).val();
server_id = $('#hidden-server_id_'+event_id).val();
response['target'] = get_response_target(
event_id,
response_id,
server_id
);
if (total_checked-1 === counter) end=1;
show_massive_response_dialog(
event_id,
response_id,
response,
counter,
end
);
counter++;
}
});
if(check_params[0] !== ''){
show_event_response_command_dialog(
response_id,
response,
total_checked
);
}
else{
check_massive_response_event(
response_id,
response,
total_checked,
response_command
);
}
});
});
}
else {
$('#button-btn_str').hide(function() {
$('#execute_again_loading').show(function() {
$(".chk_val").each(function() {
if ($(this).is(":checked")) {
//var server_id = $('#hidden-server_id_'+).
event_id = $(this).val();
server_id = $('#hidden-server_id_'+event_id).val();
response['target'] = get_response_target(event_id, response_id, server_id);
if (total_checked-1 === counter) end=1;
show_massive_response_dialog(event_id, response_id, response, counter, end);
counter++;
}
});
check_massive_response_event(
response_id,
response,
total_checked,
response_command
);
});
});
}
@ -1087,6 +1092,42 @@ if ($group_rep == 2) {
}
}
}
function check_massive_response_event(
response_id,
response,
total_checked,
response_command
){
var counter=0;
var end=0;
$(".chk_val").each(function() {
if ($(this).is(":checked")) {
event_id = $(this).val();
server_id = $('#hidden-server_id_'+event_id).val();
response['target'] = get_response_target(
event_id,
response_id,
server_id,
response_command
);
if (total_checked-1 === counter)
end=1;
show_massive_response_dialog(
event_id,
response_id,
response,
counter,
end
);
counter++;
}
});
}
</script>
<?php
} else {

View File

@ -611,6 +611,7 @@ if ($delete) {
echo "<div id='event_details_window'></div>";
echo "<div id='event_response_window'></div>";
echo "<div id='event_response_command_window' title='".__('Parameters')."'></div>";
ui_require_jquery_file('bgiframe');
ui_require_javascript_file('pandora_events');
@ -1067,9 +1068,6 @@ function validate_event_advanced(id, new_status) {
next_row_id = row_id_name + '-' + row_id_number_next;
$("#"+previous_row_id).css('display', 'none');
$("#"+current_row_id).css('display', 'none');
$("#"+selected_row_id).css('display', 'none');
$("#"+next_row_id).css('display', 'none');
}
});

View File

@ -1,24 +1,39 @@
<?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @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
global $config;
require_once $config['homedir'].'/include/functions_snmp_browser.php';
ui_require_javascript_file('pandora_snmp_browser');
// AJAX call
// AJAX call.
if (is_ajax()) {
// Read the action to perform
// Read the action to perform.
$action = (string) get_parameter('action', '');
$target_ip = (string) get_parameter('target_ip', '');
$community = (string) get_parameter('community', '');
@ -29,9 +44,11 @@ if (is_ajax()) {
$snmp3_auth_method = get_parameter('snmp3_browser_auth_method');
$snmp3_auth_pass = io_safe_output(get_parameter('snmp3_browser_auth_pass'));
$snmp3_privacy_method = get_parameter('snmp3_browser_privacy_method');
$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_browser_privacy_pass'));
$snmp3_privacy_pass = io_safe_output(
get_parameter('snmp3_browser_privacy_pass')
);
// SNMP browser
// SNMP browser.
if ($action == 'snmptree') {
$starting_oid = (string) get_parameter('starting_oid', '.');
@ -83,9 +100,8 @@ if (is_ajax()) {
}
return;
}
// SNMP get
else if ($action == 'snmpget') {
} else if ($action == 'snmpget') {
// SNMP get.
$target_oid = htmlspecialchars_decode(get_parameter('oid', ''));
$custom_action = get_parameter('custom_action', '');
if ($custom_action != '') {
@ -102,8 +118,10 @@ if (is_ajax()) {
$snmp3_auth_method,
$snmp3_auth_pass,
$snmp3_privacy_method,
$snmp3_privacy_pass
$snmp3_privacy_pass,
$server_to_exec
);
snmp_browser_print_oid(
$oid,
$custom_action,
@ -117,7 +135,7 @@ if (is_ajax()) {
return;
}
// Check login and ACLs
// Check login and ACLs.
check_login();
if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit(
@ -128,17 +146,36 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
exit;
}
// Header
// Header.
$url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_browser&pure='.$config['pure'];
if ($config['pure']) {
// Windowed
$link['text'] = '<a target="_top" href="'.$url.'&pure=0&refr=30">'.html_print_image('images/normal_screen.png', true, ['title' => __('Normal screen')]).'</a>';
// Windowed.
$link['text'] = '<a target="_top" href="'.$url.'&pure=0&refr=30">';
$link['text'] .= html_print_image(
'images/normal_screen.png',
true,
['title' => __('Normal screen')]
);
$link['text'] .= '</a>';
} else {
// Fullscreen
$link['text'] = '<a target="_top" href="'.$url.'&pure=1&refr=0">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen')]).'</a>';
// Fullscreen.
$link['text'] = '<a target="_top" href="'.$url.'&pure=1&refr=0">';
$link['text'] .= html_print_image(
'images/full_screen.png',
true,
['title' => __('Full screen')]
);
$link['text'] .= '</a>';
}
ui_print_page_header(__('SNMP Browser'), 'images/op_snmp.png', false, '', false, [$link]);
ui_print_page_header(
__('SNMP Browser'),
'images/op_snmp.png',
false,
'',
false,
[$link]
);
// SNMP tree container
// SNMP tree container.
snmp_browser_print_container();

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.732
%define release 190306
%define release 190313
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.732
%define release 190306
%define release 190313
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1895,6 +1895,7 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields` (
`name` varchar(45) NOT NULL default '',
`display_on_front` tinyint(1) NOT NULL default 0,
`is_password_type` tinyint(1) NOT NULL default 0,
`combo_values` VARCHAR(255) DEFAULT '',
PRIMARY KEY (`id_field`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -114,10 +114,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 25),
('MR', 26),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '732'),
('current_package_enterprise', '733'),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
('custom_docs_logo', 'default_docs.png'),
('custom_support_logo', 'default_support.png'),
@ -1154,7 +1154,7 @@ INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `execute`, `p
INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (9,'Packet&#x20;Loss','Checks&#x20;for&#x20;dropped&#x20;packages&#x20;after&#x20;X&#x20;seconds&#x20;of&#x20;testing.&#x20;It&#x20;returns&#x20;%&#x20;of&#x20;dropped&#x20;packets.&#x20;It&#x20;uses&#x20;ping&#x20;flood&#x20;mode&#x20;to&#x20;launch&#x20;50&#x20;consecutive&#x20;pings&#x20;to&#x20;a&#x20;remote&#x20;destination.&#x20;On&#x20;local,&#x20;stable&#x20;networks,&#x20;value&#x20;should&#x20;be&#x20;0.&#x0d;&#x0a;',30,0,'/usr/share/pandora_server/util/plugin/packet_loss.sh','','','','',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Test&#x20;time\",\"help\":\"\",\"value\":\"8\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Target&#x20;IP\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}','_field1_&#x20;_field2_');
INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0),(2,'Department',0,0),(3,'Additional&#x20;ID',0,0),(4,'eHorusID',0,0);
INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0,''),(2,'Department',0,0,''),(3,'Additional&#x20;ID',0,0,''),(4,'eHorusID',0,0,'');
INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://artica.es','',''),(2,'critical','Critical&#x20;modules','','',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone','','',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules','','',''),(5,'configuration','','','','');

View File

@ -1,10 +1,10 @@
package: pandorafms-server
Version: 7.0NG.732-190306
Version: 7.0NG.732-190313
Architecture: all
Priority: optional
Section: admin
Installed-Size: 640
Maintainer: Miguel de Dios <miguel.dedios@artica.es>
Maintainer: ÁRTICA ST <info@artica.es>
Homepage: http://pandorafms.org/
Depends: perl (>= 5.8), libdbi-perl, libdbd-mysql-perl, libtime-format-perl, libnetaddr-ip-perl, libtime-format-perl, libxml-simple-perl, libxml-twig-perl, libhtml-parser-perl, snmp, snmpd, traceroute, xprobe2, nmap, sudo, libwww-perl, libsocket6-perl, libio-socket-inet6-perl, snmp-mibs-downloader, libjson-perl, libnet-telnet-perl, libencode-locale-perl, libgeo-ip-perl
Description: Pandora FMS is a monitoring system for big IT environments. It uses remote tests, or local agents to grab information. Pandora supports all standard OS (Linux, AIX, HP-UX, Solaris and Windows XP,2000/2003), and support multiple setups in HA enviroments. This is the server package. Server makes the remote checks and process information transfer by Pandora FMS agents to the server.

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.732-190306"
pandora_version="7.0NG.732-190313"
package_cpan=0
package_pandora=1

View File

@ -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 = "190306";
my $pandora_build = "190313";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -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 = "190306";
my $pandora_build = "190313";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.732"
PI_BUILD="190306"
PI_BUILD="190313"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.732 PS190306";
my $version = "7.0NG.732 PS190313";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.732 PS190306";
my $version = "7.0NG.732 PS190313";
# save program name for logging
my $progname = basename($0);