


先日、Zabbix applianceをVMware ESXi 6.7に導入しました。
このあと環境設定を行いました。ちなみに3系はubuntuベースです。
appliance@zabbix:~$ cat /etc/os-release
NAME=”Ubuntu”
VERSION=”16.04.4 LTS (Xenial Xerus)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=”Ubuntu 16.04.4 LTS”
VERSION_ID=”16.04″
HOME_URL=”http://www.ubuntu.com/”
SUPPORT_URL=”http://help.ubuntu.com/”
BUG_REPORT_URL=”http://bugs.launchpad.net/ubuntu/”
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenialappliance@zabbix:~$ apache2 -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2018-04-18T14:53:04appliance@zabbix:~$ php -v
PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologiesappliance@zabbix:~$ mysql -V
mysql Ver 14.14 Distrib 5.7.22, for Linux (x86_64) using EditLine wrapper
- キーボードレイアウトの変更
- ネットワーク設定
- ローカルタイムの設定
- phpのTimeZone
- zabbixの言語
- グラフの文字化け
- open-vm-toolsのインストール
- 仮想マシン バージョンのアップグレード
- システムのアップデート
そのままでは英語キーボード配列でしたので日本語キーボード配列に変更しました。
1 |
appliance@zabbix:~$ sudo dpkg-reconfigure keyboard-configuration |
[Generic 1050key (Intel) PC]-[Japanese]-[Japanese]-[The Default for the keyboard layout]-[No conpose key]
ちなみにESXiコンソールを利用する場合はコンソール設定でキーボードレイアウトを[日本語]に変更して下さい。
これを変更しないといつまでも英語キーボードのままです。(これで半日悩みました)
デフォルトではDHCPに設定されています。これを固定IPに変更、DNSの設定をしました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
appliance@zabbix:~$ sudo vi /etc/network/interfaces appliance@zabbix:~$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto ens33 #iface ens33 inet dhcp iface ens33 inet static address 192.168.1.5 netmask 255.255.255.0 gateway 192.168.1.254 dns-nameserver 192.168.1.254 dns-search rootlinks.net |
/etc/resolv.confを編集しても次回起動時に上書きされて設定が無くなりました(^^;
http://manpages.ubuntu.com/manpages/bionic/man8/resolvconf.8.html
1 2 3 4 5 |
appliance@zabbix:~$ date Thu Jun 7 05:26:04 UTC 2018 appliance@zabbix:~$ sudo cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime appliance@zabbix:~$ date Thu Jun 7 14:31:34 JST 2018 |
phpのTimeZoneを設定します。また必要に応じてアクセス制限もして下さい。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
appliance@zabbix:~$ sudo vi /etc/apache2/conf-enabled/zabbix.conf appliance@zabbix:~$ cat /etc/apache2/conf-enabled/zabbix.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 192.168.1 <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 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 always_populate_raw_post_data -1 php_value date.timezone Asia/Tokyo </IfModule> </Directory> <Directory "/usr/share/zabbix/conf"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> <Directory "/usr/share/zabbix/app"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> <Directory "/usr/share/zabbix/include"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> <Directory "/usr/share/zabbix/local"> Order deny,allow Deny from all <files *.php> Order deny,allow Deny from all </files> </Directory> appliance@zabbix:~$ sudo apachectl restart |
ちなみにphp.iniは2つありました。RHEL/CentOSのように/etc/php.iniだけではないのですね。
1 2 3 |
appliance@zabbix:~$ sudo find / -name php.ini /etc/php/7.0/cli/php.ini /etc/php/7.0/apache2/php.ini |
https://Zabbix_IP/zabbix/にアクセスしてユーザー:Admin パスワード:zabbixでログインします。
右上の人アイコンをクリックしてプロファイルを表示すると言語選択ができます。
zabbixがグラフの描写に使用しているフォントgraphfont.ttf(実態は/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf)に日本語フォントが無いためです。
1 2 |
appliance@zabbix:~$ ls -l /usr/share/zabbix/fonts/ lrwxrwxrwx 1 root root 38 Apr 6 16:12 graphfont.ttf -> /etc/alternatives/zabbix-frontend-font |
取り敢えず日本語フォントをインストールします。いろいろあるようですが今回はfonts-takaoをインストールしました。
1 2 |
appliance@zabbix:~$ sudo apt update appliance@zabbix:~$ sudo apt install fonts-takao |
fonts-takaoに変更します。
1 2 3 4 |
appliance@zabbix:~$ sudo rm /usr/share/zabbix/fonts/graphfont.ttf appliance@zabbix:~$ sudo ln -s /etc/alternatives/fonts-japanese-gothic.ttf /usr/share/zabbix/fonts/graphfont.ttf appliance@zabbix:~$ ls -l /usr/share/zabbix/fonts/ lrwxrwxrwx 1 root root 43 Jun 7 15:40 graphfont.ttf -> /etc/alternatives/fonts-japanese-gothic.ttf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
appliance@zabbix:~$ sudo apt install open-vm-tools Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libdumbnet1 libmspack0 libxmlsec1 libxmlsec1-openssl Suggested packages: open-vm-tools-desktop cloud-init Recommended packages: ethtool zerofree fuse The following NEW packages will be installed: libdumbnet1 libmspack0 libxmlsec1 libxmlsec1-openssl open-vm-tools 0 upgraded, 5 newly installed, 0 to remove and 24 not upgraded. Need to get 784 kB of archives. After this operation, 3,025 kB of additional disk space will be used. Do you want to continue? [Y/n] Y (snip) |
仮想マシン バージョン 9をアップグレードします。アップグレードを実行するには仮想マシンを停止する必要があります。
[アクション]-[仮想マシンの互換性のアップグレード]から最新にアップグレードしました。
公式Repositoriesが/etc/apt/sources.listに登録されていますので、そのままアップデートできます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
appliance@zabbix:~$ sudo apt update [sudo] password for appliance: Hit:1 http://repo.zabbix.com/zabbix/3.0/ubuntu xenial InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] Get:5 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [785 kB] Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [720 kB] Get:8 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [632 kB] Get:9 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [578 kB] Fetched 3,037 kB in 2s (1,335 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 24 packages can be upgraded. Run 'apt list --upgradable' to see them. appliance@zabbix:~$ sudo apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: grub-common grub-pc grub-pc-bin grub2-common ifupdown libavahi-client3 libavahi-common-data libavahi-common3 libldap-2.4-2 libpam-modules libpam-modules-bin libpam-runtime libpam0g libplymouth4 linux-firmware plymouth plymouth-label plymouth-themes zabbix-agent zabbix-frontend-php zabbix-get zabbix-java-gateway zabbix-sender zabbix-server-mysql 24 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 59.8 MB of archives. After this operation, 10.0 MB of additional disk space will be used. Do you want to continue? [Y/n] Y (snip) |
ESXi 6.7に導入して設定箇所を列挙してみました。パスワードの変更やFirewall、HDDの拡張など本格的に運用するにはまだまだですが、取り敢えずベースとなる部分は大丈夫と思います。