summaryrefslogtreecommitdiffstats
path: root/frontends/php/latest.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-13 08:22:32 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-13 08:22:32 +0000
commitabaab90a1c9d3367f1ef636557cfe8e661716749 (patch)
tree3e266e5523a635c45a7e7ef6d4571e7323f26065 /frontends/php/latest.php
parent8901654871973b4267f106a97183001189189c82 (diff)
downloadzabbix-abaab90a1c9d3367f1ef636557cfe8e661716749.tar.gz
zabbix-abaab90a1c9d3367f1ef636557cfe8e661716749.tar.xz
zabbix-abaab90a1c9d3367f1ef636557cfe8e661716749.zip
- merger rev. 4546:4547 of branches/1.4.j [developed data monitoring of multiple nodes]
git-svn-id: svn://svn.zabbix.com/trunk@4549 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/latest.php')
-rw-r--r--frontends/php/latest.php34
1 files changed, 25 insertions, 9 deletions
diff --git a/frontends/php/latest.php b/frontends/php/latest.php
index e63206ed..2fe3b066 100644
--- a/frontends/php/latest.php
+++ b/frontends/php/latest.php
@@ -102,8 +102,8 @@ include_once "include/page_header.php";
$cmbGroup->AddItem(0,S_ALL_SMALL);
- $availiable_groups= get_accessible_groups_by_user($USER_DETAILS,PERM_READ_LIST, null, null, $ZBX_CURNODEID);
- $availiable_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_LIST, null, null, $ZBX_CURNODEID);
+ $availiable_groups= get_accessible_groups_by_user($USER_DETAILS,PERM_READ_LIST, null, null, get_current_nodeid());
+ $availiable_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_LIST, null, null, get_current_nodeid());
$result=DBselect("select distinct g.groupid,g.name from groups g, hosts_groups hg, hosts h, items i ".
" where g.groupid in (".$availiable_groups.") ".
@@ -112,13 +112,16 @@ include_once "include/page_header.php";
" order by g.name");
while($row=DBfetch($result))
{
- $cmbGroup->AddItem($row["groupid"],$row["name"]);
+ $cmbGroup->AddItem(
+ $row['groupid'],
+ get_node_name_by_elid($row['groupid']).$row['name']
+ );
}
$r_form->AddItem(array(S_GROUP.SPACE,$cmbGroup));
if($_REQUEST["groupid"] > 0)
{
- $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED.
+ $sql="select distinct h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status=".HOST_STATUS_MONITORED.
" and h.hostid=i.hostid and hg.groupid=".$_REQUEST["groupid"]." and hg.hostid=h.hostid".
" and i.status=".ITEM_STATUS_ACTIVE.
" and h.hostid in (".$availiable_hosts.") ".
@@ -127,7 +130,7 @@ include_once "include/page_header.php";
else
{
$cmbHosts->AddItem(0,S_ALL_SMALL);
- $sql="select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED.
+ $sql="select distinct h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED.
" and i.status=".ITEM_STATUS_ACTIVE." and h.hostid=i.hostid".
" and h.hostid in (".$availiable_hosts.") ".
" group by h.hostid,h.host order by h.host";
@@ -135,7 +138,10 @@ include_once "include/page_header.php";
$result=DBselect($sql);
while($row=DBfetch($result))
{
- $cmbHosts->AddItem($row["hostid"],$row["host"]);
+ $cmbHosts->AddItem(
+ $row['hostid'],
+ get_node_name_by_elid($row['hostid']).$row["host"]
+ );
}
$r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts));
@@ -165,6 +171,7 @@ include_once "include/page_header.php";
$table=new CTableInfo();
$table->SetHeader(array(
+ is_show_subnodes() ? S_NODE : null,
$_REQUEST["hostid"] ==0 ? S_HOST : NULL,
($link->ToString()).SPACE.S_DESCRIPTION,
S_LAST_CHECK,S_LAST_VALUE,S_CHANGE,S_HISTORY));
@@ -230,8 +237,8 @@ include_once "include/page_header.php";
{
$actions=new CLink(S_HISTORY,"history.php?action=showvalues&period=3600&itemid=".$db_item["itemid"],"action");
}
-
array_push($app_rows, new CRow(array(
+ is_show_subnodes() ? SPACE : null,
$_REQUEST["hostid"] > 0 ? NULL : SPACE,
str_repeat(SPACE,6).$description,
$lastclock,
@@ -257,7 +264,11 @@ include_once "include/page_header.php";
SPACE."(".$item_cnt.SPACE.S_ITEMS.")"));
$col->SetColSpan(5);
- $table->ShowRow(array($_REQUEST["hostid"] > 0 ? NULL : $db_app["host"], $col));
+ $table->ShowRow(array(
+ get_node_name_by_elid($db_app['hostid']),
+ $_REQUEST["hostid"] > 0 ? NULL : $db_app["host"],
+ $col
+ ));
$any_app_exist = true;
@@ -316,6 +327,7 @@ include_once "include/page_header.php";
}
array_push($app_rows, new CRow(array(
+ is_show_subnodes() ? SPACE : null,
$_REQUEST["hostid"] > 0 ? NULL : $db_item["host"],
str_repeat(SPACE, ($any_app_exist ? 6 : 0)).$description,
$lastclock,
@@ -344,7 +356,11 @@ include_once "include/page_header.php";
SPACE."(".$item_cnt.SPACE.S_ITEMS.")"));
$col->SetColSpan(5);
- $table->ShowRow(array($_REQUEST["hostid"] > 0 ? NULL : SPACE, $col));
+ $table->ShowRow(array(
+ is_show_subnodes() ? SPACE : null,
+ $_REQUEST["hostid"] > 0 ? NULL : SPACE,
+ $col
+ ));
}
foreach($app_rows as $row)
$table->ShowRow($row);