pandorafms/pandora_console/extras/pandora_diag.php

649 lines
29 KiB
PHP
Raw Normal View History

2018-08-09 13:08:08 +02:00
<script type="text/javascript">
function effectFadeOut() {
$('.content').fadeOut(800).fadeIn(800)
}
$(document).ready(function(){
setInterval(effectFadeOut, 1600);
});
</script>
<?php
// Pandora FMS - the Flexible Monitoring System
// ============================================
// Copyright (c) 2010 Artica Soluciones Tecnologicas, http://www.artica.es
// Please see http://pandora.sourceforge.net for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
2018-08-09 13:08:08 +02:00
global $config;
check_login ();
if (! check_acl ($config['id_user'], 0, 'PM')) {
db_pandora_audit("ACL Violation", "Trying to change License settings");
include ("general/noaccess.php");
return;
}
$update_settings = (bool) get_parameter_post ('update_settings');
if ($update_settings) {
foreach ($_POST['keys'] as $key => $value) {
db_process_sql_update(
'tupdate_settings',
array(db_escape_key_identifier('value') => $value),
array(db_escape_key_identifier('key') => $key));
}
ui_print_success_message(__('License updated'));
}
ui_require_javascript_file_enterprise('load_enterprise');
enterprise_include_once('include/functions_license.php');
$license = enterprise_hook('license_get_info');
$rows = db_get_all_rows_in_table('tupdate_settings');
$settings = new StdClass;
foreach ($rows as $row) {
$settings->{$row['key']} = $row['value'];
2018-08-09 13:08:08 +02:00
}
echo '<script type="text/javascript">';
if (enterprise_installed())
print_js_var_enteprise();
echo '</script>';
function render_info ($table) {
global $console_mode;
* include/functions_graph.php include/functions_html.php include/functions_messages.php include/db/postgresql.php include/db/mysql.php include/db/oracle.php include/functions_reporting.php include/functions_filemanager.php include/functions_gis.php include/auth/ldap.php include/auth/mysql.php include/functions_networkmap.php include/functions_network_components.php include/ajax/skins.ajax.php include/ajax/reporting.ajax.php include/ajax/visual_console_builder.ajax.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_config.php include/functions_api.php include/help/en/help_timesource.php include/help/es/help_timesource.php include/help/ja/help_timesource.php include/config_process.php include/functions_ui.php include/functions_custom_graphs.php include/fgraph.php include/functions_incidents.php include/api.php include/functions_reports.php include/functions_ui_renders.php extensions/insert_data.php extensions/system_info.php extensions/extension_uploader.php extensions/pandora_logs.php extensions/agents_modules.php extensions/update_manager.php extensions/ssh_console.php extensions/dbmanager.php extensions/vnc_view.php extensions/resource_registration.php extensions/resource_exportation.php extensions/users_connected.php extensions/module_groups.php extensions/update_manager/load_updatemanager.php extensions/update_manager/lib/libupdate_manager_client.php extensions/update_manager/lib/libupdate_manager.php extensions/update_manager/lib/libupdate_manager_components.php extensions/update_manager/lib/libupdate_manager_updates.php extensions/update_manager/settings.php extensions/update_manager/main.php extensions/plugin_registration.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/incidents/incident_statistics.php operation/search_modules.php operation/visual_console/render_view.php operation/visual_console/index.php operation/extensions.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/alerts_status.php operation/agentes/estado_generalagente.php operation/agentes/custom_fields.php operation/agentes/estado_agente.php operation/agentes/networkmap.topology.php operation/agentes/networkmap.groups.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/graphs.php operation/agentes/agent_fields.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/menu.php operation/search_agents.php operation/search_graphs.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/integria_incidents/incident.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident_statistics.php operation/events/event_statistics.php operation/events/events_rss.php operation/events/export_csv.php operation/events/sound_events.php operation/events/events_validate.php operation/events/events_list.php operation/events/events_marquee.php operation/events/events.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php operation/reporting/graph_viewer.php operation/search_reports.php operation/search_maps.php operation/search_users.php extras/pandora_diag.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/events/events.php mobile/index.php general/error_authconfig.php general/links_menu.php general/logon_ok.php general/error_dbconfig.php general/ui/agents_list.php general/header.php godmode/groups/modu_group_list.php godmode/groups/configure_group.php godmode/groups/configure_modu_group.php godmode/groups/group_list.php godmode/admin_access_logs.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_common.php godmode/agentes/fields_manager.php godmode/agentes/agent_conf_gis.php godmode/agentes/module_manager_editor_prediction.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/configure_field.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/agentes/manage_config_remote.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/servers/manage_recontask_form.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/alert_compounds.php godmode/alerts/alert_list.php godmode/alerts/configure_alert_template.php godmode/alerts/alert_templates.php godmode/alerts/configure_alert_action.php godmode/alerts/configure_alert_command.php godmode/alerts/alert_actions.php godmode/alerts/alert_list.builder.php godmode/alerts/alert_commands.php godmode/setup/file_manager.php godmode/setup/os.list.php godmode/setup/news.php godmode/setup/gis_step_2.php godmode/setup/links.php godmode/setup/setup.php godmode/setup/os.php godmode/setup/performance.php godmode/setup/setup_auth.php godmode/setup/gis.php godmode/setup/os.builder.php godmode/setup/setup_visuals.php godmode/snmpconsole/snmp_alert.php godmode/snmpconsole/snmp_filters.php godmode/users/user_list.php godmode/users/configure_profile.php godmode/gis_maps/configure_gis_map.php godmode/gis_maps/index.php godmode/massive/massive_add_alerts.php godmode/massive/massive_copy_modules.php godmode/massive/massive_delete_agents.php godmode/massive/massive_enable_disable_alerts.php godmode/massive/massive_operations.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.php godmode/massive/massive_delete_action_alerts.php godmode/massive/massive_delete_modules.php godmode/massive/massive_add_profiles.php godmode/massive/massive_delete_alerts.php godmode/massive/massive_edit_modules.php godmode/massive/massive_standby_alerts.php godmode/massive/massive_add_action_alerts.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_components_form_common.php godmode/modules/manage_network_components_form_network.php godmode/modules/manage_network_templates_form.php godmode/modules/manage_network_components_form_wmi.php godmode/modules/manage_network_components.php godmode/modules/manage_nc_groups.php godmode/reporting/visual_console_builder.wizard.php godmode/reporting/graph_builder.main.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/visual_console_builder.php godmode/reporting/reporting_builder.preview.php godmode/reporting/reporting_builder.main.php godmode/reporting/visual_console_builder.data.php godmode/reporting/visual_console_builder.elements.php godmode/reporting/graph_builder.php godmode/reporting/visual_console_builder.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/visual_console_builder.editor.php godmode/reporting/reporting_builder.item_editor.php godmode/reporting/map_builder.php godmode/reporting/graphs.php godmode/reporting/graph_builder.preview.php include/functions_db.php: Added some includes and functions of this code have "db_" prefix. * include/functions.php: Moved function check_login(), check_acl(), dame_nombre_pluginid(), get_os_name() from functions_db.php to functions.php. * include/functions_groups.php: Moved functions get_childrens(), safe_acl_group() and get_parents(), give_disabled_group(), isAllGroups(), get_group_icon(), get_all_groups(), get_id_groups_recursive(), get_user_groups_tree_recursive(), get_group_status(), get_group_name(), get_group_users() from functions_db.php to this code. * include/functions_profile.php: New library with profile functions. Moved functions get_profile_name(), get_profiles(), create_user_profile(), delete_user_profile(), delete_profile() from functions_db.php to this code. Added new parameter in function get_profile() to retrieve profiles with filter conditions applied. * include/functions_users.php: New library with users functions. Moved functions get_users_info(), get_all_model_groups(), get_user_groups(), get_user_groups_tree(), get_user_first_group(), user_access_to_agent() from funtions_db.php to this code. * godmode/users/configure_user.php: Changed get_profile_filter() function to get_profile(). * include/functions_agents.php: Moved functions get_group_agents(), get_agent_modules(), get_agent_module_id(), get_agent_id(), get_agent_name(), get_agent_modules_data_count(), check_alert_fired(), get_agent_interval(), get_agent_os(), give_agentmodule_flag(), agent_add_address(), agent_delete_address(), get_agent_address(), get_agent_with_ip(), get_agent_addresses(), get_agent_status(), delete_agent(), get_agentmodule_group(), get_agent_group() from functions_db.php to this code. * include/functions_modules.php: Moved functions get_agentmodule(), get_agentmodule_id(), get_agentmodule_is_init(), get_agent_modules_count(), get_module_type_name(), get_module_type_icon(), get_agentmodule_agent(), get_agentmodule_agent_name(), get_agentmodule_name(), get_agentmodule_type(), get_monitor_downs_in_period(), get_monitor_last_down_timestamp_in_period(), get_monitors_in_group(), get_monitors_in_agent(), get_monitors_down(), get_moduletype_name(), get_moduletype_description(), get_moduletypes(), get_module_interval(), show_icon_type(), give_modulecategory_name(), give_agent_id_from_module_id(), get_module_status(), get_agent_module_last_value(), get_previous_data(), get_agentmodule_modulegroup(), get_modulegroups(), get_modulegroup_name() from functions_db.php to this code. * include/functions_alerts.php: Moved functions get_alert_type(), get_agent_alert_fired(), get_module_alert_fired(), get_alert_fires_in_period(), get_group_alerts(), get_alerts_fired(), get_alert_last_fire_timestamp_in_period(), get_agentmodule_status(), get_agentmodule_last_status() from functions_db.php to this code. * include/functions_exportserver.php: Moved function dame_nombre_servidorexportacion() from functions_db.php to this code. * include/functions_events.php: Moved functions get_group_events(), get_agent_events(), get_module_events() from functions_db.php to this code. * include/functions_servers.php: Moved functions get_server_name(), show_server_type(), check_server_status(), server_status() from functions_db.php to this code. * include/functions_network_profiles.php: Moved function get_networkprofile_name() from functions_db.php to this code. * include/functions_visual_map.php: Moved functions get_layoutdata_x(), get_layoutdata_y() from fucntions_db.php to this code. * include/functions_io.php: Moved function __() from functions_db.php to this code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-19 20:42:49 +02:00
$info = db_get_sql ("SELECT COUNT(*) FROM $table");
2010-02-19 Sancho Lerena <slerena@artica.es> * functions_events.php: Fixed typo (switched meaning) in two labels. * include/styles/pandora.css: Changed background color of th default style. * include/functions_reporting.php: Improved function get_group_stats(). Now supports stats from batch-mode and get realtime stats in a more efficient way. Fixed get_fired_alerts_reporting_table() to avoid problems in external reporting (PDF & XML). * include/functions_servers.php: get_server_performance() now uses batch mode stats reporting, and improved also the realtime stats generation. Same with function get_server_info(). * include/functions_config.php: Added new config tokens (not fully implemented yet) for event, trap, strings and audit automatic purge. * include/functions_ui.php: Added new print_page_header() function to set the new standard header in all pages, using the "tabbed" format to show the title, subtitle and other options like help, or custom-tabs for the page * pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to agents_unknown. * extensions/ext_backup: New directory to place "deleted" extensions. * extensions/dbmanager/dbmanager.css: Table names now are in it's original lowercase/uppercase format. * extensions/dbmanager.php: Updated headers, and now return "empty" when a search is empty, instead "error" as before. * extensions/users_connected.php extensions/module_groups.php extensions/plugin_registration.php extensions/pandora_logs.php operation/incidents/incident.php operation/snmpconsole/snmp_view.php operation/users/user.php operation/users/user_edit.php godmode/agentes/planned_downtime.php operation/events/events.php operation/visual_console/index.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/exportdata.php operation/agentes/ver_agente.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/users/user_statistics.php: Added new header format. * operation/agentes/estado_grupo.php: Removed old group view. * operation/agentes/tactical.php: Adapted to use new realtime/batch statistical system. Placed events above server info. Showing only pending events and other minor changes. * operation/agentes/group_view.php: NEW screen, replacing old one. Probably most ugly, but much more useful than before. * operation/agentes/networkmap.php: Added title. * operation/messages/message.php: Added title and adding some exists in code was missing before. * operation/reporting/reporting_viewer.php: Added title. * operation/reporting/graph_viewer.php: Added title. * operation/reporting/custom_reporting.php: Added title. * operation/servers/view_server.php: * operation/menu.php: Replaced old group view with new (this has english name). Removed autorefresh "by default" in server view. * extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo. * extras/pandora_diag.php: Minor changes, removed some info and added other. * general/logon_ok.php: Minor aesthetic changes. * general/header.php: Fixed missing ";" * operation/extensions.php, godmode/extensions.php: Added support for delete extensions. * godmode/menu.php: New setup items. * godmode/setup/setup.php, godmode/setup/performance.php, godmode/setup/setup_visuals.php: Reordered setup options, new setup section "Performance", added new performance options to set "realtime" statistics or "batchmode" with it's own interval. Some setup info is now shared with the servers (but it it's any change in setup, servers should be restarted anyway). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
render_row ($info,"DB Table $table");
}
function render_info_data ($query, $label) {
global $console_mode;
* include/functions_graph.php include/functions_html.php include/functions_messages.php include/db/postgresql.php include/db/mysql.php include/db/oracle.php include/functions_reporting.php include/functions_filemanager.php include/functions_gis.php include/auth/ldap.php include/auth/mysql.php include/functions_networkmap.php include/functions_network_components.php include/ajax/skins.ajax.php include/ajax/reporting.ajax.php include/ajax/visual_console_builder.ajax.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_config.php include/functions_api.php include/help/en/help_timesource.php include/help/es/help_timesource.php include/help/ja/help_timesource.php include/config_process.php include/functions_ui.php include/functions_custom_graphs.php include/fgraph.php include/functions_incidents.php include/api.php include/functions_reports.php include/functions_ui_renders.php extensions/insert_data.php extensions/system_info.php extensions/extension_uploader.php extensions/pandora_logs.php extensions/agents_modules.php extensions/update_manager.php extensions/ssh_console.php extensions/dbmanager.php extensions/vnc_view.php extensions/resource_registration.php extensions/resource_exportation.php extensions/users_connected.php extensions/module_groups.php extensions/update_manager/load_updatemanager.php extensions/update_manager/lib/libupdate_manager_client.php extensions/update_manager/lib/libupdate_manager.php extensions/update_manager/lib/libupdate_manager_components.php extensions/update_manager/lib/libupdate_manager_updates.php extensions/update_manager/settings.php extensions/update_manager/main.php extensions/plugin_registration.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/incidents/incident_statistics.php operation/search_modules.php operation/visual_console/render_view.php operation/visual_console/index.php operation/extensions.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/alerts_status.php operation/agentes/estado_generalagente.php operation/agentes/custom_fields.php operation/agentes/estado_agente.php operation/agentes/networkmap.topology.php operation/agentes/networkmap.groups.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/graphs.php operation/agentes/agent_fields.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/menu.php operation/search_agents.php operation/search_graphs.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/integria_incidents/incident.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident_statistics.php operation/events/event_statistics.php operation/events/events_rss.php operation/events/export_csv.php operation/events/sound_events.php operation/events/events_validate.php operation/events/events_list.php operation/events/events_marquee.php operation/events/events.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php operation/reporting/graph_viewer.php operation/search_reports.php operation/search_maps.php operation/search_users.php extras/pandora_diag.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/events/events.php mobile/index.php general/error_authconfig.php general/links_menu.php general/logon_ok.php general/error_dbconfig.php general/ui/agents_list.php general/header.php godmode/groups/modu_group_list.php godmode/groups/configure_group.php godmode/groups/configure_modu_group.php godmode/groups/group_list.php godmode/admin_access_logs.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_common.php godmode/agentes/fields_manager.php godmode/agentes/agent_conf_gis.php godmode/agentes/module_manager_editor_prediction.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/configure_field.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/agentes/manage_config_remote.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/servers/manage_recontask_form.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/alert_compounds.php godmode/alerts/alert_list.php godmode/alerts/configure_alert_template.php godmode/alerts/alert_templates.php godmode/alerts/configure_alert_action.php godmode/alerts/configure_alert_command.php godmode/alerts/alert_actions.php godmode/alerts/alert_list.builder.php godmode/alerts/alert_commands.php godmode/setup/file_manager.php godmode/setup/os.list.php godmode/setup/news.php godmode/setup/gis_step_2.php godmode/setup/links.php godmode/setup/setup.php godmode/setup/os.php godmode/setup/performance.php godmode/setup/setup_auth.php godmode/setup/gis.php godmode/setup/os.builder.php godmode/setup/setup_visuals.php godmode/snmpconsole/snmp_alert.php godmode/snmpconsole/snmp_filters.php godmode/users/user_list.php godmode/users/configure_profile.php godmode/gis_maps/configure_gis_map.php godmode/gis_maps/index.php godmode/massive/massive_add_alerts.php godmode/massive/massive_copy_modules.php godmode/massive/massive_delete_agents.php godmode/massive/massive_enable_disable_alerts.php godmode/massive/massive_operations.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.php godmode/massive/massive_delete_action_alerts.php godmode/massive/massive_delete_modules.php godmode/massive/massive_add_profiles.php godmode/massive/massive_delete_alerts.php godmode/massive/massive_edit_modules.php godmode/massive/massive_standby_alerts.php godmode/massive/massive_add_action_alerts.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_components_form_common.php godmode/modules/manage_network_components_form_network.php godmode/modules/manage_network_templates_form.php godmode/modules/manage_network_components_form_wmi.php godmode/modules/manage_network_components.php godmode/modules/manage_nc_groups.php godmode/reporting/visual_console_builder.wizard.php godmode/reporting/graph_builder.main.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/visual_console_builder.php godmode/reporting/reporting_builder.preview.php godmode/reporting/reporting_builder.main.php godmode/reporting/visual_console_builder.data.php godmode/reporting/visual_console_builder.elements.php godmode/reporting/graph_builder.php godmode/reporting/visual_console_builder.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/visual_console_builder.editor.php godmode/reporting/reporting_builder.item_editor.php godmode/reporting/map_builder.php godmode/reporting/graphs.php godmode/reporting/graph_builder.preview.php include/functions_db.php: Added some includes and functions of this code have "db_" prefix. * include/functions.php: Moved function check_login(), check_acl(), dame_nombre_pluginid(), get_os_name() from functions_db.php to functions.php. * include/functions_groups.php: Moved functions get_childrens(), safe_acl_group() and get_parents(), give_disabled_group(), isAllGroups(), get_group_icon(), get_all_groups(), get_id_groups_recursive(), get_user_groups_tree_recursive(), get_group_status(), get_group_name(), get_group_users() from functions_db.php to this code. * include/functions_profile.php: New library with profile functions. Moved functions get_profile_name(), get_profiles(), create_user_profile(), delete_user_profile(), delete_profile() from functions_db.php to this code. Added new parameter in function get_profile() to retrieve profiles with filter conditions applied. * include/functions_users.php: New library with users functions. Moved functions get_users_info(), get_all_model_groups(), get_user_groups(), get_user_groups_tree(), get_user_first_group(), user_access_to_agent() from funtions_db.php to this code. * godmode/users/configure_user.php: Changed get_profile_filter() function to get_profile(). * include/functions_agents.php: Moved functions get_group_agents(), get_agent_modules(), get_agent_module_id(), get_agent_id(), get_agent_name(), get_agent_modules_data_count(), check_alert_fired(), get_agent_interval(), get_agent_os(), give_agentmodule_flag(), agent_add_address(), agent_delete_address(), get_agent_address(), get_agent_with_ip(), get_agent_addresses(), get_agent_status(), delete_agent(), get_agentmodule_group(), get_agent_group() from functions_db.php to this code. * include/functions_modules.php: Moved functions get_agentmodule(), get_agentmodule_id(), get_agentmodule_is_init(), get_agent_modules_count(), get_module_type_name(), get_module_type_icon(), get_agentmodule_agent(), get_agentmodule_agent_name(), get_agentmodule_name(), get_agentmodule_type(), get_monitor_downs_in_period(), get_monitor_last_down_timestamp_in_period(), get_monitors_in_group(), get_monitors_in_agent(), get_monitors_down(), get_moduletype_name(), get_moduletype_description(), get_moduletypes(), get_module_interval(), show_icon_type(), give_modulecategory_name(), give_agent_id_from_module_id(), get_module_status(), get_agent_module_last_value(), get_previous_data(), get_agentmodule_modulegroup(), get_modulegroups(), get_modulegroup_name() from functions_db.php to this code. * include/functions_alerts.php: Moved functions get_alert_type(), get_agent_alert_fired(), get_module_alert_fired(), get_alert_fires_in_period(), get_group_alerts(), get_alerts_fired(), get_alert_last_fire_timestamp_in_period(), get_agentmodule_status(), get_agentmodule_last_status() from functions_db.php to this code. * include/functions_exportserver.php: Moved function dame_nombre_servidorexportacion() from functions_db.php to this code. * include/functions_events.php: Moved functions get_group_events(), get_agent_events(), get_module_events() from functions_db.php to this code. * include/functions_servers.php: Moved functions get_server_name(), show_server_type(), check_server_status(), server_status() from functions_db.php to this code. * include/functions_network_profiles.php: Moved function get_networkprofile_name() from functions_db.php to this code. * include/functions_visual_map.php: Moved functions get_layoutdata_x(), get_layoutdata_y() from fucntions_db.php to this code. * include/functions_io.php: Moved function __() from functions_db.php to this code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-19 20:42:49 +02:00
$info = db_get_sql ($query);
render_row ($info, $label);
}
2015-06-08 11:05:19 +02:00
function render_row ($data, $label) {
global $console_mode;
2015-06-08 11:05:19 +02:00
if ($console_mode == 1) {
echo $label;
echo "|";
echo $data;
echo "\n";
}
else {
echo "<tr>";
echo "<td style='padding:2px;border:0px;' width='60%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>" . $label;
echo "</div></td>";
echo "<td style='font-weight:bold;padding:2px;border:0px;' width='40%'><div style='padding:5px;background-color:#f2f2f2;border-radius:2px;text-align:left;border:0px;'>" . $data;
echo "</div></td>";
echo "</tr>";
}
}
2018-08-09 13:08:08 +02:00
function get_value_sum($arr){
foreach($arr as $clave){
foreach($clave as $valor){
$result += $valor;
}
}
return $result;
}
2018-08-10 10:41:18 +02:00
2018-08-09 13:08:08 +02:00
function execution_time(){
2018-08-10 10:41:18 +02:00
$times = db_get_all_rows_sql("SELECT datos FROM tagente_datos WHERE id_agente_modulo = 29 ORDER BY utimestamp DESC LIMIT 2");
if($times[0]['datos'] > $times[1]['datos'] * 1.2)
return "<a class= 'content' style= 'color: red;'>Warning Status</a><a>&nbsp&nbsp The execution time could be degrading. For a more extensive information of this data consult the Execution Time graph</a>";
2018-08-09 13:08:08 +02:00
else
2018-08-20 10:09:09 +02:00
return "<a style ='color: green;'>Normal Status</a><a>&nbsp&nbsp The execution time is correct. For a more extensive information of this data consult the Execution Time graph</a>";
2018-08-09 13:08:08 +02:00
}
2018-08-13 12:52:01 +02:00
2018-08-09 13:08:08 +02:00
function get_logs_size($file){
$file_name = '/var'. $file .'';
$size_server_log = filesize($file_name);
return $size_server_log;
}
function get_status_logs($path){
$status_server_log = "";
$size_server_log = get_logs_size($path);
if ($size_server_log <= 10240){
2018-08-13 12:52:01 +02:00
$status_server_log = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have less than 10 MB of logs</a>";
2018-08-09 13:08:08 +02:00
}else{
2018-08-13 12:52:01 +02:00
$status_server_log = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp You have more than 10 MB of logs</a>";
2018-08-09 13:08:08 +02:00
}
return $status_server_log;
}
function percentage_modules_per_agent(){
$status_average_modules = "";
$total_agents = db_get_value_sql ('SELECT count(*) FROM tagente');
$total_modules = db_get_value_sql ('SELECT count(*) FROM tagente_modulo');
$average_modules_per_agent = $total_modules / $total_agents;
if($average_modules_per_agent <= 40){
2018-08-13 12:52:01 +02:00
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The average of modules per agent is less than 40 percent</a>";
2018-08-09 13:08:08 +02:00
}else{
2018-08-13 12:52:01 +02:00
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbspThe average of modules per agent is more than 40 percent. You can have performance problems</a>";
2018-08-09 13:08:08 +02:00
}
return $status_average_modules;
}
function license_capacity(){
$license = enterprise_hook('license_get_info');
$license_limit = $license['limit'];
$status_license_capacity = "";
$current_count = db_get_value_sql ('SELECT count(*) FROM tagente');
if ($current_count > $license_limit * 90 /100){
2018-08-13 12:52:01 +02:00
$status_license_capacity = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is more than 90 percent</a>";
2018-08-09 13:08:08 +02:00
}else{
2018-08-13 12:52:01 +02:00
$status_license_capacity = "<a style= 'color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The license capacity is less than 90 percent</a>";
2018-08-09 13:08:08 +02:00
}
return $status_license_capacity;
}
function status_license_params($license_param){
$status_license_par ="";
if ($license_param <=0)
$status_license_par = "OFF";
else
$status_license_par = "ON";
return $status_license_par;
}
function interval_average_of_network_modules(){
$total_network_modules = db_get_value_sql ("SELECT count(*) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18");
$total_module_interval_time = db_get_value_sql ("SELECT SUM(module_interval) FROM tagente_modulo WHERE id_tipo_modulo BETWEEN 6 AND 18");
$average_time= (int) $total_module_interval_time / $total_network_modules;
if($average_time < 180 ){
2018-08-13 12:52:01 +02:00
$status_average_modules = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has a lot of load and a very fine configuration is required</a>";
2018-08-09 13:08:08 +02:00
}else{
2018-08-13 12:52:01 +02:00
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has an acceptable charge</a>";
2018-08-09 13:08:08 +02:00
}
if ($average_time == 0)
2018-08-13 12:52:01 +02:00
$status_average_modules = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The system has no load</a>";
2018-08-09 13:08:08 +02:00
return $status_average_modules;
}
$attachment_total_files = count(glob($config['homedir']."/attachment/{*.*}",GLOB_BRACE));
function files_attachment_folder($total_files){
if($total_files <= 700){
2018-08-13 12:52:01 +02:00
$status_total_files = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has less than 700 files.</a>";
2018-08-09 13:08:08 +02:00
}else{
2018-08-13 12:52:01 +02:00
$status_total_files = "<a class= 'content' style= 'color: red;text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The attachment folder has more than 700 files.</a>";
2018-08-09 13:08:08 +02:00
}
return $status_total_files;
}
$tagente_datos_size = db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
function status_tagente_datos($tagente_datos_size){
2018-08-13 12:52:01 +02:00
if ($tagente_datos_size <=3000000){
$tagente_datos_size = "<a style ='color: green;text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The tagente_datos table has an acceptable amount of data.</a>";
2018-08-09 13:08:08 +02:00
}else{
2018-08-13 12:52:01 +02:00
$tagente_datos_size = "<a class= 'content' style ='color: red;text-decoration: none;'>Warning Status</a><a>&nbsp&nbsp The tagente_datos table has too much data. A historical database is recommended.</a>";
2018-08-09 13:08:08 +02:00
}
return $tagente_datos_size;
}
2018-08-13 12:52:01 +02:00
function status_values($val_rec, $val){
if ($val_rec <= $val)
2018-08-20 10:09:09 +02:00
return $val . "<a style='text-decoration: none;'> (Min. Recommended Value </a>" . $val_rec. "<a>)</a>";
2018-08-13 12:52:01 +02:00
else
2018-08-20 10:09:09 +02:00
return $val . "<a style='text-decoration: none;'> (Min. Recommended Value </a>" . $val_rec. "<a>)</a><a class= 'content' style ='color: red;text-decoration: none;'> Warning Status</a>";
2018-08-13 12:52:01 +02:00
}
2018-08-09 13:08:08 +02:00
$tables_fragmentation=db_get_sql ("SELECT (data_free/(index_length+data_length))
as frag_ratio from information_schema.tables where DATA_FREE > 0 and table_name='tagente_datos' and table_schema='pandora'");
$db_size=db_get_all_rows_sql("SELECT table_schema,
ROUND(SUM(data_length+index_length)/1024/1024,3)
FROM information_schema.TABLES
GROUP BY table_schema;"
);
2018-08-10 10:41:18 +02:00
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN'){
$total_server_threads = shell_exec("ps -T aux | grep pandora_server | grep -v grep | wc -l");
$percentage_threads_ram = shell_exec("ps axo pmem,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
$percentage_threads_cpu = shell_exec("ps axo pcpu,cmd | grep pandora_server | awk '{sum+=$1} END {print sum}'");
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
}
2018-08-09 13:08:08 +02:00
$path_server_logs ="/log/pandora/pandora_server.log";
$path_console_logs ="/www/html/pandora_console/pandora_console.log";
$innodb_log_file_size_min_rec_value = "64M";
$innodb_log_buffer_size_min_rec_value = "16M";
$innodb_flush_log_at_trx_commit_min_rec_value = 0;
2018-08-13 12:52:01 +02:00
$query_cache_limit_min_rec_value = 2;
$max_allowed_packet_min_rec_value = 32;
$innodb_buffer_pool_size_min_rec_value = shell_exec("cat /proc/meminfo | grep -i total | head -1 | awk '{print $(NF-1)*0.4/1024}'");
$sort_buffer_size_min_rec_value = 32;
$join_buffer_size_min_rec_value = 265;
2018-08-09 13:08:08 +02:00
$query_cache_type_min_rec_value = "ON";
2018-08-13 12:52:01 +02:00
$query_cache_size_min_rec_value = 24;
$innodb_lock_wait_timeout_max_rec_value = 120;
2018-08-09 13:08:08 +02:00
$tables_fragmentation_max_rec_value = 10;
2018-08-13 12:52:01 +02:00
$thread_cache_size_max_rec_value = 8;
$thread_stack_min_rec_value = 256;
$max_connections_max_rec_value = 150;
$key_buffer_size_min_rec_value = 256;
$read_buffer_size_min_rec_value = 32;
$read_rnd_buffer_size_min_rec_value = 32;
$query_cache_min_res_unit_min_rec_value = 2;
$innodb_file_per_table_min_rec_value = 0;
2018-08-09 13:08:08 +02:00
function status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation){
$status_tables_frag = "";
if($tables_fragmentation > $tables_fragmentation_max_rec_value)
2018-08-13 12:52:01 +02:00
$status_tables_frag = "<a class= 'content' style ='color: red; text-decoration: none;'>Warning Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is higher than recommended. You should defragment them.</a>";
2018-08-09 13:08:08 +02:00
else
2018-08-13 12:52:01 +02:00
$status_tables_frag = "<a style ='color: green; text-decoration: none;'>Normal Status</a><a style ='text-decoration: none;'>&nbsp&nbsp The fragmentation tables is correct.</a>";
2018-08-09 13:08:08 +02:00
return $status_tables_frag;
}
$console_mode = 1;
if (!isset($argc))
$console_mode = 0;
if ($console_mode == 1) {
echo "\nPandora FMS PHP diagnostic tool v3.2 (c) Artica ST 2009-2010 \n";
if ($argc == 1 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) {
echo "\nThis command line script gives information about Pandora FMS database.
This program only can be executed from console, and need a parameter, the
full path to Pandora FMS 'config.php' file.
Usage:
php pandora_diag.php path_to_pandora_console
Example:
php pandora_diag.php /var/www/pandora_console
";
exit;
}
if (preg_match ('/[^a-zA-Z0-9_\/\.]|(\/\/)|(\.\.)/', $argv[1])) {
echo "Invalid path: $argv[1]. Always use absolute paths.";
exit;
}
include $argv[1]."/include/config.php";
}
else {
2010-02-19 Sancho Lerena <slerena@artica.es> * functions_events.php: Fixed typo (switched meaning) in two labels. * include/styles/pandora.css: Changed background color of th default style. * include/functions_reporting.php: Improved function get_group_stats(). Now supports stats from batch-mode and get realtime stats in a more efficient way. Fixed get_fired_alerts_reporting_table() to avoid problems in external reporting (PDF & XML). * include/functions_servers.php: get_server_performance() now uses batch mode stats reporting, and improved also the realtime stats generation. Same with function get_server_info(). * include/functions_config.php: Added new config tokens (not fully implemented yet) for event, trap, strings and audit automatic purge. * include/functions_ui.php: Added new print_page_header() function to set the new standard header in all pages, using the "tabbed" format to show the title, subtitle and other options like help, or custom-tabs for the page * pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to agents_unknown. * extensions/ext_backup: New directory to place "deleted" extensions. * extensions/dbmanager/dbmanager.css: Table names now are in it's original lowercase/uppercase format. * extensions/dbmanager.php: Updated headers, and now return "empty" when a search is empty, instead "error" as before. * extensions/users_connected.php extensions/module_groups.php extensions/plugin_registration.php extensions/pandora_logs.php operation/incidents/incident.php operation/snmpconsole/snmp_view.php operation/users/user.php operation/users/user_edit.php godmode/agentes/planned_downtime.php operation/events/events.php operation/visual_console/index.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/exportdata.php operation/agentes/ver_agente.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/users/user_statistics.php: Added new header format. * operation/agentes/estado_grupo.php: Removed old group view. * operation/agentes/tactical.php: Adapted to use new realtime/batch statistical system. Placed events above server info. Showing only pending events and other minor changes. * operation/agentes/group_view.php: NEW screen, replacing old one. Probably most ugly, but much more useful than before. * operation/agentes/networkmap.php: Added title. * operation/messages/message.php: Added title and adding some exists in code was missing before. * operation/reporting/reporting_viewer.php: Added title. * operation/reporting/graph_viewer.php: Added title. * operation/reporting/custom_reporting.php: Added title. * operation/servers/view_server.php: * operation/menu.php: Replaced old group view with new (this has english name). Removed autorefresh "by default" in server view. * extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo. * extras/pandora_diag.php: Minor changes, removed some info and added other. * general/logon_ok.php: Minor aesthetic changes. * general/header.php: Fixed missing ";" * operation/extensions.php, godmode/extensions.php: Added support for delete extensions. * godmode/menu.php: New setup items. * godmode/setup/setup.php, godmode/setup/performance.php, godmode/setup/setup_visuals.php: Reordered setup options, new setup section "Performance", added new performance options to set "realtime" statistics or "batchmode" with it's own interval. Some setup info is now shared with the servers (but it it's any change in setup, servers should be restarted anyway). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
if (file_exists("../include/config.php"))
include "../include/config.php";
// Not from console, this is a web session
if ((!isset($config["id_user"])) OR (!check_acl ($config["id_user"], 0, "PM"))) {
echo "<h2>You don't have privileges to use diagnostic tool</h2>";
echo "<p>Please login with an administrator account before try to use this tool</p>";
exit;
}
// Header
2011-04-13 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_events.php include/functions_html.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_gis.php include/functions_networkmap.php include/functions_visual_map.php include/ajax/reporting.ajax.php include/help/en/help_timesource.php include/help/es/help_timesource.php include/help/ja/help_timesource.php include/functions_ui.php include/functions.php include/functions_db.php include/functions_ui_renders.php index.php extensions/insert_data.php extensions/system_info.php extensions/extension_uploader.php extensions/pandora_logs.php extensions/agents_modules.php extensions/dbmanager.php extensions/resource_registration.php extensions/resource_exportation.php extensions/users_connected.php extensions/module_groups.php extensions/update_manager/settings.php extensions/update_manager/main.php extensions/plugin_registration.php operation/incidents/incident.php operation/incidents/incident.files.php operation/incidents/incident_detail.php operation/incidents/incident.workunits.php operation/incidents/incident.list.php operation/incidents/incident_statistics.php operation/search_modules.php operation/visual_console/render_view.php operation/visual_console/index.php operation/extensions.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/agentes/datos_agente.php operation/agentes/estado_ultimopaquete.php operation/agentes/custom_fields.php operation/agentes/estado_generalagente.php operation/agentes/networkmap.topology.php operation/agentes/estado_agente.php operation/agentes/alerts_status.functions.php operation/agentes/networkmap.groups.php operation/agentes/bulbs.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/graphs.php operation/agentes/agent_fields.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/search_agents.php operation/search_graphs.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/gis_maps/index.php operation/integria_incidents/incident.php operation/integria_incidents/incident.files.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident.workunits.php operation/integria_incidents/incident.list.php operation/integria_incidents/incident_statistics.php operation/events/event_statistics.php operation/events/events_list.php operation/events/events.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_viewer.php operation/reporting/graph_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_maps.php operation/search_results.php operation/search_users.php extras/pandora_diag.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/view_alerts.php mobile/operation/events/events.php mobile/operation/servers/view_servers.php mobile/include/functions_web.php general/footer.php general/noaccess.php general/logon_ok.php general/main_menu.php general/ui/agents_list.php general/header.php godmode/groups/modu_group_list.php godmode/groups/configure_group.php godmode/groups/configure_modu_group.php godmode/groups/group_list.php godmode/admin_access_logs.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/module_manager_editor_common.php godmode/agentes/module_manager_editor_network.php godmode/agentes/fields_manager.php godmode/agentes/module_manager_editor_wmi.php godmode/agentes/module_manager_editor_plugin.php godmode/agentes/module_manager_editor_prediction.php godmode/agentes/agent_conf_gis.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/configure_field.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/agentes/manage_config_remote.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/servers/manage_recontask_form.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/alert_compounds.php godmode/alerts/alert_list.php godmode/alerts/configure_alert_template.php godmode/alerts/alert_templates.php godmode/alerts/configure_alert_action.php godmode/alerts/configure_alert_command.php godmode/alerts/alert_actions.php godmode/alerts/alert_list.builder.php godmode/alerts/alert_commands.php godmode/setup/file_manager.php godmode/setup/os.list.php godmode/setup/news.php godmode/setup/gis_step_2.php godmode/setup/links.php godmode/setup/setup.php godmode/setup/os.php godmode/setup/performance.php godmode/setup/setup_auth.php godmode/setup/gis.php godmode/setup/os.builder.php godmode/setup/setup_visuals.php godmode/snmpconsole/snmp_alert.php godmode/snmpconsole/snmp_filters.php godmode/users/user_list.php godmode/users/configure_user.php godmode/users/configure_profile.php godmode/gis_maps/configure_gis_map.php godmode/gis_maps/index.php godmode/massive/massive_add_alerts.php godmode/massive/massive_copy_modules.php godmode/massive/massive_delete_agents.php godmode/massive/massive_enable_disable_alerts.php godmode/massive/massive_operations.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.php godmode/massive/massive_delete_action_alerts.php godmode/massive/massive_delete_modules.php godmode/massive/massive_add_profiles.php godmode/massive/massive_delete_alerts.php godmode/massive/massive_edit_modules.php godmode/massive/massive_standby_alerts.php godmode/massive/massive_add_action_alerts.php godmode/modules/manage_network_templates.php godmode/modules/module_list.php godmode/modules/manage_network_components_form_common.php godmode/modules/manage_network_components_form_network.php godmode/modules/manage_network_templates_form.php godmode/modules/manage_network_components_form_wmi.php godmode/modules/manage_network_components.php godmode/modules/manage_nc_groups.php godmode/modules/manage_network_components_form_plugin.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/visual_console_builder.php godmode/reporting/reporting_builder.preview.php godmode/reporting/visual_console_builder.data.php godmode/reporting/visual_console_builder.elements.php godmode/reporting/graph_builder.php godmode/reporting/visual_console_builder.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/visual_console_builder.editor.php godmode/reporting/reporting_builder.item_editor.php godmode/reporting/map_builder.php godmode/reporting/graphs.php godmode/reporting/graph_builder.preview.php: Now all functions of include/functions_ui have ui_ prefix. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4212 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-13 18:11:02 +02:00
ui_print_page_header (__('Pandora FMS Diagnostic tool'), "", false, "", true);
echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Pandora status info")."</th></tr>";
}
render_row ($build_version, "Pandora FMS Build");
render_row ($pandora_version, "Pandora FMS Version");
render_info_data ("SELECT value FROM tconfig where token ='MR'","Minor Release");
render_row ($config["homedir"], "Homedir");
render_row ($config["homeurl"], "HomeUrl");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'enterprise_installed'", "Enterprise installed");
$full_key = db_get_sql("SELECT value
FROM tupdate_settings
WHERE `key` = 'customer_key'");
$compressed_key = substr($full_key, 0,5).'...'.substr($full_key, -5);
render_row ($compressed_key,"Update Key");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE `key` = 'current_update'", "Current Update #");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("PHP setup")."</th></tr>";
2010-02-19 Sancho Lerena <slerena@artica.es> * functions_events.php: Fixed typo (switched meaning) in two labels. * include/styles/pandora.css: Changed background color of th default style. * include/functions_reporting.php: Improved function get_group_stats(). Now supports stats from batch-mode and get realtime stats in a more efficient way. Fixed get_fired_alerts_reporting_table() to avoid problems in external reporting (PDF & XML). * include/functions_servers.php: get_server_performance() now uses batch mode stats reporting, and improved also the realtime stats generation. Same with function get_server_info(). * include/functions_config.php: Added new config tokens (not fully implemented yet) for event, trap, strings and audit automatic purge. * include/functions_ui.php: Added new print_page_header() function to set the new standard header in all pages, using the "tabbed" format to show the title, subtitle and other options like help, or custom-tabs for the page * pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to agents_unknown. * extensions/ext_backup: New directory to place "deleted" extensions. * extensions/dbmanager/dbmanager.css: Table names now are in it's original lowercase/uppercase format. * extensions/dbmanager.php: Updated headers, and now return "empty" when a search is empty, instead "error" as before. * extensions/users_connected.php extensions/module_groups.php extensions/plugin_registration.php extensions/pandora_logs.php operation/incidents/incident.php operation/snmpconsole/snmp_view.php operation/users/user.php operation/users/user_edit.php godmode/agentes/planned_downtime.php operation/events/events.php operation/visual_console/index.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/exportdata.php operation/agentes/ver_agente.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/users/user_statistics.php: Added new header format. * operation/agentes/estado_grupo.php: Removed old group view. * operation/agentes/tactical.php: Adapted to use new realtime/batch statistical system. Placed events above server info. Showing only pending events and other minor changes. * operation/agentes/group_view.php: NEW screen, replacing old one. Probably most ugly, but much more useful than before. * operation/agentes/networkmap.php: Added title. * operation/messages/message.php: Added title and adding some exists in code was missing before. * operation/reporting/reporting_viewer.php: Added title. * operation/reporting/graph_viewer.php: Added title. * operation/reporting/custom_reporting.php: Added title. * operation/servers/view_server.php: * operation/menu.php: Replaced old group view with new (this has english name). Removed autorefresh "by default" in server view. * extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo. * extras/pandora_diag.php: Minor changes, removed some info and added other. * general/logon_ok.php: Minor aesthetic changes. * general/header.php: Fixed missing ";" * operation/extensions.php, godmode/extensions.php: Added support for delete extensions. * godmode/menu.php: New setup items. * godmode/setup/setup.php, godmode/setup/performance.php, godmode/setup/setup_visuals.php: Reordered setup options, new setup section "Performance", added new performance options to set "realtime" statistics or "batchmode" with it's own interval. Some setup info is now shared with the servers (but it it's any change in setup, servers should be restarted anyway). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
render_row (phpversion(), "PHP Version");
2018-08-09 13:08:08 +02:00
render_row (ini_get('max_execution_time')."&nbspseconds", "PHP Max execution time");
2018-08-09 13:08:08 +02:00
render_row (ini_get('max_input_time')."&nbspseconds", "PHP Max input time");
render_row (ini_get('memory_limit'), "PHP Memory limit");
render_row (ini_get('session.cookie_lifetime'), "Session cookie lifetime");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database size stats")."</th></tr>";
render_info_data ("SELECT COUNT(*) FROM tagente","Total agents");
render_info_data ("SELECT COUNT(*) FROM tagente_modulo","Total modules");
render_info_data ("SELECT COUNT(*) FROM tgrupo","Total groups");
render_info_data ("SELECT COUNT(*) FROM tagente_datos","Total module data records");
// render_info_data ("SELECT COUNT(*) FROM tagente_datos_string","Total module string data records");
// render_info_data ("SELECT COUNT(*) FROM tagente_datos_log4x","Total module log4x data records");
render_info_data ("SELECT COUNT(*) FROM tagent_access","Total agent access record");
// render_info ("tagente_estado");
// render_info ("talert_template_modules");
render_info_data ("SELECT COUNT(*) FROM tevento","Total events");
if($config['enterprise_installed'])
render_info_data ("SELECT COUNT(*) FROM ttrap","Total traps");
render_info_data ("SELECT COUNT(*) FROM tusuario","Total users");
render_info_data ("SELECT COUNT(*) FROM tsesion","Total sessions");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database sanity")."</th></tr>";
render_info_data ("SELECT COUNT( DISTINCT tagente.id_agente)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
AND tagente_modulo.disabled = 0
AND tagente_estado.id_agente = tagente.id_agente
AND tagente_estado.estado = 3","Total unknown agents");
render_info_data ("SELECT COUNT(tagente_estado.estado)
FROM tagente_estado
WHERE tagente_estado.estado = 4","Total not-init modules");
$last_run_difference = '';
$diferencia = time() - date (
db_get_sql ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'"));
$last_run_difference_months = 0;
$last_run_difference_weeks = 0;
$last_run_difference_days = 0;
$last_run_difference_minutos = 0;
$last_run_difference_seconds = 0;
while($diferencia >= 2419200){
$diferencia -= 2419200;
$last_run_difference_months++;
}
while($diferencia >= 604800){
$diferencia -= 604800;
$last_run_difference_weeks++;
}
while($diferencia >= 86400){
$diferencia -= 86400;
$last_run_difference_days++;
}
while($diferencia >= 3600){
$diferencia -= 3600;
$last_run_difference_hours++;
}
while($diferencia >= 60){
$diferencia -= 60;
$last_run_difference_minutes++;
}
$last_run_difference_seconds = $diferencia;
if($last_run_difference_months > 0){
$last_run_difference .= $last_run_difference_months.'month/s ';
}
if ($last_run_difference_weeks > 0) {
$last_run_difference .= $last_run_difference_weeks.' week/s ';
}
if ($last_run_difference_days > 0) {
$last_run_difference .= $last_run_difference_days.' day/s ';
}
if ($last_run_difference_hours > 0) {
$last_run_difference .= $last_run_difference_hours.' hour/s ';
}
if ($last_run_difference_minutes > 0) {
$last_run_difference .= $last_run_difference_minutes.' minute/s ';
}
$last_run_difference .= $last_run_difference_seconds.' second/s ago';
render_row ( date ("Y/m/d H:i:s",
db_get_sql ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_maintance'")).' ('.$last_run_difference.')'.' *', "PandoraDB Last run");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Database status info")."</th></tr>";
2010-02-19 Sancho Lerena <slerena@artica.es> * functions_events.php: Fixed typo (switched meaning) in two labels. * include/styles/pandora.css: Changed background color of th default style. * include/functions_reporting.php: Improved function get_group_stats(). Now supports stats from batch-mode and get realtime stats in a more efficient way. Fixed get_fired_alerts_reporting_table() to avoid problems in external reporting (PDF & XML). * include/functions_servers.php: get_server_performance() now uses batch mode stats reporting, and improved also the realtime stats generation. Same with function get_server_info(). * include/functions_config.php: Added new config tokens (not fully implemented yet) for event, trap, strings and audit automatic purge. * include/functions_ui.php: Added new print_page_header() function to set the new standard header in all pages, using the "tabbed" format to show the title, subtitle and other options like help, or custom-tabs for the page * pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to agents_unknown. * extensions/ext_backup: New directory to place "deleted" extensions. * extensions/dbmanager/dbmanager.css: Table names now are in it's original lowercase/uppercase format. * extensions/dbmanager.php: Updated headers, and now return "empty" when a search is empty, instead "error" as before. * extensions/users_connected.php extensions/module_groups.php extensions/plugin_registration.php extensions/pandora_logs.php operation/incidents/incident.php operation/snmpconsole/snmp_view.php operation/users/user.php operation/users/user_edit.php godmode/agentes/planned_downtime.php operation/events/events.php operation/visual_console/index.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/exportdata.php operation/agentes/ver_agente.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/users/user_statistics.php: Added new header format. * operation/agentes/estado_grupo.php: Removed old group view. * operation/agentes/tactical.php: Adapted to use new realtime/batch statistical system. Placed events above server info. Showing only pending events and other minor changes. * operation/agentes/group_view.php: NEW screen, replacing old one. Probably most ugly, but much more useful than before. * operation/agentes/networkmap.php: Added title. * operation/messages/message.php: Added title and adding some exists in code was missing before. * operation/reporting/reporting_viewer.php: Added title. * operation/reporting/graph_viewer.php: Added title. * operation/reporting/custom_reporting.php: Added title. * operation/servers/view_server.php: * operation/menu.php: Replaced old group view with new (this has english name). Removed autorefresh "by default" in server view. * extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo. * extras/pandora_diag.php: Minor changes, removed some info and added other. * general/logon_ok.php: Minor aesthetic changes. * general/header.php: Fixed missing ";" * operation/extensions.php, godmode/extensions.php: Added support for delete extensions. * godmode/menu.php: New setup items. * godmode/setup/setup.php, godmode/setup/performance.php, godmode/setup/setup_visuals.php: Reordered setup options, new setup section "Performance", added new performance options to set "realtime" statistics or "batchmode" with it's own interval. Some setup info is now shared with the servers (but it it's any change in setup, servers should be restarted anyway). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
switch ($config["dbtype"]) {
case "mysql":
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_first_version'", "DB Schema Version (first installed)");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_version'", "DB Schema Version (actual)");
render_info_data ("SELECT `value`
FROM tconfig
WHERE `token` = 'db_scheme_build'", "DB Schema Build");
2018-08-09 13:08:08 +02:00
render_row(get_value_sum($db_size) . "M", "DB Size");
2018-08-10 10:41:18 +02:00
2018-08-10 10:41:18 +02:00
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN'){
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("System info")."</th></tr>";
$output = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
$output2 = 'cat /proc/cpuinfo | grep "processor" | wc -l';
render_row(exec($output).' x '.exec($output2),'CPU');
$output = 'cat /proc/meminfo | grep "MemTotal"';
render_row(exec($output),'RAM');
}
break;
case "postgresql":
render_info_data ("SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT \"value\"
FROM tconfig
WHERE \"token\" = 'enterprise_installed'", "Enterprise installed");
render_row ( date ("Y/m/d H:i:s",
db_get_sql ("SELECT \"value\"
FROM tconfig WHERE \"token\" = 'db_maintance'")), "PandoraDB Last run");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'customer_key';", "Update Key");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT value
FROM tupdate_settings
WHERE \"key\" = 'current_update'", "Current Update #");
break;
2011-04-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_events.php include/functions_messages.php include/db/oracle.php include/functions_modules.php include/functions_reporting.php include/functions_groups.php include/functions_gis.php include/auth/mysql.php include/functions_networkmap.php include/functions_servers.php include/functions_network_components.php include/ajax/reporting.ajax.php include/ajax/agent.php include/functions_config.php include/functions_api.php include/help/en/help_timesource.php include/help/es/help_timesource.php include/help/ja/help_timesource.php include/fgraph.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_fsgraph.php include/functions_alerts.php include/functions_reports.php pandoradb.oracle.sql install.php extensions/system_info.php extensions/update_manager.php extensions/dbmanager.php extensions/users_connected.php extensions/module_groups.php extensions/update_manager/sql/update_manager.oracle.sql extensions/update_manager/load_updatemanager.php extensions/update_manager/lib/libupdate_manager_client.php extensions/update_manager/lib/libupdate_manager.php extensions/update_manager/lib/libupdate_manager_components.php extensions/update_manager/lib/libupdate_manager_updates.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/agentes/datos_agente.php operation/agentes/estado_ultimopaquete.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/events/events_rss.php operation/events/events_list.php operation/events/events_marquee.php operation/search_alerts.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php pandoradb.data.oracle.sql extras/pandora_diag.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/events/events.php general/logon_ok.php godmode/groups/group_list.php godmode/admin_access_logs.php godmode/db/db_main.php godmode/agentes/agent_template.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/alerts/alert_list.list.php godmode/alerts/alert_compounds.php godmode/alerts/alert_list.php godmode/setup/setup.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_templates_form.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/reporting_builder.preview.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Support for Oracle DBMS over Console code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4187 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-11 19:05:20 +02:00
case "oracle":
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'db_scheme_version'", "DB Schema Version");
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'db_scheme_build'", "DB Schema Build");
render_info_data ("SELECT value
FROM tconfig
WHERE token = 'enterprise_installed'", "Enterprise installed");
render_row (db_get_sql ("SELECT value
FROM tconfig
WHERE token = 'db_maintance'"), "PandoraDB Last run");
render_info_data ("SELECT " . db_escape_key_identifier('value') .
" FROM tupdate_settings
WHERE \"key\" = 'customer_key'", "Update Key");
render_info_data ("SELECT " . db_escape_key_identifier('value') .
" FROM tupdate_settings
WHERE \"key\" = 'updating_code_path'", "Updating code path");
render_info_data ("SELECT " . db_escape_key_identifier('value') .
" FROM tupdate_settings
WHERE \"key\" = 'current_update'", "Current Update #");
2011-04-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_events.php include/functions_messages.php include/db/oracle.php include/functions_modules.php include/functions_reporting.php include/functions_groups.php include/functions_gis.php include/auth/mysql.php include/functions_networkmap.php include/functions_servers.php include/functions_network_components.php include/ajax/reporting.ajax.php include/ajax/agent.php include/functions_config.php include/functions_api.php include/help/en/help_timesource.php include/help/es/help_timesource.php include/help/ja/help_timesource.php include/fgraph.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_fsgraph.php include/functions_alerts.php include/functions_reports.php pandoradb.oracle.sql install.php extensions/system_info.php extensions/update_manager.php extensions/dbmanager.php extensions/users_connected.php extensions/module_groups.php extensions/update_manager/sql/update_manager.oracle.sql extensions/update_manager/load_updatemanager.php extensions/update_manager/lib/libupdate_manager_client.php extensions/update_manager/lib/libupdate_manager.php extensions/update_manager/lib/libupdate_manager_components.php extensions/update_manager/lib/libupdate_manager_updates.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/agentes/datos_agente.php operation/agentes/estado_ultimopaquete.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/events/events_rss.php operation/events/events_list.php operation/events/events_marquee.php operation/search_alerts.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php pandoradb.data.oracle.sql extras/pandora_diag.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/events/events.php general/logon_ok.php godmode/groups/group_list.php godmode/admin_access_logs.php godmode/db/db_main.php godmode/agentes/agent_template.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/alerts/alert_list.list.php godmode/alerts/alert_compounds.php godmode/alerts/alert_list.php godmode/setup/setup.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_templates_form.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/reporting_builder.preview.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Support for Oracle DBMS over Console code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4187 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-11 19:05:20 +02:00
break;
}
2018-08-13 12:52:01 +02:00
$innodb_log_file_size =db_get_value_sql ("SELECT @@innodb_log_file_size")/1048576;
$innodb_log_buffer_size =db_get_value_sql("SELECT @@innodb_log_buffer_size")/1048576;
$innodb_flush_log_at_trx_commit =db_get_value_sql("SELECT @@innodb_flush_log_at_trx_commit");
$max_allowed_packet =db_get_value_sql("SELECT @@max_allowed_packet")/1048576;
$innodb_buffer_pool_size = db_get_value_sql("SELECT @@innodb_buffer_pool_size")/1024;
$sort_buffer_size =number_format(db_get_value_sql("SELECT @@sort_buffer_size")/1024, 2);
$join_buffer_size =db_get_value_sql("SELECT @@join_buffer_size")/1024;
$query_cache_type =db_get_value_sql("SELECT @@query_cache_type");
$query_cache_size =db_get_value_sql("SELECT @@query_cache_size")/1048576;
$query_cache_limit =db_get_value_sql("SELECT @@query_cache_limit")/1048576;
$innodb_lock_wait_timeout =db_get_value_sql("SELECT @@innodb_lock_wait_timeout");
$thread_cache_size =db_get_value_sql("SELECT @@thread_cache_size");
$thread_stack =db_get_value_sql("SELECT @@thread_stack")/1024;
$max_connections =db_get_value_sql("SELECT @@max_connections");
$key_buffer_size =db_get_value_sql("SELECT @@key_buffer_size")/1024;
$read_buffer_size =db_get_value_sql("SELECT @@read_buffer_size")/1024;
$read_rnd_buffer_size =db_get_value_sql("SELECT @@read_rnd_buffer_size")/1024;
$query_cache_min_res_unit =db_get_value_sql("SELECT @@query_cache_min_res_unit")/1024;
$innodb_file_per_table = db_get_value_sql("SELECT @@innodb_file_per_table");
2018-08-09 13:08:08 +02:00
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("MySQL Performance metrics")."</th></tr>";
2018-08-20 10:09:09 +02:00
render_row(status_values($innodb_log_file_size_min_rec_value,$innodb_log_file_size),'InnoDB log file size ', 'InnoDB log file size ');
render_row(status_values($innodb_log_buffer_size_min_rec_value,$innodb_log_buffer_size),'InnoDB log buffer size ', 'InnoDB log buffer size ');
render_row(status_values($innodb_flush_log_at_trx_commit_min_rec_value,$innodb_flush_log_at_trx_commit), 'InnoDB flush log at trx-commit ','InnoDB flush log at trx-commit ');
render_row(status_values($max_allowed_packet_min_rec_value,$max_allowed_packet), 'Maximun allowed packet ','Maximun allowed packet ');
render_row(status_values($innodb_buffer_pool_size_min_rec_value,$innodb_buffer_pool_size), 'InnoDB buffer pool size ','InnoDB buffer pool size ');
render_row(status_values($sort_buffer_size_min_rec_value,$sort_buffer_size), 'Sort buffer size ','Sort buffer size ');
render_row(status_values($join_buffer_size_min_rec_value,$join_buffer_size), 'Join buffer size ','Join buffer size ');
render_row(status_values($query_cache_type_min_rec_value,$query_cache_type), 'Query cache type ', 'Query cache type ');
render_row(status_values($query_cache_size_min_rec_value,$query_cache_size), 'Query cache size ','Query cache size ');
render_row(status_values($query_cache_limit_min_rec_value,$query_cache_limit), 'Query cache limit ','Query cache limit ');
render_row(status_values($innodb_lock_wait_timeout_max_rec_value,$innodb_lock_wait_timeout), 'InnoDB lock wait timeout ','InnoDB lock wait timeout ');
render_row(status_values($thread_cache_size_max_rec_value,$thread_cache_size), 'Thread cache size ','Thread cache size ');
render_row(status_values($thread_stack_min_rec_value,$thread_stack), 'Thread stack ','Thread stack ');
render_row(status_values($max_connections_max_rec_value,$max_connections), 'Maximum connections ','Maximun connections ');
render_row(status_values($key_buffer_size_min_rec_value,$key_buffer_size), 'Key buffer size ','Key buffer size ');
render_row(status_values($read_buffer_size_min_rec_value,$read_buffer_size), 'Read buffer size ','Read buffer size ');
render_row(status_values($read_rnd_buffer_size_min_rec_value,$read_rnd_buffer_size), 'Read rnd-buffer size ','Read rnd-buffer size ');
render_row(status_values($query_cache_min_res_unit_min_rec_value,$query_cache_min_res_unit), 'Query cache min-res-unit ','Query cache min-res-unit ');
render_row(status_values($innodb_file_per_table_min_rec_value,$innodb_file_per_table), 'InnoDB file per table ','InnoDB file per table ');
2018-08-09 13:08:08 +02:00
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__("Tables fragmentation in the PandoraFMS database")."</th></tr>";
render_row ($tables_fragmentation_max_rec_value . "%", "Tables fragmentation (maximum recommended value)");
render_row (number_format($tables_fragmentation, 2) . "%", "Tables fragmentation (current value)");
render_row (status_fragmentation_tables($tables_fragmentation_max_rec_value, $tables_fragmentation), "Status fragmentation tables");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" PandoraFMS logs dates")."</th></tr>";
2018-08-20 10:09:09 +02:00
render_row(number_format(get_logs_size($path_server_logs)/1024, 2) . "M", 'Size server logs (current value)');
render_row(get_status_logs($path_server_logs),'Status server logs');
render_row(number_format(get_logs_size($path_console_logs)/1024, 2) . "M", 'Size console logs (current value)');
render_row(get_status_logs($path_console_logs),'Status console logs');
2018-08-09 13:08:08 +02:00
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" PandoraFMS Licence Information")."</th></tr>";
render_row( html_print_textarea ('keys[customer_key]', 10, 255, $settings->customer_key, 'style="height:40px; width:450px;"', true),'Customer key');
render_row( $license['expiry_date'],'Expires');
render_row( $license['limit'] . ' agents','Platform Limit');
render_row( $license['count'] . ' agents','Current Platform Count');
render_row( $license['count_enabled']. ' agents','Current Platform Count (enabled: items)');
render_row( $license['count_disabled']. ' agents','Current Platform Count (disabled: items)');
render_row( $license['license_mode'],'License Mode');
render_row( status_license_params($license['nms']) , 'Network Management System');
render_row( status_license_params($license['dhpm']) , 'Satellite');
render_row( $license['licensed_to'], 'Licensed to');
render_row( license_capacity(), "Status of agents capacity");
render_row(percentage_modules_per_agent(), "Status of average modules per agent");
render_row(interval_average_of_network_modules(), "Interval average of the network modules");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Status of the attachment folder")."</th></tr>";
render_row($attachment_total_files, "Total files in the attachment folder");
render_row(files_attachment_folder($attachment_total_files), "Status of the attachment folder");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Information from the tagente_datos table")."</th></tr>";
render_row($tagente_datos_size, "Total data in the tagente_datos table");
render_row(status_tagente_datos($tagente_datos_size), "Status of the tagente_datos table");
render_row(execution_time(), "Degradation of the execution time when executing a count");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Pandora FMS server threads")."</th></tr>";
render_row($total_server_threads, "Total server threads");
render_row($percentage_threads_ram . "%", "Percentage of threads used by the RAM");
render_row($percentage_threads_cpu . "%", "Percentage of threads used by the CPU");
echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__(" Graphs modules that represent the self-monitoring system")."</th></tr>";
$server_name = db_get_value_sql("SELECT name FROM tserver WHERE master = 1");
$agent_id= db_get_value_sql ("SELECT id_agente FROM tagente WHERE nombre = '$server_name'");
$id_modules = agents_get_modules($agent_id);
$id_modules = array (
modules_get_agentmodule_id('Agents_Unknown',$agent_id),
modules_get_agentmodule_id('Database&#x20;Maintenance',$agent_id),
modules_get_agentmodule_id('FreeDisk_SpoolDir',$agent_id),
modules_get_agentmodule_id('Free_RAM',$agent_id),
modules_get_agentmodule_id('Queued_Modules',$agent_id),
modules_get_agentmodule_id('Status',$agent_id),
modules_get_agentmodule_id('System_Load_AVG',$agent_id),
modules_get_agentmodule_id('Execution_time',$agent_id)
);
foreach ($id_modules as $id_module){
$params =array(
'agent_module_id' => $id_module['id_agente_modulo'],
'period' => SECONDS_1MONTH,
'date' => time() ,
2018-08-13 12:52:01 +02:00
'height' => '150'
2018-08-09 13:08:08 +02:00
);
render_row(grafico_modulo_sparse ($params),"Graph of the " . $id_module['nombre']." module.");
}
if ($console_mode == 0) {
echo "</table>";
}
echo "<hr color='#b1b1b1' size=1 width=1000 align=left>";
echo "<span>".__('(*) Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\' very important to
keep up-to-date database to get the best performance and results in Pandora')."</span><br><br><br>";
?>