summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/config.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-10-31 09:06:54 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-10-31 09:06:54 +0000
commitc9e0727ceb4a9299507a189affaff6d04ce5c3a5 (patch)
tree792fd7e8abe212494a3a95ea4dece24694c8cecf /frontends/php/include/config.inc.php
parent3eea91a6fdd3ae1c667e25de6ffdf5546774f915 (diff)
- added availability of template triggers changing directly on host (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3417 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r--frontends/php/include/config.inc.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 75ce2fb2..c0bc4a70 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -694,6 +694,8 @@ else
// Does expression match server:key.function(param) ?
function validate_simple_expression($expression)
{
+ global $ZBX_CURNODEID;
+
// echo "Validating simple:$expression<br>";
// Before str()
// if (eregi('^\{([0-9a-zA-Z[.-.]\_\.]+)\:([]\[0-9a-zA-Z\_\/\.\,]+)\.((diff)|(min)|(max)|(last)|(prev))\(([0-9\.]+)\)\}$', $expression, $arr))
@@ -712,14 +714,20 @@ else
//SDI($parameter);
$sql="select count(*) as cnt from hosts h,items i where h.host=".zbx_dbstr($host).
- " and i.key_=".zbx_dbstr($key)." and h.hostid=i.hostid";
+ " and i.key_=".zbx_dbstr($key)." and h.hostid=i.hostid ".
+ " and ".DBid2nodeid('h.hostid').'='.$ZBX_CURNODEID;
//SDI($sql);
$row=DBfetch(DBselect($sql));
- if($row["cnt"]!=1)
+ if($row["cnt"]==0)
{
error("No such host ($host) or monitored parameter ($key)");
return -1;
}
+ elseif($row["cnt"]!=1)
+ {
+ error("Too many hosts ($host) with parameter ($key)");
+ return -1;
+ }
if( ($function!="last")&&
($function!="diff")&&