diff options
-rw-r--r-- | Dockerfile | 1 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | extra/auto-reload-config.runit | 12 |
3 files changed, 18 insertions, 0 deletions
@@ -12,3 +12,4 @@ RUN apt-get remove -y ruby-dev pkg-config make cmake RUN apt-get -y autoremove ADD extra/oxidized.runit /etc/service/oxidized/run +ADD extra/auto-reload-config.runit /etc/service/auto-reload-config/run @@ -230,6 +230,11 @@ rvm use --default 2.1.2 root@bla:~# ``` +If you want to have the config automatically reloaded (e.g. when using a http source that changes) +``` + root@bla:~# docker run -v /etc/oxidized:/root/.config/oxidized -p 8888:8888/tcp -e CONFIG_RELOAD_INTERVAL=3600 -t oxidized/oxidized:latest oxidized +``` + ## Cookbook ### Debugging In case a model plugin doesn't work correctly (ios, procurve, etc.), you can enable live debugging of SSH/Telnet sessions. Just add a ```debug``` option, specifying a log file destination to the ```input``` section. diff --git a/extra/auto-reload-config.runit b/extra/auto-reload-config.runit new file mode 100755 index 0000000..5eaecc8 --- /dev/null +++ b/extra/auto-reload-config.runit @@ -0,0 +1,12 @@ +#!/bin/bash + +if [ -z "$CONFIG_RELOAD_INTERVAL" ]; then + # Just stop and do nothing + read +fi + +while true; do + sleep $CONFIG_RELOAD_INTERVAL + echo "Reloading config..." + curl -s http://localhost:8888/reload?format=json -O /dev/null +done |