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