$sql); foreach (dbFetchRows($sql, $param) as $drive) { $perc = round($drive['storage_perc']); $perc_warn = round($drive['storage_perc_warn']); $size = \LibreNMS\Util\Number::formatBi($drive['storage_size']); $response[] = [ 'storage_id' => $drive['storage_id'], 'hostname' => generate_device_link($drive), 'storage_descr' => $drive['storage_descr'], 'storage_perc' => $perc . '%', 'storage_perc_warn' => $perc_warn, 'storage_size' => $size, ]; } $output = ['current'=>$current, 'rowCount'=>$rowCount, 'rows'=>$response, 'total'=>$total]; echo json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);