add nginx exporter

This commit is contained in:
Ludovic Cartier 2023-04-21 15:16:01 +02:00
parent 159bb4137e
commit fb191f27d6
4 changed files with 19 additions and 0 deletions

View File

@ -17,6 +17,7 @@ prometheus_repo_blackbox: prometheus
prometheus_repo_memcached: prometheus
prometheus_repo_mongodb: percona
prometheus_repo_mysqld: prometheus
prometheus_repo_nginx: tchivert
prometheus_repo_node: prometheus
prometheus_repo_opcache: tchivert
prometheus_repo_phpfpm: Lusitaniae
@ -49,6 +50,8 @@ prometheus_mongodb_exporter_database: "admin"
prometheus_mongodb_exporter_host: "localhost"
prometheus_mongodb_exporter_port: 27017
prometheus_nginx_scrape_uri: "http://localhost/stub_status"
prometheus_opcache_exporter_fcgi_uri: "unix:///var/run/www.sock"
prometheus_phpfpm_sockets_directory: "/run/php/"

3
tasks/exporter/nginx.yml Normal file
View File

@ -0,0 +1,3 @@
---
- include_tasks: _common.yml
tags: ['prometheus_nginx_exporter']

View File

@ -39,5 +39,6 @@
- prometheus_opcache_exporter
- prometheus_blackbox_exporter
- prometheus_kong_exporter
- prometheus_nginx_exporter
with_items:
- "{{ prometheus_exporter_packages }}"

View File

@ -0,0 +1,12 @@
[Unit]
Description=Prometheus Nginx Exporter
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/prometheus-nginx-exporter \
-nginx.scrape-uri {{ prometheus_nginx_scrape_uri }} \
-web.listen-address=0.0.0.0:9113
[Install]
WantedBy=multi-user.target