mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
speedups to syslog page, caching of device_id
git-svn-id: http://www.observium.org/svn/observer/trunk@743 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -24,6 +24,17 @@ require('collectd/config.php');
|
||||
require('collectd/functions.php');
|
||||
require('collectd/definitions.php');
|
||||
|
||||
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 mac_clean_to_readable($mac){
|
||||
|
||||
$r = substr($mac, 0, 2);
|
||||
|
Reference in New Issue
Block a user