Help configuring Oxidized to use MariaDB as source

Greetings!

I have spun up a server running Oxidized, and is at the moment using router.db as source.
As I’m getting more and more devices added, I would prefer to use an external database.
I have a dedicated server running MariaDB, and has added a db called “oxidized”. Under that a table called “nodes”, containing “ip”, “model”, “username”, “password” and “group”.
The config file contains the corresponding fields.

But how/where to define the database to use in Oxidized?
I installed “default-libmysqlclient-dev”, as (if I understands correctly) it has replaced “libmysqlclient-dev”.
But now what?
(I’m quite the newbie on Linux, and totally unfamiliar with databases…)
My guess is to configure /etc/mysql/my.cnf… But with what? I’ve tried googling, but as I not sure of what I’m looking for…

So. Anyone got an example of a my.cnf-file, and is willing to share?

And two more questions:
How do I fint with adapter to use to connect. (Is it always “mysql2”?)
How to use “groups”? Is it enough to just add a group name in the database, and the devices automagically will be grouped?

Sorry 'bout the n00b questions, but I’m not good at this stuff, and I have used a few days to many now trying to figure out… :slightly_frowning_face:

Oxidized uses the ruby sequel library to connect to the database.
Assuming that and the ruby mysql2 gem supports maria DB (google should help you answer that bit) your config should look like this.

Oxidized gets the group name from your database the same as every other field.

source:
default: sql
sql:
adapter: mysql2
host:
database: oxidized
table: nodes
user:
password:
map:
name: ip
model: model
username: username
password: password
group: group

Hi, Darren

Thanks for your reply…

I may have been unclear in what I was wondering about…

The configuration of Oxidized-config is (mostly) clear, but what I do not understand is where should I add the hostname of the server containing the database… Is it my.cnfg?
If so: Which parameters should I add? (I’m not able to find to much info about how to configure SQL clients…)

Is Ruby sequel library installed by default in Oxidized? (Haven’t got the server available atm., but I probably should be able to find out if so…)

MariaDB is said to be a drop-in replacement for MySQL, so I think that shouldn’t be a problem.

You reference it in your oxidzed config file.
This is what mine looks like.

source:
  default: sql
  sql:
    adapter: mysql2
    host: <DH bostname>
    database: oxidized
    table: nodes
    user: <DB user>
    password: <DB password>
    map:
      group: group_id
      name: fqdn
      model: model
    vars_map:
      ssh_port: ssh_port

:blush:
Now I see that you answered my question in your original post…
I didn’t notice the “host”-field… Embarrassing.

Thanks a lot, Darren!

(And the other questions sorted themselves out as I retrived error-messages complaining about missing gems.)

Btw.
Oxidized using MariaDB as source works like a charm.