only collect ADSL stats if we have a port type 'adsl'

git-svn-id: http://www.observium.org/svn/observer/trunk@1441 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-20 13:10:18 +00:00
parent f63e913a0e
commit 80a074e021
2 changed files with 6 additions and 2 deletions

View File

@ -40,7 +40,7 @@
# adslAturPerfValidIntervals.1 = 0
# adslAturPerfInvalidIntervals.1 = 0
if($array[$device[device_id]][$port[ifIndex]]['adslLineCoding']) { // Check to make sure Port data is cached.
if(isset($array[$device[device_id]][$port[ifIndex]]['adslLineCoding'])) { // Check to make sure Port data is cached.
$this_port = &$array[$device[device_id]][$port[ifIndex]];

View File

@ -31,7 +31,11 @@
foreach ($ifmib_oids as $oid) { echo("$oid "); $array = snmp_cache_oid($oid, $device, $array, "IF-MIB");}
if($config['enable_ports_etherlike']) { echo("dot3Stats "); $array = snmp_cache_oid("dot3StatsEntry", $device, $array, "EtherLike-MIB"); }
if($config['enable_ports_adsl']) {
if($config['enable_ports_adsl']) {
$device['adsl_count'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `device_id` = '".$device['device_id']."' AND `ifType` = 'adsl'"),0);
}
if($device['adsl_count'] > "0") {
echo("ADSL ");
$array = snmp_cache_oid(".1.3.6.1.2.1.10.94.1.1.1.1", $device, $array, "ADSL-LINE-MIB");
$array = snmp_cache_oid(".1.3.6.1.2.1.10.94.1.1.2.1", $device, $array, "ADSL-LINE-MIB");