Merge pull request #1184 from laf/issue-936

Updated BGP polling for Cisco to support CISCO-BGP4-MIB better
This commit is contained in:
Paul Gear
2015-06-13 10:20:58 +10:00
6 changed files with 2438 additions and 1166 deletions

View File

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