2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
if (!$samehost)
|
|
|
|
{
|
|
|
|
if ($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg = $list_colour_a; }
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
$service_type = strtolower($service['service_type']);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
if ($service[service_status] == '0') { $status = "<span class=red><b>$service_type</b></span>"; }
|
|
|
|
elseif ($service[service_status] == '1') { $status = "<span class=green><b>$service_type</b></span>"; }
|
|
|
|
elseif ($service[service_status] == '2') { $status = "<span class=grey><b>$service_type</b></span>"; }
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
$message = trim($service['service_message']);
|
|
|
|
$message = str_replace("\n", "<br />", $message);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
$since = time() - $service['service_changed'];
|
|
|
|
$since = formatUptime($since);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
if ($service['service_checked'])
|
|
|
|
{
|
|
|
|
$checked = time() - $service['service_checked'];
|
|
|
|
$checked = formatUptime($checked);
|
|
|
|
} else { $checked = "Never"; }
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-05-17 19:21:20 +00:00
|
|
|
$mini_url = "graph.php?id=".$service['service_id']."&type=service_availability&from=".$config['time']['day']."&to=".$config['time']['now']."&width=80&height=20&bg=efefef";
|
2010-02-21 19:32:08 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
$popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$service['service_type'];
|
2011-05-17 19:21:20 +00:00
|
|
|
$popup .= "</div><img src=\'graph.php?id=" . $service['service_id'] . "&type=service_availability&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=125\'>";
|
2011-03-17 11:46:02 +00:00
|
|
|
$popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
2010-02-21 19:54:39 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
echo("
|
|
|
|
<tr style=\"background-color: $bg; padding: 5px;\">");
|
2010-02-21 19:54:39 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
if ($device_id)
|
|
|
|
{
|
|
|
|
if (!$samehost)
|
|
|
|
{
|
2007-04-08 18:09:21 +00:00
|
|
|
$device['device_id'] = $device_id;
|
|
|
|
$device['hostname'] = $device_hostname;
|
2011-03-17 11:46:02 +00:00
|
|
|
echo("<td valign=top width=250><span style='font-weight:bold;'>" . generate_device_link($device) . "</span></td>");
|
|
|
|
} else {
|
|
|
|
echo("<td></td>");
|
2007-04-03 14:10:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-02-21 19:32:08 +00:00
|
|
|
echo("
|
2011-03-17 11:46:02 +00:00
|
|
|
<td valign=top class=list-bold>
|
|
|
|
$status
|
|
|
|
</td>
|
|
|
|
<td valign=top><a $popup><img src='$mini_url'></a></td>
|
|
|
|
<td valign=top width=175>
|
|
|
|
$since
|
|
|
|
</td>
|
|
|
|
<td valign=top>
|
|
|
|
<span class=box-desc>$message</span>
|
|
|
|
</td>
|
|
|
|
</tr>");
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
2011-05-17 19:21:20 +00:00
|
|
|
?>
|