-
-
Save tnolet/7361441 to your computer and use it in GitHub Desktop.
#!/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++ | |
# Get Collectd, untar it, make it and install | |
wget http://collectd.org/files/collectd-5.4.0.tar.gz | |
tar zxvf collectd-5.4.0.tar.gz | |
cd collectd-5.4.0 | |
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --mandir=/usr/share/man --enable-all-plugins | |
make | |
make install | |
# Copy the default init.d script | |
cp /root/collectd-5.4.0/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 | |
cracking little script. Saved me writing something similar :)
If you're on a new box and don't have the Perl tools installed you might need those too.
perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
if you want the notify_email plugin to work, be sure to include libesmtp and libesmtp-devel and ./configure with --with-libesmtp=/usr/lib64
👍 This script is good, Just in case if anyone wants to compile collect for ALL THE PLUGINS with all dependencies, follow this link: http://giovannitorres.me/enabling-almost-all-collectd-plugins-on-centos-6.html (Contains list of all dependencies) :)
rrdtool-prel should be rrdtool-perl
For some reason tcpconns
metrics are not being sent at all.
I'm running CentOS6 and I used this command to install the collectd:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64 --mandir=/usr/share/man --enable-all-plugins
[root@ip-10-152-219-179 ~]# collectd -h
Usage: collectd [OPTIONS]
Available options:
General:
-C <file> Configuration file.
Default: /etc/collectd.conf
-t Test config and exit.
-T Test plugin read and exit.
-P <file> PID-file.
Default: /var/run/collectd.pid
-f Don't fork to the background.
-h Display help (this message)
Builtin defaults:
Config file /etc/collectd.conf
PID file /var/run/collectd.pid
Plugin directory /usr/lib64/collectd
Data directory /var/lib/collectd
collectd 5.7.2, http://collectd.org/
by Florian octo Forster <[email protected]>
for contributions see `AUTHORS'
All metrics are being sent except of tcpconns, any suggestions?
there's a typo in the first yum install
command. Instead of rrdtool-perl you have rrdtool-prel
@joegoggins In CentOS the packages are
yajl
andyajl-devel
(no need for thelib
prefix).