mark assigned default poller group (#11112)

This commit is contained in:
SourceDoctor
2020-02-09 15:44:08 +01:00
committed by GitHub
parent 385f5e0bc1
commit ffddfd0901

View File

@@ -12,6 +12,8 @@
* the source code distribution for details.
*/
use \LibreNMS\Config;
$pagetitle[] = 'Poller Groups';
require_once 'includes/html/modal/poller_groups.inc.php';
@@ -32,18 +34,27 @@ require_once 'includes/html/modal/poller_groups.inc.php';
<?php
$default_group = ['id' => 0,
'group_name' =>'(default poller group)',
'descr' => 'Devices which are not assigned to a poller group will be handled by this poller'];
'group_name' => 'General',
'descr' => ''];
$group_list = dbFetchRows('SELECT * FROM `poller_groups`');
$default_poller = Config::get('distributed_poller_group');
array_unshift($group_list, $default_group);
foreach ($group_list as $group) {
$group_device_count = dbFetchCell('SELECT COUNT(*) FROM devices WHERE `poller_group`=?', $group['id']);
$group_name = $group['group_name'];
if ($group['id'] == $default_poller) {
$group_name .= ' (default Poller)';
}
echo '
<tr id="'.$group['id'].'">
<td>'.$group['id'].'</td>
<td>'.$group['group_name'].'</td>
<td>'.$group_name.'</td>
<td><a href="/devices/poller_group='.$group['id'].'")">'.$group_device_count.'</a></td>
<td>'.$group['descr'].'</td>';
echo '<td>';