ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.8k stars 925 forks source link

Problem with backup big config file from Mikrotik #1966

Closed maxim-kyryliuk closed 1 year ago

maxim-kyryliuk commented 5 years ago

I got a problem when i tried backup few my Mikrotik. Config contain tons of addresses in address list (Total size of config around 500Kb ~5600-6000 row)

I have 3 router and all of them was not able transfer all config, it truncated some where near ~1650 line all time.

After i tried debug it 2 of 3 router start send full config. Routers wasn't rebooted and nothing changed on routers.

I made test script to check what happen

!/usr/bin/env ruby

require 'rubygems' require 'net/ssh' require 'logger'

HOST = '1.1.1.1.' USER = 'oxidized' PASS = 'password' Net::SSH.start( HOST, USER, :port => 65022, :verbose => :debug) do|ssh| result = ssh.exec!('/export') puts result end

I am using keys for AUTH.

D, [2019-11-13T11:32:03.740491 #11287] DEBUG -- socket[145733c]: received packet nr 2160 type 94 len 60 I, [2019-11-13T11:32:03.740542 #11287] INFO -- net.ssh.connection.session[12fa7f0]: channel_data: 0 45b D, [2019-11-13T11:32:03.740619 #11287] DEBUG -- socket[145733c]: received packet nr 2161 type 98 len 44 I, [2019-11-13T11:32:03.740680 #11287] INFO -- net.ssh.connection.session[12fa7f0]: channel_request: 0 exit-status false D, [2019-11-13T11:32:03.740915 #11287] DEBUG -- socket[145733c]: received packet nr 2162 type 97 len 12 I, [2019-11-13T11:32:03.740991 #11287] INFO -- net.ssh.connection.session[12fa7f0]: channel_close: 0 D, [2019-11-13T11:32:03.741115 #11287] DEBUG -- socket[145733c]: queueing packet nr 12 type 97 len 28 I, [2019-11-13T11:32:03.741155 #11287] INFO -- net.ssh.connection.session[12fa7f0]: 1.1.1.1 delete channel 0 which closed locally and remotely D, [2019-11-13T11:32:03.741262 #11287] DEBUG -- socket[145733c]: sent 52 bytes I, [2019-11-13T11:32:03.741325 #11287] INFO -- net.ssh.connection.session[12fa7f0]: closing remaining channels (0 open)

This is last lines from debug output.

Full backup should be around 7.3K lineand with size 440KB but i get only 1671 line


username: oxidized password: password model: junos interval: 3600 #interval in seconds log: ~/.config/oxidized/log threads: 1 timeout: 60 retries: 3 prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/ debug: true crash: directory: ~/.config/oxidized/crashes hostnames: false vars: enable: S3cr3tx ssh_keys: "~/.ssh/id_rsa" groups: {} rest: 127.0.0.1:8888 pid: ~/.config/oxidized/oxidized.pid input: default: ssh, telnet debug: true ssh: secure: false output: default: git git: user: Oxidized email: oxidized@example.com repo: "~/.config/oxidized/oxidized.git" source: default: csv csv: file: "~/.config/oxidized/router.db" delimiter: !ruby/regexp /:/ map: name: 0 model: 1 ip: 2 vars_map: ssh_port: 3 model_map: cisco: ios juniper: junos

Here is full config,

Time for dump full backup around 5 sec.

mortzu commented 2 years ago

Can you please reformat your paste to make it readable? (https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code)