summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/hosts.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-12-30 11:36:15 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-12-30 11:36:15 +0000
commitac9c6ecc360df3e9347194fbb2924b2bf68954f4 (patch)
treea0f29bb7e8d470b6576adc7248e97cc91ea9da6b /frontends/php/include/hosts.inc.php
parentd5dce47a8b216a4db6ba2d075edd0e2de7556b6a (diff)
- added Graphs synchronization for linked hosts (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2458 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
-rw-r--r--frontends/php/include/hosts.inc.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index b215715f..8e268a83 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -188,19 +188,28 @@
return DBexecute($sql);
}
- function get_host_by_hostid($hostid)
+ function get_host_by_itemid($itemid)
{
- $sql="select * from hosts where hostid=$hostid";
+ $sql="select h.* from hosts h, items i where i.hostid=h.hostid and i.itemid=$itemid";
$result=DBselect($sql);
if(DBnum_rows($result) == 1)
{
return DBfetch($result);
}
- else
+ error("No host with itemid=[$itemid]");
+ return FALSE;
+ }
+
+ function get_host_by_hostid($hostid)
+ {
+ $sql="select * from hosts where hostid=$hostid";
+ $result=DBselect($sql);
+ if(DBnum_rows($result) == 1)
{
- error("No host with hostid=[$hostid]");
+ return DBfetch($result);
}
- return $host;
+ error("No host with hostid=[$hostid]");
+ return FALSE;
}
# Update Host status