diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php
index 8940b36c2d..5776f5ff21 100644
--- a/pandora_console/extensions/realtime_graphs.php
+++ b/pandora_console/extensions/realtime_graphs.php
@@ -1,22 +1,42 @@
data = [];
$graph_fields['cpu_load'] = __('%s Server CPU', get_product_name());
- $graph_fields['pending_packets'] = __('Pending packages from %s Server', get_product_name());
- $graph_fields['disk_io_wait'] = __('%s Server Disk IO Wait', get_product_name());
- $graph_fields['apache_load'] = __('%s Server Apache load', get_product_name());
- $graph_fields['mysql_load'] = __('%s Server MySQL load', get_product_name());
- $graph_fields['server_load'] = __('%s Server load', get_product_name());
+ $graph_fields['pending_packets'] = __(
+ 'Pending packages from %s Server',
+ get_product_name()
+ );
+ $graph_fields['disk_io_wait'] = __(
+ '%s Server Disk IO Wait',
+ get_product_name()
+ );
+ $graph_fields['apache_load'] = __(
+ '%s Server Apache load',
+ get_product_name()
+ );
+ $graph_fields['mysql_load'] = __(
+ '%s Server MySQL load',
+ get_product_name()
+ );
+ $graph_fields['server_load'] = __(
+ '%s Server load',
+ get_product_name()
+ );
$graph_fields['snmp_interface'] = __('SNMP Interface throughput');
$graph = get_parameter('graph', 'cpu_load');
$refresh = get_parameter('refresh', '1000');
if ($graph != 'snmp_module') {
- $data['graph'] = __('Graph').' '.html_print_select($graph_fields, 'graph', $graph, '', '', 0, true);
+ $data['graph'] = __('Graph').' ';
+ $data['graph'] .= html_print_select(
+ $graph_fields,
+ 'graph',
+ $graph,
+ '',
+ '',
+ 0,
+ true
+ );
}
$refresh_fields[1000] = human_time_description_raw(1, true, 'large');
@@ -119,10 +163,14 @@ function pandora_realtime_graphs()
$agent_alias = io_safe_output(get_parameter('agent_alias', ''));
$module_name = io_safe_output(get_parameter('module_name', ''));
$module_incremental = get_parameter('incremental', 0);
- $data['module_info'] = "$agent_alias: $module_name ";
+ $data['module_info'] = $agent_alias.': '.$module_name.' ';
- // Append all the hidden in this cell
- $data['module_info'] .= html_print_input_hidden('incremental', $module_incremental, true);
+ // Append all the hidden in this cell.
+ $data['module_info'] .= html_print_input_hidden(
+ 'incremental',
+ $module_incremental,
+ true
+ );
$data['module_info'] .= html_print_select(
['snmp_module' => '-'],
'graph',
@@ -139,76 +187,72 @@ function pandora_realtime_graphs()
);
}
- $data['refresh'] = __('Refresh interval').' '.html_print_select($refresh_fields, 'refresh', $refresh, '', '', 0, true);
+ $data['refresh'] = __('Refresh interval').' ';
+ $data['refresh'] .= html_print_select(
+ $refresh_fields,
+ 'refresh',
+ $refresh,
+ '',
+ '',
+ 0,
+ true
+ );
if ($graph != 'snmp_module') {
- $data['incremental'] = __('Incremental').' '.html_print_checkbox('incremental', 1, 0, true);
+ $data['incremental'] = __('Incremental').' ';
+ $data['incremental'] .= html_print_checkbox('incremental', 1, 0, true);
}
- $data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'javascript:realtimeGraphs.clearGraph();', 'class="sub delete" style="margin-top:0px;"', true);
+ $data['reset'] = html_print_button(
+ __('Clear graph'),
+ 'reset',
+ false,
+ 'javascript:realtimeGraphs.clearGraph();',
+ 'class="sub delete" style="margin-top:0px;"',
+ true
+ );
$table->data[] = $data;
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
- $snmp_address = get_parameter('snmp_address', '');
- $snmp_community = get_parameter('snmp_community', '');
- $snmp_oid = get_parameter('snmp_oid', '');
- $snmp_ver = get_parameter('snmp_ver', '');
-
- $data = [];
-
- $data['snmp_address'] = __('Target IP').' '.html_print_input_text('ip_target', $snmp_address, '', 50, 255, true);
- $table->colspan[1]['snmp_address'] = 2;
-
- $data['snmp_community'] = __('Community').' '.html_print_input_text('snmp_community', $snmp_community, '', 50, 255, true);
- $table->colspan[1]['snmp_community'] = 2;
-
- $table->data[] = $data;
-
- $snmp_versions = [];
- $snmp_versions['1'] = '1';
- $snmp_versions['2'] = '2';
- $snmp_versions['2c'] = '2c';
-
- $data = [];
- $data['snmp_oid'] = __('OID').' '.html_print_input_text('snmp_oid', $snmp_oid, '', 100, 255, true);
- $table->colspan[2]['snmp_oid'] = 2;
-
- $data['snmp_ver'] = __('Version').' '.html_print_select($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true);
- $data['snmp_ver'] .= ' '.html_print_button(__('SNMP walk'), 'snmp_walk', false, 'javascript:snmpBrowserWindow();', 'class="sub next"', true);
- $table->colspan[2]['snmp_ver'] = 2;
-
- $table->data[] = $data;
-
- // Hide some options in snmp_module graphs
- if ($graph == 'snmp_module') {
- $table->rowstyle[1] = 'display: none;';
- $table->rowstyle[2] = 'display: none;';
- }
-
- snmp_browser_print_container(false, '100%', '60%', 'none');
+ echo snmp_browser_print_container(true, '100%', '60%', 'none');
}
- // Print the relative path to AJAX calls:
+ // Print the relative path to AJAX calls.
html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
- // Print the form
+ // Print the form.
echo '
';
- // Define a custom action to save the OID selected in the SNMP browser to the form
- html_print_input_hidden('custom_action', urlencode(base64_encode(' ')), false);
+ // Define a custom action to save
+ // the OID selected in the SNMP browser to the form.
+ html_print_input_hidden(
+ 'custom_action',
+ urlencode(
+ base64_encode(
+ ' '
+ )
+ ),
+ false
+ );
html_print_input_hidden('incremental_base', '0');
echo '';
echo '';
echo ' ';
- // Store servers timezone offset to be retrieved from js
+ // Store servers timezone offset to be retrieved from js.
set_js_value('timezone_offset', date('Z', time()));
}
-extensions_add_operation_menu_option(__('Realtime graphs'), 'estado', null, 'v1r1', 'view');
+extensions_add_operation_menu_option(
+ __('Realtime graphs'),
+ 'estado',
+ null,
+ 'v1r1',
+ 'view'
+);
extensions_add_main_function('pandora_realtime_graphs');
$db = null;
diff --git a/pandora_console/extensions/realtime_graphs/ajax.php b/pandora_console/extensions/realtime_graphs/ajax.php
index dea94a5753..a09ef9bb29 100644
--- a/pandora_console/extensions/realtime_graphs/ajax.php
+++ b/pandora_console/extensions/realtime_graphs/ajax.php
@@ -69,15 +69,34 @@ switch ($graph) {
case 'snmp_interface':
case 'snmp_module':
- $snmp_address = $_POST['snmp_address'];
- $snmp_community = $_POST['snmp_community'];
- $snmp_ver = $_POST['snmp_ver'];
- $snmp_oid = $_POST['snmp_oid'];
+ $snmp_address = get_parameter('snmp_address', '');
+ $snmp_community = get_parameter('snmp_community', '');
+ $snmp_ver = get_parameter('snmp_ver', '');
+ $snmp_oid = get_parameter('snmp_oid', '');
+ $snmp3_auth_user = get_parameter('snmp3_auth_user', '');
+ $snmp3_security_level = get_parameter('snmp3_security_level', '');
+ $snmp3_auth_method = get_parameter('snmp3_auth_method', '');
+ $snmp3_auth_pass = get_parameter('snmp3_auth_pass', '');
+ $snmp3_privacy_method = get_parameter('snmp3_privacy_method', '');
+ $snmp3_privacy_pass = get_parameter('snmp3_privacy_pass', '');
if (empty($snmp_address) || empty($snmp_oid)) {
$data = 0;
} else {
- $data = get_snmpwalk($snmp_address, $snmp_ver, $snmp_community, '', '', '', '', '', '', 0, $snmp_oid);
+ $data = get_snmpwalk(
+ $snmp_address,
+ $snmp_ver,
+ $snmp_community,
+ $snmp3_auth_user,
+ $snmp3_security_level,
+ $snmp3_auth_method,
+ $snmp3_auth_pass,
+ $snmp3_privacy_method,
+ $snmp3_privacy_pass,
+ 0,
+ $snmp_oid,
+ $snmp_port
+ );
$data_index = array_keys($data);
$graph_title = $data_index[0];
if (!empty($data)) {
diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js
index b5d6c1eaa8..088f31dbf6 100644
--- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js
+++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js
@@ -1,3 +1,4 @@
+/* global $, get_php_value */
(function() {
var numberOfPoints = 100;
var refresh = parseInt($("#refresh").val());
@@ -14,7 +15,7 @@
container: $("#chartLegend")
},
xaxis: {
- tickFormatter: function(timestamp, axis) {
+ tickFormatter: function(timestamp) {
var date = new Date(timestamp * 1000);
var server_timezone_offset = get_php_value("timezone_offset");
@@ -39,7 +40,7 @@
}
},
yaxis: {
- tickFormatter: function(value, axis) {
+ tickFormatter: function(value) {
return shortNumber(roundToTwo(value));
}
},
@@ -66,10 +67,16 @@
data: {
graph: $("#graph :selected").val(),
graph_title: $("#graph :selected").html(),
- snmp_community: $("#text-snmp_community").val(),
- snmp_oid: $("#text-snmp_oid").val(),
- snmp_ver: $("#snmp_version :selected").val(),
- snmp_address: $("#text-ip_target").val(),
+ snmp_community: $("#text-community").val(),
+ snmp_oid: $("#text-starting_oid").val(),
+ snmp_ver: $("#snmp_browser_version").val(),
+ snmp_address: $("#text-target_ip").val(),
+ snmp3_auth_user: $("#text-snmp3_browser_auth_user").val(),
+ snmp3_security_level: $("#snmp3_browser_security_level").val(),
+ snmp3_auth_method: $("#snmp3_browser_auth_method").val(),
+ snmp3_auth_pass: $("#password-snmp3_browser_auth_pass").val(),
+ snmp3_privacy_method: $("#snmp3_browser_privacy_method").val(),
+ snmp3_privacy_pass: $("#password-snmp3_browser_privacy_pass").val(),
refresh: refresh
},
success: function(serie) {
@@ -87,7 +94,7 @@
}
if (data.length === 0) {
- for (i = 0; i < numberOfPoints; i++) {
+ for (var i = 0; i < numberOfPoints; i++) {
var step = i * (refresh / 1000);
serie.data.unshift([timestamp - step, 0]);
}
@@ -123,7 +130,7 @@
var data = plot.getData();
if (data.length === 0) return;
- for (i = 0; i < data[0].data.length; i++) {
+ for (var i = 0; i < data[0].data.length; i++) {
data[0].data[i][1] = 0;
}
if (incremental) lastIncVal = null;
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index e28c255f9c..b28cde4936 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -3395,16 +3395,16 @@ function recursive_get_dt_from_modules_tree(&$f_modules, $modules, $deep)
/**
* @brief Get the button with the link to open realtime stats into a new window
- * Only to native (not satellite discovered) snmp modules.
+ * Only to native (not satellite discovered) snmp modules.
*
- * @param array With all the module info
- * @return string All the HTML code to paint the button
+ * @param array $module With all the module info.
+ * @return string Link to chart.
*/
function get_module_realtime_link_graph($module)
{
global $config;
- // Sometimes some parameters are renamed
+ // Sometimes some parameters are renamed.
if (!isset($module['id_tipo_modulo'])) {
$module['id_tipo_modulo'] = $module['module_type'];
}
@@ -3413,36 +3413,51 @@ function get_module_realtime_link_graph($module)
$module['nombre'] = $module['module_name'];
}
- // Avoid to show on metaconsole
+ // Avoid to show on metaconsole.
if (is_metaconsole()) {
return '';
}
- // Realtime graph is an extension and it should be enabled
+ // Realtime graph is an extension and it should be enabled.
if (!extensions_is_enabled_extension('realtime_graphs.php')) {
return '';
}
- // Only to remote_snmp, remote_snmp_proc. snmp_snmp_inc
- if ($module['id_tipo_modulo'] != 15 && $module['id_tipo_modulo'] != 16 && $module['id_tipo_modulo'] != 18) {
+ // Only to remote_snmp, remote_snmp_proc. snmp_snmp_inc.
+ if ($module['id_tipo_modulo'] != 15
+ && $module['id_tipo_modulo'] != 16
+ && $module['id_tipo_modulo'] != 18
+ ) {
return '';
}
- // Only version 1, 2 and 2c
- if ($module['tcp_send'] != '1' && $module['tcp_send'] != '2' && $module['tcp_send'] != '2c') {
+ // Only version 1, 2, 2c and 3
+ if ($module['tcp_send'] != '1'
+ && $module['tcp_send'] != '2'
+ && $module['tcp_send'] != '2c'
+ && $module['tcp_send'] != '3'
+ ) {
return '';
}
$params = [
- 'graph' => 'snmp_module',
- 'agent_alias' => urlencode(modules_get_agentmodule_agent_alias($module['id_agente_modulo'])),
- 'module_name' => urlencode($module['nombre']),
- 'snmp_address' => $module['ip_target'],
- 'snmp_community' => urlencode($module['snmp_community']),
- 'snmp_oid' => $module['snmp_oid'],
- 'snmp_ver' => $module['tcp_send'],
- 'hide_header' => 1,
- 'rel_path' => '../../',
+ 'graph' => 'snmp_module',
+ 'agent_alias' => urlencode(
+ modules_get_agentmodule_agent_alias($module['id_agente_modulo'])
+ ),
+ 'module_name' => urlencode($module['nombre']),
+ 'target_ip' => $module['ip_target'],
+ 'community' => urlencode($module['snmp_community']),
+ 'starting_oid' => urlencode($module['snmp_oid']),
+ 'snmp_browser_version' => urlencode($module['tcp_send']),
+ 'snmp3_auth_user' => urlencode($module['plugin_user']),
+ 'snmp3_security_level' => urlencode($module['custom_string_3']),
+ 'snmp3_auth_method' => urlencode($module['plugin_parameters']),
+ 'snmp3_auth_pass' => urlencode($module['plugin_pass']),
+ 'snmp3_privacy_method' => urlencode($module['custom_string_1']),
+ 'snmp3_privacy_pass' => urlencode($module['custom_string_2']),
+ 'hide_header' => 1,
+ 'rel_path' => '../../',
];
// Incremental type
if ($module['id_tipo_modulo'] == 16) {
@@ -3456,9 +3471,13 @@ function get_module_realtime_link_graph($module)
$link = substr($link, 0, -1);
- $win_handle = 'realtime_'.dechex(crc32($module['id_agente_modulo'].$module['nombre']));
+ $win_handle = 'realtime_';
+ $win_handle .= dechex(
+ crc32($module['id_agente_modulo'].$module['nombre'])
+ );
- $link_button = ''.html_print_image(
+ $link_button = ' ';
+ $link_button .= html_print_image(
'images/realtime_shortcut.png',
true,
[
@@ -3466,7 +3485,8 @@ function get_module_realtime_link_graph($module)
'alt' => '',
'title' => __('Realtime SNMP graph'),
]
- ).' ';
+ );
+ $link_button .= '';
return $link_button;
}
diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php
index c4ef3b05ab..3f66c790ae 100644
--- a/pandora_console/include/functions_snmp_browser.php
+++ b/pandora_console/include/functions_snmp_browser.php
@@ -669,18 +669,29 @@ function snmp_browser_print_oid(
/**
- * Print the div that contains the SNMP browser.
+ * Print browser container.
*
- * @param bool return The result is printed if set to true or returned if set to false.
- * @param string width Width of the SNMP browser. Units must be specified.
- * @param string height Height of the SNMP browser. Units must be specified.
- * @param string display CSS display value for the container div. Set to none to hide the div.
+ * @param boolean $return The result is printed
+ * if set to true or returned if set to false.
+ * @param string $width Width of the SNMP browser.
+ * Units must be specified.
+ * @param string $height Height of the SNMP browser.
+ * Units must be specified.
+ * @param string $display CSS display value for the
+ * container div. Set to none to hide the div.
+ * @param boolean $show_massive_buttons Massive buttons.
*
- * @return string The container div.
+ * @return string html.
*/
-function snmp_browser_print_container($return=false, $width='100%', $height='60%', $display='', $show_massive_buttons=false)
-{
- // Target selection
+function snmp_browser_print_container(
+ $return=false,
+ $width='100%',
+ $height='60%',
+ $display='',
+ $show_massive_buttons=false
+) {
+ $snmp_version = get_parameter('snmp_browser_version', '2c');
+ // Target selection.
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
@@ -754,12 +765,36 @@ function snmp_browser_print_container($return=false, $width='100%', $height='60%
}
}
- $table->data[1][1] = ''.__('Server to execute').' ';
- $table->data[1][1] .= html_print_select($servers_to_exec, 'server_to_exec', '', '', '', '', true);
+ $table->data[1][1] = '';
+ $table->data[1][1] .= __('Server to execute');
+ $table->data[1][1] .= ' ';
+ $table->data[1][1] .= html_print_select(
+ $servers_to_exec,
+ 'server_to_exec',
+ '',
+ '',
+ '',
+ '',
+ true
+ );
- $table->data[1][2] = html_print_button(__('Browse'), 'browse', false, 'snmpBrowse()', 'class="sub search" style="margin-top:0px;"', true);
+ $table->data[1][2] = html_print_button(
+ __('Browse'),
+ 'browse',
+ false,
+ 'snmpBrowse()',
+ 'class="sub search" style="margin-top:0px;"',
+ true
+ );
+
+ // SNMP v3 options.
+ $snmp3_auth_user = get_parameter('snmp3_auth_user', '');
+ $snmp3_security_level = get_parameter('snmp3_security_level', 'authNoPriv');
+ $snmp3_auth_method = get_parameter('snmp3_auth_method', 'MD5');
+ $snmp3_auth_pass = get_parameter('snmp3_auth_pass', '');
+ $snmp3_privacy_method = get_parameter('snmp3_privacy_method', 'AES');
+ $snmp3_privacy_pass = get_parameter('snmp3_privacy_pass', '');
- // SNMP v3 options
$table3 = new stdClass();
$table3->width = '100%';
@@ -767,18 +802,69 @@ function snmp_browser_print_container($return=false, $width='100%', $height='60%
$table3->valign[1] = '';
$table3->data[2][1] = ''.__('Auth user').' ';
- $table3->data[2][2] = html_print_input_text('snmp3_browser_auth_user', '', '', 15, 60, true);
+ $table3->data[2][2] = html_print_input_text(
+ 'snmp3_browser_auth_user',
+ $snmp3_auth_user,
+ '',
+ 15,
+ 60,
+ true
+ );
+
$table3->data[2][3] = ''.__('Auth password').' ';
- $table3->data[2][4] = html_print_input_password('snmp3_browser_auth_pass', '', '', 15, 60, true);
- $table3->data[2][4] .= html_print_input_hidden_extended('active_snmp_v3', 0, 'active_snmp_v3_fsb', true);
+ $table3->data[2][4] = html_print_input_password(
+ 'snmp3_browser_auth_pass',
+ $snmp3_auth_pass,
+ '',
+ 15,
+ 60,
+ true
+ );
+
+ $table3->data[2][4] .= html_print_input_hidden_extended(
+ 'active_snmp_v3',
+ 0,
+ 'active_snmp_v3_fsb',
+ true
+ );
$table3->data[5][0] = ''.__('Privacy method').' ';
- $table3->data[5][1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_browser_privacy_method', '', '', '', '', true);
+ $table3->data[5][1] = html_print_select(
+ [
+ 'DES' => __('DES'),
+ 'AES' => __('AES'),
+ ],
+ 'snmp3_browser_privacy_method',
+ $snmp3_privacy_method,
+ '',
+ '',
+ '',
+ true
+ );
+
$table3->data[5][2] = ''.__('Privacy pass').' ';
- $table3->data[5][3] = html_print_input_password('snmp3_browser_privacy_pass', '', '', 15, 60, true);
+ $table3->data[5][3] = html_print_input_password(
+ 'snmp3_browser_privacy_pass',
+ $snmp3_privacy_pass,
+ '',
+ 15,
+ 60,
+ true
+ );
$table3->data[6][0] = ''.__('Auth method').' ';
- $table3->data[6][1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'snmp3_browser_auth_method', '', '', '', '', true);
+ $table3->data[6][1] = html_print_select(
+ [
+ 'MD5' => __('MD5'),
+ 'SHA' => __('SHA'),
+ ],
+ 'snmp3_browser_auth_method',
+ $snmp3_auth_method,
+ '',
+ '',
+ '',
+ true
+ );
$table3->data[6][2] = ''.__('Security level').' ';
$table3->data[6][3] = html_print_select(
[
@@ -787,29 +873,92 @@ function snmp_browser_print_container($return=false, $width='100%', $height='60%
'authPriv' => __('Auth and privacy method'),
],
'snmp3_browser_security_level',
- '',
+ $snmp3_security_level,
'',
'',
'',
true
);
- // Search tools
+ // Search tools.
$table2 = new stdClass();
$table2->width = '100%';
$table2->class = 'databox filters';
$table2->size = [];
$table2->data = [];
- $table2->data[0][0] = html_print_input_text('search_text', '', '', 25, 0, true);
- $table2->data[0][0] .= ''.html_print_image('images/zoom.png', true, ['title' => __('Search'), 'style' => 'vertical-align: middle;', 'onclick' => 'searchText();']).' ';
- $table2->data[0][1] = ' '.''.html_print_image('images/go_first.png', true, ['title' => __('First match'), 'style' => 'vertical-align: middle;', 'onclick' => 'searchFirstMatch();']).' ';
- $table2->data[0][1] .= ' '.''.html_print_image('images/go_previous.png', true, ['title' => __('Previous match'), 'style' => 'vertical-align: middle;', 'onclick' => 'searchPrevMatch();']).' ';
- $table2->data[0][1] .= ' '.''.html_print_image('images/go_next.png', true, ['title' => __('Next match'), 'style' => 'vertical-align: middle;', 'onclick' => 'searchNextMatch();']).' ';
- $table2->data[0][1] .= ' '.''.html_print_image('images/go_last.png', true, ['title' => __('Last match'), 'style' => 'vertical-align: middle;', 'onclick' => 'searchLastMatch();']).' ';
+ $table2->data[0][0] = html_print_input_text(
+ 'search_text',
+ '',
+ '',
+ 25,
+ 0,
+ true
+ );
+ $table2->data[0][0] .= '';
+ $table2->data[0][0] .= html_print_image(
+ 'images/zoom.png',
+ true,
+ [
+ 'title' => __('Search'),
+ 'style' => 'vertical-align: middle;',
+ 'onclick' => 'searchText();',
+ ]
+ );
+ $table2->data[0][0] .= ' ';
+
+ $table2->data[0][1] = ' ';
+ $table2->data[0][1] .= '';
+ $table2->data[0][1] .= html_print_image(
+ 'images/go_first.png',
+ true,
+ [
+ 'title' => __('First match'),
+ 'style' => 'vertical-align: middle;',
+ 'onclick' => 'searchFirstMatch();',
+ ]
+ );
+ $table2->data[0][1] .= ' ';
+ $table2->data[0][1] .= ' ';
+ $table2->data[0][1] .= '';
+ $table2->data[0][1] .= html_print_image(
+ 'images/go_previous.png',
+ true,
+ [
+ 'title' => __('Previous match'),
+ 'style' => 'vertical-align: middle;',
+ 'onclick' => 'searchPrevMatch();',
+ ]
+ );
+ $table2->data[0][1] .= ' ';
+ $table2->data[0][1] .= ' ';
+ $table2->data[0][1] .= '';
+ $table2->data[0][1] .= html_print_image(
+ 'images/go_next.png',
+ true,
+ [
+ 'title' => __('Next match'),
+ 'style' => 'vertical-align: middle;',
+ 'onclick' => 'searchNextMatch();',
+ ]
+ );
+ $table2->data[0][1] .= ' ';
+ $table2->data[0][1] .= ' ';
+ $table2->data[0][1] .= '';
+ $table2->data[0][1] .= html_print_image(
+ 'images/go_last.png',
+ true,
+ [
+ 'title' => __('Last match'),
+ 'style' => 'vertical-align: middle;',
+ 'onclick' => 'searchLastMatch();',
+ ]
+ );
+ $table2->data[0][1] .= ' ';
$table2->cellstyle[0][1] = 'text-align:center;';
- $table2->data[0][2] = ' '.''.html_print_image(
+ $table2->data[0][2] = ' ';
+ $table2->data[0][2] .= ' '.html_print_image(
'images/expand.png',
true,
[
@@ -817,8 +966,20 @@ function snmp_browser_print_container($return=false, $width='100%', $height='60%
'style' => 'vertical-align: middle;',
'onclick' => 'expandAll();',
]
- ).' ';
- $table2->data[0][2] .= ' '.''.html_print_image('images/collapse.png', true, ['title' => __('Collapse the tree'), 'style' => 'vertical-align: middle;', 'onclick' => 'collapseAll();']).' ';
+ );
+ $table2->data[0][2] .= '';
+ $table2->data[0][2] .= ' ';
+ $table2->data[0][2] .= '';
+ $table2->data[0][2] .= html_print_image(
+ 'images/collapse.png',
+ true,
+ [
+ 'title' => __('Collapse the tree'),
+ 'style' => 'vertical-align: middle;',
+ 'onclick' => 'collapseAll();',
+ ]
+ );
+ $table2->data[0][2] .= ' ';
$table2->cellstyle[0][2] = 'text-align:center;';
// This extra div that can be handled by jquery's dialog.
@@ -828,7 +989,7 @@ function snmp_browser_print_container($return=false, $width='100%', $height='60%
$output .= html_print_table($table, true);
$output .= '';
- if (!isset($snmp_version)) {
+ if (isset($snmp_version) === false) {
$snmp_version = null;
}
@@ -838,40 +999,61 @@ function snmp_browser_print_container($return=false, $width='100%', $height='60%
$output .= '';
}
- $output .= ui_toggle(html_print_table($table3, true), __('SNMP v3 options'), '', '', true, true);
+ $output .= ui_toggle(
+ html_print_table($table3, true),
+ __('SNMP v3 options'),
+ '',
+ '',
+ true,
+ true
+ );
$output .= '
';
$output .= '';
- $output .= ui_toggle(html_print_table($table2, true), __('Search options'), '', '', true, true);
+ $output .= ui_toggle(
+ html_print_table($table2, true),
+ __('Search options'),
+ '',
+ '',
+ true,
+ true
+ );
$output .= '
';
- // SNMP tree container
+ // SNMP tree container.
$output .= '';
$output .= html_print_input_hidden('search_count', 0, true);
$output .= html_print_input_hidden('search_index', -1, true);
- // Save some variables for javascript functions
- $output .= html_print_input_hidden('ajax_url', ui_get_full_url('ajax.php'), true);
- $output .= html_print_input_hidden('search_matches_translation', __('Search matches'), true);
+ // Save some variables for javascript functions.
+ $output .= html_print_input_hidden(
+ 'ajax_url',
+ ui_get_full_url('ajax.php'),
+ true
+ );
+ $output .= html_print_input_hidden(
+ 'search_matches_translation',
+ __('Search matches'),
+ true
+ );
$output .= '
';
$output .= '
'.html_print_image('images/spinner.gif', true).'
';
$output .= '
';
$output .= '
';
- $output .= '
';
+ $output .= '
';
$output .= '
';
$output .= '';
$output .= '';
if ($show_massive_buttons) {
$output .= '';
-
- $output .= html_print_submit_button(
- __('Create agent modules'),
- 'create_modules_agent',
- false,
- ['class' => 'sub add'],
- true
- );
+ $output .= html_print_submit_button(
+ __('Create agent modules'),
+ 'create_modules_agent',
+ false,
+ ['class' => 'sub add'],
+ true
+ );
if (enterprise_installed()) {
$output .= html_print_submit_button(
@@ -883,15 +1065,15 @@ function snmp_browser_print_container($return=false, $width='100%', $height='60%
);
}
- $output .= html_print_submit_button(
- __('Create network components'),
- 'create_modules_network_component',
- false,
- ['class' => 'sub add'],
- true
- );
+ $output .= html_print_submit_button(
+ __('Create network components'),
+ 'create_modules_network_component',
+ false,
+ ['class' => 'sub add'],
+ true
+ );
- $output .= '
';
+ $output .= '';
}
if ($return) {
diff --git a/pandora_console/operation/agentes/realtime_win.php b/pandora_console/operation/agentes/realtime_win.php
index 93c8c85ea2..dbf9cf9f71 100644
--- a/pandora_console/operation/agentes/realtime_win.php
+++ b/pandora_console/operation/agentes/realtime_win.php
@@ -1,18 +1,31 @@
';
echo '';
- ui_print_error_message(__('There was a problem connecting with the node'));
+ ui_print_error_message(
+ __('There was a problem connecting with the node')
+ );
echo '';
echo '