Skip to content

Instantly share code, notes, and snippets.

@cdgraff
Forked from tnolet/gist:7361441
Last active August 29, 2015 14:16
Show Gist options
  • Save cdgraff/c25c2dcdf2e88c5bb607 to your computer and use it in GitHub Desktop.
Save cdgraff/c25c2dcdf2e88c5bb607 to your computer and use it in GitHub Desktop.
Shell Script to compile Collectd
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++ yajl yajl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
# Get Collectd, untar it, make it and install
cd /usr/local/src
wget http://collectd.org/files/collectd-5.4.2.tar.gz
tar zxvf collectd-5.4.2.tar.gz
cd collectd-5.4.2
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64 --mandir=/usr/share/man --enable-all-plugins
make
make install
# Copy the default init.d script
cp /usr/local/src/collectd-5.4.2/contrib/redhat/init.d-collectd /etc/init.d/collectd
# Set the correct permissions
chmod +x /etc/init.d/collectd
# Start the deamon
service collectd start
# NOTE! FQDN lookup is enabled by default. This might give you troubles if you'r running on Vagrant or some cloud server
# Check /var/log/messages for something like "Looking up "<yourhost>" failed. You have set the "FQDNLookup" option, but I cannot resolve my hostname...
# The fix is easy, just set "FQDNLookup false" in /etc/collectd.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment