Coder Social home page Coder Social logo

paulpetring / docker-observium Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yelp/docker-observium

3.0 2.0 3.0 28 KB

Observium docker image with both professional and community edition support, ldap auth, and easy plugin support.

License: BSD 2-Clause "Simplified" License

Shell 34.36% ApacheConf 65.64%

docker-observium's Introduction

Observium

Dockerized version of Observium with support for external database, both communitiy and professional editions (via arbritrary svn source), packages to allow native LDAP auth, and easy plugin support by exposing htmldir as a volume.

At Yelp we use this to provide portability to our NMS. With a flexible image, it's easy to manage 2+ instances with Puppet or [insert way to configure/schedule containers here]. Good use cases would be instances for corp and prod, managed services and internal, or just a single one that's more predictable on any box.

Using this image

Examples assume the following directory layout:

$ tree $PWD
/opt/observium/volumes
├── config
│   └── config.php
├── html
├── logs
└── rrd

Linking volumes and using Observium CE:

$ docker run -d \
    --name observium \
    -p 8000:8000 \
    -v /opt/observium/volumes/config:/config \
    -v /opt/observium/volumes/html:/opt/observium/html \
    -v /opt/observium/volumes/logs:/opt/observium/logs \
    -v /opt/observium/volumes/rrd:/opt/observium/rrd \
    yelp/observium

Using Observium PE (or another SVN source):

$ docker run -d \
    --name observium \
    -p 8000:8000 \
    -v /opt/observium/volumes/config:/config \
    -v /opt/observium/volumes/html:/opt/observium/html \
    -v /opt/observium/volumes/logs:/opt/observium/logs \
    -v /opt/observium/volumes/rrd:/opt/observium/rrd \
    -e USE_SVN=true \
    -e [email protected] \
    -e SVN_PASS=dfed555743854a475345ae01a7668acc \
    -e SVN_REPO=http://svn.observium.org/svn/observium/trunk \
    yelp/observium

Using docker-compose:

$ #check and modify contents of docker-compose.yml.default
  #afterwards rename it to docker-compose.yml and run
 docker-compose up #for running as deamon add -d parameter

Volumes

The following volumes are set in the container:

Volume Purpose
/config config.php should go here
/opt/observium/html This allows you to add HTML plugins if you wish (such as weathermap!)
/opt/observium/logs HTTP error/access, observium.log and update-errors.log
/opt/observium/rrd Mount this where you have a ample space and back up!
/var/run/mysqld/mysqld.sock If you're running MySQL on the local Docker host, make use of this volume and set the SQL host to localhost in config.php

If you need to sub-in random, single files just add an extra -v argument to your run (or however you're starting the container. Puppet anyone?) to the path. We do this for /etc/php5/apache2/php.ini

Ports

Only TCP/8000 is exposed.

Environment variables

Variable Default Value
WORKERS 2
USE_WEATHERMAP false
CUSTOM_PHP_INI false
HOUSEKEEPING_ARGS '-yet'
USE_SVN false
SVN_USER N/A
SVN_PASS N/A
SVN_REPO N/A

If you don't have a subscription but run your own managed copy, feel free to sub-in your own repo.

Depending on your number of devices, the default 2 workers likely isn't enough based on a polling period every 5 minutes. Just pass WORKERS=32, for example, if your total core count is 32 and you want to use them all.

Weathermap

As in the list above, setting USE_WEATHERMAP will install network-weathermap under the htmldir if not there already and schedule map-poller.php in cron.

To modify configuration, volume mount observium's htmldir to access weathermap.

Maintenance

Observium has a tendancy to become huge over time with its eventlog containing every port that flaps, syslog, performance timings for every run, and more.

This image comes with a cronjob that will run daily for you to clean this up. By default it will run with the switches set for eventlog and performance timings, but like most things in this image it can be overridden by providing HOUSEKEEPING_ARGS as an environment variable.

Please checkout out the initial post in the mailing list for details on how to configure your config.php for better control and what each switch does.

Currently the stdout/stderr for the job isn't being sent to /dev/null so you should be able to see the status of your cleanups with docker logs [id]

It is recommended by Observium to run the housekeeping script manually first before relying on the crons since it may take awhile to first run. Do this if you are using existing data for this image.

Notes

This image installs and runs rrdcached. To make use of it, make sure your observium configuration sets

$config['rrdcached']    = "unix:/var/run/rrdcached.sock"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.