summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/items.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-31 11:17:54 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-03-31 11:17:54 +0000
commitc606a0bad1b26b76bf7a061c329afbc49ff1cd97 (patch)
tree70ea31e3c754d9a91d531befd4ebd974c72abf63 /frontends/php/include/items.inc.php
parented68e5fe0c92a2a620df0116f28c6ef7ceea8df4 (diff)
downloadzabbix-c606a0bad1b26b76bf7a061c329afbc49ff1cd97.tar.gz
zabbix-c606a0bad1b26b76bf7a061c329afbc49ff1cd97.tar.xz
zabbix-c606a0bad1b26b76bf7a061c329afbc49ff1cd97.zip
- improvements to services calculation algorithms (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5564 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/items.inc.php')
-rw-r--r--frontends/php/include/items.inc.php18
1 files changed, 10 insertions, 8 deletions
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'],