客户端安装参考:https://mp.csdn.net/postedit/95475740
安装Zabbix
关闭 SeLinux
临时关闭
setenforce 0
永久关闭
vi /etc/selinux/config
关闭防火墙
临时关闭
systemctl stop firewalld.service
永久关闭
systemctl disable firewalld.service
安装基础环境
环境:安装Zabbix环境前提需要安装LAMP/LNMP环境
安装 httpd 服务
yum install -y httpd
设置开机启动
systemctl enable httpd
启动服务
systemctl start httpd
安装Mysql(mariadb)
yum install -y mariadb mariadb-server
设置开机启动
systemctl enable mariadb
启动服务
systemctl start mariadb
安装php环境
yum install -y php php-mysql
安装Zabbix
1.下载安装包
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
2.安装zabbix包
yum install -y zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender
3.创建zabbix数据库
create database zabbix character set utf8 collate utf8_bin;
创建账户并且授权设置密码,用户zabbxi分配可对数据库zabbix所有表进行所有操作的权限,并且设定密码为zabbix
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
刷新配置
flush privileges;
4.导入zabbix初始表
进入目录
cd /usr/share/doc/zabbix-server-mysql-3.4.15
解压 create.sql.gz 文件,获取sql文件
gunzip create.sql.gz
导入表至zabbix数据库,在当前目录进入mysql,
> msyql
> use zabbix
> source create.sql
5.修改zabbix 配置文件
进入zabbix配置文件所在目录
cd /etc/zabbix
修改配置文件 vi zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
6.启动zabbix服务端
systemctl start zabbix-server.service
设置开机启动
systemctl enable zabbix-server.service
6.配置PHP
cd /etc/httpd/conf.d
vi zabbix.conf
增加时区
Alias /zabbix /usr/share/zabbix<Directory "/usr/share/zabbix">Options FollowSymLinksAllowOverride NoneRequire all granted<IfModule mod_php5.c>php_value max_execution_time 300php_value memory_limit 128Mphp_value post_max_size 16Mphp_value upload_max_filesize 2Mphp_value max_input_time 300php_value max_input_vars 10000php_value always_populate_raw_post_data -1# php_value date.timezone Europe/Rigaphp_value date.timezone Asia/Shanghai</IfModule>
</Directory><Directory "/usr/share/zabbix/conf">Require all denied
</Directory><Directory "/usr/share/zabbix/app">Require all denied
</Directory><Directory "/usr/share/zabbix/include">Require all denied
</Directory><Directory "/usr/share/zabbix/local">Require all denied
</Directory>
重启服务
Systemctl restart httpd
登录Zabbix
链接:http://192.168.0.1/zabbix
填写之前设置的账号密码
填写服务名称,点击next
点击 next
安装成功,点击finish
登录账号,密码,账号:Admin,密码:zabbix,注意区分大小写
设置中文
启动客户端 agent
不启动下面启动监测,无法检测到
启动服务
systemctl start zabbix-agent.service
设置开机启动
systemctl enable zabbix-agent.service
添加监测主机
提示如下即为成功
中文无法显示解决方案:https://www.jianshu.com/p/abc495396c7d