Welcome, Guest. Please login or register.

Author Topic: WANTED - .def files for Raisecom Gazelle series  (Read 411 times)

pasubio

  • Newbie
  • *
  • Posts: 8
    • View Profile
WANTED - .def files for Raisecom Gazelle series
« on: July 31, 2017, 02:55:38 PM »
Hi,

I'm searching for .def files for Raisecom Gazelle switches, mostly for configuration backup (=> OS support).
The command CLI for printing configuration is:
Code: [Select]
show startup-config
I can see that operating system is:
Code: [Select]
ROS version ROS_5.1.1.420Anyone can help me?

Thank you very much!

Hannu Liljemark

  • Full Member
  • ***
  • Posts: 127
  • Here to help
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #1 on: August 01, 2017, 06:17:31 AM »
Have you tried looking into adding the support yourself? It's good fun to learn, and involves modifying libcli.pm and Other-Defgen.php. Here's an example where I added support for Extreme Network's wireless controller: http://forum.nedi.ch/index.php?topic=1957.msg7931#msg7931

Also http://forum.nedi.ch/index.php?topic=2038.0 is a good discussion from few months back.

Br,
Hannu
« Last Edit: August 01, 2017, 06:22:59 AM by Hannu Liljemark »

pasubio

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #2 on: August 01, 2017, 10:16:48 PM »
Thank you Hannu. I'm just trying this!
I will let you know

pasubio

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #3 on: August 02, 2017, 09:29:58 AM »
Version: NeDiO14
Added the following code to /var/nedi/inc/libcli.pm

Code: [Select]
# Raisecom
$cmd{'RaisecomOS'}{'ropr'} = '[\w.-]+\s>\s?$';
$cmd{'RaisecomOS'}{'enpr'} = '[\w.-]+\s#\s?$';
$cmd{'RaisecomOS'}{'enab'} = 'enable';
$cmd{'RaisecomOS'}{'shcf'} = 'show running-config';
$cmd{'RaisecomOS'}{'cfst'} = '\sSystem current configuration:';
$cmd{'RaisecomOS'}{'page'} = 'terminal page-break disable';

and new entry in /var/nedi/html/Other-Defgen.php.
I also created a specific .def file for my device using the "light bulb" completion.

Where are the files input.log and output.log used in CLI tutorial for debugging?

We have two kinds of problem:

1. in SNMP discovery:
Code: [Select]
IfAddresses  ------------------------------------------------------------------
IFIP:No useip policy set, always using discovered IPs
SNMP:Connect 172.18.0.222 public v2 Tout:2s MaxMS:1472 Retry:1 NB:0
IFIP:Walking ifaddress table
ERR :ifAddressTable The requested table is empty or does not exist

DisProtocol  ------------------------------------------------------------------
SNMP:Connect 172.18.0.222 public v2 Tout:7s MaxMS:4095 Retry:1 NB:0
ERR :LLDP nbr The requested table is empty or does not exist

Modules      ------------------------------------------------------------------
SNMP:Connect 172.18.0.222 public v2 Tout:2s MaxMS:1472 Retry:1 NB:0
MOD :Walking module description
ERR :Description The requested table is empty or does not exist

2. in backup configuration (the passwords are correct):
Code: [Select]
SSH :raisecom@172.18.0.222:22 Tout:2s OS:RaisecomOS EN:[\w.-]+\s#\s?$
PTY :Forking ssh -o 'StrictHostKeyChecking no' -l raisecom 172.18.0.222
CLI0:Connection refused
TEL :raisecom@172.18.0.222:23 Tout:2s OS:RaisecomOS EN:[\w.-]+\s#\s?$
CLI2:Matched 'Login:' sending username
CLI3:Username raisecom sent
CLI3:Matched 'Password:' sending password
CLI3:Password sent
ERR3:pattern match timed-out

Any hints?
Thank you


Hannu Liljemark

  • Full Member
  • ***
  • Posts: 127
  • Here to help
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #4 on: August 02, 2017, 11:46:49 AM »
Hi

If you simply login using telnet/putty, what does the switch prompt look like right after you've entered username and password? Does the prompt you see match the regexp you're using:

$cmd{'RaisecomOS'}{'ropr'} = '[\w.-]+\s>\s?$';
$cmd{'RaisecomOS'}{'enpr'} = '[\w.-]+\s#\s?$';

Sometimes the switch gives you full access after entering username and password, and it's not necessary to do "enable". For those cases you can see in libcli.pm for example:

$cmd{'FortiOS'}{'ropr'} = 'GitsDoNid';
$cmd{'FortiOS'}{'enpr'} = '[\w+().-]+\$\s?$';

There is no "$cmd{'FortiOS'}{'enab'} = 'enable';" because after login you have all the privileges you need.

So, I wonder how these Raisecom devices behave, if they require you to use a enable-like command or if you can do the "show startup-config" right after entering login and password? That will affect what you need for RaisecomOS in libcli.pm.

Br,
Hannu

pasubio

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #5 on: August 03, 2017, 09:09:02 AM »
Hi Hannu,

The  login/enable sequence on Raisecom device is the following:
  • Login: <username>
  • Password: <password>
  • HOSTNAME>enable
  • Password: <enablepassword>
  • HOSTNAME#show startup-config

Hannu Liljemark

  • Full Member
  • ***
  • Posts: 127
  • Here to help
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #6 on: August 03, 2017, 11:49:27 AM »
Okay, in that case I think the regexp should be modified to something like:

$cmd{'RaisecomOS'}{'ropr'} = '[\w.-]+>\s?$';
$cmd{'RaisecomOS'}{'enpr'} = '[\w.-]+#\s?$';

There's the \s removed since there's no whitespace between the hostname and the > or # part in the prompt.

Try that and then run the config backup again.

pasubio

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #7 on: August 03, 2017, 12:45:52 PM »
Bingo! Thank you Hannu.
Now I'm able to backup the configuration of my Raisecom devices.

If Remo want add the code, I leave it here below:
Code: [Select]
# Raisecom
$cmd{'RaisecomOS'}{'ropr'} = '[\w.-]+>\s?$';
$cmd{'RaisecomOS'}{'enpr'} = '[\w.-]+#\s?$';
$cmd{'RaisecomOS'}{'enab'} = 'enable';
$cmd{'RaisecomOS'}{'shcf'} = 'show running-config';
$cmd{'RaisecomOS'}{'cfst'} = '\sSystem current configuration:';
$cmd{'RaisecomOS'}{'page'} = 'terminal page-break disable';

Do you have any ideas for point 1 on SNMP discovery?

Hannu Liljemark

  • Full Member
  • ***
  • Posts: 127
  • Here to help
    • View Profile
Re: WANTED - .def files for Raisecom Gazelle series
« Reply #8 on: August 03, 2017, 01:52:31 PM »
Quote
IfAddresses  ------------------------------------------------------------------
IFIP:No useip policy set, always using discovered IPs
SNMP:Connect 172.18.0.222 public v2 Tout:2s MaxMS:1472 Retry:1 NB:0
IFIP:Walking ifaddress table
ERR :ifAddressTable The requested table is empty or does not exist

DisProtocol  ------------------------------------------------------------------
SNMP:Connect 172.18.0.222 public v2 Tout:7s MaxMS:4095 Retry:1 NB:0
ERR :LLDP nbr The requested table is empty or does not exist

Modules      ------------------------------------------------------------------
SNMP:Connect 172.18.0.222 public v2 Tout:2s MaxMS:1472 Retry:1 NB:0
MOD :Walking module description
ERR :Description The requested table is empty or does not exist

In Defgen check the ARP/ND and try the different methods to see which mechanism your switch supports for IfAddresses.

Same for DisProtocol - can you get any data from the switch if you try CDP, FDP or NDP? You may have to investigate the switch CLI or manuals to see if it supports LLDP/CDP even there.

Modules section is near the bottom of Defgen. I guess the defaults are for devices that support ENTITY-MIB. It may be that Raisecom doesn't support that... yet another thing to investigate.

If there's any publicly available MIB file available from Raisecom or in google, you might want to look at that and see if there's anything useful that could be used to pull the data.

Not all devices have support so you may be left without e.g. module or neighbour data.

I guess you can do this also in NEDIO: go to the OS using ssh, find nedi/sysobj directory and do:

grep Modesc * | awk '{print $2}'|grep -v '^$'|sort -u

Here there's currently 38 different OIDs one can use to pull module descriptions depending on device vendor, model and possible even software version. So, either Raisecom supports one of those, or there's something completely new OID which you need to find, or you can just leave the module section empty so Nedi doesn't try to poll the data if it's not available :)

Br,
Hannu
« Last Edit: August 03, 2017, 02:07:15 PM by Hannu Liljemark »