2011-08-13 Sancho lerena <slerena@artica.es>
* pandoradb_data.sql: Added default action "Pandora FMS event". * godmode/alerts/alert_actions.php: Fixed bug when update an action and name is the same. * godmode/snmpconsole/snmp_alert.php: Fixed witdh of field1. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4732 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3b5cf09fb9
commit
048838a86b
|
@ -1,3 +1,12 @@
|
|||
2011-08-13 Sancho lerena <slerena@artica.es>
|
||||
|
||||
* pandoradb_data.sql: Added default action "Pandora FMS event".
|
||||
|
||||
* godmode/alerts/alert_actions.php: Fixed bug when update an action
|
||||
and name is the same.
|
||||
|
||||
* godmode/snmpconsole/snmp_alert.php: Fixed witdh of field1.
|
||||
|
||||
2011-08-12 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_tags.php: Fixed false value in foreach
|
||||
|
|
|
@ -113,7 +113,7 @@ if ($create_action) {
|
|||
$field3 = (string) get_parameter ('field3');
|
||||
$group = (string) get_parameter ('group');
|
||||
$action_threshold = (int) get_parameter ('action_threshold');
|
||||
$name_check = db_get_value ('name', 'talert_actions', 'name', $name);
|
||||
$name_check = db_get_value ('name', 'talert_actions', 'name', $name);
|
||||
|
||||
if ($name_check) {
|
||||
$result = '';
|
||||
|
@ -180,10 +180,8 @@ if ($update_action) {
|
|||
$values['field3'] = $field3;
|
||||
$values['id_group'] = $group;
|
||||
$values['action_threshold'] = $action_threshold;
|
||||
$name_check = db_get_value ('name', 'talert_actions', 'name', $name);
|
||||
|
||||
|
||||
if (!$name || $name_check) {
|
||||
if (!$name) {
|
||||
$result = '';
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
|
@ -65,12 +65,8 @@ if (isset ($_GET["update_alert"]) && $_GET["update_alert"] == "-1") {
|
|||
'max_alerts' => $max_alerts,
|
||||
'min_alerts' => $min_alerts,
|
||||
'priority' => $priority);
|
||||
if (!$source_ip || !$oid) {
|
||||
$result = '';
|
||||
}
|
||||
else {
|
||||
|
||||
$result = db_process_sql_insert('talert_snmp', $values);
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
echo '<h3 class="error">'.__('There was a problem creating the alert').'</h3>';
|
||||
|
@ -80,19 +76,13 @@ if (isset ($_GET["update_alert"]) && $_GET["update_alert"] == "-1") {
|
|||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (!$source_ip || !$oid) {
|
||||
$result = '';
|
||||
}
|
||||
else {
|
||||
$sql = sprintf ("UPDATE talert_snmp SET
|
||||
$sql = sprintf ("UPDATE talert_snmp SET
|
||||
priority = %d, id_alert = %d, al_field1 = '%s', al_field2 = '%s', al_field3 = '%s', description = '%s', agent = '%s', custom_oid = '%s',
|
||||
oid = '%s', time_threshold = %d, max_alerts = %d, min_alerts = %d WHERE id_as = %d",
|
||||
$priority, $alert_type, $al_field1, $al_field2, $al_field3, $description, $source_ip, $custom_value,
|
||||
$oid, $time_threshold, $max_alerts, $min_alerts, $id_as);
|
||||
|
||||
$result = db_process_sql ($sql);
|
||||
}
|
||||
$result = db_process_sql ($sql);
|
||||
|
||||
if (!$result) {
|
||||
echo '<h3 class="error">'.__('There was a problem updating the alert').'</h3>';
|
||||
|
@ -210,11 +200,11 @@ if (isset ($_GET["update_alert"])) {
|
|||
|
||||
// Alert fields
|
||||
echo '<tr><td class="datos">'.__('Field #1 (Alias, name)').'</td><td class="datos">';
|
||||
html_print_input_text ("al_field1", $al_field1, '', 30);
|
||||
html_print_input_text ("al_field1", $al_field1, '', 50);
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td class="datos2">'.__('Field #2 (Single Line)').'</td><td class="datos2">';
|
||||
html_print_input_text ("al_field2", $al_field2, '', 30);
|
||||
html_print_input_text ("al_field2", $al_field2, '', 50);
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr><td class="datos" valign="top">'.__('Field #3 (Full Text)').'<td class="datos">';
|
||||
|
|
|
@ -400,6 +400,8 @@ INSERT INTO `talert_actions` VALUES (1,'Mail to XXX',1,'yourmail@domai
|
|||
|
||||
INSERT INTO `talert_actions` VALUES (2,'Restart agent',10,'REFRESH AGENT','','',0,0);
|
||||
|
||||
INSERT INTO `talert_actions` VALUES (3,'Pandora FMS Event',3,'','','',0,0);
|
||||
|
||||
INSERT INTO `talert_templates` VALUES (1,'Critical condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0);
|
||||
|
||||
INSERT INTO `talert_templates` VALUES (2,'Manual alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','','','max_min','',1,0.00,1.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,0,'','',1,0);
|
||||
|
|
Loading…
Reference in New Issue