Skip to content

Zabbixインストール手順

Zabbixサーバの構築方法および、監視対象のサーバへのエージェントの設定方法を記載します。

Zabbixサーバインストール

事前準備

  • mysqlインストール

    sudo apt update
    sudo apt install mysql-server-8.0 -f
    

Zabbixサーバインストール

参考文献

手順

  • rootユーザに昇格

    sudo su -
    
  • Zabbix reporitoryをインストール

    wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb
    dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb
    apt update
    
  • パッケージをインストール

    apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent
    
  • mysqlテーブル作成

    mysql -u root
    
    create database zabbix character set utf8mb4 collate utf8mb4_bin;
    create user zabbix@localhost identified by 'password';
    grant all privileges on zabbix.* to zabbix@localhost;
    set global log_bin_trust_function_creators = 1;
    quit;
    
  • 初期データ投入

    zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
    
  • log_bin_trust_function_creatorsの無効化

    mysql -u root
    
    set global log_bin_trust_function_creators = 0;
    quit;
    
  • /etc/zabbix/zabbix_server.confを編集

    DBPassword={password}
    
  • Zabbixサーバの開始

    systemctl restart zabbix-server zabbix-agent apache2
    systemctl enable zabbix-server zabbix-agent apache2
    

http://localhost/zabbix にアクセスするとログイン画面が表示されます。初期ユーザ/パスワードはAdmin/zabbixです。

Zabbix Agentインストール

参考文献

インストール手順

  • rootユーザに昇格

    sudo su -
    
  • Zabbix repositoryをインストール

    wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb
    dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb
    apt update
    
  • Zabbix Agentインストール

    apt install zabbix-agent
    
  • /etc/zabbix/zabbix_agentd.confを編集

    Server=${ZabbixサーバのIPアドレス}
    ServerActive=${ZabbixサーバのIPアドレス}
    
  • プロセス開始

    systemctl restart zabbix-agent
    systemctl enable zabbix-agent
    

ホスト登録手順

  • Data collection > Hosts から Create host を選択
    • Templates について適当に選択
    • Interfaces については Agent を選択し、監視対象のIPアドレスを入力
  • 10 ~ 15分後に Availability が点灯したら監視開始