zabbix-3.4.6安装

Posted 风子陈

tags:

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


先安装myql和php
mysql5.7.17: http://www.cnblogs.com/cjsblogs/p/8116782.html

php7.2.1: http://www.cnblogs.com/cjsblogs/p/8116782.html

安装zabbix
# tar -zxf zabbix-3.4.6.tar.gz
# cd zabbix-3.4.6

# mkdir -p /usr/local/zabbix/logs
# ./configure --prefix=/usr/local/zabbix --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --enable-server --enable-agent --enable-proxy --with-libcurl --with-ssh2 --with-openipmi --with-unixodbc --enable-java

make && make install

  

创建zabbix用户和用户组

# groupadd zabbix
# useradd -r -g zabbix zabbix
# cd /usr/local && chown -R zabbix:zabbix zabbix

  


创建zabbix数据库,并导入表结构
# mysql -uroot -p
mysql> create database if not exists zabbix default character set utf8 collate utf8_general_ci;
mysql> use zabbix;
mysql> source /tmp/zabbix-3.4.6/database/mysql/schema.sql;
mysql> source /tmp/zabbix-3.4.6/database/mysql/images.sql;
mysql> source /tmp/zabbix-3.4.6/database/mysql/data.sql;

 

修改zabbix_server.conf

LogFile=/usr/local/zabbix/logszabbix_server.log
LogFileSize=50
PidFile=/usr/local/zabbix/etc/zabbix_server.pid
SocketDir=/var/run/zabbix
DBName=zabbix
DBPassword=zabbix
DBUser=zabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

  

启动zabbix_server 

# ln -s /usr/local/mysql/lib/libmysqlclient.so.20 /usr/lib/
# ldconfig
# /usr/local/zabbix/sbin/zabbix_server

 

 

安装nginx

nginx: http://www.cnblogs.com/cjsblogs/p/8426140.html

 

添加配置文件zabbix.conf

# cd /usr/local/nginx/conf/vhosts/
# vim zabbix.conf
server {
    listen 80;
    server_name ip;
    root /usr/local/nginx/html/zabbix;
    index index.html index.htm index.php;

    location ~* ^.+\\.(js|ico|gif|jpg|jpeg|pdf|png|css|swf)$ {
         expires      30d;
         access_log   off;
     }

    location ~ ^/.*\\.php?$ {
         include fcgi.conf;
         fastcgi_pass 127.0.0.1:9000;
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
         include        fastcgi_params;
     }
}

 

拷贝网页文件到 nginx 目录

cp -r ~/zabbix-3.4.6/frontends/php/ /usr/local/nginx/html/zabbix
chown -R www.www /usr/local/nginx/html/zabbix

 

启动nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

 

  

 

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

Zabbix 3.4.6实现微信告警

zabbix搭建记录 zabbix3.4.6

zabbix分布式系统监控 (报错:host *** not monitored)

zabbix分布式系统监控报错( host not monitored)

Zabbix监控系统部署(源码)

在Tomcat的安装目录下conf目录下的server.xml文件中增加一个xml代码片段,该代码片段中每个属性的含义与用途