Update GraylogApi.php (#9617)

Fix the following exception, occurring when device known IP address is different than the one returned by gethostbyname() function call.

production.ERROR: ErrorException: Array to string conversion in /opt/librenms/app/ApiClients/GraylogApi.php:128
This commit is contained in:
Franck Zoccolo
2019-01-07 03:51:26 +01:00
committed by Tony Murray
parent 830429ee03
commit 114b3b36fe

View File

@ -125,7 +125,7 @@ class GraylogApi
$ip = gethostbyname($device->hostname);
$device_query = 'source:"' . $device->hostname . '" || source:"' . $ip . '"';
if ($device->ip && $ip != $device->ip) {
$query .= ' || source:"' . $device->ip . '"';
$device_query .= ' || source:"' . $device->ip . '"';
}
$query[] = '(' . $device_query . ')';