1
0
Fork 0
mirror of https://github.com/librenms/docker.git synced 2026-01-23 02:14:48 +00:00
No description
Find a file
2018-07-08 15:37:49 +02:00
.res Initial version based on LibreNMS 1.41 2018-07-07 13:38:51 +02:00
assets Remove SSMTP and add SMTP relay container example 2018-07-08 15:09:54 +02:00
examples/compose Typo 2018-07-08 15:37:49 +02:00
.dockerignore Initial version based on LibreNMS 1.41 2018-07-07 13:38:51 +02:00
.editorconfig Initial version based on LibreNMS 1.41 2018-07-07 13:38:51 +02:00
.gitignore Initial version based on LibreNMS 1.41 2018-07-07 13:38:51 +02:00
.travis.yml Add MicroBadger hook 2018-07-07 13:54:56 +02:00
CHANGELOG.md Initial version based on LibreNMS 1.41 2018-07-07 13:38:51 +02:00
Dockerfile Remove SSMTP and add SMTP relay container example 2018-07-08 15:09:54 +02:00
entrypoint.sh Remove SSMTP and add SMTP relay container example 2018-07-08 15:09:54 +02:00
LICENSE Initial version based on LibreNMS 1.41 2018-07-07 13:38:51 +02:00
README.md Remove SSMTP and add SMTP relay container example 2018-07-08 15:09:54 +02:00

Version Build Status Docker Stars Docker Pulls Docker Repository on Quay Donate Paypal

About

🐳 LibreNMS Docker image based on Alpine Linux and Nginx.
If you are interested, check out my other 🐳 Docker images!

Features

Included

  • Alpine Linux 3.8, Nginx, PHP 7.2
  • Cron tasks as a "sidecar" container
  • OPCache enabled to store precompiled script bytecode in shared memory

From docker-compose

Docker

Environment variables

Key Default Description
TZ UTC Timezone (e.g. Europe/Paris)
PUID 1000 LibreNMS user id
PGID 1000 LibreNMS group id
MEMORY_LIMIT 256M PHP memory limit
UPLOAD_MAX_SIZE 16M Upload max size
OPCACHE_MEM_SIZE 128 PHP OpCache memory consumption
LIBRENMS_POLLER_THREADS 16 Threads that poller-wrapper.py runs
LIBRENMS_SNMP_COMMUNITY librenmsdocker Your community string
DB_HOST MySQL database hostname / IP address
DB_PORT 3306 MySQL database port
DB_NAME librenms MySQL database name
DB_USER librenms MySQL user
DB_PASSWORD librenms MySQL password
MEMCACHED_HOST Hostname / IP address of a Memcached server
RRDCACHED_HOST Hostname / IP address of a RRDcached server

Volumes

  • /data : Contains configuration, rrd database, logs

Ports

  • 80 : HTTP port

Use this image

Docker Compose

Docker compose is the recommended way to run this image. Copy the content of folder examples/compose in /var/librenms/ on your host for example. Edit the compose and env files with your preferences and run the following commands :

touch acme.json
chmod 600 acme.json
docker-compose up -d
docker-compose logs -f

Command line

You can also use the following minimal command :

docker run -d -p 80:80 --name librenms \
  -v $(pwd)/data:/data \
  -e "DB_HOST=db" \
  crazymax/librenms:latest

-e "DB_HOST=db"
⚠️ db must be a running MySQL instance

Notes

Edit configuration

You can edit configuration of LibreNMS by placing *.php files inside /data/config folder. Let's say you want to edit the WebUI config. Create a file called for example /data/config/webui.php with this content :

<?php
$config['page_refresh'] = "300";
$config['webui']['default_dashboard_id'] = 0;

This configuration will be included in LibreNMS and will override the default values.

Validate

If you want to validate your installation from the CLI, type the following command :

$ docker exec -it --user librenms librenms php validate.php
====================================
Component | Version
--------- | -------
LibreNMS  | 1.41
DB Schema | 253
PHP       | 7.2.7
MySQL     | 10.2.16-MariaDB-10.2.16+maria~jessie
RRDTool   | 1.7.0
SNMP      | NET-SNMP 5.7.3
====================================

[OK]    Composer Version: 1.6.5
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database schema correct
[WARN]  You have not added any devices yet.
        [FIX] You can add a device in the webui or with ./addhost.php
[FAIL]  fping6 location is incorrect or bin not installed.
        [FIX] Install fping6 or manually set the path to fping6 by placing the following in config.php: $config['fping6'] = '/path/to/fping6';
[WARN]  Your install is over 24 hours out of date, last update: Sat, 30 Jun 2018 21:37:37 +0000
        [FIX] Make sure your daily.sh cron is running and run ./daily.sh by hand to see if there are any errors.
[WARN]  Your local git branch is not master, this will prevent automatic updates.
        [FIX] You can switch back to master with git checkout master

Update database

To update the database manually, type the following command :

$ docker exec -it --user librenms librenms php build-base.php

Cron

If you want to enable the cron job, you have to run a "sidecar" container like in the docker-compose file or run a simple container like this :

docker run -d --name librenms-cron \
  --env-file $(pwd)/librenms.env \
  -v librenms:/data \
  crazymax/librenms:latest /usr/local/bin/cron

-v librenms:/data
⚠️ librenms must be a valid volume already attached to a LibreNMS container

Upgrade

To upgrade to the latest version of LibreNMS, pull the newer image and launch the container. LibreNMS will upgrade automatically :

docker-compose pull
docker-compose up -d

How can i help ?

All kinds of contributions are welcomed 🙌!
The most basic way to show your support is to star 🌟 the project, or to raise issues 💬
But we're not gonna lie to each other, I'd rather you buy me a beer or two 🍻!

Paypal

License

MIT. See LICENSE for more details.