2006-03-27 05:37:27 +02:00
< ? php
2008-04-03 17:43:34 +02:00
// Pandora FMS - the Free Monitoring System
2007-03-02 18:56:07 +01:00
// ========================================
2008-04-03 17:43:34 +02:00
// Copyright (c) 2008 Artica Soluciones Tecnológicas, http://www.artica.es
// Please see http://pandora.sourceforge.net for full contribution list
2006-07-11 13:02:20 +02: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-03 17:43:34 +02:00
// as published by the Free Software Foundation for version 2.
2006-07-11 13:02:20 +02: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.
2008-04-03 17:43:34 +02:00
2006-07-11 13:02:20 +02:00
// Load global vars
2006-03-27 05:37:27 +02:00
require ( " include/config.php " );
2006-07-11 13:02:20 +02:00
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
if ( defined ( 'AJAX' )) {
$get_agent_json = ( bool ) get_parameter ( 'get_agent_json' );
$get_agent_modules_json = ( bool ) get_parameter ( 'get_agent_modules_json' );
2008-06-30 10:11:10 +02:00
$get_agent_status_tooltip = ( bool ) get_parameter ( " get_agent_status_tooltip " );
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
if ( $get_agent_json ) {
$id_agent = ( int ) get_parameter ( 'id_agent' );
$agent = get_db_row ( 'tagente' , 'id_agente' , $id_agent );
echo json_encode ( $agent );
exit ();
}
if ( $get_agent_modules_json ) {
$id_agent = ( int ) get_parameter ( 'id_agent' );
$agent_modules = get_db_all_rows_field_filter ( 'tagente_modulo' , 'id_agente' , $id_agent );
echo json_encode ( $agent_modules );
exit ();
}
2008-06-30 10:11:10 +02:00
if ( $get_agent_status_tooltip ) {
$id_agent = ( int ) get_parameter ( 'id_agent' );
$agent = get_db_row ( 'tagente' , 'id_agente' , $id_agent );
echo '<h3>' . $agent [ 'nombre' ] . '</h3>' ;
echo '<strong>' . lang_string ( 'IP' ) . ':</strong> ' . $agent [ 'direccion' ] . '<br />' ;
echo '<strong>' . lang_string ( 'Last contact' ) . ':</strong> ' . $agent [ 'ultimo_contacto' ] . '<br />' ;
echo '<strong>' . lang_string ( 'Last remote contact' ) . ':</strong> ' . $agent [ 'ultimo_contacto_remoto' ] . '<br />' ;
echo '<strong>' . lang_string ( 'Group' ) . ':</strong> ' ;
echo '<img src="images/groups_small/' . dame_grupo_icono ( $agent [ 'id_grupo' ]) . '.png" /> ' ;
echo dame_nombre_grupo ( $agent [ 'id_grupo' ]) . '<br />' ;
$sql = sprintf ( ' SELECT tagente_modulo . descripcion , tagente_modulo . nombre
FROM tagente_estado , tagente_modulo
WHERE tagente_modulo . id_agente = % d
AND tagente_modulo . id_tipo_modulo in ( 2 , 6 , 9 , 18 , 21 , 100 )
AND tagente_estado . id_agente_modulo = tagente_modulo . id_agente_modulo
AND tagente_modulo . disabled = 0
AND tagente_estado . estado = 1 ' , $id_agent );
$bad_modules = get_db_all_rows_sql ( $sql );
$sql = sprintf ( ' SELECT COUNT ( * )
FROM tagente_modulo
WHERE id_agente = % d
AND id_tipo_modulo in ( 2 , 6 , 9 , 18 , 21 , 100 ) ' , $id_agent );
$total_modules = get_db_sql ( $sql );
echo '<strong>' . lang_string ( 'Monitors down' ) . ':</strong> ' . sizeof ( $bad_modules ) . ' / ' . $total_modules ;
if ( sizeof ( $bad_modules )) {
echo '<ul>' ;
foreach ( $bad_modules as $module ) {
echo '<li>' ;
if ( $module [ 'descripcion' ] != '' )
$name = $module [ 'descripcion' ];
else
$name = $module [ 'nombre' ];
echo substr ( $name , 0 , 25 );
if ( strlen ( $name ) > 25 )
echo '(...)' ;
echo '</li>' ;
}
echo '</ul>' ;
}
echo '<br />' ;
exit ();
}
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
exit ();
}
2006-03-27 05:37:27 +02:00
if ( comprueba_login () == 0 ) {
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
$id_agente = get_parameter ( " id_agente " , - 1 );
2007-10-08 17:29:38 +02:00
if ( $id_agente != - 1 ){
2006-03-27 05:37:27 +02:00
// get group for this id_agente
$query = " SELECT * FROM tagente WHERE id_agente = " . $id_agente ;
$res = mysql_query ( $query );
$row = mysql_fetch_array ( $res );
$id_grupo = $row [ " id_grupo " ];
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
$id_usuario = $config [ " id_user " ];
2006-03-27 05:37:27 +02:00
if ( give_acl ( $id_usuario , $id_grupo , " AR " ) == 1 ){
2007-10-03 14:41:29 +02:00
// Check for validate alert request
2008-06-18 Esteban Sanchez <estebans@artica.es>
* functions.php: Added documentation to all the functions in JavaDoc
format, which is an facto-standard. Deleted unused functions. Improved
the code of some functions. Tab and blankspaces style correction.
Replaced old lang_label with lang_string(). Some functions to print
selects were replaced with a functio to get an array with all the
possible values so the caller will use print_select() with them.
* godmode/agentes/agent_manager.php: Use print_select() instead of
deleted function.
* godmode/agentes/alert_manager_editor.php: Use print_select() instead
of deleted function. Use print_checkbox(). Style correction
* godmode/reporting/map_builder.php, operation/agentes/ver_agente.php,
operation/messages/message.php,
operation/reporting/reporting_viewer_pdf.php:
Replaced deleted functions with their equivalents.
* include/functions_db.php: Documented some functions, some work is
still required. Added get_reports() to get all the reports a user can
see. Deleted unused functions. Replaced deleted functions with their
equivalents. Added get_db_row_sql(), get_previous_data(). Fixed errors
when calculating average, max, min and sum values of an agent module.
* include/functions_reporting.php: Fixed errors when calculating SLA.
* operation/events/events.php: Tab and blankspaces correction.
Replaced form_priority with print_select(). Style correction.
* operation/reporting/custom_reporting.php: Show all the reports a
user can see. Use Pandora functions.
* operation/reporting/reporting_viewer.php: Show unknown label if SLA
can not be calculated.
* operation/snmpconsole/snmp_alert.php: Avoid an extra indentation
level by using check_login() properly. Tab and blankspaces correction.
* index.php, operation/users/user_edit.php: Adopted to renamed
function.
* godmode/db/db_sanity.php, reporting/fgraph.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-19 11:01:12 +02:00
$validate_alert = get_parameter ( " validate_alert " );
2007-10-03 14:41:29 +02:00
if ( $validate_alert != " " ){
if ( give_acl ( $id_usuario , $id_grupo , " AW " ) == 1 ){
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
$alert_row = get_db_row ( " talerta_agente_modulo " , " id_aam " , $validate_alert );
2008-06-16 20:09:56 +02:00
if ( $alert_row [ " id_agente_modulo " ] != 0 ){
$am_row = get_db_row ( " tagente_modulo " , " id_agente_modulo " , $alert_row [ " id_agente_modulo " ]);
$ag_row = get_db_row ( " tagente " , " id_agente " , $am_row [ " id_agente " ]);
} else {
$ag_row = get_db_row ( " tagente " , " id_agente " , $alert_row [ " id_agent " ]);
}
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
$alert_name = $alert_row [ " descripcion " ];
2008-06-16 20:09:56 +02:00
// Single alerts
if ( $alert_row [ " id_agente_modulo " ] != 0 ){
event_insert ( " Manual validation of alert for ' $alert_name ' " , $ag_row [ " id_grupo " ], $am_row [ " id_agente " ], 1 , $config [ " id_user " ], " alert_manual_validation " , 1 , $alert_row [ " id_agente_modulo " ], $validate_alert );
// Combined alerts
} else {
event_insert ( " Manual validation of alert for ' $alert_name ' " , $ag_row [ " id_grupo " ], $alert_row [ " id_agent " ], 1 , $config [ " id_user " ], " alert_manual_validation " , 1 , 0 , $validate_alert );
}
2007-10-03 14:41:29 +02:00
$sql = 'UPDATE talerta_agente_modulo SET times_fired = 0, internal_counter = 0 WHERE id_aam = ' . $validate_alert ;
$result = mysql_query ( $sql );
}
}
2006-03-27 05:37:27 +02:00
// Check for Network FLAG change request
if ( isset ( $_GET [ " flag " ])){
if ( $_GET [ " flag " ] == 1 ){
if ( give_acl ( $id_usuario , $id_grupo , " AW " ) == 1 ){
$query = " UPDATE tagente_modulo SET flag=1 WHERE id_agente_modulo = " . $_GET [ " id_agente_modulo " ];
$res = mysql_query ( $query );
}
}
}
2008-06-16 20:09:56 +02:00
// Check for Network FLAG change request
if ( isset ( $_GET [ " flag_agent " ])){
if ( $_GET [ " flag_agent " ] == 1 ){
if ( give_acl ( $id_usuario , $id_grupo , " AW " ) == 1 ){
$query = " UPDATE tagente_modulo SET flag=1 WHERE id_agente = " . $id_agente ;
$res = mysql_query ( $query );
}
}
}
2006-03-27 05:37:27 +02:00
if ( give_acl ( $id_usuario , $id_grupo , " AR " ) == 1 ){
2008-04-03 17:43:34 +02:00
echo " <div id='menu_tab_frame_view'> " ;
2007-03-12 18:58:52 +01:00
echo " <div id='menu_tab_left'>
2007-05-27 04:55:55 +02:00
< ul class = 'mn' >
< li class = 'view' >
2007-08-28 15:33:54 +02:00
< a href = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente' >< img src = 'images/bricks.png' class = 'top' border = 0 >& nbsp ; " .substr(dame_nombre_agente( $id_agente ),0,15). " - " . $lang_label["view_mode"] . " </ a > " ;
2007-03-12 18:58:52 +01:00
echo " </li> " ;
echo " </ul></div> " ;
2007-02-22 20:48:12 +01:00
if ( isset ( $_GET [ " tab " ]))
$tab = $_GET [ " tab " ];
else
$tab = " main " ;
2007-03-28 18:07:29 +02:00
echo " <div id='menu_tab'><ul class='mn'> " ;
2007-03-02 18:56:07 +01:00
if ( give_acl ( $id_usuario , $id_grupo , " AW " ) == 1 ){
2008-04-03 17:43:34 +02:00
if ( $tab == " manage " )
echo " <li class='nomn_high'> " ;
else
echo " <li class='nomn'> " ;
2007-03-02 18:56:07 +01:00
// Manage agent
2008-04-03 17:43:34 +02:00
echo " <a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente= $id_agente '><img src='images/setup.png' width='16' class='top' border=0> " . $lang_label [ " Manage " ] . " </a> " ;
2007-03-02 18:56:07 +01:00
echo " </li> " ;
}
// Main view
2008-04-03 17:43:34 +02:00
if ( $tab == " main " )
echo " <li class='nomn_high'> " ;
else
echo " <li class='nomn'> " ;
2007-03-28 18:07:29 +02:00
echo " <a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente= $id_agente '><img src='images/monitor.png' class='top' border=0> " . $lang_label [ " Main " ] . " </a> " ;
2007-03-02 18:56:07 +01:00
echo " </li> " ;
// Data
2008-04-03 17:43:34 +02:00
if ( $tab == " data " )
echo " <li class='nomn_high'> " ;
else
echo " <li class='nomn'> " ;
2007-03-28 18:07:29 +02:00
echo " <a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente= $id_agente &tab=data'><img src='images/lightbulb.png' class='top' border=0> " . $lang_label [ " Data " ] . " </a> " ;
2007-02-27 20:03:56 +01:00
echo " </li> " ;
2007-03-02 18:56:07 +01:00
// Alerts
2008-04-03 17:43:34 +02:00
if ( $tab == " alert " )
echo " <li class='nomn_high'> " ;
else
echo " <li class='nomn'> " ;
2007-04-18 23:45:03 +02:00
echo " <a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente= $id_agente &tab=alert'><img src='images/bell.png' class='top' border=0> " . $lang_label [ " Alerts " ] . " </a> " ;
2007-02-27 20:03:56 +01:00
echo " </li> " ;
2007-03-02 18:56:07 +01:00
// Go to group view
2007-02-27 20:03:56 +01:00
echo " <li class='nomn'> " ;
2007-03-28 18:07:29 +02:00
echo " <a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id= $id_grupo &refr=60'><img src='images/images.png' class='top' border=0> " . $lang_label [ " group_view_tab " ] . " </a> " ;
2007-02-27 20:03:56 +01:00
echo " </li> " ;
2007-03-02 18:56:07 +01:00
2007-02-27 20:03:56 +01:00
echo " </ul> " ;
echo " </div> " ;
2008-04-03 17:43:34 +02:00
echo " </div> " ;
2007-03-02 18:56:07 +01:00
echo " <div style='height: 25px'> </div> " ;
2007-02-22 20:48:12 +01:00
switch ( $tab ) {
2007-03-02 18:56:07 +01:00
/* http://pandora.localhost/index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=600 */
2008-04-03 17:43:34 +02:00
case " manage " :
require " estado_generalagente.php " ;
break ;
2007-03-02 18:56:07 +01:00
2008-04-03 17:43:34 +02:00
case " main " :
require " estado_generalagente.php " ;
require " estado_monitores.php " ;
require " estado_alertas.php " ;
2008-06-13 Sancho Lerena <slerena@gmail.com>
* index.php: Added pure (Fullscreen). HTML code cleanup and user session.
* pandoradb.sql: talert_snmp: Added priority field.
* pandoradb_data.sql: Changes default values in talerta. tconfig_os, tgrupo
and some links.
* header.php: Fixed some user session management.
* logon_ok.php: New design for welcome screen, odometer is over.
* menu.php, godmode/menu.php: Some ACL improvements.
* agent_disk_conf_editor.php: Minor fix in view link.
* configurar_agente.php, agent_manager.php: Added parent combo and better
ACL checks. New remote configuration control for get timestamp info of
config file.
* modify_alert.php: Changes to use new internal Mail alert.
* config.php: Some items moved to config_process. (font, attachment and
default style).
* functions.php: Added form_agent_combo(), form_event_type_combo(),
form_priority() and return_priority() functions.
* functions_db.php: Added smal_event_table() to render a variable table
with latest events (filtered).
* pandora.css. Added pure and priority colors.
* estado_alertas.php: Fixed ACL problems.
* stado_generalagente.php: Graph of modules now represents modules that
has generated events. Old graph is not used anymore. Also display parent.
* estado_grupo.php: Border of boxes is now thicker.
* tactical.php: New screen, almost all code changed. Odometer is not used
anymore, added some new items, like module LAG meter, module sanity, and
other general metrics.
* ver_agente.php: Now renders also event for each agent view. Alert manual
validation generate a new event.
* events.php: New event system. 90% new code. A LOT of new features,
including full screen, coloured (by priority) and filters by six fields.
* snmp_alert.php: Added support for alert priority.
* operation/users/user.php: No longer a user with UM privileges could
see any other user.
* render_view.php: Added fullscreen support for visual maps.
* fgraph.php: Added support for session checking in graphs (at least!).
New graphics for events (some changed it's function like events by group),
and feature added to progress GD implementation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-13 18:59:54 +02:00
require " status_events.php " ;
2008-04-03 17:43:34 +02:00
break ;
2007-03-19 20:39:40 +01:00
2008-04-03 17:43:34 +02:00
case " data " :
require " estado_ultimopaquete.php " ;
break ;
2007-03-19 20:39:40 +01:00
2008-04-03 17:43:34 +02:00
case " alert " :
require " estado_alertas.php " ;
break ;
2007-02-22 20:48:12 +01:00
}
2006-03-27 05:37:27 +02:00
} else {
audit_db ( $id_usuario , $REMOTE_ADDR , " ACL Violation " , " Trying to read data from agent " . dame_nombre_agente ( $id_agente ));
require ( " general/noaccess.php " );
}
} else {
audit_db ( $id_usuario , $REMOTE_ADDR , " ACL Violation " , " Trying to access (read) to agent " . dame_nombre_agente ( $id_agente ));
include ( " general/noaccess.php " );
}
}
}
2007-03-28 18:07:29 +02:00
?>