CentOS 7上搭建Zabbix4.0
? 開源Linux
一個執(zhí)著于技術(shù)的公眾號

zabbix介紹
Zabbix 是一個基于 WEB 界面的提供分布式系統(tǒng)監(jiān)視以及網(wǎng)絡(luò)監(jiān)視功能的企業(yè)級的開源解決方案。它能監(jiān)視各種網(wǎng)絡(luò)參數(shù),保證服務(wù)器系統(tǒng)的安全運營;并提供靈活的通知機制以讓系統(tǒng)管理員快速定位/解決存在的各種問題。
zabbix軟件組成
zabbix-server: 監(jiān)控服務(wù)端
zabbix-agent: 監(jiān)控客戶端
zabbix-web: 監(jiān)控網(wǎng)站服務(wù)
php: 處理動態(tài)請求
mysql: 數(shù)據(jù)庫存儲監(jiān)控數(shù)據(jù)
zabbix: 負責收集agent信息匯總告知zabbix-server
1.關(guān)閉防火墻和selinux
[][][]
2.添加zabbix源和epel源
[][]
3.安裝zabbix和相關(guān)服務(wù)組件
[][][]
4.修改zabbix配置文件
[][]
5.配置數(shù)據(jù)庫服務(wù)
~]# systemctl start mariadb #啟動數(shù)據(jù)庫~]# mysql_secure_installation ##初始化數(shù)據(jù)庫NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the currentpassword for the root user. If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none):successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.Set root password? [Y/n] yNew password:new password:Password updated successfully!Reloading privilege tables..Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forThis is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n] ySuccess!root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] ySuccess!By default, MariaDB comes with a database named 'test' that anyone canThis is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] nskipping.Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.Reload privilege tables now? [Y/n] ySuccess!Cleaning up...All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB!~]# mysql -uroot -p ##登錄數(shù)據(jù)庫Enter password:Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 8Server version: 5.5.65-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; ##創(chuàng)建zabbix數(shù)據(jù)庫Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; ##創(chuàng)建數(shù)據(jù)庫管理用戶Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> quitBye~]# zcat /usr/share/doc/zabbix-server-mysql-4.0.20/create.sql.gz | mysql -uzabbix -pzabbix zabbix ##將數(shù)據(jù)表寫入到zabbix庫中
6.啟動zabbix和相關(guān)服務(wù)
[root@zabbix ~]# systemctl start zabbix-server.service httpd mariadb.service[root@zabbix ~]# systemctl enable zabbix-server.service httpd mariadb.serviceCreated symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
7.登錄zabbix的web界面,進行初始化
初始化地址http://172.16.210.56/zabbix/setup.php

點擊Next step

檢查php的一些變量條件,如果沒有報錯的信息可以點擊next step

填寫好對應(yīng)的數(shù)據(jù)庫密碼和帳號點擊Next step

設(shè)置主機和端口還有監(jiān)控頁面名字,然后點擊Next step

確認信息.然后點擊Next step

點擊Finish

帳號Admin 密碼zabbix ,再點Sign in

登錄成功。
8.更改zabbix界面語言為中文
點擊右上角的小人

選擇Chinese

再點擊update

更改成功!
鏈接:https://www.jianshu.com/p/7d798423ec58 作者:南南宮問天
關(guān)注「開源Linux」加星標,提升IT技能
好文章,分享、點贊、在看三連哦??↓↓↓
評論
圖片
表情
