From ffed389eb5af59eff1b0c5b18c9afe6dbc456656 Mon Sep 17 00:00:00 2001 From: Tobias Bauriedel Date: Thu, 19 Sep 2024 14:13:19 +0200 Subject: [PATCH] Add InfluxDB --- README.md | 4 +++- Vagrantfile | 1 + ansible/playbook.yml | 2 ++ ansible/vars/icinga2.yml | 6 ++++++ ansible/vars/influxdb2.yml | 25 +++++++++++++++++++++++++ requirements.yml | 1 + 6 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 ansible/vars/influxdb2.yml diff --git a/README.md b/README.md index 3385c97..7edae87 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,11 @@ The most common used components are pre-installed and configured. * Icingadb Redis * Icinga Web 2 * Icinga Director -* Metrics (Ansible collection `tbauriedel.gographite`) +* Graphite (Ansible collection `tbauriedel.gographite`) * go-carbon * carbonapi +* InfluxDB (Ansible collection `tbauriedel.influxdb2`) + * InfluxDB v2 ## Requirements diff --git a/Vagrantfile b/Vagrantfile index 25d81ed..7f5108d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -12,4 +12,5 @@ Vagrant.configure("2") do |config| config.vm.network "forwarded_port", guest: 80, host: 80 config.vm.network "forwarded_port", guest: 443, host: 443 config.vm.network "forwarded_port", guest: 5665, host: 5665 + config.vm.network "forwarded_port", guest: 8086, host: 8086 end diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 5f44433..321b830 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -33,6 +33,8 @@ roles: - tbauriedel.gographite.gocarbon - tbauriedel.gographite.carbonapi + - tbauriedel.influxdb2.repos + - tbauriedel.influxdb2.influxdb2 - geerlingguy.mysql - icinga.icinga.repos - icinga.icinga.icinga2 diff --git a/ansible/vars/icinga2.yml b/ansible/vars/icinga2.yml index f9003f2..1ff90dd 100644 --- a/ansible/vars/icinga2.yml +++ b/ansible/vars/icinga2.yml @@ -31,6 +31,12 @@ icinga2_features: port: 2003 enable_send_thresholds: true enable_send_metadata: true + - name: influxdb2 + host: localhost + port: 8086 + bucket: icinga2 + organization: monitoring + auth_token: "AHDUKAGSszifgj21711sfztGASg2" icinga2_objects: - name: poweruser type: ApiUser diff --git a/ansible/vars/influxdb2.yml b/ansible/vars/influxdb2.yml new file mode 100644 index 0000000..836f9b3 --- /dev/null +++ b/ansible/vars/influxdb2.yml @@ -0,0 +1,25 @@ +--- +influxdb_influxdb2_host: "http://localhost:8086" +influxdb_influxdb2_primary_user: + name: admin + password: 'admin12345!' +influxdb_influxdb2_primary_org: default +influxdb_influxdb2_primary_bucket: default +influxdb_influxdb2_retention: 0 +influxdb_influxdb2_admin_token: AHDUKAGSszifgj21711sfztGASg2 + +influxdb_influxdb2_orgs: + - name: monitoring + desc: "Monitoring organization" + token: "{{ influxdb_influxdb2_admin_token }}" + +influxdb_influxdb2_buckets: + - name: icinga2 + org: monitoring + state: present + desc: "Icinga 2 perfdata" + retention: + type: expire + everySeconds: 1209600 # 2 weeks + shardGroupDurationSeconds: 172800 # 2 days + token: "{{ influxdb_influxdb2_admin_token }}" diff --git a/requirements.yml b/requirements.yml index 3cc776f..6930b88 100644 --- a/requirements.yml +++ b/requirements.yml @@ -5,3 +5,4 @@ roles: collections: - name: icinga.icinga - name: tbauriedel.gographite + - name: tbauriedel.influxdb2