So, you have decided to install the Cacti tool. Throughout this book you will learn how to use Cacti and learn new things about it. This book will build up your knowledge, from chapter to chapter, as you complete the tasks. As you go through the book, you will see different information boxes and tips, and I encourage you to read through them as they provide valuable information. At the end of each chapter you will see a summary of what has been covered in the chapter and what you will learn in the chapter to follow.
Let's get on with setting up Cacti 1.x. Take a look at what we will do next. In this chapter we are going to cover:
- Installing the prerequisites for Cacti on a CentOS 7 system
- Installing Cacti on a CentOS 7 system and Windows 2012 R2 system
- Compiling and installing the Spine poller
- Upgrading an existing Cacti installation
- Running Cacti for the first time
- A quick overview of the Cacti web frontend
Here we go...
In order to install and run Cacti, we need to make sure that all system prerequisites are met. Here we'll give an overview of the different components needed.
As most of Cacti is built as a web interface, a web server is needed. This can be Apache's HTTPD or Microsoft Internet Information Server if installing on Windows, but, in fact, any PHP-capable web server can be used to run the web interface. For optimal support, the use of Apache or IIS is suggested.
Cacti has been built with the PHP programming language, and therefore needs PHP to be installed on the system. Most Linux distributions already have a base PHP environment installed but some might need additional packages for Cacti to function properly. In particular, the LDAP, SNMP, and MySQL extensions should be installed. Be aware that Cacti 1.1 does not support PHP 7.1.
Cacti uses the freely available MySQL and MariaDB database engines for its database server and they are available for most operating systems. One should note that the database server does not need to be installed on the same host as Cacti. For best performance and to avoid stability issues with the Spine poller, MySQL version 5.6 or MariaDB 10.x should be used.
You're now going to install Cacti from source on a CentOS 7 system. You'll use CentOS 7 as it's 100% binary compatible with Red Hat Enterprise Linux 7, but in fact you can follow most of the installation process on other Linux distributions like Ubuntu or SUSE Linux as well. By installing from source you'll get some insight into the inner workings of Cacti, and it will also provide you with a system that most Cacti and plugin developers are used to. There are differences between a source installation and a yum
/apt
installation, but they will be described later on. Let's get started.
Assume that the CentOS system has been installed with only the "Server" package selected and there is no graphical user interface installed.
This is the default installation for a CentOS system with no manual package selection.
The default CentOS installation is missing several important packages. This section will show you how to install all required packages on your CentOS 7 system as well as the latest MariaDB 10.x version:
- Set up the MariaDB repository for installing the latest MariaDB version. You can get the latest repository from https://downloads.mariadb.org/mariadb/repositories/:
echo "# MariaDB 10.1 CentOS repository list - created 2017-02-08 16:11 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1" > /etc/yum.repos.d/MariaDB.repo
- Now we can install all required packages for Cacti:
yum -y install mariadb-server php php-cli php-mysql net-snmp-utils rrdtool php-snmp gcc mariadb-devel net-snmp-devel autoconf automake libtool dos2unix wget help2man php-posix php-ldap php-mbstring php-gd
- At this point you should also take care of updating your packages to the latest version. The following command will do this for you:
yum -y upgrade
- The next step will start the required MySQL/MariaDB server:
systemctl restart mariadb.service
- Cacti 1.x requires the
timezone
tables within MySQL to be populated. The following commands allow you to do so:
mysql_tzinfo_to_sql /usr/share/zoneinfo > /tmp/mysql_timezone.sql
mysql -u root mysql < /tmp/mysql_timezone.sql
- The
timezone
settings for Cacti are very important, so you will need to set your currenttimezone
. The following command will help you to do so:
timedatectl set-timezone Europe/Berlin
- Now that you have set your
timezone
, installed the MySQL/MariaDB server, and upgraded your system, you will have to set some special configuration parameters for MySQL/MariaDB. Edit the/etc/my.cnf
file:
vi /etc/my.cnf
- Change your
[mysqld]
section. Make sure to change the time zone setting to your actualtimezone
:
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock symbolic-links=0 max_heap_table_size=90M max_allowed_packet=16M tmp_table_size=64M join_buffer_size=64M innodb_file_per_table=ON innodb_buffer_pool_size=450M innodb_doublewrite=OFF innodb_additional_mem_pool_size=80M innodb_lock_wait_timeout=50 innodb_flush_log_at_trx_commit=2 collation_server=utf8_general_ci character_set_client=utf8 default-time-zone='Europe/Berlin' innodb_flush_log_at_timeout=3 innodb_read_io_threads=32 innodb_write_io_threads=16
- As you have already learned, the
timezone
setting is very important in Cacti. You already changed it for the database server and your system, but PHP also needs to be aware of yourtimezone
. Therefore, you will now edit the/etc/php.ini
file. While doing so you will also enable error logging for the syslog system, which will help you find issues with custom plugins. Now edit the/etc/php.ini
file and set the following lines:
; Log errors to syslog (Event Log on NT, not valid in Windows 95). error_log = syslog ... [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = Europe/Berlin
- The next step will enable the web server as well as restart the required MySQL/MariaDB server. Use the following commands to start these:
systemctl start httpd.service
systemctl restart mariadb.service
- Now that the web server is up and running, you should enable the
http
/https
ports on the CentOS firewall. Thefirewall-cmd
command will help you with this task:
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --reload
- As you want to have both services started automatically after a reboot of the system, you should also enable both services during boot time. This final step will allow you to do so:
systemctl enable httpd.service
systemctl enable mariadb.service
- As a final step you should set the SELinux system to permissive. On a CentOS/RHEL system this can be done by editing the file
/etc/selinux/config
and setting the SELINUX variable to permissive, which will become active after the next restart:
SELINUX=permissive
- Before continuing it is now a good time to restart the system.
You just gave the system a location to find the remaining packages needed for the Cacti installation and then installed them. You also enabled the web server and database server to start at boot time. In addition, you have also set some very important system settings and disabled the SELinux setting. You are now ready to start the next installation phase.
Go to http://www.cacti.net and download the latest version of Cacti. In the top-left corner, under Downloads
, click on the Cacti
link. You can download the Cacti files from there. Please also make a note of the latest stable version
. You will need this information in the following steps. For simplicity, we're assuming that your server has an internet connection.
Note
Cacti version variable CACTIVERSION:
As the Cacti version may be different, we will use the CACTIVERSION
or NEWCACTIVERSION
variables during the different installation and upgrade steps to refer to the Cacti version. Check the current version on the Cacti website and change these variables accordingly.
It's now time to download the latest Cacti version to your server. You will need your system username and password to login to your CentOS installation. If you have installed your CentOS system with the default settings, you should already have an SSH server running. If you're already logged in on the machine, you can ignore the first step:
- From a Windows machine, log on to your system using an SSH client such as Putty. If this is the first time you are connecting to the server, Putty will display a security alert and ask you to accept the RSA key. After doing so, Putty will display a logon prompt where you can log on to the system.
- Maximizing the window so long text lines do not break at the end of the line might make things easier.
- You'll need to become the root user in order to be able to set up Cacti properly. Should that not be an option, performing these steps with
sudo
should achieve the same results. - Change to
/var/www/html
. This is the document root for Apache. - Create the
CACTIVERSION
variable and set it to the current Cacti version
export CACTIVERSION=1.1.28
- To download Cacti, you can use the
wget
command. Enter the following command to download Cacti:
wget https://www.cacti.net/downloads/cacti-$CACTIVERSION.tar.gz
- You should see the following output on your screen:
- You now have the
tar.gz
file on your system, so let's move on and extract it. The following command will extract the files and directories contained in the archive to the current directory:
tar -xzvf cacti-$CACTIVERSION.tar.gz
- Finally, you are going to create a symbolic link to this new Cacti directory. This will allow you to easily switch between different Cacti versions later, for example, when upgrading Cacti. To create a symbolic link, enter the following command to create a link named
cacti
which points to thecacti-1.1.28
directory:
ln -s cacti-$CACTIVERSION cacti
The database isn't automatically created during the installation of Cacti. Therefore, you are now going to create it here. At the same time, a database user for Cacti should be created to allow it to access the database. It's also a good idea to secure the MySQL database server by using one of the included CentOS tools or the commands provided.
For simplicity, let's assume that you're going to host the database on the same server as Cacti:
- Execute the following command to log on to the MySQL/MariaDB CLI:
mysql -u root mysql
- The default MySQL root account does not have a password set, so you can do it now:
SET PASSWORD FOR root@localhost = PASSWORD('MyN3wpassw0rd');
- You can remove the example database, as it is not needed:
DROP DATABASE test;
- Together with the example database, some example users may have been created. You can remove these with the following command:
DELETE FROM user WHERE NOT (host = "localhost" AND user = "root");
- On a CentOS distribution you can use the following command to guide you through the preceding steps:
/usr/bin/mysql_secure_installation
- Now that MySQL is secured, let's create the Cacti database. Enter the following command. This will ask for the MySQL root password which you provided in setup step 1 or step 5. When finished, you'll have an empty database called
cacti
:
mysqladmin -u root -p create cacti
- As the database is still empty, you need to create the tables and fill them with the initial data that comes with Cacti. The following command will do just that. Once the command finishes you'll have a working
cacti
database:
mysql -u root -p cacti < /var/www/html/cacti/cacti.sql
- Unfortunately, Cacti is still unable to access it, therefore you're now going to create a database user for Cacti. Enter the following command:
mysql -u root -p mysql
- You'll see the following on the screen:
- Type the next few lines in the MySQL prompt to create the Cacti user and allow him to use the
time_zone_name
table of MySQL. Make sure to choose a strong password:
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'MyV3ryStr0ngPassword';
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'MyV3ryStr0ngPassword';
flush privileges;
exit
You used some tools to secure the MySQL server and created a database. You also filled the Cacti database with the initial Cacti data and created a MySQL user for Cacti. However, Cacti still needs to know how to access the database, so let's move on to the next step.
If you are not using CentOS to install Cacti, you can use some MySQL internal functions to secure your installation.
You need to tell Cacti where to find the database and which credentials it should use to access it. This is done by editing the config.php
file in the include
directory.
The database and some other special configuration tasks are done by editing the information in the config.php
file:
- Change to the
cacti
directory:
cd /var/www/html/cacti/include
- Edit
config.php
withvi
:
vi config.php
- Change the
$database_username
and$database_password
fields to the previously created username and password. The content of the file should now look like the following:
There are many other settings within this file that we will explain in later chapters, so leave them alone for now.
For the poller to work correctly, Cacti also requires a system user account. You are going to create one now and also set up the poller's cron entry. We are going for a one-minute-based poller interval to prepare for the one-minute polling in a later chapter.
Let's create the cron entry so the poller runs frequently:
- To create a user called
cactiuser
, issue the following command as root. It will also add the user to theapache
group:
adduser --groups apache cactiuser
- Change to the
cacti
directory:
cd /var/www/html/cacti
- Change the ownership of the
cacti
directory, the newly created user, andapache
. You will also change the permissions of some special directories as well as enable theapache
user group to write to therra
andlog
directory. Thesetfacl
command is important for some internal Cacti processes to work properly and makes sure that theapache
user is able to write to these directories:
chown -R cactiuser.apache /var/www/html/cacti/
chmod -R 775 rra/ log/ resource/ scripts/ cache/
setfacl -d -m group:apache:rw /var/www/html/cacti/rra
setfacl -d -m group:apache:rw /var/www/html/cacti/log
- Add the poller cron entry. Edit the
cacti
file in/etc/cron.d
:
vi /etc/cron.d/cacti
- Add the following line to the file:
*/1 * * * * cactiuser /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1
- Save the file.
You just created a system user that runs the Cacti poller, and scheduled the poller to run every one-minute. Cacti, by default, is still configured for a five-minute-based polling interval, but it can be changed to one minute if needed. The poller itself can run at different intervals. You are going to configure a one minute polling interval in a later chapter.
By default, Cacti comes with a poller written in PHP. For small to medium installations this poller does its job just fine, but for large installations an alternative poller needs to be used, and Spine is it. It's written in C and is much faster than the original poller because it uses the multi-tasking capabilities of modern operating systems and hardware.
Here we will take a deep dive into installing and configuring the Spine poller:
- As with the Cacti main files, go to http://www.cacti.net and click on
Spine
under theDownload
section. Make a note of the latest stable version. - If not already done, create the
CACTIVERSION
variable and set it to the current Cacti version:
export CACTIVERSION=1.1.28
- Change directories to
/tmp/
and issue the following command:
cd /tmpwget https://www.cacti.net/downloads/spine/cacti-spine-$CACTIVERSION.tar.gz
- Extract the file:
tar -xzvf cacti-spine-$CACTIVERSION.tar.gz
- Change to the newly created directory:
cd cacti-spine-$CACTIVERSION
- Prepare the directory for compilation. Please note that this step may not work on other distributions, and additional steps may be needed:
./bootstrap
- Configure the compiling environment:
./configure
- Compile Spine:
make
- Once the
make
command finishes, install Spine:
make install
- Now change the owner of the spine binary to root and set the sticky bit so you can use ICMP pings:
chown root:root /usr/local/spine/bin/spinechmod +s /usr/local/spine/bin/spine
- You now have Spine installed, but it needs to be configured. Therefore, copy the sample configuration file to a location where Spine will find it:
cp /usr/local/spine/etc/spine.conf.dist /etc/spine.conf
- Edit the file in
vi
:
vi /etc/spine.conf
- Change the database configuration to match the settings from earlier:
- Create a symbolic link in
/sbin
to thespine
binary:
ln -s /usr/local/spine/bin/spine /sbin/spine
You just set up a basic development environment for compiling Spine, compiled it, and then installed it. You also configured Spine to use the correct database information.
Note
Compiling Spine on other Linux distributions:
When compiling Spine on other Linux distributions, such as Ubuntu, you will have to go through some additional steps. For more information, refer to http://docs.cacti.net/manual:100:1_installation.1_install_unix.6_install_and_configure_spine.
The main difference between installing Cacti from source and using apt
/yum
-based installations is the location of the configuration files and availability of patches. Cacti, by default, does not follow the Filesystem Hierarchy Standard (FHS) defined for Linux operating systems. The FHS defines directories where applications should add their configuration or log files. The apt
/yum
-based installations usually follow this standard. Due to this, add-ons such as the plugin architecture may not be available on all platforms using apt
/yum
.
The main advantage of using apt
/yum
based installations is the ease of installation, but as we've just seen, installing Cacti isn't very difficult.
However, the disadvantage of using apt
or yum
is the availability of newer Cacti versions. Source-based Cacti installations can be upgraded to the latest version as soon as they are available on the Cacti website, while apt
/yum
-based installs might need to wait until the package maintainers update their repositories.
Here is a little challenge for you. It's not difficult, but it will allow you to alter the installation to suit your needs. What if you want to use a remote database server? Maybe you want to use an existing, dedicated MySQL server instead of hosting the database on the same system as Cacti, or you want to separate the roles to allow more growth. Can you figure out what to change?
Solution: Create the MySQL database on the remote system using the same command as if installed locally but this time use the -h <hostname>
option to specify the remote server. When creating the user and granting it permissions, use the following command, assuming the Cacti server has the IP, 192.168.0.10
:
GRANT ALL ON cacti.* TO cactiuser@'192.168.0.10' IDENTIFIED BY 'MyV3ryStr0ngPassword';
flush privileges;
exit
This will allow the Cacti user access to the database from the Cacti server. Now change $database_hostname
in config.php
and DB_Host
in spine.conf
on the Cacti server to point to your remote database server. On the database server, you will also have to allow traffic to the 3306 database port using the following firewall commands:
firewall-cmd --permanent --zone=public --add-port=3306/tcpfirewall-cmd --reload
The installation of Cacti on a Windows system is quite different from Linux. Most of the prerequisites that are already available on a Linux platform need to be installed on a Windows system. The MySQL database is an example of such a prerequisite. Here you can find more information about the Windows installation and how you can overcome most of the manual installation procedures by making use of the community-built Windows installer.
Instead of installing every prerequisite by hand, the community-built Windows installer provides a convenient way of installing them together with Cacti. It was built by a long-term Cacti user and forum member BSOD2600. The installer contains all the software and is also compatible with running Cacti on an IIS web server.
Note
For Cacti 1.x, there will not always be an up-to-date Windows installer available. Nevertheless, the main goal of the installer is to provide you with a convenient way of installing all required software with a single installer. Afterwards, you can download the latest Cacti version from the Cacti website and manually update.
Let's have a closer look at installing Cacti on a Windows system:
- Download the Windows installer to the system on which you want to install Cacti. To retrieve the latest version, go to http://forums.cacti.net/viewtopic.php?t=14946 and click the download link at the end of the first post. Save the installer to your desktop.
- Double-click on the setup file. The installer will check what has already been installed and give you a report. Click
Next >
after you have read the information:
- The next screen shows the GPL license. Accept it and click
Next >
:
- Then you must select a web server. If you have IIS installed you can select it here, otherwise Apache will be installed:
- In the next step you can choose the components to install. Select all available options. The
Plugins
section is empty as most plugins have been added to Cacti 1.x. Now clickNext >
:
- Keep the defaults for the installation locations and click
Next >
:
- The final step provides an overview of the paths to be created. Click
Install
to start the installation process:
- Please note the default Cacti admin and MySQL root passwords.
- Open the Post-Install instructions and follow the tasks.
Unlike Linux, where compilation from source is the preferred method, the community-based installer already comes with pre-compiled binaries for Windows. This greatly eases the installation part of Cacti on a Windows system, so you can concentrate on the actual configuration of Cacti.
Upgrading Cacti involves several steps, one of which is backing up the database. Since you created a symbolic link to the Cacti directory, you don't need to backup any files but instead we copy or move them from the old version over to the new one.
- Create a backup of the database. The following command will back up the Cacti database to a file called
cacti_backup.sql
. You will be asked for the MySQL root password:
mysqldump -u root -p --lock-tables --add-drop-table cacti > /root/cacti_backup.sql
- Change to the
/var/www/html
directory. From http://www.cacti.net, download the source for the version you want to upgrade to. - Create the
CACTIVERSION
variable and set it to the current Cacti version:
export NEWCACTIVERSION=1.1.28
- Extract the file. This will create a new directory named
cacti-1.1.28
:
cd /var/www/htmlwget https://www.cacti.net/downloads/spine/cacti- spine-$NEWCACTIVERSION.tar.gz tar -xzvf cacti-spine-$NEWCACTIVERSION.tar.gz
- Change to the newly-created directory and edit
include/config.php
. Change the database entries in there to match your installation. - Before copying any files, you should stop the poller using the web interface. Go to
Configuration
|Settings
and change to thePoller
tab. Disable the poller by unchecking it:
- Copy some files from your existing installation to the new one:
cp /var/www/html/cacti/rra/* /var/www/html/cacti-$NEWCACTIVERSION/rra/
cp -u /var/www/html/cacti/scripts/* /var/www/html/cacti-$NEWCACTIVERSION/scripts/
cp -u -R /var/www/html/cacti/resource/* /var/www/html/cacti-$NEWCACTIVERSION /resource/
- Set the permissions on the
log
andrra
folders:
cd /var/www/html/cacti-$NEWCACTIVERSION/
chown -R cactiuser.apache /var/www/html/cacti-$NEWCACTIVERSION/
chmod -R 775 rra/ log/ resource/ scripts/ cache/
setfacl -d -m group:apache:rw /var/www/html/cacti/rra
setfacl -d -m group:apache:rw /var/www/html/cacti/log
- Change the symbolic link to point to the new directory:
cd /var/www/html/
ln -fs cacti-$NEWCACTIVERSION cacti
- As Cacti 1.x requires the
timezone
data to be present in the MySQL/MariaDB database, you will have to import it here as well when upgrading from the 0.8.8 version of Cacti:
mysql_tzinfo_to_sql /usr/share/zoneinfo > /tmp/mysql_timezone.sql
mysql -u root -p mysql < /tmp/mysql_timezone.sql
- You will also have to grant access to the
timezone
tables using the following SQL statement:
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost IDENTIFIED BY 'MyV3ryStr0ngPassword';
- The final upgrade process is done using the web interface. Point your browser to
http://<yourserver>/cacti/install
and follow the steps. Make sure you selectUpgrade
on the second page. - If you are upgrading from 0.8.8 to 1.x, the upgrade process will take some time to complete depending on your Cacti installation size.
- You can now enable the poller again using the Cacti web interface.
- Once you have checked that everything is working fine, you can remove or archive the original Cacti directory.
You upgraded Cacti to a newer version. As a safety net, you created a backup of the database so you can revert back to the old version in case of an error. You copied the RRD files and other resources to the new installation and switched over by changing the symbolic link to point to the new location. You finished the upgrade process by going to the install URL, which provides the final web-based upgrade process.
After the installation of the database and files, there are still several additional configuration tasks left. For these tasks, you are going to use the web interface provided by Cacti to guide you through the final part of the setup. The following steps are almost identical for Windows and Linux.
- Go to the installation URL:
http://<yourserver>/cacti/install
. Read the license agreement and clickNext
:
- The next page provides an overview of the different installed modules and database parameters. As you have installed all prerequisites and configured the database server according to these recommendations, you can
Accept the GPL License Agreemen
t
and clickNex
t
here.
- The next page asks if you are installing a new system, a new remote poller, or upgrading an existing one. Choose
New Primary Server
then clickNext
:
- The next page provides an overview of all required binaries and paths. If you have followed the installation steps closely, all fields should be green. Make sure to set the theme to
Classic
:
- The following page will check for the correct files and folder permissions. If you have followed the installation guide, everything shows up green here. Click on
Next
to continue the installation:
- The final step allows you to import some pre-defined templates. Select all of the templates and click
Finish
to complete the installation:
You finalized your Cacti installation by running the included web-based installer. If you have been following the instructions, you will have a working Cacti installation.
The installation will leave you with the default cmd.php
poller. If you want to use Spine, you will now have to log on to the Cacti web interface and set the Spine poller file path in the Paths
section of the Settings
page. You also have to change the poller type to Spine in the Poller
section.
The first time you log in, use the username admin
and password admin
(for Linux). You will be forced to change the admin password, but after doing so you will be presented with the Cacti web interface:
The initial page is called the Console
and only administrators and users with special access rights are able to see it. From here you can fully administer Cacti.
The Console
tab is where you manage your Cacti installation. From here you can add devices and users or create graphs and assign them to a tree. We're going to explain each of the menu sections here:
The Create
section provides an easy access for new graph creations for specific devices. It's a shortcut to the create graphs link within each device.
The Management
section, as its name says, allows the management of graphs, devices, data sources, graph trees, and the new Sites items as well as aggregate graphs. Sites is a new feature of Cacti and allows you to assign devices to a site. As with the old Cacti versions, within this section you can still add/edit or delete devices, delete graphs, add devices to trees, and much more.
The Data Collection
section describes the different ways that Cacti retrieves data from devices or systems. Here you can manage data queries such as SNMP retrieve methods, or manage the different input methods, which are used by external scripts called from the poller. With version 1.x, the new Data Collectors item has been added. Cacti 1.x allows you to have multiple remote pollers, and in this section you can add and manage these pollers. More to come in a later chapter.
The Templates
section provides an easy way of combining data templates into a graph (graph templates), graphs and data queries for a specific type of host (host templates), or different data source items (data templates). Many graph, data, and host templates are available on the Cacti forums.
The Automation
section is new in Cacti 1.x. It allows you to plan for automated network discovery as well as define rules for the automation of device and graph creation for auto-discovered devices. This section is based on the Discovery and Autom8 plugin which was already available for the 0.8.8 version of Cacti and has now been integrated into the main Cacti distribution.
The Presets
section allows you to configure the new VDEF rules as well as the old CDEF and GPRINT settings. The Data Profiles
item is a new concept in Cacti 1.x. It defines the poller interval being used for the different data templates. This is where you will start the creation of a new one minute-based polling interval.
The Import/Export section allows the import and export of templates. This is especially useful for providing templates of exotic devices to the Cacti community, or to import them from one of the many provided on the Cacti forum.
Cacti doesn't yet provide a method for importing or exporting other data (for example, device lists) from within the web interface.
Within the Configuration
section we can change the settings of Cacti. These settings include:
- General settings (for example, logging levels)
- Path settings (similar to the paths page from the installer)
- Device default settings (SNMP version, timeouts)
- Poller settings (number of threads, poller type to use)
- Data storage settings (set remote or local RRD file storage)
- Visual settings (size of the graphs, font size to use, theme to use)
- Authentication settings (local authentication, LDAP or HTTP basic, password settings)
- Data source statistics settings (enable/disable data source statistics collection)
- Performance settings (enable/disable on-demand RRD file updates and image caching)
- Spikes settings (enable/disable automated spike data removal)
- Mail/reporting/DNS settings (set email options, configure nectar/reporting and DNS settings)
The graphs
tab is the main screen for end users. Here they can view the graphs for their devices and systems, and also change some personal settings:
The graph
tab contains a hierarchical tree to the left containing all devices a user is allowed to view. The main part of the page contains the graphs, and a filtering system for customizing the timeframe and graphs displayed based on a number of methods.
The nectar
tab provides you with some basic reporting functionality for Cacti. It is based on the Nectar plugin and has been integrated into Cacti 1.x:
You now have a rough overview of the Cacti web interface and how it interacts with the database. You're going to dive a bit deeper into the details in the next few chapters, so it is not important at this stage to know where everything is or how it works in detail.
- If you are using a remote database server, which configuration files do you need to change?
a) The config.php
file and spine.conf
b) The global.php
file and config.php
- Which section on the
Console
tab allows you to change the path to the Cacti log file?
a) The System Utilities
section
b) The Path
tab within the Configuration Section
c) The General
tab within the Configuration Section
- On a CentOS 7 system, how can you configure the MySQL server to start automatically during system startup?
a) You can use the enableservice
command
b) The setstartup
command allows you to do so
c) The systemctl
command will do this
In this chapter, you have learned a lot of new information. You have learned how to download and install Cacti and how to set up the directory structure and permissions. You have covered how to create a database and fill it with the base Cacti data and time zone information, and learned how to configure Cacti to find its database. There have been topics about creating the Cacti system user and setting up the poller's cron entry for doing the actual monitoring work. You have also covered the installation of the Spine poller and looked into the process of upgrading an existing Cacti installation. Finally, you had a brief look at the different sections and parts of the web interface.
You're now ready to create your first few devices and graphs in the next chapter. So let's move on then!