No permissions !"); show_footer(); exit; } ?> [Success for '$hosts_ok']
[Failed for '$hosts_notok'","Cannot add item"); unset($HTTP_GET_VARS["itemid"]); } if($HTTP_GET_VARS["register"]=="delete") { $result=delete_item($HTTP_GET_VARS["itemid"]); show_messages($result,"Item deleted","Cannot delete item"); unset($itemid); } if($HTTP_GET_VARS["register"]=="Delete selected") { $result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]); while($row=DBfetch($result)) { // $$ is correct here if(isset($HTTP_GET_VARS[$row["itemid"]])) { $result2=delete_item($row["itemid"]); } } show_messages(TRUE,"Items deleted","Cannot delete items"); } if($HTTP_GET_VARS["register"]=="Activate selected") { $result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]); while($row=DBfetch($result)) { // $$ is correct here if(isset($HTTP_GET_VARS[$row["itemid"]])) { $result2=activate_item($row["itemid"]); } } show_messages(TRUE,"Items activated","Cannot activate items"); } if($HTTP_GET_VARS["register"]=="Disable selected") { $result=DBselect("select itemid from items where hostid=".$HTTP_GET_VARS["hostid"]); while($row=DBfetch($result)) { // $$ is correct here if(isset($HTTP_GET_VARS[$row["itemid"]])) { $result2=disable_item($row["itemid"]); } } show_messages(TRUE,"Items disabled","Cannot disable items"); } } ?> "; if(isset($HTTP_GET_VARS["groupid"])) { // echo "all "; echo "all "; } else { echo "[all] "; } $result=DBselect("select groupid,name from groups order by name"); while($row=DBfetch($result)) { // if(!check_right("Host","R",$row["hostid"])) // { // continue; // } if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) ) { echo "["; } echo "".$row["name"].""; if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) ) { echo "]"; } echo " "; } ?> ["; } if(isset($HTTP_GET_VARS["groupid"])) { echo "".$row["host"].""; } else { echo "".$row["host"].""; } if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"])) { echo "]"; } echo " "; } show_table_header_end(); $lasthost=""; if(isset($HTTP_GET_VARS["hostid"])&&!isset($HTTP_GET_VARS["type"])) { $result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.lastdelete,i.nextcheck,h.hostid,i.type from hosts h,items i where h.hostid=i.hostid and h.hostid=".$HTTP_GET_VARS["hostid"]." order by h.host,i.key_,i.description"); $col=0; while($row=DBfetch($result)) { if(!check_right("Item","R",$row["itemid"])) { continue; } if($lasthost != $row["host"]) { if($lasthost != "") { echo "
"; } echo "
"; show_table_header("".$row["host"].""); echo "
"; echo ""; echo ""; echo ""; // echo ""; echo ""; // echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } $lasthost=$row["host"]; if($col++%2 == 1) { echo ""; } else { echo ""; } echo ""; // echo ""; // echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if(check_right("Item","U",$row["itemid"])) { echo ""; } else { echo ""; } echo ""; } echo "
SelIdHostKeyDescriptionUpdate intervalHistoryShortnameTypeStatusActions
".$row["itemid"]."".$row["itemid"]."".$row["host"]."".$row["key_"]."".$row["description"]."".$row["delay"]."".$row["history"]."".$row["host"].":".$row["key_"].""; switch($row["type"]) { case 0: echo "Zabbix agent"; break; case 1: echo "SNMPv1 agent"; break; case 2: echo "Zabbix trapper"; break; case 3: echo "Simple check"; break; case 4: echo "SNMPv2 agent"; break; case 5: echo "Zabbix internal"; break; default: echo "Unknown"; break; } echo ""; # if(isset($HTTP_GET_VARS["hostid"])) # { switch($row["status"]) { case 0: echo "Active"; break; case 1: echo "Not active"; break; # case 2: # echo "Trapper"; # break; case 3: echo "Not supported"; break; default: echo "$status Unknown"; } # } # else # { # switch($row["status"]) # { # case 0: # echo "Active"; # break; # case 1: # echo "Not active"; # break; # case 2: # echo "Trapper"; # break; # case 3: # echo "Not supported"; # break; # default: # echo "$status Unknown"; # } # } echo "ChangeChange
"; show_table2_header_begin(); echo ""; echo ""; echo ""; show_table2_header_end(); echo "
"; } else { // echo "
Select Host
"; } ?> 0) { echo ""; insert_item_form(); } ?>