how to install zabbix on central ubuntu server and then install zabbix agent on another…
- User
how to install zabbix on central ubuntu server and then install zabbix agent on another ubuntu machine
- Assistant
I will guide you through the process of installing Zabbix server on a central Ubuntu server and then installing Zabbix agent on another Ubuntu machine.
Step 1: Install Zabbix server on a central Ubuntu server
- Update the Ubuntu package list:
sudo apt update- Install Zabbix repository:
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+ubuntu20.04_all.deb sudo dpkg -i zabbix-release_5.0-1+ubuntu20.04_all.deb sudo apt updateReplace 'ubuntu20.04' with your Ubuntu version if different.
- Install Zabbix server, frontend, and agent:
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent- Install and configure MariaDB:
sudo apt install mariadb-server sudo mysql_secure_installationFollow the prompts to set up the MariaDB installation.
- Create the Zabbix database and user:
Login to the MySQL server with the root account:
sudo mysql -uroot -pCreate the Zabbix database and user:
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin; GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'your-zabbix-password'; FLUSH PRIVILEGES; EXIT;Change 'your-zabbix-password' with a strong password.
- Import the Zabbix database schema:
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbixEnter the Zabbix user's password when prompted.
- Configure Zabbix server:
Edit the Zabbix server configuration file:
sudo nano /etc/zabbix/zabbix_server.confUpdate the following lines with the Zabbix database user password:
DBPassword=your-zabbix-password- Restart Zabbix server and enable it to start at boot:
sudo systemctl restart zabbix-server sudo systemctl enable zabbix-server- Configure PHP for Zabbix frontend:
Edit the Zabbix PHP configuration file:
sudo nano /etc/zabbix/apache.confUncomment the 'date.timezone' line and set the correct timezone:
php_value date.timezone Europe/BerlinReplace 'Europe/Berlin' with the appropriate timezone.
- Restart Apache web server:
sudo systemctl restart apache2- Access the Zabbix frontend:
Open your web browser and navigate to:
http://your-server-IP/zabbixFollow the on-screen instructions to complete the Zabbix frontend setup.
Step 2: Install Zabbix agent on another Ubuntu machine
- Update the Ubuntu package list:
sudo apt update- Install Zabbix repository:
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+ubuntu20.04_all.deb sudo dpkg -i zabbix-release_5.0-1+ubuntu20.04_all.deb sudo apt updateReplace 'ubuntu20.04' with your Ubuntu version if different.
- Install Zabbix agent:
sudo apt install zabbix-agent- Configure Zabbix agent:
Edit the Zabbix agent configuration file:
sudo nano /etc/zabbix/zabbix_agentd.confUpdate the following lines with the Zabbix server's IP address:
Server=your-zabbix-server-ip ServerActive=your-zabbix-server-ip Hostname=your-agent-hostnameReplace 'your-zabbix-server-ip' with the Zabbix server's IP address and 'your-agent-hostname' with a hostname for this agent.
- Restart Zabbix agent and enable it to start at boot:
sudo systemctl restart zabbix-agent sudo systemctl enable zabbix-agentStep 3: Add Zabbix agent to the Zabbix server
-
Log in to the Zabbix frontend.
-
Navigate to Configuration > Hosts.
-
Click on 'Create host'.
-
Enter a Hostname, visible name, and select a group for the agent.
-
Under 'Agent interfaces', enter the IP address of the agent machine.
-
Click 'Add' to save the new host.
The Zabbix agent is now added to the Zabbix server, and it should start monitoring the agent machine shortly.