No permissions !"); show_footer(); exit; } ?> "; echo "Id"; echo "Name"; echo "Actions"; echo ""; $result=DBselect("select groupid,name from groups order by name"); $col=0; while($row=DBfetch($result)) { // if(!check_right("User group","R",$row["usrgrpid"])) // { // continue; // } if($col++%2==0) { echo ""; } echo "".$row["groupid"].""; echo "".$row["name"].""; echo ""; echo "Change"; echo ""; echo ""; } if(DBnum_rows($result)==0) { echo ""; echo "-No host groups defined-"; echo ""; } echo ""; 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 " "; } show_table_header_end(); echo "
"; ?> "; echo ""; echo "Id"; echo "Host"; echo "Port"; echo "Status"; echo "Actions"; echo ""; if(isset($HTTP_GET_VARS["groupid"])) { $sql="select h.hostid,h.host,h.port,h.status from hosts h,hosts_groups hg where hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid order by h.host"; } else { $sql="select h.hostid,h.host,h.port,h.status from hosts h order by h.host"; } $result=DBselect($sql); $col=0; while($row=DBfetch($result)) { if(!check_right("Host","R",$row["hostid"])) { continue; } if($col++%2==0) { echo ""; } else { echo ""; } echo "".$row["hostid"].""; echo "".$row["host"].""; echo "".$row["port"].""; echo ""; if(check_right("Host","U",$row["hostid"])) { if($row["status"] == 0) echo "Monitored"; else if($row["status"] == 1) echo "Not monitored"; else if($row["status"] == 2) echo "Unreachable"; else if($row["status"] == 3) echo "Template"; else if($row["status"] == HOST_STATUS_DELETED) echo "Deleted"; else echo "Unknown"; } else { if($row["status"] == 0) echo "Monitored"; else if($row["status"] == 1) echo "Not monitored"; else if($row["status"] == 2) echo "Unreachable"; else if($row["status"] == 3) echo "Template"; else if($row["status"] == HOST_STATUS_DELETED) echo "Deleted"; else echo "Unknown"; } echo ""; if(check_right("Host","U",$row["hostid"])) { if($row["status"] != HOST_STATUS_DELETED) { if(isset($HTTP_GET_VARS["groupid"])) { echo "Change"; } else { echo "Change"; } } else { echo " "; } } else { echo "Change"; } echo ""; } if(DBnum_rows($result)==0) { echo ""; echo "-No hosts defined-"; echo ""; } echo ""; } ?> "; insert_hostgroups_form($HTTP_GET_VARS["groupid"]); ?> "; echo ""; show_table2_header_begin(); echo "Host"; show_table2_v_delimiter(); echo "
"; if(isset($HTTP_GET_VARS["hostid"])) { echo ""; } if(isset($HTTP_GET_VARS["groupid"])) { echo ""; } echo "Host"; show_table2_h_delimiter(); echo ""; show_table2_v_delimiter(); echo "Groups"; show_table2_h_delimiter(); echo ""; show_table2_v_delimiter(); echo nbsp("New group"); show_table2_h_delimiter(); echo ""; show_table2_v_delimiter(); echo nbsp("Use IP address"); show_table2_h_delimiter(); // onChange does not work on some browsers: MacOS, KDE browser // echo ""; echo ""; if($useip=="checked") { show_table2_v_delimiter(); echo "IP address"; show_table2_h_delimiter(); echo ""; } else { echo ""; } show_table2_v_delimiter(); echo "Port"; show_table2_h_delimiter(); echo ""; show_table2_v_delimiter(); echo "Status"; show_table2_h_delimiter(); echo ""; show_table2_v_delimiter(); echo nbsp("Use the host as a template"); show_table2_h_delimiter(); echo ""; show_table2_v_delimiter2(); echo ""; if(isset($HTTP_GET_VARS["hostid"])) { echo ""; echo ""; } show_table2_header_end(); ?>