yinl_li 发表于 2019-1-22 06:42:07

YUM安装Zabbix

  环境:Centos 6.6
  

  已完成LNMP安装
# cd /etc/
# grep max_execution_time php.ini
max_execution_time = 300
# grep post_max_size php.ini
post_max_size = 16M
# grep ^max_input_time php.ini
max_input_time = 300
# grep '^date.timezone' php.ini
date.timezone = "Asia/Shanghai"
#
# grep php-fpm.pid php-fpm.conf
pid = /var/run/php-fpm/php-fpm.pid
#
# cd php-fpm.d/
# grep ^pm.min_spare_servers www.conf
pm.min_spare_servers = 5
# grep ^pm.max_spare_servers www.conf
pm.max_spare_servers = 35
# grep ^pm.start_servers www.conf
pm.start_servers = 5
# grep ^listen www.conf
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
# netstat -anp|grep php-fpm
tcp      0      0 127.0.0.1:9000            0.0.0.0:*                   LISTEN      1179/php-fpm      
unix3      [ ]         STREAM   CONNECTED   9145   1179/php-fpm      
unix3      [ ]         STREAM   CONNECTED   9144   1179/php-fpm      
# ps -ef |grep php |grep -v grep
root      1179   10 21:59 ?      00:00:00 php-fpm: master process (/etc/php-fpm.conf)
nginx   118011790 21:59 ?      00:00:00 php-fpm: pool www            
nginx   118111790 21:59 ?      00:00:00 php-fpm: pool www            
nginx   118211790 21:59 ?      00:00:00 php-fpm: pool www            
nginx   118311790 21:59 ?      00:00:00 php-fpm: pool www            
nginx   118411790 21:59 ?      00:00:00 php-fpm: pool www            
#  

# ls
zabbix-2.0.14-1.el6.x86_64.rpm         zabbix-server-2.0.14-1.el6.x86_64.rpm
zabbix-agent-2.0.14-1.el6.x86_64.rpm   zabbix-server-mysql-2.0.14-1.el6.x86_64.rpm
zabbix-get-2.0.14-1.el6.x86_64.rpm   zabbix-web-2.0.14-1.el6.noarch.rpm
zabbix-sender-2.0.14-1.el6.x86_64.rpmzabbix-web-mysql-2.0.14-1.el6.noarch.rpm
# yum -y localinstall zabbix*.rpm
# mysql -uroot -predhat
mysql> create database zabbix default charset utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on zabbix.* to zabbix@192.168.31.160 identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
# rpm -ql zabbix-web
# cp -rfp /usr/share/zabbix /var/www/html/zabbix
# rpm -ql zabbix-server-mysql
# cd /usr/share/doc/zabbix-server-mysql-2.0.14/create/
# mysql -uroot -predhat zabbix < schema.sql
# mysql -uroot -predhat zabbix < images.sql
# mysql -uroot -predhat zabbix < data.sql
# cd /etc/zabbix/
# grep ^DB zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
DBPort=3306
# grep ^LogFile zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
#
# grep ^Server zabbix_agentd.conf
Server=192.168.31.160
ServerActive=192.168.31.160
# grep ^Hostname zabbix_agentd.conf
Hostname=192.168.31.160
# grep ^Unsafe zabbix_agentd.conf
UnsafeUserParameters=1
#
# /etc/init.d/zabbix-server start
Starting Zabbix server:                                    
# /etc/init.d/zabbix-agent start
Starting Zabbix agent:                                    
# chkconfig zabbix-server on
# chkconfig zabbix-agent on  

# cd /etc/nginx/conf.d/
# head -25 default.conf|tail -6
    location /zabbix {
root /var/www/html;
index index.php;
access_log/var/log/zabbix/zabbix.access.log main;
try_files $uri $uri/ /index.php?$args;
    }
#
# /etc/init.d/nginx restart
Stopping nginx:                                          
Starting nginx:                                          
#
# chown zabbix:nginx /etc/zabbix/ -R
# chmod 775 /etc/zabbix/web/http://s5.运维网.com/wyfs02/M00/80/47/wKiom1c9HPXSTX6NAAK3O3iyAKU795.png
http://s3.运维网.com/wyfs02/M00/80/45/wKioL1c9HeHj64OYAACVjElZ2wk640.png
  




页: [1]
查看完整版本: YUM安装Zabbix