ubuntu 16.04 + zabbix 3.4 + zabbix server

os: ubuntu 16.04
zabbix: 3.4php

ip 規劃
192.168.56.101 node1 pgsql 9.6 master
192.168.56.102 node2 pgsql 9.6 slave
192.168.56.103 node3 zabbix proxy
192.168.56.104 node4 zabbix servernode

本篇blog介紹在 node4 節點上安裝 zabbix server 的具體過程。
基本參照 zabbix 的官網,由於官網的介紹真的很清晰。mysql

Choose your platform for Zabbix server

選定
zabbix version:3.4
os distribution:ubuntu
os version:16.04(Xenial)
database:mysqlweb

https://www.zabbix.com/download?zabbix=3.4&os_distribution=ubuntu&os_version=xenial&db=MySQL

Install and configure Zabbix server

Install Repository with MySQL database

# wget https://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
# dpkg -i zabbix-release_3.4-1+xenial_all.deb
# apt update

Install Zabbix server, frontend, agent

本次在zabbix server端沒有安裝 zabbix-agentsql

# apt install zabbix-server-mysql zabbix-frontend-php
# ls -l /etc/zabbix/

Create initial database

# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> exit;

# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

提示錯誤 ERROR 1071 (42000) at line 162: Specified key was too long; max key length is 767 bytesapache

這個是須要修改 my.cnfubuntu

# vi /etc/mysql/mariadb.conf.d/50-server.cnf
innodb_large_prefix = on
innodb_file_format=BARRACUDA

Configure the database for Zabbix server

# vi /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=password
DBPort=3306
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
CacheSize=256M
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
FpingLocation=/usr/bin/fping
Fping6Location=/usr/bin/fping6
LogSlowQueries=3000

Configure PHP for Zabbix frontend

# vi /etc/zabbix/apache.conf

php_value date.timezone Asia/Shanghai

Start Zabbix server and agent processes

# systemctl restart zabbix-server apache2
# systemctl enable zabbix-server apache2

或者使用ruby

# update-rc.d zabbix-server apache2 defaults 90

查看 zabbix_server 監聽端口app

# netstat -antp|grep -i zabbix
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      19701/zabbix_server
tcp6       0      0 :::10051                :::*                    LISTEN      19701/zabbix_server
# netstat -lntp|grep -i zabbix
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      19701/zabbix_server
tcp6       0      0 :::10051                :::*                    LISTEN      19701/zabbix_server

Configure Zabbix frontend

Connect to your newly installed Zabbix frontend: http://server_ip_or_name/zabbix
Follow steps described in Zabbix documentation: Installing frontend https://www.zabbix.com/documentation/3.4/manual/installation/install#installing_frontendfrontend

Start using Zabbix

See Quickstart guide https://www.zabbix.com/documentation/3.4/manual/quickstart/login

用戶名:Admin
密碼:zabbix

Some Path

Configuration files are placed in /etc/zabbix.
Zabbix server, proxy and agent logfiles are placed in /var/log/zabbix.
Zabbix frontend is placed in /usr/share/zabbix.
Home directory for user zabbix is /var/lib/zabbix.
Frontend timezone is set to Europe/Riga (this can be modified in /etc/apache2/conf-available/zabbix.conf);

# ls -l /etc/apache2/conf-available
lrwxrwxrwx 1 root root   23 Jul 19 16:01 zabbix.conf -> /etc/zabbix/apache.conf

參考:
https://www.zabbix.com/download

https://www.zabbix.com/documentation/3.4/manual
https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages

相關文章
相關標籤/搜索