2010-01-25 Sancho Lerena <slerena@artica.es>

* include/functions.php: Fixed problem in show_event_type() function
	who mades events.php to do a invalid filtering by event status.

	* operation/events/events_rss.php: Added optional (commented code)
	support for filtering RSS request by the API ACL. need to implement a switch
	in the config array to use here ACLs or not.

	* operation/events/events.php: Fixed problem filterings events by status 
	(warning, critical, normal and not-normal).




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2306 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2010-01-25 19:47:38 +00:00
parent c319ce5234
commit 58e1dab4c7
4 changed files with 47 additions and 9 deletions

View File

@ -1,3 +1,16 @@
2010-01-25 Sancho Lerena <slerena@artica.es>
* include/functions.php: Fixed problem in show_event_type() function
who mades events.php to do a invalid filtering by event status.
* operation/events/events_rss.php: Added optional (commented code)
support for filtering RSS request by the API ACL. need to implement a switch
in the config array to use here ACLs or not.
* operation/events/events.php: Fixed problem filterings events by status
(warning, critical, normal and not-normal).
2010-01-25 Pablo de la Concepción <pablo.concepcion@artica.es>
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Added group column to control

View File

@ -720,8 +720,11 @@ function is_module_data_string ($module_name) {
function get_event_types () {
$types = array ();
$types['unknown'] = __('Unknown');
$types['monitor_up'] = __('Monitor up');
$types['monitor_down'] = __('Monitor down');
$types['critical'] = __('Monitor Critical');
$types['warning'] = __('Monitor Warning');
$types['normal'] = __('Monitor Normal');
$types['alert_fired'] = __('Alert fired');
$types['alert_recovered'] = __('Alert recovered');
$types['alert_ceased'] = __('Alert ceased');

View File

@ -174,8 +174,20 @@ if ($status == 1) {
if ($search != "")
$sql_post .= " AND evento LIKE '%".$search."%'";
if ($event_type != "")
$sql_post .= " AND event_type = '".$event_type."'";
if ($event_type != ""){
// If normal, warning, could be several (going_up_warning, going_down_warning... too complex
// for the user so for him is presented only "warning, critical and normal"
if ($event_type == "warning" || $event_type == "critical" || $event_type == "normal"){
$sql_post .= " AND event_type LIKE '%$event_type%' ";
}
elseif ($event_type == "not_normal"){
$sql_post .= " AND event_type LIKE '%warning%' OR LIKE '%critical%' ";
}
else
$sql_post .= " AND event_type = '".$event_type."'";
}
if ($severity != -1)
$sql_post .= " AND criticity >= ".$severity;
if ($id_agent != -1)
@ -238,6 +250,9 @@ echo "</td>";
// Event type
echo "<td>".__('Event type')."</td><td>";
print_select (get_event_types (), 'event_type', $event_type, '', __('All'), '');
// Expand standard array to add not_normal (not exist in the array, used only for searches)
$event_type["not_normal"] = __("Not normal");
echo "</td></tr><tr>";
// Severity

View File

@ -13,16 +13,23 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
ini_set ('display_errors', 0); //Don't display other errors, messes up XML
header("Content-Type: application/xml; charset=UTF-8"); //Send header before starting to output
require_once "../../include/config.php";
require_once "../../include/functions.php";
require_once "../../include/functions_db.php";
require_once "../../include/functions_api.php";
$ipOrigin = $_SERVER['REMOTE_ADDR'];
// Uncoment this to activate ACL on RSS Events
/*
if (!isInACL($ipOrigin)) {
exit;
}
*/
header("Content-Type: application/xml; charset=UTF-8"); //Send header before starting to output
function rss_error_handler ($errno, $errstr, $errfile, $errline) {
global $config;