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.
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!
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.
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:
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
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
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 [email protected] IDENTIFIED BY 'MY_SECRET_PASSWORD'; FLUSH PRIVILEGES;
Then click Retry.
Step 5: Setup RackTables Setup
8. Now it’s time to set the right ownership and minimum permissions for the
# chown apache:apache /var/www/html/racktables/wwwroot/inc/secret.php # chmod 400 /var/www/html/racktables/wwwroot/inc/secret.php
9. After clicking Retry in the previous step, the database will be initialized:
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.
11. If everything goes as expected, the installation should now be complete:
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:
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
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:
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:
- IPv4 space
- IPv6 space
- IP SLB
- Log records
- Virtual resources
- 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:
- Wiki: https://wiki.racktables.org/index.php/Main_Page
- 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
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.
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!