mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Nac polling improvement (#16265)
* Nac polling improvement Was loading all nac entries from the DB, then filtering them. Now it only loads non-historical entries off the bat. All this because the filter was returning the wrong type... * Add missing get
This commit is contained in:
@@ -81,11 +81,9 @@ class Nac implements Module
|
||||
|
||||
$nac_entries = $os->pollNac()->keyBy('mac_address');
|
||||
//filter out historical entries
|
||||
$existing_entries = $os->getDevice()->portsNac->keyBy('mac_address')->filter(function ($value, $key) {
|
||||
if ($value['historical'] == 0) {
|
||||
return $value;
|
||||
}
|
||||
});
|
||||
$existing_entries = $os->getDevice()->portsNac()
|
||||
->where('historical', 0)
|
||||
->get()->keyBy('mac_address');
|
||||
|
||||
// update existing models
|
||||
foreach ($nac_entries as $nac_entry) {
|
||||
|
Reference in New Issue
Block a user