=$old[0])) { // DISASTER if(($new[0]-$old[0])/pow(10,5)>=1) { $audio="disaster_on.wav"; } else { $audio="warning_on.wav"; } } // echo "$tr_hash
$triggers_hash
".$old[1]."
".$new[1]; ?> No permissions !"); show_footer(); exit; } if(isset($HTTP_GET_VARS["hostid"])&&!check_right("Host","R",$HTTP_GET_VARS["hostid"])) { show_table_header("No permissions !"); show_footer(); exit; } ?> "; } ?> all "; } else { echo "[all] "; } while($row=DBfetch($result)) { if(!check_right("Host","R",$row["hostid"])) { continue; } if(isset($HTTP_GET_VARS["hostid"]) && ($row["hostid"] == $HTTP_GET_VARS["hostid"])) { echo "[".$row["host"]."] "; } else { echo "".$row["host"]." "; } } show_table_v_delimiter(); ?> Show only true] "; } else { echo "[Show all triggers] "; } if($noactions!='true') { echo "[Hide Actions] "; } else { echo "[Show Actions] "; } if($compact!='true') { echo "[Hide Details] "; } else { echo "[Show Details] "; } if($select!='true') { echo "[Select] "; } else { echo "[Hide Select] "; show_table_v_delimiter(); echo "
"; } show_table_header_end(); echo "
"; } $time=date("[H:i:s]",time()); if(isset($HTTP_GET_VARS["fullscreen"])) { show_table_header("TRIGGERS $time"); $cond=""; if(isset($HTTP_GET_VARS["hostid"])) { $cond=" and h.hostid=".$HTTP_GET_VARS["hostid"]." "; } if($onlytrue=='true') { $sql="select t.priority,count(*) from triggers t,hosts h,items i,functions f where t.value=1 and t.status=0 and f.itemid=i.itemid and h.hostid=i.hostid and h.status in (0,2) and t.triggerid=f.triggerid and t.description $select_cond and i.status=0 $cond group by 1"; } else { $sql="select t.priority,count(*) 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 t.status=0 and h.status in (0,2) and t.description $select_cond and i.status=0 $cond group by 1"; } $result=DBselect($sql); $p0=$p1=$p2=$p3=$p4=$p5=0; for($i=0;$i"; echo ""; echo "Not classified: $p0"; echo "Information: $p1"; echo "Warning: $p2"; echo "Average: $p3"; echo "High: $p4"; echo "Disaster: $p5"; echo ""; echo ""; } else { show_table_header("TRIGGERS $time"); } echo ""; echo ""; if(isset($HTTP_GET_VARS["fullscreen"])) { $fullscreen="&fullscreen=1"; } else { $fullscreen=""; } if(isset($sort) && $sort=="description") { echo ""; echo ""; if(!isset($sort)||(isset($sort) && $sort=="priority")) { echo ""; } else { if($select=="TRUE") { echo ""; if($noactions!='true') { echo ""; } echo ""; echo "\n"; if(isset($HTTP_GET_VARS["hostid"])) { $cond=" and h.hostid=".$HTTP_GET_VARS["hostid"]." "; } else { $cond=""; } if(!isset($sort)) { $sort="priority"; } switch ($sort) { case "description": $sort="order by t.description"; break; case "priority": $sort="order by t.priority desc, t.description"; break; case "lastchange": $sort="order by t.lastchange desc, t.priority"; break; default: $sort="order by t.priority desc, t.description"; } if($onlytrue=='true') { $result=DBselect("select distinct t.triggerid,t.status,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url,t.value from triggers t,hosts h,items i,functions f where t.value=1 and t.status=0 and f.itemid=i.itemid and h.hostid=i.hostid and t.description $select_cond and t.triggerid=f.triggerid and i.status in (0,2) and h.status in (0,2) $cond $sort"); } else { $result=DBselect("select distinct t.triggerid,t.status,t.description,t.expression,t.priority,t.lastchange,t.comments,t.url,t.value 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 t.status=0 and t.description $select_cond and i.status in (0,2) and h.status in (0,2) $cond $sort"); } $col=0; while($row=DBfetch($result)) { if(!check_right_on_trigger("R",$row["triggerid"])) { continue; } // Check for dependencies $sql="select count(*) from trigger_depends d, triggers t where d.triggerid_down=".$row["triggerid"]." and d.triggerid_up=t.triggerid and t.value=1"; $result2=DBselect($sql); if(DBget_field($result2,0,0)>0) { continue; } if($col++%2 == 1) { echo ""; } else { echo ""; } echo ""; if( (time(NULL)-$row["lastchange"])<300) { $blink1=""; $blink2=""; } else { $blink1=""; $blink2=""; } if($row["value"]==0) { echo "";} else if($row["value"]==2) { echo ""; } else { echo ""; } if($row["priority"]==0) echo ""; elseif($row["priority"]==1) echo ""; elseif($row["priority"]==2) echo ""; elseif($row["priority"]==3) echo ""; elseif($row["priority"]==4) echo ""; elseif($row["priority"]==5) echo ""; else echo ""; echo ""; if($noactions!='true') { echo ""; } if($row["comments"] != "") { echo ""; } else { echo ""; } if($row["value"] == 0) echo "\n"; cr(); } echo "
DESCRIPTION"; } else { if($select=="TRUE") { echo "Description"; } else { echo "Description"; } } if($compact!='true') {echo "
Expression
";} echo "
StatusSEVERITYSeverity"; } else { echo "Severity"; } } if($noactions=='true') echo ""; else echo ""; if(isset($sort) && $sort=="lastchange") { echo "LAST CHANGE"; } else { if($select=="TRUE") { echo "Last change"; } else { echo "Last change"; } } echo "ActionsComments
"; // $description=$row["description"]; // if( strstr($description,"%s")) // { $description=expand_trigger_description($row["triggerid"]); // } if($row["url"] == "") { echo $description; } else { echo "$description"; } if($compact!='true') { echo "
".explode_exp($row["expression"],1).""; } echo "
$blink1FALSE$blink2$blink1UNKNOWN$blink2$blink1TRUE$blink2Not classifiedInformationWarningAverageHighDisaster !!!".$row["priority"]."".date("d M H:i:s",$row["lastchange"]).""; echo ""; echo "Show actions - "; echo "History - "; if(isset($HTTP_GET_VARS["hostid"])) { echo "Change"; } else { echo "Change"; } echo "ShowAdd
"; show_table_header("Total:$col"); ?>