mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
committed by
Tony Murray
parent
830429ee03
commit
114b3b36fe
@ -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 . ')';
|
||||
|
Reference in New Issue
Block a user