Closed M0NsTeRRR closed 5 months ago
Hello @adn77
I will prepare fsos device type for v2, can you tell me if :
terminal width
exists in your OS and the maximum valueRegards,
terminal length <0-512> Number of lines on screen (0 for no pausing)
terminal width <0-256>
but apparently the CLI prompt is truncated at 78 characters.Thanks again for all your support! I believe it's worth it as there are quite a few devices running FSOS 2.x.y ๐
Thanks you, when you set an hostname with 40 characters does your prompt is truncated like mysuperlonghostname#
to mysuperlong#
?
Can you give me an output example with a long and short hostname ?
No, the prompt is always prefixed with the max. 40 character hostname. The actual command is truncated to show only the remaining characters (totalling max. 78)
Okay does terminal width 256
display 256 chars max in the terminal ?
The only command I was able to verify this with is show core-dump
which actually prints lines longer than 256 chars, broken to the next line.
Okay we should be fine so
I don't know if I understand the PR correctly, at least the command for saving the config is not Cisco like, but simply write
instead....
On v1 it's copy run start
and you need to put the filename instead of a confirmation.
On v2 how does it works ? You simply write write
and that's all ? No confirmation ?
yes it's write
unless you want to save special types of configs:
fs02#write ?
all -- Save all configuration file
bvss-config -- Save current bvss configuration
ifindex -- Save current ifindex
vos-config -- Save current vos configuration
<cr>
fs02#write
Saving current configuration...
OK!
fs02#
Configuration mode is entered via config
.
The prompt will always be hostname_config.*#
, e.g.
fs02#config
fs02_config#int gigaEthernet0/1
fs02_config_g0/1#
This is the CLI guide: https://resource.fs.com/mall/doc/20230214154759x25y4r.pdf
I am sorry to bother you with those details.
Thanks you, no it's fine don't worry thanks for your feedback. Can you provide me show version output to add ssh detection ?
Looks like terminal length
and terminal width
only work AFTER enable
- that's why my show interface brief
never returns - it's waiting while paginating ๐
The show version
can also be seen in this output:
Welcome to FS S3900-48T6S-R Ethernet Switch
fs01>
fs01>terminal width 511
terminal width 511
^
Unknown command
fs01>terminal length 0
terminal length 0
^
Unknown command
fs01>
fs01>
fs01>enable
fs01#
fs01#
fs01#
fs01#
fs01#show version
Fiberstore Co., Limited Internetwork Operating System Software
S3900-48T6S-R Series Software, Version 2.2.0F Build 107821, RELEASE SOFTWARE
Copyright (c) 2021 by FS.COM All Rights Reserved
Compiled: 2022-12-22 9:40:43 by SYS, Image text-base: 0x80010000
ROM: System Bootstrap, Version 0.1.9,hardware version:A
Serial num:CG2206232992Nxxxxx, ID num:0020083905324
System image file is "Switch.bin"
FS S3900-48T6S-R RISC
524288K bytes of memory,16384K bytes of flash
Base ethernet MAC Address: 64:9d:99:xx:yy:zz
PCB version:J
snmp info:
vend_ID:52642 product_ID:2039 system_ID:1.3.6.1.4.1.52642.1.2039.0
fs01 uptime is 19:11:58:47, The current time: 2023-2-27 20:33:53
Reboot history information:
No. 1: System is rebooted by power-on
fs01#
Oh okay good to know i will update this :) thanks for your feedback
@M0NsTeRRR how would I test your Netmiko PR?
Hello,
Sorry for the late reply.
You can clone my work https://github.com/M0NsTeRRR/netmiko
, install poetry, install dependencies with poetry and build the package.
You will get a dist folder with a .whl
.
On your project force the reinstallation of netmiko library with my custom one with pip install netmiko-4.1.3-py3-none-any.whl --force-reinstall
After that you can test it by changing self.device_type
to fsos_v2
.
Warning for this driver enable mode is required due to terminal width
command.
Hello @adn77,
Waiting your feedback before asking a review for my netmiko PR :)
Regards,
Sorry for taking sooo long. What can I say - it works :)
Welcome to FS S3900-48T6S-R Ethernet Switch
fs01>
fs01>
fs01>
fs01>enable
fs01#
fs01#terminal width 256
fs01#terminal length 0
fs01#
fs01#
fs01#
fs01#show version
Fiberstore Co., Limited Internetwork Operating System Software
S3900-48T6S-R Series Software, Version 2.2.0F Build 107821, RELEASE SOFTWARE
Copyright (c) 2021 by FS.COM All Rights Reserved
Compiled: 2022-12-22 9:40:43 by SYS, Image text-base: 0x80010000
ROM: System Bootstrap, Version 0.1.9,hardware version:A
Serial num:CG2206232992Nxxxxx, ID num:0020083905324
System image file is "Switch.bin"
FS S3900-48T6S-R RISC
524288K bytes of memory,16384K bytes of flash
Base ethernet MAC Address: 64:9d:99:xx:yy:zz
PCB version:J
snmp info:
vend_ID:52642 product_ID:2039 system_ID:1.3.6.1.4.1.52642.1.2039.0
fs01 uptime is 62:09:30:24, The current time: 2023-4-11 18:20:8
Reboot history information:
No. 1: System is rebooted by power-on
fs01#
fs01#
fs01#show interface brief
Port Description Status Vlan Duplex Speed Type
g0/1 down 1 auto auto Giga-TX
g0/2 down 1 auto auto Giga-TX
...
g0/47 down 1 auto auto Giga-TX
g0/48 down 1 auto auto Giga-TX
tg0/49 down 1 full 10000Mb 10Giga-FX
tg0/50 up 1 full 10000Mb 10Giga-FX-SFP
tg0/51 down 1 full 10000Mb 10Giga-FX
tg0/52 down 1 full 10000Mb 10Giga-FX
tg0/53 down 1 full 10000Mb 10Giga-FX
tg0/54 down 1 full 10000Mb 10Giga-FX
v1 up
n0 up
fs01#
fs01#exit
Looks like the netmiko PR is good to go! Thanks for pursuing this.
Alex
No problem thanks for your feedback :)
Does this look familiar? https://resource.fs.com/mall/doc/202309041627276v45dm.zip
Maybe you want to ask them to provide you a free sample ๐
Oh didn'see that. No it doesn't look to be a copy/paste and it's really bad code but you can't expect much from them. Thanks for the notification also I will remind netmiko maintainer if they can work on our PR.
I finally got some time today to have a deeper look at the driver. I am familiar with Ansible but not with Napalm.
Today I managed to execute a cli call but I had to concate the entire command in string with \n linebreaks.
As far as I understood, your driver implements all Napalm methods and overloads the ones not matching pre-defined IOS commands?! How far does this get you? I imagine for proper automation one would rely on config backup/restore based on Jinja2 templates instead of implementing every possible command?
Yes i've implemented all napalm driver methods (if I didnt miss one) as documented here. My driver doesnt depend on other drivers. I've created this driver for an homelab purpose I love automation and I've a FS switch. At my current work (Telecom operator) we use enterprise software like Cisco NSO and I'm developping services on top of it. For backup you could rely on Oxidized/Rancid (I don't know if it works with fs switch, it's in my to do list). Of course you could rely on ansible and jinja templating to update your configuration, you could also tell the device to boot with a minimal configuration that allow to get the full configuration on a HTTP server. Some people have stored theirs configurations in Netbox too (you can find some examples on google). There is many possibilities :)
Hello @adn77,
I've you been able to create your driver ? If yes would you like to post it under napalm-automation-community
to know if I ask maintainer again for a new repo.
Regards,
To be honest I fell back to using ssh with "expect" ๐ฆ
I only came to NAPALM because of it being mentioned as a Netbox plugin. I don't know what people are doing with it, but my requirements are rather basic, such as configuring port channel on uplink interfaces and assigning trunk/access ports with their respective VLANs.
We have about 30 of these devices (all documented in Netbox)... I feel embarrassed to ask, could you give me some pointers as to how I would make actual use of NAPALM here? Do I have to template out the entire config using Jinja and would I only use the cli command in NAPALM for uploading of the config?
Maybe this is the piece of information missing in my puzzle... hopefully this will get my motivation back to focus on finishing the driver.
Thanks as always! Alex
Hello,
Thanks for your feedback. Regarding netbox you have an example in the documentation. It's used for fetching operational data : https://demo.netbox.dev/static/docs/additional-features/napalm/ Napalm just give you an abstract layer. For example if you want to get a VLAN on a switch without be worried about vendor. For configuration purpose it remains limited.
I will close the issue, we can still discuss here :)
Create FSOS device type in netmiko library to replace cisco_ios implementation to fix
terminal width <value>
unknown command. Netmiko session log