【tech】ubuntu18.04 zabbix4.0 install log作業ログ

Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-32-generic x86_64)

  • Documentation: https://help.ubuntu.com
  • Management: https://landscape.canonical.com
  • Support: https://ubuntu.com/advantage

    212 packages can be updated.
    78 updates are security updates.

    Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings

    Last login: Tue Oct 30 01:34:01 2018 from 192.168.56.1
    ubuntu@ubuntu-VirtualBox:~$ ubuntu@ubuntu-VirtualBox:~$ sudo dpkg-reconfigure keyboard-configuration
    password for ubuntu:
    ubuntu@ubuntu-VirtualBox:~$ sudo apt install language-pack-ja-base language-ppack-ja
    Reading package lists... 0%Reading package lists... 0%Reading package lists... 6%Reading package lists... Done
    language-pack-ja is already the newest version (1:18.04+20180712).
    language-pack-ja set to manually installed.
    language-pack-ja-base is already the newest version (1:18.04+20180712).
    language-pack-ja-base set to manually installed.
    0 upgraded, 0 newly installed, 0 to remove and 214 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Affected packages: apparmor:amd64
    ubuntu@ubuntu-VirtualBox:~$ sudo update-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
    ubuntu@ubuntu-VirtualBox:~$ sudo apt-get upgrade -y
    パッケージリストを読み込んでいます... 0%パッケージリストを読み込んでいます... 100%パッケージリストを読み込んでいます... 完了
    libjavascriptcoregtk-4.0-18 libwebkit2gtk-4.0-37 linux-generic
    linux-headers-generic linux-image-generic
    以下のパッケージはアップグレードされます:
    apport apport-gtk appstream apt apt-config-icons apt-utils apturl
    ubuntu-mono ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk
    ubuntu-report ubuntu-settings ubuntu-software udisks2 unattended-upgrades
    update-manager update-manager-core util-linux uuid-runtime wpasupplicant
    xbrlapi xserver-common xserver-xephyr xserver-xorg-core
    xserver-xorg-legacy xwayland
    アップグレード: 207 個、新規インストール: 0 個、削除: 0 個、保留: 7 個。
    129 MB 中 14.2 MB のアーカイブを取得する必要があります。
    この操作後に追加で 10.3 MB のディスク容量が消費されます。
    console-setup (1.178ubuntu2.7) で (1.178ubuntu2.6 に) 上書き展開しています ...
    .../012-keyboard-configuration_1.178ubuntu2.7_all.deb を展開する準備をしています ...
    libcurl3-gnutls:amd64 (7.58.0-2ubuntu3.3) を設定しています ...
    light-themes (16.10+18.04.20181005-0ubuntu1) を設定しています ...
    cracklib-runtime (2.9.2-5build1) のトリガを処理しています ...
    tzdata (2018g-0ubuntu0.18.04) を設定しています ...

    Current default time zone: 'Asia/Tokyo'
    Local time is now: 2018年 10月 31日 水曜日 00:11:57 JST.
    Universal Time is now: Tue Oct 30 15:11:57 UTC 2018.
    Run 'dpkg-reconfigure tzdata' if you wish to change it.

    mutter-common (3.28.3-2~ubuntu18.04.1) を設定しています ...
    ubuntu-report (1.3.0~18.04) を設定しています ...
    Generating grub configuration file ...
    Linux イメージを見つけました: /boot/vmlinuz-4.15.0-32-generic
    Found initrd image: /boot/initrd.img-4.15.0-32-generic
    Found memtest86+ image: /boot/memtest86+.elf
    Found memtest86+ image: /boot/memtest86+.bin
    完了
    dbus (1.12.2-1ubuntu1) のトリガを処理しています ...
    たいていの場合良い考え x x です。
    Found memtest86+ image: /boot/memtest86+.elf
    Found memtest86+ image: /boot/memtest86+.bin
    完了
    libirs160:amd64 (1:9.11.3+dfsg-1ubuntu1.2) を設定しています ...
    gstreamer1.0-packagekit (1.1.9-1ubuntu2.18.04.3) を設定しています ...
    libbind9-160:amd64 (1:9.11.3+dfsg-1ubuntu1.2) を設定しています ...
    libpangoxft-1.0-0:amd64 (1.40.14-1ubuntu0.1) を設定しています ...
    apport-gtk (2.20.9-0ubuntu7.4) を設定しています ...
    update-initramfs: Generating /boot/initrd.img-4.15.0-32-generic
    ubuntu@ubuntu-VirtualBox:~$ sudo apt-get update
    fontconfig (2.12.6-0ubuntu2) のトリガを処理しています ...

    ubuntu@ubuntu-VirtualBox:~$ sudo reboot

    Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-32-generic x86_64)

  • Documentation: https://help.ubuntu.com

  • Management: https://landscape.canonical.com
  • Support: https://ubuntu.com/advantage

  • Canonical Livepatch is available for installation.

    • Reduce system reboots and improve kernel security. Activate at:
      https://ubuntu.com/livepatch

    14 個のパッケージがアップデート可能です。
    9 個のアップデートはセキュリティアップデートです。

    Last login: Wed Oct 31 00:04:03 2018 from 192.168.56.1
    ubuntu@ubuntu-VirtualBox:~$
    ubuntu@ubuntu-VirtualBox:~$ sudo apt-get install -y mysql-server
    ubuntu のパスワード:
    パッケージリストを読み込んでいます... 0%パッケージリストを読み込んでいます... 100%パッケージリストを読み込んでいます... 完了
    systemd (237-3ubuntu10.3) のトリガを処理しています ...
    ubuntu@ubuntu-VirtualBox:~$ sudo vi /etc/mysql/my.cnf
    "/etc/mysql/my.cnf" 21 lines, 682 characters#

 # The MySQL database server configuration file.
 #
 # You can copy this to one of:
 # - "/etc/mysql/my.cnf" to set global options,
 # - "~/.my.cnf" to set user-specific options.
 #
 # One can use all long options that the program supports.
 # Run program with --help to get a list of available options and with
 # --print-defaults to see which it would actually understand and use.
 #
 # For explanations see
 # http://dev.mysql.com/doc/mysql/en/server-system-variables.html

 #
 # * IMPORTANT: Additional settings that can override those from this file!
 #   The files must end with '.cnf', otherwise they'll be ignored.
 #

 !includedir /etc/mysql/conf.d/
 !includedir /etc/mysql/mysql.conf.d/

[mysqld]
character-set-server = utf8
collation-server     = utf8_bin
skip-character-set-client-handshake
innodb_file_per_table


 ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            ~                                                                            /character-set-server = utf8collation-server = utf8_binskip-character-set-client-handshakeinnodb_file_per_table:wq"/etc/mysql/my.cnf" 27 lines, 806 characters written

ubuntu@ubuntu-VirtualBox:~$ sudo service mysql restart
ubuntu@ubuntu-VirtualBox:~$ sudo wget https://repo.zabbix.com/zabbix/4.0/ubunttu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb
--2018-10-31 00:17:15-- https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb
repo.zabbix.com (repo.zabbix.com) をDNSに問いあわせています... 162.243.159.138
repo.zabbix.com (repo.zabbix.com)|162.243.159.138|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 4008 (3.9K)
zabbix-release_4.0-2+bionic_all.deb' に保存中

zabbix-re 0% 0 --.-KB/s zabbix-release_4.0- 100% 3.91K --.-KB/s 時間 0s

2018-10-31 00:17:18 (339 MB/s) - zabbix-release_4.0-2+bionic_all.deb' へ保存完了

ubuntu@ubuntu-VirtualBox:~$ sudo dpkg -i zabbix-release_4.0-2+bionic_all.deb
以前に未選択のパッケージ zabbix-release を選択しています。
進捗: 進捗: .../04-gir1.2-webkit2-4.0_2.22.2-0ubuntu0.18.04.2_amd64.deb を展開する準備をしています ...
進捗: gir1.2-webkit2-4.0:amd64 (2.22.2-0ubuntu0.18.04.2) で (2.20.5-0ubuntu0.18.04.1 に) 上書き展開しています ...
進捗: 進捗: .../05-gir1.2-javascriptcoregtk-4.0_2.22.2-0ubuntu0.18.04.2_amd64.deb を展開する準備をしています ...
進捗: gir1.2-javascriptcoregtk-4.0:amd64 (2.22.2-0ubuntu0.18.04.2) で (2.20.5-0ubuntu0.18.04.1 に) 上書き展開しています ...
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
完了
進捗:
ubuntu@ubuntu-VirtualBox:~$ sudo apt update
状態情報を読み取っています... 0%状態情報を読み取っています... 3%状態情報を読み取っています... 完了
パッケージはすべて最新です。
ubuntu@ubuntu-VirtualBox:~$ sudo apt install -y zabbix-server-mysql zabbix-froontend-php zabbix-agent
状態情報を読み取っています... 0%状態情報を読み取っています... 3%状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
apache2 apache2-bin apache2-data apache2-utils fping libapache2-mod-php
libapache2-mod-php7.2 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap libcurl4 libiksemel3 liblua5.2-0 libmysqlclient20
libodbc1 libopenipmi0 libssh2-1 php-bcmath php-common php-gd php-ldap
進捗: libapr1:amd64 (1.6.3-2) を展開しています...
進捗: 以前に未選択のパッケージ libaprutil1:amd64 を選択しています。
ureadahead (0.100.0-20) のトリガを処理しています ...
libc-bin (2.27-3ubuntu1) のトリガを処理しています ...
systemd (237-3ubuntu10.3) のトリガを処理しています ...
ufw (0.35-5) のトリガを処理しています ...

ubuntu@ubuntu-VirtualBox:~$ sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: no
Please set the password for root here.

New password:

Re-enter new password:
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.

  • Removing privileges on test database...
    Success.

    Reloading the privilege tables will ensure that all changes
    made so far will take effect immediately.

    Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
    Success.

    All done!

    ubuntu@ubuntu-VirtualBox:~$ sudo mysql -uroot -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 4
    Server version: 5.7.24-0ubuntu0.18.04.1 (Ubuntu)

    Copyright (c) 2000, 2018, 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 zabbixDB character set utf8 collate utf8_bin;
    Query OK, 1 row affected (0.00 sec)

    mysql> grant all privileges on zabbixDB.* to zabbixuser@localhost identified by 'ZabbixPW123!!';
    Query OK, 0 rows affected, 1 warning (0.00 sec)

    mysql> quit
    Bye
    ubuntu@ubuntu-VirtualBox:~$ zcat /usr/share/doc/zabbix-server-mysql*/create.sqql.gz | mysql -uzabbixuser -p zabbixDB
    Enter password:
    ubuntu@ubuntu-VirtualBox:~$ sudo vi /etc/zabbix/zabbix_server.conf
    "/etc/zabbix/zabbix_server.conf" 714 lines, 16870 characters# This is a configuration file for Zabbix server daemon

    To get more information about Zabbix, visit http://www.zabbix.com

 ############ GENERAL PARAMETERS #################

 ### Option: ListenPort
 #Listen port for trapper.
 #
 # Mandatory: no
 # Range: 1024-32767
 # Default:
 # ListenPort=10051

 ### Option: SourceIP
 #Source IP address for outgoing connections.
 #
 # Mandatory: no
 # Default:
 # SourceIP=

 ### Option: LogType
 #Specifies where log messages are written to:
 #system  - syslog
 #file    - file specified with LogFile parameter
 #console - standard output
 #
 # Mandatory: no
 # Default:
 # LogType=file

 ### Option: LogFile
 #Log file name for LogType 'file' parameter.
 ##IPC socket directory.
 #Directory to store IPC sockets used by internal Zabbix services.
 #
 # Mandatory: no
 # Default:
 # SocketDir=/tmp

 SocketDir=/var/run/zabbix

 ### Option: DBHost
 #Database host name.
 #If set to localhost, socket is used for MySQL.
 #If set to empty string, socket is used for PostgreSQL.
 #
 # Mandatory: no
 # Default:
 # DBHost=localhost

 ### Option: DBName
 #Database name.
 #For SQLite3 path to database file must be provided. DBUser and DBPasssword are ignored.
 #
 # Mandatory: yes
 # Default:
 # DBName=

 DBName=zabbix

 ### Option: DBSchema
 #Schema name. Used for IBM DB2 and PostgreSQL.
 #
 # Mandatory: no DBHost=localhostDBHost=localhost


 DBName=zabbixDB


 #
 # Mandatory: no
 # Default:
 # DBSchema=

 ### Option: DBUser
 #Database user. Ignored for SQLite.
 #
 # Mandatory: no
 # Default:
 # DBUser=

 DBUser=zabbixuser

 ### Option: DBPassword
 #Database password. Ignored for SQLite.
 #Comment this line if no password is used.
 #
 # Mandatory: no
 Default:# DBPassword=ZabbixPW123!!


 ### Option: DBSocket
/etc/zabbix/zabbix_server.conf" 716 lines, 16887 characters written

ubuntu@ubuntu-VirtualBox:~$ sudo vi /etc/zabbix/apache.conf

# Define /zabbix alias, this is the default
<IfModule mod_alias.c>
    Alias /zabbix /usr/share/zabbix
</IfModule>

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        php_value date.timezone Asia/Tokyo
    </IfModule>
    <IfModule mod_php7.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        php_value date.timezone Asia/Tokyo
    </IfModule>
</Directory>

ubuntu@ubuntu-VirtualBox:~$ sudo systemctl enable zabbix-server zabbix-agent aapache2
Synchronizing state of zabbix-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-server
Synchronizing state of zabbix-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-agent
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
ubuntu@ubuntu-VirtualBox:~$ sudo systemctl restart zabbix-server zabbix-agent apache2
ubuntu@ubuntu-VirtualBox:~$