Zabbix agent install oracle linux

How to Install Zabbix Agent 6 on Rocky Linux/Alma Linux/Oracle Linux 8

A Zabbix agent is a program that runs on a remote machine that needs to be monitored through the Zabbix server. The agent collects the data on the remote server and send back to Zabbix server when requested. Zabbix agent must be installed on all the remote systems that need to be monitor through the Zabbix server.

There are two types of checks:

  • Passive Check – Zabbix Agent sent data to server on their request.
  • Active Check – Zabbix Agent sends data periodically to server.

In this article, we will learn how to install the Zabbix agent in RHEL 8 based distributions like the Rocky Linux or Alma Linux. Checkout this guide on How to Install and Configure Zabbix Server 5 on Rocky Linux/Alma Linux 8.

Table of Content

  1. Ensure that the server is up to date
  2. Install the Zabbix Agent
  3. Configure Zabbix Agent

1. Ensure that the server packages are up to date

Before proceeding, let us make sure that our server packages are up to date with this command:

Let us also install some common packages that we will need

2. Install the Zabbix Agent

The Zabbix agent packages are not available under the default Rocky Linux 8 repositories. We will need to configure the Zabbix repository in our system before installing the agent.

The latest Zabbix version as at the writing of this article is Zabbix version 5.4. Install the Zabbix version 5.4 repository using this command:

sudo dnf install -y https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm

Once the repository is installed, we can install the agent. Use this command:

sudo dnf install -y zabbix-agent

Confirm the software version installed:

$ rpm -qi zabbix-agent Name : zabbix-agent Version : 6.0.0 Release : 1.el8 Architecture: x86_64 Install Date: Wed 23 Feb 2022 02:38:59 PM GMT Group : Applications/Internet Size : 2436931 License : GPLv2+ Signature : RSA/SHA512, Mon 14 Feb 2022 02:59:01 PM GMT, Key ID 082ab56ba14fe591 Source RPM : zabbix-6.0.0-1.el8.src.rpm Build Date : Mon 14 Feb 2022 02:16:21 PM GMT Build Host : fe91fa9aa207 Relocations : (not relocatable) URL : http://www.zabbix.com/ Summary : Old Zabbix Agent Description : Old implementation of zabbix agent. To be installed on monitored systems.

3. Configure Zabbix Agent

Now, you need to configure the Agent service to allow Zabbix server requests. We will also update the Hostname so we know which server we configured the agent on. Edit the Zabbix agent configuration file by adding the Zabbix server IP.

sudo vim /etc/zabbix/zabbix_agentd.conf
Server=10.2.40.98 ServerActive=10.2.40.98 Hostname=dev-oraclelinuxsrv

4. Disable SELinux and Adjust Firewall for Zabbix

If you have firewall installed and enabled, you will need to allow the Zabbix ports 10050 and 10051. and HTTP service through the firewall. You can allow them with the following command:

sudo firewall-cmd --permanent --add-port=10050/tcp sudo firewall-cmd --reload

You will also need to set SELinux to permissive in order to access the frontend from a browser. To do that, run the command:

sudo setenforce 0 sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

5. Start and enable the Zabbix agent

We can now start the agent. The agent is not started by default. Use this command to start:

sudo systemctl start zabbix-agent

Check the status to confirm that it is started.

$ sudo systemctl status zabbix-agent ● zabbix-agent.service - Zabbix Agent Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2022-02-23 14:40:52 GMT; 7s ago Process: 2612512 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS) Main PID: 2612514 (zabbix_agentd) Tasks: 6 (limit: 48867) Memory: 3.8M CGroup: /system.slice/zabbix-agent.service ├─2612514 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf ├─2612515 /usr/sbin/zabbix_agentd: collector [idle 1 sec] ├─2612516 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection] ├─2612517 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection] ├─2612518 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection] └─2612519 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec] Feb 23 14:40:52 oraclesrv.citizix.com systemd[1]: Starting Zabbix Agent. Feb 23 14:40:52 oraclesrv.citizix.com systemd[1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory Feb 23 14:40:52 oraclesrv.citizix.com systemd[1]: Started Zabbix Agent.

From the above output, we can confirm that the agent is running. To enable the agent to start on boot, use this command:

sudo systemctl enable zabbix-agent

That is it! You have successfully installed Zabbix Agent on your Rocky Linux Machine. You can now proceed to add host in zabbix server to be monitored. Checkout this guide on How to Add Host in Zabbix Server to Monitor.

Читайте также:  Linux принтер печатает иероглифы

Источник

Download and install Zabbix

Zabbix Server Installation

Get assistance in better understanding the benefits and potential from using Zabbix

Technical Support

Get access to the team of Zabbix experts that know every little bit of the source code

Training
  • Features
  • What’s new in Zabbix 6.4
  • Screenshots
  • System requirements
  • Lifecycle & Release Policy
  • License
  • Documentation
  • Roadmap
  • By Topic
  • By Industry
  • For Enterprises
  • Case studies
  • Customers and Users
  • Integrations & Templates
  • Support
  • Consulting
  • Turn-Key Solution
  • Template building
  • Upgrade
  • Development
  • Remote troubleshooting
  • Integration
  • Certified User
  • Certified Specialist
  • Certified Professional
  • Certified Expert
  • Testimonials
  • Training FAQ
  • Application form
  • Webinars
  • Partner Program
  • Become a Partner
  • Strategic Partners
  • Distributors
  • Map of Partners
  • Events
  • Forum
  • Blog
  • Bugs and Feature Requests
  • Developers
  • Community templates
  • Newsletters
  • About Us
  • Career
  • Contacts
  • Press Releases
  • Trademark
Join us! We’re hiring!

© 2001-2023 by Zabbix LLC. All rights reserved.

Источник

Install Zabbix 5 LTS With Nginx on Oracle Linux 8

This is a step-by-step guide on how to install and configure Zabbix with Nginx on Oracle Linux 8. Zabbix is a powerful monitoring tool and is 100% free. It is used in monitoring network devices, systems, server applications, hardware appliances and IoT devices among others. It ultimately monitors the performance of IT infrastructure components and services.

Zabbix works in a client/server architecture. An agent software is installed on a client machine which facilitates communication with the server. The client software is available for Linux, Unix and Windows. Tools such as SNMP can also be used with devices that do not have a compatible Zabbix agent.

Install Zabbix 5.0 LTS on Oracle Linux 8

For our complete zabbix installation, we require a database server (MySQL/ MariaDB), PHP and Nginx web server. In my installation, I preferred to disable SElinux. Edit SElinux configuration file, change the SELINUX line to ‘disabled’

sudo setenforce 0 sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config cat /etc/selinux/config | grep SELINUX=

Install Zabbix dependencies

Install Epel and Remi repositories to use in installing required dependencies.

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

Install required dependencies

We are going to install php7.4. Let’s disable php7.2 that comes with Oracle Linux 8 by default.

sudo dnf module reset php sudo dnf module install php:remi-7.4 

Install other php modules with the following command.

sudo dnf -y install php-fpm php-cli php-gd php-mysql php-snmp php-pear php-curl php-common php-mcrypt

Install MariaDB Database server

Install MariaDB by running the following command:

sudo dnf -y install mariadb mariadb-server

Enable and start mariadb with the below commands

sudo systemctl enable mariadb sudo systemctl start mariadb

Secure MariaDB and set root password

$ sudo mysql_secure_installation Enter current password for root (enter for none): Just press Enter Set root password? [Y/n] Y New password: New-root-password Re-enter new password: Re-enter New-root-password Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y Thanks for using MariaDB!

Connect to MariaDB and set up a database and a user

Читайте также:  Linux move file and directory

Login with the password set above and run the following commands to create a database and a user.

CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongDBPassw0rd'; GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost'; FLUSH PRIVILEGES; EXIT

Install Nginx Web Server

Run the command below to install nginx

sudo systemctl enable nginx sudo systemctl start nginx

Install Zabbix server on Oracle Linux 8

Use the below command to download and install Zabbix server on Oracle Linux 8

sudo dnf -y install https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

Also install zabbix packages using the below command:

sudo dnf -y install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-agent

Now proceed and start and enable Zabbix server, agent

sudo systemctl start zabbix-server zabbix-agent sudo systemctl enable zabbix-server zabbix-agent

By default, Zabbix-server runs on pot 10050 while Zabbix-agent runs on 10051. You can confirm if this is the case by running the following commands:

$ sudo ss -tlnup | grep 10050 $ sudo ss -tnlup | grep 10051

Configure Zabbix

We need to import the database schema to the Zabbix database by using the below commands:

cd /usr/share/doc/zabbix-server-mysql sudo gunzip create.sql.gz mysql -u root -p zabbix < create.sql

Next, edit the zabbix_server.conf file and define your Zabbix database credentials:

sudo vim /etc/zabbix/zabbix_server.conf

Add the credentials set when creating Zabbix database

DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=StrongDBPassw0rd

Next, configure PHP for Zabbix frontend by editing the following file:

sudo vim /etc/php-fpm.d/zabbix.conf

Change the timezone value to suit your timezone

php_value[date.timezone] = Africa/Nairobi

Save the file and restart php-fpm

sudo systemctl start php-fpm

Configure Nginx as Proxy for Zabbix Server

A file zabbix.conf is already created in nginx path. Edit it to update your servername and listening port

sudo vim /etc/nginx/conf.d/zabbix.conf

Your configuration file should look as below:

listen 80; server_name zabbix.example.com;

Save the file and restart nginx

sudo systemctl restart nginx

Configure Firewall Rules for Zabbix

If your firewall is active, you need to open zabbix and nginx ports as shown:

sudo firewall-cmd --permanent --add-port=10050/tcp sudo firewall-cmd --permanent --add-port=10051/tcp sudo firewall-cmd --permanent --add-port=80/tcp sudo firewall-cmd --reload

Zabbix 5 Web access on Oracle Linux 8

Now access your zabbix server from the browser using your server name: http://zabbix.example.com. You should see a page as below:

Читайте также:  Touch screen with linux driver

Click on next step to go to the next page to which is as shown below:

Click Next step once you have confirmed all is okay. In the next page, provide database credentials to connect to the zabbix database.

In the next page, provide zabbix server details.

The next page provides installation summary.

Click Next step

Click finish and you will be presented with Zabbix login page. Login with user Admin and password zabbix. Once you login, you should see a page as shown below:

That’s it about how to install and configure Zabbix with Nginx on Oracle Linux 8. Install and configure Zabbix agents on the servers you wish to monitor and enjoy your Zabbix Monitoring! Remember to check more interesting Linux guides below:

Источник

Оцените статью
Adblock
detector