iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 1
1
自我挑戰組

成長型維運平台 - 單人新手到多人團隊都適用的工具系列 第 1

1-1.監控工具之一:Zabbix Server

建議參考書籍:下世代超前佈署:用 Zabbix 全面監管巨量伺服器
https://www.tenlong.com.tw/products/9789865501471

https://ithelp.ithome.com.tw/upload/images/20201224/20077752bkLhz9ErSt.jpg

說到監控,最基本就是看看CPU、Memory等基本狀態,再來Ping一下目的看網路有沒有通,因此第一步先找尋能幫助我們做這些工作的工具。

選工具的方式很簡單,第一先去看該類商用工具,第二查相同類型是否有opensoft工具。

需求
(功能面)
基本監控,能顯示圖表
(擴充面)
有API接口,能夠建立Cluster

這裡我選擇使用Zabbix搭配Grafana(產生儀錶板)

架設:
快速的方式可選擇(.vmdk)或(.iso)直接試玩 https://www.zabbix.com/download

以下作業系統CentOS7依照Documentation架設
https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages/rhel_centos

#selinux關掉

vi /etc/selinux/config
config>SELINUX=disabled
reboot

#安裝apache , mysql

yum -y install httpd mariadb*
systemctl enable mariadb
systemctl restart mariadb

#安裝Zabbix Server (2018/2/1)

rpm -ivh http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm
yum -y update
yum -y install zabbix-server-mysql zabbix-agent zabbix-web-mysql

安裝功能相依插件

yum -y install php-bcmath php-mbstring php-xml curl curl-devel net-snmp net-snmp-devel  net-snmp-utils perl-DBI

#設定Zabbix SQL (mysql>別複製,代表在SQL下的指令,'zabbix'DB密碼可自行修改,zcat後面路徑不同系統可能路徑不同,Enter password:輸入DB密碼)

mysql
mysql>create database zabbix character set utf8 collate utf8_bin;
mysql>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql>quit;
zcat /usr/share/doc/zabbix-server*/create.sql.gz | mysql -uzabbix -p zabbix

sql安全(選擇性)

mysql_secure_installation

#設定Zabbix Server (zabbix_server.conf>不要複製,DBPassword改成之前設定的)

vi /etc/zabbix/zabbix_server.conf
zabbix_server.conf>DBPassword=zabbix

#設定時區(zabbix.conf>不要複製)

vi /etc/httpd/conf.d/zabbix.conf
zabbix.conf>php_value date.timezone asia/taipei

#firewall(10050,10051 Zabbix Agent的服務port, 80網頁)

firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
systemctl restart firewalld

#服務全部重啟及設定開機啟動

systemctl restart zabbix-agent
systemctl enable zabbix-agent
systemctl restart zabbix-server
systemctl enable zabbix-server
systemctl restart mariadb
systemctl enable mariadb
systemctl restart httpd
systemctl enable httpd

#補充mysql建失敗重作

show databases;
drop database zabbix;

#補充刪除rpm,版本升級時需要,

rpm -qa |grep zabbix
yum remove 檔名
vi /etc/yum.repos.d/zabbix.repo

Zabbix儀錶板,美觀方面可以接grafana,後面會介紹。特別好用功能為Maps功能,方便做故障排查用
架構圖

Linux 指令可參考
https://ithelp.ithome.com.tw/articles/10077313

一些zabbix介紹
Google Cloud Platform monitoring with Zabbix
https://www.slideshare.net/maxkuzkin/google-cloud-platform-monitoring-with-zabbix

Zabbixとjob scheduler連携による運用システムoss化の実現
https://www.slideshare.net/ikedai/zabbixjob-scheduleross


下一篇
1-2.監控工具之一:Zabbix Proxy
系列文
成長型維運平台 - 單人新手到多人團隊都適用的工具27
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

0
to790303
iT邦新手 5 級 ‧ 2019-10-18 20:24:48

你好,請問我在架設zabbix 4.0的時候會遇到無法安裝zabbix-web-mysql的問題,請問這是怎麼一回事呢?
https://ppt.cc/fgXLkx

VM配置如下
linux cetos 7
apache:2.4.6
mysql:5.7.28
phh:7.2.23

我要留言

立即登入留言