Zabbix Server 和 Zabbix Web

安装源

rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

安装配置Mysql

yum install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
MariaDB [(NONE)]> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [(NONE)]> GRANT ALL privileges ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';
MariaDB [(NONE)]> quit;
vim /etc/my.cnf
 
# 添加如下两行
max_connections = 1000
open_files_limit = 65535
 
# 查看是否配置成功
mysql -e "show variables like 'max_connections';"

安装Package

yum install zabbix-server-mysql zabbix-web-mysql
cd /usr/share/doc/zabbix-server-mysql-3.0.1/
zcat create.sql.gz | mysql -uroot zabbix

修改配置文件

vim /etc/zabbix/zabbix_server.conf
LogFileSize=10
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
 
CacheSize=512M
HistoryCacheSize=1G
TrendCacheSize=256M
ValueCacheSize=512M
 
StartPingers=5
StartDiscoverers=5

更换gnutls版本

下载 gnutls-3.1.18-8.el7.x86_64.rpm

可能需要下面的两个包:

gnutls-dane-3.1.18-8.el7.x86_64.rpm

gnutls-utils-3.1.18-8.el7.x86_64.rpm

安装

yum downgrade gnutls-3.1.18-8.el7.x86_64.rpm

如果有问题,可以使用–force按照3.1.18版本的包,并卸载掉高版本的包

安装其他需要的Package

yum install epel-release
yum -y install mysql-devel libxml2-devel net-snmp-devel
rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel7.noarch.rpm
# 需要设置域名解析服务器为8.8.8.8
yum -y install libcurl-devel

启动服务

systemctl enable zabbix-server
systemctl start zabbix-server

修改php配置

vim /etc/httpd/conf.d/zabbix.conf
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/Shanghai

重启apache2

systemctl restart httpd

Zabbix Proxy

安装源

rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

安装配置Mysql

yum install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
MariaDB [(NONE)]> CREATE DATABASE zabbix_proxy CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [(NONE)]> GRANT ALL privileges ON zabbix_proxy.* TO zabbix@localhost IDENTIFIED BY 'zabbix';
MariaDB [(NONE)]> quit;

安装Package

yum install zabbix-proxy-mysql

创建数据库

cd /usr/share/doc/zabbix-proxy-mysql-3.0.1/
zcat schema.sql.gz | mysql -uroot zabbix_proxy

修改配置文件

vim /etc/zabbix/zabbix_proxy.conf
Server=58.247.8.188
ServerPort=10006
Hostname=HuaTong proxy1
 
LogFileSize=10
 
DBHost=localhost
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=zabbix
 
ConfigFrequency=3600
DataSenderFrequency=1
 
CacheSize=128M
HistoryCacheSize=256M
HistoryIndexCacheSize=128M

启动服务

systemctl enable zabbix-proxy.service
systemctl start zabbix-proxy.service

Zabbix Agent

写了一个批量安装zabbix-agent的脚本

下载代码:

git clone https://github.com/zouyapeng/auto-install-agent.git

修改配置:

cd auto-install-agent/
 
# 修改需要安装zabbix的hosts
vim hosts
 
# 修改Password(需要安装Zabbix-agent的password)
vim main.sh +/Password=

安装需要的软件包:

yum install expect

运行安装:

./main.sh your-zabbix-server-ip

参考:https://www.zabbix.com/documentation/3.0/manual/installation/install_from_packages

评论

请输入您的评论. 可以使用维基语法: