2008-09-18 14:06:21 +02:00
|
|
|
<?php
|
|
|
|
|
2009-06-08 20:21:21 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2008-09-18 14:06:21 +02:00
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2009-06-08 20:21:21 +02:00
|
|
|
|
2008-09-18 14:06:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Load global vars
|
|
|
|
require ("include/config.php");
|
|
|
|
|
|
|
|
check_login ();
|
|
|
|
|
2009-10-21 18:15:22 +02:00
|
|
|
if (! give_acl ($config['id_user'], 0, "PM")) {
|
2008-09-18 14:06:21 +02:00
|
|
|
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
|
|
|
|
"Trying to access Export Server Management");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$name = (string) get_parameter ("name");
|
|
|
|
$export_server = (int) get_parameter ("export_server");
|
|
|
|
$preffix = (string) get_parameter ("preffix");
|
|
|
|
$interval = (int) get_parameter ("interval");
|
|
|
|
$ip_server = (string) get_parameter ("ip_server");
|
|
|
|
$connect_mode = (string) get_parameter ("connect_mode");
|
|
|
|
$user = (string) get_parameter ("user");
|
|
|
|
$password = (string) get_parameter ("password");
|
|
|
|
$port = (string) get_parameter ("port");
|
|
|
|
$directory = (string) get_parameter ("directory");
|
|
|
|
$options = (string) get_parameter ("options");
|
|
|
|
$create = (int) get_parameter ("create");
|
|
|
|
$delete = (int) get_parameter ("delete");
|
|
|
|
$update = (int) get_parameter ("update");
|
|
|
|
|
|
|
|
// Update
|
|
|
|
if ($update) {
|
|
|
|
$sql = sprintf ("UPDATE tserver_export SET name = '%s', id_export_server = %d,
|
|
|
|
preffix = '%s', `interval` = %d, ip_server = '%s', connect_mode = '%s',
|
|
|
|
user = '%s', pass = '%s', port = %d, directory = '%s', options = '%s'
|
|
|
|
WHERE id = %d",
|
|
|
|
$name, $export_server, $preffix, $interval, $ip_server, $connect_mode,
|
|
|
|
$user, $password, $port, $directory, $options, $update);
|
|
|
|
if (process_sql ($sql) === false) {
|
|
|
|
echo '<h3 class="error">'.__('Error updating export target').'</h3>';
|
|
|
|
} else {
|
|
|
|
echo '<h3 class="suc">'.__('Successfully updated export target').'</h3>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete
|
|
|
|
if ($delete) {
|
|
|
|
$sql = sprintf("DELETE FROM tserver_export WHERE id = '%d'", $delete);
|
|
|
|
if (process_sql ($sql) === false) {
|
2008-09-19 12:49:31 +02:00
|
|
|
echo '<h3 class="error">'.__('Error deleting export target').'</h3>';
|
2008-09-18 14:06:21 +02:00
|
|
|
} else {
|
2009-06-24 Jorge Gonzalez <jorgegonz@artica.es>
* include/functions_reporting.php, include/functions_ui.php,
* operation/incidents/incident.php,
* operation/snmpconsole/snmp_view.php, operation/events/events.php,
* operation/agentes/tactical.php, godmode/users/user_list.php,
* godmode/users/configure_user.php,
* godmode/profiles/profile_list.php,
* godmode/agentes/module_manager_editor_wmi.php,
* godmode/agentes/massive_edit_modules.php,
* godmode/agentes/manage_config_remote.php,
* godmode/modules/manage_network_components_form_network.php,
* godmode/modules/manage_network_components_form_wmi.php,
* godmode/servers/manage_export.php,
* godmode/servers/manage_recontask.php,
* godmode/servers/modificar_server.php: Some translatable strings
* reused to simplify i18n work.
* include/languages/es.po, include/languages/es.mo: Updated Spanish
* translation.
* include/languages/index.pot: Updated po template.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1763 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-06-24 15:36:29 +02:00
|
|
|
echo '<h3 class="suc">'.__('Successfully deleted export target').'</h3>';
|
2008-09-18 14:06:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Create
|
|
|
|
if ($create) {
|
|
|
|
$sql = sprintf ("INSERT INTO tserver_export
|
|
|
|
(`name`, `id_export_server`, `preffix`, `interval`, `ip_server`, `connect_mode`,
|
|
|
|
`user`, `pass`, `port`, `directory`, `options`)
|
|
|
|
VALUES ('%s', %d, '%s', %d, '%s', '%s', '%s', '%s', %d, '%s', '%s')",
|
|
|
|
$name, $export_server, $preffix, $interval, $ip_server, $connect_mode,
|
|
|
|
$user, $password, $port, $directory, $options);
|
|
|
|
|
|
|
|
if (process_sql ($sql) === false) {
|
2008-09-19 12:49:31 +02:00
|
|
|
echo '<h3 class="error">'.__('Error creating export target').'</h3>';
|
2008-09-18 14:06:21 +02:00
|
|
|
} else {
|
2008-09-19 12:49:31 +02:00
|
|
|
echo '<h3 class="suc">'.__('Successfully created export target').'</h3>';
|
2008-09-18 14:06:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// List export servers
|
2009-06-25 Jorge Gonzalez <jorgegonz@artica.es>
* include/functions_db.php, operation/snmpconsole/snmp_view.php,
* operation/agentes/status_monitor.php,
* operation/agentes/estado_grupo.php,
* operation/agentes/estado_ultimopaquete.php,
* operation/agentes/alerts_status.php,
* operation/agentes/estado_generalagente.php,
* operation/agentes/estado_agente.php,
* operation/agentes/exportdata.php,
* operation/agentes/estado_monitores.php,
* operation/agentes/tactical.php, operation/agentes/networkmap.php,
* operation/reporting/reporting_viewer.php, reporting/fgraph.php,
* general/pandora_help.php, general/logoff.php,
* general/logon_failed.php, godmode/setup/setup.php,
* godmode/setup/links.php, godmode/snmpconsole/snmp_alert.php,
* godmode/profiles/profile_list.php, godmode/db/db_main.php,
* godmode/db/db_audit.php, godmode/db/db_refine.php,
* godmode/db/db_info.php, godmode/db/db_event.php,
* godmode/db/db_purge.php,
* godmode/agentes/massive_delete_agents.php,
* godmode/agentes/massive_config.php,
* godmode/agentes/massive_delete_alerts.php,
* godmode/agentes/massive_edit_modules.php,
* godmode/agentes/module_manager.php,
* godmode/agentes/massive_delete_modules.php,
* godmode/agentes/configurar_agente.php,
* godmode/agentes/planned_downtime.php,
* godmode/modules/manage_network_templates_form.php,
* godmode/modules/manage_network_components.php,
* godmode/reporting/map_builder.php,
* godmode/reporting/map_builder_wizard.php,
* godmode/servers/manage_export.php,
* godmode/servers/manage_export_form.php,
* godmode/servers/plugin.php, godmode/servers/modificar_server.php,
* godmode/servers/manage_recontask_form.php,
* godmode/alerts/alert_compounds.php, godmode/menu.php: Some
* translatable strings reused to simplify i18n work.
* include/languages/es.po, include/languages/es.mo: Updated Spanish
* translation.
* include/languages/index.pot: Updated po template.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1768 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-06-25 10:01:18 +02:00
|
|
|
echo "<h2>".__('Pandora servers')." » ".__('Export targets')."</h2>";
|
2008-09-18 14:06:21 +02:00
|
|
|
|
|
|
|
$result = get_db_all_rows_in_table ("tserver_export");
|
|
|
|
if (!$result) {
|
|
|
|
echo '<div class="nf">'.__('There are no export targets configured').'</div>';
|
|
|
|
echo '<div class="action-buttons" style="width: 700px">';
|
|
|
|
echo '<form method="post" action="index.php?sec=gservers&sec2=godmode/servers/manage_export_form&create">';
|
|
|
|
echo print_submit_button (__('Create'),"crt",false,'class="sub next"',true);
|
|
|
|
echo '</form>';
|
|
|
|
echo '</div>';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-06-24 Jorge Gonzalez <jorgegonz@artica.es>
* include/functions_reporting.php, include/functions_ui.php,
* operation/incidents/incident.php,
* operation/snmpconsole/snmp_view.php, operation/events/events.php,
* operation/agentes/tactical.php, godmode/users/user_list.php,
* godmode/users/configure_user.php,
* godmode/profiles/profile_list.php,
* godmode/agentes/module_manager_editor_wmi.php,
* godmode/agentes/massive_edit_modules.php,
* godmode/agentes/manage_config_remote.php,
* godmode/modules/manage_network_components_form_network.php,
* godmode/modules/manage_network_components_form_wmi.php,
* godmode/servers/manage_export.php,
* godmode/servers/manage_recontask.php,
* godmode/servers/modificar_server.php: Some translatable strings
* reused to simplify i18n work.
* include/languages/es.po, include/languages/es.mo: Updated Spanish
* translation.
* include/languages/index.pot: Updated po template.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1763 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-06-24 15:36:29 +02:00
|
|
|
$table->head = array (__('Name'), __('Preffix'), __('Interval'), __('Address'), __('Transfer mode'), __('Action'));
|
2008-09-18 14:06:21 +02:00
|
|
|
//$table->align = array ("","","","center","","","center","center");
|
|
|
|
$table->width = 700;
|
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
foreach ($result as $row) {
|
|
|
|
$table->data[] = array (
|
|
|
|
// Name
|
|
|
|
'<a href="index.php?sec=gservers&sec2=godmode/servers/manage_export_form&update=' . $row['id'] . '"><b>' . $row['name'] . '</b></a>',
|
|
|
|
$row['preffix'],
|
|
|
|
$row['interval'],
|
|
|
|
$row['ip_server'],
|
|
|
|
$row['connect_mode'],
|
|
|
|
// Action
|
|
|
|
'<a href="index.php?sec=gservers&sec2=godmode/servers/manage_export&delete=' . $row['id'] . '">
|
|
|
|
<img src="images/cross.png" border="0" /></a> <a href="index.php?sec=gservers&sec2=godmode/servers/manage_export_form&update=' . $row['id'] . '">
|
|
|
|
<img src="images/config.png" /></a>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
print_table ($table);
|
|
|
|
|
|
|
|
echo '<div class="action-buttons" style="width: 700px">';
|
|
|
|
echo '<form method="post" action="index.php?sec=gservers&sec2=godmode/servers/manage_export_form&create">';
|
|
|
|
echo print_submit_button (__('Create'),"crt",false,'class="sub next"',true);
|
|
|
|
echo '</form>';
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
?>
|