創作內容

0 GP

利用CentOS7 架設 Zabbix

作者:噗嚨共│2020-08-16 21:31:45│巴幣:0│人氣:1119
基礎設置CentOS 7 如不用此設定也可但安裝畫面可能會點不一樣,一些會用到的東西就先裝了。

安裝完成後先安裝openssh-sever以利後續利用Xshell或PuTTY操作
#yum -y install openssh-sever   //安裝openssh
#vim /etc/ssh/ssh_config //開啟設定檔

需修改的部分如上所示 完成後利用Xshell或PuTTY連入比較方便複製指令唷

Zabbix安裝與部署(現在才正式開始唷

Step 1 – Disable SELinux


#setenforce 0        //暫時關閉防火牆
#vi /etc/selinux/config   //進入防火牆設定
#systemctl stop firewalld.service       //臨時關閉防火牆
#systemctl disable firewalld.service  //永久關閉防火牆

Step 2 – install apache


#yum install -y httpd //安裝apache
#systemctl enable httpd //httpd服務開機進行自啟
#systemctl start httpd //啟動httpd服務

Step 3 – install mariadb


#yum install -y mariadbmariadb-server //安裝mariadb
#systemctl enable mariadb //mariadb服務開機進行自啟
#systemctl start mariadb //啟動mariadb服務
#systemctl status mariadb.service //檢查mariadb服務是否正常安裝

Step 3 – install PHP


#yum install -y php php-mysql //安裝php環境

Step 4 – install zabbix


//安裝版本為4.2zabbix如需其他版本請去官網查詢下載網址
#yum install -y zabbix-server-mysqlzabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender
//安裝zabbix
#mysql
//進入mariadb
MariaDB [(none)]>create databasezabbix character set utf8 collate utf8_bin;
//創一個zabbix資料庫並設置為utf8的字符編碼格式
MariaDB [(none)]>grant allprivileges on zabbix.* to zabbix@localhost identified by '你localhost密碼';
//創建帳號並且授權設置密碼
MariaDB [(none)]>grant allprivileges on zabbix.* to zabbix@'%' identified by '你的密碼';
//創建帳號並且授權設置密碼
MariaDB [(none)]>flush privileges;
//刷新
MariaDB [(none)]>exit
# cd/usr/share/doc/zabbix-server-mysql-4.2.8/ //到-按tab讓他自動搜尋
[root@localhostzabbix-server-mysql-4.2.8]#pwd
[root@localhostzabbix-server-mysql-4.2.8]#ls
[root@localhostzabbix-server-mysql-4.2.8]# gunzip create.sql.gz
[root@localhostzabbix-server-mysql-4.2.8]#ls
[root@localhostzabbix-server-mysql-4.2.8]#mysql
MariaDB [(none)]>use zabbix;
MariaDB [zabbix]>source create.sql
#vi /etc/zabbix/zabbix_server.conf
找到以下值將其鍵入
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=你的密碼
DBSocket=/var/lib/mysql/mysql.sock
完成後輸入:wq 儲存後離開
#systemctl start zabbix-server.service
#systemctl enablezabbix-server.service
#systemctl startzabbix-agent.serveice
#systemctl enablezabbix-agent.serveice

Step 5 – Set time zone


#cd /etc/httpd/conf.d
# vi zabbix.conf

如上鍵入php_value date.timezoneAsia/Taipei
#systemctl restart httpd //重啟httpd

Step 6 – 網頁安裝zabbix


開啟網頁輸入你的ip/zabbix //進行zabbix安裝
輸入剛剛設定的密碼
設定zabbix server細節
完成安裝
登入username是Admin Password是zabbix


最近朋友詢問如何架Zabbix於是把一年前,自己架設的過程分享出來 。
(與現在最新版本目前是5.0可能有點不同,如果遇到架設困難可再自行Google,過來人的經驗如遇到問題請都用全英文查詢)
PS.不是很會排版如有傷眼不好意思啦
引用網址:https://home.gamer.com.tw/TrackBack.php?sn=4884690
All rights reserved. 版權所有,保留一切權利

相關創作

留言共 0 篇留言

我要留言提醒:您尚未登入,請先登入再留言

喜歡★asdfg1122we 可決定是否刪除您的留言,請勿發表違反站規文字。

追蹤私訊切換新版閱覽

作品資料夾

pjfl20180818空氣
BOB看更多我要大聲說1小時前


face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】