ytti / oxidized

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

Empty backup config on juniper qfx3000-m #2380

Closed AnnaParkhomenko closed 2 years ago

AnnaParkhomenko commented 3 years ago

I used model junos for Juniper qfx3000-m and get a empty output with "# \ n # \ n #". On other models of juniper configuration collection is successful. Debug:

#successful backup:
E, [2021-10-08T05:33:32.967403 #2795835] ERROR -- : 10.70.138.5 raised LocalJumpError with msg "no block given", 10.70.138.5 saved
D, [2021-10-08T05:33:32.967468 #2795835] DEBUG -- : lib/oxidized/node.rb: Oxidized::SSH failed for dc-nat
D, [2021-10-08T05:33:32.967517 #2795835] DEBUG -- : lib/oxidized/job.rb: Config fetched for dc-nat at 2021-10-08 02:33:32 UTC
W, [2021-10-08T05:33:33.101792 #2795835]  WARN -- : dc-nat.tc.bankrc.local status no_connection, retry attempt 3
D, [2021-10-08T05:33:33.101916 #2795835] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 0 of 34
D, [2021-10-08T05:33:33.102085 #2795835] DEBUG -- : lib/oxidized/worker.rb: Added dc-nat to the job queue
D, [2021-10-08T05:33:33.102121 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:33.102248 #2795835] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for dc-nat at 2021-10-08 02:33:33 UTC
D, [2021-10-08T05:33:33.102423 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to dc-nat.tc
D, [2021-10-08T05:33:33.102556 #2795835] DEBUG -- : AUTH METHODS::["none", "publickey", "password"]
D, [2021-10-08T05:33:33.392230 #2795835] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login commands at dc-nat
D, [2021-10-08T05:33:33.392331 #2795835] DEBUG -- : lib/oxidized/model/model.rb Collecting commands' outputs
D, [2021-10-08T05:33:33.392387 #2795835] DEBUG -- : lib/oxidized/model/model.rb Executing show version
D, [2021-10-08T05:33:33.392412 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb show version @ dc-nat.tc with expect: /^([\w.@-]+[#>]\s?)$/
D, [2021-10-08T05:33:33.618846 #2795835] DEBUG -- : model.rb cmd node0:    <--added logg for test getting output-->
--------------------------------------------------------------------------
Hostname: dc-nat-node0
Model: srx1500
Junos: 15.1X49-D60.7
JUNOS Software Release [15.1X49-D60.7]

node1:
--------------------------------------------------------------------------
Hostname: dc-nat-node1
Model: srx1500
Junos: 15.1X49-D60.7
JUNOS Software Release [15.1X49-D60.7]

D, [2021-10-08T05:33:33.619091 #2795835] DEBUG -- : lib/oxidized/model/model.rb Executing show chassis hardware
D, [2021-10-08T05:33:33.619130 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb show chassis hardware @ dc-nat with expect: /^([\w.@-]+[#>]\s?)$/
D, [2021-10-08T05:33:33.984903 #2795835] DEBUG -- : model.rb cmd node0:
--------------------------------------------------------------------------
Hardware inventory:
Item             Version  Part number  Serial number     Description

#unsuccessful backup:
D, [2021-10-08T05:33:35.102870 #2795835] DEBUG -- : lib/oxidized/worker.rb: Jobs running: 0 of 1 - ended: 1 of 34
D, [2021-10-08T05:33:35.103069 #2795835] DEBUG -- : lib/oxidized/worker.rb: Added dc-qfabric to the job queue
D, [2021-10-08T05:33:35.103220 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:35.103151 #2795835] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for dc-qfabric at 2021-10-08 02:33:35 UTC
D, [2021-10-08T05:33:35.103445 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb: Connecting to dc-qfabric
D, [2021-10-08T05:33:35.103597 #2795835] DEBUG -- : AUTH METHODS::["none", "publickey", "password"]
D, [2021-10-08T05:33:36.103561 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:37.103895 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:38.104243 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:39.104585 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:39.448510 #2795835] DEBUG -- : lib/oxidized/input/cli.rb: Running post_login commands at dc-qfabric
D, [2021-10-08T05:33:39.448616 #2795835] DEBUG -- : lib/oxidized/model/model.rb Collecting commands' outputs
D, [2021-10-08T05:33:39.448654 #2795835] DEBUG -- : lib/oxidized/model/model.rb Executing show version
D, [2021-10-08T05:33:39.448681 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb show version @ dc-qfabric l with expect: /^([\w.@-]+[#>]\s?)$/
D, [2021-10-08T05:33:40.104963 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:40.365415 #2795835] DEBUG -- : model.rb cmd          <--added logg for test-->
D, [2021-10-08T05:33:40.365705 #2795835] DEBUG -- : lib/oxidized/model/model.rb Executing show chassis hardware
D, [2021-10-08T05:33:40.365773 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb show chassis hardware @ dc-qfabric with expect: /^([\w.@-]+[#>]\s?)$/
D, [2021-10-08T05:33:40.958842 #2795835] DEBUG -- : model.rb cmd          <--added logg for test-->
D, [2021-10-08T05:33:40.959072 #2795835] DEBUG -- : lib/oxidized/model/model.rb Executing show system license
D, [2021-10-08T05:33:40.959107 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb show system license @ dc-qfabric with expect: /^([\w.@-]+[#>]\s?)$/
D, [2021-10-08T05:33:41.105281 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2021-10-08T05:33:41.661413 #2795835] DEBUG -- : model.rb cmd          <--added logg for test-->
D, [2021-10-08T05:33:41.661589 #2795835] DEBUG -- : lib/oxidized/model/model.rb Executing show system license keys
D, [2021-10-08T05:33:41.661627 #2795835] DEBUG -- : lib/oxidized/input/ssh.rb show system license keys @ dc-qfabric with expect: /^([\w.@-]+[#>]\s?)$/
D, [2021-10-08T05:33:42.105618 #2795835] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel********

Log in dc-qfabric on ssh:

oxidized@uhp-oxidized ~]$ ssh -l  oxidized dc-qfabric
oxidized@dc-qfabric's password:
Last login: Fri Oct  8 10:42:23 2021 from hq-netflow1.bankrc.local
Juniper QFabric Director 13.1.9042 2017-02-15 09:16:48 UTC

oxidized@dc-qfabric> show version
Hostname: dc-qfabriq
Model: qfx3000-m
Serial Number: 91152217045466
QFabric System ID: e9b4687c-0bd1-11e4-a8c0-d3305ccefe58
JUNOS Base Version [14.1X53-D42.3]

oxidized@dc-qfabric>
mkorourke commented 2 years ago

Hi @AnnaParkhomenko did you have any luck resolving this? I've the same qfab issue and working with @elmobp we've had no luck in resolving.

elmobp commented 2 years ago

Looks like I may have a fix should have a PR ready soon

elmobp commented 2 years ago

After some tests looks like if you use a vars_map and set ssh_no_exec for qfabric nodes this should resolve it

elmobp commented 2 years ago

Also make the individual nodes match ^([\w.@-]+[#>]\s?)$

karhupuoli commented 2 years ago

Thanks, it solved the issue.