2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
|
|
|
|
2008-01-10 17:40:00 +01:00
|
|
|
// Pandora FMS - the Free Monitoring System
|
|
|
|
// ========================================
|
2008-04-03 17:43:34 +02:00
|
|
|
// Copyright (c) 2008 Artica Soluciones Tecnológicas, http://www.artica.es
|
2008-01-10 17:40:00 +01:00
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-04-03 17:43:34 +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.
|
|
|
|
// 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.
|
|
|
|
|
2006-07-11 10:49:21 +02:00
|
|
|
// Load global vars
|
2006-03-27 05:37:27 +02:00
|
|
|
require("include/config.php");
|
2006-07-11 10:49:21 +02:00
|
|
|
|
2007-03-12 18:58:52 +01:00
|
|
|
$modules_server = 0;
|
2007-07-16 20:47:39 +02:00
|
|
|
$total_modules_network = 0;
|
2007-03-12 18:58:52 +01:00
|
|
|
$total_modules_data = 0;
|
|
|
|
|
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
|
|
|
if (comprueba_login() != 0) {
|
2008-07-03 13:47:53 +02:00
|
|
|
audit_db($config["id_user"],$REMOTE_ADDR, "ACL Violation","Trying to access Agent view");
|
|
|
|
require ($config["homeurl"]."/general/noaccess.php");
|
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
|
|
|
}
|
|
|
|
|
|
|
|
if ((give_acl($id_user, 0, "AR")==0) AND (give_acl($id_user,0,"AW") == 0) AND (dame_admin($id_user) == 0) ){
|
2008-07-03 13:47:53 +02:00
|
|
|
audit_db($config["id_user"],$REMOTE_ADDR, "ACL Violation","Trying to access Agent view");
|
|
|
|
require ($config["homeurl"]."/general/noaccess.php");
|
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
|
|
|
}
|
|
|
|
|
2008-07-03 13:47:53 +02:00
|
|
|
echo "<h2>".lang_string ("view_servers")." > ";
|
|
|
|
echo lang_string ("server_detail")."</h2>";
|
|
|
|
|
|
|
|
$total_modules = (int) get_db_sql ("SELECT COUNT(*)
|
|
|
|
FROM tagente_modulo
|
|
|
|
WHERE tagente_modulo.disabled = 0");
|
|
|
|
$servers = get_db_all_rows_in_table ('tserver');
|
|
|
|
if (sizeof ($servers) == 0)
|
|
|
|
return;
|
|
|
|
|
2008-07-22 18:21:05 +02:00
|
|
|
$table->width = '98%';
|
2008-07-03 13:47:53 +02:00
|
|
|
$table->size = array ();
|
|
|
|
$table->size[6] = '60';
|
|
|
|
$table->align = array ();
|
|
|
|
$table->align[1] = 'center';
|
|
|
|
$table->align[6] = 'center';
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = lang_string ("name");
|
|
|
|
$table->head[1] = lang_string ('status');
|
|
|
|
$table->head[2] = lang_string ('load');
|
|
|
|
$table->head[3] = lang_string ('modules');
|
|
|
|
$table->head[4] = lang_string ('lag');
|
|
|
|
$table->head[5] = lang_string ('description');
|
|
|
|
$table->head[6] = lang_string ('type');
|
|
|
|
$table->head[7] = lang_string ('version');
|
|
|
|
$table->head[8] = lang_string ('lastupdate');
|
|
|
|
$table->data = array ();
|
|
|
|
|
|
|
|
foreach ($servers as $server) {
|
|
|
|
$data = array ();
|
|
|
|
$serverinfo = server_status ($server['id_server']);
|
|
|
|
$data[0] = $server['name'];
|
|
|
|
if ($server['status'] == 0){
|
|
|
|
$data[1] = '<img src="images/pixel_red.png" width="20" height="20">';
|
|
|
|
} else {
|
|
|
|
$data[1] = '<img src="images/pixel_green.png" width="20" height="20">';
|
|
|
|
}
|
|
|
|
// Load
|
|
|
|
if ($total_modules > 0)
|
|
|
|
$load_percent = $serverinfo["modules"] / ($total_modules / 100);
|
|
|
|
else
|
|
|
|
$load_percent = 0;
|
|
|
|
if ($load_percent > 100)
|
|
|
|
$load_percent = 100;
|
|
|
|
$data[2] = '<img src="reporting/fgraph.php?tipo=progress&percent='.$load_percent.'&height=18&width=80">';
|
|
|
|
$data[3] = $serverinfo["modules"] . " ".lang_string("of")." ". $total_modules;
|
|
|
|
$data[4] = human_time_description_raw ($serverinfo["lag"]) . " / ". $serverinfo["module_lag"];
|
|
|
|
$data[5] = '<span title="'.$server['description'].'">'.substr ($server['description'], 0, 25).'</span>';
|
|
|
|
$data[6] = '';
|
|
|
|
if ($server['network_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/network.png" title="'.lang_string ('network_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['data_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/data.png" title="'.lang_string ('data_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['snmp_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/snmp.png" title="'.lang_string ('snmp_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['recon_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/recon.png" title="'.lang_string ('recon_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['export_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/database_refresh.png" title="'.lang_string ('export_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['wmi_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/wmi.png" title="'.lang_string ('wmi_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['prediction_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/chart_bar.png" title="'.lang_string ('prediction_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['plugin_server'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/plugin.png" title="'.lang_string ('plugin_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['master'] == 1) {
|
|
|
|
$data[6] .= ' <img src="images/master.png" title="'.lang_string ('master_server').'">';
|
|
|
|
}
|
|
|
|
if ($server['checksum'] == 1){
|
|
|
|
$data[6] .= ' <img src="images/binary.png" title="'.lang_string ('checksum').'">';
|
2006-12-07 19:53:43 +01:00
|
|
|
}
|
2008-07-03 13:47:53 +02:00
|
|
|
$data[7] = $server['version'];
|
2008-07-22 18:21:05 +02:00
|
|
|
$data[8] = human_time_comparation ($server['keepalive']) . "</td>";
|
2008-07-03 13:47:53 +02:00
|
|
|
|
|
|
|
array_push ($table->data, $data);
|
2006-03-27 05:37:27 +02: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
|
|
|
|
2008-07-03 13:47:53 +02:00
|
|
|
print_table ($table);
|
2007-04-18 18:48:38 +02:00
|
|
|
?>
|