Installing cacti on AntiX with an external MySQL server

AntiX is a very lightweight distribution based on debian. It can efficiently use any old hardware you have lying around, which makes it ideal as the basis for a cacti server. Anything from and old office computer, to a new low watt mini itx box can be used to produce a capable cacti server.

The install is pretty easy, as it’s debian based the command is as simple as

sudo apt-get update
sudo apt-get install cacti

During the install, you’ll be asked to use dbconfigure to set up storage for cacti. You can follow the defaults, and it will prompt you to set a root password for mysql (after installing it) and then configure the user and tables for cacti to run from. I prefer to use an external MySQL server to store this data. I agreed to use the configuration script (it’s pretty good at setting things up), because cacti won’t automatically set itself up after install it will simply return fail pages. I told dbconfig not to install mysql, gave dbconfig the correct settings I wanted, and then did the following in another terminal tab:

cd /etc/dbconfig-common/
sudo nano cacti.conf

Fix the line:
dbc_dbserver=”
so that it points at your mysql server:
dbc_dbserver=’192.168.1.3′
also make sure you set a port:
dbc_dbport=’3306′

Select retry in the dbconfig screen when it fails the first time, and it will configure your cacti install to use this mysql server.

Now you’ll be greeted with the cacti scren….

Nope.

FATAL: Cannot connect to MySQL server on '192.168.1.63'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

The problem is that when dbconfig sets up the cacti user, it limits it to access from the the uname of the cacti server. Log into mysql using the root password, and alter the user so that it can log in from anywhere (%) or the IP address, if the uname isn’t working nicely. Now you’ll have no problem.
The default username and password is admin and cacti respectively, and you’ll be forced to change this once you log in the first time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s