Use official NET-SNMP-EXTEND-MIB first for running distro command,

then fallback to the older OID subtree.
This commit is contained in:
Mark Nagel
2015-10-23 09:18:05 -07:00
parent a7bf0e0857
commit be579b3cf9

View File

@@ -32,9 +32,16 @@ if ($device['os'] == "linux" || $device['os'] == "endian") {
}
# Distro "extend" support
$features = snmp_get($device, ".1.3.6.1.4.1.2021.7890.1.3.1.1.6.100.105.115.116.114.111", "-Oqv", "UCD-SNMP-MIB");
# NET-SNMP-EXTEND-MIB::nsExtendOutput1Line.\"distro\"
$features = snmp_get($device, ".1.3.6.1.4.1.8072.1.3.2.3.1.1.6.100.105.115.116.114.111", "-Oqv", "NET-SNMP-EXTEND-MIB");
$features = str_replace("\"", "", $features);
if (!$features) { # No "extend" support, try legacy UCD-MIB shell support
$features = snmp_get($device, ".1.3.6.1.4.1.2021.7890.1.3.1.1.6.100.105.115.116.114.111", "-Oqv", "UCD-SNMP-MIB");
$features = str_replace("\"", "", $features);
}
if (!$features) { # No "extend" support, try "exec" support
$features = snmp_get($device, ".1.3.6.1.4.1.2021.7890.1.101.1", "-Oqv", "UCD-SNMP-MIB");
$features = str_replace("\"", "", $features);