Skip to content
Snippets Groups Projects
Commit b02463f6 authored by void's avatar void
Browse files

librenms und influxdb

parent 89ef7dd0
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
# - { path: /srv/xyz/secret_pw, length: 24 } # - { path: /srv/xyz/secret_pw, length: 24 }
# - { path: /srv/xyz/secret2_pw, length: 12 } # - { path: /srv/xyz/secret2_pw, length: 12 }
# Check if file exists
- name: "{{ item.path | basename }} (check directory)"
file:
path: "{{ item.path | dirname }}"
state: "directory"
# Check if file exists # Check if file exists
- name: "{{ item.path | basename }} (check file)" - name: "{{ item.path | basename }} (check file)"
......
---
- name: create folder struct for influxdb
file:
path: "{{ item }}"
state: "directory"
with_items:
- "/srv/influxdb/"
- "/srv/influxdb/data/"
- name: Docker Compose Konfig-Datei erstellen
template:
src: "docker-compose.yml"
dest: "/srv/influxdb/docker-compose.yml"
- name: start influxdb docker
docker_service:
project_src: /srv/influxdb/
state: present
version: "3"
services:
db:
image: influxdb:1.5.1
restart: always
ports:
- 8086:8086
- 2003:2003
volumes:
- /srv/influxdb/data/:/var/lib/influxdb
environment:
INFLUXDB_GRAPHITE_ENABLED: "true"
---
# Get secrets
- include: ../functions/get_secret.yml
with_items:
- { path: /srv/librenms/mysql_root_pw, length: 24 }
- { path: /srv/librenms/mysql_user_pw, length: 12 }
- name: create folder struct for librenms
file:
path: "{{ item }}"
state: "directory"
owner: www-data
group: www-data
with_items:
- "/srv/librenms/"
- "/srv/librenms/db/"
- "/srv/librenms/logs/"
- "/srv/librenms/rrd/"
- name: Docker Compose Konfig-Datei erstellen
template:
src: "docker-compose.yml"
dest: "/srv/librenms/docker-compose.yml"
- name: Zussätzliche Konfig-Datei erstellen
template:
src: "{{item}}"
dest: "/srv/librenms/{{item}}"
with_items:
- config.custom.php
- sql_mode.cnf
- name: start librenms docker
docker_service:
project_src: /srv/librenms/
state: present
<?php
# Netzwerke für Auto Discover
$config['nets'][] = '10.0.0.0/22';
$config['nets'][] = '192.168.0.0/24';
# Ignorierte Interfaces
$config['bad_if_regexp'][] = '/^lo.*$/';
$config['bad_if_regexp'][] = '/^br.*$/';
$config['bad_if_regexp'][] = '/^pf.*$/';
$config['bad_if_regexp'][] = '/^veth.*$/';
$config['bad_if_regexp'][] = '/^bridge.*$/';
$config['bad_if_regexp'][] = '/^docker.*$/';
# Export data to influxdb
$config['influxdb']['enable'] = true;
$config['influxdb']['transport'] = 'http';
$config['influxdb']['host'] = 'warpsrvint';
$config['influxdb']['port'] = '8086';
$config['influxdb']['db'] = 'librenms';
?>
version: "3"
services:
db:
image: mariadb:10.3.4
restart: always
volumes:
- /srv/librenms/db/:/var/lib/mysql
- /srv/librenms/sql_mode.cnf:/etc/mysql/conf.d/sql_mode.cnf
environment:
MYSQL_ROOT_PASSWORD: "{{ mysql_root_pw }}"
MYSQL_PASSWORD: "{{ mysql_user_pw }}"
MYSQL_DATABASE: librenms
MYSQL_USER: librenms
# run database upgrades: docker exec librenms_app_1 sh -c "cd /opt/librenms && php /opt/librenms/build-base.php"
# create initial user: docker exec librenms_app_1 php /opt/librenms/adduser.php admin admin 10 test@example.com
app:
image: jarischaefer/docker-librenms:1.37-1
restart: always
ports:
- 8088:80
- 514:514
- 514:514/udp
volumes:
- /srv/librenms/logs/:/opt/librenms/logs/
- /srv/librenms/rrd/:/opt/librenms/rrd/
- /srv/librenms/config.custom.php:/opt/librenms/conf.d/config.custom.php
environment:
DB_HOST: db
DB_NAME: librenms
DB_USER: librenms
DB_PASS: "{{ mysql_user_pw }}"
BASE_URL: http://warpsrvint:8088
TZ: Europe/Zurich
ALERTS_ENABLE: "true"
BILLING_CALCULATE_ENABLE: "false"
CHECK_SERVICES_ENABLE: "true"
DAILY_ENABLE: "true"
DISCOVERY_ENABLE: "true"
DISCOVERY_THREADS: 2
POLL_BILLING_ENABLE: "true"
POLLERS_ENABLE: "true"
POLLERS: 4
SNMP_SCAN_ENABLE: "true"
SNMP_SCAN_CRON: "30 * * * *"
ENABLE_SYSLOG: "true"
[mysqld]
innodb_file_per_table=1
sql-mode=""
lower_case_table_names=0
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
- { role: ../common/docker, tags: docker } - { role: ../common/docker, tags: docker }
- { role: nginx, tags: nginx } - { role: nginx, tags: nginx }
- { role: docker_grafana, tags: grafana } - { role: docker_grafana, tags: grafana }
- { role: docker_influxdb, tags: influxdb }
- { role: docker_iobroker, tags: iobroker } - { role: docker_iobroker, tags: iobroker }
- { role: docker_librenms, tags: librenms }
- { role: docker_l4z0r, tags: l4z0r } - { role: docker_l4z0r, tags: l4z0r }
# - { role: docker_ldap, tags: ldap } # - { role: docker_ldap, tags: ldap }
- { role: docker_mqtt, tags: mqtt } - { role: docker_mqtt, tags: mqtt }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment