$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, [ '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, 'ff_type' => 0, 'each_ff' => 0, ] ); } if (empty($id)) { array_push($fail_modules, $name_check); } } } echo json_encode($fail_modules); return; }