Appearance
Zabbixインストール手順
Zabbixサーバの構築方法および、監視対象のサーバへのエージェントの設定方法を記載します。
Zabbixサーバインストール
事前準備
mysqlインストール
shellsudo apt update sudo apt install mysql-server-8.0 -f
Zabbixサーバインストール
参考文献
- https://www.zabbix.com/documentation/current/en/manual/installation/install_from_packages/debian_ubuntu
- https://www.zabbix.com/download?zabbix=7.0&os_distribution=ubuntu&os_version=24.04&components=server_frontend_agent&db=mysql&ws=apache
手順
rootユーザに昇格
shellsudo su -Zabbix reporitoryをインストール
shellwget 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パッケージをインストール
shellapt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agentmysqlテーブル作成
shellmysql -u rootsqlcreate 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;初期データ投入
shellzcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbixlog_bin_trust_function_creatorsの無効化shellmysql -u rootset global log_bin_trust_function_creators = 0; quit;/etc/zabbix/zabbix_server.confを編集iniDBPassword={password}Zabbixサーバの開始
shellsystemctl restart zabbix-server zabbix-agent apache2 systemctl enable zabbix-server zabbix-agent apache2
http://localhost/zabbix にアクセスするとログイン画面が表示されます。初期ユーザ/パスワードはAdmin/zabbixです。
Zabbix Agentインストール
参考文献
- https://www.zabbix.com/download?zabbix=7.0&os_distribution=ubuntu&os_version=24.04&components=agent&db=&ws=
- https://www.zabbix.com/documentation/6.0/jp/manual/appendix/config/zabbix_agentd
- https://qiita.com/ohtsuka-shota/items/a08848ff69dc868e6e43
インストール手順
rootユーザに昇格
shellsudo su -Zabbix repositoryをインストール
shellwget 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 updateZabbix Agentインストール
shellapt install zabbix-agent/etc/zabbix/zabbix_agentd.confを編集iniServer=${ZabbixサーバのIPアドレス} ServerActive=${ZabbixサーバのIPアドレス}プロセス開始
shellsystemctl restart zabbix-agent systemctl enable zabbix-agent
ホスト登録手順
- Data collection > Hosts から Create host を選択
- Templates について適当に選択
- Interfaces については Agent を選択し、監視対象のIPアドレスを入力
- 10 ~ 15分後に Availability が点灯したら監視開始