YUM安装Zabbix

Posted

tags:

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

环境:Centos 6.6


已完成LNMP安装

[[email protected] ~]# cd /etc/
[[email protected] etc]# grep max_execution_time php.ini
max_execution_time = 300
[[email protected] etc]# grep post_max_size php.ini
post_max_size = 16M
[[email protected] etc]# grep ^max_input_time php.ini
max_input_time = 300
[[email protected] etc]# grep ‘^date.timezone‘ php.ini
date.timezone = "Asia/Shanghai"
[[email protected] ~]#
[[email protected] etc]# grep php-fpm.pid php-fpm.conf
pid = /var/run/php-fpm/php-fpm.pid
[[email protected] etc]#
[[email protected] etc]# cd php-fpm.d/
[[email protected] php-fpm.d]# grep ^pm.min_spare_servers www.conf
pm.min_spare_servers = 5
[[email protected] php-fpm.d]# grep ^pm.max_spare_servers www.conf
pm.max_spare_servers = 35
[[email protected] php-fpm.d]# grep ^pm.start_servers www.conf
pm.start_servers = 5
[[email protected] php-fpm.d]# grep ^listen www.conf
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
[[email protected] php-fpm.d]# netstat -anp|grep php-fpm
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      1179/php-fpm        
unix  3      [ ]         STREAM     CONNECTED     9145   1179/php-fpm        
unix  3      [ ]         STREAM     CONNECTED     9144   1179/php-fpm        
[[email protected] php-fpm.d]# ps -ef |grep php |grep -v grep
root      1179     1  0 21:59 ?        00:00:00 php-fpm: master process (/etc/php-fpm.conf)
nginx     1180  1179  0 21:59 ?        00:00:00 php-fpm: pool www            
nginx     1181  1179  0 21:59 ?        00:00:00 php-fpm: pool www            
nginx     1182  1179  0 21:59 ?        00:00:00 php-fpm: pool www            
nginx     1183  1179  0 21:59 ?        00:00:00 php-fpm: pool www            
nginx     1184  1179  0 21:59 ?        00:00:00 php-fpm: pool www            
[[email protected] php-fpm.d]#


[[email protected] zabbix]# 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.rpm  zabbix-web-mysql-2.0.14-1.el6.noarch.rpm
[[email protected] zabbix]# yum -y localinstall zabbix*.rpm
[[email protected] zabbix]# 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 [email protected] identified by ‘zabbix‘;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
[[email protected] zabbix]# rpm -ql zabbix-web
[[email protected] zabbix]# cp -rfp /usr/share/zabbix /var/www/html/zabbix
[[email protected] ~]# rpm -ql zabbix-server-mysql
[[email protected] ~]# cd /usr/share/doc/zabbix-server-mysql-2.0.14/create/
[[email protected] create]# mysql -uroot -predhat zabbix < schema.sql
[[email protected] create]# mysql -uroot -predhat zabbix < images.sql
[[email protected] create]# mysql -uroot -predhat zabbix < data.sql
[[email protected] ~]# cd /etc/zabbix/
[[email protected] zabbix]# grep ^DB zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
DBPort=3306
[[email protected] zabbix]# grep ^LogFile zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
[[email protected] zabbix]#
[[email protected] zabbix]# grep ^Server zabbix_agentd.conf
Server=192.168.31.160
ServerActive=192.168.31.160
[[email protected] zabbix]# grep ^Hostname zabbix_agentd.conf
Hostname=192.168.31.160
[[email protected] zabbix]# grep ^Unsafe zabbix_agentd.conf
UnsafeUserParameters=1
[[email protected] zabbix]#
[[email protected] zabbix]# /etc/init.d/zabbix-server start
Starting Zabbix server:                                    [  OK  ]
[[email protected] zabbix]# /etc/init.d/zabbix-agent start
Starting Zabbix agent:                                     [  OK  ]
[[email protected] zabbix]# chkconfig zabbix-server on
[[email protected] zabbix]# chkconfig zabbix-agent on


[[email protected] ~]# cd /etc/nginx/conf.d/
[[email protected] 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;
    }
[[email protected] conf.d]#
[[email protected] conf.d]# /etc/init.d/nginx restart
Stopping nginx:                                            [  OK  ]
Starting nginx:                                            [  OK  ]
[[email protected] conf.d]#
[[email protected] ~]# chown zabbix:nginx /etc/zabbix/ -R
[[email protected] ~]# chmod 775 /etc/zabbix/web/

技术分享

技术分享


本文出自 “鹏城-酱油瓶” 博客,谢绝转载!

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

yum安装zabbix

zabbix2.4 yum安装

CentOS 7 yum安装Zabbix

安装Zabbix到CentOS(YUM)

[原创] zabbix学习之旅二:yum安装

YUM安装Zabbix