Script installation zabbix2.2, based on centos6.6 basic server

Source: Internet
Author: User

#!/bin/bash########################################################################################### #0, Custom configuration file Required Parameters ########################################################################################## #mysql_ root_pw=root_pwmysql_zabbix_pw=zabbix_pwdbpassword= $mysql _zabbix_pwcachesize=256mzbx_server_name= my-zabbix-server########################################################################################### #1, Installation of Zabbix and 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, Configuration 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, Configuration 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

Script installation zabbix2.2, based on centos6.6 basic server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.