Oxidized Docker - how to use git instead

I have installed Oxidized via Docker. Is there a way to change it so that it will output to a local git repo instead of text files?

I’m using Ubuntu 16.04 for my installation.

Thanks in advance.

You just need to update your oxidized config to use git: https://github.com/ytti/oxidized/blob/master/docs/Outputs.md#output-git

Even with docker you are a still mapping a local config file into the container so edit it on the docker host, restart the container and it should work.

What is the configuration of source for oxidized.

I cant seem to get librenms and oxidized to talk to each on the same host where both librenms and oxidized docker is running.

Does anyone have librenms and Oxidized dockers installed on the same host where oxidized is using librenms as a source.

Care to share your configuration that works.

I may be misunderstanding this, but I have mine set up to use a static config (router.db I think) as the source. Are you trying to add hosts to LibreNMS and have it automatically add the host to oxidized?

Judging from the support doc (https://docs.librenms.org/Extensions/Oxidized/), I would double check that your containers are on the same Docker network (not the local network, but the container network) and then make sure your config is pointing to the oxidized container IP.

LibreNMS and have it automatically add the host to oxidized? Correct.

They are on the same docker network.

And then make sure your config is pointing to the oxidized container IP.–> How do I ensure that the containers always get the same ips when starting up after any event that cause them to restart

I ended up following instructions similar to this.


Basically you have to create another Docker network, recreate LibreNMS and Oxidized containers with static IPs.
I had to do this for my LibreNMS, Oxidized, and mariaDB containers.

Thanks will give it a go.

Was hoping there would be another way.

I tried the below with no success
on librenms I have tried http://0.0.0.0:8888 as oxidized runs on port 8888

in the oxidized config file i have tried

url: http://127.0.0.1:8000/api/v0/oxidized
url: http://0.0.0.0:8000/api/v0/oxidized

Is there no way to create a link between containers?

Or have some DNS config to assist with this type of deployment?

Ok so…

For LibreNMS (in /opt/librenms/config.php), enter the following config but replace your the x.x.x.x with your container IP (honestly you could probably just use the LAN IP of the Docker host as long as you can get to the WebGUIs of both LibreNMS and Oxidized).

$config[‘oxidized’][‘enabled’] = TRUE;
$config[‘oxidized’][‘url’] = ‘http://x.x.x.x:8888’;

This will allow you to see the Oxidized configs for your devices from within LibreNMS.

For Oxidized, (in /root/.config/oxidized/config)…
Replace your existing source config with the following (as long as you want to use this as the sole source).
If you want to use additional sources, such as a static csv - the just add the following to the end of your source section without including “source:” - that would make redundant and probably cause yaml config errors with Oxidized.

source:
default: http
debug: false
http:
url: https://x.x.x.x/api/v0/oxidized
map:
name: hostname
model: os
group: group
headers:
X-Auth-Token: ‘your-librenms-api-token-here’

Replace x.x.x.x with the IP of your LibreNMS container or the LAN IP of the host that you access LibreNMS from.
Replace your X-Auth-Token with your own API token.
You can get it from LibreNMS - create a new one.

Restart the Oxidized container.
If you have issues getting to Oxidized, you may need to remove the pid file and then restart Oxidized again (pid file is located at /root/.config/oxidized/pid)

Some of this requires a lot of trial and error. My Oxidized container is fairly old. So I’m not sure if your Oxidized config is at the same location or not.

I do not have LibreNMS sourcing my Oxidized installation and at this point, it’s the production server, so I cannot test this to verify for you.

Hi Jeff

Thanks for above im sure it will help someone in the future, your previous posts directed me to learning more about the docker networks and I came across the user-defined network which has the following advantage:

User-defined bridges provide automatic DNS resolution between containers .
User-defined bridges provide better isolation .

So this is what I did:

Create a monitoring network
docker network create --driver bridge monitoring

Add the following to my docker-compose.yml for Librenms

networks:
default:
external:
name: monitoring

Edited my docker-compose.yml of oxidized to look from this which is at the following link https://github.com/ytti/oxidized#debian-and-ubuntu

docker-compose.yml

docker-compose file example for oxidized that will start along with docker daemon

oxidized:
restart: always
image: oxidized/oxidized:latest
ports:
- 8888:8888/tcp
environment:
CONFIG_RELOAD_INTERVAL: 600
volumes:
- /etc/oxidized:/root/.config/oxidized

to this

version: “3.5”

services:
oxidized:
image: oxidized/oxidized:latest
ports:
- target: 8888
published: 8888
protocol: tcp
environment:
- “CONFIG_RELOAD_INTERVAL=600”
volumes:
- /dockers/oxidized:/root/.config/oxidized
restart: always
networks:
default:
external:
name: monitoring

I then started my librenms and oxidized docker and configured librenms as following

Generated an API Key in librenms

and edited my config file for oxidized

rest: 0.0.0.0:8888
output:
default: git
git:
user: Oxidized
email: [email protected]
repo: " /root/.config/oxidized/default.git"
source:
default: http
http:
url: http://librenms:8000/api/v0/oxidized
scheme: http
delimiter: !ruby/regexp /:confused:
user: username
pass: password
map:
name: hostname
model: os
username: username
password: password
group: group
vars_map:
enable: enable
headers:
X-Auth-Token: ‘blahblahblahblahblahblahblahblahblahblahblah’

And it works

And on the oxidized web gui

For me this is resolved