Skip to content

Instantly share code, notes, and snippets.

Created Aug 24, 2012
What would you like to do?
pystatsd installation script
apt-get install python-pip
pip install pystatsd
cat > /etc/default/statsd <<EOF
STATSD_PORT=8125 # port to run on (default: 8125)
PCT=90 # stats pct threshold (default: 90)
GRAPHITE_HOST=localhost # host to connect to graphite on (default: localhost)
GRAPHITE_PORT=2003 # port to connect to graphite on (default: 2003)
USER=nobody # user to run statsd as
cat > /etc/init/statsd.conf <<EOF
description "start and stop the statsd server"
version "1.1"
author "Rob Terhaar"
description "statsd server"
respawn limit 15 5
#oom never
start on (local-filesystems
and net-device-up IFACE!=lo)
stop on shutdown
pre-start script
. /etc/default/statsd
end script
. /etc/default/statsd
exec su -s /bin/sh -c "/usr/local/bin/pystatsd-server \
--port $STATSD_PORT \
--pct $PCT \
--graphite-host $GRAPHITE_HOST \
--graphite-port $GRAPHITE_PORT" $USER
end script
post-stop script
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment