"); if(file_exists("includes/dev-data-" . strtolower($device[os]) . ".inc")) { echo("
"); echo("

Device Data

"); include("includes/dev-data-" . strtolower($device[os]) . ".inc"); echo("
"); } if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"),0)) { echo("
"); echo("

Storage

"); echo(""); $i = '1'; echo(""); $drives = mysql_query("SELECT * FROM `storage` WHERE host_id = '" . $device['device_id'] . "'"); while($drive = mysql_fetch_array($drives)) { $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits']; $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits']; $perc = $drive['storage_perc']; $total = formatStorage($total); $used = formatStorage($used); if($perc > '80') { $drv_class='red'; } else { $drvclass=''; } echo(""); $i++; } echo("
MountpointUsage%Total Used
" . $drive['hrStorageDescr'] . " " . $perc . "%" . $total . "" . $used . "
"); echo("
"); } unset($temp_seperator); if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) { $total = mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"),0); $rows = round($total / 2,0); echo("
"); echo("

Temperatures

"); $i = '1'; $temps = mysql_query("SELECT * FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"); echo(""); echo(""); echo("
"); echo(""); while($temp = mysql_fetch_array($temps)) { if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } if($temp['temp_current'] < '30') { $temp_class=''; } elseif($temp['temp_current'] < '40') { $temp_class='blue'; } elseif($temp['temp_current'] < '50') { $temp_class='green'; } elseif($temp['temp_current'] < '60') { $temp_class='orange'; } else { $temp_class='red'; } $temp['temp_descr'] = truncate($temp['temp_descr'], 25, ''); echo(""); if($i == $rows) { echo("
" . $temp['temp_descr'] . "" . $temp['temp_current'] . "°C
"); } $i++; } echo("
"); echo("
"); echo("
"); } echo("
"); echo("

Recent Events

"); $query = "SELECT *,DATE_FORMAT(datetime, '%d/%b/%y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,10"; $data = mysql_query($query); echo(""); while($entry = mysql_fetch_array($data)) { include("includes/print-event-short.inc"); } echo("
"); echo(""); if($interfaces['total']) { echo("

Total Traffic

" . device_traffic_image($device['device_id'], 490, 100, $day, $now) . "
"); } if($interfaces['total']) { echo("
"); echo("

Interfaces

"); echo("
$interfaces[total] $interfaces[up] $interfaces[down] $interfaces[disabled]
"); echo("
"); $sql = "SELECT * FROM interfaces WHERE `device_id` = '" . $device['device_id'] . "'"; $query = mysql_query($sql); while($data = mysql_fetch_array($query)) { echo("$ifsep" . generateiflink($data, makeshortif(strtolower($data['ifDescr'])))); $ifsep = ", "; } unset($ifsep); echo("
"); echo("
"); } if($services['total']) { echo("
"); echo("

Services

"); echo("
$services[total] $services[up] $services[down] $services[disabled]
"); echo("
"); $sql = "SELECT * FROM services WHERE service_host = '" . $device['device_id'] . "' ORDER BY service_type"; $query = mysql_query($sql); while($data = mysql_fetch_array($query)) { if ($data[service_status] == "0" && $data[service_ignore] == "1") { $status = "grey"; } if ($data[service_status] == "1" && $data[service_ignore] == "1") { $status = "green"; } if ($data[service_status] == "0" && $data[service_ignore] == "0") { $status = "red"; } if ($data[service_status] == "1" && $data[service_ignore] == "0") { $status = "blue"; } echo("$break" . strtolower($data[service_type]) . ""); $break = ", "; } echo("
"); } echo(""); ?>