oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Strip uptime from D-Link 3130 configs

Open morgens opened this issue 2 years ago • 7 comments

Hello! There is a model template for D-Link cisco-like cli devices called dlinknextgen https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/dlinknextgen.rb

For some newer models like DGS-3130 there are additional lines in the config with uptime and SNTP last sync date. Since I'm not very familiar with Ruby, I can't figure out how to remove those lines, and they change every time you get config from device.

Example config:

show running-config

!Current Configuration: ! !System Description "DGS-3130-54TS" !System Software Version "2.00.B044" !System Up Time "1 days 2 hrs 32 mins 36 secs" !Current SNTP Synchronized Time: May 29 07:25:16 2024 UTC !

Maybe @mirackle-spb can help as the author of the original template?

morgens avatar May 29 '24 07:05 morgens

Must be stripped now.

mirackle-spb avatar May 29 '24 09:05 mirackle-spb

It's not. After uploading the template it looks like this:

!Current Configuration: ! !System Description "DGS-3130-54TS" !System Software Version "1.10.B033" "1707 days 2 hrs 49 mins 40 secs" May 30 07:02:39 2024 UTC !

morgens avatar May 30 '24 07:05 morgens

Ops, my mistake. I dont have any swith with this template now :( Please check.

mirackle-spb avatar May 30 '24 08:05 mirackle-spb

It looks ok now. Tested on some DGS-3130-54TS with different firmwares and stacked/not stacked. Also tested on DGS-1510 (stacked and not) and DXS-1210. Will be able to test on DGS-1250 in the near future. The only problem I see now are some unrecognized symbols in the end of the "show vlan" command. It looks like this:

# 	VLAN XXX
# 		Name : VLANXXX
# 		Tagged Member Ports   : 1/0/1,1/0/54
# 		Untagged Member Ports :
# 
# 
# ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	Total Entries : 9
# 
# 
!Current Configuration:
!
!System Description "DGS-3130-54TS"
!System Software Version "2.00.B044"
!System Up Time <removed>
!Current SNTP Synchronized Time: <removed>
!

Those symbols don't change between config captures and I'm not sure what they are, but they cause a problem where Oxidized returns TypeError when you try to open the latest configuration from the "versions" screen (with Git as output), pressing "configuration" from the "nodes" screen opens config correctly. But if you remove "show vlan" command from the model template the symbols disappear (with vlan info :) ). So I'm guessing this is somehow related to this command output.

morgens avatar May 30 '24 11:05 morgens

Sorry, but i dont have such devices now in my network. So i cant check this.

mirackle-spb avatar May 30 '24 11:05 mirackle-spb

From what I can see, this is a switch firmware issue. I even connected to one of the switches in question with a serial cable and I got a sequence of empty characters in the beginning and in the "show vlan" section. I'll try to contact support and ask them to investigate.

morgens avatar May 30 '24 12:05 morgens

Merged => close.

robertcheramy avatar Jun 14 '24 13:06 robertcheramy