array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, BETWEEN(0,65535), NULL), "hostid"=> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, BETWEEN(0,65535), NULL), "start"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535)."({}%100==0)", NULL), "next"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "prev"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL) ); $_REQUEST["hostid"]=@iif(isset($_REQUEST["hostid"]),$_REQUEST["hostid"],get_profile("web.latest.hostid",0)); update_profile("web.latest.hostid",$_REQUEST["hostid"]); update_profile("web.menu.view.last",$page["file"]); 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." "; if(isset($_REQUEST["start"])) { $h2=$h2.""; $h2=$h2.""; } else { $h2=$h2.""; } $h2=$h2.">\">"; show_header2($h1,$h2,"
"); ?> setHeader(array(S_TIME, S_DESCRIPTION, S_VALUE, S_SEVERITY)); $col=0; $skip=$_REQUEST["start"]; while(($row=DBfetch($result))&&($col<100)) { if(!check_right_on_trigger("R",$row["triggerid"])) { continue; } if($skip > 0) { $skip--; continue; } $description=expand_trigger_description($row["triggerid"]); $description="$description"; if($row["value"] == 0) { $value=new CCol(S_OFF,"off"); } elseif($row["value"] == 1) { $value=new CCol(S_ON,"on"); } else { $value=new CCol(S_UNKNOWN_BIG,"unknown"); } if($row["priority"]==0) $priority=S_NOT_CLASSIFIED; elseif($row["priority"]==1) $priority=S_INFORMATION; elseif($row["priority"]==2) $priority=S_WARNING; elseif($row["priority"]==3) $priority=array("value"=>S_AVERAGE,"class"=>"average"); elseif($row["priority"]==4) $priority=array("value"=>S_HIGH,"class"=>"high"); elseif($row["priority"]==5) $priority=array("value"=>S_DISASTER,"class"=>"disaster"); else $priority=$row["priority"]; $table->addRow(array( date("Y.M.d H:i:s",$row["clock"]), $description, $value, $priority)); $col++; } $table->show(); ?>