".S_NO_PERMISSIONS.""); show_page_footer(); exit; } ?> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535), NULL), "hostid"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535), NULL), "select"=> array(T_ZBX_STR, O_OPT, NULL, NULL, NULL) ); // check_fields($fields); ?> ".S_NO_PERMISSIONS.""); show_page_footer(); exit; } ?> "; $h2=$h2.form_select("groupid",0,S_ALL_SMALL); $result=DBselect("select groupid,name from groups order by name"); while($row=DBfetch($result)) { // Check if at least one host with read permission exists for this group $result2=DBselect("select 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=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host"); $cnt=0; while($row2=DBfetch($result2)) { if(!check_right("Host","R",$row2["hostid"])) { continue; } $cnt=1; break; } if($cnt!=0) { $h2=$h2.form_select("groupid",$row["groupid"],$row["name"]); } } $h2=$h2.""; $h2=$h2." ".S_HOST." "; $h2=$h2.""; $h2=$h2.nbsp(" "); if(isset($_REQUEST["select"])&&($_REQUEST["select"]=="")) { unset($_REQUEST["select"]); } // $h2=$h2.S_SELECT; // $h2=$h2.nbsp(" "); if(isset($_REQUEST["select"])) { $h2=$h2.""; } else { $h2=$h2.""; } $h2=$h2.nbsp(" "); $h2=$h2.""; show_header2($h1, $h2, "
"); ?> "; if(!isset($_REQUEST["select"])||($_REQUEST["select"] == "")) { $result=get_host_by_hostid($_REQUEST["hostid"]); $host=$result["host"]; // show_table_header("$host"); } else { // show_table_header("Description is like *".$_REQUEST["select"]."*"); } # show_table_header_begin(); # echo "$host"; # show_table3_v_delimiter(); table_begin(); $header=array(); if(isset($_REQUEST["select"])) { $header=array_merge($header,array(S_HOST)); } $header=array_merge($header,array(S_DESCRIPTION, S_LAST_CHECK, S_LAST_VALUE,S_CHANGE,S_HISTORY)); table_header($header); $col=0; if(isset($_REQUEST["select"])) $sql="select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier,i.key_ from items i,hosts h where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 and i.description like '%".zbx_ads($_REQUEST["select"])."%' order by i.description"; else $sql="select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier,i.key_ from items i,hosts h where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=0 and h.hostid=".$_REQUEST["hostid"]." order by i.description"; $result=DBselect($sql); while($row=DBfetch($result)) { if(!check_right("Item","R",$row["itemid"])) { continue; } if(!check_right("Host","R",$row["hostid"])) { continue; } iif_echo($col++%2 == 1, "