Compare commits

...

4 Commits

3 changed files with 26 additions and 4 deletions

View File

@ -3,6 +3,18 @@
# Database servers # Database servers
--- ---
- hosts: vm-general-1.ashburn.mgmt.desu.ltd - hosts: vm-general-1.ashburn.mgmt.desu.ltd
tasks:
- name: assure prometheus psql exporter
ansible.builtin.docker_container:
name: prometheus-psql-exporter
image: quay.io/prometheuscommunity/postgres-exporter
env:
DATA_SOURCE_URI: "10.0.0.2:5432/postgres"
DATA_SOURCE_USER: "nagios"
DATA_SOURCE_PASS: "{{ secret_postgresql_monitoring_password }}"
ports:
- 9102:9187/tcp
tags: [ db, psql, prometheus, monitoring, docker ]
roles: roles:
- role: geerlingguy.postgresql - role: geerlingguy.postgresql
vars: vars:

View File

@ -42,6 +42,8 @@
image: quay.io/prometheus/node-exporter:latest image: quay.io/prometheus/node-exporter:latest
command: command:
- '--path.rootfs=/host' - '--path.rootfs=/host'
- '--collector.interrupts'
- '--collector.processes'
network_mode: host network_mode: host
pid_mode: host pid_mode: host
volumes: volumes:

View File

@ -1,17 +1,17 @@
# my global config # my global config
# vim:ft=ansible:
--- ---
global: global:
scrape_interval: 15s scrape_interval: 15s
evaluation_interval: 15s evaluation_interval: 15s
scrape_configs: scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries # Default Prometheus job to monitor itself
# scraped from this config.
- job_name: "prometheus" - job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs: static_configs:
- targets: ["localhost:9090"] - targets: ["localhost:9090"]
# These two jobs are included for every node in our inventory
- job_name: "node-exporter" - job_name: "node-exporter"
static_configs: static_configs:
- targets: - targets:
@ -24,3 +24,11 @@ scrape_configs:
{% for host in groups['tags_nagios'] %} {% for host in groups['tags_nagios'] %}
- '{{ host }}:9101' - '{{ host }}:9101'
{% endfor %} {% endfor %}
# This container is used on every psql machine
- job_name: "psql-exporter"
static_configs:
- targets:
{% for host in groups['tags_nagios-checkpgsql'] %}
- '{{ host }}:9102'
{% endfor %}