Jan Wagner: Oxidized - silly attempt at (Really Awesome New Cisco confIg Differ)
Since ages I wanted have replaced this freaking backup solution of our Network Equipment based on some hacky shell scripts and expect uploading the configs on a TFTP server.
Years ago I stumbled upon RANCID (Really Awesome New Cisco confIg Differ) but had no time to implement it. Now I returned to my idea to get rid of all our old crap. I don't know where, I think it was at DENOG2, I saw RANCID coupled with a VCS, where the NOC was notified about configuration (and inventory) changes by mailing the configuration diff and the history was indeed in the VCS.
The good old RANCID seems not to support to write into a VCS out of the box. But for the rescue there is rancid-git, a fork that promises git extensions and support for colorized emails. So far so good. While I was searching for a VCS capable RANCID, somewhere under a stone I found Oxidized, a 'silly attempt at rancid'. Looking at it, it seems more sophisticated, so I thought this might be the right attempt. Unfortunately there is no Debian package available, but I found an ITP created by Jonas. Anyway, for just looking into it, I thought the Docker path for a testbed might be a good idea, as no Debian package ist available (yet). For oxidized configuration is only a
configfile needed and as nodes source a rancid compatible router.db file can be used (beside SQLite and http backend). A migration into a production environment seems pretty easy. So I gave it a go.
I assume Docker is installed already. There seems to be a Docker image on Docker Hub, that looks official, but it seems not maintained (actually). An issue is open for automated building the image.
Creating Oxidized container image
The official documentation describes the procedure. I used a slightly different approach.
docking-station:~# mkdir -p /srv/docker/oxidized/
docking-station:~# git clone https://github.com/ytti/oxidized \
/srv/docker/oxidized/oxidized.git
docking-station:~# docker build -q -t oxidized/oxidized:latest \
/srv/docker/oxidized/oxidized.git
I thought it might be a good idea to also tag the image with the actual version of the gem.
docking-station:~# docker tag oxidized/oxidized:latest \
oxidized/oxidized:0.11.0
docking-station:~# docker images grep oxidized
oxidized/oxidized latest 35a325792078 15 seconds ago 496.1 MB
oxidized/oxidized 0.11.0 35a325792078 15 seconds ago 496.1 MB
Create initial default configuration like described in the documentation.
docking-station:~# mkir -p /srv/docker/oxidized/.config/
docking-station:~# docker run -e CONFIG_RELOAD_INTERVAL=600 \
-v /srv/docker/oxidized/.config/:/root/.config/oxidized \
-p 8888:8888/tcp -t oxidized/oxidized:latest oxidized
Adjusting configuration
After this I adjusted the default configuration for writing a log, the nodes config into a bare git, having nodes secrets in router.db and some hooks for debugging.
Creating node configuration
docking-station:~# echo "7204vxr.lab.cyconet.org:cisco:admin:password:enable" >> \
/srv/docker/oxidized/.config/router.db
docking-station:~# echo "ccr1036.lab.cyconet.org:routeros:admin:password" >> \
/srv/docker/oxidized/.config/router.db
Starting the oxidized beast
docking-station:~# docker run -e CONFIG_RELOAD_INTERVAL=600 \
-v /srv/docker/oxidized/.config/:/root/.config/oxidized \
-p 8888:8888/tcp -t oxidized/oxidized:latest oxidized
Puma 2.16.0 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://127.0.0.1:8888
If you want to have the container get started with the docker daemon automatically, you can start the container with --restart always and docker will take care of it. If I wanted to make it running permanent, I would use a systemd unitfile.
Reload configuration immediately
If you don't want to wait to automatically reload of the configuration, you can trigger it.
docking-station:~# curl -s http://localhost:8888/reload?format=json \
-O /dev/null
docking-station:~# tail -2 /srv/docker/oxidized/.config/log/oxidized.log
I, [2016-01-29T16:50:46.971904 #1] INFO -- : Oxidized starting, running as pid 1
I, [2016-01-29T16:50:47.073307 #1] INFO -- : Loaded 2 nodes
Writing nodes configuration
docking-station:/srv/docker/oxidized/.config/oxidized.git# git shortlog
Oxidizied (2):
update 7204vxr.lab.cyconet.org
update ccr1036.lab.cyconet.org
Writing the nodes configurations into a local bare git repository is neat but far from perfect. It would be cool to have all the stuff in a central VCS. So I'm pushing it every 5 minutes into one with a cron job.
docking-station:~# cat /etc/cron.d/doxidized
# m h dom mon dow user command
*/5 * * * * root $(/srv/docker/oxidized/bin/oxidized_cron_git_push.sh)
docking-station:~# cat /srv/docker/oxidized/bin/oxidized_cron_git_push.sh
#!/bin/bash
DOCKER_OXIDIZED_BASE="/srv/docker/oxidized/"
OXIDIZED_GIT_DIR=".config/oxidized.git"
cd $ DOCKER_OXIDIZED_BASE /$ OXIDIZED_GIT_DIR
git push origin master --quiet
Now having all the nodes configurations in a source code hosting system, we can browse the configurations, changes, history and even establish notifications for changes. Mission accomplished!
Now I can test the coverage of our equipment. The last thing that would make me super happy, a oxidized Debian package!
docking-station:~# mkdir -p /srv/docker/oxidized/
docking-station:~# git clone https://github.com/ytti/oxidized \
/srv/docker/oxidized/oxidized.git
docking-station:~# docker build -q -t oxidized/oxidized:latest \
/srv/docker/oxidized/oxidized.git
docking-station:~# docker tag oxidized/oxidized:latest \
oxidized/oxidized:0.11.0
docking-station:~# docker images grep oxidized
oxidized/oxidized latest 35a325792078 15 seconds ago 496.1 MB
oxidized/oxidized 0.11.0 35a325792078 15 seconds ago 496.1 MB
docking-station:~# mkir -p /srv/docker/oxidized/.config/
docking-station:~# docker run -e CONFIG_RELOAD_INTERVAL=600 \
-v /srv/docker/oxidized/.config/:/root/.config/oxidized \
-p 8888:8888/tcp -t oxidized/oxidized:latest oxidized
Creating node configuration
docking-station:~# echo "7204vxr.lab.cyconet.org:cisco:admin:password:enable" >> \
/srv/docker/oxidized/.config/router.db
docking-station:~# echo "ccr1036.lab.cyconet.org:routeros:admin:password" >> \
/srv/docker/oxidized/.config/router.db
Starting the oxidized beast
docking-station:~# docker run -e CONFIG_RELOAD_INTERVAL=600 \
-v /srv/docker/oxidized/.config/:/root/.config/oxidized \
-p 8888:8888/tcp -t oxidized/oxidized:latest oxidized
Puma 2.16.0 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://127.0.0.1:8888
If you want to have the container get started with the docker daemon automatically, you can start the container with --restart always and docker will take care of it. If I wanted to make it running permanent, I would use a systemd unitfile.
Reload configuration immediately
If you don't want to wait to automatically reload of the configuration, you can trigger it.
docking-station:~# curl -s http://localhost:8888/reload?format=json \
-O /dev/null
docking-station:~# tail -2 /srv/docker/oxidized/.config/log/oxidized.log
I, [2016-01-29T16:50:46.971904 #1] INFO -- : Oxidized starting, running as pid 1
I, [2016-01-29T16:50:47.073307 #1] INFO -- : Loaded 2 nodes
Writing nodes configuration
docking-station:/srv/docker/oxidized/.config/oxidized.git# git shortlog
Oxidizied (2):
update 7204vxr.lab.cyconet.org
update ccr1036.lab.cyconet.org
Writing the nodes configurations into a local bare git repository is neat but far from perfect. It would be cool to have all the stuff in a central VCS. So I'm pushing it every 5 minutes into one with a cron job.
docking-station:~# cat /etc/cron.d/doxidized
# m h dom mon dow user command
*/5 * * * * root $(/srv/docker/oxidized/bin/oxidized_cron_git_push.sh)
docking-station:~# cat /srv/docker/oxidized/bin/oxidized_cron_git_push.sh
#!/bin/bash
DOCKER_OXIDIZED_BASE="/srv/docker/oxidized/"
OXIDIZED_GIT_DIR=".config/oxidized.git"
cd $ DOCKER_OXIDIZED_BASE /$ OXIDIZED_GIT_DIR
git push origin master --quiet
Now having all the nodes configurations in a source code hosting system, we can browse the configurations, changes, history and even establish notifications for changes. Mission accomplished!
Now I can test the coverage of our equipment. The last thing that would make me super happy, a oxidized Debian package!
docking-station:~# echo "7204vxr.lab.cyconet.org:cisco:admin:password:enable" >> \
/srv/docker/oxidized/.config/router.db
docking-station:~# echo "ccr1036.lab.cyconet.org:routeros:admin:password" >> \
/srv/docker/oxidized/.config/router.db
docking-station:~# docker run -e CONFIG_RELOAD_INTERVAL=600 \
-v /srv/docker/oxidized/.config/:/root/.config/oxidized \
-p 8888:8888/tcp -t oxidized/oxidized:latest oxidized
Puma 2.16.0 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://127.0.0.1:8888
If you want to have the container get started with the docker daemon automatically, you can start the container with --restart always and docker will take care of it. If I wanted to make it running permanent, I would use a systemd unitfile.
Reload configuration immediately
If you don't want to wait to automatically reload of the configuration, you can trigger it.
docking-station:~# curl -s http://localhost:8888/reload?format=json \
-O /dev/null
docking-station:~# tail -2 /srv/docker/oxidized/.config/log/oxidized.log
I, [2016-01-29T16:50:46.971904 #1] INFO -- : Oxidized starting, running as pid 1
I, [2016-01-29T16:50:47.073307 #1] INFO -- : Loaded 2 nodes
Writing nodes configuration
docking-station:/srv/docker/oxidized/.config/oxidized.git# git shortlog
Oxidizied (2):
update 7204vxr.lab.cyconet.org
update ccr1036.lab.cyconet.org
Writing the nodes configurations into a local bare git repository is neat but far from perfect. It would be cool to have all the stuff in a central VCS. So I'm pushing it every 5 minutes into one with a cron job.
docking-station:~# cat /etc/cron.d/doxidized
# m h dom mon dow user command
*/5 * * * * root $(/srv/docker/oxidized/bin/oxidized_cron_git_push.sh)
docking-station:~# cat /srv/docker/oxidized/bin/oxidized_cron_git_push.sh
#!/bin/bash
DOCKER_OXIDIZED_BASE="/srv/docker/oxidized/"
OXIDIZED_GIT_DIR=".config/oxidized.git"
cd $ DOCKER_OXIDIZED_BASE /$ OXIDIZED_GIT_DIR
git push origin master --quiet
Now having all the nodes configurations in a source code hosting system, we can browse the configurations, changes, history and even establish notifications for changes. Mission accomplished!
Now I can test the coverage of our equipment. The last thing that would make me super happy, a oxidized Debian package!
docking-station:~# curl -s http://localhost:8888/reload?format=json \
-O /dev/null
docking-station:~# tail -2 /srv/docker/oxidized/.config/log/oxidized.log
I, [2016-01-29T16:50:46.971904 #1] INFO -- : Oxidized starting, running as pid 1
I, [2016-01-29T16:50:47.073307 #1] INFO -- : Loaded 2 nodes
docking-station:/srv/docker/oxidized/.config/oxidized.git# git shortlog
Oxidizied (2):
update 7204vxr.lab.cyconet.org
update ccr1036.lab.cyconet.org
Writing the nodes configurations into a local bare git repository is neat but far from perfect. It would be cool to have all the stuff in a central VCS. So I'm pushing it every 5 minutes into one with a cron job.
docking-station:~# cat /etc/cron.d/doxidized
# m h dom mon dow user command
*/5 * * * * root $(/srv/docker/oxidized/bin/oxidized_cron_git_push.sh)
docking-station:~# cat /srv/docker/oxidized/bin/oxidized_cron_git_push.sh
#!/bin/bash
DOCKER_OXIDIZED_BASE="/srv/docker/oxidized/"
OXIDIZED_GIT_DIR=".config/oxidized.git"
cd $ DOCKER_OXIDIZED_BASE /$ OXIDIZED_GIT_DIR
git push origin master --quiet
Now having all the nodes configurations in a source code hosting system, we can browse the configurations, changes, history and even establish notifications for changes. Mission accomplished!
Now I can test the coverage of our equipment. The last thing that would make me super happy, a oxidized Debian package!
Siri and I are on a journey through India and Nepal,
with the aim of learning about needs of Debian derivatives,
to improve Debian and encourage closer integration.
When looking around to implement a nginx in front of a Docker web application, in most cases nginx itself is also a Docker container.
Survey URL:
What happened in the
Automatic Calendar Management Notmuch + Calypso
One of the big features of outlook/exchange in my world is
automatically merging of incoming calendar updates from email. This
makes my calendar actually useful in knowing what meetings people have
asked me to attend. As I'm not willing to otherwise tolerate outlook,
I decided to try and provide that in my preferred environment; notmuch
and calypso.
Identifying calendar updates
The first trick is how to identify incoming messages with calendar
updates. I'd love to be able to search for specific mime content
types, but I haven't been able to construct such a search. Failing
that, I'm just looking for messages containing the string
'text/calendar':
Here is my monthly update covering a large part of what I have been doing in the free software world (
Before I disappear into the Japanese winter holidays, here the Christmas update of all TeX Live packages. Nothing spectacular here, just the usual bunch of updates of loads of packages. There is a bug with respect to a file move from one package to another, will be fixed in an upload soon.
Updated packages
apnum, appendix, archaeologie, babel, babel-french, babel-greek, babel-hungarian, bangorcsthesis, beamer-verona, bhcexam, bibarts, bidi, bxjscls, chemfig, commado, comprehensive, context, cslatex, csplain, ctanify, doclicense, dvips, ejpecp, exsheets, fbb, fibeamer, fithesis, fontools, francais-bst, gitinfo2, glossaries, gnuplottex, greek-fontenc, hyph-utf8, indextools, ksp-thesis, l3build, l3experimental, l3kernel, l3packages, latexcourse-rug, lollipop, lstbayes, lualibs, luaotfload, luatexja, luatexko, luatodonotes, make4ht, mcf2graph, media9, mex, mfirstuc, mhchem, mptopdf, nameauth, nevelok, newtx, nicetext, nucleardata, ocgx2, pageslts, petri-nets, phonrule, pkuthss, powerdot, proofread, proposal, pst-labo, pst-solides3d, reledmac, sapthesis, serbian-lig, showlabels, t2, tcolorbox, tempora, testhyphens, tetex, tex4ebook, tex4ht, texlive-scripts, texsis, thuthesis, toptesi, tudscr, ucharcat, versonotes, xcharter, xepersian, xifthen, xindy, xint.
New packages
beamertheme-detlevcm, beamertheme-metropolis, beamertheme-phnompenh, beamer-verona, bitpattern, carbohydrates, delimseasy, drawmatrix, einfuehrung2, ellipse, ffslides, gitlog, greektonoi, ksp-thesis, longfbox, options, simpler-wick, unicode-data.
Enjoy.
Portability toward other systems has been improved: old versions of GNU diff are now supported (Mike McQuaid), suggestion of the appropriate locale is now the more generic
For the last week I have been stuck in England. For the vast majority of that time, I've had nothing to do except work on Debian and this blog post documents some of the things I worked on.
Obviously spending a whole week on Debian, there's going to be some packaging involved. The following packages got new versions in unstable this last week:
it looks like this autumn was not my best blogging time: this is the first
posting in 3 months. anyway, I wanted to give a quick overview about
my work on RC bugs. again nothing exciting, mostly just trying to fix the
ones popping up in the pkg-perl team.
This has been a great opportunity to raise awareness of the