mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added the poller group name to the table - general if no poller groups created
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
<?php
|
||||
|
||||
$sql = ' FROM `devices` AS D';
|
||||
$sql = ' FROM `devices` AS D ';
|
||||
|
||||
if (is_admin() === false) {
|
||||
$sql .= ", devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '".$_SESSION['user_id']."' AND D.ignore = '0'";
|
||||
$sql .= ", devices_perms AS P ";
|
||||
}
|
||||
|
||||
$sql .= " LEFT JOIN `poller_groups` ON `D`.`poller_group`=`poller_groups`.`id`";
|
||||
|
||||
if (is_admin() === false) {
|
||||
$sql .= " WHERE D.device_id = P.device_id AND P.user_id = '".$_SESSION['user_id']."' AND D.ignore = '0'";
|
||||
}
|
||||
else {
|
||||
$sql .= ' WHERE 1';
|
||||
@@ -34,12 +40,16 @@ if ($rowCount != -1) {
|
||||
$sql .= " LIMIT $limit_low,$limit_high";
|
||||
}
|
||||
|
||||
$sql = "SELECT D.device_id,D.hostname AS `hostname`, D.last_polled AS `last_polled`, D.last_polled_timetaken AS `last_polled_timetaken` $sql";
|
||||
$sql = "SELECT D.device_id,D.hostname AS `hostname`, D.last_polled AS `last_polled`, `group_name`, D.last_polled_timetaken AS `last_polled_timetaken` $sql";
|
||||
|
||||
foreach (dbFetchRows($sql) as $device) {
|
||||
if (empty($device['group_name'])) {
|
||||
$device['group_name'] = 'General';
|
||||
}
|
||||
$response[] = array(
|
||||
'hostname' => "<a class='list-device' href='".generate_device_url($device, array('tab' => 'graphs', 'group' => 'poller'))."'>".$device['hostname'].'</a>',
|
||||
'last_polled' => $device['last_polled'],
|
||||
'poller_group' => $device['group_name'],
|
||||
'last_polled_timetaken' => $device['last_polled_timetaken'],
|
||||
);
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ $no_refresh = true;
|
||||
<tr>
|
||||
<th data-column-id="hostname">Hostname</th>
|
||||
<th data-column-id="last_polled">Last Polled</th>
|
||||
<th data-column-id="poller_group">Poller Group</th>
|
||||
<th data-column-id="last_polled_timetaken" data-order="desc">Polling Duration (Seconds)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
Reference in New Issue
Block a user