mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
move and optimize away some sql queries, remove obsolete code
git-svn-id: http://www.observium.org/svn/observer/trunk@2638 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,8 +1,21 @@
|
||||
<?php
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `devices`") as $device)
|
||||
{
|
||||
if (get_dev_attrib($device,'override_sysLocation_bool'))
|
||||
{
|
||||
$device['real_location'] = $device['location'];
|
||||
$device['location'] = get_dev_attrib($device,'override_sysLocation_string');
|
||||
}
|
||||
|
||||
$devices['count']++;
|
||||
|
||||
$cache['devices']['hostname'][$device['hostname']] = $device['device_id'];
|
||||
$cache['devices']['id'][$device['device_id']] = $device;
|
||||
}
|
||||
|
||||
if($_SESSION['userlevel'] >= 5)
|
||||
{
|
||||
$devices['count'] = dbFetchCell("SELECT COUNT(*) FROM devices");
|
||||
$devices['up'] = dbFetchCell("SELECT COUNT(*) FROM devices WHERE status = '1' AND `ignore` = '0'");
|
||||
$devices['down'] = dbFetchCell("SELECT COUNT(*) FROM devices WHERE status = '0' AND `ignore` = '0'");
|
||||
$devices['ignored'] = dbFetchCell("SELECT COUNT(*) FROM devices WHERE `ignore` = '1'");
|
||||
|
Reference in New Issue
Block a user