zabbix 3.0.1 的安装

来源:互联网 发布:南通集数数据 编辑:程序博客网 时间:2024/06/09 19:20
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql -y
yum install mariadb mariadb-server -y
yum install zabbix-agent -y

systemctl start mariadb

systemctl enable mariadb

## 安装好mariadb后,默认是可以直接用mysql登陆的,需要设置mysql用户名和密码。但是在zabbix的主配置文件中,因为数据是导入到zabbix中的,所以可以直接在配置文件中使用设置的zabbix用户名和密码。


mysql -e"
create database zabbix;
grant all on zabbix.* to zabbix@'localhost' identified by 'zabbix';
flush privileges;
exit"


#配置zabbix server端的文件,定义数据库的IP、用户名、密码
vim /etc/zabbix/zabbix_server.conf
LogFile=/tmp/zabbix_server.log
PidFile=/tmp/zabbix_server.pid
ListenPort=10051
DBHost=10.250.6.26
DBName= zabbix
DBUser=zabbix
DBPassword=abcd-1234          #指定zabbix数据库密码
ListenIP=10.250.6.26    #服务器IP地址
DBSocket=/tmp/mysql.sock
StartPollers=30                         #开启多线程数,一般不要超过30个
StartTrappers=20                        #trapper线程数
StartPingers=10                         #fping线程数
StartDiscoverers=120            
MaxHousekeeperDelete=5000       
CacheSize=1024M                         #用来保存监控数据的缓存数,根据监控主机的数量适当调整
StartDBSyncers=8                        #数据库同步时间
HistoryCacheSize=1024M          
TrendCacheSize=128M                     #总趋势缓存大小
HistoryTextCacheSize=512M
AlertScriptsPath=/etc/zabbix/alertscripts
LogSlowQueries=1000
#修改Agentd配置文件,更改HOSTNAME为本机的hostname
vim /etc/zabbix/zabbix_agentd.conf
PidFile=/tmp/zabbix_agentd.pid #进程PID
LogFile=/tmp/zabbix_agentd.log #日志保存位置
EnableRemoteCommands=1 #允许执行远程命令
Server=10.250.6.26 #agent端的ip
Hostname=client1 #必须与zabbix创建的host name相同

cd /usr/share/doc/zabbix-server-mysql-3.0.1
gunzip create.sql.gz
mysql -uzabbix -h127.0.0.1 -p zabbix < create.sql.gz

sed -i "s%# DBPassword=%DBPassword=zabbix%" /etc/zabbix/zabbix_server.conf
systemctl start zabbix-server
systemctl enable zabbix-server

sed -i "s%# php_value date.timezone Europe/Riga%php_value date.timezone Asia/Shanghai%" /etc/httpd/conf.d/zabbix.conf
systemctl start httpd
systemctl enable httpd
systemctl start zabbix-agent

systemctl enable zabbix-agent

#可以开始页面安装了,在安装的时候会有报错

修改php配置文件(php.ini)参数。

max_execution_time = 300      

max_input_time = 300     

post_max_size = 16M 

date.timezone = Asia/Shanghai       #默认是注释掉的

[root@localhost ~]# vim /etc/httpd/conf/httpd.conf

注:加上index.php

DirectoryIndex  index.php index.html index.html.var

[root@localhost~]# /etc/init.d/httpd restart


可以开始网页安装了



0 1