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可以去 https://lnmp.org/ 下載自行安裝
第一步 安裝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),對(duì)其啟動(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ù)器配置文件:(該去除#號(hào)的就去除#號(hào))
[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 =”前面的分號(hào)去掉,然后頂格寫,并且將等號(hào)后面 賦予 :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ù)就不會(huì)啟動(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ù),但是總會(huì)有一些出奇的事情發(fā)生,當(dāng)我再次啟動(dòng)系統(tǒng),查看iptables狀態(tài),iptables又自動(dòng)開啟,很是無奈啊!經(jīng)過研究libvirt(虛擬化工具的C函數(shù)庫)在開機(jī)時(shí)會(huì)帶動(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并將前面分號(hào)去掉。也可以在前面修改時(shí)區(qū)時(shí)添加

# /etc/init.d/httpd restart //修改完成以后,要重啟

重啟httpd 會(huì)報(bào)錯(cuò),編輯httpd.conf 文件,vi /etc/httpd/conf/httpd.conf,將ServerName www.example.com:80前#取消即可!










重啟系統(tǒng)以后,再次報(bào)錯(cuò)數(shù)據(jù)庫沒有啟動(dòng),原因是數(shù)據(jù)庫沒有開機(jī)啟動(dòng)。執(zhí)行開機(jī)啟動(dòng),下次開機(jī)就不會(huì)報(bào)錯(cuò)
[root@localhost ~]# chkconfig mysqld on


所有安裝完成以后,需要執(zhí)行 全部開機(jī)啟動(dòng)即可!

總結(jié)
以上所述是小編給大家介紹的centos6.5下安裝zabbix2.4的教程圖解,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!