一、系統環境
cat /etc/redhat-release
centos linux release 7.3.1611 (core)
關閉防火墻及selinux
1
2
3
4
5
|
systemctl stop firewalld.service systemctl disable firewalld.service sed -i 's/selinux=enforcing/selinux=disabled/' /etc/selinux/config grep selinux=disabled /etc/selinux/config setenforce 0 |
二、數據庫安裝及配置
1、mariadb概述
mariadb數據庫管理系統是mysql的一個分支,主要由開源社區在維護,采用gpl授權許可。
開發這個分支的原因是:甲骨文公司收購了mysql后,有將mysql閉源的潛在風險,因此社區采用分支的方式來避開這個風險。
mariadb的目的是完全兼容mysql,包括api和命令行,使之能輕松成為mysql的代替品。
2、安裝mariadb
1
|
yum install mariadb-server mariadb -y |
mariadb數據庫的相關命令是:
1
2
3
4
|
systemctl start mariadb #啟動mariadb systemctl stop mariadb #停止mariadb systemctl restart mariadb #重啟mariadb systemctl enable mariadb #設置開機啟動 |
三、zabbix3.4安裝及配置
1、zabbix3.4新功能概述
- remote command support through proxies
- parallel processing of alerts
- being notified on problem acknowledgement
- item value preprocessing
- configurable jmx endpoints
- jmx low-level discovery
- pcre library for regular expressions
- url-encoding support in web monitoring
- support of macros and time suffixes in time periods
- host macro support in event tags
- frontend improvements
- daemon improvements
- item changes/improvements
- low-level discovery
- return code check for scripts and commands
zabbixe中文文檔
2、zabbix3.4安裝
1
2
|
rpm -ivh http: //repo .zabbix.com /zabbix/3 .4 /rhel/7/x86_64/zabbix-release-3 .4-1.el7.centos.noarch.rpm yum install zabbix-server-mysql zabbix-web-mysql -y |
3、創建數據庫
1
2
|
create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix' ; |
4、導入數據
zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -uzabbix -pzabbix zabbix
5、配置數據庫用戶及密碼
1
2
3
4
5
6
7
8
9
10
11
12
|
grep -n '^'[a-z] /etc/zabbix/zabbix_server.conf 38:logfile=/var/log/zabbix/zabbix_server.log 49:logfilesize=0 72:pidfile=/var/run/zabbix/zabbix_server.pid 99:dbname=zabbix 115:dbuser=zabbix 123:dbpassword=zabbix 314:snmptrapperfile=/var/log/snmptrap/snmptrap.log 432:timeout=4 474:alertscriptspath=/usr/lib/zabbix/alertscripts 484:externalscripts=/usr/lib/zabbix/externalscripts 520:logslowqueries=3000 |
6、啟動zabbix server并設置開機啟動
1
2
|
systemctl enable zabbix-server systemctl start zabbix-server |
7、編輯zabbix前端php配置,更改時區
1
2
|
vim /etc/httpd/conf .d /zabbix .conf php_value date .timezone asia /shanghai |
8、selinux配置
1
2
|
setsebool -p httpd_can_connect_zabbix on setsebool -p httpd_can_network_connect_db on |
9、啟動httpd并設置開機啟動
1
2
|
systemctl start httpd systemctl enable httpd |
四、安裝zabbix web
1、瀏覽器訪問,并進行安裝http://172.16.8.254/zabbix/
2、點擊next會出現檢查狀態
3、檢查系統環境設置,必須全部都為ok,才能繼續
4、輸入連接到數據庫詳細信息。zabbix數據庫必須已經創建好
5、連接zabbix服務細節,如果沒有改變可選擇默認
7、完成安裝,會將在/etc/zabbix/web/zabbix.conf.php生成配置文件
1
2
|
congratulations! you have successfully installed zabbix frontend. configuration file "/etc/zabbix/web/zabbix.conf.php" created. |
8、登錄最新版zabbix3.4 默認用戶admin 默認密碼zabbix
五、zabbxi-agent安裝及配置
1、安裝zabbxi-agent
1
|
yum install zabbix-agent -y |
2、配置zabbxi-agent
1
2
3
4
5
6
7
8
|
grep -n '^'[a-z] /etc/zabbix/zabbix_agentd.conf 13:pidfile=/var/run/zabbix/zabbix_agentd.pid 32:logfile=/var/log/zabbix/zabbix_agentd.log 43:logfilesize=0 97:server=172.16.8.254 138:serveractive=172.16.8.254 149:hostname=zabbix server 267:include=/etc/zabbix/zabbix_agentd.d/*.conf |
3、啟動zabbxi-agent并設置開機啟動
1
2
|
systemctl enable zabbix-agent.service systemctl restart zabbix-agent.service |
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。
原文鏈接:http://blog.csdn.net/xiegh2014/article/details/77571965