3.0はLTS Zabbix サポート期間とリリースポリシー で5年サポートしてくれる。
yum update zabbix-* # 更新されたパッケージ確認 tail /var/log/yum.log # プロセスの起動時間確認 ps -eo pid,lstart,args | grep zabbix
外部チェック(External checks)がうまく動作しない場合があった。
zabbix 3.0では一部の環境変数が設定されておらず、スクリプトが参照している場合は動作しなくなったため、修正する必要がある
HOME=/var/lib/zabbixsrv LANG=en_US.UTF-8 LOGNAME=zabbixsrv PATH=/sbin:/usr/sbin:/bin:/usr/bin PWD=/ SHELL=/bin/bash SHLVL=4 TERM=xterm USER=zabbixsrv _=/bin/env
CONSOLETYPE=vt LANG=en_US.UTF-8 LANGSH_SOURCED=1 PATH=/sbin:/usr/sbin:/bin:/usr/bin PREVLEVEL=N PWD=/ RUNLEVEL=3 SHLVL=5 TERM=linux UPSTART_EVENTS=runlevel UPSTART_INSTANCE= UPSTART_JOB=rc _=/bin/env previous=N runlevel=3
export HOME=${HOME:-"$(getent passwd zabbix | cut -f6 -d:)"}
sudo tail -f /var/log/httpd/error_log [Fri Dec 16 07:42:18.067087 2016] [authz_core:error] [pid 35636] [client 192.168.61.1:55724] AH01630: client denied by server configuration: /usr/share/zabbix/
--- 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>
zabbix20-server-2.0.11-1.el6.x86_64 zabbix20-web-2.0.11-1.el6.noarch zabbix20-2.0.11-1.el6.x86_64 zabbix20-server-mysql-2.0.11-1.el6.x86_64 zabbix20-web-mysql-2.0.11-1.el6.noarch zabbix20-agent-2.0.11-1.el6.x86_64
# DBが更新されないようにサービス停止 sudo service zabbix-server stop sudo service httpd stop # mysql zabbix DBのみ mysqldump --opt --single-transaction --default-character-set=utf8 --no-autocommit --flush-logs --hex-blob zabbix | gzip > mysql.zabbix.$(date +%Y%m%d).gz # 設定ファイル。/etc/zabbix以下がsymlinkの事もある(EPEL版)のため、hオプションを付けてバックアップ tar cfzh zabbix.conf.$(date +%Y%m%d).tar.gz /etc/zabbix/
# php5.4未満はアンインストール sudo yum erase php* # EPEL版はパッケージ名がzabbix20, zabbix22のようにzabbix公式と異なるのでアンインストール sudo yum erase zabbix20-*
# 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
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