Updated LTM discovery to fix route domain ID breaking the hex to stri… (#8146)

* Updated LTM discovery to fix route domain ID breaking the hex to string IPv4 conversion

* fixed whitespaces

* fixed whitespaces
This commit is contained in:
dnapper
2018-01-25 12:28:40 -07:00
committed by Tony Murray
parent a98ab6363b
commit 772ecac36d

View File

@@ -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];