2006-03-27 05:37:27 +02:00
< ? php
2008-08-22 20:07:32 +02:00
// Pandora FMS - the Flexible Monitoring System
2008-07-25 20:37:32 +02:00
// ============================================
2008-08-22 20:07:32 +02:00
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
// Please see http://pandora.sourceforge.net for full contribution list
2008-01-10 17:40:00 +01:00
2008-04-01 15:53:11 +02:00
// This program is free software; you can redistribute it and/or
2008-09-01 06:22:26 +02:00
// modify it under the terms of the GNU Lesser General Public License (LGPL)
2008-08-22 20:07:32 +02:00
// as published by the Free Software Foundation for version 2.
2008-09-01 06:22:26 +02:00
//
2008-04-01 15:53:11 +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.
2008-08-22 20:07:32 +02:00
// 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-06-09 12:48:11 +02:00
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
/**
* Check if login session variables are set .
*
* It will stop the execution if those variables were not set
*
2009-01-08 16:52:13 +01:00
* @ return bool 0 on success exit () on no success
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
*/
2008-09-01 06:22:26 +02:00
2008-07-15 22:19:30 +02:00
function check_login () {
2008-07-15 23:29:28 +02:00
global $config ;
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
if ( ! isset ( $config [ " homedir " ])) {
2008-07-15 23:29:28 +02:00
// No exists $config. Exit inmediatly
include ( " general/noaccess.php " );
exit ;
}
if (( isset ( $_SESSION [ " id_usuario " ])) AND ( $_SESSION [ " id_usuario " ] != " " )) {
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
if ( is_user ( $_SESSION [ " id_usuario " ])) {
2008-07-15 23:29:28 +02:00
return 0 ;
}
}
2008-07-17 14:21:17 +02:00
audit_db ( " N/A " , getenv ( " REMOTE_ADDR " ), " No session " , " Trying to access without a valid session " );
2008-07-15 23:29:28 +02:00
include ( $config [ " homedir " ] . " /general/noaccess.php " );
exit ;
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-15 22:19:30 +02:00
/**
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
* Check access privileges to resources
*
* Access can be :
* IR - Incident Read
* IW - Incident Write
* IM - Incident Management
* AR - Agent Read
* AW - Agent Write
* LW - Alert Write
* UM - User Management
* DM - DB Management
* LM - Alert Management
* PM - Pandora Management
2008-07-15 22:19:30 +02:00
*
2009-01-08 16:52:13 +01:00
* @ param int $id_user User id
* @ param int $id_group Agents group id
* @ param string $access Access privilege
2008-07-15 22:19:30 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return bool 1 if the user has privileges , 0 if not .
*/
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
function give_acl ( $id_user , $id_group , $access ) {
2008-07-15 23:29:28 +02:00
// IF user is level = 1 then always return 1
global $config ;
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
$nivel = is_user_admin ( $id_user );
if ( $nivel ) {
2008-07-15 23:29:28 +02:00
return 1 ;
//Apparently nivel is 1 if user has full admin access
}
2009-01-22 18:44:33 +01:00
2008-07-15 22:19:30 +02:00
//Joined multiple queries into one. That saves on the query overhead and query cache.
2008-07-15 23:29:28 +02:00
if ( $id_group == 0 ) {
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
$query1 = sprintf ( " SELECT tperfil.incident_view,tperfil.incident_edit,tperfil.incident_management,tperfil.agent_view,tperfil.agent_edit,tperfil.alert_edit,tperfil.alert_management,tperfil.pandora_management,tperfil.db_management,tperfil.user_management FROM tusuario_perfil,tperfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil AND tusuario_perfil.id_usuario = '%s' " , $id_user );
2008-07-15 23:29:28 +02:00
//GroupID = 0, access doesnt matter (use with caution!) - Any user gets access to group 0
} else {
2008-07-21 15:43:33 +02:00
$query1 = sprintf ( " SELECT tperfil.incident_view,tperfil.incident_edit,tperfil.incident_management,tperfil.agent_view,tperfil.agent_edit,tperfil.alert_edit,tperfil.alert_management,tperfil.pandora_management,tperfil.db_management,tperfil.user_management FROM tusuario_perfil,tperfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil
2009-01-22 18:44:33 +01:00
AND tusuario_perfil . id_usuario = '%s' AND ( tusuario_perfil . id_grupo = % d OR tusuario_perfil . id_grupo = 1 ) " , $id_user , $id_group );
2008-07-15 22:19:30 +02:00
}
2009-01-22 18:44:33 +01:00
2008-11-07 13:45:18 +01:00
$rowdup = get_db_all_rows_sql ( $query1 );
2008-07-15 22:19:30 +02:00
$result = 0 ;
2008-08-25 01:59:10 +02:00
if ( ! $rowdup )
return $result ;
2008-07-21 14:23:28 +02:00
foreach ( $rowdup as $row ) {
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
// For each profile for this pair of group and user do...
2008-11-07 13:45:18 +01:00
switch ( $access ) {
case " IR " :
$result += $row [ " incident_view " ];
break ;
case " IW " :
$result += $row [ " incident_edit " ];
break ;
case " IM " :
$result += $row [ " incident_management " ];
break ;
case " AR " :
$result += $row [ " agent_view " ];
break ;
case " AW " :
$result += $row [ " agent_edit " ];
break ;
case " LW " :
$result += $row [ " alert_edit " ];
break ;
case " LM " :
$result += $row [ " alert_management " ];
break ;
case " PM " :
$result += $row [ " pandora_management " ];
break ;
case " DM " :
$result += $row [ " db_management " ];
break ;
case " UM " :
$result += $row [ " user_management " ];
break ;
}
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
}
2006-03-27 05:37:27 +02:00
if ( $result > 1 )
$result = 1 ;
2008-07-15 23:29:28 +02:00
return $result ;
2006-03-27 05:37:27 +02:00
}
2009-01-22 18:44:33 +01:00
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
/**
* Adds an audit log entry .
*
2009-01-08 16:52:13 +01:00
* @ param string $id User id
* @ param string $ip Client IP
* @ param string $accion Action description
* @ param string $descripcion Long action description
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
*/
2007-03-28 18:07:29 +02:00
function audit_db ( $id , $ip , $accion , $descripcion ){
2008-07-30 20:39:40 +02:00
$accion = safe_input ( $accion );
$descripcion = safe_input ( $descripcion );
2008-07-29 18:50:17 +02:00
$sql = sprintf ( " INSERT INTO tsesion (ID_usuario, accion, fecha, IP_origen,descripcion, utimestamp) VALUES ('%s','%s',NOW(),'%s','%s',UNIX_TIMESTAMP(NOW())) " , $id , $accion , $ip , $descripcion );
process_sql ( $sql );
2007-03-06 14:18:49 +01:00
}
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
/**
* Log in a user into Pandora .
*
2009-01-08 16:52:13 +01:00
* @ param string $id_user User id
* @ param string $ip Client user IP address .
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
*/
function logon_db ( $id_user , $ip ) {
2008-07-02 14:40:58 +02:00
audit_db ( $id_user , $ip , " Logon " , " Logged in " );
2008-07-15 22:19:30 +02:00
// Update last registry of user to set last logon. How do we audit when the user was created then?
2009-01-22 18:44:33 +01:00
process_user_contact ( $id_user );
2007-03-06 14:18:49 +01:00
}
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
/**
* Log out a user into Pandora .
*
2009-01-08 16:52:13 +01:00
* @ param string $id_user User id
* @ param string $ip Client user IP address .
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
*/
function logoff_db ( $id_user , $ip ) {
2008-07-15 22:19:30 +02:00
audit_db ( $id_user , $ip , " Logoff " , " Logged out " );
2007-03-06 14:18:49 +01:00
}
2006-03-27 05:37:27 +02:00
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
/**
* Get profile name from id .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_profile Id profile in tperfil
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
*
2009-01-08 16:52:13 +01:00
* @ return string Profile name of the given id
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
*/
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
function get_profile_name ( $id_profile ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
return ( string ) get_db_value ( 'name' , 'tperfil' , 'id_perfil' , ( int ) $id_profile );
2006-03-27 05:37:27 +02:00
}
2009-01-22 18:44:33 +01:00
/**
* Selects all profiles ( array ( id => name ))
*
* @ return array List of all profiles
*/
function get_profiles () {
$profiles = get_db_all_rows_in_table ( " tperfil " , " name " );
$return = array ();
if ( $profiles === false ) {
return $return ;
}
foreach ( $profiles as $profile ) {
$return [ $profile [ " id_perfil " ]] = $profile [ " name " ];
}
return $return ;
}
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
/**
* Create Profile for User
*
* @ param string User ID
* @ param int Profile ID ( default 1 => AR )
* @ param int Group ID ( default 1 => All )
*
* @ return bool True if succesful , false if not
*/
function create_user_profile ( $id_user , $id_profile = 1 , $id_group = 1 ) {
global $config ;
if ( isset ( $config [ " id_user " ])) {
//Usually this is set unless we call it while logging in (user known by auth scheme but not by pandora)
$assign = $config [ " id_user " ];
} else {
$assign = $id_user ;
}
$insert = array (
" id_usuario " => $id_user ,
" id_perfil " => $id_profile ,
" id_grupo " => $id_group ,
" assigned_by " => $assign
);
return ( bool ) process_sql_insert ( " tusuario_perfil " , $insert );
}
2009-01-22 18:44:33 +01:00
/**
* Delete user profile from database
*
* @ param string User ID
* @ param int Profile ID
*
* @ return bool Whether or not it ' s deleted
*/
function delete_user_profile ( $id_user , $id_profile ) {
$sql = sprintf ( " DELETE FROM tusuario_perfil WHERE id_usuario = '%s' AND id_up = %d " , $id_user , $id_profile );
return ( bool ) process_sql ( $sql );
}
/**
* Delete profile from database ( not user - profile link ( tusuario_perfil ), but the actual profile ( tperfil ))
*
* @ param int Profile ID
*
* @ return bool Whether or not it ' s deleted
*/
function delete_profile ( $id_profile ) {
$sql = sprintf ( " DELETE FROM tperfil WHERE id_perfil = %d " , $id_profile );
return ( bool ) process_sql ( $sql );
}
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
2008-06-19 15:50:52 +02:00
/**
* Get disabled field of a group
*
2009-01-08 16:52:13 +01:00
* @ param int id_group Group id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return bool Disabled field of given group
2008-06-19 15:50:52 +02:00
*/
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
function give_disabled_group ( $id_group ) {
2008-06-16 20:09:56 +02:00
return ( bool ) get_db_value ( 'disabled' , 'tgrupo' , 'id_grupo' , ( int ) $id_group );
2007-04-22 03:08:58 +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
/**
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
* Get all the agents within a group ( s ) . For non - godmode usage get_user_groups should be used .
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
*
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
* @ param mixed $id_group Group id or an array of ID ' s . If nothing is selected , it will select all
2008-09-16 20:16:09 +02:00
*
2009-01-08 16:52:13 +01:00
* @ param bool $disabled Add disabled agents to agents . Default : False .
2008-11-20 15:09:26 +01:00
*
2009-01-08 16:52:13 +01:00
* @ param string $case Which case to return the agentname as ( lower , upper , none )
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
*
2009-01-08 16:52:13 +01:00
* @ return array An array with all agents in the group or an empty array
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
*/
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
function get_group_agents ( $id_group = 0 , $disabled = false , $case = " lower " ) {
$id_group = safe_int ( $id_group , 1 );
2008-09-16 20:16:09 +02:00
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
//If id_group is an array, then
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
if ( empty ( $id_group ) || in_array ( 1 , ( array ) $id_group )) {
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
//If All is included in the group list, just select All
$id_group = 1 ;
} else {
//If All is not included, select what we need
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
$id_group = implode ( " , " , ( array ) $id_group );
2008-11-20 15:09:26 +01:00
}
/* 'All' group must return all agents */
$search = '' ;
if ( ! empty ( $id_group ) && $id_group > 1 ) {
$search .= sprintf ( ' WHERE id_grupo IN (%s)' , $id_group );
}
if ( $disabled !== false ) {
$search .= (( $search == '' ) ? ' WHERE' : ' AND' ) . ' disabled = 0' ;
}
$sql = sprintf ( " SELECT id_agente, nombre FROM tagente%s ORDER BY nombre " , $search );
$result = get_db_all_rows_sql ( $sql );
if ( $result === false )
return array (); //Return an empty array
$agents = array ();
foreach ( $result as $row ) {
switch ( $case ) {
case " lower " :
$agents [ $row [ " id_agente " ]] = mb_strtolower ( $row [ " nombre " ], " UTF-8 " );
break ;
case " upper " :
$agents [ $row [ " id_agente " ]] = mb_strtoupper ( $row [ " nombre " ], " UTF-8 " );
break ;
default :
$agents [ $row [ " id_agente " ]] = $row [ " nombre " ];
2008-07-16 23:04:31 +02:00
}
}
2008-11-20 15:09:26 +01:00
return ( $agents );
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
}
2007-04-22 03:08:58 +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
/**
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
* Get all the modules in an agent . If an empty list is passed it will select all
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
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param mixed Agent id to get modules . It can also be an array of agent id ' s .
* @ param mixed Array , comma delimited list or singular value of rows to
* select . If nothing is specified , nombre will be selected .
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
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ return array An array with all modules in the agent .
* If multiple rows are selected , they will be in an array
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
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_agent_modules ( $id_agent , $details = false ) {
2008-11-20 15:09:26 +01:00
$id_agent = safe_int ( $id_agent , 1 );
if ( empty ( $id_agent )) {
$filter = '' ;
} else {
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
$filter = sprintf ( ' WHERE id_agente IN (%s)' , implode ( " , " , ( array ) $id_agent ));
2008-11-20 15:09:26 +01:00
}
if ( empty ( $details )) {
$details = " nombre " ;
2008-11-21 18:58:30 +01:00
} else {
$details = safe_input ( $details );
2008-11-20 15:09:26 +01:00
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$sql = sprintf ( ' SELECT id_agente_modulo , % s
FROM tagente_modulo
% s
ORDER BY nombre ' ,
implode ( " , " , ( array ) $details ),
$filter );
$result = get_db_all_rows_sql ( $sql );
2008-11-21 18:58:30 +01:00
2008-11-20 15:09:26 +01:00
if ( empty ( $result )) {
2008-11-21 18:58:30 +01:00
return array ();
2008-11-20 15:09:26 +01:00
}
2008-11-21 18:58:30 +01:00
$modules = array ();
2008-11-20 15:09:26 +01:00
foreach ( $result as $row ) {
if ( is_array ( $details )) {
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
//Just stack the information in array by ID
$modules [ $row [ 'id_agente_modulo' ]] = $row ;
2008-11-20 15:09:26 +01:00
} else {
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$modules [ $row [ 'id_agente_modulo' ]] = $row [ $details ];
2008-11-20 15:09:26 +01:00
}
}
return $modules ;
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
}
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
/**
* Get a list of the reports the user can view .
*
* A user can view a report by two ways :
* - The user created the report ( id_user field in treport )
* - The report is not private and the user has reading privileges on
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* the group associated to the report
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
*
2009-01-08 16:52:13 +01:00
* @ param string $id_user User id
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
*
2009-01-08 16:52:13 +01:00
* @ return array An array with all the reports the user can view .
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
*/
function get_reports ( $id_user ) {
$user_reports = array ();
2008-07-09 18:33:28 +02:00
$all_reports = get_db_all_rows_in_table ( 'treport' , 'name' );
2008-07-21 14:23:28 +02:00
if ( $all_reports === false ) {
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
return $user_reports ;
}
foreach ( $all_reports as $report ) {
/* The report is private and it does not belong to the user */
if ( $report [ 'private' ] && $report [ 'id_user' ] != $id_user )
continue ;
/* Check ACL privileges on report group */
if ( ! give_acl ( $id_user , $report [ 'id_group' ], 'AR' ))
continue ;
array_push ( $user_reports , $report );
}
return $user_reports ;
}
2006-03-27 05:37:27 +02:00
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
/**
* Get group icon from group .
*
2009-01-08 16:52:13 +01:00
* @ param int id_group Id group to get the icon
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
*
2009-01-08 16:52:13 +01:00
* @ return string Icon path of the given group
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
*/
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
function dame_grupo_icono ( $id_group ) {
return ( string ) get_db_value ( 'icon' , 'tgrupo' , 'id_grupo' , ( int ) $id_group );
2006-03-27 05:37:27 +02:00
}
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
/**
* Get agent id from an agent name .
*
2009-01-08 16:52:13 +01:00
* @ param string $agent_name Agent name to get its id .
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
*
2009-01-08 16:52:13 +01:00
* @ return int Id from the agent of the given name .
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
*/
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
function dame_agente_id ( $agent_name ) {
return ( int ) get_db_value ( 'id_agente' , 'tagente' , 'nombre' , $agent_name );
2006-03-27 05:37:27 +02:00
}
2008-11-20 15:09:26 +01:00
/**
* Get name of an agent .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agent Agent id .
* @ param string $case Case ( upper , lower , none )
2008-11-20 15:09:26 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given agent .
2008-11-20 15:09:26 +01:00
*/
function get_agent_name ( $id_agent , $case = " upper " ) {
$agent = ( string ) get_db_value ( 'nombre' , 'tagente' , 'id_agente' , ( int ) $id_agent );
switch ( $case ) {
case " upper " :
return mb_strtoupper ( $agent , " UTF-8 " );
break ;
case " lower " :
return mb_strtolower ( $agent , " UTF-8 " );
break ;
default :
return ( $agent );
}
2006-03-27 05:37:27 +02:00
}
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
/**
2009-01-08 16:52:13 +01:00
* Get type name for alerts ( e - mail , text , internal , ... ) based on type number
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
*
2009-01-08 16:52:13 +01:00
* @ param int id_alert Alert type id .
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
*
2009-01-08 16:52:13 +01:00
* @ return string Type name of the alert .
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
*/
2009-01-05 19:41:14 +01:00
function get_alert_type ( $id_type ) {
return ( string ) get_db_value ( 'nombre' , 'talerta' , 'id_alerta' , ( int ) $id_type );
2006-03-27 05:37:27 +02:00
}
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
/**
* Get name of a module group .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_module_group Module group id .
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
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given module group .
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
*/
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
function dame_nombre_grupomodulo ( $id_module_group ) {
return ( string ) get_db_value ( 'name' , 'tmodule_group' , 'id_mg' , ( int ) $id_module_group );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the name of an exporting server
*
2009-01-08 16:52:13 +01:00
* @ param int $id_server Server id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string The name of given server .
2008-06-19 15:50:52 +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
function dame_nombre_servidorexportacion ( $id_server ) {
return ( string ) get_db_value ( 'name' , 'tserver_export' , 'id' , ( int ) $id_server );
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
}
2008-06-19 15:50:52 +02:00
/**
* Get the name of a plugin
*
2009-01-08 16:52:13 +01:00
* @ param int id_plugin Plugin id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string The name of the given plugin
2008-06-19 15:50:52 +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
function dame_nombre_pluginid ( $id_plugin ) {
return ( string ) get_db_value ( 'name' , 'tplugin' , 'id' , ( int ) $id_plugin );
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
}
2008-06-19 15:50:52 +02:00
/**
* Get the name of a module type
*
2009-01-08 16:52:13 +01:00
* @ param int $id_type Type id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string The name of the given type .
2008-06-19 15:50:52 +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
function giveme_module_type ( $id_type ) {
return ( string ) get_db_value ( 'nombre' , 'ttipo_modulo' , 'id_tipo' , ( int ) $id_type );
2008-04-10 12:25:52 +02:00
}
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
/**
* Get agent id of an agent module .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agentmodule Agent module id .
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return int The id of the agent of given agent module
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
*/
function get_agentmodule_agent ( $id_agentmodule ) {
return ( int ) get_db_value ( 'id_agente' , 'tagente_modulo' , 'id_agente_modulo' , ( int ) $id_agentmodule );
}
2008-06-19 15:50:52 +02:00
/**
* Get agent name of an agent module .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agente_modulo Agent module id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string The name of the given agent module .
2008-06-19 15:50:52 +02:00
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_agentmodule_agent_name ( $id_agentmodule ) {
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
// Since this is a helper function we don't need to do casting
return ( string ) get_agent_name ( get_agentmodule_agent ( $id_agentmodule ));
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the module name of an agent module .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agente_modulo Agent module id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given agent module .
2008-06-19 15:50:52 +02:00
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_agentmodule_name ( $id_agente_modulo ) {
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
return ( string ) get_db_value ( 'nombre' , 'tagente_modulo' , 'id_agente_modulo' , ( int ) $id_agente_modulo );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the module type of an agent module .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agentmodule Agent module id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Module type of the given agent module .
2008-06-19 15:50:52 +02:00
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_agentmodule_type ( $id_agentmodule ) {
return ( int ) get_db_value ( 'id_tipo_modulo' , 'tagente_modulo' , 'id_agente_modulo' , ( int ) $id_agentmodule );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
2009-01-22 18:44:33 +01:00
* DEPRECATED : User get_user_fullname
2008-06-19 15:50:52 +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
function dame_nombre_real ( $id_user ) {
2009-01-22 18:44:33 +01:00
return get_user_fullname ( $id_user );
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
}
/**
* Get all the times a monitor went down during a period .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agent_module Agent module of the monitor .
* @ param int $period Period timed to check from date
* @ param int $date Date to check ( now by default )
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
*
2009-01-08 16:52:13 +01:00
* @ return int The number of times a monitor went down .
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
*/
function get_monitor_downs_in_period ( $id_agent_module , $period , $date = 0 ) {
2008-07-16 23:04:31 +02:00
if ( $date == 0 ) {
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
2008-07-16 23:04:31 +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
$datelimit = $date - $period ;
2008-07-16 23:04:31 +02:00
$sql = sprintf ( " SELECT COUNT(`id_agentmodule`) FROM `tevento` WHERE
`event_type` = 'monitor_down'
2008-07-21 15:43:33 +02:00
AND `id_agentmodule` = % d
AND `utimestamp` > % d
AND `utimestamp` <= % d " ,
$id_agent_module , $datelimit , $date );
2008-06-19 15:50:52 +02:00
return get_db_sql ( $sql );
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
}
/**
* Get the last time a monitor went down during a period .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agent_module Agent module of the monitor .
* @ param int $period Period timed to check from date
* @ param int $date Date to check ( now by default )
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
*
2009-01-08 16:52:13 +01:00
* @ return int The last time a monitor went down .
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
*/
function get_monitor_last_down_timestamp_in_period ( $id_agent_module , $period , $date = 0 ) {
2008-07-16 23:04:31 +02:00
if ( $date == 0 ) {
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
2008-07-16 23:04:31 +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
$datelimit = $date - $period ;
2008-07-16 23:04:31 +02:00
$sql = sprintf ( " SELECT MAX(`timestamp`) FROM `tevento` WHERE
event_type = 'monitor_down'
2008-07-21 15:43:33 +02:00
AND `id_agentmodule` = % d
AND `utimestamp` > % d
AND `utimestamp` <= % d " ,
$id_agent_module , $datelimit , $date );
2008-06-19 15:50:52 +02:00
return get_db_sql ( $sql );
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
}
2008-07-07 15:16:13 +02:00
/**
* Get all the monitors defined in an group .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_group Group id to get all the monitors .
2008-07-07 15:16:13 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array with all the monitors defined in the group ( tagente_modulo ) .
2008-07-07 15:16:13 +02:00
*/
function get_monitors_in_group ( $id_group ) {
2008-09-30 19:55:36 +02:00
if ( $id_group <= 1 ) {
//We select all groups the user has access to if it's 0, -1 or 1
global $config ;
$id_group = array_keys ( get_user_groups ( $config [ 'id_user' ]));
}
if ( is_array ( $id_group )) {
$id_group = implode ( " , " , $id_group );
}
2008-07-16 23:04:31 +02:00
$sql = sprintf ( " SELECT `tagente_modulo`.* FROM `tagente_modulo`, `ttipo_modulo`, `tagente` WHERE
`id_tipo_modulo` = `id_tipo`
AND `tagente` . `id_agente` = `tagente_modulo` . `id_agente`
AND `ttipo_modulo` . `nombre` LIKE '%%_proc'
2008-09-30 19:55:36 +02:00
AND `tagente` . `id_grupo` IN ( % s ) ORDER BY `tagente` . `nombre` " , $id_group );
2008-07-07 15:16:13 +02:00
return get_db_all_rows_sql ( $sql );
}
2008-11-08 11:57:40 +01:00
/**
* Get all the events happened in a group during a period of time .
*
* The returned events will be in the time interval ( $date - $period , $date ]
*
2009-01-08 16:52:13 +01:00
* @ param int $id_group Group id to get events .
* @ param int $period Period of time in seconds to get events .
* @ param int $date Beginning date to get events .
2008-11-08 11:57:40 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array with all the events happened .
2008-11-08 11:57:40 +01:00
*/
2008-11-14 16:37:32 +01:00
function get_group_events ( $id_group , $period , $date ) {
2008-11-08 11:57:40 +01:00
$datelimit = $date - $period ;
if ( $id_group == 1 ) {
$sql = sprintf ( ' SELECT * FROM tevento
WHERE utimestamp > % d AND utimestamp <= % d
ORDER BY utimestamp ASC ' ,
$datelimit , $date );
} else {
$sql = sprintf ( ' SELECT * FROM tevento
WHERE utimestamp > % d AND utimestamp <= % d
AND id_grupo = % d
ORDER BY utimestamp ASC ' ,
$datelimit , $date , $id_group );
}
return get_db_all_rows_sql ( $sql );
}
2008-07-07 15:16:13 +02:00
/**
* Get all the monitors defined in an agent .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_agent Agent id to get all the monitors .
2008-07-07 15:16:13 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array with all the monitors defined ( tagente_modulo ) .
2008-07-07 15:16:13 +02:00
*/
function get_monitors_in_agent ( $id_agent ) {
2008-07-16 23:04:31 +02:00
$sql = sprintf ( " SELECT `tagente_modulo`.*
FROM `tagente_modulo` , `ttipo_modulo` , `tagente`
WHERE `id_tipo_modulo` = `id_tipo`
AND `tagente` . `id_agente` = `tagente_modulo` . `id_agente`
2008-07-30 20:39:40 +02:00
AND `ttipo_modulo` . `nombre` LIKE '%%_proc'
2008-07-21 15:43:33 +02:00
AND `tagente` . `id_agente` = % d " , $id_agent );
2008-07-07 15:16:13 +02:00
return get_db_all_rows_sql ( $sql );
}
/**
* Get all the monitors down during a period of time .
*
2009-01-08 16:52:13 +01:00
* @ param array $monitors An array with all the monitors to check . Each
2008-07-07 15:16:13 +02:00
* element of the array must be a dictionary .
2009-01-08 16:52:13 +01:00
* @ param int $period Period of time to check the monitors .
* @ param int $date Beginning date to check the monitors .
2008-07-07 15:16:13 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array with all the monitors that went down in that
2008-07-07 15:16:13 +02:00
* period of time .
*/
function get_monitors_down ( $monitors , $period = 0 , $date = 0 ) {
$monitors_down = array ();
2008-09-30 19:55:36 +02:00
if ( empty ( $monitors ))
2008-08-22 16:28:00 +02:00
return $monitors_down ;
2008-07-07 15:16:13 +02:00
foreach ( $monitors as $monitor ) {
$down = get_monitor_downs_in_period ( $monitor [ 'id_agente_modulo' ], $period , $date );
2008-09-30 19:55:36 +02:00
if ( $down > 0 )
2008-07-07 15:16:13 +02:00
array_push ( $monitors_down , $monitor );
}
return $monitors_down ;
}
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
/**
* Get all the times an alerts fired during a period .
*
2009-01-19 15:42:34 +01:00
* @ param int Alert module id .
* @ param int Period timed to check from date
* @ param int Date to check ( current time by default )
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
*
2009-01-08 16:52:13 +01:00
* @ return int The number of times an alert fired .
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
*/
2009-01-19 15:42:34 +01:00
function get_alert_fires_in_period ( $id_alert_module , $period , $date = 0 ) {
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 ( ! $date )
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
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
$datelimit = $date - $period ;
2008-07-16 23:04:31 +02:00
$sql = sprintf ( " SELECT COUNT(`id_agentmodule`) FROM `tevento` WHERE
`event_type` = 'alert_fired'
2009-01-19 15:42:34 +01:00
AND `id_alert_am` = % d
2008-07-21 15:43:33 +02:00
AND `utimestamp` > % d
AND `utimestamp` <= % d " ,
2009-01-19 15:42:34 +01:00
$id_alert_module , $datelimit , $date );
2008-06-19 15:50:52 +02:00
return ( int ) get_db_sql ( $sql );
2006-03-27 05:37:27 +02:00
}
2008-07-07 15:16:13 +02:00
/**
* Get all the alerts defined in a group .
*
* It gets all the alerts of all the agents on a given group .
*
2009-01-08 16:52:13 +01:00
* @ param int $id_group Group id to check .
2008-07-07 15:16:13 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array with alerts dictionaries defined in a group .
2008-07-07 15:16:13 +02:00
*/
2009-01-05 19:41:14 +01:00
function get_group_alerts ( $id_group ) {
2008-07-07 15:16:13 +02:00
$alerts = array ();
2008-11-20 15:09:26 +01:00
$agents = get_group_agents ( $id_group , false , " none " );
2009-01-19 15:42:34 +01:00
require_once ( 'include/functions_agents.php' );
2008-11-20 15:09:26 +01:00
foreach ( $agents as $agent_id => $agent_name ) {
2009-01-05 19:41:14 +01:00
$agent_alerts = get_agent_alerts ( $agent_id );
2008-07-07 15:16:13 +02:00
$alerts = array_merge ( $alerts , $agent_alerts );
}
return $alerts ;
}
/**
* Get all the alerts fired during a period , given a list of alerts .
*
2009-01-19 15:42:34 +01:00
* @ param array A list of alert modules to check . See get_alerts_in_group ()
* @ param int Period of time to check fired alerts .
* @ param int Beginning date to check fired alerts in UNIX format ( current date by default )
2008-07-07 15:16:13 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array with the alert id as key and the number of times
2008-07-07 15:16:13 +02:00
* the alert was fired ( only included if it was fired ) .
*/
function get_alerts_fired ( $alerts , $period = 0 , $date = 0 ) {
if ( ! $date )
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
2008-07-07 15:16:13 +02:00
$datelimit = $date - $period ;
$alerts_fired = array ();
$agents = array ();
foreach ( $alerts as $alert ) {
2009-01-19 15:42:34 +01:00
$fires = get_alert_fires_in_period ( $alert [ 'id' ], $period , $date );
2008-07-07 15:16:13 +02:00
if ( ! $fires ) {
continue ;
}
2009-01-19 15:42:34 +01:00
$alerts_fired [ $alert [ 'id' ]] = $fires ;
2008-07-07 15:16:13 +02:00
}
return $alerts_fired ;
}
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
/**
* Get the last time an alert fired during a period .
*
2009-01-19 15:42:34 +01:00
* @ param int Alert agent module id .
* @ param int Period timed to check from date
* @ param int Date to check ( current date by default )
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
*
2009-01-19 15:42:34 +01:00
* @ return int The last time an alert fired . It ' s an UNIX timestamp .
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
*/
2009-01-19 15:42:34 +01:00
function get_alert_last_fire_timestamp_in_period ( $id_alert_module , $period , $date = 0 ) {
2008-07-16 23:04:31 +02:00
if ( $date == 0 ) {
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
2008-07-16 23:04:31 +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
$datelimit = $date - $period ;
2009-01-19 15:42:34 +01:00
$sql = sprintf ( " SELECT MAX(`utimestamp`) FROM `tevento` WHERE
2008-07-16 23:04:31 +02:00
`event_type` = 'alert_fired'
2009-01-19 15:42:34 +01:00
AND `id_alert_am` = % d
2008-07-21 15:43:33 +02:00
AND `utimestamp` > % d
AND `utimestamp` <= % d " ,
2009-01-19 15:42:34 +01:00
$id_alert_module , $datelimit , $date );
2008-06-19 15:50:52 +02:00
return get_db_sql ( $sql );
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
}
2006-03-27 05:37:27 +02:00
2008-06-19 15:50:52 +02:00
/**
* Get the server name .
*
2009-01-19 15:42:34 +01:00
* @ param int Server id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given server
2008-06-19 15:50:52 +02:00
*/
2008-12-16 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/logon_ok.php, godmode/agentes/modificar_agente.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_recontask.php, godmode/setup/news.php,
operation/agentes/datos_agente.php, operation/agentes/estado_agente.php,
operation/agentes/status_events.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incidents.php,
operation/incidents/incident_detail.php, operation/messages/message.php:
Function updates and new function definitions
* include/functions.php: safe_input used utf_decode which gives problems
with foreign chars since everything else is (or should be UTF-8) fixed.
format_datetime is no longer necessary - use print_timestamp for output.
Extended multibyte wrapper functions.
* include/functions_db.php: give_server_name is now get_server_name;
dame_so_name is now get_os_name; dame_so_icon is now print_os_icon;
show_icon_group is now print_group_icon; give_network_profile_name is now
get_networkprofile_name; smal_event_table is now print_events_table
* include/functions_events.php: print_events_table was moved here and
fixed. Now calculates the cutoff of event and agent text.
* include/functions_html.php: Added title to print_table function and
updated documentation. print_timestamp now uses the new function
definitions (array) and handles 0-dates better. print_group_icon and
print_os_icon added and extended. Added print_agent_name. This function
fixes issues that show up when cutting off agent names with multibyte char
* operation/servers/view_server.php: Rewrite with new functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1295 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-17 15:26:42 +01:00
function get_server_name ( $id_server ) {
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
return ( string ) get_db_value ( 'name' , 'tserver' , 'id_server' , ( int ) $id_server );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
* Get the module type name ( type = generic_data , remote_snmp , ... )
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ param int $id_type Type id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given type .
2008-06-19 15:50:52 +02:00
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_moduletype_name ( $id_type ) {
return ( string ) get_db_value ( 'nombre' , 'ttipo_modulo' , 'id_tipo' , ( int ) $id_type );
}
2006-03-27 05:37:27 +02:00
2009-01-16 20:04:54 +01:00
/**
* Returns an array with all module types ( default ) or if " remote " or " agent "
* is passed it will return only remote ( ICMP , SNMP , TCP ... ) module types
* otherwise the full list + the column you specify
*
* @ param string Specifies which type to return ( will return an array with id ' s )
* @ param string Which rows to select ( defaults to nombre )
*
* @ return array Either the full table or if a type is specified , an array with id ' s
*/
function get_moduletypes ( $type = " all " , $rows = " nombre " ) {
$return = array ();
$rows = ( array ) $rows ; //Cast as array
$row_cnt = count ( $rows );
if ( $type == " remote " ) {
return array_merge ( range ( 6 , 18 ), ( array ) 100 );
} elseif ( $type == " agent " ) {
return array_merge ( range ( 1 , 4 ), range ( 19 , 24 ));
}
$sql = sprintf ( " SELECT id_tipo,%s FROM ttipo_modulo " , implode ( " , " , $rows ));
$result = get_db_all_rows_sql ( $sql );
if ( $result === false ) {
return $return ;
}
foreach ( $result as $type ) {
if ( $row_cnt > 1 ) {
$return [ $type [ " id_tipo " ]] = $type ;
} else {
$return [ $type [ " id_tipo " ]] = $type [ reset ( $rows )];
}
}
return $return ;
}
2008-06-19 15:50:52 +02:00
/**
2009-01-08 16:52:13 +01:00
* @ deprecated Use get_agent_group ( $id ) now ( fully compatible )
2008-06-19 15:50:52 +02:00
*/
function dame_id_grupo ( $id_agent ) {
2009-01-05 19:41:14 +01:00
return get_agent_group ( $id_agent );
2006-03-27 05:37:27 +02:00
}
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
2008-06-19 15:50:52 +02:00
/**
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
* Get the number of pandora data packets in the database .
*
* In case an array is passed , it will have a value for every agent passed
* incl . a total otherwise it will just return the total
2008-06-19 15:50:52 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param mixed Agent id or array of agent id ' s , 0 for all
2008-11-06 21:16:15 +01:00
*
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
* @ return mixed The number of data in the database
2008-06-19 15:50:52 +02:00
*/
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
function get_agent_modules_data_count ( $id_agent = 0 ) {
$id_agent = safe_int ( $id_agent , 1 );
if ( empty ( $id_agent )) {
$id_agent = array ();
2008-11-06 21:16:15 +01:00
} else {
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
$id_agent = ( array ) $id_agent ;
2008-11-06 21:16:15 +01:00
}
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
$count = array ();
$count [ " total " ] = 0 ;
$query [ 0 ] = " SELECT COUNT(*) FROM tagente_datos " ;
//$query[1] = "SELECT COUNT(*) FROM tagente_datos_inc";
//$query[2] = "SELECT COUNT(*) FROM tagente_datos_string";
foreach ( $id_agent as $agent_id ) {
//Init value
$count [ $agent_id ] = 0 ;
$modules = array_keys ( get_agent_modules ( $agent_id ));
foreach ( $query as $sql ) {
//Add up each table's data
$count [ $agent_id ] += ( int ) get_db_sql ( $sql . " WHERE id_agente_modulo IN ( " . implode ( " , " , $modules ) . " ) " );
}
//Add total agent count to total count
$count [ " total " ] += $count [ $agent_id ];
}
if ( $count [ " total " ] == 0 ) {
foreach ( $query as $sql ) {
$count [ " total " ] += ( int ) get_db_sql ( $sql );
}
}
if ( ! isset ( $agent_id )) {
//If agent_id is not set, it didn't loop through any agents
return $count [ " total " ];
}
return $count ; //Return the array
2008-06-19 15:50:52 +02:00
}
2006-03-27 05:37:27 +02:00
2008-06-19 15:50:52 +02:00
/**
* Get the operating system name .
*
2009-01-19 15:42:34 +01:00
* @ param int Operating system id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given operating system .
2008-06-19 15:50:52 +02:00
*/
2008-12-16 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/logon_ok.php, godmode/agentes/modificar_agente.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_recontask.php, godmode/setup/news.php,
operation/agentes/datos_agente.php, operation/agentes/estado_agente.php,
operation/agentes/status_events.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incidents.php,
operation/incidents/incident_detail.php, operation/messages/message.php:
Function updates and new function definitions
* include/functions.php: safe_input used utf_decode which gives problems
with foreign chars since everything else is (or should be UTF-8) fixed.
format_datetime is no longer necessary - use print_timestamp for output.
Extended multibyte wrapper functions.
* include/functions_db.php: give_server_name is now get_server_name;
dame_so_name is now get_os_name; dame_so_icon is now print_os_icon;
show_icon_group is now print_group_icon; give_network_profile_name is now
get_networkprofile_name; smal_event_table is now print_events_table
* include/functions_events.php: print_events_table was moved here and
fixed. Now calculates the cutoff of event and agent text.
* include/functions_html.php: Added title to print_table function and
updated documentation. print_timestamp now uses the new function
definitions (array) and handles 0-dates better. print_group_icon and
print_os_icon added and extended. Added print_agent_name. This function
fixes issues that show up when cutting off agent names with multibyte char
* operation/servers/view_server.php: Rewrite with new functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1295 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-17 15:26:42 +01:00
function get_os_name ( $id_os ) {
return ( string ) get_db_value ( 'name' , 'tconfig_os' , 'id_os' , ( int ) $id_os );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
* DEPRECATED : Use get_user_email
2008-06-19 15:50:52 +02:00
*/
function dame_email ( $id_user ) {
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
return get_user_email ( $id_user );
2007-03-02 18:56:07 +01:00
}
2008-06-19 15:50:52 +02:00
/**
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
* DEPRECATED : Use is_user_admin
2008-06-19 15:50:52 +02:00
*/
function dame_admin ( $id_user ) {
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
return is_user_admin ( $id_user );
2008-06-19 15:50:52 +02:00
}
2007-03-06 14:18:49 +01:00
2008-06-19 15:50:52 +02:00
/**
2009-01-08 16:52:13 +01:00
* @ deprecated Use check_login () instead
2008-06-19 15:50:52 +02:00
*/
2009-01-08 16:52:13 +01:00
function comprueba_login () {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
return check_login ();
2007-03-06 14:18:49 +01:00
}
2008-06-19 15:50:52 +02:00
/**
* Check if an agent has alerts fired .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return bool True if the agent has fired alerts .
2008-06-19 15:50:52 +02:00
*/
function check_alert_fired ( $id_agent ) {
2009-01-19 15:42:34 +01:00
$sql = sprintf ( " SELECT COUNT(*)
FROM talert_template_modules , tagente_modulo
WHERE talert_template_modules . id_agent_module = tagente_modulo . id_agente_modulo
AND times_fired > 0 AND id_agente = % d " ,
$id_agent );
2008-06-19 15:50:52 +02:00
$value = get_db_sql ( $sql );
if ( $value > 0 )
return true ;
return false ;
2007-03-06 14:18:49 +01:00
}
2008-06-19 15:50:52 +02:00
/**
* Check is a user exists in the system
*
2009-01-19 15:42:34 +01:00
* @ param string User id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return bool True if the user exists .
2008-06-19 15:50:52 +02:00
*/
function existe ( $id_user ) {
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
return is_user ( $id_user );
2007-03-06 14:18:49 +01:00
}
2007-03-02 18:56:07 +01:00
2008-06-19 15:50:52 +02:00
/**
* Get the interval value of an agent module .
*
* If the module interval is not set , the agent interval is returned
*
2009-01-19 15:42:34 +01:00
* @ param int Id agent module to get the interval value .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int Module interval or agent interval if no module interval
2008-06-19 15:50:52 +02:00
*/
2008-06-20 14:13:35 +02:00
function get_module_interval ( $id_agent_module ) {
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
$interval = ( int ) get_db_value ( 'module_interval' , 'tagente_modulo' , 'id_agente_modulo' , ( int ) $id_agent_module );
2008-11-20 22:26:59 +01:00
if ( $interval > 0 )
2008-06-19 15:50:52 +02:00
return $interval ;
2008-11-20 22:26:59 +01:00
$id_agent = give_agent_id_from_module_id ( $id_agent_module );
return ( int ) get_agent_interval ( $id_agent );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the interval of an agent .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int The interval value of a given agent
2008-06-19 15:50:52 +02:00
*/
2008-11-20 22:26:59 +01:00
function get_agent_interval ( $id_agent ) {
2008-06-19 15:50:52 +02:00
return ( int ) get_db_value ( 'intervalo' , 'tagente' , 'id_agente' , $id_agent );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the flag value of an agent module .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent module id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return bool The flag value of an agent module .
2008-06-19 15:50:52 +02:00
*/
function give_agentmodule_flag ( $id_agent_module ) {
return get_db_value ( 'flag' , 'tagente_modulo' , 'id_agente_modulo' , $id_agent_module );
2006-03-27 05:37:27 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Prints a list of < options > HTML tags with the groups the user has
* reading privileges .
2008-09-19 18:08:59 +02:00
*
2009-01-08 16:52:13 +01:00
* @ deprecated Use get_user_groups () in combination with print_select ()
2008-09-19 18:08:59 +02:00
* instead
2008-06-19 15:50:52 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param string User id
* @ param bool Flag to show all the groups or not . True by default .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array with all the groups
2008-06-19 15:50:52 +02:00
*/
2008-06-16 20:09:56 +02:00
function list_group ( $id_user , $show_all = 1 ){
2008-06-19 15:50:52 +02:00
$mis_grupos = array (); // Define array mis_grupos to put here all groups with Agent Read permission
2008-10-14 11:19:19 +02:00
$sql = 'SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre' ;
2008-07-29 18:50:17 +02:00
$result = get_db_all_rows_sql ( $sql );
2008-08-25 01:59:10 +02:00
if ( ! $result )
return $mis_grupos ;
2008-07-29 18:50:17 +02:00
foreach ( $result as $row ) {
if (( $row [ " id_grupo " ] != 1 || $show_all == 1 ) && $row [ " id_grupo " ] != 0 && give_acl ( $id_user , $row [ " id_grupo " ], " AR " ) == 1 ) {
//Put in an array all the groups the user belongs to
array_push ( $mis_grupos , $row [ " id_grupo " ]);
echo '<option value="' . $row [ " id_grupo " ] . '">' . $row [ " nombre " ] . '</option>' ;
2006-12-31 01:29:40 +01:00
}
}
return ( $mis_grupos );
}
2008-06-19 15:50:52 +02:00
/**
2009-01-08 16:52:13 +01:00
* Get a list of the groups a user has reading privileges to .
2008-06-23 18:07:00 +02:00
*
2009-01-08 16:52:13 +01:00
* @ deprecated Use get_user_groups () instead
2008-06-19 15:50:52 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param int User id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array A list of the groupid => groups the user has reading privileges .
2008-06-19 15:50:52 +02:00
*/
function list_group2 ( $id_user ) {
2008-07-29 18:50:17 +02:00
$mis_grupos = array (); // Define array mis_grupos to put here all groups with Agent Read permission
2008-11-07 13:45:18 +01:00
$result = get_db_all_fields_in_table ( 'tgrupo' , 'id_grupo' );
2008-08-25 01:59:10 +02:00
if ( ! $result )
return $mis_grupos ;
2008-07-29 18:50:17 +02:00
foreach ( $result as $row ) {
2008-06-19 15:50:52 +02:00
if ( give_acl ( $id_user , $row [ " id_grupo " ], " AR " ) == 1 ) {
2008-07-29 18:50:17 +02:00
array_push ( $mis_grupos , $row [ " id_grupo " ]); //Put in array all the groups the user belongs to
2007-01-01 19:41:27 +01:00
}
2008-07-29 18:50:17 +02:00
}
2007-01-01 19:41:27 +01:00
return ( $mis_grupos );
}
2008-09-19 18:08:59 +02:00
/**
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
* Get a list of all users in an array [ username ] => ( info )
2008-09-19 18:08:59 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param string Field to order by ( id_usuario , nombre_real or fecha_registro )
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
* @ param string Which info to get ( defaults to nombre_real )
2008-09-19 18:08:59 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array An array of users
2008-09-19 18:08:59 +02:00
*/
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
function get_users_info ( $order = " nombre_real " , $info = " nombre_real " ) {
$users = get_users ( $order );
$ret = array ();
foreach ( $users as $user_id => $user_info ) {
$ret [ $user_id ] = $user_info [ $info ];
2008-09-19 18:08:59 +02:00
}
2009-01-20 Evi Vanoost <vanooste@rcbi.rochester.edu>
* ajax.php, include/config.inc.php, include/config_process.php,
include/functions.php, include/functions_db.php,
include/functions_ui.php, index.php, install.php,
operation/users/user.php, operation/users/user_edit.php,
reporting/fgraph.php: Added pluggable authentication and moved functions
* general/login_page.php, general/logon_ok.php,
godmode/agentes/modificar_agente.php,
godmode/users/configure_users.php, godmode/users/user_list.php,
operation/agentes/estado_agente.php, operation/incidents/incident.php,
operation/incidents/incident_search.php: Updated functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1366 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-20 19:21:20 +01:00
return $ret ;
2008-09-19 18:08:59 +02:00
}
2008-06-23 18:07:00 +02:00
/**
* Get all the groups a user has reading privileges .
*
2009-01-19 15:42:34 +01:00
* @ param string User id
* @ param string The privilege to evaluate
*
2009-01-08 16:52:13 +01:00
* @ return array A list of the groups the user has certain privileges .
2008-06-23 18:07:00 +02:00
*/
2008-10-20 19:25:37 +02:00
function get_user_groups ( $id_user = 0 , $privilege = " AR " ) {
2008-09-04 16:44:24 +02:00
if ( $id_user == 0 ) {
global $config ;
$id_user = $config [ 'id_user' ];
}
2008-06-23 18:07:00 +02:00
$user_groups = array ();
2008-07-09 18:33:28 +02:00
$groups = get_db_all_rows_in_table ( 'tgrupo' , 'nombre' );
2008-08-25 01:59:10 +02:00
if ( ! $groups )
return $user_groups ;
2008-06-23 18:07:00 +02:00
foreach ( $groups as $group ) {
2008-10-20 19:25:37 +02:00
if ( ! give_acl ( $id_user , $group [ " id_grupo " ], $privilege ))
2008-06-23 18:07:00 +02:00
continue ;
$user_groups [ $group [ 'id_grupo' ]] = $group [ 'nombre' ];
}
return $user_groups ;
}
2008-06-19 15:50:52 +02:00
/**
* Get module type icon .
*
2009-01-08 16:52:13 +01:00
* TODO : Create print_moduletype_icon and print the full tag including hover etc .
* @ deprecated Use print_moduletype_icon instead
2008-06-19 15:50:52 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param int Module type id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Icon filename of the given group
2008-06-19 15:50:52 +02:00
*/
function show_icon_type ( $id_type ) {
return ( string ) get_db_value ( 'icon' , 'ttipo_modulo' , 'id_tipo' , $id_type );
2006-12-31 01:29:40 +01:00
}
2006-03-27 05:37:27 +02:00
2008-03-13 19:57:21 +01:00
/**
* Return a string containing image tag for a given target id ( server )
2009-01-08 16:52:13 +01:00
* TODO : Make this print_servertype_icon and move to functions_ui . php . Make XHTML compatible . Make string translatable
*
* @ deprecated Use print_servertype_icon instead
*
2009-01-19 15:42:34 +01:00
* @ param int Server type id
2008-03-13 19:57:21 +01:00
*
* @ return string Fully formatted IMG HTML tag with icon
*/
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
function show_server_type ( $id ) {
2008-06-23 13:50:11 +02:00
global $config ;
switch ( $id ) {
case 1 :
return '<img src="images/data.png" title="Pandora FMS Data server">' ;
break ;
case 2 :
return '<img src="images/network.png" title="Pandora FMS Network server">' ;
break ;
case 4 :
return '<img src="images/plugin.png" title="Pandora FMS Plugin server">' ;
break ;
case 5 :
return '<img src="images/chart_bar.png" title="Pandora FMS Prediction server">' ;
break ;
case 6 :
return '<img src="images/wmi.png" title="Pandora FMS WMI server">' ;
break ;
default : return " -- " ;
}
2007-03-12 18:58:52 +01:00
}
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
/**
* Get a module category name
*
2009-01-19 15:42:34 +01:00
* @ param int Id category
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
*
* @ return Name of the given category
*/
function give_modulecategory_name ( $id_category ) {
switch ( $id_category ) {
case 0 :
return __ ( 'Software agent data' );
break ;
case 1 :
return __ ( 'Software agent monitor' );
break ;
case 2 :
return __ ( 'Network agent data' );
break ;
case 3 :
return __ ( 'Network agent monitor' );
break ;
}
return __ ( 'Unknown' );
}
2008-06-19 15:50:52 +02:00
/**
* Get a network component group name
*
2009-01-19 15:42:34 +01:00
* @ param int Id network component group .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given network component group
2008-06-19 15:50:52 +02:00
*/
function give_network_component_group_name ( $id_network_component_group ) {
return ( string ) get_db_value ( 'name' , 'tnetwork_component_group' , 'id_sg' , $id_network_component_group );
2007-03-19 20:39:40 +01:00
}
2008-06-19 15:50:52 +02:00
/**
* Get a network profile name .
*
2009-01-19 15:42:34 +01:00
* @ param int Id network profile
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string Name of the given network profile .
2008-06-19 15:50:52 +02:00
*/
2008-12-16 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/logon_ok.php, godmode/agentes/modificar_agente.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_recontask.php, godmode/setup/news.php,
operation/agentes/datos_agente.php, operation/agentes/estado_agente.php,
operation/agentes/status_events.php, operation/agentes/tactical.php,
operation/events/events.php, operation/incidents/incidents.php,
operation/incidents/incident_detail.php, operation/messages/message.php:
Function updates and new function definitions
* include/functions.php: safe_input used utf_decode which gives problems
with foreign chars since everything else is (or should be UTF-8) fixed.
format_datetime is no longer necessary - use print_timestamp for output.
Extended multibyte wrapper functions.
* include/functions_db.php: give_server_name is now get_server_name;
dame_so_name is now get_os_name; dame_so_icon is now print_os_icon;
show_icon_group is now print_group_icon; give_network_profile_name is now
get_networkprofile_name; smal_event_table is now print_events_table
* include/functions_events.php: print_events_table was moved here and
fixed. Now calculates the cutoff of event and agent text.
* include/functions_html.php: Added title to print_table function and
updated documentation. print_timestamp now uses the new function
definitions (array) and handles 0-dates better. print_group_icon and
print_os_icon added and extended. Added print_agent_name. This function
fixes issues that show up when cutting off agent names with multibyte char
* operation/servers/view_server.php: Rewrite with new functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1295 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-17 15:26:42 +01:00
function get_networkprofile_name ( $id_network_profile ) {
2008-06-19 15:50:52 +02:00
return ( string ) get_db_value ( 'name' , 'tnetwork_profile' , 'id_np' , $id_network_profile );
}
2007-04-13 20:47:58 +02:00
2008-06-19 15:50:52 +02:00
/**
* Assign an IP address to an agent .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent id
* @ param string IP address to assign
2008-06-19 15:50:52 +02:00
*/
2007-04-13 20:47:58 +02:00
function agent_add_address ( $id_agent , $ip_address ) {
2007-04-18 11:58:26 +02:00
// Check if already is attached to agent
2008-07-29 18:50:17 +02:00
$sql = sprintf ( " SELECT COUNT(`ip`) FROM taddress_agent, taddress
2007-04-18 11:58:26 +02:00
WHERE taddress_agent . id_a = taddress . id_a
2008-07-29 18:50:17 +02:00
AND ip = '%s' AND id_agent = % d " , $ip_address , $id_agent );
2008-07-29 19:10:28 +02:00
$current_address = get_db_sql ( $sql );
2008-07-29 18:50:17 +02:00
if ( $current_address > 0 )
2007-04-18 11:58:26 +02:00
return ;
2008-06-19 15:50:52 +02:00
2007-04-18 11:58:26 +02:00
// Look for a record with this IP Address
2008-06-19 15:50:52 +02:00
$id_address = ( int ) get_db_value ( 'id_a' , 'taddress' , 'ip' , $ip_address );
2008-07-29 18:50:17 +02:00
if ( $id_address === 0 ) {
2007-04-18 11:58:26 +02:00
// Create IP address in tadress table
2008-07-29 18:50:17 +02:00
$sql = sprintf ( " INSERT INTO taddress (ip) VALUES ('%s') " , $ip_address );
$id_address = process_sql ( $sql , " insert_id " );
2007-04-13 20:47:58 +02:00
}
2008-06-19 15:50:52 +02:00
2007-04-18 11:58:26 +02:00
// Add address to agent
2008-07-29 18:50:17 +02:00
$sql = sprintf ( " INSERT INTO taddress_agent
2007-04-18 11:58:26 +02:00
( id_a , id_agent ) VALUES
2008-07-29 18:50:17 +02:00
( % d , % d ) " , $id_address , $id_agent );
process_sql ( $sql );
2007-04-18 11:58:26 +02:00
}
2007-04-13 20:47:58 +02:00
2008-06-19 15:50:52 +02:00
/**
* Unassign an IP address from an agent .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent id
* @ param string IP address to unassign
2008-06-19 15:50:52 +02:00
*/
2007-04-18 11:58:26 +02:00
function agent_delete_address ( $id_agent , $ip_address ) {
2008-07-29 18:50:17 +02:00
$sql = sprintf ( " SELECT id_ag FROM taddress_agent, taddress
WHERE taddress_agent . id_a = taddress . id_a AND ip = '%s'
AND id_agent = % d " , $ip_address , $id_agent );
$id_ag = get_db_sql ( $sql );
if ( $id_ag !== false ) {
$sql = sprintf ( " DELETE FROM taddress_agent WHERE id_ag = %d " , $id_ag );
process_sql ( $sql );
2007-04-13 20:47:58 +02:00
}
2008-11-06 21:16:15 +01:00
// Need to change main address?
if ( get_agent_address ( $id_agent ) == $ip_address ) {
$new_ips = get_agent_addresses ( $id_agent );
// Change main address in agent to first one in the list
2008-11-20 15:09:26 +01:00
$query = sprintf ( " UPDATE tagente SET `direccion` = '%s' WHERE id_agente = %d " , current ( $new_ips ), $id_agent );
2008-07-29 18:50:17 +02:00
process_sql ( $query );
2007-04-18 11:58:26 +02:00
}
}
2008-06-19 15:50:52 +02:00
/**
* Get address of an agent .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string The address of the given agent
2008-06-19 15:50:52 +02:00
*/
2008-11-06 21:16:15 +01:00
function get_agent_address ( $id_agent ) {
return ( string ) get_db_value ( 'direccion' , 'tagente' , 'id_agente' , ( int ) $id_agent );
2007-04-18 11:58:26 +02:00
}
2008-10-24 11:52:46 +02:00
/**
* Get the agent that matches an IP address
*
2009-01-19 15:42:34 +01:00
* @ param string IP address to get the agents .
2008-10-24 11:52:46 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return mixed The agent that has the IP address given . False if none were found .
2008-10-24 11:52:46 +02:00
*/
function get_agent_with_ip ( $ip_address ) {
$sql = sprintf ( ' SELECT tagente .*
FROM tagente , taddress , taddress_agent
WHERE tagente . id_agente = taddress_agent . id_agent
AND taddress_agent . id_a = taddress . id_a
AND ip = " %s " ' , $ip_address );
return get_db_row_sql ( $sql );
}
2008-06-19 15:50:52 +02:00
/**
2008-11-06 21:16:15 +01:00
* Get all IP addresses of an agent
2008-06-19 15:50:52 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param int Agent id
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return array Array with the IP address of the given agent or an empty array .
2008-06-19 15:50:52 +02:00
*/
2008-11-06 21:16:15 +01:00
function get_agent_addresses ( $id_agent ) {
$sql = sprintf ( " SELECT ip FROM taddress_agent, taddress
2007-04-18 11:58:26 +02:00
WHERE taddress_agent . id_a = taddress . id_a
2008-11-06 21:16:15 +01:00
AND id_agent = % d " , $id_agent );
$ips = get_db_all_rows_sql ( $sql );
if ( $ips === false ) {
$ips = array ();
}
$ret_arr = array ();
foreach ( $ips as $row ) {
2008-11-20 15:09:26 +01:00
$ret_arr [ $row [ " ip " ]] = $row [ " ip " ];
2008-11-06 21:16:15 +01:00
}
return $ret_arr ;
2007-04-13 20:47:58 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get agent id from an agent module .
*
2009-01-19 15:42:34 +01:00
* @ param int Id of the agent module .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int The agent if of the given module .
2008-06-19 15:50:52 +02:00
*/
function give_agent_id_from_module_id ( $id_agent_module ) {
2008-06-19 18:01:54 +02:00
return ( int ) get_db_value ( 'id_agente' , 'tagente_modulo' , 'id_agente_modulo' , $id_agent_module );
2007-03-28 18:07:29 +02:00
}
2008-08-04 10:15:16 +02:00
$sql_cache = array ( 'saved' => 0 );
2008-06-19 15:50:52 +02:00
/**
* Get the first value of the first row of a table in the database .
*
2009-01-19 15:42:34 +01:00
* @ param string Field name to get
* @ param string Table to retrieve the data
* @ param string Field to filter elements
* @ param string Condition the field must have
2008-08-04 10:15:16 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return mixed Value of first column of the first row . False if there were no row .
2008-07-21 14:23:28 +02:00
*/
2008-08-04 10:15:16 +02:00
function get_db_value ( $field , $table , $field_search = 1 , $condition = 1 ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
if ( is_int ( $condition )) {
2008-09-30 19:55:36 +02:00
$sql = sprintf ( " SELECT %s FROM %s WHERE %s = %d LIMIT 1 " ,
2008-08-04 10:15:16 +02:00
$field , $table , $field_search , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else if ( is_float ( $condition ) || is_double ( $condition )) {
2008-09-30 19:55:36 +02:00
$sql = sprintf ( " SELECT %s FROM %s WHERE %s = %f LIMIT 1 " ,
2008-08-04 10:15:16 +02:00
$field , $table , $field_search , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
2008-09-30 19:55:36 +02:00
$sql = sprintf ( " SELECT %s FROM %s WHERE %s = '%s' LIMIT 1 " ,
2008-08-04 10:15:16 +02:00
$field , $table , $field_search , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-07-16 23:04:31 +02:00
$result = get_db_all_rows_sql ( $sql );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
2008-09-03 14:01:46 +02:00
if ( $result === false )
2008-07-21 14:23:28 +02:00
return false ;
return $result [ 0 ][ $field ];
2008-04-01 15:53:11 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the first row of an SQL database query .
*
2009-01-19 15:42:34 +01:00
* @ param string SQL select statement to execute .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return mixed The first row of the result or false
2008-06-19 15:50:52 +02:00
*/
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
function get_db_row_sql ( $sql ) {
2008-07-16 23:04:31 +02:00
$sql .= " LIMIT 1 " ;
$result = get_db_all_rows_sql ( $sql );
2008-08-04 10:15:16 +02:00
2008-07-21 14:23:28 +02:00
if ( $result === false )
return false ;
2008-08-04 10:15:16 +02:00
return $result [ 0 ];
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
}
2008-06-19 15:50:52 +02:00
/**
* Get the first row of a database query into a table .
*
* The SQL statement executed would be something like :
* " SELECT * FROM $table WHERE $field_search = $condition "
*
2009-01-19 15:42:34 +01:00
* @ param string Table to get the row
* @ param string Field to filter elementes
* @ param string Condition the field must have .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return mixed The first row of a database query or false .
2008-06-19 15:50:52 +02:00
*/
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
function get_db_row ( $table , $field_search , $condition ) {
if ( is_int ( $condition )) {
2008-07-21 15:43:33 +02:00
$sql = sprintf ( " SELECT * FROM `%s` WHERE `%s` = %d LIMIT 1 " , $table , $field_search , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else if ( is_float ( $condition ) || is_double ( $condition )) {
2008-07-21 15:43:33 +02:00
$sql = sprintf ( " SELECT * FROM `%s` WHERE `%s` = %f LIMIT 1 " , $table , $field_search , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
2008-07-15 23:29:28 +02:00
$sql = sprintf ( " SELECT * FROM `%s` WHERE `%s` = '%s' LIMIT 1 " , $table , $field_search , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-07-15 22:19:30 +02:00
$result = get_db_all_rows_sql ( $sql );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
if ( $result === false )
2008-07-21 14:23:28 +02:00
return false ;
2008-07-15 22:19:30 +02:00
return $result [ 0 ];
2008-01-10 17:40:00 +01:00
}
2008-06-19 15:50:52 +02:00
/**
* Get a single field in the databse from a SQL query .
*
2009-01-19 15:42:34 +01:00
* @ param string SQL statement to execute
* @ param mixed Field number or row to get , beggining by 0. Default : 0
2008-10-14 11:19:19 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return mixed The selected field of the first row in a select statement .
2008-06-19 15:50:52 +02:00
*/
function get_db_sql ( $sql , $field = 0 ) {
2008-07-21 14:23:28 +02:00
$result = get_db_all_rows_sql ( $sql );
if ( $result === false )
return false ;
2008-08-04 10:15:16 +02:00
return $result [ 0 ][ $field ];
2008-01-10 17:40:00 +01:00
}
2007-05-20 19:12:31 +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
/**
* Get all the result rows using an SQL statement .
*
2009-01-19 15:42:34 +01:00
* @ param string SQL statement to execute .
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
*
2009-01-08 16:52:13 +01:00
* @ return mixed A matrix with all the values returned from the SQL statement or
2008-07-21 14:23:28 +02:00
* false in case of empty result
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
*/
2008-06-30 10:11:10 +02:00
function get_db_all_rows_sql ( $sql ) {
2008-07-25 20:37:32 +02:00
$return = process_sql ( $sql );
2008-07-21 14:23:28 +02:00
if ( ! empty ( $return ))
return $return ;
//Return false, check with === or !==
return false ;
}
2008-11-05 14:12:45 +01:00
/**
* Error handler function when an SQL error is triggered .
*
2009-01-19 15:42:34 +01:00
* @ param int Level of the error raised ( not used , but required by set_error_handler ()) .
* @ param string Contains the error message .
2009-01-08 16:52:13 +01:00
*
2009-01-19 15:42:34 +01:00
* @ return bool True if error level is lower or equal than errno .
2008-11-05 14:12:45 +01:00
*/
function sql_error_handler ( $errno , $errstr ) {
2008-11-07 13:45:18 +01:00
if ( error_reporting () <= $errno )
return false ;
2008-11-05 14:12:45 +01:00
echo " <strong>SQL error</strong>: " . $errstr . " <br /> \n " ;
return true ;
}
2008-07-21 14:23:28 +02:00
/**
* This function comes back with an array in case of SELECT
* in case of UPDATE , DELETE etc . with affected rows
* an empty array in case of SELECT without results
2008-07-29 18:50:17 +02:00
* Queries that return data will be cached so queries don ' t get repeated
*
2009-01-19 15:42:34 +01:00
* @ param string SQL statement to execute
2008-07-29 18:50:17 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param string What type of info to return in case of INSERT / UPDATE .
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* 'affected_rows' will return mysql_affected_rows ( default value )
* 'insert_id' will return the ID of an autoincrement value
* 'info' will return the full ( debug ) information of a query
2008-07-29 18:50:17 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return mixed An array with the rows , columns and values in a multidimensional array or false in error
2008-07-21 14:23:28 +02:00
*/
2008-09-03 14:01:46 +02:00
function process_sql ( $sql , $rettype = " affected_rows " ) {
2008-07-21 15:43:33 +02:00
global $config ;
2008-07-15 23:29:28 +02:00
global $sql_cache ;
2008-11-07 13:45:18 +01:00
2008-07-15 23:29:28 +02:00
$retval = array ();
2008-11-07 13:45:18 +01:00
if ( $sql == '' )
return false ;
2008-07-17 08:41:39 +02:00
if ( ! empty ( $sql_cache [ $sql ])) {
$retval = $sql_cache [ $sql ];
$sql_cache [ 'saved' ] ++ ;
2008-07-15 22:19:30 +02:00
} else {
2008-07-16 23:04:31 +02:00
$result = mysql_query ( $sql );
2008-07-21 14:23:28 +02:00
if ( $result === false ) {
2008-11-05 14:12:45 +01:00
$backtrace = debug_backtrace ();
$error = sprintf ( '%s (\'%s\') in <strong>%s</strong> on line %d' ,
mysql_error (), $sql , $backtrace [ 0 ][ 'file' ], $backtrace [ 0 ][ 'line' ]);
set_error_handler ( 'sql_error_handler' );
trigger_error ( $error );
restore_error_handler ();
2008-07-21 14:23:28 +02:00
return false ;
} elseif ( $result === true ) {
2008-07-29 18:50:17 +02:00
if ( $rettype == " insert_id " ) {
return mysql_insert_id ();
} elseif ( $rettype == " info " ) {
return mysql_info ();
}
2008-07-21 14:23:28 +02:00
return mysql_affected_rows (); //This happens in case the statement was executed but didn't need a resource
} else {
while ( $row = mysql_fetch_array ( $result )) {
array_push ( $retval , $row );
}
$sql_cache [ $sql ] = $retval ;
mysql_free_result ( $result );
2008-07-15 23:29:28 +02:00
}
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-07-21 15:43:33 +02:00
if ( ! empty ( $retval ))
return $retval ;
2008-07-21 14:23:28 +02:00
//Return false, check with === or !==
2008-07-21 15:43:33 +02:00
return false ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +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
/**
* Get all the rows in a table of the database .
*
2009-01-19 15:42:34 +01:00
* @ param string Database table name .
* @ param string Field to order by .
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
*
2009-01-08 16:52:13 +01:00
* @ return mixed A matrix with all the values in the table
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
*/
2008-07-09 18:33:28 +02:00
function get_db_all_rows_in_table ( $table , $order_field = " " ) {
2008-07-15 22:19:30 +02:00
if ( $order_field != " " ) {
2008-10-02 11:19:02 +02:00
return get_db_all_rows_sql ( " SELECT * FROM ` " . $table . " ` ORDER BY " . $order_field );
2008-07-15 22:19:30 +02:00
} else {
2008-07-16 23:04:31 +02:00
return get_db_all_rows_sql ( " SELECT * FROM ` " . $table . " ` " );
2008-07-15 22:19:30 +02:00
}
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +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
/**
* Get all the rows in a table of the databes filtering from a field .
*
2009-01-19 15:42:34 +01:00
* @ param string Database table name .
* @ param string Field of the table .
* @ param string Condition the field must have to be selected .
* @ param string Field to order by .
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
*
2009-01-08 16:52:13 +01:00
* @ return mixed A matrix with all the values in the table that matches the condition in the field or false
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
*/
2008-07-09 18:33:28 +02:00
function get_db_all_rows_field_filter ( $table , $field , $condition , $order_field = " " ) {
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
if ( is_int ( $condition ) || is_bool ( $condition )) {
2008-09-30 19:55:36 +02:00
$sql = sprintf ( " SELECT * FROM `%s` WHERE `%s` = %d " , $table , $field , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else if ( is_float ( $condition ) || is_double ( $condition )) {
2008-09-30 19:55:36 +02:00
$sql = sprintf ( " SELECT * FROM `%s` WHERE `%s` = %f " , $table , $field , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
2008-07-21 14:23:28 +02:00
$sql = sprintf ( " SELECT * FROM `%s` WHERE `%s` = '%s' " , $table , $field , $condition );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-07-09 18:33:28 +02:00
if ( $order_field != " " )
2008-10-14 11:19:19 +02:00
$sql .= sprintf ( " ORDER BY %s " , $order_field );
2008-06-30 10:11:10 +02:00
return get_db_all_rows_sql ( $sql );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +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
/**
* Get all the rows in a table of the databes filtering from a field .
*
2009-01-19 15:42:34 +01:00
* @ param string Database table name .
* @ param string Field of the table .
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
*
2009-01-08 16:52:13 +01:00
* @ return mixed A matrix with all the values in the table that matches the condition in the field
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
*/
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
function get_db_all_fields_in_table ( $table , $field = '' , $condition = '' , $order_field = '' ) {
2008-07-21 15:43:33 +02:00
$sql = sprintf ( " SELECT * FROM `%s` " , $table );
2008-10-14 11:19:19 +02:00
if ( $condition != '' ) {
2008-07-21 15:43:33 +02:00
$sql .= sprintf ( " WHERE `%s` = '%s' " , $field , $condition );
2008-07-16 23:04:31 +02:00
}
2008-10-14 11:19:19 +02:00
if ( $order_field != " " )
$sql .= sprintf ( " ORDER BY %s " , $order_field );
2008-07-16 23:04:31 +02:00
return get_db_all_rows_sql ( $sql );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
/**
* Formats an array of values into a SQL string .
*
* This function is useful to generate an UPDATE SQL sentence from a list of
* values . Example code :
*
* < code >
* $values = array ();
* $values [ 'name' ] = " Name " ;
* $values [ 'description' ] = " Long description " ;
* $sql = 'UPDATE table SET ' . format_array_to_update_sql ( $values ) . ' WHERE id=1' ;
* echo $sql ;
* </ code >
* Will return :
* < code >
* UPDATE table SET `name` = " Name " , `description` = " Long description " WHERE id = 1
* </ code >
*
* @ param array Values to be formatted in an array indexed by the field name .
*
* @ return string Values joined into an SQL string that can fits into an UPDATE
* sentence .
*/
function format_array_to_update_sql ( $values ) {
$fields = array ();
foreach ( $values as $field => $value ) {
if ( ! is_string ( $field ))
continue ;
if ( $value === NULL ) {
$sql = sprintf ( " `%s` = NULL " , $field );
} elseif ( is_int ( $value ) || is_bool ( $value )) {
$sql = sprintf ( " `%s` = %d " , $field , $value );
} else if ( is_float ( $value ) || is_double ( $value )) {
$sql = sprintf ( " `%s` = %f " , $field , $value );
} else {
$sql = sprintf ( " `%s` = '%s' " , $field , $value );
}
array_push ( $fields , $sql );
}
return implode ( " , " , $fields );
}
2008-06-19 15:50:52 +02:00
/**
* Get the status of an alert assigned to an agent module .
*
2009-01-19 15:42:34 +01:00
* @ param int Id agent module to check .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return bool True if there were alerts fired .
2008-06-19 15:50:52 +02:00
*/
2008-10-14 11:19:19 +02:00
function return_status_agent_module ( $id_agentmodule = 0 ) {
2008-10-14 17:07:53 +02:00
$status = get_db_value ( 'estado' , 'tagente_estado' , 'id_agente_modulo' , $id_agentmodule );
2008-10-14 11:19:19 +02:00
if ( $status == 100 ) {
2008-07-16 23:04:31 +02:00
// We need to check if there are any alert on this item
2009-01-19 15:42:34 +01:00
$times_fired = get_db_value ( 'SUM(times_fired)' , 'talert_template_modules' ,
'id_agent_module' , $id_agentmodule );
2008-10-14 11:19:19 +02:00
if ( $times_fired > 0 ) {
2008-07-16 23:04:31 +02:00
return 0 ;
}
// No alerts fired for this agent module
return 1 ;
2008-10-14 21:45:08 +02:00
} elseif ( $status == 0 ) { // 0 is ok for estado field
2008-07-16 23:04:31 +02:00
return 1 ;
} else {
2008-07-10 13:58:40 +02:00
return 0 ;
2008-06-19 15:50:52 +02:00
}
}
2007-07-28 20:11:48 +02:00
2008-06-19 15:50:52 +02:00
/**
* Get the status of a layout .
*
* It gets all the data of the contained elements ( including nested
* layouts ), and makes an AND operation to be sure that all the items
* are OK . If any of them is down , then result is down ( 0 )
*
2009-01-19 15:42:34 +01:00
* @ param int Id of the layout
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return bool The status of the given layout .
2008-06-19 15:50:52 +02:00
*/
function return_status_layout ( $id_layout = 0 ) {
2007-07-28 20:11:48 +02:00
$temp_status = 0 ;
$temp_total = 0 ;
2008-07-21 15:43:33 +02:00
$sql = sprintf ( 'SELECT id_agente_modulo, parent_item, id_layout_linked FROM `tlayout_data` WHERE `id_layout` = %d' , $id_layout );
2008-07-16 23:04:31 +02:00
$result = get_db_all_rows_sql ( $sql );
2008-07-17 14:21:17 +02:00
if ( $result === false )
return 0 ;
2008-07-16 23:04:31 +02:00
foreach ( $result as $rownum => $data ) {
if (( $data [ " id_layout_linked " ] != 0 ) && ( $data [ " id_agente_modulo " ] == 0 )) {
$temp_status += return_status_layout ( $data [ " id_layout_linked " ]);
2007-07-28 20:11:48 +02:00
$temp_total ++ ;
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
} else {
2008-07-16 23:04:31 +02:00
$temp_status += return_status_agent_module ( $data [ " id_agente_modulo " ]);
2007-07-28 20:11:48 +02:00
$temp_total ++ ;
}
}
2008-07-16 23:04:31 +02:00
if ( $temp_status == $temp_total ) {
2007-07-28 20:11:48 +02:00
return 1 ;
2008-07-16 23:04:31 +02:00
}
2008-07-17 14:21:17 +02:00
return 0 ;
2007-07-28 20:11:48 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the current value of an agent module .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent module id .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int a numerically formatted value
2008-06-19 15:50:52 +02:00
*/
function return_value_agent_module ( $id_agentmodule ) {
2008-10-14 17:07:53 +02:00
return format_numeric ( get_db_value ( 'datos' , 'tagente_estado' ,
'id_agente_modulo' , $id_agentmodule ));
2007-05-20 19:12:31 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the X axis coordinate of a layout item
*
2009-01-19 15:42:34 +01:00
* @ param int Id of the layout to get .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int The X axis coordinate value .
2008-06-19 15:50:52 +02:00
*/
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
function get_layoutdata_x ( $id_layoutdata ) {
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
return ( float ) get_db_value ( 'pos_x' , 'tlayout_data' , 'id' , ( int ) $id_layoutdata );
2007-05-20 19:12:31 +02:00
}
2008-06-19 15:50:52 +02:00
/**
2009-01-08 16:52:13 +01:00
* Get the Y axis coordinate of a layout item
2008-06-19 15:50:52 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param int Id of the layout to get .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int The Y axis coordinate value .
2008-06-19 15:50:52 +02:00
*/
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
function get_layoutdata_y ( $id_layoutdata ){
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
return ( float ) get_db_value ( 'pos_y' , 'tlayout_data' , 'id' , ( int ) $id_layoutdata );
2007-05-20 19:12:31 +02:00
}
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
/**
* Get the previous data to the timestamp provided .
*
* It ' s useful to know the first value of a module in an interval ,
2008-06-20 14:13:35 +02:00
* since it will be the last value in the table which has a timestamp
* before the beginning of the interval . All this calculation is due
* to the data compression algorithm .
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
*
2009-01-19 15:42:34 +01:00
* @ param int Agent module id
* @ param int The timestamp to look backwards from and get the data .
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
*
2009-01-08 16:52:13 +01:00
* @ return mixed The row of tagente_datos of the last period . False if there were no data .
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
*/
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
function get_previous_data ( $id_agent_module , $utimestamp = 0 ) {
if ( empty ( $utimestamp ))
$utimestamp = time ();
2008-06-20 14:13:35 +02:00
$interval = get_module_interval ( $id_agent_module );
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
$sql = sprintf ( ' SELECT * FROM tagente_datos
WHERE id_agente_modulo = % d
AND utimestamp <= % d
2008-06-20 14:13:35 +02:00
AND utimestamp > % d
2008-07-17 14:21:17 +02:00
ORDER BY utimestamp DESC ' ,
2008-06-20 14:13:35 +02:00
$id_agent_module , $utimestamp , $utimestamp - $interval );
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
return get_db_row_sql ( $sql );
}
2008-06-19 15:50:52 +02:00
/**
* Get the average value of an agent module in a period of time .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent module id
* @ param int Period of time to check ( in seconds )
* @ param int Top date to check the values . Default current time .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int The average module value in the interval .
2008-06-19 15:50:52 +02:00
*/
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
function get_agentmodule_data_average ( $id_agent_module , $period , $date = 0 ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
if ( ! $date )
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
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
$datelimit = $date - $period ;
$sql = sprintf ( " SELECT SUM(datos), COUNT(*) FROM tagente_datos
WHERE id_agente_modulo = % d
AND utimestamp > % d AND utimestamp <= % d
ORDER BY utimestamp ASC " ,
$id_agent_module , $datelimit , $date );
$values = get_db_row_sql ( $sql );
$sum = ( float ) $values [ 0 ];
$total = ( int ) $values [ 1 ];
/* Get also the previous data before the selected interval. */
$previous_data = get_previous_data ( $id_agent_module , $datelimit );
if ( $previous_data )
return ( $previous_data [ 'datos' ] + $sum ) / ( $total + 1 );
2008-06-23 16:36:22 +02:00
if ( $total > 0 )
return $sum / $total ;
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
return 0 ;
2007-05-20 19:12:31 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the maximum value of an agent module in a period of time .
*
2009-01-19 15:42:34 +01:00
* @ param int Agent module id to get the maximum value .
* @ param int Period of time to check ( in seconds )
* @ param int Top date to check the values . Default current time .
2008-06-19 15:50:52 +02:00
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ return float The maximum module value in the interval .
2008-06-19 15:50:52 +02:00
*/
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
function get_agentmodule_data_max ( $id_agent_module , $period , $date = 0 ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
if ( ! $date )
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
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
$datelimit = $date - $period ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$sql = sprintf ( " SELECT MAX(datos) FROM tagente_datos
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
WHERE id_agente_modulo = % d
2008-06-20 14:13:35 +02:00
AND utimestamp > % d AND utimestamp <= % d " ,
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
$id_agent_module , $datelimit , $date );
$max = ( float ) get_db_sql ( $sql );
/* Get also the previous report before the selected interval. */
$previous_data = get_previous_data ( $id_agent_module , $datelimit );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
if ( $previous_data !== false )
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
return max ( $previous_data [ 'datos' ], $max );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
return max (( float ) $previous_data , $max );
2007-05-20 19:12:31 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the minimum value of an agent module in a period of time .
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param int Agent module id to get the minimum value .
* @ param int Period of time to check ( in seconds )
* @ param int Top date to check the values in Unix time . Default current time .
2008-06-19 15:50:52 +02:00
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ return float The minimum module value of the module
2008-06-19 15:50:52 +02:00
*/
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
function get_agentmodule_data_min ( $id_agent_module , $period , $date = 0 ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
if ( ! $date )
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
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
$datelimit = $date - $period ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$sql = sprintf ( " SELECT MIN(datos) FROM tagente_datos
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
WHERE id_agente_modulo = % d
2008-06-20 14:13:35 +02:00
AND utimestamp > % d AND utimestamp <= % d " ,
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
$id_agent_module , $datelimit , $date );
$min = ( float ) get_db_sql ( $sql );
/* Get also the previous data before the selected interval. */
$previous_data = get_previous_data ( $id_agent_module , $datelimit );
if ( $previous_data )
return min ( $previous_data [ 'datos' ], $min );
return $min ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-06-19 15:50:52 +02:00
/**
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
* Get the sum of values of an agent module in a period of time .
2008-06-19 15:50:52 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param int Agent module id to get the sumatory .
* @ param int Period of time to check ( in seconds )
* @ param int Top date to check the values . Default current time .
2008-06-19 15:50:52 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return int The sumatory of the module values in the interval .
2008-06-19 15:50:52 +02:00
*/
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
function get_agentmodule_data_sum ( $id_agent_module , $period , $date = 0 ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
if ( ! $date )
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$date = get_system_time ();
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$datelimit = $date - $period ; // limit date
2008-07-16 23:04:31 +02:00
$id_module_type = get_db_value ( 'id_tipo_modulo' , 'tagente_modulo' , 'id_agente_modulo' , $id_agent_module );
2008-06-23 18:07:00 +02:00
$module_name = get_db_value ( 'nombre' , 'ttipo_modulo' , 'id_tipo' , $id_module_type );
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
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
if ( is_module_data_string ( $module_name )) {
2008-08-12 Esteban Sanchez <estebans@artica.es>
* pandoradb_data.sql: Added default languages.
* include/streams.php, include/gettext.php: Added to repository. New
files to add gettext support of mo files.
* include/functions_db.php: Function lang_string() functionallity
changed to use gettext library.
* include/languages/language_es_es.php,
include/languages/language_gl.php, include/languages/language_en.php,
include/languages/language_pt_br.php,
include/languages/language_it.php,
include/languages/language_ast_es.php,
include/languages/language_es_la.php,
include/languages/language_de.php, include/languages/language_fr.php,
include/languages/language_ca.php: Files deleted, they are
deprecated since we have moved to gettext.
* lude/languages/pt_br.mo, include/languages/es.mo,
include/languages/fr.po, include/languages/it.po,
include/languages/ca.po, include/languages/ast.po,
include/languages/de.po, include/languages/gl.mo: Gettext translations
of the previous languages we have in language_*.php files.
* include/languages/Makefile: Added to repository to generate
index.pot and mo files of each translation.
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/config_process.php,
include/functions.php, include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/sla_view.php, operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, general/logoff.php,
general/pandora_help.php, general/footer.php, general/noaccess.php,
general/logon_failed.php, general/links_menu.php,
general/login_page.php, general/logon_ok.php, general/header.php,
general/main_menu.php, godmode/groups/configure_group.php,
godmode/groups/group_list.php, godmode/setup/news.php,
godmode/setup/links.php, godmode/setup/setup.php,
godmode/users/user_list.php, godmode/users/configure_user.php,
godmode/profiles/profile_list.php, godmode/admin_access_logs.php,
godmode/db/db_info_data.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/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced string parameters of __() callings to
plain english. Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1006 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-12 14:06:25 +02:00
return __ ( 'Wrong module type' );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
// Get the whole interval of data
2008-06-20 14:13:35 +02:00
$sql = sprintf ( ' SELECT utimestamp , datos FROM tagente_datos
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
WHERE id_agente_modulo = % d
2008-06-20 14:13:35 +02:00
AND utimestamp > % d AND utimestamp <= % d
ORDER BY utimestamp ASC ' ,
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
$id_agent_module , $datelimit , $date );
2008-06-30 10:11:10 +02:00
$datas = get_db_all_rows_sql ( $sql );
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
/* Get also the previous data before the selected interval. */
$previous_data = get_previous_data ( $id_agent_module , $datelimit );
if ( $previous_data ) {
/* Add data to the beginning */
array_unshift ( $datas , $previous_data );
}
2008-07-21 15:43:33 +02:00
if ( $datas === false ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
return 0 ;
}
2008-06-20 14:13:35 +02:00
$last_data = " " ;
$total_badtime = 0 ;
$module_interval = get_module_interval ( $id_agent_module );
2008-06-24 14:28:34 +02:00
$timestamp_begin = $datelimit + $module_interval ;
2008-06-20 14:13:35 +02:00
$timestamp_end = 0 ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$sum = 0 ;
2008-06-20 14:13:35 +02:00
$data_value = 0 ;
2008-08-25 01:59:10 +02:00
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
foreach ( $datas as $data ) {
2008-06-20 14:13:35 +02:00
$timestamp_end = $data [ " utimestamp " ];
$elapsed = $timestamp_end - $timestamp_begin ;
$times = intval ( $elapsed / $module_interval );
if ( is_module_inc ( $module_name )) {
$data_value = $data [ 'datos' ] * $module_interval ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
2008-06-20 14:13:35 +02:00
$data_value = $data [ 'datos' ];
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-06-20 14:13:35 +02:00
$sum += $times * $data_value ;
$timestamp_begin = $data [ " utimestamp " ];
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-06-20 14:13:35 +02:00
/* The last value must be get from tagente_estado , but
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
it will count only if it ' s not older than date demanded
*/
2008-06-20 14:13:35 +02:00
$timestamp_end = get_db_value ( 'utimestamp' , 'tagente_estado' , 'id_agente_modulo' , $id_agent_module );
if ( $timestamp_end <= $datelimit ) {
$elapsed = $timestamp_end - $timestamp_begin ;
$times = intval ( $elapsed / $module_interval );
2008-07-02 14:30:56 +02:00
if ( is_module_inc ( $module_name )) {
$data_value = $data [ 'datos' ] * $module_interval ;
} else {
$data_value = $data [ 'datos' ];
}
$sum += $times * $data_value ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
return ( float ) $sum ;
2007-05-20 19:12:31 +02:00
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
/**
2008-10-14 17:07:53 +02:00
* Get a translated string
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
*
2009-01-19 15:42:34 +01:00
* @ param string String to translate
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
*
2009-01-08 16:52:13 +01:00
* @ return string The translated string . If not defined , the same string will be returned
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
*/
function __ ( $string ) {
2008-10-14 17:07:53 +02:00
global $l10n ;
if ( is_null ( $l10n ))
return $string ;
return $l10n -> translate ( $string );
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
}
2008-06-19 15:50:52 +02:00
/**
* Get the numbers of servers up .
*
* This check assumes that server_keepalive should be at least 15 minutes .
*
2009-01-08 16:52:13 +01:00
* @ return int The number of servers alive .
2008-06-19 15:50:52 +02:00
*/
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
function check_server_status () {
$sql = " SELECT COUNT(id_server) FROM tserver WHERE status = 1 AND keepalive > NOW() - INTERVAL 15 MINUTE " ;
2008-09-24 16:34:52 +02:00
$status = ( int ) get_db_sql ( $sql ); //Cast as int will assure a number value
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
// Set servers to down
2008-06-19 15:50:52 +02:00
if ( $status == 0 ){
2008-07-29 18:50:17 +02:00
process_sql ( " UPDATE tserver SET status = 0 " );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
2008-06-19 15:50:52 +02:00
return $status ;
2008-04-03 17:43:34 +02:00
}
2008-06-19 15:50:52 +02:00
/**
2009-01-08 16:52:13 +01:00
* @ deprecated Will show a small HTML table with some compound alert information
2008-06-19 15:50:52 +02:00
*/
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
function show_alert_row_mini ( $id_combined_alert ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$color = 1 ;
2009-01-19 15:42:34 +01:00
$sql = sprintf ( " SELECT talert_template_modules.*,tcompound_alert.operation
FROM talert_template_modules , tcompound_alert
WHERE tcompound_alert . id_aam = talert_template_modules . id
2008-09-03 14:01:46 +02:00
AND tcompound_alert . id = % d " , $id_combined_alert );
2008-07-29 18:50:17 +02:00
$result = get_db_all_rows_sql ( $sql );
2008-08-25 01:59:10 +02:00
2008-09-03 14:01:46 +02:00
if ( $result === false )
2008-08-25 01:59:10 +02:00
return ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
echo " <table width=400 cellpadding=2 cellspacing=2 class='databox'> " ;
2008-08-19 19:09:44 +02:00
echo " <th> " . __ ( 'Name' ) . " </th> " ;
echo " <th> " . __ ( 'Oper' ) . " </th> " ;
2008-09-03 14:01:46 +02:00
/* Translators: Abbrevation for Time threshold */
2008-08-19 19:09:44 +02:00
echo " <th> " . __ ( 'Tt' ) . " </th> " ;
echo " <th> " . __ ( 'Firing' ) . " </th> " ;
echo " <th> " . __ ( 'Time' ) . " </th> " ;
2008-09-03 14:01:46 +02:00
/* Translators: Abbrevation for Description */
2008-08-19 19:09:44 +02:00
echo " <th> " . __ ( 'Desc' ) . " </th> " ;
echo " <th> " . __ ( 'Recovery' ) . " </th> " ;
echo " <th> " . __ ( 'MinMax.Al' ) . " </th> " ;
echo " <th> " . __ ( 'Days' ) . " </th> " ;
echo " <th> " . __ ( 'Fired' ) . " </th> " ;
2008-08-25 01:59:10 +02:00
2008-07-29 18:50:17 +02:00
foreach ( $result as $row2 ) {
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
if ( $color == 1 ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$tdcolor = " datos " ;
$color = 0 ;
2008-07-29 18:50:17 +02:00
} else {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$tdcolor = " datos2 " ;
$color = 1 ;
}
2008-08-04 10:15:16 +02:00
echo " <tr> " ;
2008-07-29 18:50:17 +02:00
if ( $row2 [ " disable " ] == 1 ) {
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$tdcolor = " datos3 " ;
}
2008-08-19 19:09:44 +02:00
echo " <td class= $tdcolor > " . get_db_sql ( " SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = " . $row2 [ " id_agente_modulo " ]) . " </td> " ;
echo " <td class= $tdcolor > " . $row2 [ " operation " ] . " </td> " ;
2008-04-03 17:43:34 +02:00
2008-08-19 19:09:44 +02:00
echo " <td class=' $tdcolor '> " . human_time_description ( $row2 [ " time_threshold " ]) . " </td> " ;
2008-04-03 17:43:34 +02:00
2008-07-29 18:50:17 +02:00
if ( $row2 [ " dis_min " ] != 0 ) {
$mytempdata = fmod ( $row2 [ " dis_min " ], 1 );
if ( $mytempdata == 0 ) {
$mymin = intval ( $row2 [ " dis_min " ]);
} else {
$mymin = format_for_graph ( $row2 [ " dis_min " ]);
}
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
$mymin = 0 ;
}
2008-07-29 18:50:17 +02:00
if ( $row2 [ " dis_max " ] != 0 ) {
$mytempdata = fmod ( $row2 [ " dis_max " ], 1 );
if ( $mytempdata == 0 ) {
$mymax = intval ( $row2 [ " dis_max " ]);
} else {
$mymax = format_for_graph ( $row2 [ " dis_max " ]);
}
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
$mymax = 0 ;
}
2008-07-29 18:50:17 +02:00
if (( $mymin == 0 ) && ( $mymax == 0 )) {
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
$mymin = __ ( 'N/A' );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
$mymax = $mymin ;
}
// We have alert text ?
if ( $row2 [ " alert_text " ] != " " ) {
2008-08-12 Esteban Sanchez <estebans@artica.es>
* pandoradb_data.sql: Added default languages.
* include/streams.php, include/gettext.php: Added to repository. New
files to add gettext support of mo files.
* include/functions_db.php: Function lang_string() functionallity
changed to use gettext library.
* include/languages/language_es_es.php,
include/languages/language_gl.php, include/languages/language_en.php,
include/languages/language_pt_br.php,
include/languages/language_it.php,
include/languages/language_ast_es.php,
include/languages/language_es_la.php,
include/languages/language_de.php, include/languages/language_fr.php,
include/languages/language_ca.php: Files deleted, they are
deprecated since we have moved to gettext.
* lude/languages/pt_br.mo, include/languages/es.mo,
include/languages/fr.po, include/languages/it.po,
include/languages/ca.po, include/languages/ast.po,
include/languages/de.po, include/languages/gl.mo: Gettext translations
of the previous languages we have in language_*.php files.
* include/languages/Makefile: Added to repository to generate
index.pot and mo files of each translation.
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/config_process.php,
include/functions.php, include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/sla_view.php, operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, general/logoff.php,
general/pandora_help.php, general/footer.php, general/noaccess.php,
general/logon_failed.php, general/links_menu.php,
general/login_page.php, general/logon_ok.php, general/header.php,
general/main_menu.php, godmode/groups/configure_group.php,
godmode/groups/group_list.php, godmode/setup/news.php,
godmode/setup/links.php, godmode/setup/setup.php,
godmode/users/user_list.php, godmode/users/configure_user.php,
godmode/profiles/profile_list.php, godmode/admin_access_logs.php,
godmode/db/db_info_data.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/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced string parameters of __() callings to
plain english. Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1006 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-12 14:06:25 +02:00
echo " <td class=' $tdcolor '> " . __ ( 'Text' ) . " </td> " ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
echo " <td class=' $tdcolor '> " . $mymin . " / " . $mymax . " </td> " ;
}
// Alert times
echo " <td class=' $tdcolor '> " ;
echo get_alert_times ( $row2 );
// Description
2008-07-29 18:50:17 +02:00
echo " </td><td class=' $tdcolor '> " . substr ( $row2 [ " descripcion " ], 0 , 20 );
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
// Has recovery notify activated ?
2008-07-29 18:50:17 +02:00
if ( $row2 [ " recovery_notify " ] > 0 ) {
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
$recovery_notify = __ ( 'Yes' );
2008-07-29 18:50:17 +02:00
} else {
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.php,
godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php,
godmode/db/db_info.php, godmode/db/db_event.php,
godmode/db/db_purge.php, godmode/extensions.php,
godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
$recovery_notify = __ ( 'No' );
2008-07-29 18:50:17 +02:00
}
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
echo " </td><td class=' $tdcolor '> " . $recovery_notify ;
// calculare firing conditions
if ( $row2 [ " alert_text " ] != " " ){
2008-08-12 Esteban Sanchez <estebans@artica.es>
* pandoradb_data.sql: Added default languages.
* include/streams.php, include/gettext.php: Added to repository. New
files to add gettext support of mo files.
* include/functions_db.php: Function lang_string() functionallity
changed to use gettext library.
* include/languages/language_es_es.php,
include/languages/language_gl.php, include/languages/language_en.php,
include/languages/language_pt_br.php,
include/languages/language_it.php,
include/languages/language_ast_es.php,
include/languages/language_es_la.php,
include/languages/language_de.php, include/languages/language_fr.php,
include/languages/language_ca.php: Files deleted, they are
deprecated since we have moved to gettext.
* lude/languages/pt_br.mo, include/languages/es.mo,
include/languages/fr.po, include/languages/it.po,
include/languages/ca.po, include/languages/ast.po,
include/languages/de.po, include/languages/gl.mo: Gettext translations
of the previous languages we have in language_*.php files.
* include/languages/Makefile: Added to repository to generate
index.pot and mo files of each translation.
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/config_process.php,
include/functions.php, include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/sla_view.php, operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, general/logoff.php,
general/pandora_help.php, general/footer.php, general/noaccess.php,
general/logon_failed.php, general/links_menu.php,
general/login_page.php, general/logon_ok.php, general/header.php,
general/main_menu.php, godmode/groups/configure_group.php,
godmode/groups/group_list.php, godmode/setup/news.php,
godmode/setup/links.php, godmode/setup/setup.php,
godmode/users/user_list.php, godmode/users/configure_user.php,
godmode/profiles/profile_list.php, godmode/admin_access_logs.php,
godmode/db/db_info_data.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/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced string parameters of __() callings to
plain english. Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1006 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-12 14:06:25 +02:00
$firing_cond = __ ( 'Text' ) . " ( " . substr ( $row2 [ " alert_text " ], 0 , 8 ) . " ) " ;
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
} else {
$firing_cond = $row2 [ " min_alerts " ] . " / " . $row2 [ " max_alerts " ];
}
echo " </td><td class=' $tdcolor '> " . $firing_cond ;
// calculate days
$firing_days = get_alert_days ( $row2 );
echo " </td><td class=' $tdcolor '> " . $firing_days ;
// Fired ?
2008-07-29 18:50:17 +02:00
if ( $row2 [ " times_fired " ] > 0 ) {
2008-08-12 Esteban Sanchez <estebans@artica.es>
* pandoradb_data.sql: Added default languages.
* include/streams.php, include/gettext.php: Added to repository. New
files to add gettext support of mo files.
* include/functions_db.php: Function lang_string() functionallity
changed to use gettext library.
* include/languages/language_es_es.php,
include/languages/language_gl.php, include/languages/language_en.php,
include/languages/language_pt_br.php,
include/languages/language_it.php,
include/languages/language_ast_es.php,
include/languages/language_es_la.php,
include/languages/language_de.php, include/languages/language_fr.php,
include/languages/language_ca.php: Files deleted, they are
deprecated since we have moved to gettext.
* lude/languages/pt_br.mo, include/languages/es.mo,
include/languages/fr.po, include/languages/it.po,
include/languages/ca.po, include/languages/ast.po,
include/languages/de.po, include/languages/gl.mo: Gettext translations
of the previous languages we have in language_*.php files.
* include/languages/Makefile: Added to repository to generate
index.pot and mo files of each translation.
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/config_process.php,
include/functions.php, include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/sla_view.php, operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, general/logoff.php,
general/pandora_help.php, general/footer.php, general/noaccess.php,
general/logon_failed.php, general/links_menu.php,
general/login_page.php, general/logon_ok.php, general/header.php,
general/main_menu.php, godmode/groups/configure_group.php,
godmode/groups/group_list.php, godmode/setup/news.php,
godmode/setup/links.php, godmode/setup/setup.php,
godmode/users/user_list.php, godmode/users/configure_user.php,
godmode/profiles/profile_list.php, godmode/admin_access_logs.php,
godmode/db/db_info_data.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/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced string parameters of __() callings to
plain english. Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1006 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-12 14:06:25 +02:00
echo " <td class=' " . $tdcolor . " ' align='center'><img width='20' height='9' src='images/pixel_red.png' title=' " . __ ( 'Alert fired' ) . " '></td> " ;
2008-07-29 18:50:17 +02:00
} else {
2008-08-12 Esteban Sanchez <estebans@artica.es>
* pandoradb_data.sql: Added default languages.
* include/streams.php, include/gettext.php: Added to repository. New
files to add gettext support of mo files.
* include/functions_db.php: Function lang_string() functionallity
changed to use gettext library.
* include/languages/language_es_es.php,
include/languages/language_gl.php, include/languages/language_en.php,
include/languages/language_pt_br.php,
include/languages/language_it.php,
include/languages/language_ast_es.php,
include/languages/language_es_la.php,
include/languages/language_de.php, include/languages/language_fr.php,
include/languages/language_ca.php: Files deleted, they are
deprecated since we have moved to gettext.
* lude/languages/pt_br.mo, include/languages/es.mo,
include/languages/fr.po, include/languages/it.po,
include/languages/ca.po, include/languages/ast.po,
include/languages/de.po, include/languages/gl.mo: Gettext translations
of the previous languages we have in language_*.php files.
* include/languages/Makefile: Added to repository to generate
index.pot and mo files of each translation.
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/config_process.php,
include/functions.php, include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/sla_view.php, operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, general/logoff.php,
general/pandora_help.php, general/footer.php, general/noaccess.php,
general/logon_failed.php, general/links_menu.php,
general/login_page.php, general/logon_ok.php, general/header.php,
general/main_menu.php, godmode/groups/configure_group.php,
godmode/groups/group_list.php, godmode/setup/news.php,
godmode/setup/links.php, godmode/setup/setup.php,
godmode/users/user_list.php, godmode/users/configure_user.php,
godmode/profiles/profile_list.php, godmode/admin_access_logs.php,
godmode/db/db_info_data.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/agent_template.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced string parameters of __() callings to
plain english. Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1006 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-12 14:06:25 +02:00
echo " <td class=' " . $tdcolor . " ' align='center'><img width='20' height='9' src='images/pixel_green.png' title=' " . __ ( 'Alert not fired' ) . " '></td> " ;
2008-07-29 18:50:17 +02:00
}
2008-06-15 Esteban Sanchez <estebans@artica.es>
* include/functions_html.php: Added to repository. Implements HTML
functions.
* reporting/fgraph.php: Many style correction fixes, including those
regardings tabs and blank spaces, variable names and indentation
levels for checkings. Improved dame_fecha(). Added date support to
graphic_combined_module(), grafico_modulo_sparse(). The selection of
the graphic to show based on parameters has been replaced by a switch.
The parameters are parsed with get_parameter()
* include/functions_db.php: Style correction of tabs and blanks
spaces. Use Pandora database functions on simple querying functions
such as dame_perfil(), give_disabled_group(), dame_grupo(),
give_note_author(), dame_agente_id(), dame_agente_modulo_id() and many
more, there are a lot more to change. Function comprueba_admin()
renamed to check_admin (wrap created for old function). Added some
checks to get_db_value(), get_db_row() so the SQL is build based on
the parameter types. Added get_db_all_rows_sqlfree(),
get_db_all_rows_in_table(), get_db_all_rows_field_filter(),
get_db_all_fields_in_table(). Added date support to
return_moduledata_avg_value(), return_moduledata_max_value(),
return_moduledata_min_value(). Added function
return_moduledata_sum_value() to get the sum of the values in a
module.
* include/functions.php: If input is numeric on safe_input, do not
clean it, since it's safe by itself. Use mysql_escape_string() on
salida_sql(). Added get_report_types(), get_report_name(),
get_report_type_data_source() relatives to reports. Added also
is_module_data(), is_module_proc(), is_module_inc(),
is_module_data_string() to know if a module is from a type. Replaced
form_priority() with get_event_types() so the caller of this function
will print the select (using print_select).
* operation/events/events.php: Replaced form_priorit() with
get_event_types().
* ChangeLog: Tab style correction with previous commit.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@863 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-16 12:45:08 +02:00
}
echo " </table> " ;
2008-04-03 17:43:34 +02:00
}
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
2008-06-23 16:36:22 +02:00
/**
2009-01-08 16:52:13 +01:00
* @ deprecated use get_server_info instead
2008-06-23 16:36:22 +02:00
* Get statistical information for a given server
2008-11-11 15:24:34 +01:00
*
2009-01-19 15:42:34 +01:00
* @ param int Server id to get status .
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ return array Server info array
*/
2008-06-23 16:36:22 +02:00
function server_status ( $id_server ) {
2008-11-11 15:24:34 +01:00
$serverinfo = get_server_info ( $id_server );
return $serverinfo [ $id_server ];
2008-06-23 16:36:22 +02:00
}
2008-10-10 17:08:31 +02:00
2009-01-08 16:52:13 +01:00
/**
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* Delete an agent from the database .
2008-10-14 17:07:53 +02:00
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param mixed An array of agents ids or a single integer id to be erased
2008-10-14 17:07:53 +02:00
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ return bool False if error , true if success .
*/
2008-10-14 17:07:53 +02:00
function delete_agent ( $id_agents ) {
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
//Init vars
2008-10-14 17:07:53 +02:00
$errors = 0 ;
//Subfunciton for less typing
2009-01-08 16:52:13 +01:00
/**
* @ ignore
*/
2008-10-14 17:07:53 +02:00
function temp_sql_delete ( $table , $row , $value ) {
global $errors ; //Globalize the errors variable
$sql = sprintf ( " DELETE FROM %s WHERE %s = %s " , $table , $row , $value );
$result = process_sql ( $sql );
if ( $result === false )
$errors ++ ;
}
//Convert single values to an array
if ( ! is_array ( $id_agents )) {
$id_agents [ 0 ] = ( int ) $id_agents ;
}
//Start transaction
process_sql ( " SET AUTOCOMMIT = 0; " );
$trerr = process_sql ( " START TRANSACTION; " );
if ( $trerr === false ) {
echo " Error starting transaction " ;
return false ;
}
foreach ( $id_agents as $id_agent ) {
$id_agent = ( int ) $id_agent ; //Cast as integer
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
$agent_name = get_agent_name ( $id_agent );
2008-10-14 17:07:53 +02:00
if ( $id_agent < 1 )
continue ; //If an agent is not an integer or invalid, don't process it
//A variable where we store that long subquery thing for
//modules
$tmodbase = " ANY(SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = " . $id_agent . " ) " ;
//IP address
$sql = sprintf ( " SELECT id_ag FROM taddress_agent, taddress WHERE taddress_agent.id_a = taddress.id_a AND id_agent = %d " , $id_agent );
$result = get_db_all_rows_sql ( $sql );
2008-10-14 21:45:08 +02:00
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
if ( $result )
2008-10-14 17:07:53 +02:00
foreach ( $result as $row ) {
temp_sql_delete ( " taddress_agent " , " id_ag " , $row [ " id_ag " ]);
}
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
// We cannot delete tagente_datos and tagente_datos_string here
// because it's a huge ammount of time. tagente_module has a special
// field to mark for delete each module of agent deleted and in
// daily maintance process, all data for that modules are deleted
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
//Alert
2009-01-19 15:42:34 +01:00
/* TODO: Compound alert */
//temp_sql_delete ("tcompound_alert", "id_aam", "ANY(SELECT id_aam FROM talerta_agente_modulo WHERE id_agent = ".$id_agent.")");
temp_sql_delete ( " talert_template_modules " , " id_agent_module " , $tmodbase );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2008-10-14 17:07:53 +02:00
//Events (up/down monitors)
temp_sql_delete ( " tevento " , " id_agente " , $id_agent );
//Graphs, layouts & reports
temp_sql_delete ( " tgraph_source " , " id_agent_module " , $tmodbase );
temp_sql_delete ( " tlayout_data " , " id_agente_modulo " , $tmodbase );
temp_sql_delete ( " treport_content " , " id_agent_module " , $tmodbase );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2008-10-14 17:07:53 +02:00
//Planned Downtime
temp_sql_delete ( " tplanned_downtime_agents " , " id_agent " , $id_agent );
//The status of the module
temp_sql_delete ( " tagente_estado " , " id_agente_modulo " , $tmodbase );
//The actual modules, don't put anything based on
//tagente_modulo after this
temp_sql_delete ( " tagente_modulo " , " id_agente " , $id_agent );
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
process_sql ( 'UPDATE tagente_modulo SET delete_pending = 1, disabled = 1 WHERE id_agente = ' . $id_agent );
2008-10-14 17:07:53 +02:00
//Access entries
temp_sql_delete ( " tagent_access " , " id_agent " , $id_agent );
2009-01-12 18:28:15 +01:00
//tagente_datos_inc
2009-01-19 15:42:34 +01:00
temp_sql_delete ( " tagente_datos_inc " , " id_agente_modulo " , $tmodbase );
2009-01-12 18:28:15 +01:00
2008-10-14 17:07:53 +02:00
//And at long last, the agent
temp_sql_delete ( " tagente " , " id_agente " , $id_agent );
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
// Delete remote configuration
$agent_md5 = md5 ( $agent_name , FALSE );
2009-01-12 18:28:15 +01:00
if ( isset ( $config [ " remote_config " ]))
if ( file_exists ( $config [ " remote_config " ] . " / " . $agent_md5 . " .md5 " )) {
// Agent remote configuration editor
$file_name = $config [ " remote_config " ] . " / " . $agent_md5 . " .conf " ;
unlink ( $file_name );
$file_name = $config [ " remote_config " ] . " / " . $agent_md5 . " .md5 " ;
unlink ( $file_name );
}
2008-10-14 17:07:53 +02:00
}
2008-12-10 21:15:38 +01:00
if ( $errors > 0 ) {
2008-10-14 17:07:53 +02:00
process_sql ( " ROLLBACK; " );
process_sql ( " SET AUTOCOMMIT = 1; " );
return false ;
} else {
process_sql ( " COMMIT; " );
process_sql ( " SET AUTOCOMMIT = 1; " );
return true ;
}
2008-10-10 17:08:31 +02:00
}
2008-11-11 15:24:34 +01:00
/**
* This function will get all the server information in an array or a specific server
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param mixed An optional integer or array of integers to select specific servers
2008-11-11 15:24:34 +01:00
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ return mixed False in case the server doesn ' t exist or an array with info .
2009-01-08 16:52:13 +01:00
*/
2008-11-11 15:24:34 +01:00
function get_server_info ( $id_server = - 1 ) {
if ( is_array ( $id_server )) {
$select_id = " WHERE id_server IN ( " . implode ( " , " , $id_server ) . " ) " ;
} elseif ( $id_server > 0 ) {
$select_id = " WHERE id_server IN ( " . ( int ) $id_server . " ) " ;
} else {
$select_id = " " ;
}
$sql = " SELECT * FROM tserver " . $select_id ;
$result = get_db_all_rows_sql ( $sql );
if ( empty ( $result )) {
return false ;
}
$return = array ();
foreach ( $result as $server ) {
if ( $server [ " network_server " ] == 1 ) {
$server [ " type " ] = " network " ;
} elseif ( $server [ " data_server " ] == 1 ) {
$server [ " type " ] = " data " ;
} elseif ( $server [ " plugin_server " ] == 1 ) {
$server [ " type " ] = " plugin " ;
} elseif ( $server [ " wmi_server " ] == 1 ) {
$server [ " type " ] = " wmi " ;
} elseif ( $server [ " recon_server " ] == 1 ) {
$server [ " type " ] = " recon " ;
} elseif ( $server [ " snmp_server " ] == 1 ) {
$server [ " type " ] = " snmp " ;
} elseif ( $server [ " prediction_server " ] == 1 ) {
$server [ " type " ] = " prediction " ;
} else {
$server [ " type " ] = " unknown " ;
}
$server [ " modules " ] = get_db_sql ( " SELECT COUNT(*) FROM tagente_estado, tagente_modulo
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
WHERE tagente_modulo . id_agente_modulo = tagente_estado . id_agente_modulo
AND tagente_modulo . disabled = 0
AND tagente_estado . running_by = " . $server["id_server"] );
2008-11-11 15:24:34 +01:00
$server [ " module_lag " ] = get_db_sql ( " SELECT COUNT(*) FROM tagente_estado, tagente_modulo, tagente
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
WHERE tagente_estado . last_execution_try > 0
AND tagente_estado . running_by = " . $server["id_server"] . "
AND tagente_modulo . id_agente = tagente . id_agente
AND tagente . disabled = 0
AND tagente_modulo . disabled = 0
AND tagente_estado . id_agente_modulo = tagente_modulo . id_agente_modulo
AND ( UNIX_TIMESTAMP () - tagente_estado . last_execution_try - tagente_estado . current_interval < 1200 ) " );
2008-11-11 15:24:34 +01:00
// Lag over 1200 seconds is not lag, is module without contacting data in several time.or with a
// 1200 sec is 20 min
$server [ " lag " ] = get_db_sql ( " SELECT MAX(tagente_estado.last_execution_try - tagente_estado.current_interval)
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
FROM tagente_estado , tagente_modulo , tagente
WHERE tagente_estado . last_execution_try > 0
AND tagente_estado . running_by = " . $server["id_server"] . "
AND tagente_modulo . id_agente = tagente . id_agente
AND tagente . disabled = 0
AND tagente_modulo . disabled = 0
AND tagente_estado . id_agente_modulo = tagente_modulo . id_agente_modulo
AND ( UNIX_TIMESTAMP () - tagente_estado . last_execution_try - tagente_estado . current_interval < 1200 ) " );
2008-11-11 15:24:34 +01:00
if ( empty ( $server [ " lag " ])) {
$server [ " lag " ] = 0 ;
} else {
2008-12-24 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_reporting.php, include/functions_db.php,
include/functions_html.php, operation/agentes/datos_agente.php,
operation/agentes/estado_agente.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_grupo.php, operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php, operation/agentes/status_monitor.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/fgraph.php,
godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_purge.php:
Added get_system_time in favor of time ();
* include/functions.php: Added get_system_time which gets the time from
a source based on user preference
* include/help/en/help_timesource.php: Explanation of timesource.
* godmode/setup/setup.php, include/config_process.php: Added timesource
selection and preference
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1310 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-24 17:53:00 +01:00
$server [ " lag " ] = get_system_time () - $server [ " lag " ];
2008-11-11 15:24:34 +01:00
}
//Push the raw data on the return stack
2009-01-15 11:21:38 +01:00
$return [ $server [ " id_server " ]] = $server ;
2008-11-11 15:24:34 +01:00
}
return $return ;
}
/**
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* Get the number of all agent modules in the database
2008-11-11 15:24:34 +01:00
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param mixed Array of integers with agent ( s ) id or a single agent id . Default
* value will select all .
2008-11-20 15:09:26 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return int The number of agent modules
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_agent_modules_count ( $id_agent = 0 ) {
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
//Make sure we're all int's and filter out bad stuff
$id_agent = safe_int ( $id_agent , 1 );
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
if ( empty ( $id_agent )) {
2009-01-12 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Removed fields "timestamp" and "id_agente" (and altered
some indexes) on tagente_datos, tagente_datos_string and
tagente_datos_inc.
tagente_estado table: removed cambio, added status_changes, last_status.
tagente_modulo: added five new fields (warning,critical mgmt., flipflop
detection, history module and delete_pending bit.
* agent_manager.php: Group ALL not shown anymore.
* configurar_agente.php: Support for new options. Delete a module now
mark for deletion the module, not delete data (It's VERY slow!).
* modificar_agente.php: Delete agent now uses the global function,
minor fixes.
* module_manager_editor.php: New fields initializacion.
* module_manager_editor_network.php: At this time, the first module
editor who implements the new fields and improve old ones (tcp data).
* setup.php: Added support for new token: event_view_hr (Filter of max
old (in hr) for the event viewer. Removed old tokens show_unknown and
show_lastalert.
* functions.php: format_for_graph() has an important BUG that makes
all units rendered without the "K" !!!!. Fixed.
* delete_agent.php: Delete remote config (if present). Also mark
for deletion modules instead delete them (and let the data without
being deleted, because it's a HUGE consuming time, and it's left
for the daily db maintance process).
* estado_agente.php: Updated code for view new status.
* estado_generalagente.php: Total packets are removed from this view,
this was a huge time consuming SQL operation that don't give important
infomation. Groupname is now visualized.
* estado_ultimopaquete.php,
* estado_monitores.php,
* estado_grupo.php: Rewritten much code to view new status and other
minor changes.
* ver_agente.php: Data view now works under the tabs and other minor
changes.
* events.php: Support for the new events and status. Added filter for
username and for a max. hours old events. Some boxes are now hidden
by default.
* fgraph.php: Some graphs are now fixed and uses tagente_datos and
tagent_access with utimestamp and without id_agent index. Works faster
* images/*: Updated icons (module types) and two new bulb colors.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 04:53:33 +01:00
//If the array proved empty or the agent is less than 1 (eg. -1)
2008-11-20 15:09:26 +01:00
$filter = '' ;
} else {
2009-01-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/footer.php, operation/agentes/sla_view.php,
operation/agentes/estado_ultimopaquete.php: Replaced time
function with get_system_time
* operation/reporting/reporting_viewer.php,
operation/reporting/reporting_xml.php, reporting/stat_win.php,
godmode/agentes/configurar_agente.php: Function renaming
* include/functions_reporting.php, include/functions_db.php,
operation/agentes/exportdata.php,
operation/agentes/estado_generalagente.php, reporting/fgraph.php,
godmode/db/db_info.php, godmode/db/db_purge.php,
godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente
redundant by using the internal functions and separate queries.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1324 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-09 23:12:48 +01:00
$filter = sprintf ( " WHERE id_agente IN (%s) " , implode ( " , " , ( array ) $id_agent ));
2008-11-20 15:09:26 +01:00
}
return ( int ) get_db_sql ( " SELECT COUNT(*) FROM tagente_modulo " . $filter );
2008-11-11 15:24:34 +01:00
}
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
/**
* This function gets the agent group for a given agent module
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param int The agent module id
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return int The group id
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_agentmodule_group ( $id_module ) {
$agent = ( int ) get_agentmodule_agent (( int ) $id_module );
return ( int ) get_agent_group ( $agent );
}
/**
* This function gets the group for a given agent
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param int The agent id
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return int The group id
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_agent_group ( $id_agent ) {
return ( int ) get_db_value ( 'id_grupo' , 'tagente' , 'id_agente' , ( int ) $id_agent );
}
/**
* This function gets the group name for a given group id
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param int The group id
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return string The group name
*/
2008-12-12 Evi Vanoost <vanooste@rcbi.rochester.edu>
* pandora_console/operation/agentes/datos_agente.php: Rewrite. Uses new
functions and better security and validation
* pandora_console/include/functions_db.php: Renamed some functions and
created agentmodule functions for consistency with documentation and to
avoid searching for and typing certain function names:
get_agentmodules is now get_agent_modules;
dame_grupo is now get_group_name;
dame_nombre_agente is now get_agent_name; get_agentmodule_agent is new;
dame_nombre_agente_agentemodulo is now get_agentmodule_agent_name;
dame_nombre_modulo_agentemodulo is now get_agentmodule_name;
dame_id_tipo_modulo_agentemodulo is now get_agentmodule_type;
dame_nombre_tipo_modulo is now get_moduletype_name; dame_nombre_grupo is
now get_group_name; get_agentmodule_count is get_agent_modules_count;
get_agentmodule_group is new; get_agent_group is new;
* pandora_console/include/functions_reporting.php,
pandora_console/include/functions.php,
pandora_console/operation/incidents/incident.php,
pandora_console/operation/users/user.php,
pandora_console/operation/users/user_edit.php,
pandora_console/operation/events/events.php,
pandora_console/operation/visual_console/index.php,
pandora_console/operation/agentes/estado_grupo.php,
pandora_console/operation/agentes/export_csv.php,
pandora_console/operation/agentes/estado_agente.php,
pandora_console/operation/agentes/estado_ultimopaquete.php,
pandora_console/operation/agentes/estado_generalagente.php,
pandora_console/operation/agentes/sla_view.php,
pandora_console/operation/agentes/exportdata.php,
pandora_console/operation/agentes/ver_agente.php,
pandora_console/operation/agentes/tactical.php,
pandora_console/operation/agentes/networkmap.php,
pandora_console/operation/messages/message.php,
pandora_console/operation/reporting/reporting_xml.php,
pandora_console/operation/reporting/reporting_viewer.php,
pandora_console/reporting/fgraph.php,
pandora_console/godmode/groups/group_list.php,
pandora_console/godmode/users/user_list.php,
pandora_console/godmode/users/configure_user.php,
pandora_console/godmode/db/db_refine.php,
pandora_console/godmode/db/db_info.php,
pandora_console/godmode/db/db_purge.php,
pandora_console/godmode/agentes/manage_config.php,
pandora_console/godmode/agentes/modificar_agente.php,
pandora_console/godmode/agentes/configurar_agente.php,
pandora_console/godmode/agentes/manage_config_remote.php,
pandora_console/godmode/modules/manage_network_components_form_network.php,
pandora_console/godmode/modules/manage_network_components_form_wmi.php,
pandora_console/godmode/reporting/reporting_builder.php,
pandora_console/godmode/reporting/map_builder.php,
pandora_console/godmode/reporting/graph_builder.php: Renamed functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1291 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-12 22:54:40 +01:00
function get_group_name ( $id_group ) {
return ( string ) get_db_value ( 'nombre' , 'tgrupo' , 'id_grupo' , ( int ) $id_group );
}
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
/**
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* Gets all module groups . ( General , Networking , System ) .
*
* Module groups are merely for sorting frontend
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return array All module groups
*/
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
function get_modulegroups () {
$result = get_db_all_fields_in_table ( " tmodule_group " );
$return = array ();
if ( empty ( $result )) {
return $return ;
}
foreach ( $result as $modulegroup ) {
$return [ $modulegroup [ " id_mg " ]] = $modulegroup [ " name " ];
}
return $return ;
}
/**
* Gets a modulegroup name based on the id
*
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
* @ param int The id of the modulegroup
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
*
2009-01-08 16:52:13 +01:00
* @ return string The modulegroup name
*/
2009-01-07 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions.php: Removed safe_sql_string. Cleaned documenation so
it would be parsed without errors by phpdoc
* include/functions_exportserver.php: Aggregate all exportserver functions
here.
* include/functions_db.php: Cleaned up documentation. Added
get_modulegroups and get_modulegroup_name.
* godmode/db/db_refine.php: Fixed the selection box.
* godmode/agentes/agent_disk_conf_editor.php: Added todo. Don't handle
the footer anymore
* godmode/agentes/agent_template.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager.php, godmode/agentes/agent_manager.php,
godmode/agentes/alert_manager.php:
Removed the ACL part since it was redundant due to the inclusion.
Just made sure that it was included (checking on $id_agente)
* godmode/agentes/manage_config.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/planned_downtime.php: Style fix
* godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor_prediction.php: Fixed prediction
module creation/update bugs
* godmode/setup/links.php: No more relying on antique (PHP4) functions
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1321 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-07 16:57:33 +01:00
function get_modulegroup_name ( $modulegroup_id ) {
return ( string ) get_db_value ( 'name' , 'tmodule_group' , 'id_mg' , ( int ) $modulegroup_id );
}
2009-01-14 19:12:20 +01:00
/**
2009-01-15 12:52:49 +01:00
* Inserts strings into database
2009-01-14 19:12:20 +01:00
*
* The number of values should be the same or a positive integer multiple as the number of rows
* If you have an associate array ( eg . array ( " row1 " => " value1 " )) you can use this function with ( $table , array_keys ( $array ), $array ) in it ' s options
* All arrays and values should have been cleaned before passing . It ' s not neccessary to add quotes .
*
2009-01-15 12:52:49 +01:00
* @ param string Table to insert into
* @ param mixed A single value or array of values to insert ( can be a multiple amount of rows )
2009-01-14 19:12:20 +01:00
*
2009-01-16 20:04:54 +01:00
* @ return mixed False in case of error or invalid values passed . Affected rows otherwise
2009-01-14 19:12:20 +01:00
*/
2009-01-19 15:42:34 +01:00
function process_sql_insert ( $table , $values ) {
//Empty rows or values not processed
if ( empty ( $values ))
2009-01-14 19:12:20 +01:00
return false ;
$values = ( array ) $values ;
2009-01-19 15:42:34 +01:00
2009-01-14 19:12:20 +01:00
$query = sprintf ( " INSERT INTO `%s` " , $table );
2009-01-19 15:42:34 +01:00
$fields = array ();
$values_str = '' ;
$i = 1 ;
$max = count ( $values );
foreach ( $values as $field => $value ) { //Add the correct escaping to values
if ( $field [ 0 ] != " ` " ) {
$field = " ` " . $field . " ` " ;
2009-01-14 19:12:20 +01:00
}
2009-01-19 15:42:34 +01:00
array_push ( $fields , $field );
if ( is_null ( $value )) {
$values_str .= " NULL " ;
} elseif ( is_int ( $value ) || is_bool ( $value )) {
$values_str .= sprintf ( " %d " , $value );
} else if ( is_float ( $value ) || is_double ( $value )) {
$values_str .= sprintf ( " %f " , $value );
2009-01-14 19:12:20 +01:00
} else {
2009-01-19 15:42:34 +01:00
$values_str .= sprintf ( " '%s' " , $value );
}
if ( $i < $max ) {
$values_str .= " , " ;
2009-01-14 19:12:20 +01:00
}
2009-01-19 15:42:34 +01:00
$i ++ ;
2009-01-14 19:12:20 +01:00
}
2009-01-19 15:42:34 +01:00
$query .= '(' . implode ( ', ' , $fields ) . ')' ;
2009-01-14 19:12:20 +01:00
2009-01-19 15:42:34 +01:00
$query .= ' VALUES (' . $values_str . ')' ;
2009-01-14 19:12:20 +01:00
2009-01-19 15:42:34 +01:00
return process_sql ( $query , 'insert_id' );
2009-01-14 19:12:20 +01:00
}
/**
2009-01-15 12:52:49 +01:00
* Inserts strings into database
2009-01-14 19:12:20 +01:00
*
2009-01-15 12:52:49 +01:00
* All values should be cleaned before passing . Quoting isn ' t necessary .
* Examples :
2009-01-14 19:12:20 +01:00
*
2009-01-15 12:52:49 +01:00
* < code >
process_sql_update ( 'table' , array ( 'field' => 1 ), array ( 'id' => $id ));
process_sql_update ( 'table' , array ( 'field' => 1 ), array ( 'id' => $id , 'name' => $name ));
process_sql_update ( 'table' , array ( 'field' => 1 ), array ( 'id' => $id , 'name' => $name ), 'OR' );
process_sql_update ( 'table' , array ( 'field' => 2 ), 'id in (1, 2, 3) OR id > 10' );
* < code >
*
* @ param string Table to insert into
* @ param array An associative array of values to update
* @ param mixed An associative array of field and value matches . Will be joined
* with operator specified by $where_join . A custom string can also be provided .
* If nothing is provided , the update will affect all rows .
* @ param string When a $where parameter is given , this will work as the glue
* between the fields . " AND " operator will be use by default . Other values might
* be " OR " , " AND NOT " , " XOR "
2009-01-14 19:12:20 +01:00
*
2009-01-16 20:04:54 +01:00
* @ return mixed False in case of error or invalid values passed . Affected rows otherwise
2009-01-14 19:12:20 +01:00
*/
2009-01-15 12:52:49 +01:00
function process_sql_update ( $table , $values , $where = false , $where_join = 'AND' ) {
2009-01-14 19:12:20 +01:00
$query = sprintf ( " UPDATE `%s` SET " , $table );
2009-01-15 12:52:49 +01:00
$i = 1 ;
2009-01-14 19:12:20 +01:00
$max = count ( $values );
foreach ( $values as $field => $value ) {
if ( $field [ 0 ] != " ` " ) {
$field = " ` " . $field . " ` " ;
}
if ( is_null ( $value )) {
$query .= sprintf ( " %s = NULL " , $field );
} elseif ( is_int ( $value ) || is_bool ( $value )) {
$query .= sprintf ( " %s = %d " , $field , $value );
} else if ( is_float ( $value ) || is_double ( $value )) {
$query .= sprintf ( " %s = %f " , $field , $value );
} else {
$query .= sprintf ( " %s = '%s' " , $field , $value );
}
if ( $i < $max ) {
$query .= " , " ;
}
$i ++ ;
}
2009-01-15 12:52:49 +01:00
if ( $where ) {
$query .= ' WHERE ' ;
if ( is_string ( $where )) {
/* FIXME: Should we clean the string for sanity? */
$query .= $where ;
} else if ( is_array ( $where )) {
$i = 1 ;
$max = count ( $where );
foreach ( $where as $field => $value ) {
if ( $field [ 0 ] != " ` " ) {
$field = " ` " . $field . " ` " ;
}
if ( is_null ( $value )) {
$query .= sprintf ( " %s IS NULL " , $field );
} elseif ( is_int ( $value ) || is_bool ( $value )) {
$query .= sprintf ( " %s = %d " , $field , $value );
} else if ( is_float ( $value ) || is_double ( $value )) {
$query .= sprintf ( " %s = %f " , $field , $value );
} else {
$query .= sprintf ( " %s = '%s' " , $field , $value );
}
if ( $i < $max ) {
$query .= $where_join ;
}
$i ++ ;
}
}
}
2009-01-14 19:12:20 +01:00
return process_sql ( $query );
}
2009-01-15 11:21:38 +01:00
?>