syntaxer run

git-svn-id: http://www.observium.org/svn/observer/trunk@2964 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-05 16:17:41 +00:00
parent 04ec17134b
commit ed6ffa6067
17 changed files with 56 additions and 77 deletions

View File

@@ -7,17 +7,17 @@ $this_vlans = array();
include("includes/discovery/q-bridge-mib.inc.php");
include("includes/discovery/cisco-vlans.inc.php");
foreach($this_vlans as $vlan)
foreach ($this_vlans as $vlan)
{
/// Pull Tables for this VLAN
#/usr/bin/snmpbulkwalk -v2c -c kglk5g3l454@988 -OQUs -m BRIDGE-MIB -M /opt/observium/mibs/ udp:sw2.ahf:161 dot1dStpPortEntry
#/usr/bin/snmpbulkwalk -v2c -c kglk5g3l454@988 -OQUs -m BRIDGE-MIB -M /opt/observium/mibs/ udp:sw2.ahf:161 dot1dBasePortEntry
if(is_numeric($vlan) && ($vlan <1002 || $vlan > 1105)) /// Ignore reserved VLAN IDs
if (is_numeric($vlan) && ($vlan <1002 || $vlan > 1105)) /// Ignore reserved VLAN IDs
{
if($device['os_group'] == "cisco" || $device['os'] == "ios") /// This shit only seems to work on IOS
if ($device['os_group'] == "cisco" || $device['os'] == "ios") /// This shit only seems to work on IOS
{
$vlan_device = array_merge($device, array('community' => $device['community']."@".$vlan));
$vlan_data = snmpwalk_cache_oid($vlan_device, "dot1dStpPortEntry", array(), "BRIDGE-MIB:Q-BRIDGE-MIB");
@@ -32,7 +32,7 @@ foreach($this_vlans as $vlan)
str_pad("Priority", 10).str_pad("State", 15).str_pad("Cost", 10)."\n");
}
foreach($vlan_data as $vlan_port_id => $vlan_port)
foreach ($vlan_data as $vlan_port_id => $vlan_port)
{
$port = get_port_by_index_cache($device, $vlan_port['dot1dBasePortIfIndex']);
echo(str_pad($vlan_port_id, 10).str_pad($vlan_port['dot1dBasePortIfIndex'], 10).
@@ -50,7 +50,7 @@ foreach($this_vlans as $vlan)
$from_db = dbFetchRow("SELECT * FROM `ports_vlans` WHERE device_id = ? AND interface_id = ? AND `vlan` = ?", array($device['device_id'], $port['interface_id'], $vlan));
if($from_db['port_vlan_id'])
if ($from_db['port_vlan_id'])
{
dbUpdate($db_a, 'ports_vlans', "`port_vlan_id` = ?", $from_db['port_vlan_id']);
echo("Updated");
@@ -68,7 +68,6 @@ foreach($this_vlans as $vlan)
}
$device_vlans = mysql_query("SELECT * FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "'");
while ($dev_vlan = mysql_fetch_assoc($device_vlans))
{
@@ -87,5 +86,4 @@ while ($dev_vlan = mysql_fetch_assoc($device_vlans))
unset($this_vlans);
?>