Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor Extrem Network : model not parsed correctly for AP3xx / AP7532 #212

Open
dev-osuri opened this issue Nov 30, 2023 · 8 comments
Open

Comments

@dev-osuri
Copy link

Hello,

We have trouble with some Extrem Network devices details :

image

Here are the mibs of the equipments:
AP3xx-mibs-7.7.1.8-009R.tar.gz
AP7532-mibs-7.7.1.8-009R.tar.gz

@inphobia
Copy link
Member

what os version are these running? i'm guessing "wing"?

ap's running "iq engine" aka aerohive's hiveos should be supported.

@dev-osuri
Copy link
Author

dev-osuri commented Feb 27, 2024

yes we are using "wing".

We have several thousands of those devices and os versions may vary, 5.X (5.9.1 on the screenshot), 7.7 etc etc but it's difficult to say while Netdisco doesn't parse them accurately :)

@inphobia
Copy link
Member

at least with the latest mib release this object translates:

👀 Building MIBs index
✔ Index rebuilt (0 errors, 105 vendors, 4585 mibs).
≈ translating for 'all'
WING-MIB::wingSysoidAp7532
⚑ Translate done.

now, if i read the code correctly, somewhere along the line snmp::info will have to have read the mib to find a translation, and since we don't have explicit support for wing devices their mibs are most likely never loaded.

since i'm curious, could you modify Layer3.pm?

in
%MIBS = (

add:

    'WING-MIB' => 'wingCfgMgmtName',
    'WS-SMI'   => 'ws2000',

this should return the translated value for that oid then, which should result in wingSysoidAp7532. this is the best we can do for generic modules.

returning the vendor might also be possible, if by vendor you're ok with whatever name is mapped to the enterprise registration, in this case this will return sysbol

for that you'll need to modify the sub vendor { part. after the return brocade line you need to take the value returned by id(). this value will start wil .1.3.6.1.4.1 , you'll then need to get the next number and discard everything following that. run in through translateObj and you'll get the name of whoever the enterprise id is registered to.

haven't tested the code example, and have no idea what impact this will have. i think it will at least populate the vendor & model and the values of whatever Layer3.pm supports if they are exactly implemented as the mibs describe.

@inphobia
Copy link
Member

perhaps Layer3.pm could try & bit harder also return something from entity-mib if supported, but that could just make it a huge mess depending if those values make little sense or tend to change a lot (new os, diffent hw, etc)...
while translateoid gives some assurenance the values will not be all over the place, entity allows a bit more freeform. Entity.pm will do it's best to return consistent values between runs.

@dev-osuri
Copy link
Author

I've done the first change in Layer3.pm and now it looks like this :
ndex
so it's better :)
an ugly name is still better than "unknown" :)

I'll look in the second change soon.

In our context the biggest added value by netdisco is the model/version inventory part so it would nice to have have them correctly parsed.

I'll keep you posted after the second change.

thanks for your help.

@inphobia
Copy link
Member

if all you want is pretty formatted vendor , model and perhaps os release, that can probably be done in under an hour. but providing a module creates expectations, such as mapping clients to ssid etc...

@dev-osuri
Copy link
Author

dev-osuri commented Feb 29, 2024

everybody here like netdisco because it's easy to handle without having big network knowledge, so our main goal is to have all of our big network mapped in netdisco with the following informations : FQDN, IP, serial number, vendor, model, os, os version.
At the moment everything else is "only" nice to have. ( Port mapping for switches is also used by some teams but it's already working :-) )

So i can promise you that if the vendor/model/os/os version can work for extreme network devices we won't open a new ticket for ssid & co anytime soon ;)

@inphobia
Copy link
Member

haven't tested this but should be fairly close.

  1. revert the change in Layer3.pm
  2. change Info.pm
  3. add Wing.pm under Layer3 directory

if you still use that hack from previously in this thread, but back the original file

the in the main Info.pm file look for

        #   Cisco Small Business (300 500) series override
        #   This is for enterprises(1).cisco(9).otherEnterprises(6).ciscosb(1)
        $objtype = 'SNMP::Info::Layer2::CiscoSB'
            if ( $soid =~ /^\.?1\.3\.6\.1\.4\.1\.9\.6\.1/ );

below this add

        #   extreme wing ap
        #   This is for enterprises(1).symbol(388).wingMIB(50)
        $objtype = 'SNMP::Info::Layer3::Wing'
            if ( $soid =~ /^\.?1\.3\.6\.1\.4\.1\.388\.50/ );

create a file under Layer3/ named Wing.pm (you might need to change the VERSION to match what you're running:

package SNMP::Info::Layer3::Wing;
#
# Copyright (c) 2019 nick nauwelaerts
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#     * Redistributions of source code must retain the above copyright notice,
#       this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of the University of California, Santa Cruz nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

use strict;
use warnings;

use Exporter;
use SNMP::Info::Layer3;

@SNMP::Info::Layer3::Wing::ISA = qw/
    SNMP::Info::Layer3
    Exporter
/;
@SNMP::Info::Layer3::Wing::EXPORT_OK = qw//;

our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE);

$VERSION = '3.95';

%MIBS = (
    %SNMP::Info::Layer3::MIBS,
    'WING-MIB' => 'wingCfgMgmtName',
    'WS-SMI'   => 'ws2000',
);

%GLOBALS = (
    %SNMP::Info::Layer3::GLOBALS,
    'wing_serial' => 'wingStatsDevSysSerialNo',
    'wing_os_ver' => 'wingStatsDevSysVersion',
    'wing_model'  => 'wingStatsDevSysProductName',
);

%FUNCS = (
    %SNMP::Info::Layer3::FUNCS,
);

%MUNGE = (
    %SNMP::Info::Layer3::MUNGE,
);

sub vendor {
    return 'wing';
}

sub os_ver {
    my $redlion = shift;

    return $redlion->wing_os_ver();
}

sub model {
    my $redlion = shift;

    return $redlion->wing_model();
}

sub serial {
    my $redlion = shift;

    return $redlion->wing_serial();
}

# is actually just an embedded linux
# 'sn' refers to "sixnet", the original creators of the device
# layer2::sixnet is for redlion's switch offerings.
# (they also have a different enterprise oid)
sub os {
    return 'wing';
}

1;

__END__

=head1 NAME

SNMP::Info::Layer3::Wing - SNMP Interface to redlion routers

=head1 AUTHORS

nick nauwelaerts

=head1 SYNOPSIS

    # Let SNMP::Info determine the correct subclass for you.
    my $redlion = new SNMP::Info(
                          AutoSpecify => 1,
                          Debug       => 1,
                          DestHost    => 'myrouter',
                          Community   => 'public',
                          Version     => 2
                        )
    or die "Can't connect to DestHost.\n";

    my $class      = $redlion->class();
    print "SNMP::Info determined this device to fall under subclass : $class\n";

=head1 DESCRIPTION

Subclass for redlion routers.

=head2 Inherited Classes

=over

=item SNMP::Info::Layer3

=back

=head2 Required MIBs

=over

=item F<RED-LION-RAM-MIB>

=back

=head2 Inherited MIBs

See L<SNMP::Info::Layer3/"Required MIBs"> for its MIB requirements.

=head1 GLOBALS

These are methods that return scalar value from SNMP.

=over

=item $redlion->layers()

Returns '00000110' since sysServices returns undef.

=item $redlion->model()

Returns the model extracted from C<unitDescription>.

=item $redlion->os()

Returns 'sn'.

=item $redlion->os_ver()

Returns the os version extracted from C<unitFirmwareVersion>.

=item $redlion->serial()

Returns the serial extracted from C<unitSerialNumber>. Must be enabled
in the snmp setup of the device to show this.

=item $redlion->vendor()

Returns 'redlion'.

=back

=head2 Global Methods imported from SNMP::Info::Layer3

See L<SNMP::Info::Layer3/"GLOBALS"> for details.

=head1 TABLE ENTRIES

These are methods that return tables of information in the form of a reference
to a hash.

=head2 Table Methods imported from SNMP::Info::Layer3

See L<SNMP::Info::Layer3/"TABLE METHODS"> for details.

=cut

this mostly a copy/paste from Redlion.pm , and as you can see i list interest halfway through to renaming it to wing unless it was needed. manual part isn't even changed.
think these oid's have the best chance of working, but just to be clear:

Important

none of this is tested, haven't even tested it for syntax errors

it should however give you a base that should not need many changes to do what you want.

oids i use to get the relevant info are also a complete guess, but they seem likely candidates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants