zabbix配置文件有两种:
服务器端配置文件(/usr/local/etc/zabbix_rver.conf)客户端配置文件(/usr/local/etc/zabbix_agentd.conf)zabbix代理配置文件(/usr/local/etc/zabbix_proxy.conf)服务器端配置文件zabbix_rver.conf常用配置参数:客户端配置文件zabbix_agentd.conf常用配置参数:
环境说明:
安装依赖包
[root@wangyitong ~]# wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.1.tar.gz
下载zabbix与解压
[root@wangyitong ~]# wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.1.tar.gz[root@wangyitong ~]# lsanaconda-ks.cfg lamp zabbix-5.0.1.tar.gz[root@wangyitong ~]# tar xf zabbix-5.0.1.tar.gz
创建zabbix用户和组
[root@wangyitong ~]# uradd -r -M -s /sbin/nologin zabbix
配置zabbix数据库
[root@wangyitong ~]# mysql -uroot -p123456mysql: [Warning] Using a password on the command line interface can be inre.Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.30 MySQL Community Server (GPL)Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights rervOracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input state.mysql> create databa zabbix character t utf8 collate utf8_bin;Query OK, 1 row affected (0.01 c)mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix123';Query OK, 0 rows affected, 2 warnings (0.01 c)mysql> flush privileges;Query OK, 0 rows affected (0.02 c)mysql> quitBye[root@wangyitong ~]# cd zabbix-5.0.1/databa/mysql/[root@wangyitong mysql]# lsdata.sql double.sql images.sql Makefile.am Makefile.in schema.sql[root@wa形态什么ngyitong mysql]# mysql -uzabbix -pzabbix123 zabbix < schema.sqlmysql: [Warning] Using a password on the command line interface can be incure.[root@wangyitong mysql]# mysql -uzabbix -pzabbix123 zabbix < images.sqlmysql: [Warning] Using a password on the command line interface can be incure.[root@wangyitong mysql]# mysql -uzabbix -pzabbix123 zabbix < data.sqlmysql: [Warning] Using a password on the command line interface can be incure.
编译安装zabbix
[root@wangyitong ~]# cd zabbix-5.0.1[root@wangyitong zabbix-5.0.1]# ./configure --enable-rver \> --enable-agent \> --with-mysql \> --with-net-snmp \> --with-libcurl \> --with-libxml2....[root@wangyitong zabbix-5.0.1]# make insatall
[root@wangyitong zabbix-5.0.1]# cd /usr/local/etc/[root@wangyitong etc]# lszabbix_agentd.conf zabbix_rver.confzabbix_agentd.conf.d zabbix_rver.conf.d[root@wangyitong etc]# vim zabbix_rver.confDBPassword=zabbix123 //设置zabbix数据库连接密码启动zabbix_rver和zabbix_agentd[root@wangyitong ~]# zabbix_rver [root@wangyitong ~]# zabbix_agentd[root@wangyitong ~]# ss -antlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:22 *:* LISTEN 0 100 127.0.0.1:25 *:* LISTEN 0 128 *:10050 *:* LISTEN 0 128 *:10051 *:* LISTEN 0 128 127.0.0.1:9000 *:* LISTEN 0 128 :::80 :::* LISTEN 0 128 :::22 :::* LISTEN 0 100 ::1:25 :::* LISTEN 0 80 :::3306 :::*
修改/etc/php.ini的配置并重启php-fpm
root@wangyitong ~]# d -ri 's/(post_max_size =).*/ 16M/g' /etc/php.ini[root@wangyitong ~]# d -ri 's/(max_execution_time =).*/ 300/g' /etc/php.ini[root@wangyitong ~]# d -ri 's/(max_input_time =).*/ 300/g' /etc/php.ini[root@wangyitong ~]# d -i '/;date.timezone/a date.timezone = Asia/Shanghai' /etc/php.ini[root@wangyitong ~]# rvice php-fpm restartGracefully shutting down php-fpm . doneStarting php-fpm done
创建数据存放目录并修改目录属主和属组
[root@wangyitong ~]# cd zabbix-5.0.1[root@wangyitong zabbix-5.0.1]# lsaclocal.m4 conf configure.ac install-sh misc uiAUTHORS config.guess COPYING m4 missingbin config.log databa Makefile NEWSbuild config.status depcomp Makefile.am READMEChangeLog config.sub include 如何分辨假钱Makefile.in sasscompile configure INSTALL man src[root@wangyitong zabbix-5.0.1]# cp -r ui /usr/loca生命的思考l/apache/htdocs/zabbix[root@wangyitong zabbix-5.0.1]# cd /usr/local/apache/htdocs/[root@wangyitong htdocs]# lsindex.html test.com zabbix[root@wangyitong htdocs]# chown -R apache.apache zabbix/[root@wangyitong htdocs]# lltotal 8-rw-r--r--. 1 apache apache 45 Jun 12 2007 index.htmldrwxr-xr-x. 2 apache apache 23 Jul 16 01:40 test.comdrwxr-xr-x. 12 apache apache 4096 Jul 16 20:16 zabbix
配置apache虚拟主机
[root@wangyitong ~]# vim /etc/httpd24/httpd.conf#添加下面的内容<VirtualHost *:80> DocumentRoot "/usr/local/apache/htdocs/zabbix" ServerName www.wyt.com ProxyRequests Off ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/zabbix/$1 <Directory "/usr/local/apache/htdocs/zabbix"> Options none AllowOverride none Require all granted </Directory&世界旅游景点gt;</VirtualHost>
设置zabbix/conf目录的权限,让zabbix有权限生成配置文件zabbix.conf.php
[root@wangyitong ~]# chmod 777 /usr/local/apache/htdocs/zabbix/conf[root@wangyitong ~]# ll -d /usr/local/apache/htdocs/zabbix/confdrwxrwxrwx. 3 apache apache 94 Jul 16 20:16 /usr/local/apache/htdocs/zabbix/conf
重启服务
[root@wangyitong ~]# apachectl stop[root@wangyitong ~]# apachectl start[root@wangyitong ~]# rvice php-fpm restartGracefully shutting down php-fpm . doneStarting php-fpm done[root@wangyitong ~]# rvice mysqld restartShutting down MySQL.. SUCCESS! Starting MySQL. SUCCESS! [root@wangyitong ~]# ss -antlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:22 *:* LISTEN 0 100 127.0.0.1:25 *:* LISTEN 0 128 *:10050 *:* LISTEN 15 128 *:10051 *:* LISTEN 0 128 127.0.0.1:9000 *:* LISTEN 0 128 :::80 :::* LISTEN 0 128 :::22 :::* LISTEN 0 100 ::1:25 :::* LISTEN 0 80 :::3306 :::*
修改/etc/hosts文件,添加域名与IP的映射
在浏览器上用IP访问进行安装:
恢复zabbix/conf目录的权限为755
[root@wangyitong ~]# chmod 755 /usr/local/apache/htdocs/zabbix/conf[root@wangyitong ~]# ll -d /usr/local/apache/htdocs/zabbix/confdrwxr-xr-x. 3 apache apache 117 Jul 16 21:05 /usr/local/apache/htdocs/zabbix/conf
用户名: Admin
密码: zabbix
本文地址:https://blog.csdn.net/lnsistw/article/details/107360705
本文发布于:2023-04-08 20:17:58,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/e95a5eface34706870ae59e80793ae5a.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:zabbix监控部署.doc
本文 PDF 下载地址:zabbix监控部署.pdf
留言与评论(共有 0 条评论) |