Zabbix安裝部署
zabbix監控內容:
zabbix-server安裝部署
1.關閉selinux和firewall
#vim /etc/selinux/config #將SELINUX=enforcing改為SELINUX=disabled #或使用: #sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config #getenforce #Disabled 為關閉(臨時關閉) #setenforce 0 #設定SELinux 成為enforcing模式(永久關閉) #systemctl stop firewalld.service 停止防火牆 #systemctl disable firewalld.service禁止firewall開機啟動
2.更改yum源為阿里源
#yum install wget -y #rm -rf /etc/yum.repos.d/* #wget -O /etc/yum.repos.d/Centos_Base.repo #wget -O /etc/yum.repos.d/epel-7 #yum clean all 清空快取 #yum makecache 生成快取
3.安裝httpd
#yum install httpd -y #systemctl start httpd #systemctl status httpd #systemctl enable httpd
4.安裝php
#yum install php -y 重啟apache服務 #systemctl restart httpd #vim /var/www/html/hell.php 檢視php是否安裝成功 < h1>hello world</h1> < h1>hi</h1> this is a....
5.安裝mysql–yum安裝
#rpm -qa|grep mysql 檢視之前安裝的mysq #rpm -e xxxx 解除安裝所有mysql服務 #yum list installed | grep mysql 也可嘗試使用yum命令解除安裝舊版本 #yum remove mysql #find / -name mysql 檢視殘留mysql檔案 #rm -rf 檔案
#wget 下載到當前路徑,下載完成可以在當前目錄檢視到 #rpm -ivh mysql80-community-release-el7-4.noarch.rpm #yum repolist enable|grep mysql 檢視mysql的yum源是否安裝成功 #yum install mysql-server -y
#systemctl start mysqld #systemctl status mysqld #systemctl enable mysqld
mysql>alter user user() identified by 'abCD@1234';
#yum -y install php-mysql 將php和mysql關聯 #yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel 安裝常用的php模組 #systemctl restart httpd 重啟apache服務
6.安裝部署zabbix環境
#rpm -Uvh
[root@localhost ~]# ls /etc/yum.repos.d/ Centos-L.repo.bak CentOS-x86_64-kernel.repo CentOS-Media.repo.bak zabbix.repo
[root@localhost ~]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix Official Repository - $basearch baseurl= enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[root@localhost ~]# sed -i 's#
#yum clean all #yum makecache
[root@localhost ~]# yum -y install zabbix-server-mysql zabbix-agent
[root@localhost ~]# vim /etc/yum.repos.d/zabbix.repo
[root@localhost ~]# yum -y install centos-release-scl
[root@localhost ~]# yum -y install zabbix-web-mysql-scl zabbix-apache-conf-scl
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'abCD@1234';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> flush privileges; mysql>exit
[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql-*/create.sql.gz | mysql -uzabbix -p zabbix Enter password:輸入資料庫root密碼
[root@localhost ~]# mysql -uroot -pabCD@1234 mysql> use zabbix; mysql> show tables; #檢視庫內的表
[root@localhost ~]# vim /etc/zabbix/zabbix_server.conf
[root@localhost ~]# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
啟動zabbix:
#tailf /var/log/zabbix/zabbix_server.log
mysql>ALTER USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY 'zabbix'; #systemctl restart zabbix-server
#yum -y install wqy-microhei-fonts
#alias #系統預設的別名cp=cp -i,在cp前加\就可以還原命令的本意 alias cp='cp -i'
#\cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
zabbix-agent安裝部署
#yum -y install ntpdate #ntpdate -u ntp.aliyun.com #同步時間: #mv /etc/localtime{,.bak} #ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #時區統一: sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config systemctl disable --now firewalld getenforce #檢視防火牆狀態 setenforce 0 #更改防火牆狀態 iptables -L #檢視iptables規則 #關閉防火牆:
rpm -Uvh
[root@localhost ~]# ls /etc/yum.repos.d/ Centos-L.repo.bak CentOS-x86_64-kernel.repo CentOS-Media.repo.bak zabbix.repo
[root@localhost ~]# vim /etc/yum.repos.d/zabbix.repo
[root@localhost ~]# sed -i 's#
#yum clean all #yum makecache
#yum -y install zabbix-agent2
#systemctl enable --now zabbix-agent2 [root@c4-node3 ~]# netstat -tpln | grep zabbix #檢查埠是否被啟用(安裝net-tools) tcp6 0 0 :::10050 :::* LISTEN 3327/zabbix_agent2
#grep -Ev '^#|^$' /etc/zabbix/zabbix_agent2.conf #過濾註釋行和空行 PidFile=/var/run/zabbix/zabbix_agent2.pid #pid檔案 LogFile=/var/log/zabbix/zabbix_agent2.log #日誌檔案 LogFileSize=0 #日誌大小,預設0無限制 Server=192.168.86.148 #服務端地址(server地址,這裡改為130) ServerActive=192.168.86.148 #改為服務端地址 Hostname=zabbix_server #建議改為機器的主機名 Include=/etc/zabbix/zabbix_agent2.d/*.conf #使用Include語法,“.d”目錄裡面所有以.conf結尾的檔案都會被識別為配置檔案 ControlSocket=/tmp/agent.sock
systemctl restart zabbix-agent2
#yum -y install zabbix-get #安裝工具 #zabbix_get -s '192.168.86.131' -p 10050 -k 'system.hostname' #-s地址(zabbix_agent地址),-p埠,-k命令 zabbix_agent #收集到了主機名連線成功
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70003733/viewspace-2850912/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Zabbix監控安裝部署
- zabbix5.0的安裝部署
- 【ZABBIX】Linux下安裝ZABBIXLinux
- zabbix安裝agent
- apt安裝zabbixAPT
- Zabbix Agent安裝
- zabbix的安裝配置
- 編譯安裝zabbix編譯
- zabbix5.0安裝
- 【監控】Zabbix安裝
- Ubuntu安裝zabbix配置教程Ubuntu
- centos8 安裝zabbixCentOS
- zabbix安裝中文環境
- Zabbix 的容器版安裝
- Centos7-安裝ZabbixCentOS
- Zabbix Agent 安裝與使用
- Zabbix安裝部署(國內源映象)----一次性解決centos7安裝zabbix報錯:[Errno 256] 的問題CentOS
- Zabbix 簡介與yum安裝
- centos7安裝zabbix 5.0CentOS
- Zabbix安裝實驗報告
- Docker映像的Zabbix元件安裝Docker元件
- zabbix agent 的兩種安裝方式
- CentOS 7 原始碼安裝 Zabbix 6.0CentOS原始碼
- Linux下Zabbix5.0 LTS監控基礎原理及安裝部署(圖文教程)Linux
- zabbix3.4原始碼安裝步驟原始碼
- 原始碼安裝和配置zabbix 3.0 LST原始碼
- Linux安裝部署Linux
- ELK安裝部署
- chromedriver安裝部署Chrome
- canal安裝部署
- SQOOP安裝部署OOP
- keepalived 安裝部署
- Hadoop安裝部署Hadoop
- Doris安裝部署
- NH.A.0002__zabbix_lamp+zabbix_server原始碼編譯安裝_V2020.10.22LAMPServer原始碼編譯
- centos7安裝zabbix3.2詳解CentOS
- Centos7安裝安裝部署dockerCentOSDocker
- ElasticSearch + Kibana 安裝部署Elasticsearch