How to Setup RackTables, a Datacenter and Server Room Asset Management for Linux

If you, as a system administrator, are in charge of managing not only servers but also your company’s IT assets, you will need to monitor their status as well as their physical location.

Additionally, you must to be able to report the current occupation and utilization percentage of your datacenter. Having this information handy is essential before planning new implementations or adding new equipment to your environment, and is as valid for small and medium-sized server rooms as for the classic datacenter and the cloud.

RackTables - A Datacenter and Server Room Asset Management for Linux
RackTables – A Datacenter and Server Room Asset Management for Linux

In this article we will explain how to install and use RackTables, a web-based datacenter management system in CentOS/RHEL 7, Fedora 23-24 and Debian/Ubuntu systems, that will help you to document your hardware assets, network addresses and configuration, and physical space available in racks, among other things.

Also, you can try out this software through a demo version in the project’s website in order to examine it before proceeding. We are sure you will love it!

System Prerequisites

In CentOS 7, although RackTables is available from the EPEL repository, we will install it by downloading the tarball with the installation files from the project’s website.

We will choose this approach in CentOS instead of downloading the program from the repositories to simplify and unify the installation on both distributions.

Our initial environment consists of a CentOS 7 server with IP 192.168.0.29 where we will install RackTables. We will later add other machines as part of our assets to be managed.

Step 1: Installing LAMP Stack

1. Basically, RackTables requires a LAMP stack to operate:

-------------- On CentOS and RHEL 7 -------------- 
# yum install httpd mariadb php 

-------------- On Fedora 24 and 23 --------------
# dnf install httpd mariadb php 

-------------- On Debian and Ubuntu --------------
# aptitude install apache2 mariadb-server mariadb-client php5 

2. Don’t forget to start the web and database servers:

# systemctl start httpd
# systemctl start mariadb
# systemctl enable httpd
# systemctl enable mariadb

By default, the web and database servers should be started by default. If not, use the same systemd-based commands to do it yourself. Also, run the mysql_secure_installation to secure your database server.

# mysql_secure_installation

Step 2: Download RackTables Tarball

3. Finally, download the tarball with the installation files, untar it, and perform the following steps. The latest stable version at the time of this writing (early July 2016) is 0.20.11:

# wget https://sourceforge.net/projects/racktables/files/RackTables-0.20.11.tar.gz
# tar xzvf RackTables-0.20.11.tar.gz
# mkdir /var/www/html/racktables
# cp -r RackTables-0.20.11/wwwroot /var/www/html/racktables

Now we can proceed with the actual RackTables installation in Linux, which we will cover in the next section.

Step 3: Install RackTables in Linux

The following actions need to be performed only after the above steps have been completed.

4. Launch a web browser and go to http://192.168.0.29/racktables/wwwroot/?module=installer (don’t forget the change the IP address or use a specific hostname instead). Next, click Proceed:

RackTables Installation in Linux
RackTables Installation in Linux

5. If some items are missing from the checklist that follows, return to the command line and install the necessary packages.

In this case we will ignore the HTTPS message to simplify our setup, but you are strongly encouraged to use it if you are considering to deploy RackTables in a production environment.

We will also ignore the other items inside yellow cells as they are not strictly required to make RackTables work.

Once we have installed the following packages, and restarted Apache we will refresh the above screen and all tests should show as passed:

# yum install php-mysql php-pdo php-mbstring 
RackTables Installation Checks
RackTables Installation Checks

Important: If you do not restart Apache, you will not be able to see the changes even if you click on Retry.

6. Make the configuration file writeable by the web server and disable SELinux during the installation:

# touch /var/www/html/racktables/wwwroot/inc/secret.php
# chmod 666 /var/www/html/racktables/wwwroot/inc/secret.php
# setenforce 0
Make RackTables Configuration Writable
Make RackTables Configuration Writable

Step 4: Create RackTables Database

7. Next, open a MariaDB shell with:

# mysql -u root -p

Important: Enter the password assigned to the root MariaDB user when you executed mysql_secure_installation command.

and create the database and grant the necessary permissions to the racktables_user (replace MY_SECRET_PASSWORD with one of your choosing):

CREATE DATABASE racktables_db CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON racktables_db.* TO racktables_user@localhost IDENTIFIED BY 'MY_SECRET_PASSWORD';
FLUSH PRIVILEGES;
RackTables Database Settings
RackTables Database Settings

Then click Retry.

Step 5: Setup RackTables Setup

8. Now it’s time to set the right ownership and minimum permissions for the secret.php file:

# chown apache:apache /var/www/html/racktables/wwwroot/inc/secret.php
# chmod 400 /var/www/html/racktables/wwwroot/inc/secret.php
Set RackTables Permissions
Set RackTables Permissions

9. After clicking Retry in the previous step, the database will be initialized:

RackTables Database Initialization
RackTables Database Initialization

10. You will be prompted to enter a password for the RackTables administrative account. You will use this password to login to the web-based interface in the next step.

Set RackTables Admin Password
Set RackTables Admin Password

11. If everything goes as expected, the installation should now be complete:

RackTables Installation Completed
RackTables Installation Completed

When you click Proceed, you will be prompted to login. Enter admin as username and the password you chose in the previous step for the administrative account. You will then be taken to the RackTables main user interface:

RackTables Admin Dashboard
RackTables Admin Dashboard

12. To access the UI more easily in the future, you may consider adding a symbolic link that points to the wwwroot directory in /var/www/html/racktables:

# ln -s /var/www/html/racktables/wwwroot/index.php /var/www/html/racktables/index.php

Then you will be able to login via http://192.168.0.29/racktables. Otherwise, you will need to use http://192.168.0.29/racktables/wwwroot instead.

13. One final adjustment you may want to make is replacing MyCompanyName (upper left corner) with the name of your company.

To do that, click on RackTables Administrator (upper right corner) and then on the Quick links tab. Next, make sure Configuration is checked and save changes by clicking on the icon with the blue arrow pointing to the disk at the bottom of the screen.

Finally, click on the newly-added Configuration link at the top of the screen, then click User interface and Change:

Change RackTables Name
Change RackTables Name

We are now ready to add equipment and other data to our asset management system.

Step 6: Adding RackTables Equipment and Data

14. When you first login to the UI, you will see the following self-explanatory asset and miscellaneous categories:

  1. Rackspace
  2. Objects
  3. IPv4 space
  4. IPv6 space
  5. Files
  6. Reports
  7. IP SLB
  8. 802.1Q
  9. Configuration
  10. Log records
  11. Virtual resources
  12. Patch cables

Feel free to click on them and spend some time to become familiar with RackTables. Most of the above categories have two or more tabs where you can view a summary of the inventory and add other items. In addition, you can refer to the following resources for more information:

  1. Wiki: https://wiki.racktables.org/index.php/Main_Page
  2. Mailing list: http://www.freelists.org/list/racktables-users

After completing the RackTables installation, you can re-enable SELinux using:

# setenforce 1

Step 7: Logging out RackTables Session

15. To log out from your current user session in RackTables, you will need to add the else statement below in /var/www/html/racktables/wwwroot/inc/interface.php inside the showLogOutURL function:

function showLogoutURL ()
    	if ($dirname != '/')
            	$dirname .= '/';
    	else
            	$dirname .= 'racktables';

Then restart Apache.

When you click on logout (upper right corner), another login box will appear. Dismiss it by clicking Cancel and your session will be terminated.

To log on again and pick up where you left off, click the Back button in your browser and login with your usual credentials.

Summary

In this article we have explained how to set up RackTables, an asset management system for your IT inventory. Don’t hesitate to let us know if you have any questions about or suggestions to improve this article. Feel free to use the comment form below to reach us anytime. We look forward to hearing from you!

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Gabriel Cánepa
Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

11 Comments

Leave a Reply
  1. Hi,
    Does anyone fix the logout session, the above instruction didn’t go well and I’m unable to logout the session.

    function showLogoutURL ()
    if ($dirname != ‘/’)
    $dirname .= ‘/’;
    else
    $dirname .= ‘racktables’;

    thank you in advance!

    Reply
  2. Hi Gabriel,

    I encountered a error when execute command line CREATE DATABASE racktables_db SET utf8 COLLATE utf8_general_ci; in Mariadb database returned with error :

    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘SET utf8 COLLATE utf8_general_ci’ at line 1

    Can you help as I am basic Linux user ?

    Reply
  3. Step 2 has a typo, with capital T:

    # mkdir /var/www/html/rackTables – Typo capital T, should be lower case
    # cp -r RackTables-0.20.11/wwwroot /var/www/html/rackTables – Typo capital T, should be lower case

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.