2007-02-27 20:03:56 +01:00
|
|
|
<?PHP
|
|
|
|
|
2008-04-01 15:53:11 +02:00
|
|
|
// Pandora FMS - the Free Monitoring System
|
2007-03-12 18:58:52 +01:00
|
|
|
// ========================================
|
2008-04-01 15:53:11 +02:00
|
|
|
// Copyright (c) 2008 Artica Soluciones Tecnológicas, http://www.artica.es
|
2008-04-03 Jorge Gonzalez <jo[Brge.gonzalez@artica.es>
* include/functions_db.php: New functions added to handle plugins and
export servers.
* include/languages/language_en.php: Updated English translation file.
* general/header.php: Updated header.
* godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/agent_manager.php, godmode/modules/module_list.php:
Added infrastructure to add/edit modules.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@792 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-04-03 18:52:11 +02:00
|
|
|
// Copyright (c) 2008 Jorge Gonzalez <jorge.gonzalez@artica.es>
|
2008-04-01 15:53:11 +02:00
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
|
|
|
|
2007-03-12 18:58:52 +01:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-04-01 15:53:11 +02:00
|
|
|
// as published by the Free Software Foundation for version 2.
|
2007-03-12 18:58:52 +01:00
|
|
|
// 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.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
2007-02-27 20:03:56 +01:00
|
|
|
// ========================
|
|
|
|
// AGENT GENERAL DATA FORM
|
|
|
|
// ========================
|
2007-03-02 18:56:07 +01:00
|
|
|
// Load global vars
|
|
|
|
require("include/config.php");
|
|
|
|
|
|
|
|
if (give_acl($id_user, 0, "AW")!=1) {
|
|
|
|
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access agent manager");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
};
|
2007-02-27 20:03:56 +01:00
|
|
|
|
|
|
|
echo "<h2>".$lang_label["agent_conf"];
|
2007-03-12 18:58:52 +01:00
|
|
|
if (isset($_GET["create_agent"])){
|
|
|
|
$create_agent = 1;
|
2007-10-12 18:27:50 +02:00
|
|
|
echo " > ".$lang_label["create_agent"];
|
2007-02-27 20:03:56 +01:00
|
|
|
} else {
|
2007-10-12 18:27:50 +02:00
|
|
|
echo " > ".$lang_label["update_agent"];
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
|
|
|
echo "</h2>";
|
2007-03-12 18:58:52 +01:00
|
|
|
echo "<div style='height: 5px'> </div>";
|
2007-02-27 20:03:56 +01:00
|
|
|
|
|
|
|
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&
|
|
|
|
sec2=godmode/agentes/configurar_agente">';
|
2007-03-12 18:58:52 +01:00
|
|
|
if ($create_agent == 1) {
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "<input type='hidden' name='create_agent' value='1'>";
|
|
|
|
} else {
|
|
|
|
echo "<input type='hidden' name='update_agent' value='1'>";
|
|
|
|
echo "<input type='hidden' name='id_agente' value='".$id_agente."'>";
|
|
|
|
}
|
2007-05-20 19:12:31 +02:00
|
|
|
echo '<table width="650" cellpadding="4" cellspacing="4" class="databox_color">';
|
|
|
|
echo "<tr>";
|
2007-02-27 20:03:56 +01:00
|
|
|
echo '<td class="datos"><b>'.$lang_label["agent_name"].'</b></td>
|
|
|
|
<td class="datos">
|
|
|
|
<input type="text" name="agente" size=30 value="'.$nombre_agente.'">';
|
2007-07-16 20:47:39 +02:00
|
|
|
|
2007-07-19 21:03:37 +02:00
|
|
|
if ((isset($id_agente)) && ($id_agente != "")){
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "
|
|
|
|
<a href='index.php?sec=estado&
|
|
|
|
sec2=operation/agentes/ver_agente&id_agente=".$id_agente."'>
|
2007-06-27 19:45:42 +02:00
|
|
|
<img src='images/lupa.png' border='0' align='middle' alt=''></a>";
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
2007-04-18 11:58:26 +02:00
|
|
|
|
|
|
|
echo '<tr><td class="datos2">';
|
|
|
|
echo '<b>'.$lang_label["ip_address"].'</b>';
|
|
|
|
echo '<td class="datos2">';
|
|
|
|
echo '<input type="text" name="direccion" size="12" value="'.$direccion_agente.'">';
|
|
|
|
|
2007-08-23 17:52:42 +02:00
|
|
|
if ($create_agent != 1){
|
|
|
|
echo " ";
|
|
|
|
|
|
|
|
echo '<select name="address_list">';
|
|
|
|
$sql1 = "SELECT * FROM taddress, taddress_agent
|
|
|
|
WHERE taddress.id_a = taddress_agent.id_a
|
|
|
|
AND taddress_agent.id_agent = $id_agente";
|
|
|
|
if ($result=mysql_query($sql1))
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
|
|
|
echo "<option value='".salida_limpia($row["ip"])."'>".salida_limpia($row["ip"])." ";
|
|
|
|
}
|
|
|
|
echo "</select>";
|
|
|
|
|
|
|
|
echo "<input name='delete_ip' type=checkbox value='1'> ".$lang_label["delete_sel"];
|
|
|
|
echo "</td>";
|
|
|
|
}
|
2007-04-18 11:58:26 +02:00
|
|
|
|
|
|
|
echo '<tr><td class="datos"><b>'.$lang_label["group"].'</b>';
|
|
|
|
echo '<td class="datos"><select name="grupo" class="w130">';
|
|
|
|
|
2007-02-27 20:03:56 +01:00
|
|
|
if (isset($grupo)){
|
2007-05-28 21:15:44 +02:00
|
|
|
echo "<option value='".$grupo."'>".dame_grupo($grupo)."</option>";
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
|
|
|
$sql1='SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre';
|
|
|
|
$result=mysql_query($sql1);
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
|
|
|
// Group ALL cannot be selected
|
|
|
|
if ($row["id_grupo"] != 1){
|
2007-05-28 21:15:44 +02:00
|
|
|
echo "<option value='".$row["id_grupo"]."'>".$row["nombre"]."</option>";
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<tr><td class="datos2"><b><?php echo $lang_label["interval"]?></b></td>
|
|
|
|
<td class="datos2">
|
|
|
|
<input type="text" name="intervalo" size="15" value="
|
|
|
|
<?php echo $intervalo?>"></td>
|
|
|
|
<tr><td class="datos"><b><?php echo $lang_label["os"]?></b></td>
|
|
|
|
<td class="datos">
|
|
|
|
<select name="id_os" class="w130">
|
|
|
|
<?php
|
|
|
|
if (isset($id_os)){
|
2007-05-28 21:15:44 +02:00
|
|
|
echo "<option value='".$id_os."'>".dame_so_name($id_os)."</option>";
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
|
|
|
$sql1='SELECT id_os, name FROM tconfig_os ORDER BY name';
|
|
|
|
$result=mysql_query($sql1);
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
2007-05-28 21:15:44 +02:00
|
|
|
echo "<option value='".$row["id_os"]."'>".$row["name"]."</option>";
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
|
2008-03-06 Sancho Lerena <slerena@gmail.com>
Pandora FMS 2.0 development first commit. 1.4 version is now 2.0
* pandoradb_data.sql: Added correct tnetwork_components, fixed
ttipo_modulo (categoria values).
* include/styles/pandora.css: Added some server icons, tab style
for module editor has been improved.
* include/functions_db.php: added new functions, lang_string and
check_login, and a first review of several functions that currently
need change for new config session parameters in array $config[]
* include/javascript/pandora.js: Added a new global include for
spare javascript functions before included into a few pages.
* include/languages/language_en.php: New tokens.
* include/help*: New contextual help system.
* include/config_process.php: New way to manage config.
* include/functions.php: Added new functions to manage global
* operation/agentes/estado_ultimopaquete.php: removed old javascript
code from there.
* operation/agentes/estado_agente.php: Removed references to deprecated
field "agent_type".
* operation/agentes/tactical.php: Some code cleanup and progressbar
issues merged from 1.3.1 branch. Need to add support to new server
types and new module types.
* operation/servers/view_server.php: Added support to new servers, code
cleanup.
* reporting/fgraph.php: Code cleanup, changes to use new config method,
and a lot of style change.
* general/pandora_help.php: New source for contextual help in the way
of moodle.
* general/footer.php, general/noaccess.php: Code cleanup and uses of
new config.
* module_manager_editor: New editors for each module family. Need
finish and implement EDITION of data, now only inserts data.
* godmode/agentes/agent_manager.php: Implemented new server assigment
and edition.
* godmode/agentes/configurar_agente.php: Small changes that affects
module management, visualization and agent management.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@739 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-03-07 17:22:16 +01:00
|
|
|
<?PHP
|
|
|
|
|
|
|
|
// Network server
|
|
|
|
echo '<tr><td class="datos2"><b>';
|
|
|
|
echo lang_string("Network server");
|
|
|
|
echo '</b></td><td class="datos2">';
|
|
|
|
echo '<select name="network_server" class="w130">';
|
|
|
|
echo "<option value='".$id_network_server."'>".give_server_name($id_network_server);
|
|
|
|
$sql1 = 'SELECT id_server, name FROM tserver where network_server = 1 ORDER BY name';
|
2007-02-27 20:03:56 +01:00
|
|
|
$result=mysql_query($sql1);
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
2007-05-28 21:15:44 +02:00
|
|
|
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
2007-02-27 20:03:56 +01:00
|
|
|
}
|
2008-03-06 Sancho Lerena <slerena@gmail.com>
Pandora FMS 2.0 development first commit. 1.4 version is now 2.0
* pandoradb_data.sql: Added correct tnetwork_components, fixed
ttipo_modulo (categoria values).
* include/styles/pandora.css: Added some server icons, tab style
for module editor has been improved.
* include/functions_db.php: added new functions, lang_string and
check_login, and a first review of several functions that currently
need change for new config session parameters in array $config[]
* include/javascript/pandora.js: Added a new global include for
spare javascript functions before included into a few pages.
* include/languages/language_en.php: New tokens.
* include/help*: New contextual help system.
* include/config_process.php: New way to manage config.
* include/functions.php: Added new functions to manage global
* operation/agentes/estado_ultimopaquete.php: removed old javascript
code from there.
* operation/agentes/estado_agente.php: Removed references to deprecated
field "agent_type".
* operation/agentes/tactical.php: Some code cleanup and progressbar
issues merged from 1.3.1 branch. Need to add support to new server
types and new module types.
* operation/servers/view_server.php: Added support to new servers, code
cleanup.
* reporting/fgraph.php: Code cleanup, changes to use new config method,
and a lot of style change.
* general/pandora_help.php: New source for contextual help in the way
of moodle.
* general/footer.php, general/noaccess.php: Code cleanup and uses of
new config.
* module_manager_editor: New editors for each module family. Need
finish and implement EDITION of data, now only inserts data.
* godmode/agentes/agent_manager.php: Implemented new server assigment
and edition.
* godmode/agentes/configurar_agente.php: Small changes that affects
module management, visualization and agent management.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@739 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-03-07 17:22:16 +01:00
|
|
|
echo '</select>';
|
|
|
|
|
|
|
|
// Plugin Server
|
|
|
|
echo '<tr><td class="datos"><b>';
|
|
|
|
echo lang_string("Plugin server");
|
|
|
|
echo '</b></td><td class="datos">';
|
|
|
|
echo '<select name="plugin_server" class="w130">';
|
|
|
|
echo "<option value='".$id_plugin_server."'>".give_server_name($id_plugin_server);
|
|
|
|
$sql1 = 'SELECT id_server, name FROM tserver where plugin_server = 1 ORDER BY name';
|
|
|
|
$result=mysql_query($sql1);
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
|
|
|
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
|
|
|
}
|
|
|
|
echo '</select>';
|
|
|
|
|
|
|
|
// WMI Server
|
|
|
|
echo '<tr><td class="datos2"><b>';
|
|
|
|
echo lang_string("WMI server");
|
|
|
|
echo '</b></td><td class="datos2">';
|
|
|
|
echo '<select name="wmi_server" class="w130">';
|
|
|
|
echo "<option value='".$id_wmi_server."'>".give_server_name($id_wmi_server);
|
|
|
|
$sql1 = 'SELECT id_server, name FROM tserver where wmi_server = 1 ORDER BY name';
|
|
|
|
$result=mysql_query($sql1);
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
|
|
|
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
|
|
|
}
|
|
|
|
echo '</select>';
|
|
|
|
|
|
|
|
// Prediction Server
|
|
|
|
echo '<tr><td class="datos"><b>';
|
|
|
|
echo lang_string("Prediction server");
|
|
|
|
echo '</b></td><td class="datos">';
|
|
|
|
echo '<select name="prediction_server" class="w130">';
|
|
|
|
echo "<option value='".$id_prediction_server."'>".give_server_name($id_prediction_server);
|
|
|
|
$sql1 = 'SELECT id_server, name FROM tserver where prediction_server = 1 ORDER BY name';
|
|
|
|
$result=mysql_query($sql1);
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
|
|
|
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
|
|
|
}
|
|
|
|
echo '</select>';
|
|
|
|
|
|
|
|
// Description
|
|
|
|
echo '<tr><td class="datos2"><b>';
|
|
|
|
echo lang_string ("description");
|
|
|
|
echo '</b><td class="datos2">';
|
|
|
|
echo '<input type="text" name="comentarios" size="55" value="'.$comentarios.'"></td>';
|
|
|
|
|
|
|
|
|
|
|
|
// Learn mode / Normal mode
|
|
|
|
echo '<tr><td class="datos"><b>';
|
|
|
|
echo lang_string ("module_definition");
|
|
|
|
echo '</b><td class="datos">';
|
|
|
|
if ($modo == "1"){
|
|
|
|
echo $lang_label["learning_mode"].'
|
|
|
|
<input type="radio" class="chk" name="modo" value="1" style="margin-right: 40px;" checked>';
|
|
|
|
echo $lang_label["normal_mode"].'
|
|
|
|
<input type="radio" class="chk" name="modo" value="0">';
|
|
|
|
} else {
|
|
|
|
echo $lang_label["learning_mode"].'
|
|
|
|
<input type="radio" class="chk" name="modo" value="1" style="margin-right: 40px;">';
|
|
|
|
echo $lang_label["normal_mode"].'
|
|
|
|
<input type="radio" name="modo" class="chk" value="0" checked>';
|
|
|
|
}
|
2007-02-27 20:03:56 +01:00
|
|
|
|
|
|
|
?>
|
2008-03-06 Sancho Lerena <slerena@gmail.com>
Pandora FMS 2.0 development first commit. 1.4 version is now 2.0
* pandoradb_data.sql: Added correct tnetwork_components, fixed
ttipo_modulo (categoria values).
* include/styles/pandora.css: Added some server icons, tab style
for module editor has been improved.
* include/functions_db.php: added new functions, lang_string and
check_login, and a first review of several functions that currently
need change for new config session parameters in array $config[]
* include/javascript/pandora.js: Added a new global include for
spare javascript functions before included into a few pages.
* include/languages/language_en.php: New tokens.
* include/help*: New contextual help system.
* include/config_process.php: New way to manage config.
* include/functions.php: Added new functions to manage global
* operation/agentes/estado_ultimopaquete.php: removed old javascript
code from there.
* operation/agentes/estado_agente.php: Removed references to deprecated
field "agent_type".
* operation/agentes/tactical.php: Some code cleanup and progressbar
issues merged from 1.3.1 branch. Need to add support to new server
types and new module types.
* operation/servers/view_server.php: Added support to new servers, code
cleanup.
* reporting/fgraph.php: Code cleanup, changes to use new config method,
and a lot of style change.
* general/pandora_help.php: New source for contextual help in the way
of moodle.
* general/footer.php, general/noaccess.php: Code cleanup and uses of
new config.
* module_manager_editor: New editors for each module family. Need
finish and implement EDITION of data, now only inserts data.
* godmode/agentes/agent_manager.php: Implemented new server assigment
and edition.
* godmode/agentes/configurar_agente.php: Small changes that affects
module management, visualization and agent management.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@739 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-03-07 17:22:16 +01:00
|
|
|
<tr><td class="datos2"><b><?php echo $lang_label["status"]?></b>
|
2007-02-27 20:03:56 +01:00
|
|
|
<td class="datos2">
|
|
|
|
<?php if ($disabled == "1"){
|
|
|
|
echo $lang_label["disabled"].'
|
2007-05-27 04:55:55 +02:00
|
|
|
<input type="radio" class="chk" name="disabled" value="1" style="margin-right: 40px;" checked>';
|
2007-02-27 20:03:56 +01:00
|
|
|
echo $lang_label["active"].'
|
|
|
|
<input class="chk" type="radio" name="disabled" value="0">';
|
|
|
|
} else {
|
|
|
|
echo $lang_label["disabled"].'
|
2007-05-27 04:55:55 +02:00
|
|
|
<input type="radio" class="chk" name="disabled" value="1" style="margin-right: 40px;">';
|
2007-02-27 20:03:56 +01:00
|
|
|
echo $lang_label["active"].'
|
|
|
|
<input type="radio" name="disabled" class="chk" value="0" checked>';
|
|
|
|
}
|
2007-05-20 19:12:31 +02:00
|
|
|
|
|
|
|
echo '</table><table width="650"><tr><td align="right">';
|
2007-03-12 18:58:52 +01:00
|
|
|
if ($create_agent == 1){
|
2007-02-27 20:03:56 +01:00
|
|
|
echo "
|
2007-05-08 13:24:57 +02:00
|
|
|
<input name='crtbutton' type='submit' class='sub wand' value='".
|
2007-02-27 20:03:56 +01:00
|
|
|
$lang_label["create"]."'>";
|
|
|
|
} else {
|
|
|
|
echo "
|
2007-05-08 13:24:57 +02:00
|
|
|
<input name='uptbutton' type='submit' class='sub upd' value='".
|
2007-02-27 20:03:56 +01:00
|
|
|
$lang_label["update"]."'>";
|
|
|
|
}
|
2007-05-20 19:12:31 +02:00
|
|
|
echo "</td></form></table>";
|
|
|
|
|
2007-02-27 20:03:56 +01:00
|
|
|
?>
|