指令碼安裝zabbix2.2,基於centos6.6 basic server

來源:互聯網
上載者:User

標籤:zabbix   basic   centos6.6   

#!/bin/bash############################################################################################0、定製設定檔所需參數###########################################################################################mysql_root_pw=root_pwmysql_zabbix_pw=zabbix_pwDBPassword=$mysql_zabbix_pwCacheSize=256MZBX_SERVER_NAME=My-Zabbix-Server############################################################################################1、安裝Zabbix及MySQL############################################################################################rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpmrpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpmrpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmyum install -y zabbix zabbix-get zabbix-server zabbix-web-mysql zabbix-web zabbix-agentyum install -y mysql-server############################################################################################2、配置MySQL###########################################################################################sed -i ‘/^symbolic-links=0/a character-set-server=utf8\ninnodb_file_per_table=1‘ /etc/my.cnfchkconfig mysqld on/etc/init.d/mysqld startmysqladmin -uroot password $mysql_root_pwmysql -h localhost -uroot -p$mysql_root_pw -e "create database zabbix character set utf8;"mysql -h localhost -uroot -p$mysql_root_pw -e "grant all privileges on zabbix.* to [email protected] identified by ‘$mysql_zabbix_pw‘;"mysql -h localhost -uroot -p$mysql_root_pw -e "flush privileges;"mysql -h localhost -uzabbix -p$mysql_zabbix_pw -Dzabbix < /usr/share/doc/zabbix-server-mysql-2.2.10/create/schema.sqlmysql -h localhost -uzabbix -p$mysql_zabbix_pw -Dzabbix < /usr/share/doc/zabbix-server-mysql-2.2.10/create/images.sqlmysql -h localhost -uzabbix -p$mysql_zabbix_pw -Dzabbix < /usr/share/doc/zabbix-server-mysql-2.2.10/create/data.sql############################################################################################3、配置Zabbix###########################################################################################sed -i "/^# DBPassword=/a DBPassword=$DBPassword" /etc/zabbix/zabbix_server.confsed -i "/^# CacheSize=8M/a CacheSize=$CacheSize" /etc/zabbix/zabbix_server.confsed -i ‘s/# php_value date.timezone Europe\/Riga/php_value date.timezone Asia\/Shanghai/‘ /etc/httpd/conf.d/zabbix.confcp /usr/share/zabbix/conf/zabbix.conf.php.example /etc/zabbix/web/zabbix.conf.phpsed -i "10c \$DB[\"PASSWORD\"]    = ‘$DBPassword‘;" /etc/zabbix/web/zabbix.conf.phpsed -i "16c \$ZBX_SERVER_NAME   = ‘$ZBX_SERVER_NAME‘;" /etc/zabbix/web/zabbix.conf.phpchkconfig zabbix-server onchkconfig httpd on/etc/init.d/zabbix-server start/etc/init.d/httpd startiptables -I  INPUT -m state --state NEW -p tcp  --dport 10050 -j ACCEPT iptables -I  INPUT -m state --state NEW -p tcp  --dport 80 -j ACCEPT  /etc/init.d/iptables savesetenforce 0sed -i ‘s/SELINUX=enforcing/SELINUX=permissive/‘ /etc/sysconfig/selinux

指令碼安裝zabbix2.2,基於centos6.6 basic server

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.