cleanups, extend ports.port_descr_type length to 255, maybe break billing, remove and add some FIXMEs, poll toner with snmp_get

git-svn-id: http://www.observium.org/svn/observer/trunk@1985 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-28 20:29:34 +00:00
parent 2be7bfe497
commit 2c300b5bf4
21 changed files with 149 additions and 168 deletions

View File

@@ -28,16 +28,6 @@ function mac_clean_to_readable($mac)
return($r);
}
function zeropad($num, $length = 2)
{
while (strlen($num) < $length)
{
$num = '0'.$num;
}
return $num;
}
function only_alphanumeric($string)
{
return preg_replace('/[^a-zA-Z0-9]/', '', $string);
@@ -197,12 +187,6 @@ function interface_errors($rrd_file, $period = '-1d') // Returns the last in/out
return $errors;
}
# FIXME: below function is unused, only commented out in html/pages/device/overview/ports.inc.php - do we still need it?
function device_traffic_image($device, $width, $height, $from, $to)
{
return "<img src='graph.php?device=" . $device . "&amp;type=device_bits&amp;from=" . $from . "&amp;to=" . $to . "&amp;width=" . $width . "&amp;height=" . $height . "&amp;legend=no' />";
}
function getImage($host)
{
global $config;
@@ -679,7 +663,7 @@ function log_event($text, $device = NULL, $type = NULL, $reference = NULL)
{
global $debug;
if (!is_array($device)) { $device = device_by_id_cache($device); }
if (!is_array($device)) { $device = device_by_id_cache($device); }
$event_query = "INSERT INTO eventlog (host, reference, type, datetime, message) VALUES (" . ($device['device_id'] ? $device['device_id'] : "NULL");
$event_query .= ", '" . ($reference ? $reference : "NULL") . "', '" . ($type ? $type : "NULL") . "', NOW(), '" . mres($text) . "')";