Closed spurgelaurels closed 3 years ago
So I tested with the linuxgeneric model, and oxidized was able to log, and execute cat /etc/hostname
but it barfs without error right after that.... It doesn't even newline properly.
root@0eec47dfa1d3:~/.config/oxidized/logs# cat 172.20.1.63-ssh
Last login: Fri May 14 10:29:01 2021 from 172.17.0.7
[admin@alembic ~]$ cat /etc/hostname
alembic.slough.ca
[admin@alembic ~]$ root@0eec47dfa1d3:~/.config/oxidized/logs#
The only logs I can see in oxidized's output:
D, [2021-05-14T14:29:43.049949 #1367] DEBUG -- : lib/oxidized/job.rb: Config fetched for alembic at 2021-05-14 14:29:43 UTC
W, [2021-05-14T14:29:43.224447 #1367] WARN -- : /alembic status no_connection, retries exhausted, giving up
Not a ruby expert but at least most model i see have this generic outline:
cat bla.rb
class BLA < Oxidized::Model
prompt /^([\w.@()-]+[#>]\s?)$/
comment '! '
cmd 'show running-config'
cfg :telnet do
username /^login:/
password /^Password:/
end
cfg :ssh, :telnet do
post_login 'terminal length 0'
post_login 'terminal width 0'
pre_logout 'logout'
end
end
Not a ruby expert but at least most model i see have this generic outline:
Made the change suggested, and now I can see debug SSH logs where it's negotiating between client and server. Even got as far as outputting logs into the logs directory now. Seems it's dying as soon as the prompt is present, but now at least I think I can work with the model file to fix or troubleshoot!
Okay, so half of my APs aren't working and are getting SSH Conn reset by peer errors. The other half are. I realized that the model versions were slightly different, as one is an AP130, the other is an AP330. Commands are the same for both, prompt is the same for both. Only difference is the copyright is on a line-break on one model.
admin@172.20.0.60's password:
Last login: Fri May 14 11:36:45 2021 from 172.20.1.63
Copyright (c) 2006-2020 Extreme Networks, Inc.
AP-FRONT#show ver
Copyright (c) 2006-2020 Extreme Networks, Inc.
Version: HiveOS 10.0r10b build-254127
Build time: Thu Jan 21 09:41:43 UTC 2021
Build cookie: 2101210141-254127
Platform: AP130
Bootloader ver: v0.0.4.42
TPM ver: v1.2.66.4
Uptime: 1 weeks, 4 days, 1 hours, 17 minutes, 0 seconds
AP-FRONT#
admin@172.20.0.61's password:
Last login: Fri May 14 11:37:51 2021 from 172.20.1.63
Extreme Networks, Inc.
Copyright (c) 2006-2020
AP-BASEMENT#show ver
Extreme Networks, Inc.
Copyright (c) 2006-2020
Version: HiveOS 6.5r14 build-255963
Build time: Mon Mar 1 10:37:16 UTC 2021
Build cookie: 2103010237-255963
Platform: AP370
Bootloader ver: v1.0.3.41
TPM ver: v1.2.35.8
Uptime: 1 weeks, 3 days, 23 hours, 59 minutes, 26 seconds
AP-BASEMENT#
As I dug deeper into this, I realized that the 3 non-working APs were running older versions of OpenSSH (5.9). Debug logs shows the host disconnected our ssh attempts, likely due to some older keys/cipher use.
Unfortunately, using SSH from the command line on my oxidized host connects just fine, and debug logs don't show anything useful.
I've added the following to my config file, and they seem to connect now! If you're encountering this as well, check the docs and you'll see you can apply this with a model / vars map to different devices as needed. (I only have one decide type, so a global var is fine)
vars:
ssh_kex: diffie-hellman-group-exchange-sha256
I'm a bit confused here, because I don't know which part of this is failing. I'm trying to connect to some Aerohive APs to pull their configs, which meant having to create a new model. The rb file is pasted below, and is quite simple.
Unfortunately, the logs look like it's working, but then drop a non-verbose failure, so I'm not sure where to work from here. Back in the rancid days, you could invoke clogin/hlogin to test the connectivity first, and I don't know if oxidized has something like that.
W, [2021-05-14T12:53:28.107607 #1259] WARN -- : /ap-basement status fail, retry attempt 1
config
router.db (There are several more entries redacted)
172.20.0.60:ap-front:Hiveos
/var/lib/gems/2.5.0/gems/oxidized-0.28.0/lib/oxidized/model/hiveos.rb
Log Output from oxidized