From 6bd6385a10f95abaef00538bf960bed5b2190444 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 24 Sep 2018 23:15:47 +0200 Subject: [PATCH] Set default port for MEMCACHED_PORT and RRDCACHED_PORT --- .travis.yml | 12 ++++++------ CHANGELOG.md | 4 ++++ README.md | 22 +++++++++++++++++----- entrypoint.sh | 15 +++++++++------ examples/compose/librenms.env | 17 +++++++++++++++-- 5 files changed, 51 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16000c9..0b99854 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,12 +28,12 @@ install: docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ --build-arg VCS_REF=${TRAVIS_COMMIT::8} \ --build-arg VERSION=${VERSION} \ - -t $DOCKER_USERNAME/$DOCKER_REPONAME . + -t docker_build . before_script: - docker network create -d bridge $DOCKER_REPONAME - docker run -d --network=$DOCKER_REPONAME --name db mariadb:10.2 - - docker run -d --network=$DOCKER_REPONAME --link db -p 8000:80 -e "DB_HOST=db" -e "DB_PASSWORD=asupersecretpassword" --name $DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME + - docker run -d --network=$DOCKER_REPONAME --link db -p 8000:80 -e "DB_HOST=db" -e "DB_PASSWORD=asupersecretpassword" --name $DOCKER_REPONAME docker_build - sleep 20 - docker logs $DOCKER_REPONAME @@ -44,12 +44,12 @@ after_success: - | test $TRAVIS_PULL_REQUEST = false \ && echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin \ - && docker tag $DOCKER_USERNAME/$DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \ - && docker tag $DOCKER_USERNAME/$DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \ + && docker tag docker_build $DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \ + && docker tag docker_build $DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \ && docker push $DOCKER_USERNAME/$DOCKER_REPONAME \ && echo "$QUAY_PASSWORD" | docker login quay.io --username "$QUAY_USERNAME" --password-stdin \ - && docker tag $DOCKER_USERNAME/$DOCKER_REPONAME quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \ - && docker tag $DOCKER_USERNAME/$DOCKER_REPONAME quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \ + && docker tag docker_build quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG \ + && docker tag docker_build quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION \ && docker push quay.io/$QUAY_USERNAME/$QUAY_REPONAME \ && curl -X POST $MICROBADGER_HOOK diff --git a/CHANGELOG.md b/CHANGELOG.md index f81faa8..07eae4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.43-RC3 (2018/09/24) + +* Set default port for `MEMCACHED_PORT` and `RRDCACHED_PORT` + ## 1.43-RC2 (2018/09/24) * Add CAP_NET_RAW on nmap and fping diff --git a/README.md b/README.md index f4b183a..21eb9aa 100644 --- a/README.md +++ b/README.md @@ -37,12 +37,17 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other ### Environment variables +#### General + * `TZ` : The timezone assigned to the container (default `UTC`) * `PUID` : LibreNMS user id (default `1000`) * `PGID`: LibreNMS group id (default `1000`) * `MEMORY_LIMIT` : PHP memory limit (default `256M`) * `UPLOAD_MAX_SIZE` : Upload max size (default `16M`) * `OPCACHE_MEM_SIZE` : PHP OpCache memory consumption (default `128`) + +#### (Distributed) Poller + * `LIBRENMS_POLLER_THREADS` : Threads that `poller-wrapper.py` runs (default `16`) * `LIBRENMS_POLLER_INTERVAL` : Interval in minutes at which `poller-wrapper.py` runs (defaults to `5`) [docs](https://docs.librenms.org/#Support/1-Minute-Polling/) * `LIBRENMS_DISTRIBUTED_POLLER_ENABLE` : Enable distributed poller functionality @@ -50,6 +55,9 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other * `LIBRENMS_DISTRIBUTED_POLLER_GROUP` : By default, all hosts are shared and have the poller_group = 0. To pin a device to a poller, set it to a value greater than 0 and set the same value here. One can also specify a comma separated string of poller groups. The poller will then poll devices from any of the groups listed. [docs](https://docs.librenms.org/#Extensions/Distributed-Poller/#distributed-poller) * `LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST` : Memcached server for poller synchronization (Defaults to `$MEMCACHED_HOST`) * `LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_PORT` : Port of memcached server (Defaults to `$MEMCACHED_PORT`) + +#### Cron + * `LIBRENMS_CRON_DISCOVERY_ENABLE` : Enable LibreNMS discovery for this container cronjobs (default `true`) * `LIBRENMS_CRON_DAILY_ENABLE` : Enable LibreNMS daily script for this container cronjobs (default `true`) * `LIBRENMS_CRON_ALERTS_ENABLE` : Enable LibreNMS alerts generation for this container cronjobs (default `true`) @@ -57,17 +65,23 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other * `LIBRENMS_CRON_BILLING_CALCULATE_ENABLE` : Enable LibreNMS billing for this container cronjobs (default `true`) * `LIBRENMS_CRON_CHECK_SERVICES_ENABLE` : Enable LibreNMS service checks for this container cronjobs (default `true`) * `LIBRENMS_CRON_POLLER_ENABLE` : Enable LibreNMS polling for this container cronjobs (default `true`) -* `LIBRENMS_SNMP_COMMUNITY` : This container's SNMP v2c community string (default `librenmsdocker`) + +#### Database + * `DB_HOST` : MySQL database hostname / IP address * `DB_PORT` : MySQL database port (default `3306`) * `DB_NAME` : MySQL database name (default `librenms`) * `DB_USER` : MySQL user (default `librenms`) * `DB_PASSWORD` : MySQL password (default `librenms`) * `DB_TIMEOUT` : Time in seconds after which we stop trying to reach the MySQL server (useful for clusters, default `30`) + +#### Misc + +* `LIBRENMS_SNMP_COMMUNITY` : This container's SNMP v2c community string (default `librenmsdocker`) * `MEMCACHED_HOST` : Hostname / IP address of a Memcached server -* `MEMCACHED_PORT` : Port of the Memcached server +* `MEMCACHED_PORT` : Port of the Memcached server (default `11211`) * `RRDCACHED_HOST` : Hostname / IP address of a RRDcached server -* `RRDCACHED_PORT` : Port of the RRDcached server +* `RRDCACHED_PORT` : Port of the RRDcached server (default `42217`) ### Volumes @@ -157,8 +171,6 @@ SNMP | NET-SNMP 5.7.3 [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. diff --git a/entrypoint.sh b/entrypoint.sh index 8c707c6..56930dc 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,6 +37,9 @@ DB_NAME=${DB_NAME:-"librenms"} DB_USER=${DB_USER:-"librenms"} DB_TIMEOUT=${DB_TIMEOUT:-"30"} +MEMCACHED_PORT=${MEMCACHED_PORT:-"11211"} +RRDCACHED_PORT=${RRDCACHED_PORT:-"42217"} + # From https://github.com/docker-library/mariadb/blob/master/docker-entrypoint.sh#L21-L41 # usage: file_env VAR [DEFAULT] # ie: file_env 'XYZ_DB_PASSWORD' 'example' @@ -160,8 +163,8 @@ if [ ! -z "${MEMCACHED_HOST}" ]; then cat > ${LIBRENMS_PATH}/config.d/memcached.php < ${LIBRENMS_PATH}/config.d/distributed_poller.php <