From c606a0bad1b26b76bf7a061c329afbc49ff1cd97 Mon Sep 17 00:00:00 2001 From: artem Date: Mon, 31 Mar 2008 11:17:54 +0000 Subject: - improvements to services calculation algorithms (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5564 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/items.inc.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'frontends/php/include/items.inc.php') diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index 934e4cd9..85901a41 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -919,14 +919,16 @@ COpt::profiling_start('prepare data'); // A little tricky check for attempt to overwrite active trigger (value=1) with // inactive or active trigger with lower priority. - $val = 0; - - if (array_key_exists($descr, $items) && array_key_exists($row['host'], $items[$descr])){ - $prio = $items[$descr][$row['host']]['severity']; - $val = $items[$descr][$row['host']]['tr_value']; - } - - if((TRIGGER_VALUE_FALSE == $val) || ((TRIGGER_VALUE_TRUE == $row['tr_value']) && ($prio<$row['priority']))){ + if (!isset($items[$descr][$row['host']]) || + ( + (($items[$descr][$row['host']]['tr_value'] == TRIGGER_VALUE_FALSE) && ($row['tr_value'] == TRIGGER_VALUE_TRUE)) || + ( + (($items[$descr][$row['host']]['tr_value'] == TRIGGER_VALUE_FALSE) || ($row['tr_value'] == TRIGGER_VALUE_TRUE)) && + ($row['priority'] > $items[$descr][$row['host']]['severity']) + ) + ) + ) + { $items[$descr][$row['host']] = array( 'itemid' => $row['itemid'], 'value_type'=> $row['value_type'], -- cgit