mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 10:58:42 +00:00
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:
parent
1d1d458b63
commit
45a5fbc150
1814
IF-MIB.txt
1814
IF-MIB.txt
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user