How To Install Cacti On Linux
Cacti is a gratis and open-source network monitoring and graphic tool written in PHP. It is designed as the front-cease awarding for the Round-Robin database tool (RRDtool). It is used to get CPU load and network bandwidth utilization in a graph format.
In general, Cacti is used to get network bandwidth utilization and monitor the network traffic of a router or switch past polling over the SNMP protocol.
Hither, we will meet how to install Cacti on Ubuntu 20.04.
Install Cacti On Ubuntu xx.04
Cacti run on elevation of Apache, MySQL/MariaDB, and PHP. And then, nosotros will install them one by 1.
Prerequisites
Update the repository index using the apt control.
sudo apt update Install Apache & PHP
First, install the Apache webserver.
sudo apt install -y apache2 php-mysql libapache2-modernistic-php Install PHP Extensions
Additionally, install a few PHP modules for the proper performance of Cacti.
sudo apt install -y sphp-xml php-ldap php-mbstring php-gd php-gmp Install MariaDB
Install the MariaDB (v10.three) from the Ubuntu repository.
READ: How To Install MariaDB v10.04 On Ubuntu 20.04
You can also [install MySQL 8.0 on Ubuntu 20.04](https://www.itzgeek.com/post/how-to-install-mysql-eight-0-on-ubuntu-20-04/) and use it as a database server for the Cacti installation.
sudo apt install -y mariadb-server mariadb-client After the MariaDB installation, run the mysql_secure_installation command to secure the MariaDB instance.
Install SNMP
Also, install the SNMP and RRDtool to monitor the devices.
sudo apt install -y snmp php-snmp rrdtool librrds-perl Database Tuning
Cacti recommend changing the MariaDB server settings for better performance. So, edit the configuration file.
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf Add together/Update the below settings in the [mysqld] section of the file.
collation-server = utf8mb4_unicode_ci max_heap_table_size = 128M tmp_table_size = 64M join_buffer_size = 64M innodb_file_format = Barracuda innodb_large_prefix = ane innodb_buffer_pool_size = 512M innodb_flush_log_at_timeout = 3 innodb_read_io_threads = 32 innodb_write_io_threads = sixteen innodb_io_capacity = 5000 innodb_io_capacity_max = 10000 Restart the MariaDB service mail the configuration change.
sudo systemctl restart mariadb PHP Configuration
Nosotros need to set the timezone, memory limit, and execution time in the PHP configuration file for the Cacti installation. And so, edit the php.ini file depending on your PHP version.
sudo nano /etc/php/7.4/apache2/php.ini AND
sudo nano /etc/php/vii.iv/cli/php.ini Update your timezone, as shown below.
date.timezone = US/Central memory_limit = 512M max_execution_time = 60 Create Database
Log in to the database server.
You can log in to the MariaDB server without entering MySQL root countersign by running sudo mysql -u root -p or mysql -u root -p command equally root in Ubuntu 20.04.
sudo mysql -u root -p Now, create a database for the Cacti installation.
create database cacti; Create a database user and grant permission to the newly created database.
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipassword'; affluent privileges; exit The newly created user (cactiuser) should take admission to the mysql.time_zone_name table. So, we will import the mysql_test_data_timezone.sql to mysql database first.
sudo mysql -u root -p mysql < /usr/share/mysql/mysql_test_data_timezone.sql And so, log in to MySQL.
sudo mysql -u root -p Grant the permission to cactiuser.
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost; affluent privileges; go out Download & Configure Cacti
Download the latest version of the Cacti using the wget command.
wget https://www.cacti.net/downloads/cacti-latest.tar.gz Extract the Cacti archive using the tar command and move the extracted files to /opt directory.
tar -zxvf cacti-latest.tar.gz sudo mv cacti-i* /opt/cacti Import the default Cacti database data to the newly created cacti database.
sudo mysql -u root -p cacti < /opt/cacti/cacti.sql Edit the Cacti configuration file to specify the database type, database name, hostname, user, and password information.
sudo nano /opt/cacti/include/config.php Make the changes accordingly.
/* brand certain these values reverberate your actual database/host/user/password */ $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cactipassword"; $database_port = "3306"; $database_ssl = false;
Create a crontab file to schedule the polling job.
sudo nano /etc/cron.d/cacti Add together the post-obit scheduler entry in the crontab so that Cacti can poll every five minutes.
*/5 * * * * world wide web-information php /opt/cacti/poller.php > /dev/aught 2>&ane Create a new site for the Cacti tool.
sudo nano /etc/apache2/sites-available/cacti.conf Apply the following configuration.
Allonym /cacti /opt/cacti <Directory /opt/cacti> Options +FollowSymLinks AllowOverride None <IfVersion >= 2.iii> Require all granted </IfVersion> <IfVersion < 2.3> Order Allow,Deny Allow from all </IfVersion> AddType awarding/10-httpd-php .php <IfModule mod_php.c> php_flag magic_quotes_gpc Off php_flag short_open_tag On php_flag register_globals Off php_flag register_argc_argv On php_flag track_vars On # this setting is necessary for some locales php_value mbstring.func_overload 0 php_value include_path . </IfModule> DirectoryIndex alphabetize.php </Directory> Enable the created site.
sudo a2ensite cacti Restart Apache services.
sudo systemctl restart apache2 Create a log file for Cacti and permit the Apache user (www-data) to write a data on to Cacti directory.
sudo touch /opt/cacti/log/cacti.log sudo chown -R world wide web-data:world wide web-data /opt/cacti/ Setup Cacti
Visit the below URL to begin the installation of Cacti.
http://your.ip.add.ress/cacti
Login to Cacti installation wizard to set up Cacti installation.
Username: admin
Password: admin
You must change the password of the Cacti admin user earlier yous begin to set up Cacti.
Read and Accept the Cacti license agreement and click on Begin to continue.
Cacti perform pre-installation checks and report issues on this page. You lot need to fix the problems before you go to the next stride. Sometimes, yous can ignore warnings.
Select New Primary Server equally an installation blazon for our installation and validate the database connection information then click Side by side.
Now, Cacti installation wizard checks for permission problems y'all may have in the Cacti directories.
This page will show you the Cacti binary locations and their versions item.
Take the time to read this statement and visit this link for more information and and so click the Side by side.
Click Next on the default profile page every bit nosotros already gear up up cron to poll every five minutes.
Select the device templates you wish to use and then click Stop to complete the installation of Cacti.
Click Next.
Select Confirm Installation and printing Install to showtime the Cacti installation.
Expect for the Cacti installation to complete.
In a minute or two, the Cacti installation will complete.
Clicking on the Get Started on the above folio volition take you direct to the Cacti dashboard.
Access Cacti Dashboard
Visit the post-obit URL to brainstorm using the Cacti tool.
http://your.ip.add.ress/cacti
Enter User Proper noun and Password to login to Cacti.
Username: admin
Password: <YOUR_PASSWORD>
Cacti Dashboard:
Past default, the local motorcar (your Cacti server) will be added for monitoring in Cacti. You can Go to Graphs » Default Tree » Local Linux Machine to see the usage graph of the Cacti server.
Monitor Remote Linux Machines
READ: How to monitor remote Linux machines with Cacti monitoring tool
Conclusion
That's All. I hope you have learned how to install Cacti on Ubuntu 20.04. Now, yous can check out how to monitor remote Linux machines with the Cacti monitoring tool. Please share your feedback in the comments section.
Source: https://www.itzgeek.com/post/how-to-install-cacti-on-ubuntu-20-04/
Posted by: alvaradogonell.blogspot.com

0 Response to "How To Install Cacti On Linux"
Post a Comment