Centos 7 – Installing Collectd and Collectd-Web

Published on Author gryzli

Installing collectd/collectd-web is pretty easy (if we dont dive into the deep water). So the whole installation is basically installing several packages + few config modifications.

 

# Installing Collectd

 

# Install Centos 7 epel repository

 

# Install collectd + rrd support

 

# Uncomment some lines in collectd config file (/etc/collectd.conf)

 

Uncomment the following lines:

Hostname "localhost"
FQDNLookup true
BaseDir "/var/lib/collectd"
PIDFile "/var/run/collectd.pid"
PluginDir "/usr/lib64/collectd"
TypesDB "/usr/share/collectd/types.db"

 

With this configuration, the RRD files would be stored in the following directory: /var/lib/collectd/localhost/$plugin

, where $plugin would be the name of the plugin, whose data is stored.

# Restart collectd so , the new settings will apply

 

 

I don’t think that collectd-web is something you should use in production for some huge graphings, but it is pretty handy, to just check whats happening with your collectd stats.

So here is the easiest way to get it running.

# Installing Collectd-Web

 

First we would need some additional packages:

 

# Installing packages

 

The installation of collectd-web would be inside: /usr/local/collectd-web

 

# Download and untar collectd-web

 

# Customizing port/ip which collectd-web will be listening

By default collectd-web server will listen only on 127.0.0.1 and port 8888.

If you want you to be able to access the server by using some public ip. you should change this inside the python script for the server.

By modifying the file: /usr/local/collectd-web/runserver.py

, you can change these settings.

If you want Collectd-web to listen on all interface, you can do the following

By changing 0.0.0.0 to some public ip, you could bind the server to just one IP address.

 

Also inside runserver.py you could change the port, which collectd-web will you to listen to.

 

# Create collectd-web config

Before we finish, we need to tell collectd-web, where are the rrd files for the hosts/plugins it is going to show graphs about.

So this is done by doing the following: 

 

# Restart and running

 

# Enable and restart collects

 

 

# Start Collectd-web server

 

You may need to open tcp port 8888 for inbound connections, so you would be able to access your collectd-web instance.

Now you can access your collectd-web server by accesing the following address in your web browser:

http://your_server_ip:8888