安装与部署Zabbix
永久关闭selinux
[root@localhost ~]# vi /etc/selinux/config
修改SELINUX=disabled 保存
reboot 重启,执行sestatus查看状态
##关闭防火墙
临时关闭:systemctl stop firewalld.service
查看防火墙状态:firewall-cmd --state
永久关闭:systemctl disable firewalld.service
安装环境
1、安装apache
yum install -y httpd
httpd服务添加开机启动
systemctl enable httpd.service
启动httpd服务
systemctl startus httpd.service
2、安装mariadb
yum install -y mariadb mariadb-server
设置开机启动
systemctl enable mariadb.service
运行服务
systemctl start mariadb.service
systemctl status mariadb.service
查看安装是否成功
命令:mysql
3、安装PHP环境
yum install -y php php-mysql
4、下载并安装zabbix 3.4
下载安装包
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
安装zabbix
yum install -y zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender
5、创建zabbix库,设置字符编码为utf8
mysql
create database zabbix character set utf8 collate utf8_bin;
show databases;
创建授权账号密码(账号:zabbix 密码:zabbix)
grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix’;
刷新
flush privileges;
6、导入表
cd /usr/share/doc/zabbix-server-mysql-3.4.15/
ls
gunzip create.sql.gz
mysql
use zabbix;
source create.sql
6、配置zabbix server
cd /etc/zabbix/
备份配置文件
cp zabbix_server.conf zabbix_server.conf.bak
编辑配置文件
vi zabbix_server.conf
zabbix-server服务添加开机启动,并运行服务
7、配置PHP
cd /etc/httpd/conf.d
修改时区
vi zabbix.conf
重启httpd
systemctl restart httpd.service
8、登陆zabbix网址,完成前端配置
密码为数据库设置的密码,zabbix
9、语言配置
10、中文乱码?
解决办法:
将windows中的字体:如简体,上传到linux务器中;
原服务器字体备份
新字体改名为graphfont.ttf
链接:https://blog.csdn.net/yuexingbai/article/details/100551796
安装zabbix-agent并配置
1、安装zabbix-agent # 已安装
yum -y install zabbix-agent
2、备份并修改配置文件
mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.bak ##备份配置文件
cat /etc/zabbix/zabbix_agentd.conf.bak | egrep -v ‘^$|#’> /etc/zabbix/zabbix_agentd.conf ##过滤空白行与注释
4、启动zabbix-agentd
systemctl start zabbix-agent.service ##启动zabbix-agent.service
systemctl status zabbix-agent.service ##检查zabbix-agent.service状态
systemctl enable zabbix-agent.service ##添加开机启动