".S_NO_PERMISSIONS.""); show_footer(); exit; } ?> "; $h2=$h2."".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."".$row["name"]; } } $h2=$h2.""; $h2=$h2." ".S_HOST." "; $h2=$h2.""; $h2=$h2."".S_SELECT_HOST_DOT_DOT_DOT; if(isset($_GET["groupid"])) { $sql="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=".$_GET["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host"; } else { $sql="select h.hostid,h.host from hosts h,items i where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid group by h.hostid,h.host order by h.host"; } $result=DBselect($sql); while($row=DBfetch($result)) { if(!check_right("Host","R",$row["hostid"])) { continue; } $h2=$h2."".$row["host"]; } $h2=$h2.""; show_header2($h1, $h2, "", ""); ?> "; $result=DBselect("select host from hosts where hostid=".$_GET["hostid"]); $row=DBfetch($result); show_table_header($row["host"]); $result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.status=0 and t.triggerid=f.triggerid and h.hostid=".$_GET["hostid"]." and h.status=".HOST_STATUS_MONITORED." and i.status=0 order by h.host, t.description"); table_begin(); table_header(array(S_DESCRIPTION,S_TRUE,S_FALSE,S_UNKNOWN,S_GRAPH)); $col=0; while($row=DBfetch($result)) { if(!check_right_on_trigger("R",$row["triggerid"])) { continue; } $lasthost=$row["host"]; $description=expand_trigger_description($row["triggerid"]); $description="$description"; $availability=calculate_availability($row["triggerid"],0,0); $true=array("value"=>sprintf("%.4f%%",$availability["true"]), "class"=>"on"); $false=array("value"=>sprintf("%.4f%%",$availability["false"]), "class"=>"off"); $unknown=array("value"=>sprintf("%.4f%%",$availability["unknown"]), "class"=>"unknown"); $actions="".S_SHOW.""; table_row(array( $description, $true, $false, $unknown, $actions ),$col++); } table_end(); } ?> "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } ?>