From cbd5989707209baba0447124c183d1335c1140ef Mon Sep 17 00:00:00 2001 From: Claudio Maradonna Date: Fri, 25 Jun 2021 18:33:09 +0200 Subject: [PATCH] feature: custom files for prometheus exporters --- prometheus/exporters/apache.conf | 1 + prometheus/exporters/apache.service | 15 +++++++++++++++ prometheus/exporters/mysqld.service | 15 +++++++++++++++ prometheus/exporters/nginx.conf | 1 + prometheus/exporters/postgresql.conf | 2 ++ 5 files changed, 34 insertions(+) create mode 100644 prometheus/exporters/apache.conf create mode 100644 prometheus/exporters/apache.service create mode 100644 prometheus/exporters/mysqld.service create mode 100644 prometheus/exporters/nginx.conf create mode 100644 prometheus/exporters/postgresql.conf diff --git a/prometheus/exporters/apache.conf b/prometheus/exporters/apache.conf new file mode 100644 index 0000000..a8e2ad2 --- /dev/null +++ b/prometheus/exporters/apache.conf @@ -0,0 +1 @@ +ARGS='--scrape_uri="http://127.0.0.1/server-status?auto"' diff --git a/prometheus/exporters/apache.service b/prometheus/exporters/apache.service new file mode 100644 index 0000000..fbf05b1 --- /dev/null +++ b/prometheus/exporters/apache.service @@ -0,0 +1,15 @@ +[Unit] +Description=Prometheus exporter for Apache +Documentation=https://github.com/Lusitaniae/apache_exporter +Wants=network-online.target +After=network-online.target + +[Service] +User=root +Group=root +Type=simple +EnvironmentFile=/etc/default/prometheus-apache-exporter +ExecStart=/usr/bin/apache_exporter $ARGS + +[Install] +WantedBy=multi-user.target diff --git a/prometheus/exporters/mysqld.service b/prometheus/exporters/mysqld.service new file mode 100644 index 0000000..0b9436c --- /dev/null +++ b/prometheus/exporters/mysqld.service @@ -0,0 +1,15 @@ +[Unit] +Description=Prometheus exporter for MariaDB +Documentation=https://github.com/prometheus/mysqld_exporter +Wants=network-online.target +After=network-online.target + +[Service] +User=root +Group=root +Type=simple +EnvironmentFile=/etc/default/prometheus-mariadb-exporter +ExecStart=/usr/bin/mysqld_exporter $ARGS + +[Install] +WantedBy=multi-user.target diff --git a/prometheus/exporters/nginx.conf b/prometheus/exporters/nginx.conf new file mode 100644 index 0000000..3068016 --- /dev/null +++ b/prometheus/exporters/nginx.conf @@ -0,0 +1 @@ +ARGS="-nginx.scrape-uri http://127.0.0.1:80/stub_status" diff --git a/prometheus/exporters/postgresql.conf b/prometheus/exporters/postgresql.conf new file mode 100644 index 0000000..afb72f4 --- /dev/null +++ b/prometheus/exporters/postgresql.conf @@ -0,0 +1,2 @@ +# peer mode +DATA_SOURCE_NAME='host=/var/run/postgresql sslmode=disable'