array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), "hostid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL) ); check_fields($fields); validate_group(PERM_READ_ONLY, array("allow_all_hosts","always_select_first_host","monitored_hosts","with_items")); ?> AddItem(0,S_ALL_SMALL); $availiable_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_LIST, null, null, $ZBX_CURNODEID); $result=DBselect("select distinct g.groupid,g.name from groups g, hosts_groups hg, hosts h, items i ". " where h.hostid in (".$availiable_hosts.") ". " and hg.groupid=g.groupid and h.status=".HOST_STATUS_MONITORED. " and h.hostid=i.hostid and hg.hostid=h.hostid ". " order by g.name"); while($row=DBfetch($result)) { $cmbGroup->AddItem($row["groupid"],$row["name"]); } $r_form->AddItem(array(S_GROUP.SPACE,$cmbGroup)); show_table_header(S_HOST_PROFILES_BIG, $r_form); ?> setHeader(array(S_HOST,S_NAME,S_OS,S_SERIALNO,S_TAG,S_MACADDRESS)); if($_REQUEST["groupid"] > 0) { $sql="select h.hostid,h.host,p.name,p.os,p.serialno,p.tag,p.macaddress". " from hosts h,hosts_profiles p,hosts_groups hg where h.hostid=p.hostid". " and h.hostid=hg.hostid and hg.groupid=".$_REQUEST["groupid"]. " and h.hostid in (".$availiable_hosts.") ". " order by h.host"; } else { $sql="select h.hostid,h.host,p.name,p.os,p.serialno,p.tag,p.macaddress". " from hosts h,hosts_profiles p where h.hostid=p.hostid". " and h.hostid in (".$availiable_hosts.") ". " order by h.host"; } $result=DBselect($sql); while($row=DBfetch($result)) { $table->AddRow(array( new CLink($row["host"],"?hostid=".$row["hostid"].url_param("groupid"),"action"), $row["name"], $row["os"], $row["serialno"], $row["tag"], $row["macaddress"] )); } $table->show(); } ?>