diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-09-02 21:51:08 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-09-02 21:51:08 -0700 |
commit | 31ddbad108b6c228b36f4ad850b7f2ff6565c0e7 (patch) | |
tree | 5f2a41495b4db4a7d9bd77cd216b3ca61a7f8812 /scripts/snmp | |
parent | 9e9d0de1e2df1b41aaba4fc3d9fa57e6448443e0 (diff) | |
download | vyatta-cfg-system-31ddbad108b6c228b36f4ad850b7f2ff6565c0e7.tar.gz vyatta-cfg-system-31ddbad108b6c228b36f4ad850b7f2ff6565c0e7.zip |
Remove ifDescr override
Net-snmp now generates ifDescr itself, so don't need
all the parsing and override stuff
Diffstat (limited to 'scripts/snmp')
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index d366f1ba..e077482c 100644 --- a/scripts/snmp/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl @@ -60,7 +60,6 @@ sub snmp_start { select $fh; snmp_get_constants(); snmp_get_values(); - snmp_get_descr(); snmp_get_traps(); close $fh; select STDOUT; @@ -250,75 +249,6 @@ EOF } } -# Use ethtool to find businfo -sub ether_businfo { - my $dev = shift; - my $bus; - - open( my $ethtool, "/usr/sbin/ethtool -i $dev 2>/dev/null |" ) - or die "ethtool failed: $!\n"; - - # ethtool -i produces: - # - # driver: sky2 - # version: 1.28 - # firmware-version: N/A - # bus-info: 0000:04:00.0 - while (<$ethtool>) { - chomp; - if (/^bus-info: ([0-9a-f:]+)/) { - $bus = $1; - last; - } - } - close $ethtool; - return $bus; -} - -# Use lspci to find hardware information -sub pci_name { - my $id = shift; - my $vendor = ""; - my $device; - my $revision = ""; - - return unless $id; - - open( my $lspci, '-|', "/usr/bin/lspci -v -mm -s $id") - or die "lspci failed: $!\n"; - - while (<$lspci>) { - chomp; - $vendor = "$1 : " if (/^Vendor:\s*(.*)$/); - $device = $1 if (/^Device:\s*(.*)$/); - $revision = " (rev $1)" if (/^Rev:\s*(.*)$/); - } - close $lspci; - - return unless $device; - return $vendor . $device . $revision; -} - -# Generate interface description information -sub snmp_get_descr { - opendir (my $sysfs, "/sys/class/net") - or die "Could not open /sys/class/net: $!"; - - while (my $dev = readdir $sysfs) { - next if ($dev =~ /^\./); - next unless open (my $ifindex, '<', "/sys/class/net/$dev/ifindex"); - - chomp (my $iif = <$ifindex>); - close $ifindex; - - my $descr = pci_name(ether_businfo($dev)); - next unless $descr; - - print "override ifDescr.$iif octet_str \"$descr\"\n"; - } -} - - # Configure SNMP client parameters sub snmp_client_config { my $config = new Vyatta::Config; |