<?php
include 'konak.php';
$query = "SELECT server_name, status FROM server_status";
$data  = mysqli_query($koneksi, $query);
$res = [];
while ($row = $data->fetch_assoc()) {
    $key = $row["server_name"];
    $res[$key] = [
        "status"    => $row["status"]
    ];
}

header('Content-Type: application/json');
echo json_encode($res);
die();
?>
