1
0
Fork 0
mirror of https://github.com/librenms/docker.git synced 2026-01-23 10:15:22 +00:00

Set default port for MEMCACHED_PORT and RRDCACHED_PORT

This commit is contained in:
CrazyMax 2018-09-24 23:15:47 +02:00
parent f9fd0940d7
commit 6bd6385a10
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
5 changed files with 51 additions and 19 deletions

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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 <<EOL
<?php
\$config['memcached']['enable'] = true;
\$config['memcached']['host'] = '$MEMCACHED_HOST';
\$config['memcached']['port'] = $MEMCACHED_PORT;
\$config['memcached']['host'] = '${MEMCACHED_HOST}';
\$config['memcached']['port'] = ${MEMCACHED_PORT};
EOL
fi
@ -179,10 +182,10 @@ if [ ! -z "${LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST}" -a ! -z "${RRDCACHED_H
cat > ${LIBRENMS_PATH}/config.d/distributed_poller.php <<EOL
<?php
\$config['distributed_poller'] = true;
\$config['distributed_poller_name'] = '$LIBRENMS_DISTRIBUTED_POLLER_NAME';
\$config['distributed_poller_group'] = '$LIBRENMS_DISTRIBUTED_POLLER_GROUP';
\$config['distributed_poller_memcached_host'] = '$LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST';
\$config['distributed_poller_memcached_port'] = $LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_PORT;
\$config['distributed_poller_name'] = '${LIBRENMS_DISTRIBUTED_POLLER_NAME}';
\$config['distributed_poller_group'] = '${LIBRENMS_DISTRIBUTED_POLLER_GROUP}';
\$config['distributed_poller_memcached_host'] = '${LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_HOST}';
\$config['distributed_poller_memcached_port'] = ${LIBRENMS_DISTRIBUTED_POLLER_MEMCACHED_PORT};
EOL
fi

View file

@ -1,16 +1,29 @@
TZ=Europe/Paris
PUID=1000
PGID=1000
MEMORY_LIMIT=256M
UPLOAD_MAX_SIZE=16M
OPCACHE_MEM_SIZE=128
LIBRENMS_POLLER_THREADS=16
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
LIBRENMS_POLLER_INTERVAL=5
LIBRENMS_CRON_DISCOVERY_ENABLE=true
LIBRENMS_CRON_DAILY_ENABLE=true
LIBRENMS_CRON_ALERTS_ENABLE=true
LIBRENMS_CRON_BILLING_ENABLE=true
LIBRENMS_CRON_BILLING_CALCULATE_ENABLE=true
LIBRENMS_CRON_CHECK_SERVICES_ENABLE=true
LIBRENMS_CRON_POLLER_ENABLE=true
DB_HOST=db
DB_NAME=librenms
DB_USER=librenms
DB_PASSWORD=asupersecretpassword
DB_TIMEOUT=30
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
MEMCACHED_HOST=memcached
MEMCACHED_PORT=11211
RRDCACHED_HOST=rrdcached
RRDCACHED_PORT=42217