2009-04-02 Esteban Sanchez <estebans@artica.es>

* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed id on tconfig
	inserts.

	* godmode/agentes/configurar_agente.php: Min and max module values
	were not being updated.

	* godmode/alerts/configure_alert_template.php: Removed duplicated
	example. Added support for next warning and critical template types.

	* include/functions_ui.php, include/functions_alerts.php: Added new
	alert template types.

	* include/functions_db.php: temp_sql_delete() moved out of
	delete_agent() because there were errors if it was calling more than
	once.

	* include/functions_reports.php: Fixed doc for get_reports().

	* include/config_process.php: Updated build number.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1589 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2009-04-02 12:53:27 +00:00
parent f119df947b
commit c5172510e5
9 changed files with 76 additions and 28 deletions

View File

@ -1,3 +1,25 @@
2009-04-02 Esteban Sanchez <estebans@artica.es>
* extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed id on tconfig
inserts.
* godmode/agentes/configurar_agente.php: Min and max module values
were not being updated.
* godmode/alerts/configure_alert_template.php: Removed duplicated
example. Added support for next warning and critical template types.
* include/functions_ui.php, include/functions_alerts.php: Added new
alert template types.
* include/functions_db.php: temp_sql_delete() moved out of
delete_agent() because there were errors if it was calling more than
once.
* include/functions_reports.php: Fixed doc for get_reports().
* include/config_process.php: Updated build number.
2009-04-02 Esteban Sanchez <estebans@artica.es>
* reporting/fgraph.php: Removed id_agente reference on combined

View File

@ -7,11 +7,11 @@ ALTER TABLE treport_content_sla_combined CHANGE sla_limit `sla_limit` double(18,
ALTER TABLE ttrap add `priority` tinyint(4) unsigned NOT NULL default '2';
INSERT INTO `tconfig` VALUES (24, 'loginhash_pwd', '');
INSERT INTO `tconfig` VALUES (25, 'trap2agent', 0);
INSERT INTO `tconfig` VALUES (26, 'prominent_time', 0);
INSERT INTO `tconfig` VALUES (27, 'timesource', 'system');
INSERT INTO `tconfig` VALUES (28, 'event_view_hr', 8);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('loginhash_pwd', '');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('trap2agent', 0);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('prominent_time', 0);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('timesource', 'system');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('event_view_hr', 8);
ALTER TABLE tagente ADD `custom_id` varchar(255) default '';
ALTER TABLE tagente_modulo ADD `custom_id` varchar(255) default '';

View File

@ -380,8 +380,8 @@ if ($update_module || $create_module) {
$post_process = (float) get_parameter ('post_process');
$prediction_module = (int) get_parameter ('prediction_module');
$max_timeout = (int) get_parameter ('max_timeout');
$minvalue = (int) get_parameter_post ("minvalue");
$maxvalue = (int) get_parameter ('maxvalue');
$minvalue = (int) get_parameter_post ("min");
$maxvalue = (int) get_parameter ('max');
$interval = (int) get_parameter ('module_interval', $intervalo);
$id_prediction_module = (int) get_parameter ('id_prediction_module');
$id_plugin = (int) get_parameter ('id_plugin');

View File

@ -439,11 +439,6 @@ if ($step == 2) {
$table->data[2][0] = __('Priority');
$table->data[2][1] = print_select (get_priorities (), 'priority',
$priority, '', 0, 0, true, false, false);
$table->data[2][1] .= '<span id="matches_value" '.($show_matches ? '' : 'style="display: none"').'>';
$table->data[2][1] .= '&nbsp;'.print_checkbox ('matches_value', 1, $matches, true);
$table->data[2][1] .= print_label (__('Trigger when matches the value'),
'checkbox-matches_value', true);
$table->data[2][1] .= '</span>';
$table->data[3][0] = __('Condition type');
$table->data[3][1] = print_select (get_alert_templates_types (), 'type',
@ -518,6 +513,8 @@ var between = "<?php echo __('The alert would fire when the value is between <sp
var between_not = "<?php echo __('The alert would fire when the value is not between <span id=\"min\"></span> and <span id=\"max\"></span>');?>";
var under = "<?php echo __('The alert would fire when the value is under <span id=\"min\"></span>');?>";
var over = "<?php echo __('The alert would fire when the value is over <span id=\"max\"></span>');?>";
var warning = "<?php echo __('The alert would fire when the module is in warning status');?>";
var critical = "<?php echo __('The alert would fire when the module is in critical status');?>";
function check_regex () {
if ($("#type").attr ('value') != 'regex') {
@ -620,6 +617,20 @@ $(document).ready (function () {
/* Show example */
$("span#example").empty ().append (under);
break;
case "warning":
$("#template-value, #template-max, span#matches_value, #template-min").hide ();
$("#template-example").show ();
/* Show example */
$("span#example").empty ().append (warning);
break;
case "critical":
$("#template-value, #template-max, span#matches_value, #template-min").hide ();
$("#template-example").show ();
/* Show example */
$("span#example").empty ().append (critical);
break;
default:
$("#template-value, #template-max, #template-min, #template-example, span#matches_value").hide ();
break;

View File

@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//Pandora Version
$build_version = 'PC090324';
$build_version = 'PC090402';
$pandora_version = 'v3.0-dev';
$config['start_time'] = microtime (true);

View File

@ -186,6 +186,8 @@ function get_alert_templates_types () {
$types['min'] = __('Min.');
$types['equal'] = __('Equal to');
$types['not_equal'] = __('Not equal to');
$types['warning'] = __('Warning status');
$types['critical'] = __('Critical status');
return $types;
}

View File

@ -2502,6 +2502,20 @@ function server_status ($id_server) {
return $serverinfo[$id_server];
}
/**
* Subfunciton for less typing
* @ignore
*/
function temp_sql_delete ($table, $row, $value) {
global $error; //Globalize the errors variable
$result = process_sql_delete ($table, $row.' = '.$value);
if ($result === false) {
$error = true;
}
}
/**
* Delete an agent from the database.
*
@ -2514,19 +2528,6 @@ function delete_agent ($id_agents) {
$error = false;
//Subfunciton for less typing
/**
* @ignore
*/
function temp_sql_delete ($table, $row, $value) {
global $error; //Globalize the errors variable
$result = process_sql_delete ($table, $row.' = '.$value);
if ($result === false) {
$error = true;
echo $table, $row.' = '.$value;
}
}
//Convert single values to an array
if (! is_array ($id_agents))
$id_agents = (array) $id_agents;

View File

@ -53,7 +53,9 @@ function get_report ($id_report, $filter = false, $fields = false) {
* - The report is not private and the user has reading privileges on
* the group associated to the report
*
* @param string $id_user User id
* @param array Extra filter to retrieve reports. All reports are returned by
* default
* @param array Fields to be fetched on every report.
*
* @return array An array with all the reports the user can view.
*/
@ -69,7 +71,7 @@ function get_reports ($filter = false, $fields = false) {
}
$reports = array ();
$all_reports = get_db_all_rows_filter ('treport', $filter, $fields);
$all_reports = @get_db_all_rows_filter ('treport', $filter, $fields);
if ($all_reports !== FALSE)
foreach ($all_reports as $report){
if ($config['id_user'] != $report['id_user'] && ! give_acl ($config['id_user'], $report['id_group'], 'AR'))

View File

@ -422,6 +422,16 @@ function print_alert_template_example ($id_alert_template, $return = false, $pri
case 'min':
/* Do not translate the HTML attributes */
$output .= __('The alert would fire when the value is under <span id="min"></span>');
break;
case 'warning':
/* Do not translate the HTML attributes */
$output .= __('The alert would fire when the module is in warning status');
break;
case 'critical':
/* Do not translate the HTML attributes */
$output .= __('The alert would fire when the module is in critical status');
break;
}