2010-03-02 Sancho Lerena <slerena@artica.es>

* include/functions_reporting.php: Solved issue with several undefined
	vars.

	* include/functions_servers.php: Solved issue with several undefined
	vars. 

	* include/functions_config.php: Added metaconsola witch to readconfig.

	* include/config_process.php: Update build.. is YYMMDD !

	* include/functions_ui.php: Removed deprecated call to split and replaced
	by preg_split.

	* index.php: Activated developer mode.

	* operation/agentes/estado_monitores.php: Solved small problem with modules
	without history, filling missing column in table. Added headers

	* godmode/alerts/configure_alert_compound.php,
	operation/agentes/status_monitor.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_commands.php,
	godmode/modules/manage_network_templates.php,
	godmode/modules/module_list.php,
	godmode/modules/manage_network_components.php,
	godmode/modules/manage_nc_groups.php: Removed deprecated call to include
	config.php and in some cases, added new header style.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2010-03-02 14:13:00 +00:00
parent 442981a212
commit 22e7cde978
21 changed files with 105 additions and 34 deletions

View File

@ -1,3 +1,37 @@
2010-03-02 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Solved issue with several undefined
vars.
* include/functions_servers.php: Solved issue with several undefined
vars.
* include/functions_config.php: Added metaconsola witch to readconfig.
* include/config_process.php: Update build.. is YYMMDD !
* include/functions_ui.php: Removed deprecated call to split and replaced
by preg_split.
* index.php: Activated developer mode.
* operation/agentes/estado_monitores.php: Solved small problem with modules
without history, filling missing column in table. Added headers
* godmode/alerts/configure_alert_compound.php,
operation/agentes/status_monitor.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_commands.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php: Removed deprecated call to include
config.php and in some cases, added new header style.
2010-03-02 Miguel de Dios <miguel.dedios@artica.es>
* godmode/setup/gis_step_2.php: fix a mechanographic mistake.

View File

@ -14,7 +14,8 @@
// GNU General Public License for more details.
// Load global vars
require_once ("include/config.php");
global $config;
require_once ("include/functions_alerts.php");
check_login ();

View File

@ -15,7 +15,8 @@
// Load global vars
require_once ("include/config.php");
global $config;
require_once ("include/functions_alerts.php");
check_login ();

View File

@ -14,7 +14,8 @@
// GNU General Public License for more details.
// Load global vars
require_once ('include/config.php');
global $config;
require_once ('include/functions_alerts.php');
check_login ();
@ -105,8 +106,9 @@ if (! give_acl ($config['id_user'], 0, "LM")) {
exit;
}
echo "<h2>".__('Alerts')." &raquo; ";
echo __('Alert templates')."</h2>";
// Header
print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "", false, "", true);
$update_template = (bool) get_parameter ('update_template');
$delete_template = (bool) get_parameter ('delete_template');

View File

@ -14,7 +14,8 @@
// GNU General Public License for more details.
// Load global vars
require_once ('include/config.php');
global $config;
require_once ('include/functions_alerts.php');
check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details.
// Load global vars
require_once ("include/config.php");
global $config;
require_once ("include/functions_alerts.php");
check_login ();

View File

@ -13,6 +13,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
check_login ();
if (! give_acl ($config['id_user'], 0, "AW")) {

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details.
// Load global vars
require_once ('include/config.php');
global $config;
require_once ('include/functions_alerts.php');
check_login ();
@ -26,6 +26,10 @@ if (! give_acl ($config['id_user'], 0, "LM")) {
exit;
}
// Header
print_page_header (__('Alerts').' &raquo; '.__('Configure alert template'), "", false, "", true);
$duplicate_template = (bool) get_parameter ('duplicate_template');
$id = (int) get_parameter ('id');
@ -301,8 +305,6 @@ if ($id && ! $create_template) {
$id_group = $template["id_group"];
}
echo '<h2>'.__('Alerts').' &raquo; '.__('Configure alert template').'</h2>';
print_alert_template_steps ($step, $id);
$table->id = 'template';

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details.
// Load global vars
require("include/config.php");
global $config;
check_login ();
@ -25,6 +25,10 @@ if (! give_acl ($config['id_user'], 0, "PM")) {
return;
}
// Header
print_page_header (__('Module management').' &raquo; '. __('Component group management'), "", false, "", true);
require_once ('include/functions_network_components.php');
$create = (bool) get_parameter ('create');
@ -71,7 +75,6 @@ if ($id || $new) {
return;
}
echo '<h2>'.__('Module management').' &raquo; '. __('Component group management').'</h2>';
$url = get_url_refresh (array ('offset' => false,
'create' => false,

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details.
// Load global vars
require ("include/config.php");
global $config;
check_login ();
@ -25,6 +25,10 @@ if (! give_acl ($config['id_user'], 0, "PM")) {
exit;
}
// Header
print_page_header (__('Module management')." &raquo; ". __('Module component management'), "", false, "", true);
require_once ('include/functions_network_components.php');
$type = (int) get_parameter ('type');
@ -242,8 +246,6 @@ $url = get_url_refresh (array ('offset' => false,
'ff_event' => false,
'id_component_type' => false));
echo "<h2>".__('Module management')." &raquo; ";
echo __('Module component management')."</h2>";
$search_id_group = (int) get_parameter ('search_id_group');
$search_string = (string) get_parameter ('search_string');

View File

@ -15,7 +15,7 @@
// Load global vars
require_once ("include/config.php");
global $config;
check_login ();
@ -26,6 +26,10 @@ if (! give_acl ($config['id_user'], 0, "PM")) {
return;
}
// Header
print_page_header (__('Module management')." &raquo; ".__('Module template management'), "", false, "", true);
require_once ('include/functions_network_profiles.php');
$delete_profile = (bool) get_parameter ('delete_profile');
@ -100,8 +104,6 @@ if ($export_profile) {
exit;
}
echo "<h2>".__('Module management')." &raquo; ".__('Module template management')."</h2>";
$result = get_db_all_rows_in_table ("tnetwork_profile", "name");
$table->cellpadding = 4;

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details.
// Load global vars
require("include/config.php");
global $config;
check_login ();
@ -24,6 +24,9 @@ if (! give_acl ($config['id_user'], 0, "PM")) {
exit;
}
// Header
print_page_header (__('Module management')." &raquo; ". __('Defined modules'), "", false, "", true);
$update_module = (bool) get_parameter_post ('update_module');
// Update
@ -45,8 +48,6 @@ if ($update_module) {
echo "<h3 class='suc'>".__('Module updated successfully')."</h3>";
}
echo "<h2>".__('Module management')." &raquo; ";
echo __('Defined modules')."</h2>";
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>";
echo "<th>".__('Icon')."</th>";

View File

@ -22,7 +22,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC010310';
$build_version = 'PC100301'; // Remember is YYMMDD
$pandora_version = 'v3.1-dev';
/* Help to debug problems. Override global PHP configuration */

View File

@ -836,7 +836,7 @@ function enterprise_include_once ($filename) {
if ($filepath === false)
return ENTERPRISE_NOT_HOOK;
if (file_exists ($filepath)) {
include_once ($filepath);
require_once ($filepath);
return true;
}
return ENTERPRISE_NOT_HOOK;

View File

@ -177,7 +177,7 @@ function update_config () {
update_config_value ('string_purge', get_parameter ('string_purge', $config['string_purge']));
update_config_value ('audit_purge', get_parameter ('audit_purge', $config['audit_purge']));
update_config_value ('acl_enterprise', get_parameter ('acl_enterprise', $config['acl_enterprise']));
update_config_value ('metaconsole', get_parameter ('metaconsole', $config['metaconsole']));
}
@ -302,6 +302,10 @@ function process_config () {
update_config_value ('acl_enterprise', 0);
}
if (!isset ($config["metaconsole"])){
update_config_value ('metaconsole', 0);
}
/*
*Parse the ACL IP list for access API that it's save in chunks as
*list_ACL_IPs_for_API_<num>, because the value has a limit of 100

View File

@ -106,11 +106,15 @@ function get_group_stats ($id_group = 0) {
$data["total_agents"] = 0;
$data["total_alerts"] = 0;
$data["total_checks"] = 0;
$data["alerts"] = 0;
$data["agents_unknown"] = 0;
$data["monitor_health"] = 100;
$data["alert_level"] = 100;
$data["module_sanity"] = 100;
$data["server_sanity"] = 100;
$data["total_not_init"] = 0;
$data["monitor_non_init"] = 0;
$cur_time = get_system_time ();
//Check for access credentials using give_acl. More overhead, much safer
@ -211,10 +215,16 @@ function get_group_stats ($id_group = 0) {
$data["module_sanity"] = 100;
}
if ($data["monitor_alerts_fired"] > 0 && $data["alerts"] > 0) {
$data["alert_level"] = format_numeric (100 - ($data["monitor_alerts_fired"] / ($data["alerts"] / 100)), 1);
} else {
if (isset($data["alerts"])){
if ($data["monitor_alerts_fired"] > 0 && $data["alerts"] > 0) {
$data["alert_level"] = format_numeric (100 - ($data ["monitor_alerts_fired"] / ($data["alerts"] / 100)), 1);
} else {
$data["alert_level"] = 100;
}
}
else {
$data["alert_level"] = 100;
$data["alerts"] = 0;
}
$data["monitor_bad"] = $data["monitor_critical"] + $data["monitor_warning"];

View File

@ -281,7 +281,10 @@ function get_server_info ($id_server = -1) {
} // recon
} // Take data for realtime mode
$server["lag_txt"] = ($server["lag"] == 0 ? '-' : human_time_description_raw ($server["lag"])) . " / ". $server["module_lag"];
if (isset($server["module_lag"]))
$server["lag_txt"] = ($server["lag"] == 0 ? '-' : human_time_description_raw ($server["lag"])) . " / ". $server["module_lag"];
else
$server["lag_txt"] = "";
if ($server["modules_total"] > 0) {
$server["load"] = round ($server["modules"] / $server["modules_total"] * 100);

View File

@ -1104,11 +1104,11 @@ function get_status_images_path () {
if (strpos ($imageset, ",") === false)
$imageset .= ",40x18";
list ($imageset, $sizes) = split (",", $imageset, 2);
list ($imageset, $sizes) = preg_split ("/\,/", $imageset);
if (strpos ($sizes, "x") === false)
$sizes .= "x18";
list ($imagewidth, $imageheight) = split ("x", $sizes, 2);
list ($imagewidth, $imageheight) = preg_split ("/x/", $sizes);
$imagespath = 'images/status_sets/'.$imageset;

View File

@ -20,7 +20,8 @@ if (function_exists ('mb_internal_encoding')) {
}
// Set to 1 to do not check for installer or config file (for development!).
$develop_bypass = 0;
// Activate gives more error information, not useful for production sites
$develop_bypass = 1;
if ($develop_bypass != 1) {
// If no config file, automatically try to install
@ -58,7 +59,7 @@ require_once ("include/config.php");
/* Enterprise support */
if (file_exists (ENTERPRISE_DIR."/load_enterprise.php")) {
include (ENTERPRISE_DIR."/load_enterprise.php");
include_once (ENTERPRISE_DIR."/load_enterprise.php");
}
/**

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details.
// Load globar vars
require_once ("include/config.php");
global $config;
if (!isset ($id_agente)) {
//This page is included, $id_agente should be passed to it.
@ -127,6 +127,8 @@ foreach ($modules as $module) {
$data[5] = $salida;
$graph_type = return_graphtype ($module["id_tipo_modulo"]);
$data[6] = " ";
if ($module['history_data'] == 1){
$nombre_tipo_modulo = get_moduletype_name ($module["id_tipo_modulo"]);
$handle = "stat".$nombre_tipo_modulo."_".$module["id_agente_modulo"];

View File

@ -17,7 +17,7 @@
// Load global vars
require_once ("include/config.php");
global $config;
check_login();