安装Zabbix服务端
1、zabbix的安装,可以采用yum安装,也可以选择从官网(www.zabbix.com/download)下载,但是yum下载的版本最多是2.2版,且需要epel的源。这里采用wget从官网下载并安装。
# 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)
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
# 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... #################################
Updating / installing...
1:zabbix-release-3.4-2.el7 #################################
# 2、安装服务,包含php和httpd。
# yum install -y zabbix-agent zabbix-get zabbix-server-mysql zabbix-web zabbix-web-mysql 3、安装mysql,可以采用yum安装,也可以编译安装。
这里采用yum安装。
# yum install -y mysql-server mysql-devel
# systemctl start mysqld
# ps aux| grep mysql
root 144380.00.0 112652 968 pts/0 S+ 21:00 0:00 grep --color=auto mysql
root 820800.00.0 1132561580 ? S 2017 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/plinuxos.pid
mysql 822130.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
# vim /etc/my.cnf
......
character_set_server = utf8 ##增加改行,防止乱码
......
# systemctl restart mysqld
# /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、导入自带数据库
# cd /usr/share/doc/zabbix-server-mysql-3.4.5/
AUTHORSChangeLogCOPYINGcreate.sql.gzNEWSREADME
# gzip -d create.sql.gz
# export PATH=$PATH:/usr/local/mysql/bin/
# mysql -uroot zabbix < create.sql 6、启动zabbix-server和httpd
# systemctl start zabbix-server
# systemctl start httpd 7、查看zabbix日志
# less /var/log/zabbix/zabbix_server.log 8、配置zabbix
# vim /etc/zabbix/zabbix_server.conf
……
DBHost=127.0.0.1 ##增加DBHost
……
DBPassword=juispan ##增加口令
……
# systemctl restart zabbix-server 9、打开游览器输入IP/zabbix自动跳转主页
http://s1.运维网.com/images/20180113/1515855283421891.png
http://s1.运维网.com/images/20180113/1515855290828607.png
http://s1.运维网.com/images/20180113/1515855295849963.png
http://s1.运维网.com/images/20180113/1515855302147912.png
http://s1.运维网.com/images/20180113/1515855308263698.png
10、安装完成登录系统
http://s1.运维网.com/images/20180113/1515855314720178.png
页:
[1]