本文小編為大家詳細(xì)介紹“centos下怎么安裝zabbix”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“centos下怎么安裝zabbix”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學(xué)習(xí)新知識吧。
centos-dvd1版本系統(tǒng)固定ip地址是192.168.159.128 ,centos-mininal 版本系統(tǒng) 地址是192.168.1.* 或者192.168.2.*網(wǎng)段
zabbix2.4安裝(centos6.5)
zabbix有自帶的yum源,lnmp可以去 下載自行安裝
第一步 安裝zabbix官方的zabbix源,地址如下:
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
第二步 使用yum安裝的方法自動(dòng)安裝zabbix的服務(wù)端和agent等相關(guān)的rpm包
yum install -y mysql mysql-server zabbix-server-mysql zabbix-web-mysql zabbix-agent
zabbix-get:這個(gè)命令主要獲取監(jiān)控?cái)?shù)據(jù)的命令。安裝成功以后,需要在 mysql里面創(chuàng)建一個(gè)zabbix 數(shù)據(jù)庫和用戶。
進(jìn)入數(shù)據(jù)庫失敗,查看mysqld服務(wù)沒有啟動(dòng),對其啟動(dòng)即可!
啟動(dòng)mysql 數(shù)據(jù)庫服務(wù): /etc/init.d/mysqld start
進(jìn)入數(shù)據(jù)庫:mysql -uroot
*****************************************************************************************************************
格式:grant 權(quán)限 on 數(shù)據(jù)庫名.表名 to 用戶@登錄主機(jī) identified by "用戶密碼";
grant all privileges on *.* to zabbixuser@"%" identified by "xxx"; flush privileges;
*******************************************************************************************************************************
創(chuàng)建數(shù)據(jù)庫和用戶:
mysql> createdatabase zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhostidentified by 'zabbix'; flush privileges; show databases;
mysql> quit; 或者 \q
zabbix 監(jiān)控系統(tǒng)數(shù)據(jù)是存放在數(shù)據(jù)庫中,是需要建立一些表的。
查看建表語句,并導(dǎo)入;
[root@localhost~]# cd /usr/share/doc/zabbix-server-mysql-2.4.8/create [root@localhost create]#ll
導(dǎo)入數(shù)據(jù)庫:
[root@localhost create]# mysql -uroot zabbix< schema.sql [root@localhostcreate]# mysql -uroot zabbix < images.sql [root@localhostcreate]# mysql -uroot zabbix < data.sql
修改 zabbix 服務(wù)器配置文件:(該去除#號的就去除#號)
[root@localhost ~]#vi /etc/zabbix/zabbix_server.conf dbhost=localhost dbname=zabbix dbuser=zabbix dbpassword=zabbix vim的安裝 #yum search vim //查看vim相關(guān)軟件信息 #yum install -y vim* //在線安裝vim
修改時(shí)區(qū);
[root@localhost~]# vim /etc/php.ini// 在php.ini 配置文件里面最后面添加下列內(nèi)容【shift+g跳到文件末行】 php_valuemax_execution_time 300 php_valuememory_limit 128m php_valuepost_max_size 16m php_valueupload_max_filesize 2m php_valuemax_input_time 300
將“;date.timezone =”前面的分號去掉,然后頂格寫,并且將等號后面 賦予 :asia/shanghai
修改完成以后,重啟系統(tǒng)以后才能生效!
查看當(dāng)前時(shí)間:
[root@localhost~]# date
當(dāng)查看當(dāng)前時(shí)間的時(shí)候,時(shí)間不同步,需要進(jìn)行同步
安裝時(shí)間同步命令
[root@localhost~]#yum install ntpdate
執(zhí)行同步美國時(shí)間
[root@localhost~]# ntpdate us.pool.ntp.org
修改時(shí)區(qū):(ln sf a b b指向a) 同步時(shí)間
[root@localhost~]# ln -sf /usr/share/zoneinfo/asia/shanghai /usr/localtime [root@localhost~]#date
啟動(dòng)必要的服務(wù)(重啟):(是開機(jī)啟動(dòng),如果不啟動(dòng)系統(tǒng),服務(wù)就不會啟動(dòng),可以進(jìn)行手工啟動(dòng)服務(wù))
手工啟動(dòng)必要的服務(wù)(不重啟)
防火墻在啟用狀態(tài)下,chkconfig httpd on 啟動(dòng)httpd服務(wù)情況下,無法打開zabbix配置頁面
apache啟動(dòng),但無法通過瀏覽器打開zabbix,解決辦法 ,關(guān)閉防火墻,關(guān)閉selinux
關(guān)閉 selinux:sed -i "s/selinux=enforcing/selinux=disabled/g"/etc/selinux/config
確認(rèn)是否修改成功:#grepselinux /etc/selinux/config
停止防火墻:/etc/init.d/iptables stop
無意中發(fā)現(xiàn)一個(gè)現(xiàn)象,當(dāng)我關(guān)閉iptables并且停止iptables服務(wù),但是總會有一些出奇的事情發(fā)生,當(dāng)我再次啟動(dòng)系統(tǒng),查看iptables狀態(tài),iptables又自動(dòng)開啟,很是無奈??!經(jīng)過研究libvirt(虛擬化工具的c函數(shù)庫)在開機(jī)時(shí)會帶動(dòng)iptables的啟動(dòng),永久關(guān)閉iptables的方法是通過chkconfig工具,我們只需要chkconfig iptables off即可。
[系統(tǒng)環(huán)境]
centos release 6.7 (final)
關(guān)閉iptables
啟動(dòng)httpd: chkconfig httpd on
/etc/init.d/iptables stop
# 關(guān)閉iptables
chkconfig iptables off #永久關(guān)閉iptables
chkconfig --list iptables
# 檢查iptables
chkconfig --list httpd //查看httpd啟動(dòng)情況
iptables -l或者/etc/init.d/iptables status #查看iptables運(yùn)行狀態(tài)
cat /etc/redhat-release //查看系統(tǒng)版本
修改時(shí)區(qū):
# vim /etc/php.ini 修改 ;date.timezone =asia/shanghai并將前面分號去掉。也可以在前面修改時(shí)區(qū)時(shí)添加
# /etc/init.d/httpd restart //修改完成以后,要重啟
重啟httpd 會報(bào)錯(cuò),編輯httpd.conf 文件,vi /etc/httpd/conf/httpd.conf,將servername 前#取消即可!
重啟系統(tǒng)以后,再次報(bào)錯(cuò)數(shù)據(jù)庫沒有啟動(dòng),原因是數(shù)據(jù)庫沒有開機(jī)啟動(dòng)。執(zhí)行開機(jī)啟動(dòng),下次開機(jī)就不會報(bào)錯(cuò)
[root@localhost ~]# chkconfig mysqld on
所有安裝完成以后,需要執(zhí)行 全部開機(jī)啟動(dòng)即可!
讀到這里,這篇“centos下怎么安裝zabbix”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過才能領(lǐng)會,如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
本文標(biāo)題:centos下怎么安裝zabbix-創(chuàng)新互聯(lián)
網(wǎng)頁路徑:http://chinadenli.net/article42/ejjec.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站、網(wǎng)站改版、網(wǎng)站排名、網(wǎng)站策劃、App開發(fā)、響應(yīng)式網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容