updates (disable etherlike unless people really really want it)

git-svn-id: http://www.observium.org/svn/observer/trunk@568 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong 2009-12-29 01:00:57 +00:00
parent 1d1d458b63
commit 45a5fbc150
3 changed files with 3 additions and 1819 deletions

1814
IF-MIB.txt

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
$cmd = $config['snmpbulkwalk'] . " -m IF-MIB -O nsq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
$cmd .= " ifDescr";
if ($debug) echo("$cmd");
if ($debug) echo("$cmd\n");
$interfaces = trim(shell_exec($cmd));
$interfaces = str_replace("\"", "", $interfaces);
$interfaces = str_replace("ifDescr.", "", $interfaces);
@ -38,8 +38,8 @@
if(!$config['allow_ng']) {
if (preg_match('/ng[0-9]+$/', $if)) { $nullintf = 1; }
}
if ($debug) echo("\n $if ");
if ($nullintf == 0) {
if ($debug) echo("$if\n");
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) == '0') {
mysql_query("INSERT INTO `interfaces` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','$ifDescr')");
# Add Interface
@ -55,13 +55,11 @@
$int_exists[] = "$ifIndex";
} else {
# Ignored Interface
#echo("$if \n");
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) != '0') {
mysql_query("UPDATE `interfaces` SET `deleted` = '1' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'");
# Delete Interface
echo("-"); ## Deleted Interface
} else {
echo("$if\n");
echo("X"); ## Ignored Interface
}
}

View File

@ -30,7 +30,7 @@
echo("Caching Oids: ");
foreach ($ifmib_oids as $oid) { echo("$oid "); $array = snmp_cache_oid($oid, $device, $array, "IF-MIB");}
if($config['enable_etherlike']) { echo("dot3Stats "); $array = snmp_cache_oid("dot3StatsEntry", $device, $array, "EtherLike-MIB"); }
if($config['enable_ports_etherlike']) { echo("dot3Stats "); $array = snmp_cache_oid("dot3StatsEntry", $device, $array, "EtherLike-MIB"); }
echo("\n");