Fix - Seperate default poller id and distributed poller groups (#11584)

* Seperate Setting for default poller id

* revert change

* Travis restart

* fixes
This commit is contained in:
SourceDoctor 2020-05-25 00:55:11 +02:00 committed by GitHub
parent 4bb064c7ad
commit f92caf8cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 6 deletions

View File

@ -26,7 +26,7 @@ if (isset($options['g']) && $options['g'] >= 0) {
array_unshift($argv, $cmd);
$poller_group = $options['g'];
} elseif (Config::get('distributed_poller') === true) {
$poller_group = Config::get('distributed_poller_group');
$poller_group = Config::get('default_poller_group');
} else {
$poller_group = 0;
}

View File

@ -32,7 +32,7 @@ class PollerController extends Controller
return view('poller.groups', [
'current_tab' => 'groups',
'poller_groups' => PollerGroup::query()->withCount('devices')->get(),
'default_group_id' => Config::get('distributed_poller_group'),
'default_group_id' => Config::get('default_poller_group'),
'ungrouped_count' => Device::where('poller_group', 0)->count(),
]);
}

View File

@ -42,7 +42,7 @@ class PollerGroup extends Model
static::deleting(function (PollerGroup $pollergroup) {
// handle device pollergroup fallback to default poller
$default_poller_id = \LibreNMS\Config::get('distributed_poller_group');
$default_poller_id = \LibreNMS\Config::get('default_poller_group');
$pollergroup->devices()->update(['poller_group' => $default_poller_id]);
});
}

View File

@ -9,4 +9,4 @@
"/js/lang/ru.js": "/js/lang/ru.js?id=dc6cb9314c4903b00501",
"/js/lang/uk.js": "/js/lang/uk.js?id=669c4652f87dfd31ce7a",
"/js/lang/zh-TW.js": "/js/lang/zh-TW.js?id=82383ffa183494fa4a14"
}
}

View File

@ -69,11 +69,12 @@ function discover_new_device($hostname, $device = '', $method = '', $interface =
}
try {
$remote_device_id = addHost($hostname, '', '161', 'udp', Config::get('distributed_poller_group'));
$remote_device_id = addHost($hostname, '', '161', 'udp', Config::get('default_poller_group'));
$remote_device = device_by_id_cache($remote_device_id, 1);
echo '+[' . $remote_device['hostname'] . '(' . $remote_device['device_id'] . ')]';
discover_device($remote_device);
device_by_id_cache($remote_device_id, 1);
if ($remote_device_id && is_array($device) && !empty($method)) {
$extra_log = '';
$int = cleanPort($interface);

View File

@ -1189,6 +1189,10 @@
"type": "boolean"
},
"distributed_poller_group": {
"default": 0,
"type": "integer"
},
"default_poller_group": {
"default": 0,
"type": "integer",
"group": "poller",

View File

@ -507,7 +507,7 @@ return [
'description' => 'Enable Distributed Polling (requires additional setup)',
'help' => 'Enable distributed polling system wide. This is intended for load sharing, not remote polling. You must read the documentation for steps to enable: https://docs.librenms.org/Extensions/Distributed-Poller/'
],
'distributed_poller_group' => [
'default_poller_group' => [
'description' => 'Default Poller Group',
'help' => 'The default poller group all pollers should poll if none is set in config.php'
],