updated integration of agent

This commit is contained in:
nd 2020-05-22 21:17:59 +02:00
parent c677a02fde
commit 588fe344f1
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
6 changed files with 121 additions and 13 deletions

20
files/generate-config.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
tmpfile=`mktemp`
(
cat /etc/prometheus/conf.d/*.conf
echo "alerting:"
echo " alertmanagers:"
(cat /etc/prometheus/conf.d/alerting/*.conf 2> /dev/null | sed "s/^/ /") || echo ""
echo "scrape_configs:"
cat /etc/prometheus/conf.d/scrape_configs/*.conf
) > $tmpfile
chmod 0644 $tmpfile
mv $tmpfile /etc/prometheus/prometheus.yml
/usr/bin/systemctl reload prometheus