".__('Agent configuration'); if (isset($_GET["create_agent"])) { $create_agent = 1; echo " > ".__('Create agent'); } else { echo " > ".__('Update agent'); } echo ""; echo '
 
'; // Agent remote configuration editor $agent_md5 = md5 ($nombre_agente, FALSE); $filename['md5'] = $config["remote_config"] . "/" . $agent_md5 . ".md5"; $filename['conf'] = $config["remote_config"] . "/" . $agent_md5 . ".conf"; if (isset ($_GET["disk_conf"])) { require ("agent_disk_conf_editor.php"); exit; } // Agent remote configuration DELETE if (isset($_GET["disk_conf_delete"])) { //TODO: Get this working on computers where the Pandora server(s) are not on the webserver //TODO: Get a remote_config editor working in the open version unlink ($filename['md5']); unlink ($filename['conf']); } echo '
'; $table->width = 650; $table->cellpadding = 4; $table->cellspacing = 4; $table->class = "databox_color"; $table->head = array (); $table->data = array (); $table->data[0][0] = ''.__('Agent name').''.print_help_tip (__("The agent's name must be the same as the one defined at the console"), true); $table->data[0][1] = print_input_text ('agente', $nombre_agente, '', 30, 100,true); if (isset ($id_agente) && $id_agente != "") { $table->data[0][1] .= ' '; } // Remote configuration available if (file_exists ($filename['md5'])) { $table->data[0][1] .= ' '.print_help_tip (__('You can remotely edit this agent configuration'), true); } $table->data[1][0] = ''.__('IP Address').''; $table->data[1][1] = print_input_text ('direccion', $direccion_agente, '', 16, 100, true); if ($create_agent != 1) { $table->data[1][1] .= '    '; $ip_all = get_agent_addresses ($id_agente); $table->data[1][1] .= print_select ($ip_all, "address_list", $direccion_agente, '', '', 0, true); $table->data[1][1] .= print_checkbox ("delete_ip", 1, false, true).__('Delete selected'); } $groups = get_user_groups ($config["id_user"]); $agents = get_group_agents (array_keys ($groups)); $table->data[2][0] = ''.__('Parent').''; $table->data[2][1] = print_select ($agents, 'id_parent', $id_parent, '', get_agent_name ($id_parent, "lower"), $id_parent, true, false, false); //I use get_agent_name because the user might not have rights to the current parent $table->data[3][0] = ''.__('Group').''; $table->data[3][1] = print_select ($groups, 'grupo', $grupo, '', '', 0, true, false, false); $table->data[4][0] = ''.__('Interval').''; $table->data[4][1] = print_input_text ('intervalo', $intervalo, '', 16, 100, true); $table->data[5][0] = ''.__('OS').''; $table->data[5][1] = print_select_from_sql ('SELECT id_os, name FROM tconfig_os ORDER BY name', 'id_os', $id_os, '', '', '0', true); // Network server $table->data[6][0] = ''.__('Network Server').''.print_help_tip (__('You must select a Network Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[6][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE network_server = 1 ORDER BY name', 'network_server', $id_network_server, '', '', 0, true); // Plugin server $table->data[7][0] = ''.__('Plugin Server').''.print_help_tip (__('You must select a Plugin Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[7][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE plugin_server = 1 ORDER BY name', 'plugin_server', $id_plugin_server, '', '', 0, true); // WMI Server $table->data[8][0] = ''.__('WMI Server').''.print_help_tip (__('You must select a WMI Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[8][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE wmi_server = 1 ORDER BY name', 'wmi_server', $id_wmi_server, '', '', 0, true); // Prediction Server $table->data[9][0] = ''.__('Prediction Server').''.print_help_tip (__('You must select a Prediction Server for the Agent, so it can work properly with this kind of modules'), true); $table->data[9][1] = print_select_from_sql ('SELECT id_server, name FROM tserver WHERE prediction_server = 1 ORDER BY name', 'prediction_server', $id_prediction_server, '', '', 0, true); enterprise_hook ('inventory_server'); // Description $table->data[10][0] = ''.__('Description').''; $table->data[10][1] = print_input_text ('comentarios', $comentarios, '', 45, 255, true); // Learn mode / Normal mode $table->data[11][0] = ''.__('Module definition').''.pandora_help("module_definition", true); $table->data[11][1] = __('Learning mode').' '.print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"', true); $table->data[11][1] .= __('Normal mode').' '.print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"', true); // Status (Disabled / Enabled) $table->data[12][0] = ''.__('Status').''; $table->data[12][1] = __('Disabled').' '.print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true); $table->data[12][1] .= __('Active').' '.print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true); // Remote configuration $table->data[13][0] = ''.__('Remote configuration').''; if (file_exists ($filename['md5'])) { $table->data[13][1] = date ("F d Y H:i:s.", fileatime ($filename['md5'])); // Delete remote configuration $table->data[13][1] .= ''; } else { $table->data[13][1] = ''.__('Not available').''; } print_table ($table); unset ($table); echo '
'; if ($create_agent == 1) { print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"'); print_input_hidden ('create_agent', 1); } else { print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"'); print_input_hidden ('update_agent', 1); print_input_hidden ('id_agente', $id_agente); } echo '
'; ?>