formula-prometheus-ng/prometheus/files/node_exporter.upstart.jinja

31 lines
842 B
Text
Raw Normal View History

2016-10-04 11:03:07 -04:00
# Prometheus Node Exporter (Upstart unit)
description "Prometheus exporter for machine metrics"
start on runlevel [2345]
stop on runlevel [06]
env NODE_EXPORTER=/usr/bin/node_exporter
env USER=prometheus
env GROUP=prometheus
env DEFAULTS=/etc/default/node_exporter
env RUNDIR=/var/run/node_exporter
env PID_FILE=/var/run/node_exporter/node_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/node_exporter", if available.
[ -e $DEFAULTS ] && . $DEFAULTS
export GOMAXPROCS=${GOMAXPROCS:-2}
exec start-stop-daemon -c $USER -g $GROUP -p $PID_FILE -x $NODE_EXPORTER -S -- $ARGS
end script
respawn
respawn limit 10 10
kill timeout 10