Gathering server statistics: collectd


by ross at 18:21:43 on March 20, 2014

Edit /usr/local/etc/collectd.conf:

Hostname    ""
BaseDir     "/home/collectd/data"
TypesDB     "/usr/local/share/collectd/types.db"
Interval     10

LoadPlugin syslog
LoadPlugin apache
LoadPlugin cpu
LoadPlugin df
LoadPlugin exec
LoadPlugin interface
LoadPlugin load
LoadPlugin memcached
LoadPlugin memory
LoadPlugin mysql
LoadPlugin ping
LoadPlugin processes
LoadPlugin rrdtool
LoadPlugin uptime

<Plugin apache>
        URL "http://coffin.lan/mod_status?auto"
<Plugin df>
        FSType "ufs"
        FSType "zfs"
<Plugin exec>
        Exec "collectd:collectd" "/root/bin/hdd-temperature"
<Plugin interface>
        Interface "re0"
        Interface "re1"
<Plugin memcached>
        Host ""
        Port "11211"
<Plugin mysql>
        <Database coffin>
                Host "localhost"
                User "collectd"
                Password ""
                Socket "/tmp/mysql.sock"
<Plugin ping>
        Host ""
        Host ""
<Plugin processes>

If you want Apache statistics you must add ExtendedStatus on to httpd.conf and define this location on your virtual host:

        <Location /mod_status>
                SetHandler server-status
                Order Deny,Allow
                Deny from all
                Allow from

This is described in the documentation. Visit the site.