安装Zabbix服务端

1、zabbix的安装,可以采用yum安装,也可以选择从官网(www.zabbix.com/download)下载,但是yum下载的版本最多是2.2版,且需要epel的源。

这里采用wget从官网下载并安装。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root@plinuxos src] # wget http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
--2018-01-13 20:29:34--  http: //repo .zabbix.com /zabbix/3 .4 /rhel/7/x86_64/zabbix-release-3 .4-2.el7.noarch.rpm
Resolving repo.zabbix.com (repo.zabbix.com)... 162.243.159.138
Connecting to repo.zabbix.com (repo.zabbix.com)|162.243.159.138|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13572 (13K) [application /x-redhat-package-manager ]
Saving to: ‘zabbix-release-3.4-2.el7.noarch.rpm’
 
100%[====================>] 13,572      9.98KB /s    in  1.3s   
 
2018-01-13 20:29:36 (9.98 KB /s ) - ‘zabbix-release-3.4-2.el7.noarch.rpm’ saved [13572 /13572 ]
 
[root@plinuxos src] # rpm -ivh zabbix-release-3.4-2.el7.noarch.rpm 
warning: zabbix-release-3.4-2.el7.noarch.rpm: Header V4 RSA /SHA512  Signature, key ID a14fe591: NOKEY
Preparing...                           ################################# [100%]
Updating / installing...
    1:zabbix-release-3.4-2.el7          ################################# [100%]
[root@plinuxos src] #

2、安装服务,包含php和httpd。

1
[root@plinuxos src] # yum install -y zabbix-agent zabbix-get zabbix-server-mysql zabbix-web zabbix-web-mysql

3、安装mysql,可以采用yum安装,也可以编译安装。

这里采用yum安装。

1
2
3
4
5
6
[root@plinuxos src] # yum install -y mysql-server mysql-devel
[root@plinuxos src] # systemctl start mysqld
[root@plinuxos src] # ps aux| grep mysql
root      14438  0.0  0.0 112652   968 pts /0     S+   21:00   0:00  grep  --color=auto mysql
root      82080  0.0  0.0 113256  1580 ?        S     2017   0:00  /bin/sh  /usr/local/mysql/bin/mysqld_safe  --datadir= /data/mysql  --pid- file = /data/mysql/plinuxos .pid
mysql     82213  0.1 14.1 1784592 471176 ?      Sl    2017 248:15  /usr/local/mysql/bin/mysqld  --basedir= /usr/local/mysql  --datadir= /data/mysql  --plugin- dir = /usr/local/mysql/lib/plugin  --user=mysql --log-error= /data/mysql/plinuxos .err --pid- file = /data/mysql/plinuxos .pid

4、配置mysql

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[root@plinuxos src] # vim /etc/my.cnf
......
character_set_server = utf8    ##增加改行,防止乱码
......
[root@plinuxos src] # systemctl restart mysqld
[root@plinuxos src] # /usr/local/mysql/bin/mysql -uroot      ##进入mysql配置zabbix库
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection  id  is 72
Server version: 5.6.35-log MySQL Community Server (GPL)
 
Copyright (c) 2000, 2016, Oracle and /or  its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and /or  its
affiliates. Other names may be trademarks of their respective
owners.
 
Type  'help;'  or  '\h'  for  help. Type  '\c'  to  clear  the current input statement.
 
mysql> create database zabbix character  set  utf8;
Query OK, 1 row affected (0.00 sec)
 
mysql> grant all on zabbix.* to  'zabbix' @ '127.0.0.1'  identified by  'juispan' ;
Query OK, 0 rows affected (0.00 sec)
 
mysql> quit;
Bye

5、导入自带数据库

1
2
3
4
5
[root@plinuxos src] # cd /usr/share/doc/zabbix-server-mysql-3.4.5/
AUTHORS  ChangeLog  COPYING  create.sql.gz  NEWS  README
[root@plinuxos zabbix-server-mysql-3.4.5] # gzip -d create.sql.gz
[root@plinuxos zabbix-server-mysql-3.4.5] # export PATH=$PATH:/usr/local/mysql/bin/
[root@plinuxos zabbix-server-mysql-3.4.5] # mysql -uroot zabbix < create.sql

6、启动zabbix-server和httpd

1
2
[root@plinuxos ~] # systemctl start zabbix-server
[root@plinuxos ~] # systemctl start httpd

7、查看zabbix日志

1
[root@plinuxos ~] # less /var/log/zabbix/zabbix_server.log

8、配置zabbix

1
2
3
4
5
6
7
[root@plinuxos ~] # vim /etc/zabbix/zabbix_server.conf 
……
DBHost=127.0.0.1         ##增加DBHost
……
DBPassword=juispan       ##增加口令
……
[root@plinuxos ~] # systemctl restart zabbix-server

9、打开游览器输入IP/zabbix自动跳转主页

1.png

2.png

3.png

4.png

5.png

10、安装完成登录系统

6.png









本文转自Grodd51CTO博客,原文链接:http://blog.51cto.com/juispan/2060683,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值