remove external snmpget invocation for q-bridge-mib discovery

git-svn-id: http://www.observium.org/svn/observer/trunk@2941 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-01 14:40:56 +00:00
parent ef6b649f5c
commit 0c13f1ad6b
+3 -5
View File
@@ -10,17 +10,15 @@ if ($vlanversion == 'version1')
$vlans = snmp_walk($device, "dot1qVlanFdbId", "-Oqn", "Q-BRIDGE-MIB");
$vlan_array = snmpwalk_cache_multi_oid($device, "dot1qVlanStaticName", $vlan_array, "Q-BRIDGE-MIB");
foreach (explode("\n", $vlans) as $vlan_oid)
{
list($oid,$vlan_index) = explode(' ',$vlan_oid);
$oid_ex = explode('.',$oid);
$vlan = $oid_ex[count($oid_ex)-1];
$vlan_descr_cmd = $config['snmpget'] . " -M " . $config['mibdir'] . " -m Q-BRIDGE-MIB -O nvq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
$vlan_descr_cmd .= "dot1qVlanStaticName.$vlan|grep -v \"No Such Instance currently exists at this OID\"";
$vlan_descr = shell_exec($vlan_descr_cmd);
$vlan_descr = trim(str_replace("\"", "", $vlan_descr));
$vlan_descr = trim(str_replace("\"", "", $vlan_array[$vlan]['dot1qVlanStaticName']));
if (mysql_result(mysql_query("SELECT COUNT(vlan_id) FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "' AND `vlan_domain` = '' AND `vlan_vlan` = '" . $vlan . "'"), 0) == '0')
{