Revert "Poller command rewrite (#13414)" (#13524)

This reverts commit 1752d1efd4.
This commit is contained in:
Tony Murray
2021-11-16 21:40:29 -06:00
committed by GitHub
parent 1752d1efd4
commit f8764ddcb5
49 changed files with 304 additions and 1181 deletions

View File

@@ -24,8 +24,6 @@
* @author Heath Barnhart <hbarnhart@kanren.net>
*/
use App\Action;
use App\Actions\Device\UpdateDeviceGroupsAction;
use LibreNMS\Alert\AlertRules;
use LibreNMS\Config;
use LibreNMS\Data\Store\Datastore;
@@ -35,7 +33,6 @@ $init_modules = ['polling', 'alerts', 'laravel'];
require __DIR__ . '/includes/init.php';
$poller_start = microtime(true);
Log::setDefaultDriver('console');
echo Config::get('project_name') . " Poller\n";
$options = getopt('h:m:i:n:r::d::v::a::f::q');
@@ -142,7 +139,7 @@ foreach (dbFetch($query) as $device) {
// Update device_groups
echo "### Start Device Groups ###\n";
$dg_start = microtime(true);
$group_changes = Action::execute(UpdateDeviceGroupsAction::class);
$group_changes = \App\Models\DeviceGroup::updateGroupsFor($device['device_id']);
d_echo('Groups Added: ' . implode(',', $group_changes['attached']) . PHP_EOL);
d_echo('Groups Removed: ' . implode(',', $group_changes['detached']) . PHP_EOL);
echo '### End Device Groups, runtime: ' . round(microtime(true) - $dg_start, 4) . "s ### \n\n";