I’ve got Oxidized up and running (finally), but it’s not pulling the full config from my Cisco switches. It’s pulling software version information, VTP info, stacking module ports, and stuff like that but not the actual config. I have debugging set to “true” in the Oxidized config, I have a location for the log files configured, but I’m not seeing ANY logs. How do I go about debugging this?
Do you have this set in your oxidized config
and did you specify your enable password under
vars: enable: passw0rd
Also you should see logs so perhaps debug that first, did you restart oxidized service, force config refresh from oxidized-web, no log output ? does the oxidized user have permissions to write logs in that specified folder?
I added the two lines you mentioned. No change in behavior.
I have restarted the service with each change to the config file using these commands:
sudo systemctl daemon-reload
sudo systemctl enable oxidized.service
sudo systemctl start oxidized
sudo systemctl status oxidized
The oxidized user should have write permissions to the logs folder. This is the output of ls -l for the /home/oxidized/.config/oxidized directory:
-rw-r–r-- 1 root root 1083 Jun 11 08:47 config
-rw-rw-r-- 1 oxidized oxidized 1513 Jun 7 09:51 crash
drwxr-xr-x 6 oxidized oxidized 4096 Jun 11 08:52 default.git
drwxrwxr-x 2 oxidized oxidized 4096 Jun 7 13:50 logs
-rw-r–r-- 1 oxidized oxidized 6 Jun 7 13:21 pid
Below is my config file (passwords obscured, of course).
prompt: !ruby/regexp /^([\[email protected]]+[#>]\s?)$/
default: ssh, telnet
url: http:// ********** /api/v0/oxidized
events: [node_success, post_store]
cmd: ‘cd /home/oxidized/.config/oxidized/devices.git && git push -f -q /home/oxidized/.config/oxidized/devices.git master’
And this is the contents of /etc/systmd/system/oxidized.service
Description=Oxidized - Network Device Configuration Backup Tool
input: default: ssh, telnet debug: /home/oxidized/.config/oxidized/logs/log_input ssh: secure: false
input: default: ssh, telnet debug: true ssh: secure: false
Then restart, and force a config run from the web to the cisco switch.
For the cisco switch what model is it using in oxidized web? IOS ?
Is your oxidized configuration file indented properly ? otherwise some things wont work, for example
vars: enable: **********
vars: enable: **********
The indentation is correct (as far as I can tell), it just didn’t transfer over correctly when I copied an pasted here.
I made the config change you suggested. No behavior change. The web interface shows a green status indicator and the “Last Update” time changes, but it never loads the running config. It seems to stop after the vtp status or inventory depending on the switch.
Still no log files in the logs directory.
Hmm looks ok to me too.
Anything useful in your journal?
journalctl -u oxidized --since "today" -f
Try increase your Timeout to 60 and restart, incase the job takes a while to grab the running-config.
What versions of oxidized are you running?
gem list | grep oxidized
I do see some stuff in the journal.
Jun 11 03:53:49 nms oxidized: sh: 1: cd: can’t cd to /home/oxidized/.config/oxidized/devices.git
Jun 11 03:53:49 nms oxidized: E, [2019-06-11T03:53:49.987116 #124352] ERROR – : Exec: “cd /home/oxidized/.config/oxidized/devices.git && git push -f -q /home//oxidized/.config/oxidized/devices.git master” failed with exit value 2
Jun 11 03:53:49 nms oxidized: #<Thread:[email protected]/var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/hook/exec.rb:32 run> terminated with exception (report_on_exception is true):
Jun 11 03:53:49 nms oxidized: /var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/hook/exec.rb:50:in
block in run_cmd!': "cd /home/oxidized/.config/oxidized/devices.git && git push -f -q /home//oxidized/.config/oxidized/devices.git master" failed with exit value 2 (RuntimeError) Jun 11 03:53:49 nms oxidized: from /usr/lib/ruby/2.5.0/timeout.rb:93:inblock in timeout’
Jun 11 03:53:49 nms oxidized: from /usr/lib/ruby/2.5.0/timeout.rb:33:in
block in catch' Jun 11 03:53:49 nms oxidized: from /usr/lib/ruby/2.5.0/timeout.rb:33:incatch’
Jun 11 03:53:49 nms oxidized: from /usr/lib/ruby/2.5.0/timeout.rb:108:in
timeout' Jun 11 03:53:49 nms oxidized: from /var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/hook/exec.rb:44:inrun_cmd!’
Jun 11 03:53:49 nms oxidized: from /var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/hook/exec.rb:34:in `block in run_hook’
Jun 11 03:53:49 nms oxidized: E, [2019-06-11T03:53:49.987343 #124352] ERROR – : Hook post-commit (#Exec:0x0000561e35d4d038) failed (#<RuntimeError: “cd /home/oxidized/.config/oxidized/devices.git && git push -f -q /home//oxidized/.config/oxidized/devices.git master” failed with exit value 2>) for event :node_success
A “devices.git” directory didn’t exist so I just now manually created it.
Everything is working now! Unfortunately, I don’t know exactly what caused it start working.
I created the “devices.git” directory that didn’t exist but was in the config, but that didn’t change any behavior.
I updated Ubuntu and it requested a reboot, so I did that and that broke full functionality of Oxidized. Trying to start Oxidized manually, I saw an error that “logs” was a directory instead of a file and couldn’t be opened for writing. So I changed the log file in the config
I can’t recall anything else I may have done, but after that it all started working correctly.