lost and found ( for me ? )

ubuntu 12.04 : install collectd



many thanks.

# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"

# uname -ri
3.2.0-39-generic x86_64

install collectd and packages which are required for collectd.
# apt-get install -y apache2 libconfig-general-perl librrds-perl libregexp-common-perl  libhtml-parser-perl collectd-core

configure collectd.
get CPU , memory , locad , memory , disk info.
# cat /etc/collectd/collectd.conf
LoadPlugin cpu
LoadPlugin load
LoadPlugin memory
LoadPlugin disk
LoadPlugin rrdtool
<Plugin rrdtool>
 DataDir "/var/lib/collectd/rrd/"
</Plugin>

start collectd
# service collectd restart

configure apache2 to check graphs via HTTP.
In my case , I configured TCP 8888 port as the collectd’s HTTP port.
# pwd
/etc/apache2/sites-available

# cat collectd
<VirtualHost *:8888>

ScriptAlias /collectd/bin/ /usr/share/doc/collectd-core/examples/collection3/bin/
Alias /collectd/ /usr/share/doc/collectd-core/examples/collection3/
<Directory /usr/share/doc/collectd-core/examples/collection3/>
   AddHandler cgi-script .cgi
   DirectoryIndex bin/index.cgi
   Options +ExecCGI
   Order Allow,Deny
   Allow from all
</Directory>

</VirtualHost>

edit ports.conf to listen on TCP 8888.
# egrep -v ^# /etc/apache2/ports.conf

NameVirtualHost *:8888
Listen 8888

<IfModule mod_ssl.c>
   # If you add NameVirtualHost *:443 here, you will also have to change
   # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
   # to <VirtualHost *:443>
   # Server Name Indication for SSL named virtual hosts is currently not
   # supported by MSIE on Windows XP.
   Listen 443
</IfModule>

<IfModule mod_gnutls.c>
   Listen 443
</IfModule>

enable collectd site and start apache2.
# a2ensite collectd
# service apache2 restart

access to http://<collectd’s IP>:8888/collectd

CPU usage

Memory usage

add other graphs
There are plugins under /var/lib/collectd directory.
# pwd
/usr/lib/collectd

# ls | head -10
apache.so
apcups.so
ascent.so
battery.so
bind.so
conntrack.so
contextswitch.so
cpu.so
cpufreq.so
csv.so

edit collection.conf ( add TCP connections )
# cat /etc/collectd/collectd.conf
LoadPlugin cpu
LoadPlugin load
LoadPlugin memory
LoadPlugin disk
LoadPlugin rrdtool
LoadPlugin tcpconns
<Plugin rrdtool>
 DataDir "/var/lib/collectd/rrd/"
</Plugin>

restart collectd
# /etc/init.d/collectd restart



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.