Gathering server statistics: collectd

collectd.conf

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

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

Hostname    "coffin.daemon-notes.com"
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>
<Plugin df>
        FSType "ufs"
        FSType "zfs"
</Plugin>
<Plugin exec>
        Exec "collectd:collectd" "/root/bin/hdd-temperature"
</Plugin>
<Plugin interface>
        Interface "re0"
        Interface "re1"
</Plugin>
<Plugin memcached>
        Host "127.0.0.1"
        Port "11211"
</Plugin>
<Plugin mysql>
        <Database coffin>
                Host "localhost"
                User "collectd"
                Password ""
                Socket "/tmp/mysql.sock"
        </Database>
</Plugin>
<Plugin ping>
        Host "8.8.8.8"
        Host "8.8.4.4"
</Plugin>
<Plugin processes>
</Plugin>

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 127.0.0.1
        </Location>

This is described in the documentation. Visit the site.

Comments