Welcome, Guest. Please login or register.

Author Topic: Def Files for Mellanox  (Read 2741 times)

dervossibaer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Def Files for Mellanox
« on: September 01, 2020, 03:26:19 pm »
does anybody have def files for Mellanox SN series switches ? what do i have to do to build a new operating system (onyx) into nedi ? Thank you for your cooperation !

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2893
    • View Profile
    • NeDi
Re: Def Files for Mellanox
« Reply #1 on: September 03, 2020, 11:34:37 am »
I see 3 Mellanox .defs dating back to 2017. Those should help to get started. Adding a new OS needs coding either by advanced users, who send me the changes. I can do it in conjunction with paid consulting and remote access...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

Hannu Liljemark

  • Full Member
  • ***
  • Posts: 153
  • Here to help
    • View Profile
Re: Def Files for Mellanox
« Reply #2 on: September 04, 2020, 09:23:31 am »
dervossibaer, you could look at https://forum.nedi.ch/index.php?topic=1957.0 sample I created few years ago to get basic support for new OS.

dervossibaer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Def Files for Mellanox
« Reply #3 on: October 29, 2020, 03:12:48 pm »
Thanks for the tip ! 
Find the attached File for Mellanox MSN2100.

You also need to add  to /var/nedi/inc/libcli.pm

# MELLANOX
$cmd{'ONYX'}{'ropr'} = '(.+?)>\s?$';
$cmd{'ONYX'}{'enpr'} = '(.+?)#\s?$';
$cmd{'ONYX'}{'enab'} = 'enable';
$cmd{'ONYX'}{'page'} = 'terminal length 998';
$cmd{'ONYX'}{'shru'} = 'show running-config';
$cmd{'ONYX'}{'cfto'} = 20;
$cmd{'ONYX'}{'cfst'} = '.';
$cmd{'ONYX'}{'cfen'} = 'cli default prefix-modes enable';
$cmd{'ONYX'}{'erm'} = 'invalid input|Unknown | failed|Incorrect usage';

and Patch /var/nedi/html/Other-Defed.php  or Other-Defgen.php
so that it looks like this :

                                <option value="Maipu"<?= ($os == "Maipu")?" selected":"" ?>>Maipu
                                <option value="">--------
                                <option value="ONYX"<?= ($os == "ONYX")?" selected":"" ?>>Mellanox ONYX
                                <option value="">--------
                                <option value="Omnipath"<?= ($os == "Omnipath")?" selected":"" ?>>Omnipath

Than you can Select ONYX as OS in Defed.

i´m Still struggeling with the SSH Timeouts. The Mellanox Switches take about 5 Sek after sending "sh running" until they respond with the Config.
This sometimes works, but most of the Time it does not work. In Case of Failure i see in /TMP/IPofDevice-output.log the following

CLI8:Matched enable prompt, OK
DBG :CMD=terminal length 998 ERR=invalid input|Unknown | failed|Incorrect usage
DBG :RES=
CMDR:terminal length 998 result is OK
DBG :CMD=show running-config ERR=invalid input|Unknown | failed|Incorrect usage
CMDR:show running-config result is OK
ERR :No config ()[/b][/b]
DBG :Elevate=1 Min=0 Mode=B Notify=abcdefijlmnopstw
EVNT:MOD=B/1 L=150 CL=cfge TGT=MLNX-TEST MSG=Config backup error: 0

So it Seems that the Switch does not send Config. or Config is not detected.

And it´s ugly, that Mellanos does not Support "TERM LEN 0" only "Term Len 999" 
Still going down the Road ! NEDI ROCKS !

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2893
    • View Profile
    • NeDi
Re: Def Files for Mellanox
« Reply #4 on: November 03, 2020, 01:46:38 pm »
Thanks :-)

I'll review and add your contribution...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

dervossibaer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Def Files for Mellanox
« Reply #5 on: March 26, 2021, 02:11:21 pm »
after struggeling around with paging / timeout i think i found a solution :


# MELLANOX
$cmd{'ONYX'}{'ropr'} = '(.+?)>\s?$';
$cmd{'ONYX'}{'enpr'} = '(.+?)#\s?$';
$cmd{'ONYX'}{'enab'} = 'enable';
$cmd{'ONYX'}{'page'} = 'no cli session paging enable';
$cmd{'ONYX'}{'shru'} = 'show running-config';
$cmd{'ONYX'}{'cfto'} = 20;
$cmd{'ONYX'}{'cfst'} = '.';
$cmd{'ONYX'}{'cfen'} = 'cli default prefix-modes enable';
$cmd{'ONYX'}{'erm'} = 'invalid input|Unknown | failed|Incorrect usage';

dervossibaer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Def Files for Mellanox
« Reply #6 on: March 26, 2021, 02:19:36 pm »
attached you?ll find the most featured DEF Files !