install zabbix

Posted zmichael

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了install zabbix相关的知识,希望对你有一定的参考价值。

#yum install maridb and php apache
yum install make httpd php mysql-devel gcc net-snmp-devel curl-devel perl-DBI php-fpm php-gd php-mysql php-bcmath php-mbstring php-xml unixODBC-devel OpenIPMI-devel libxml2-devel mariadb mariadb-server -y

#add new user zabbix
useradd zabbix -s /sbin/nologin

#start mariadb
systemctl start mariadb.service

#create new database
mysql -uroot -e "create database zabbix character set utf8 collate utf8_bin;"

#create new user
mysql -uroot -e "grant all on zabbix.* to zabbix@localhost identified by ‘zabbix‘;"

#flush privileges
mysql -uroot -e "flush privileges;"

#download zabbix installation and install
cd /usr/local/src/
wget https://testom.obs.cn-east-2.myhuaweicloud.com/zabbix-3.2.7.tar.gz
tar -xf zabbix-3.2.7.tar.gz
cd zabbix-3.2.7

#excute sql script
cd database/mysql/
mysql -uzabbix -pzabbix zabbix < schema.sql
mysql -uzabbix -pzabbix zabbix < images.sql
mysql -uzabbix -pzabbix zabbix < data.sql

#start install zabbix
cd /usr/local/src/zabbix-3.2.7

./configure --enable-server --enable-agent --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-unixodbc

make && make install

#modify zabbix db password
sed -i "s/# DBPassword=/DBPassword=zabbix/g" /usr/local/etc/zabbix_server.conf

 

#copy start file to init.d

cp /usr/local/src/zabbix-3.2.7/misc/init.d/fedora/core5/zabbix_server /etc/init.d/

chmod +x /etc/init.d/zabbix_server

#start zabbix
/etc/init.d/zabbix_server start

#modify php conf
sed -i "s#max_execution_time = 30#max_execution_time = 300#" /etc/php.ini

sed -i "s#max_input_time = 60#max_input_time = 300#" /etc/php.ini

sed -i "s#post_max_size = 8M#post_max_size = 32M#" /etc/php.ini

sed -i "s#;date.timezone =#date.timezone = Asia/Shanghai#g" /etc/php.ini

#copy zabbix frontend to html
cd /usr/local/src/zabbix-3.2.7/frontends/
mkdir -p /var/www/html/zabbix
cp -rf php/* /var/www/html/zabbix
chmod -R 777 /var/www/html/zabbix

以上是关于install zabbix的主要内容,如果未能解决你的问题,请参考以下文章

install命令

Vue.use() 与 install()

install命令的用法

install cmake,install torch7

用install Install Shield 6.22打包安装程序 怎么创建卸载程序 高手指教!~

pip install PIL报错问题解决