".S_NO_PERMISSIONS.""); show_page_footer(); exit; } ?> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID, NULL), "hostid"=> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID, NULL), "triggerid"=> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID, NULL) ); check_fields($fields); ?> "; $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.""; show_header2($h1, $h2, "
"); ?> "; $result=DBselect("select host from hosts where hostid=".$_REQUEST["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=".$_REQUEST["hostid"]." and h.status=".HOST_STATUS_MONITORED." and i.status=0 order by h.host, t.description"); $table = new CTableInfo(); $table->setHeader(array(S_NAME,S_TRUE,S_FALSE,S_UNKNOWN,S_GRAPH)); 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=new CSpan(sprintf("%.4f%%",$availability["true"]), "on"); $false=new CSpan(sprintf("%.4f%%",$availability["false"]), "off"); $unknown=new CSpan(sprintf("%.4f%%",$availability["unknown"]), "unknown"); $actions="".S_SHOW.""; $table->addRow(array( $description, $true, $false, $unknown, $actions )); } $table->show(); } ?> "; echo "