中小型規模網站集羣架構:zabbix安裝

1.安裝zabbix

服務端安裝

rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpmyum -y install httpd zabbix-web zabbix-server-mysql zabbix-web-mysql mysql-server

PHP安裝

rpm -ivh http://repo.webtatic.com/yum/el6/x86_64/webtatic-release-6-6.noarch.rpm 
yum -y install php55w php55w-mysql php55w-common php55w-gd php55w-mbstring php55w-mcrypt php55w-devel php55w-xml php55w-bcmath

直接解決:

yum -y  install httpd zabbix-web zabbix-server-mysql zabbix-web-mysql zabbix-get mysql-server php55w php55w-mysql php55w-common php55w-gd php55w-mbstring php55w-mcrypt php55w-devel php55w-xml php55w-bcmath zabbix-get zabbix-java-gateway wqy-microhei-fonts net-snmp net-snmp-utils

修改mysql配置

\cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
啓動MySQL/etc/init.d/mysqld start
創建用戶並授權mysqlcreate database zabbix character set utf8 collate utf8_bin;grant all on zabbix.* to zabbix@'localhost' identified by 'zabbix';flush privileges;exit

導入數據文件

cd /usr/share/doc/zabbix-server-mysql-3.0.7zcat create.sql.gz |mysql -uzabbix -pzabbix zabbix

相關數據修改
修改php配置文件

egrep -n "^post_max_size|^max_execution_time|^max_input_time|^date.timezone" /etc/php.inised -i 's#max_execution_time = 30#max_execution_time = 300#;s#max_input_time = 60#max_input_time = 300#;s#post_max_size = 8M#post_max_size = 16M#;910a date.timezone = Asia/Shanghai' /etc/php.ini

修改zabbix_server配置文件

sed -i '115a DBPassword=zabbix' /etc/zabbix/zabbix_server.conf

網頁文件

cp -R /usr/share/zabbix/ /var/www/html/

文件授權

chmod -R 755 /etc/zabbix/webchown -R apache.apache /etc/zabbix/web

啓動zabbix

echo "ServerName 127.0.0.1:80">>/etc/httpd/conf/httpd.conf/etc/init.d/httpd start/etc/init.d/zabbix-server start

修改字符集,修改掉默認的字符集

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repoyum -y install wqy-microhei-fonts

\cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

安裝客戶端

yum localinstall http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/6/x86_64/zabbix-agent-3.0.7-1.el6.x86_64.rpm -y

修改配置文件

sed -i 's#Server=127.0.0.1#Server=172.16.1.41#' /etc/zabbix/zabbix_agentd.conf

重啓服務

/etc/init.d/zabbix-agent restart

服務端檢測

zabbix_get -s 172.16.1.41 -p 10050 -k "system.cpu.load[all,avg1]"


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章