安裝Zabbix服務端
阿新 • • 發佈:2018-01-14
for zabb emc dha path proc oracle file rest 1、zabbix的安裝,可以采用yum安裝,也可以選擇從官網(www.zabbix.com/download)下載,但是yum下載的版本最多是2.2版,且需要epel的源。
這裏采用wget從官網下載並安裝。
[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。
[root@plinuxos src]# yum install -y zabbix-agent zabbix-get zabbix-server-mysql zabbix-web zabbix-web-mysql
3、安裝mysql,可以采用yum安裝,也可以編譯安裝。
這裏采用yum安裝。
[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
[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、導入自帶數據庫
[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
[root@plinuxos ~]# systemctl start zabbix-server [root@plinuxos ~]# systemctl start httpd
7、查看zabbix日誌
[root@plinuxos ~]# less /var/log/zabbix/zabbix_server.log
8、配置zabbix
[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自動跳轉主頁
10、安裝完成登錄系統
安裝Zabbix服務端