30 lines
No EOL
1.1 KiB
Django/Jinja
30 lines
No EOL
1.1 KiB
Django/Jinja
# Prometheus Alert Manager (Upstart unit)
|
|
description "An exporter for collectd. It accepts collectd's binary network protocol as sent by collectd's network plugin and metrics in JSON format via HTTP POST as sent by collectd's write_http plugin, and transforms and exposes them for consumption by Prometheus."
|
|
start on runlevel [2345]
|
|
stop on runlevel [06]
|
|
|
|
env ALERTMANAGER=/usr/bin/collectd_exporter
|
|
env USER=prometheus
|
|
env GROUP=prometheus
|
|
env DEFAULTS=/etc/default/collectd_exporter
|
|
env RUNDIR=/var/run/collectd_exporter
|
|
env PID_FILE=/var/run/collectd_exporter/collectd_exporter.pid
|
|
pre-start script
|
|
[ -e $DEFAULTS ] && . $DEFAULTS
|
|
|
|
mkdir -p $RUNDIR || true
|
|
chmod 0750 $RUNDIR || true
|
|
chown $USER:$GROUP $RUNDIR || true
|
|
end script
|
|
|
|
script
|
|
# read settings like GOMAXPROCS from "/etc/default/collectd_exporter", if available.
|
|
[ -e $DEFAULTS ] && . $DEFAULTS
|
|
|
|
export GOMAXPROCS=${GOMAXPROCS:-2}
|
|
exec start-stop-daemon -c $USER -g $GROUP -p $PID_FILE -x $ALERTMANAGER -S -- $ARGS
|
|
end script
|
|
|
|
respawn
|
|
respawn limit 10 10
|
|
kill timeout 10 |