Upstart script for Collectd

Application Management Published on 1 min Last updated

We have been doing some internal testing with Collectd.

"collectd gathers statistics about the system it is running on and stores this information. Those statistics can then be used to find current performance bottlenecks (i.e. performance analysis) and predict future system load (i.e. capacity planning). Or if you just want pretty graphs of your private server and are fed up with some homegrown solution you're at the right place, too ;)." (taken from their website)

Anyway, we are quite impressed with it but during the configuration I couldn't locate an upstart script for it so - I made my own.

author "Loadbalancer.org <support@loadbalancer.org>"
version "1.0"
#Loadbalancer.org - Start collectd upstart script
#
# This service maintains collectd
#
# to start -
# initctl start lb_collectd
# to stop
# initctl stop lb_collectd
#
#
start on runlevel [345]
stop on runlevel [S016]
respawn
expect fork
#stop the service if it tries to respawn more than 10 times in 5 seconds.
respawn limit 10 5
#check configuration is valid before starting collectd
pre-start exec /usr/local/sbin/collectd -t -C /etc/collectd.conf
#start collectd
exec /usr/local/sbin/collectd -C /etc/collectd.conf

All complaints to /dev/null :-)

Feel free to put your suggestions below.