LibreNMS not updating Oxidized nodes list with new nodes

Hi Guys,

I’m working on integrating Oxidized with LibreNMS.
My setup is a separate VM for LibreNMS, and a separate VM for Oxidized.
For the most part, things are working. My LibreNMS shows the configs/versions of the switches/routers I added (both Cisco and Mikrotik).
However, for the test purposes, I used CSV Input in Oxidized, where I add my switches/routers to router.db file.

Now i’m trying to get LibreNMS updates Oxidized node list whenever a new machine is added, but so far no sucess.

Running connectivity test seems to work. See below :

curl -H 'X-Auth-Token: xxxxxx13f2252f4ce4d68bxxxxxx' http://librenms.MY.DOMAIN/api/v0/oxidized

{
    "hostname": "localhost",
    "os": "linux",
    "ip": "127.0.0.1",
    "group": "true"
},
{
    "hostname": "artemis.MY.DOMAIN",
    "os": "ios",
    "ip": "xx.xx.xx.xx",
    "group": "true"
},
{
    "hostname": "aiolos.MY.DOMAIN",
    "os": "ios",
    "ip": "xx.xx.xx.xx",
    "group": "true"
},

Below is my Oxidized conf:

---
username: user
password: "somepassword"
model: routeros
resolve_dns: true
interval: 120
use_syslog: false
debug: true
threads: 30
timeout: 120
retries: 3
prompt: !ruby/regexp /(\S+@\S+\s?.)$/
rest: 0.0.0.0:8888
next_adds_job: false
vars: {}
groups: {}
models: {}
pid: "/home/oxidized/.config/oxidized/pid"
crash:
   directory: "/home/oxidized/.config/oxidized/crashes"
hostnames: false
stats:
  history_size: 100
input:
  default: telnet
  debug: true
  ssh:
  secure: false
output:
  default: file
  file:
   directory: "/home/oxidized/.config/oxidized/configs"
output:
  default: git
  git:
   user: oxidized
   email: [email protected]
   repo: "/home/oxidized/.config/oxidized/configs/devices.git"
source:
    default: http
    debug: true
    http:
      url: http://librenms.MY.DOMAIN/api/v0/oxidized
      map:
        name: hostname
        model: os
        group: group
      headers:
    X-Auth-Token: 'xxxxxxx413f2252f4ce4d68bxxxxxx'
    model_map:
      juniper: junos
      cisco: ios
      mikrotik: routeros
source:
 default: csv
  csv:
   file: "/home/oxidized/.config/oxidized/router.db"
   delimiter: !ruby/regexp /:/
 map:
    name: 0
    model: 1
   gpg: false
model_map:
   juniper: junos
  cisco: ios
  mikrotik: routeros

If I omit the the CSV source, Oxidized service won’t run.

I’m not sure where I have a mistake.
Any advice please ?

Thanks

Below is the service failure when the CSV source is omitted:

 oxidized.service - Oxidized - Network Device Configuration Backup Tool
 Loaded: loaded (/lib/systemd/system/oxidized.service; enabled; vendor preset: enabled)
 Active: failed (Result: exit-code) since Fri 2019-11-15 11:25:09 CET; 1s ago
 Process: 2030 ExecStart=/usr/local/bin/oxidized (code=exited, status=1/FAILURE)
 Main PID: 2030 (code=exited, status=1/FAILURE)

Nov 15 11:25:09 oxidized oxidized[2030]:         from /var/lib/gems/2.5.0/gems/oxidized-0.26.3   /lib/oxidized/nodes.rb:125:in `initialize'
Nov 15 11:25:09 oxidized oxidized[2030]:         from /var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/core.rb:14:in `new'
Nov 15 11:25:09 oxidized oxidized[2030]:         from /var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/core.rb:14:in `initialize'
Nov 15 11:25:09 oxidized oxidized[2030]:         from /var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/core.rb:4:in `new'
Nov 15 11:25:09 oxidized oxidized[2030]:         from /var/lib/gems/2.5.0/gems/oxidized-0.26.3/lib/oxidized/cli.rb:13:in `run'
Nov 15 11:25:09 oxidized oxidized[2030]:         from /var/lib/gems/2.5.0/gems/oxidized-0.26.3/bin/oxidized:8:in `<top (required)>'
Nov 15 11:25:09 oxidized oxidized[2030]:         from /usr/local/bin/oxidized:23:in `load'
Nov 15 11:25:09 oxidized oxidized[2030]:         from /usr/local/bin/oxidized:23:in `<main>'
Nov 15 11:25:09 oxidized systemd[1]: oxidized.service: Main process exited, code=exited,   status=1/FAILURE
Nov 15 11:25:09 oxidized systemd[1]: oxidized.service: Failed with result 'exit-code'.

Do you mean when you add a device in LibreNMS you want it to appear in your Oxidized install? If so you need to use LibreNMS as the source of truth for Oxidized. Our docs show how.

Hi Iaf,

I do actually use LibreNMS as the source. Kindly see my Oxidized config above.
However, Now i think I figured out what was the issue:

I added ip: ip in the oxidized config:

map:
        name: hostname
        model: os
        ip: ip

Oxidized now started pulling all switches/routers that are added in LibreNMS.

Fingers crossed ! let’s see when it finishes it cycle

Ok it seems that Oxidized now has retrieved all the devices from LibreNMS and backed them up.

However, I hit another issue. for some reason the device Config TAB disappeared from LibreNMS. I had it earlier when I used CSV file source in Oxidized, i.e. when I click on a router/switch in LibreNMS, it showed a tab for config and when I click on that tab, I see that router’s/switche’s backed up configuration.

Now that tab disappeared now !

Below is my LibreNMS config part for Oxidized:

 # Enable Oxidized
$config['oxidized']['enabled']         = true;
$config['oxidized']['url']             = 'http://xx.xx.xx.xx:8888';
$config['oxidized']['features']['versioning'] = true;
$config['oxidized']['reload_nodes'] = true;
#$config['oxidized']['ignore_types'] = array('server','power','storage');
#$config['oxidized']['ignore_os'] = array('linux','windows');

Please see attached screen shots from Oxidized and LibreNMS. As you can see, there is no Config tab in the GUI switch’s page.

attached is my LibreNMS oxidized settings in the GUI