moar cleanup

git-svn-id: http://www.observium.org/svn/observer/trunk@1901 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-17 11:46:02 +00:00
parent aedac10866
commit a14ae7e60a
11 changed files with 186 additions and 193 deletions

View File

@@ -1,33 +1,34 @@
<?php
$descr = mres($_POST['descr']);
$ignore = mres($_POST['ignore']);
$type = mres($_POST['type']);
$disabled = mres($_POST['disabled']);
$community = mres($_POST['community']);
$snmpver = mres($_POST['snmpver']);
$port = mres($_POST['port']);
$timeout = mres($_POST['timeout']);
$retries = mres($_POST['retries']);
$descr = mres($_POST['descr']);
$ignore = mres($_POST['ignore']);
$type = mres($_POST['type']);
$disabled = mres($_POST['disabled']);
$community = mres($_POST['community']);
$snmpver = mres($_POST['snmpver']);
$port = mres($_POST['port']);
$timeout = mres($_POST['timeout']);
$retries = mres($_POST['retries']);
#FIXME needs more sanity checking! and better feedback
#FIXME needs more sanity checking! and better feedback
$sql = "UPDATE `devices` SET `purpose` = '" . $descr . "', `community` = '" . $community . "', `type` = '$type'";
$sql .= ", `snmpver` = '" . $snmpver . "', `ignore` = '$ignore', `disabled` = '$disabled', `port` = '$port', ";
$sql .= "`timeout` = '$timeout', `retries` = '$retries' WHERE `device_id` = '".$device['device_id']."'";
$query = mysql_query($sql);
$sql = "UPDATE `devices` SET `purpose` = '" . $descr . "', `community` = '" . $community . "', `type` = '$type'";
$sql .= ", `snmpver` = '" . $snmpver . "', `ignore` = '$ignore', `disabled` = '$disabled', `port` = '$port', ";
$sql .= "`timeout` = '$timeout', `retries` = '$retries' WHERE `device_id` = '".$device['device_id']."'";
$query = mysql_query($sql);
$rows_updated = mysql_affected_rows();
$rows_updated = mysql_affected_rows();
if($rows_updated > 0) {
$update_message = mysql_affected_rows() . " Device record updated.";
$updated = 1;
} elseif ($rows_updated = '-1') {
$update_message = "Device record unchanged. No update necessary.";
$updated = -1;
} else {
$update_message = "Device record update error.";
$updated = 0;
}
if ($rows_updated > 0)
{
$update_message = mysql_affected_rows() . " Device record updated.";
$updated = 1;
} elseif ($rows_updated = '-1') {
$update_message = "Device record unchanged. No update necessary.";
$updated = -1;
} else {
$update_message = "Device record update error.";
$updated = 0;
}
?>
?>

View File

@@ -1,10 +1,10 @@
<?php
if(is_numeric($id))
if (is_numeric($id))
{
$sensor = mysql_fetch_assoc(mysql_query("SELECT * FROM sensors WHERE sensor_id = '".mres($id)."'"));
if(is_numeric($sensor['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($sensor['device_id'])))
if (is_numeric($sensor['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($sensor['device_id'])))
{
$device = device_by_id_cache($sensor['device_id']);
@@ -17,4 +17,4 @@ if(is_numeric($id))
}
}
?>
?>

View File

@@ -4,20 +4,19 @@ $scale_min = "0";
include("includes/graphs/common.inc.php");
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("current-" . $sensor['sensor_descr'] . ".rrd");
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("current-" . $sensor['sensor_descr'] . ".rrd");
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 18),0,18);
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 18),0,18);
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
$rrd_options .= " GPRINT:sensor$current_id:MIN:%5.2lfA";
$rrd_options .= " GPRINT:sensor:LAST:%5.2lfA";
$rrd_options .= " GPRINT:sensor:MAX:%5.2lfA\\\\l";
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
$rrd_options .= " GPRINT:sensor$current_id:MIN:%5.2lfA";
$rrd_options .= " GPRINT:sensor:LAST:%5.2lfA";
$rrd_options .= " GPRINT:sensor:MAX:%5.2lfA\\\\l";
if(is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if(is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
?>
?>

View File

@@ -4,18 +4,18 @@ $scale_min = "0";
include("includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("fanspeed-" . $sensor['sensor_type'] .'-'. $sensor['sensor_index'] . ".rrd");
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("fanspeed-" . $sensor['sensor_type'] .'-'. $sensor['sensor_index'] . ".rrd");
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 20),0,20);
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 20),0,20);
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($sensor['sensor_descr_fixed'])))."'"; # Ugly hack :(
$rrd_options .= " GPRINT:sensor:LAST:%3.0lfrpm";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lfrpm\\\\l";
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($sensor['sensor_descr_fixed'])))."'"; # Ugly hack :(
$rrd_options .= " GPRINT:sensor:LAST:%3.0lfrpm";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lfrpm\\\\l";
if(is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if(is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
?>
?>

View File

@@ -4,18 +4,18 @@ $scale_min = "0";
include("includes/graphs/common.inc.php");
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("frequency-" . $sensor['sensor_descr'] . ".rrd");
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("frequency-" . $sensor['sensor_descr'] . ".rrd");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " COMMENT:' Last Max\\n'";
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 28),0,28);
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 28),0,28);
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lfHz";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lfHz\\\\l";
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lfHz";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lfHz\\\\l";
if(is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if(is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
?>
?>

View File

@@ -5,30 +5,30 @@ $scale_max = "40";
include("includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_options .= " COMMENT:' Last Max\\n'";
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("humidity-" . $sensor['sensor_descr'] . ".rrd");
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("humidity-" . $sensor['sensor_descr'] . ".rrd");
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 28),0,28);
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 28),0,28);
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename:sensor:MIN";
$rrd_options .= " CDEF:sensorwarm=sensor_max,".$sensor['sensor_limit'].",GT,sensor,UNKN,IF";
$rrd_options .= " CDEF:sensorcold=sensor_min,20,LT,sensor,UNKN,IF";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename:sensor:MIN";
$rrd_options .= " CDEF:sensorwarm=sensor_max,".$sensor['sensor_limit'].",GT,sensor,UNKN,IF";
$rrd_options .= " CDEF:sensorcold=sensor_min,20,LT,sensor,UNKN,IF";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
# $rrd_options .= " AREA:sensor#bbd392";
# $rrd_options .= " AREA:sensorwarm#FFCCCC";
# $rrd_options .= " AREA:sensorcold#CCCCFF";
$rrd_options .= " LINE1:sensor#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($sensor['sensor_descr_fixed'])))."'"; # Ugly hack :(
$rrd_options .= " LINE1:sensorwarm#660000";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lf%%";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lf%%\\\\l";
$rrd_options .= " LINE1:sensor#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($sensor['sensor_descr_fixed'])))."'"; # Ugly hack :(
$rrd_options .= " LINE1:sensorwarm#660000";
$rrd_options .= " GPRINT:sensor:LAST:%3.0lf%%";
$rrd_options .= " GPRINT:sensor:MAX:%3.0lf%%\\\\l";
if(is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if(is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
?>
?>

View File

@@ -5,35 +5,34 @@ $scale_max = "60";
include("includes/graphs/common.inc.php");
$rrd_options .= " COMMENT:' Cur Min Max\\n'";
$rrd_options .= " COMMENT:' Cur Min Max\\n'";
### FIXME: Overwrite default because it won't work here yet
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/temperature-" . safename($sensor['sensor_type']."-".$sensor['sensor_index']) . ".rrd";
### FIXME: Overwrite default because it won't work here yet
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/temperature-" . safename($sensor['sensor_type']."-".$sensor['sensor_index']) . ".rrd";
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 21),0,21);
$sensor['sensor_descr_fixed'] = str_replace(':','\:',str_replace('\*','*',$sensor['sensor_descr_fixed']));
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 21),0,21);
$sensor['sensor_descr_fixed'] = str_replace(':','\:',str_replace('\*','*',$sensor['sensor_descr_fixed']));
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename:sensor:MIN";
$rrd_options .= " CDEF:sensorwarm=sensor_max,".$sensor['sensor_limit'].",GT,sensor,UNKN,IF";
$rrd_options .= " CDEF:sensorcold=sensor_min,20,LT,sensor,UNKN,IF";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
$rrd_options .= " DEF:sensor_max=$rrd_filename:sensor:MAX";
$rrd_options .= " DEF:sensor_min=$rrd_filename:sensor:MIN";
$rrd_options .= " CDEF:sensorwarm=sensor_max,".$sensor['sensor_limit'].",GT,sensor,UNKN,IF";
$rrd_options .= " CDEF:sensorcold=sensor_min,20,LT,sensor,UNKN,IF";
$rrd_options .= " AREA:sensor_max#c5c5c5";
$rrd_options .= " AREA:sensor_min#ffffffff";
# $rrd_options .= " AREA:sensor#bbd392";
# $rrd_options .= " AREA:sensorwarm#FFCCCC";
# $rrd_options .= " AREA:sensorcold#CCCCFF";
# $rrd_options .= " LINE1:sensor#cc0000:'" . str_replace(':','\:',str_replace('\*','*',quotemeta($sensor['sensor_descr_fixed'])))."'"; # Ugly hack :(
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
# $rrd_options .= " LINE1.5:sensorwarm#660000";
$rrd_options .= " GPRINT:sensor:LAST:%4.1lfC";
$rrd_options .= " GPRINT:sensor_min:MIN:%4.1lfC";
$rrd_options .= " GPRINT:sensor_max:MAX:%4.1lfC\\\\l";
$rrd_options .= " GPRINT:sensor:LAST:%4.1lfC";
$rrd_options .= " GPRINT:sensor_min:MIN:%4.1lfC";
$rrd_options .= " GPRINT:sensor_max:MAX:%4.1lfC\\\\l";
if(is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if(is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
?>
?>

View File

@@ -24,7 +24,7 @@ $rrd_options .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed']."'";
$rrd_options .= " GPRINT:sensor:LAST:%6.2lfV";
$rrd_options .= " GPRINT:sensor:MAX:%6.2lfV\\\\l";
if(is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if(is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
?>
?>

View File

@@ -1,31 +1,26 @@
<?php
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
if ($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
unset($icon);
unset($icon);
$icon = geteventicon($entry['message']);
if($icon) {$icon = "<img src='images/16/$icon'>"; }
$icon = geteventicon($entry['message']);
if ($icon) { $icon = "<img src='images/16/$icon'>"; }
echo("<tr style=\"background-color: $bg\">
<td width=0></td>
<td class=syslog width=140>
".$entry['humandate']."
</td>
<td class=syslog>");
echo("<tr style=\"background-color: $bg\">
<td width=0></td>
<td class=syslog width=140>
".$entry['humandate']."
</td>
<td class=syslog>");
if ($entry['type'] == "interface") {
$entry['link'] = "<b>".generate_port_link(getifbyid($entry['reference']))."</b>";
}
if($entry['type'] == "interface") {
$entry['link'] = "<b>".generate_port_link(getifbyid($entry['reference']))."</b>";
}
echo($entry['link'] ." ". htmlspecialchars($entry['message'])
. "</td>
<td></td>
</tr>");
echo($entry['link'] ." ". htmlspecialchars($entry['message'])
. "</td>
<td></td>
</tr>");
?>
?>

View File

@@ -1,40 +1,37 @@
<?php
if(isset($bg) && $bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
if (isset($bg) && $bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
$hostname = gethostbyid($entry['host']);
$hostname = gethostbyid($entry['host']);
unset($icon);
unset($icon);
$icon = geteventicon($entry['message']);
if($icon) {$icon = '<img src="images/16/' . $icon . '" />'; }
$icon = geteventicon($entry['message']);
if ($icon) { $icon = '<img src="images/16/' . $icon . '" />'; }
echo('<tr style="background-color: ' . $bg . '">
<td width="0"></td>
<td class="syslog" width="160">
' . $entry['datetime'] . '
</td>');
echo('<tr style="background-color: ' . $bg . '">
<td width="0"></td>
<td class="syslog" width="160">
' . $entry['datetime'] . '
</td>');
if(!isset($_GET['id']) && (!isset($overview) || $overview == 0)) {
$dev = device_by_id_cache($entry['host']);
echo("<td class=list-bold width=150>
" . generate_device_link($dev, shorthost($dev['hostname'])) . "
</td>");
}
if (!isset($_GET['id']) && (!isset($overview) || $overview == 0)) {
$dev = device_by_id_cache($entry['host']);
echo("<td class=list-bold width=150>
" . generate_device_link($dev, shorthost($dev['hostname'])) . "
</td>");
}
if($entry['type'] == "interface") {
$entry['link'] = "<b>".generate_port_link(getifbyid($entry['reference']))."</b>";
} else {
$entry['link'] = "System";
}
echo("<td>".$entry['link']."</td>");
if ($entry['type'] == "interface")
{
$entry['link'] = "<b>".generate_port_link(getifbyid($entry['reference']))."</b>";
} else {
$entry['link'] = "System";
}
echo("<td>".htmlspecialchars($entry['message']) . "</td>
</tr>");
echo("<td>".$entry['link']."</td>");
echo("<td>".htmlspecialchars($entry['message']) . "</td>
</tr>");
?>
?>

View File

@@ -1,60 +1,62 @@
<?php
if(!$samehost) {
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg = $list_colour_a; }
if (!$samehost)
{
if ($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg = $list_colour_a; }
}
$service_type = strtolower($service['service_type']);
$service_type = strtolower($service['service_type']);
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>";}
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>"; }
$message = trim($service['service_message']);
$message = str_replace("\n", "<br />", $message);
$message = trim($service['service_message']);
$message = str_replace("\n", "<br />", $message);
$since = time() - $service['service_changed'];
$since = formatUptime($since);
$since = time() - $service['service_changed'];
$since = formatUptime($since);
if($service['service_checked']) {
$checked = time() - $service['service_checked'];
$checked = formatUptime($checked);
} else { $checked = "Never"; }
if ($service['service_checked'])
{
$checked = time() - $service['service_checked'];
$checked = formatUptime($checked);
} else { $checked = "Never"; }
$mini_url = $config['base_url'] . "/graph.php?id=".$service['service_id']."&type=service_availability&from=".$day."&to=".$now."&width=80&height=20&bg=efefef";
$mini_url = $config['base_url'] . "/graph.php?id=".$service['service_id']."&type=service_availability&from=".$day."&to=".$now."&width=80&height=20&bg=efefef";
$popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$service['service_type'];
$popup .= "</div><img src=\'".$config['base_url']."/graph.php?id=" . $service['service_id'] . "&type=service_availability&from=$day&to=$now&width=400&height=125\'>";
$popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
$popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$service['service_type'];
$popup .= "</div><img src=\'".$config['base_url']."/graph.php?id=" . $service['service_id'] . "&type=service_availability&from=$day&to=$now&width=400&height=125\'>";
$popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
echo("
<tr style=\"background-color: $bg; padding: 5px;\">");
echo("
<tr style=\"background-color: $bg; padding: 5px;\">");
if($device_id) {
if(!$samehost) {
if ($device_id)
{
if (!$samehost)
{
$device['device_id'] = $device_id;
$device['hostname'] = $device_hostname;
echo("<td valign=top width=250><span style='font-weight:bold;'>" . generate_device_link($device) . "</span></td>");
} else {
echo("<td></td>");
echo("<td valign=top width=250><span style='font-weight:bold;'>" . generate_device_link($device) . "</span></td>");
} else {
echo("<td></td>");
}
}
echo("
<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>");
<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++;
$i++;
?>
?>