mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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 . "&type=device_bits&from=" . $from . "&to=" . $to . "&width=" . $width . "&height=" . $height . "&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) . "')";
|
||||
|
Reference in New Issue
Block a user