Zabbix 3.0 †
3.0はLTS Zabbix サポート期間とリリースポリシー で5年サポートしてくれる。
- 気づいた点
- メンテナンス時に現在の日時をクリックするとzabbixホストのtimezoneになってくれる。zabbix2.0まではzabbixホストがUTCで、ローカルがJSTだと、JSTが現在の日時になって、手動で修正が必要だった。
パッケージの更新 †
環境変数HOME等が設定されていない †
外部チェック(External checks)がうまく動作しない場合があった。
zabbix 3.0では一部の環境変数が設定されておらず、スクリプトが参照している場合は動作しなくなったため、修正する必要がある
- epel repo zabbix 2.0:
- user: zabbixsrv
- home: /var/lib/zabbixsrv
- env: HOME,USER,SHELL変数が設定されている
- zabbix repo zabbix 3.0
- user: zabbix
- home: /var/lib/zabbix
- env: HOME,USER,SHELL変数が設定されていない
httpd2.4で「client denied by server configuration:」 †
- 環境
- CentOS 7.3 64bit
- httpd-2.4.6-45.el7.centos.x86_64
- httpd2.4からアクセス制御の書き方が変わった。
- /etc/httpd/conf.d/zabbix.conf の中身を以下のように置き換える
--- zabbix.conf.httpd22 2016-12-16 07:57:11.342962457 +0000
+++ zabbix.conf 2016-12-16 08:21:09.611989118 +0000
@@ -8,8 +8,7 @@
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
- Order allow,deny
- Allow from all
+ Require all granted
<IfModule mod_php5.c>
php_value max_execution_time 300
@@ -23,37 +22,29 @@
</Directory>
<Directory "/usr/share/zabbix/conf">
- Order deny,allow
- Deny from all
+ Require all denied
<files *.php>
- Order deny,allow
- Deny from all
+ Require all denied
</files>
</Directory>
<Directory "/usr/share/zabbix/app">
- Order deny,allow
- Deny from all
+ Require all denied
<files *.php>
- Order deny,allow
- Deny from all
+ Require all denied
</files>
</Directory>
<Directory "/usr/share/zabbix/include">
- Order deny,allow
- Deny from all
+ Require all denied
<files *.php>
- Order deny,allow
- Deny from all
+ Require all denied
</files>
</Directory>
<Directory "/usr/share/zabbix/local">
- Order deny,allow
- Deny from all
+ Require all denied
<files *.php>
- Order deny,allow
- Deny from all
+ Require all denied
</files>
</Directory>
EPEL版からZabbix公式リポジトリ版へのアップグレード †
- CentOS 6/7対応
- CentOS 5 はserver rpmがない。agent/proxyはある。zabbix v2.4はserverもある
- 必要要件のインストール: CentOS6.x 64bit
- php5.4ではapcの代わりにユーザキャッシュ部分を分離したものがapcu, オペコードのキャッシュに zend opcache を使う
# epelとremiリポジトリ追加
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# 必要パッケージのインストール
sudo yum -y --enablerepo=epel,remi install mysql-server curl net-snmp unixODBC OpenIPMI-libs httpd php php-bcmath php-gd php-mbstring php-mysqlnd php-xml php-pecl-apcu php-pecl-zendopcache
- zabbix 3.0へのアップグレード: CentOS 6.x 64bit EPEL版から
sudo rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
sudo yum install zabbix-web zabbix-web-japanese zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender
# EPEL版は /etc/zabbix_server.conf.rpmsave, /etc/zabbix_agentd.conf.rpmsave のように設定が残っているので確認
vim /etc/zabbix/zabbix_server.conf
----
DBPassword=****
----
vim /etc/zabbix/zabbix_agentd.conf
----
ListenIP=127.0.0.1
----
sudo vim /etc/php.d/apcu.ini
----
apc.shm_size=32M
----
sudo service mysqld restart
sudo service zabbix-server restart
less /var/log/zabbix/zabbix_server.log
...
1883:20161019:123331.012 Zabbix Server stopped. Zabbix 2.0.11 (revision 42526).
6294:20161019:151719.792 Starting Zabbix Server. Zabbix 3.0.5 (revision 62889).
6294:20161019:151719.792 ****** Enabled features ******
6294:20161019:151719.792 SNMP monitoring: YES
6294:20161019:151719.792 IPMI monitoring: YES
6294:20161019:151719.792 Web monitoring: YES
6294:20161019:151719.792 VMware monitoring: YES
6294:20161019:151719.792 SMTP authentication: NO
6294:20161019:151719.792 Jabber notifications: YES
6294:20161019:151719.792 Ez Texting notifications: YES
6294:20161019:151719.792 ODBC: YES
6294:20161019:151719.792 SSH2 support: YES
6294:20161019:151719.792 IPv6 support: YES
6294:20161019:151719.792 TLS support: YES
6294:20161019:151719.792 ******************************
sudo service zabbix-agent restart
less /var/log/zabbix/zabbix_agentd.log
...
6267:20161019:151934.194 Zabbix Agent stopped. Zabbix 3.0.5 (revision 62889).
6380:20161019:151934.317 Starting Zabbix Agent [Zabbix server]. Zabbix 3.0.5 (revision 62889).
6380:20161019:151934.317 **** Enabled features ****
6380:20161019:151934.317 IPv6 support: YES
6380:20161019:151934.317 TLS support: YES
6380:20161019:151934.317 **************************
6380:20161019:151934.317 using configuration file: /etc/zabbix/zabbix_agentd.conf
sudo cp /usr/share/doc/zabbix-web-3.0.5/httpd22-example.conf /etc/httpd/conf.d/zabbix.conf
sudo vim zabbix.conf
----
php_value date.timezone Asia/Tokyo
----
sudo service httpd restart
sudo chkconfig mysqld on
sudo chkconfig zabbix-server on
sudo chkconfig zabbix-agent on
sudo chkconfig httpd on
# zabbix agentが正常に動作していれば、1になる
zabbix_get -s 127.0.0.1 -k agent.ping
1
- 重複しているテンプレート項目を削除
- {Template OS Linux:system.cpu.util[,iowait].last(0)}>20
- {Template OS Linux:proc.num[].last(0)}>300
- {Template OS Linux:proc.num[,,run].last(0)}>30