Monitoring your infrastructure is crucial for maintaining the performance and availability of your network, system, and applications. Centreon is an open-source tool that offers comprehensive monitoring capabilities, allowing you to set notifications, receive email alerts, and easily add systems for monitoring. In this tutorial, we will guide you through the process of installing Centreon on Rocky Linux 8, ensuring that you have a robust monitoring solution in place.
Prerequisites
Before we begin the installation process, there are a few prerequisites that you need to fulfill:
- A server running Rocky Linux 8.
- A root password configured on the server.
Step 1: Update OS
To ensure that you have the latest versions of the required packages, it is essential to update your system. Open the terminal and enter the following command:
sudo dnf update -y
This command will update all the packages on your system to their latest versions.
Step 2: Disable SELinux
SELinux is a security feature that can sometimes interfere with the smooth functioning of Centreon. To avoid any potential issues, it is recommended to disable SELinux. Check the status of SELinux by running the following command:
getenforce
If SELinux is enabled, you will need to disable it. Open the SELinux configuration file using the following command:
sudo vim /etc/selinux/config
Inside the file, find the line that says SELINUX=enforcing
and change it to SELINUX=disabled
. Save the file and reboot your system for the changes to take effect.
Step 3: Install PHP
Centreon relies on PHP for its web interface and other functionalities. To install PHP, we first need to enable the EPEL and PowerTools repositories. Run the following commands in the terminal:
sudo dnf -y install dnf-plugins-core epel-release sudo dnf config-manager --set-enabled powertools
Once the repositories are enabled, install the Remi repository by executing the following commands:
sudo dnf module reset -y php sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm sudo dnf module install php:remi-8.0
Next, install PHP and its required extensions by running the following command:
sudo dnf -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-opcache
To verify the installation and check the PHP version, use the following command:
php --version
To configure the timezone for PHP, open the PHP timezone configuration file:
sudo vim /etc/php.d/php-timezone.ini
Inside the file, set your desired timezone using the date.timezone
directive. Save the file and exit.
Increase the PHP script execution timeout by editing the max_execution_time
and max_input_time
values in the php.ini
file:
sudo vim /etc/php.ini
Set the values to 300
as follows:
max_execution_time = 300 max_input_time = 300
Save the file and restart the PHP-FPM service:
sudo systemctl enable php-fpm sudo systemctl restart php-fpm
Step 4: Install MariaDB Database Server
Centreon requires a database server to store its configuration and monitoring data. We will install MariaDB, a popular open-source database server. Execute the following command to install MariaDB:
sudo dnf install mariadb-server -y
Start the MariaDB service and enable it to start at boot time:
sudo systemctl start mariadb sudo systemctl enable mariadb
Next, secure the MariaDB installation by running the following command:
sudo mysql_secure_installation
This command will guide you through a series of prompts to set a root password, remove anonymous users, disallow remote root login, and remove the test database. Follow the prompts and answer accordingly to secure your database server.
After securing the database server, you can test the MySQL connection by executing the following command:
mysql -u root -p
To create a remote user with root privileges for Centreon installation, log in to MySQL using the root user:
mysql -u root -p
Execute the following commands to create a new user and grant the necessary privileges:
CREATE USER 'shapehost'@'188.166.52.228' IDENTIFIED BY '123'; GRANT ALL PRIVILEGES ON*.* TO 'shapehost'@'188.166.52.228' WITH GRANT OPTION; FLUSH PRIVILEGES; exit
Replace the IP address 188.166.52.228
with the appropriate IP address.
Step 5: Install Centreon Packages
To install Centreon, we need to add the Centreon repository. Run the following command to add the repository:
sudo dnf install https://yum.centreon.com/standard/21.10/el8/stable/noarch/RPMS/centreon-release-21.10-2.el8.noarch.rpm
Once the repository is added, install the Centreon packages by executing the following command:
sudo dnf install centreon centreon-database -y
The centreon-database
package will configure MariaDB with optimized settings for Centreon. You can view the configuration file by running the following command:
cat /etc/systemd/system/mariadb.service.d/centreon.conf
To reload the daemon and restart the MariaDB service, use the following commands:
sudo systemctl daemon-reload
sudo systemctl restart mariadb
Finally, enable the required services to start at boot time:
sudo systemctl enable mariadb
sudo systemctl enable php-fpm
sudo systemctl enable httpd
sudo systemctl enable centreon
sudo systemctl enable cbd
sudo systemctl enable centengine
sudo systemctl enable gorgoned
sudo systemctl enable snmptrapd
sudo systemctl enable centreontrapd
sudo systemctl enable snmpd
Step 6: Centreon Web Installation
Before we proceed with the Centreon Web installation, ensure that all the required services are running. Start the services by executing the following commands:
sudo systemctl start mariadb
sudo systemctl start php-fpm
sudo systemctl start httpd
sudo systemctl start centreon
sudo systemctl start cbd
sudo systemctl start centengine
sudo systemctl start gorgoned
sudo systemctl start snmptrapd
sudo systemctl start centreontrapd
sudo systemctl start snmpd
To access the Centreon Web interface, open a web browser and enter the following URL:
http://<IP>/centreon
Replace <IP>
with the IP address or hostname of your server.
You will be greeted with the Centreon Setup screen. Follow the instructions provided in the setup wizard to configure Centreon. The steps include:
- Enter monitoring engine information.
- Configure the Centreon Broker module.
- Provide admin information.
- Set the root password (use the password you set during the MySQL secure installation).
- Install the database and generate the cache.
After completing the setup, click on the “Finished” button. You can now log in to the Centreon Web interface using the admin username and password you set during the installation process.
Congratulations! You have successfully installed Centreon Monitoring Tool on Rocky Linux. You can now explore Centreon and start monitoring your server infrastructure.
Conclusion
Installing Centreon on Rocky Linux 8 is a straightforward process that provides you with a powerful monitoring solution for your infrastructure. Centreon’s extensive range of features and compatibility with third-party solutions make it an ideal choice for monitoring network, system, and application components. By following the steps outlined in this tutorial, you can ensure that your server environment is monitored efficiently and effectively.
For more information about Shape.host services, including Linux SSD VPS, visit Shape.host.