mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
allow customisable filtering of interfaces from device_bits graph (also usable on theoretical device_pkts and device_errors)
git-svn-id: http://www.observium.org/svn/observer/trunk@1068 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,6 +2,19 @@
|
||||
|
||||
## Common Functions
|
||||
|
||||
function device_by_id_cache($device_id)
|
||||
{
|
||||
global $device_cache;
|
||||
if (is_array($device_cache[$device_id]))
|
||||
{
|
||||
$device = $device_cache[$device_id];
|
||||
} else {
|
||||
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '".$device_id."'"));
|
||||
$device_cache[$device_id] = $device;
|
||||
}
|
||||
return $device;
|
||||
}
|
||||
|
||||
function truncate($substring, $max = 50, $rep = '...'){
|
||||
if(strlen($substring) < 1){ $string = $rep; } else { $string = $substring; }
|
||||
$leave = $max - strlen ($rep);
|
||||
|
Reference in New Issue
Block a user