Show Location on Poller Log (#11945)

* Show Location on Poller Log

* .

* .
This commit is contained in:
SourceDoctor
2020-07-20 18:23:28 +02:00
committed by GitHub
parent 912247f2f0
commit e8f2c2e396
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -9,6 +9,7 @@ if (!Auth::user()->hasGlobalAdmin()) {
$sql .= ", devices_perms AS P ";
}
$sql .= " LEFT JOIN `locations` as L ON `D`.`location_id`=`L`.`id`";
$sql .= " LEFT JOIN `poller_groups` ON `D`.`poller_group`=`poller_groups`.`id`";
if (!Auth::user()->hasGlobalAdmin()) {
@@ -54,7 +55,7 @@ if ($rowCount != -1) {
$sql .= " LIMIT $limit_low,$limit_high";
}
$sql = "SELECT D.device_id, D.hostname AS `hostname`, D.sysName, D.last_polled AS `last_polled`, `group_name`, D.last_polled_timetaken AS `last_polled_timetaken` $sql";
$sql = "SELECT D.device_id, L.location as `location`, D.hostname AS `hostname`, D.sysName, D.last_polled AS `last_polled`, `group_name`, D.last_polled_timetaken AS `last_polled_timetaken` $sql";
foreach (dbFetchRows($sql, $param) as $device) {
if (empty($device['group_name'])) {
@@ -64,6 +65,7 @@ foreach (dbFetchRows($sql, $param) as $device) {
'hostname' => generate_device_link($device, format_hostname($device), array('tab' => 'graphs', 'group' => 'poller')),
'last_polled' => $device['last_polled'],
'poller_group' => $device['group_name'],
'location' => $device['location'],
'last_polled_timetaken' => round($device['last_polled_timetaken'], 2),
);
}
+1
View File
@@ -12,6 +12,7 @@
<th data-column-id="hostname">@lang('Hostname')</th>
<th data-column-id="last_polled">@lang('Last Polled')</th>
<th data-column-id="poller_group">@lang('Poller Group')</th>
<th data-column-id="location">@lang('Location')</th>
<th data-column-id="last_polled_timetaken" data-order="desc">@lang('Polling Duration') (@lang('Seconds'))</th>
</tr>
</thead>