From dac776bc06612816595afb2d8de43e92900ec801 Mon Sep 17 00:00:00 2001 From: Robert Ricci Date: Wed, 13 Mar 2002 23:22:56 +0000 Subject: [PATCH] Add Intel support to portstats. --- tbsetup/portstats.in | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tbsetup/portstats.in b/tbsetup/portstats.in index 7c25b87f0..f466f9f51 100755 --- a/tbsetup/portstats.in +++ b/tbsetup/portstats.in @@ -15,7 +15,6 @@ use lib '@prefix@/lib'; use libdb; use snmpit_lib; -use snmpit_cisco; use English; use Getopt::Long; @@ -156,7 +155,23 @@ foreach my $name (keys %portMap) { # # Connect to the switch and get the data we want off of it # - my $device = new snmpit_cisco($name); + my $type = getDeviceType($name); + my $device; + SWITCH: for ($type) { + /cisco/ && do { + require snmpit_cisco; + $device = new snmpit_cisco($name); + last; + }; + /intel/ && do { + require snmpit_intel; + $device = new snmpit_intel($name); + last; + }; + + # 'default' case + die "Unknown switch type ($type) for $name\n"; + } my @results = $device->getFields(\@ports,\@oids); foreach my $result (@results) { -- GitLab