Fix for Cisco kit where match prefix is switched off.

This commit is contained in:
laf
2014-03-05 15:02:04 +00:00
parent 6c64e98bdf
commit fe100a499a
2 changed files with 32 additions and 3 deletions
+17 -1
View File
@@ -765,12 +765,28 @@ function snmp_cache_portName($device, $array)
function snmp_gen_auth (&$device)
{
global $debug;
$vlan = FALSE;
if (isset($device['snmpcontext']))
{
if (is_numeric($device['snmpcontext']) && $device['snmpcontext'] > 0 && $device['snmpcontext'] < 4096 )
{
$vlan = $device['snmpcontext'];
}
}
$cmd = "";
if ($device['snmpver'] === "v3")
{
$cmd = " -v3 -n \"\" -l " . $device['authlevel'];
$cmd = " -v3 -l " . $device['authlevel'];
if(is_numeric($vlan))
{
$cmd .= ' -n "vlan-' . $vlan . '"';
} else {
$cmd .= ' -n ""';
}
if ($device['authlevel'] === "noAuthNoPriv")
{