国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
Step 1: Install Apache Web Server
Step 2: Install MariaDB Database Server
Step 3: Install PHP and PHP Extensions
Step 4: Install SNMP and RRD Tool
Step 5: Create a Cacti Database
Step 6: Installing and Configuring the Cacti Monitoring Tool
Step 8: Running Cacti Installer via the Browser
Home System Tutorial LINUX How to Install Cacti on Rocky Linux and AlmaLinux

How to Install Cacti on Rocky Linux and AlmaLinux

Jul 08, 2025 am 09:46 AM

Cacti is an open-source web-based network monitoring and graphing tool written in PHP. It was designed as a front-end application for data logging using RRDtool. Cacti uses the SNMP protocol to monitor devices such as routers, servers, and switches.

It displays information such as network bandwidth utilization and CPU load in a graph format. It’s essential in monitoring and ensuring IT infrastructure is functioning as desired.

[ You might also like: 16 Useful Bandwidth Monitoring Tools to Analyze Network Usage in Linux ]

In this guide, you will learn how to install the Cacti monitoring tool on Rocky Linux and AlmaLinux.

Step 1: Install Apache Web Server

Cacti is a web-based tool, so we must set up a web server on which Cacti will run. Run the following command to install an Apache webserver:

$ sudo dnf install httpd -y

Next, start and enable the webserver with the commands:

$ sudo systemctl start httpd
$ sudo systemctl enable --now httpd

Step 2: Install MariaDB Database Server

Cacti require its own database to store the data it collects. We will install and use Mariadb as our database server.

$ sudo dnf install -y mariadb-server mariadb

Next, start and enable mariadb to start on boot as shown:

$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb

Step 3: Install PHP and PHP Extensions

Cacti is written in PHP, and therefore, we need to install PHP and the required PHP dependencies. First, add the Remi repository:

$ sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpmmi 

Then, enable the DNF module for PHP installation.

$ sudo dnf module reset php
$ sudo dnf module enable php:remi-7.4

After that, install PHP and required extensions with the commands below:

$ sudo dnf install @php
$ sudo dnf install -y php php-{mysqlnd,curl,gd,intl,pear,recode,ldap,xmlrpc,snmp,mbstring,gettext,gmp,json,xml,common}

Enable the php-fpm service by executing the command:

$ sudo systemctl enable --now php-fpm

Step 4: Install SNMP and RRD Tool

Now we will install SNMP and RRDtool, which are required for gathering and analyzing system metrics.

$ sudo dnf install -y net-snmp net-snmp-utils net-snmp-libs rrdtool

Start and enable snmpd with the commands:

$ sudo systemctl start snmpd
$ sudo systemctl enable snmpd

Step 5: Create a Cacti Database

We now need to create a database and user for cacti and grant all the necessary privileges to the cacti user.

$ mysql -u root -p

<strong>MariaDB [(none)]></strong> CREATE DATABASE cactidb;
<strong>MariaDB [(none)]></strong> GRANT ALL ON cactidb.* TO cacti_user@localhost IDENTIFIED  BY 'passwd123';
<strong>MariaDB [(none)]></strong> FLUSH PRIVILEGES;
<strong>MariaDB [(none)]></strong> EXIT;

How to Install Cacti on Rocky Linux and AlmaLinux

Then, import the mysql test data timezone.sql file into the mysql database.

$ mysql -u root -p mysql 
<p>Then, connect to the mysql database and provide the cacti user access to the <strong>mysql.time</strong> zone name table.</p>
<pre class="brush:php;toolbar:false"><strong>MariaDB [(none)]></strong> GRANT SELECT ON mysql.time_zone_name TO cacti_user@localhost;
<strong>MariaDB [(none)]></strong> FLUSH PRIVILEGES;
<strong>MariaDB [(none)]></strong> EXIT;

How to Install Cacti on Rocky Linux and AlmaLinux

For optimal performance, you need to add the following configuration in the mariadb-server.cnf file under the [ mysqld ] section as shown.

$ sudo vi /etc/my.cnf.d/mariadb-server.cnf

Paste the following configuration.

collation-server=utf8mb4_unicode_ci
character-set-server=utf8mb4
max_heap_table_size=32M
tmp_table_size=32M
join_buffer_size=64M
# 25% Of Total System Memory
innodb_buffer_pool_size=1GB
# pool_size/128 for less than 1GB of memory
innodb_buffer_pool_instances=10
innodb_flush_log_at_timeout=3
innodb_read_io_threads=32
innodb_write_io_threads=16
innodb_io_capacity=5000
innodb_file_format=Barracuda
innodb_large_prefix=1
innodb_io_capacity_max=10000

Save the changes and exit.

Step 6: Installing and Configuring the Cacti Monitoring Tool

The Cacti package is available in the EPEL (Extra Packages for Enterprise Linux) repository.

$ sudo dnf install epel-release -y

Next, we install the Cacti monitoring tool as shown:

$ sudo dnf install cacti -y

Next, verify the installation of cacti as shown:

$ rpm -qi cacti

How to Install Cacti on Rocky Linux and AlmaLinux

Then, import the default cacti database tables into the mariadb cacti database you created above. But before that, run the following command to determine the path of the default cacti database:

$ rpm -ql cacti | grep cacti.sql

How to Install Cacti on Rocky Linux and AlmaLinux

Next, use the following command to import the default database tables:

$ mysql -u root -p cactidb 
<p>Next, modify the cacti configuration file to include the following database details:</p>
<pre class="brush:php;toolbar:false">$ sudo vim /usr/share/cacti/include/config.php

How to Install Cacti on Rocky Linux and AlmaLinux

Modify the database name, username, and password to reflect the one you created earlier.

Next, set the timezone in the php.ini file. Additionally, modify the below parameters to reflect as shown:

date.timezone = Africa/Nairobi
memory_limit = 512M
max_execution_style = 60

Then, set up cron for Cacti by editing the /etc/cron.d/cacti file as shown:

$ sudo vim /etc/cron.d/cacti

Uncomment the following line to have a Cacti poll for data every 5 minutes.

*/5 * * * *   apache /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Save and exit the configuration file.

Then modify Apache’s configuration file to enable remote access to Cacti.

$ sudo vim /etc/httpd/conf.d/cacti.conf

Change the following lines in the file:

How to Install Cacti on Rocky Linux and AlmaLinux

  • Modify Require host localhost to Require all granted.
  • Change Allow from localhost to Allow from [network subnet].
  • Specify your own network subnet. For our case, the subnet is 192.168.122.1/24.

Restart apache and php-fpm services for the changes to take effect.

$ sudo systemctl restart httpd
$ sudo systemctl restart php-fpm

Before finally setting up Cacti, allow HTTP service on your firewall as shown:

$ sudo firewall-cmd --permanent --add-service=http
$ sudo firewall-cmd --reload

Step 8: Running Cacti Installer via the Browser

To complete the set up of Cacti, visit your server’s IP as shown:

http://server-ip/cacti

The login page shown below will appear. Log in with the default credentials shown:

Username: admin
Password: admin

Click ‘Login‘ to proceed.

How to Install Cacti on Rocky Linux and AlmaLinux

You will be asked to set the default cacti admin login password.

How to Install Cacti on Rocky Linux and AlmaLinux

Next, Accept the GPL license agreement and click on ‘Begin‘.

How to Install Cacti on Rocky Linux and AlmaLinux

Cacti will run pre-installation tests to ensure that the necessary PHP modules are installed and the relevant database settings are set up. If everything is configured correctly, you can proceed with the installation. Click Next to proceed.

How to Install Cacti on Rocky Linux and AlmaLinux

After that, choose the ‘New Primary Server‘ as the type of installation and verify that the database connection parameters are right.

How to Install Cacti on Rocky Linux and AlmaLinux

The following step checks for directory issues and confirms that the proper permissions are in place. If everything is in order, click ‘Next‘; otherwise, click ‘Previous‘ and correct any problems.

How to Install Cacti on Rocky Linux and AlmaLinux

The installer then checks to see if all of the binary paths for the required packages are installed.

How to Install Cacti on Rocky Linux and AlmaLinux

Next, we validate data input methods. This gives you a few actions to take after installing Cacti in order to whitelist data input methods. Check the ‘I have read this statement‘ box after reading the instructions.

How to Install Cacti on Rocky Linux and AlmaLinux

Thereafter, choose the cron interval and input your network subnet as shown. Then click ‘Next‘.

How to Install Cacti on Rocky Linux and AlmaLinux

Cacti come with templates that let you monitor and graph a variety of network devices, including Linux and Windows computers. All options have been checked to ensure that you get all of the templates you need. If you’re satisfied, click ‘Next‘.

How to Install Cacti on Rocky Linux and AlmaLinux

Following that, the installer will verify to see if the database/server collation is UTF8 compliant. Click the ‘Next‘ button.

How to Install Cacti on Rocky Linux and AlmaLinux

To start the installation process, click on the ‘Confirm Installation‘ checkbox and then click on the ‘Install‘ button.

How to Install Cacti on Rocky Linux and AlmaLinux

Once the necessary packages have been installed, click the ‘Get Started‘ button.

How to Install Cacti on Rocky Linux and AlmaLinux

Now the Cacti dashboard will be displayed as shown:

How to Install Cacti on Rocky Linux and AlmaLinux

By default, cacti create resource utilization graphs for your local machine on which Cacti is installed. To view the graphs, navigate through – Graph –> Default Tree –> Local –> Choose Your Device.

How to Install Cacti on Rocky Linux and AlmaLinux

That’s how you install Cacti on Rocky Linux and AlmaLinux.

The above is the detailed content of How to Install Cacti on Rocky Linux and AlmaLinux. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276
How to troubleshoot DNS issues on a Linux machine? How to troubleshoot DNS issues on a Linux machine? Jul 07, 2025 am 12:35 AM

When encountering DNS problems, first check the /etc/resolv.conf file to see if the correct nameserver is configured; secondly, you can manually add public DNS such as 8.8.8.8 for testing; then use nslookup and dig commands to verify whether DNS resolution is normal. If these tools are not installed, you can first install the dnsutils or bind-utils package; then check the systemd-resolved service status and configuration file /etc/systemd/resolved.conf, and set DNS and FallbackDNS as needed and restart the service; finally check the network interface status and firewall rules, confirm that port 53 is not

Install Guacamole for Remote Linux/Windows Access in Ubuntu Install Guacamole for Remote Linux/Windows Access in Ubuntu Jul 08, 2025 am 09:58 AM

As a system administrator, you may find yourself (today or in the future) working in an environment where Windows and Linux coexist. It is no secret that some big companies prefer (or have to) run some of their production services in Windows boxes an

How to Install NodeJS 14 / 16 & NPM on Rocky Linux 8 How to Install NodeJS 14 / 16 & NPM on Rocky Linux 8 Jul 13, 2025 am 09:09 AM

Built on Chrome’s V8 engine, Node.JS is an open-source, event-driven JavaScript runtime environment crafted for building scalable applications and backend APIs. NodeJS is known for being lightweight and efficient due to its non-blocking I/O model and

How to find my private and public IP address in Linux? How to find my private and public IP address in Linux? Jul 09, 2025 am 12:37 AM

In Linux systems, 1. Use ipa or hostname-I command to view private IP; 2. Use curlifconfig.me or curlipinfo.io/ip to obtain public IP; 3. The desktop version can view private IP through system settings, and the browser can access specific websites to view public IP; 4. Common commands can be set as aliases for quick call. These methods are simple and practical, suitable for IP viewing needs in different scenarios.

System requirements to install linux System requirements to install linux Jul 20, 2025 am 03:49 AM

Linuxcanrunonmodesthardwarewithspecificminimumrequirements.A1GHzprocessor(x86orx86_64)isneeded,withadual-coreCPUrecommended.RAMshouldbeatleast512MBforcommand-lineuseor2GBfordesktopenvironments.Diskspacerequiresaminimumof5–10GB,though25GBisbetterforad

How to Install MySQL 8.0 on Rocky Linux and AlmaLinux How to Install MySQL 8.0 on Rocky Linux and AlmaLinux Jul 12, 2025 am 09:21 AM

Written in C, MySQL is an open-source, cross-platform, and one of the most widely used Relational Database Management Systems (RDMS). It’s an integral part of the LAMP stack and is a popular database management system in web hosting, data analytics,

Ubuntu 25.04 'Plucky Puffin”: A Bold Leap Forward with GNOME 48 and HDR Brilliance Ubuntu 25.04 'Plucky Puffin”: A Bold Leap Forward with GNOME 48 and HDR Brilliance Jul 12, 2025 am 09:28 AM

Ubuntu has long stood as a bastion of accessibility, polish, and power in the Linux ecosystem. With the arrival of Ubuntu 25.04, codenamed “Plucky Puffin”, Canonical has once again demonstrated its commitment to delivering a

How to Install MongoDB on Rocky Linux and AlmaLinux How to Install MongoDB on Rocky Linux and AlmaLinux Jul 12, 2025 am 09:29 AM

MongoDB is a high-performance, highly scalable document-oriented NoSQL database built to manage heavy traffic and vast amounts of data. Unlike traditional SQL databases that store data in rows and columns within tables, MongoDB structures data in a J

See all articles