Linuxサーバの監視方法 (Zabbix)

目的

手順

MySQLにZabbix用データベースを作成する

  • MySQLの初期パスワードを設定しない場合、sudoしてアクセスするモードになるらしい。
$ sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 213
Server version: 5.7.26-0ubuntu0.18.04.1 (Ubuntu)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'P@ssword123';
Query OK, 0 rows affected, 1 warning (0.01 sec)

Zabbixのインストール

k$ sudo dpkg -i zabbix-release_4.0-2+bionic_all.deb

$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent