From 8cfbb37ed947a8072078f8ea71602958c608ecff Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Thu, 30 Jun 2022 00:15:40 -0700 Subject: [PATCH] Init librenms --- homelab/server/config/librenms/.env | 8 + .../server/config/librenms/docker-compose.yml | 172 ++++++++++++++++++ homelab/server/config/librenms/librenms.env | 13 ++ homelab/server/config/librenms/msmtpd.env | 10 + 4 files changed, 203 insertions(+) create mode 100644 homelab/server/config/librenms/.env create mode 100644 homelab/server/config/librenms/docker-compose.yml create mode 100644 homelab/server/config/librenms/librenms.env create mode 100644 homelab/server/config/librenms/msmtpd.env diff --git a/homelab/server/config/librenms/.env b/homelab/server/config/librenms/.env new file mode 100644 index 00000000..e00b0604 --- /dev/null +++ b/homelab/server/config/librenms/.env @@ -0,0 +1,8 @@ +DOCKER_DATA=/home/joey/data/librenms +TZ=America/Los_Angeles +PUID=1000 +PGID=1000 + +MYSQL_DATABASE=librenms +MYSQL_USER=librenms +MYSQL_PASSWORD=***REMOVED*** \ No newline at end of file diff --git a/homelab/server/config/librenms/docker-compose.yml b/homelab/server/config/librenms/docker-compose.yml new file mode 100644 index 00000000..7f5e70c0 --- /dev/null +++ b/homelab/server/config/librenms/docker-compose.yml @@ -0,0 +1,172 @@ +version: "3.5" + +services: + db: + image: mariadb:10.5 + container_name: librenms_db + command: + - "mysqld" + - "--innodb-file-per-table=1" + - "--lower-case-table-names=0" + - "--character-set-server=utf8mb4" + - "--collation-server=utf8mb4_unicode_ci" + volumes: + - "$DOCKER_DATA/db:/var/lib/mysql" + environment: + - "TZ=${TZ}" + - "MYSQL_ALLOW_EMPTY_PASSWORD=yes" + - "MYSQL_DATABASE=${MYSQL_DATABASE}" + - "MYSQL_USER=${MYSQL_USER}" + - "MYSQL_PASSWORD=${MYSQL_PASSWORD}" + restart: always + + memcached: + image: memcached:alpine + container_name: librenms_memcached + environment: + - "TZ=${TZ}" + restart: always + + redis: + image: redis:5.0-alpine + container_name: librenms_redis + environment: + - "TZ=${TZ}" + restart: always + + msmtpd: + image: crazymax/msmtpd:latest + container_name: librenms_msmtpd + env_file: + - "./msmtpd.env" + restart: always + + librenms: + image: librenms/librenms:latest + container_name: librenms + hostname: librenms + cap_add: + - NET_ADMIN + - NET_RAW + ports: + - target: 8000 + published: 8000 + protocol: tcp + depends_on: + - db + - memcached + - msmtpd + volumes: + - "./librenms:/data" + env_file: + - "./librenms.env" + environment: + - "TZ=${TZ}" + - "PUID=${PUID}" + - "PGID=${PGID}" + - "DB_HOST=db" + - "DB_NAME=${MYSQL_DATABASE}" + - "DB_USER=${MYSQL_USER}" + - "DB_PASSWORD=${MYSQL_PASSWORD}" + - "DB_TIMEOUT=60" + - "REDIS_HOST=redis" + - "REDIS_PORT=6379" + - "REDIS_DB=0" + restart: always + + dispatcher: + image: librenms/librenms:latest + container_name: librenms_dispatcher + hostname: librenms-dispatcher + cap_add: + - NET_ADMIN + - NET_RAW + depends_on: + - librenms + - redis + volumes: + - "./librenms:/data" + env_file: + - "./librenms.env" + environment: + - "TZ=${TZ}" + - "PUID=${PUID}" + - "PGID=${PGID}" + - "DB_HOST=db" + - "DB_NAME=${MYSQL_DATABASE}" + - "DB_USER=${MYSQL_USER}" + - "DB_PASSWORD=${MYSQL_PASSWORD}" + - "DB_TIMEOUT=60" + - "DISPATCHER_NODE_ID=dispatcher1" + - "REDIS_HOST=redis" + - "REDIS_PORT=6379" + - "REDIS_DB=0" + - "SIDECAR_DISPATCHER=1" + restart: always + + syslogng: + image: librenms/librenms:latest + container_name: librenms_syslogng + hostname: librenms-syslogng + cap_add: + - NET_ADMIN + - NET_RAW + depends_on: + - librenms + ports: + - target: 514 + published: 514 + protocol: tcp + - target: 514 + published: 514 + protocol: udp + volumes: + - "./librenms:/data" + env_file: + - "./librenms.env" + environment: + - "TZ=${TZ}" + - "PUID=${PUID}" + - "PGID=${PGID}" + - "DB_HOST=db" + - "DB_NAME=${MYSQL_DATABASE}" + - "DB_USER=${MYSQL_USER}" + - "DB_PASSWORD=${MYSQL_PASSWORD}" + - "DB_TIMEOUT=60" + - "REDIS_HOST=redis" + - "REDIS_PORT=6379" + - "REDIS_DB=0" + - "SIDECAR_SYSLOGNG=1" + restart: always + + snmptrapd: + image: librenms/librenms:latest + container_name: librenms_snmptrapd + hostname: librenms-snmptrapd + cap_add: + - NET_ADMIN + - NET_RAW + depends_on: + - librenms + ports: + - target: 162 + published: 162 + protocol: tcp + - target: 162 + published: 162 + protocol: udp + volumes: + - "./librenms:/data" + env_file: + - "./librenms.env" + environment: + - "TZ=${TZ}" + - "PUID=${PUID}" + - "PGID=${PGID}" + - "DB_HOST=db" + - "DB_NAME=${MYSQL_DATABASE}" + - "DB_USER=${MYSQL_USER}" + - "DB_PASSWORD=${MYSQL_PASSWORD}" + - "DB_TIMEOUT=60" + - "SIDECAR_SNMPTRAPD=1" + restart: always diff --git a/homelab/server/config/librenms/librenms.env b/homelab/server/config/librenms/librenms.env new file mode 100644 index 00000000..664b9d3b --- /dev/null +++ b/homelab/server/config/librenms/librenms.env @@ -0,0 +1,13 @@ +MEMORY_LIMIT=256M +UPLOAD_MAX_SIZE=16M +OPCACHE_MEM_SIZE=128 +REAL_IP_FROM=0.0.0.0/32 +REAL_IP_HEADER=X-Forwarded-For +LOG_IP_VAR=remote_addr + +LIBRENMS_SNMP_COMMUNITY=librenmsdocker +MEMCACHED_HOST=memcached +MEMCACHED_PORT=11211 + +LIBRENMS_WEATHERMAP=false +LIBRENMS_WEATHERMAP_SCHEDULE=*/5 * * * * \ No newline at end of file diff --git a/homelab/server/config/librenms/msmtpd.env b/homelab/server/config/librenms/msmtpd.env new file mode 100644 index 00000000..f51ff35e --- /dev/null +++ b/homelab/server/config/librenms/msmtpd.env @@ -0,0 +1,10 @@ +# https://github.com/crazy-max/docker-msmtpd +SMTP_HOST=smtp.gmail.com +SMTP_PORT=465 +SMTP_TLS=on +SMTP_STARTTLS=on +SMTP_TLS_CHECKCERT=on +SMTP_AUTH=on +SMTP_USER=noreply@jafner.net +SMTP_PASSWORD=jrfqlxfxykoextks +SMTP_FROM=noreply@jafner.net