Commit 2a15da9b authored by Robert Ricci's avatar Robert Ricci

HP support for snmpit, written by Keith Sklower at Berkeley. Should

still be considered experimental, but I beleive DETER has been running
it for some time now.

Note: I have not modified these files (including the copyright) in any
way: ie. Keith himself put the EMULAB-LGPL tag in the header of the
new file.
parent 312337fa
This diff is collapsed.
#!/usr/bin/perl -w
#
# This file was modified from an Netbed/Emulab module.
# Modfications Copyright (c) 2004, Regents, University of California.
#
# EMULAB-COPYRIGHT
# EMULAB-LGPL
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2004-2008 Regents, University of California.
# All rights reserved.
#
#
# snmpit module for Nortel level 2 switches
#
......@@ -997,7 +996,7 @@ sub listVlans($) {
foreach $ifIndex (@portlist) {
($node) = $self->convertPortFormat($PORT_FORMAT_NODEPORT,$ifIndex);
if (!$node) {
$modport = $self->convertPortFormat
($modport) = $self->convertPortFormat
($PORT_FORMAT_MODPORT,$ifIndex);
$node = $self->{NAME} . ":$modport";
}
......
......@@ -2,8 +2,8 @@
#
# EMULAB-LGPL
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# Copyright (c) 2004-2006 Regents, University of California.
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2004-2008 Regents, University of California.
# All rights reserved.
#
......@@ -123,6 +123,12 @@ sub new($$$@) {
$device = new snmpit_nortel($devicename,$self->{DEBUG});
last;
}; # /nortel.*/
(/hp/)
&& do {
use snmpit_hp;
$device = new snmpit_hp($devicename,$self->{DEBUG});
last;
}; # /hp.*/
die "Device $devicename is not of a known type, skipping\n";
}
......@@ -513,7 +519,6 @@ sub findVlans($@) {
{ warn "Incompatible 802.1Q tag assignments for $id\n" .
" Saw $num on $device->{NAME}, but had " .
"$oldnum before\n";}
} else
{ $mapping{$id} = $num; }
}
......
......@@ -30,6 +30,7 @@ use snmpit_lib;
use snmpit_cisco;
use snmpit_foundry;
use snmpit_nortel;
use snmpit_hp;
use SNMP;
use Getopt::Long;
......@@ -164,6 +165,8 @@ SWITCH:
$switchtype = "intel"; last;};
(/^nortel/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "nortel"; last;};
(/^hp/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "hp"; last;};
(/^foundry/) && do { $snmpversion = "1"; $useindexing = 0;
$switchtype = "foundry"; last;};
......@@ -211,6 +214,9 @@ SWITCH:
if ($switchtype eq "nortel") {
$device = new snmpit_nortel($switch,$debug,$community);
}
if ($switchtype eq "hp") {
$device = new snmpit_hp($switch,$debug,$community);
}
}
#
......@@ -362,7 +368,7 @@ SWITCH:
#
my $modport;
if (($switchtype eq "cisco") || ($switchtype eq "foundry") ||
($switchtype eq "nortel")) {
($switchtype eq "hp") || ($switchtype eq "nortel")) {
($modport) = $device->convertPortFormat(2, $ifIndex);
} else {
$modport = "1.$ifIndex";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment