mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #1184 from laf/issue-936
Updated BGP polling for Cisco to support CISCO-BGP4-MIB better
This commit is contained in:
@@ -1208,6 +1208,21 @@ function first_oid_match($device, $list) {
|
||||
}
|
||||
}
|
||||
|
||||
function hex_to_ip($hex) {
|
||||
$return = "";
|
||||
if (filter_var($hex, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === FALSE && filter_var($hex, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === FALSE) {
|
||||
$hex_exp = explode(' ', $hex);
|
||||
foreach ($hex_exp as $item) {
|
||||
if (!empty($item) && $item != "\"") {
|
||||
$return .= hexdec($item).'.';
|
||||
}
|
||||
}
|
||||
$return = substr($return, 0, -1);
|
||||
} else {
|
||||
$return = $hex;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
function fix_integer_value($value) {
|
||||
if ($value < 0) {
|
||||
$return = 4294967296+$value;
|
||||
|
Reference in New Issue
Block a user