Commit 2a9a0d06 authored by Kirk Webb's avatar Kirk Webb

Small bits to tie in and install the Mellanox snmpit module.

parent 549941b6
......@@ -38,7 +38,8 @@ LIB_STUFF = portstats snmpit_intel.pm \
snmpit_cisco_stack.pm snmpit_intel_stack.pm \
snmpit_foundry.pm snmpit_stack.pm snmpit_remote.pm \
snmpit_nortel.pm snmpit_hp.pm snmpit_apcon.pm \
snmpit_arista.pm snmpit_arista_switch_daemon.py
snmpit_arista.pm snmpit_arista_switch_daemon.py \
snmpit_mellanox.pm
#
# Force dependencies on the scripts so that they will be rerun through
......
......@@ -347,6 +347,11 @@ DEVICE: foreach my $name (keys %portMap) {
$device = new snmpit_arista($name);
last;
};
/mellanox/ && do {
require snmpit_mellanox;
$device = new snmpit_mellanox($name);
last;
};
# 'default' case
warn "WARNING: Unknown switch type ($type) for $name, skipping some ports\n";
......
......@@ -76,7 +76,7 @@ my $PORT_FORMAT_MLNX = 3;
# Creates a new object.
#
# usage: new($classname,$devicename,$debuglevel,$community)
# returns a new object, blessed into the snmpit_arista class.
# returns a new object, blessed into the snmpit_mellanox class.
#
sub new($$$;$) {
......@@ -1543,10 +1543,6 @@ sub disablePortTrunking($$) {
#
# On sucess, returns a two-dimensional list indexed by port,oid
#
# Note: Since we mostly use XML-RPC to communicate with Arista switch,
# this function is just borrowed from snmpit_hp without any big
# change. Let's hope it can work...
#
sub getFields($$$) {
my $self = shift;
my ($ports,$oids) = @_;
......
......@@ -1618,6 +1618,12 @@ sub snap($) {
$device = new snmpit_arista($devicename, $self->{DEBUG});
last;
}; # /arista.*/
(/mellanox/)
&& do {
require snmpit_mellanox;
$device = new snmpit_mellanox($devicename,$self->{DEBUG});
last;
}; # /mellanox.*/
print "Device $devicename is not of a known type\n";
}
if (!$device) {
......
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