diff --git a/pandora_console/images/spinner_green.gif b/pandora_console/images/spinner_green.gif new file mode 100644 index 0000000000..5182e7e42e Binary files /dev/null and b/pandora_console/images/spinner_green.gif differ diff --git a/pandora_console/include/ajax/snmp_browser.ajax.php b/pandora_console/include/ajax/snmp_browser.ajax.php new file mode 100644 index 0000000000..3376245093 --- /dev/null +++ b/pandora_console/include/ajax/snmp_browser.ajax.php @@ -0,0 +1,126 @@ + $target_oid) { + $oid = snmp_browser_get_oid ($target_ip, $community, + htmlspecialchars_decode($target_oid), $snmp_version, $snmp3_auth_user, + $snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass, + $snmp3_privacy_method, $snmp3_privacy_pass); + + + $name_check = db_get_value ('name', 'tnetwork_component', + 'name', $oid['oid']); + + if(empty($oid['description'])) { + $description = ''; + } else { + $description = io_safe_input($oid['description']); + } + + if(!$name_check){ + $id = network_components_create_network_component ($oid['oid'],17,1, + array ('description' => $description, + 'module_interval' => 300, + 'max' => 0, + 'min' => 0, + 'tcp_send' => $snmp_version, + 'tcp_rcv' => '', + 'tcp_port' => 0, + 'snmp_oid' => $oid['numeric_oid'], + 'snmp_community' => $community, + 'id_module_group' => 3, + 'id_modulo' => 2, + 'id_plugin' => 0, + 'plugin_user' => '', + 'plugin_pass' => '', + 'plugin_parameter' => '', + 'macros' => '', + 'max_timeout' => 0, + 'max_retries' => 0, + 'history_data' => '', + 'dynamic_interval' => 0, + 'dynamic_max' => 0, + 'dynamic_min' => 0, + 'dynamic_two_tailed' => 0, + 'min_warning' => 0, + 'max_warning' => 0, + 'str_warning' => '', + 'min_critical' => 0, + 'max_critical' => 0, + 'str_critical' => '', + 'min_ff_event' => 0, + 'custom_string_1' => '', + 'custom_string_2' => '', + 'custom_string_3' => '', + 'post_process' => 0, + 'unit' => '', + 'wizard_level' => 'nowizard', + 'macros' => '', + 'critical_instructions' => '', + 'warning_instructions' => '', + 'unknown_instructions' => '', + 'critical_inverse' => 0, + 'warning_inverse' => 0, + 'id_category' => 0, + 'tags' => '', + 'disabled_types_event' => '{"going_unknown":1}', + 'min_ff_event_normal' => 0, + 'min_ff_event_warning' => 0, + 'min_ff_event_critical' => 0, + 'each_ff' => 0)); + } + + if(empty($id)) { + array_push($fail_modules,$name_check); + } + } + } + + echo json_encode($fail_modules); + return; +} + + + +?> \ No newline at end of file diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index c15ceb2966..7318e871cf 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -116,7 +116,7 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a echo ""; } - echo ' ' . $level . ''; + echo html_print_checkbox("create_$sub_id", 0, false, true, false, '') .' ' . $level . ''; if (isset ($sub_level['__VALUE__'])) { echo ' '; } @@ -618,3 +618,137 @@ function snmp_browser_print_container ($return = false, $width = '100%', $height } ?> + + diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b07a95f79b..9ee675f508 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -656,7 +656,7 @@ input.sub[disabled] { input.next, input.upd, input.ok, input.wand, input.delete, input.cog, input.target, input.search, input.copy, input.add, input.graph, input.percentile, input.binary, input.camera, input.config, -input.cancel, input.default, input.filter, input.pdf { +input.cancel, input.default, input.filter, input.pdf,input.spinn { padding-right: 30px; height: 23px; @@ -741,6 +741,9 @@ input.pdf:disabled { input.camera { background-image: url(../../images/input_camera.png) !important; } +input.spinn { + background-image: url(../../images/spinner_green.gif) !important; +} #toolbox #auto_save { padding-top: 5px; diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 148a6e7179..191c0caab9 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -47,6 +47,26 @@ if (is_ajax()) { } else { snmp_browser_print_tree ($snmp_tree); + echo html_print_submit_button(__('Create network components'),'create_network_component', + false, array('style' => 'display: none', 'class' => 'sub add'), true); + + echo '