zabbix在linux下的安裝
在安裝之前需要安裝mariadb資料庫:
然後
- create database zabbix character set utf8 collate utf8_bin;
- grant all privileges on zabbix.* to [email protected] identified by ‘zabbix’;
- grant all privileges on zabbix.* to [email protected] identified by ‘zabbix’;
下載zabbix
-
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent
-
資料庫配置:
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
4.開啟zabbix伺服器程序
systemctl enable zabbix-server
出現:Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
[[email protected] ~]# systemctl start zabbix-server
[[email protected] ~]# systemctl status zabbix-server
5.編輯zabbix前端php配置
vi /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
6.改變配置檔案後,啟動Apache Web伺服器
system stop firewalld
setenforce 0
systemctl start httpd
systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
7.配置zabbix web
如果這裡沒有顯示,就直接next:
在到了登入介面是,預設使用者名稱/密碼為Admin/zabbix 8.配置客戶端
1.匯入源
2.安裝客戶端
yum install zabbix-agent
3.配置客戶端
vi /etc/zabbix/zabbix_agentd.conf
修改此檔案中的下面三個值
Server=192.168.92.8 //安裝zabbix服務端的機器的IP
ServerActive=192.168.92.8 //安裝zabbix服務端的機器的IP Hostname=192.168.92.9 //被監控的機器的ip作為Hostname
4.開啟agent
關閉 防火牆 stop firewalld.service
關閉SELinux setenforce 0
systemctl start zabbix-agent
9.管理被監控的機器:
1、進入UI介面—>配置—>主機–>建立主機 2、進入下面編輯頁面 ip地址一定要填寫正確,
3、填寫完上面的主機資訊以後,要選擇一個模板
點選選擇以後 在彈出的選擇列表中選擇Template OS Linux
選擇完模板以後,首先點選模板頁面中那個比較小一點的“新增(add)”,然後在點選那個大一點的新增!
下面看監控的效果圖形