history as $entry) {
if ($entry->hostname !== $last_host || $entry->service !== $last_service) {
echo '
' . "\n";
}
$cnt++;
if ($cnt > 10000) break;
$duration = $entry->timestamp - $current_offset;
if ($next_color === null) {
$color = stateColor($entry->last_state);
} else {
$color = $next_color;
}
$next_color = stateColor($entry->state);
if ($entry->state == 0) {
$offset = ceil($duration / 3600 / 6);
} else {
$offset = floor($duration / 3600 / 6);
}
echo '
';
$current_offset += $duration;
$last_host = $entry->hostname;
$last_service = $entry->service;
}
?>