mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +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:
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 = $config['snmpbulkwalk'] . " -m IF-MIB -O nsq -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
||||||
$cmd .= " ifDescr";
|
$cmd .= " ifDescr";
|
||||||
if ($debug) echo("$cmd");
|
if ($debug) echo("$cmd\n");
|
||||||
$interfaces = trim(shell_exec($cmd));
|
$interfaces = trim(shell_exec($cmd));
|
||||||
$interfaces = str_replace("\"", "", $interfaces);
|
$interfaces = str_replace("\"", "", $interfaces);
|
||||||
$interfaces = str_replace("ifDescr.", "", $interfaces);
|
$interfaces = str_replace("ifDescr.", "", $interfaces);
|
||||||
@@ -38,8 +38,8 @@
|
|||||||
if(!$config['allow_ng']) {
|
if(!$config['allow_ng']) {
|
||||||
if (preg_match('/ng[0-9]+$/', $if)) { $nullintf = 1; }
|
if (preg_match('/ng[0-9]+$/', $if)) { $nullintf = 1; }
|
||||||
}
|
}
|
||||||
|
if ($debug) echo("\n $if ");
|
||||||
if ($nullintf == 0) {
|
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') {
|
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')");
|
mysql_query("INSERT INTO `interfaces` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','$ifDescr')");
|
||||||
# Add Interface
|
# Add Interface
|
||||||
@@ -55,13 +55,11 @@
|
|||||||
$int_exists[] = "$ifIndex";
|
$int_exists[] = "$ifIndex";
|
||||||
} else {
|
} else {
|
||||||
# Ignored Interface
|
# 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') {
|
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'");
|
mysql_query("UPDATE `interfaces` SET `deleted` = '1' WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'");
|
||||||
# Delete Interface
|
# Delete Interface
|
||||||
echo("-"); ## Deleted Interface
|
echo("-"); ## Deleted Interface
|
||||||
} else {
|
} else {
|
||||||
echo("$if\n");
|
|
||||||
echo("X"); ## Ignored Interface
|
echo("X"); ## Ignored Interface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
echo("Caching Oids: ");
|
echo("Caching Oids: ");
|
||||||
foreach ($ifmib_oids as $oid) { echo("$oid "); $array = snmp_cache_oid($oid, $device, $array, "IF-MIB");}
|
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");
|
echo("\n");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user