From 1550b1f5cdd18560985f0a19a294ddf5b5e33dfe Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 27 Sep 2011 10:07:39 +0000 Subject: [PATCH] poll q-bridge-mib for port VLAN, also fix links on device vlan tab git-svn-id: http://www.observium.org/svn/observer/trunk@2593 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-vlan.inc.php | 2 +- includes/polling/ports.inc.php | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/html/includes/print-vlan.inc.php b/html/includes/print-vlan.inc.php index 09d98428e..2b452dc6c 100644 --- a/html/includes/print-vlan.inc.php +++ b/html/includes/print-vlan.inc.php @@ -16,7 +16,7 @@ foreach (dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ? echo("
".makeshortif($port['ifDescr'])."
- ".$device['hostname']." - ".$port['ifDescr']."
\ ".$port['ifAlias']." \ \ diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index 5bf77dfae..dbc4fc903 100755 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -90,6 +90,8 @@ if ($device['os_group'] == "ios") } +$port_stats = snmpwalk_cache_oid($device, "dot1qPortVlanTable", $port_stats, "Q-BRIDGE-MIB"); + $polled = time(); /// End Building SNMP Cache Array @@ -192,12 +194,17 @@ foreach ($ports as $port) } /// Set VLAN and Trunk - if(isset($this_port['vlanTrunkPortEncapsulationOperType']) && $this_port['vlanTrunkPortEncapsulationOperType'] != "notApplicable") + if (isset($this_port['vlanTrunkPortEncapsulationOperType']) && $this_port['vlanTrunkPortEncapsulationOperType'] != "notApplicable") { $this_port['ifTrunk'] = $this_port['vlanTrunkPortEncapsulationOperType']; } $this_port['ifVlan'] = $this_port['vmVlan']; if(isset($this_port['vlanTrunkPortNativeVlan'])) { $this_port['ifVlan'] = $this_port['vlanTrunkPortNativeVlan']; } + + if (isset($this_port['dot1qPvid'])) + { + $this_port['ifVlan'] = $this_port['dot1qPvid']; + } /// Update IF-MIB data foreach ($data_oids as $oid)