Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0314· OpenAIAi2 WildChat-4.8M (AI2)

how to install zabbix on central ubuntu server and then install zabbix agent on another…

  1. User

    how to install zabbix on central ubuntu server and then install zabbix agent on another ubuntu machine

  2. 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

    1. Update the Ubuntu package list:
    sudo apt update
    
    1. 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 update
    

    Replace 'ubuntu20.04' with your Ubuntu version if different.

    1. Install Zabbix server, frontend, and agent:
    sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent
    
    1. Install and configure MariaDB:
    sudo apt install mariadb-server
    sudo mysql_secure_installation
    

    Follow the prompts to set up the MariaDB installation.

    1. Create the Zabbix database and user:

    Login to the MySQL server with the root account:

    sudo mysql -uroot -p
    

    Create 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.

    1. Import the Zabbix database schema:
    zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
    

    Enter the Zabbix user's password when prompted.

    1. Configure Zabbix server:

    Edit the Zabbix server configuration file:

    sudo nano /etc/zabbix/zabbix_server.conf
    

    Update the following lines with the Zabbix database user password:

    DBPassword=your-zabbix-password
    
    1. Restart Zabbix server and enable it to start at boot:
    sudo systemctl restart zabbix-server
    sudo systemctl enable zabbix-server
    
    1. Configure PHP for Zabbix frontend:

    Edit the Zabbix PHP configuration file:

    sudo nano /etc/zabbix/apache.conf
    

    Uncomment the 'date.timezone' line and set the correct timezone:

    php_value date.timezone Europe/Berlin
    

    Replace 'Europe/Berlin' with the appropriate timezone.

    1. Restart Apache web server:
    sudo systemctl restart apache2
    
    1. Access the Zabbix frontend:

    Open your web browser and navigate to:

    http://your-server-IP/zabbix
    

    Follow the on-screen instructions to complete the Zabbix frontend setup.

    Step 2: Install Zabbix agent on another Ubuntu machine

    1. Update the Ubuntu package list:
    sudo apt update
    
    1. 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 update
    

    Replace 'ubuntu20.04' with your Ubuntu version if different.

    1. Install Zabbix agent:
    sudo apt install zabbix-agent
    
    1. Configure Zabbix agent:

    Edit the Zabbix agent configuration file:

    sudo nano /etc/zabbix/zabbix_agentd.conf
    

    Update the following lines with the Zabbix server's IP address:

    Server=your-zabbix-server-ip
    ServerActive=your-zabbix-server-ip
    Hostname=your-agent-hostname
    

    Replace 'your-zabbix-server-ip' with the Zabbix server's IP address and 'your-agent-hostname' with a hostname for this agent.

    1. Restart Zabbix agent and enable it to start at boot:
    sudo systemctl restart zabbix-agent
    sudo systemctl enable zabbix-agent
    

    Step 3: Add Zabbix agent to the Zabbix server

    1. Log in to the Zabbix frontend.

    2. Navigate to Configuration > Hosts.

    3. Click on 'Create host'.

    4. Enter a Hostname, visible name, and select a group for the agent.

    5. Under 'Agent interfaces', enter the IP address of the agent machine.

    6. 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.