".S_NO_PERMISSIONS.""); show_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,hosts_groups hg where hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid and h.status<>".HOST_STATUS_DELETED." group by h.hostid,h.host order by h.host"); $cnt=0; while($row2=DBfetch($result2)) { if(!check_right("Host","U",$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, "
", "
"); ?> "; echo ""; $result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.status,t.value,t.priority,t.error from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.triggerid=f.triggerid and h.hostid=".$_REQUEST["hostid"]." order by h.host,t.description"); $col=0; while($row=DBfetch($result)) { if(check_right_on_trigger("R",$row["triggerid"]) == 0) { continue; } $description=expand_trigger_description($row["triggerid"]); $id=" ".$row["triggerid"]; $sql="select t.triggerid,t.description from triggers t,trigger_depends d where t.triggerid=d.triggerid_up and d.triggerid_down=".$row["triggerid"]; $result1=DBselect($sql); if(DBnum_rows($result1)>0) { $description=$description."

".S_DEPENDS_ON."
"; for($i=0;$i"; } $description=$description."

"; } 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"]; if($row["status"] == 1) { $status="".S_DISABLED.""; } else if($row["status"] == 2) { $status="".S_UNKNOWN.""; } else { $status="".S_ENABLED.""; } // $expression=rawurlencode($row["expression"]); if($row["error"]=="") { $row["error"]=" "; } if(isset($_REQUEST["hostid"])) { $actions="".S_CHANGE.""; } else { $actions="".S_CHANGE.""; } $actions=$actions." :: "; if(get_action_count_by_triggerid($row["triggerid"])>0) { $actions=$actions."Actions"; } else { $actions=$actions."".S_ACTIONS.""; } table_row(array( $id, $description, explode_exp($row["expression"],1), $priority, $status, $row["error"], $actions ),$col++); } table_end(); show_form_begin(); echo ""; echo ""; echo ""; show_table2_header_end(); echo ""; } ?> 0) { echo ""; @insert_trigger_form($_REQUEST["hostid"],$_REQUEST["triggerid"]); } ?>