CentOS 7: LibreNMS + Oxidized

Hello,

So, I am extremely confused in regards to how to configure the Oxidized config file correctly to get this integrated with my LibreNMS instance.

This is a test environment with only one network device (Cisco IOS) at the moment.

Server (CentoOS 7) installed with LibreNMS and testing with one Cisco 2960g

LibreNMS is working fines, now just trying to get Oxidized working

username: $ADMIN # Is this the username and password for my network devices
password: $PASSWORD
model: ios
interval: 3600
use_syslog: false
debug: false
threads: 30
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 127.0.0.1:8888
next_adds_job: false
vars: {}
groups: {}
models: {}
pid: /home/oxidized/.config/oxidized/pid
input:
  default: ssh, telnet
  debug: false
  ssh:
    secure: false
output:
  default: git
  git:
    user: git
    email:
    repo: "/root/.config/oxidized/devices.git"
source:
  default: csv
  csv:
    file: /home/oxidized/.config/oxidized/router.db
    delimiter: !ruby/regexp /:/
    map:
      name: 0
      model: 1
      username: 2
      password: 3
model_map:
  cisco: ios
  juniper: junos

I am unable to start Oxidized, producing this error:

Error loading config: (): found character that cannot start any token while scanning for the next token at line 3 column 11

I just want to get this up and running so I can test it in our environment, any help is appreciated.

The fact you don’t say what’s not actually working makes it impossible for people to help you.

running oxidized as the oxidized user is not working and presents this error:

Error loading config: (): found character that cannot start any token while scanning for the next token at line 3 column 11

Please check your config at that location. Run your config through a yaml validator to make sure the syntax is right.

Hi, I tried running the config through the yaml validator until it passed and even then I received the same error. The purpose of me reaching out (and my hope), was to gain an understanding of what needs to be changed in the yaml config to get this running.

I’ve been comparing my config with a bunch of other examples online and I can’t grasp how to properly configure it as everyone is doing it differently.

I think you might need the hyphens at the top of the config file.

Username and password is indeed the ssh or telnet credentials

For the LibreNMS integration, you want to change the source to http and provide the correct URL and create an administrative user in LibreNMS e.g “oxidized” and create a auth token through the LibreNMS GUI, paste that into your config.

for example

---
username: sshuser
password: sshpassw0rd
model: ios
interval: 86400
use_syslog: false
log: /home/oxidized/.config/oxidized/logs
debug: true
threads: 30
timeout: 30
retries: 1
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 0.0.0.0:8888
next_adds_job: true
vars: {}
groups: {}
models: {}
pid: /home/oxidized/.config/oxidized/pid
vars:
  enable: yourCiscoEnablePassw0rd
input:
  default: ssh, telnet
  debug: false
  ssh:
    secure: false
output:
  default: git
  git:
    user: oxidized
    email: [email protected]
    repo: /home/oxidized/.config/oxidized/devices.git
source:
  default: http
  http:
    url: https://1.1.1.1/api/v0/oxidized
    secure: false
    map:
      name: hostname
      model: os
      group: group
    headers:
      X-Auth-Token: 'blahblahblah123123123'
model_map:
  cisco: ios

Here are some of my Centos 7 notes that may help you i’m not sure how far you’ve got, did you get everything working except the config?

yum install make cmake which sqlite-devel openssl-devel libssh2-devel ruby gcc ruby-devel libicu-devel gcc-c++

gem install rubygems-update
update_rubygems

gem install rack-test -v 0.7.0
gem install rugged

gem install oxidized
gem install oxidized-script oxidized-web

create your systemd service file

https://github.com/ytti/oxidized/blob/master/extra/oxidized.service

systemctl restart oxidized

Hi Chas,

I got everything working except the config. Thanks for your help, I will try this out and see if it works. Much appreciated.

However, can you explain what this does:

create your systemd service file

https://github.com/ytti/oxidized/blob/master/extra/oxidized.service

Its just a service file, so you can control it using systemctl etc…

just put that file into /etc/systemd/system/

systemctl daemon-reload
systemctl enable oxidized (so it starts on boot)
systemctl restart oxidized
systemctl status oxidized

etc

So I replicated your config (plugged in my environment specific info), and I am still getting the same error.

● oxidized.service - Oxidized - Network Device Configuration Backup Tool
Loaded: loaded (/etc/systemd/system/oxidized.service; enabled; vendor preset: disabled)
Active: inactive (dead)

Jul 25 11:32:00 librenms systemd[1]: Started Oxidized - Network Device Configuration Backup Tool.
Jul 25 11:32:00 librenms systemd[1]: Starting Oxidized - Network Device Configuration Backup Tool…
Jul 25 11:32:00 librenms oxidized[18481]: Error loading config: (): found character that cannot start any token while scanning for the next token at line 3 column 11
Jul 25 11:32:42 librenms systemd[1]: Started Oxidized - Network Device Configuration Backup Tool.
Jul 25 11:32:42 librenms systemd[1]: Starting Oxidized - Network Device Configuration Backup Tool…
Jul 25 11:32:42 librenms oxidized[18552]: Error loading config: (): found character that cannot start any token while scanning for the next token at line 3 column 11
Jul 25 11:40:43 librenms systemd[1]: Started Oxidized - Network Device Configuration Backup Tool.
Jul 25 11:40:43 librenms systemd[1]: Starting Oxidized - Network Device Configuration Backup Tool…
Jul 25 11:40:43 librenms oxidized[19275]: Error loading config: (): found character that cannot start any token while scanning for the next token at line 3 column 11

After you edited it, is the yaml validators still happy with it? Make sure there are no Tabs and that you are using white spaces, also ensure no comments like the original post e.g “# Is this the username and password for my network devices”

Also are you using plaintext for the username and password, i.e not using $ADMIN and $PASSWORD variables

Yaml validator does not pass, it wants me to remove the variables for the device (name, model, username, password…)
I’ll double check tabs, but I am pretty sure I did not use any tabs
I removed comments and “variables” were replaced with plain text in my running config.
I literally copied your config and adjusted it to fit my environment this last time I tried to get it to run.
Here is my current YAML config:


username: MYUSERNAME
password: MYPASSWORD
model: ios
interval: 86400
use_syslog: false
log: /home/oxidized/.config/oxidized/logs
debug: true
threads: 30
timeout: 30
retries: 1
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 0.0.0.0:8888
next_adds_job: true
vars: {}
groups: {}
models: {}
pid: /home/oxidized/.config/oxidized/pid
vars:
enable: cisco
input:
default: ssh, telnet
debug: false
ssh:
secure: false
output:
default: git
git:
user: oxidized
email: [email protected]
repo: /home/oxidized/.config/oxidized/devices.git
source:
default: http
http:
url: https://1.1.1.1/api/v0/oxidized
secure: false
map:
name: hostname
model: os
group: group
headers:
X-Auth-Token: ‘MYTOKEN’
model_map:
cisco: ios

Hmm i ran my config through https://codebeautify.org/yaml-validator but it says it passed.

Can you paste your config again to pastebin or https://p.libren.ms it makes the formatting clearer

Oxidized can load config from a variety of locations, I’d check you don’t have more than one. Look at /etc/oxidized/config and ~/.config/oxidized/config

Here is the config Chas, and I will double check the config files Laf:

https://pastebin.com/r5RzE5Cg

Thanks

You’ve somehow lost the whitespace indentations after copying my config, check mine again.

e.g

mine

input:
  default: ssh, telnet
  debug: false
  ssh:
    secure: false

yours

input:
default: ssh, telnet
debug: false
ssh:
secure: false

Ok, pastebin seemed to mess it up. Looking at my running config on the server it is indented correctly.

That doesn’t make sense to me, i tried it twice in plain and in yaml on pastebin and it keeps the indentation correctly.

if you run cat config does it still show indented? just want to rule out your text editor

Yes, cat shows indentations

Working through this using multiple sources I think I was able to make some progress, now I am getting this error.

source returns no usable nodes
/usr/local/share/gems/gems/oxidized-0.24.0/lib/oxidized/core.rb:15:in initialize': source returns no usable nodes (Oxidized::Core::NoNodesFound) from /usr/local/share/gems/gems/oxidized-0.24.0/lib/oxidized/core.rb:4:innew’
from /usr/local/share/gems/gems/oxidized-0.24.0/lib/oxidized/core.rb:4:in new' from /usr/local/share/gems/gems/oxidized-0.24.0/lib/oxidized/cli.rb:12:inrun’
from /usr/local/share/gems/gems/oxidized-0.24.0/bin/oxidized:8:in <top (required)>' from /usr/local/bin/oxidized:23:inload’
from /usr/local/bin/oxidized:23:in `’

Here is my updated config (passes YAML validation tool in librenms):

https://pastebin.com/JWPkv2uz

My router.db file formate is:

ip:ios

I was able to identify the discrepancies in my config file thanks to some help from the github: https://github.com/ytti/oxidized/issues/1469 and some trial and error testing. I now have a working instance of Oxidized and the web interface works. Though I still can’t pull the configs from the LibreNMS Web UI, I was able to get Oxidized working.

Thanks for the help, I appreciate it a bunch.