From 772ecac36d11bf3964ca847e1e4b3bc8ba7801ec Mon Sep 17 00:00:00 2001 From: dnapper Date: Thu, 25 Jan 2018 12:28:40 -0700 Subject: [PATCH] =?UTF-8?q?Updated=20LTM=20discovery=20to=20fix=20route=20?= =?UTF-8?q?domain=20ID=20breaking=20the=20hex=20to=20stri=E2=80=A6=20(#814?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updated LTM discovery to fix route domain ID breaking the hex to string IPv4 conversion * fixed whitespaces * fixed whitespaces --- includes/discovery/loadbalancers/f5-ltm.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/discovery/loadbalancers/f5-ltm.inc.php b/includes/discovery/loadbalancers/f5-ltm.inc.php index b9e54ed176..5d0586b150 100644 --- a/includes/discovery/loadbalancers/f5-ltm.inc.php +++ b/includes/discovery/loadbalancers/f5-ltm.inc.php @@ -73,6 +73,11 @@ if (!is_null($ltmVirtualServEntry) || !is_null($ltmVsStatusEntry) || !is_null($l // The UID is far too long to have in a RRD filename, use a hash of it instead. $result['hash'] = hash('crc32', $result['UID']); + // Trim IPv4 response to remove route domain ID + if (strlen($ltmVirtualServEntry['1.3.6.1.4.1.3375.2.2.10.1.2.1.3.'.$index]) == 23) { + $ltmVirtualServEntry['1.3.6.1.4.1.3375.2.2.10.1.2.1.3.'.$index] = substr($ltmVirtualServEntry['1.3.6.1.4.1.3375.2.2.10.1.2.1.3.'.$index], 0, 11); + } + // Now that we have our UID we can pull all the other data we need. $result['IP'] = IP::fromHexString($ltmVirtualServEntry['1.3.6.1.4.1.3375.2.2.10.1.2.1.3.'.$index], true); $result['port'] = $ltmVirtualServEntry['1.3.6.1.4.1.3375.2.2.10.1.2.1.6.'.$index];