安装zabbix-server 3.4
本文以centos 7
为例。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18systemctl stop firewalld.service #关闭防火墙
systemctl disable firewalld.service #开机不启动防火墙
setenforce 0 #清空selinux的配置
yum install mariadb-server mariadb –y
systemctl enable mariadb #设置开机启动
systemctl start mariadb #启动MariaDB
rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.5-1.el7.x86_64.rpm
yum install zabbix-server-mysql zabbix-web-mysql -y
zcat /usr/share/doc/zabbix-server-mysql-3.4.9/create.sql.gz |mysql -uzabbix -pzabbix zabbix #这里是设定zabbix数据库账号密码和database的地方,create.sql.gz这个文件位置要根据实际情况来
vim /etc/httpd/conf.d/zabbix.conf #这里要修改文件里的时区,改成Asia/Shanghai
systemctl start zabbix-server
systemctl enable zabbix-server
setsebool -P httpd_can_connect_zabbix on
setsebool -P httpd_can_cetwork_connect_db on
systemctl start httpd
systemctl enable httpd
chkconfig zabbix_agent on
systemctl start zabbix-agent
然后就是在浏览器输入外网IP/zabbix/
进行页面安装了,剩下的就不多写了。
如果打开WEB网页是如下的样子:
请检查php-fpm的版本。
安装zabbix-agent 4.0
如果是centos 6
:
1
2
3rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-2.el6.noarch.rpm
yum install -y zabbix-agent
chkconfig zabbix-agent on;service zabbix-agent start #如果不对就使使zabbix_agent
如果是centos 7
:
1
2
3rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
yum install -y zabbix-agent
chkconfig zabbix-agent on;service zabbix-agent start #如果不对就使使zabbix_agent
安装Graphtree
虽然官方说Graphtree只维护到3.2版本,但是经过我测试3.4依旧可用。安装方法如下:
1
2
3
4
5首先进入到zabbix的html页面的文件夹
yum install patch -y
wget https://raw.githubusercontent.com/OneOaaS/graphtrees/master/graphtree3.0.4.patch
patch -Np0 <graphtree3.0.4.patch
chown -R apache.apache oneoaas #如果是nginx,那就是www.www
刷新一下zabbix-server即可发现Monitoring下面多了一个Graphtree,如图:
点击即可查看。
其他资料
https://www.kaijia.me/2014/11/zabbix-report-lack-of-free-swap-space-issue-on-server-without-swap-solved/
https://blog.csdn.net/sinat_15955423/article/details/76685878 (centos6.x安装php5.6+gd库+bcmath库)
https://www.sundayle.com/zabbix-monitor/