Hi Everyone,
I’ve noticed that Oxidized can no longer access my devices using public key authentication. Best I can tell this started happening late last year. It had been working fine for about two years previously. I’m currently running Oxidized version 0.28.0.
Oxidized still appears to connect occasionally, although the “Sync Status” for most devices says “no connection”, the “Last Sync” stat is still updating regularly. I can see the previously pulled configs that are stored in my git repo in the LibreNMS GUI, but no new configs are being stored. When I check debug.log I see the following error when Oxidized is attempting to authenticate to devices:
E, [2021-06-08T13:16:15.460137 #1770] ERROR – : 172.20.20.1 raised NoMethodError with msg “undefined method `each’ for “publickey”:String”, 172.20.20.1 saved
I’ve done my best Googlefu but haven’t found much information on what this error means, but it clearly doesn’t like something about using public key authentication. To be clear - ssh public key authentication to these devices works using the user and key set up for Oxidized and it works from the server that LibreNMS and Oxidized both live on, so it’s not an issue with the key itself or anything to do with the network path.
Here is a sanitized version of my Oxidized config.
username: user
password: password
model: enterasys
interval: 86400
log: ~/.config/oxy/logs/debug.log
use_syslog: false
debug: true
threads: 30
timeout: 300
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 127.0.0.1:8888
next_adds_job: false
vars: {}
groups:
enterasys:
username: user
password: password
hp:
username: user
vars:
auth_methods: publickey
ssh_keys: "home/oxy/.ssh/id_rsa"
arubaos-cx:
username: user
vars:
auth_mehtods: publickey
ssh_keys: "home/oxy/.ssh/id_rsa"
hp2910al:
username: user
password: password
cisco:
username: user
password: password
vars:
enable: enablepass
asa:
username: user
password: password
vars:
enable: enablepass
models: {}
pid: "/home/oxy/.config/oxidized/pid"
input:
default: ssh
debug: true
ssh:
secure: false
output:
default: git
git:
user: oxy
email: [email protected]
single_repo: true
repo: "/home/oxy/devices.git"
source:
default: http
debug: true
http:
url: https://127.0.0.1:6501/api/v0/oxidized
scheme: https
secure: false
delimiter: !ruby/regexp /:/
map:
name: hostname
model: os
group: group
headers:
X-Auth-Token: 'API Token'
model_map:
cisco: ios
juniper: junos
asa: asa
enterasys: enterasys
arubaos-cx: aoscx
Crash log from one of the switches failing to connect with public key authentication:
2021-06-09 16:42:33 UTC
undefined method `each' for "publickey":String [NoMethodError]
--------------------------------------------------
/var/lib/gems/2.3.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/session.rb:71:in `authenticate'
/var/lib/gems/2.3.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:250:in `start'
/var/lib/gems/2.3.0/gems/oxidized-0.28.0/lib/oxidized/input/ssh.rb:27:in `connect'
/var/lib/gems/2.3.0/gems/oxidized-0.28.0/lib/oxidized/node.rb:67:in `run_input'
/var/lib/gems/2.3.0/gems/oxidized-0.28.0/lib/oxidized/node.rb:44:in `block in run'
/var/lib/gems/2.3.0/gems/oxidized-0.28.0/lib/oxidized/node.rb:38:in `each'
/var/lib/gems/2.3.0/gems/oxidized-0.28.0/lib/oxidized/node.rb:38:in `run'
/var/lib/gems/2.3.0/gems/oxidized-0.28.0/lib/oxidized/job.rb:9:in `block in initialize'
I’m happy to supply more information as needed if that will help. I appreciate any assistance.