设为首页 加入收藏

TOP

部署zabbix监控服务(二)
2023-07-23 13:32:12 】 浏览:46
Tags:部署 zabbix
]# ls Makefile.am Makefile.in data.sql double.sql history_pk_prepare.sql images.sql schema.sql [root@localhost mysql]# mysql -uzabbix -p'zabbix123!' zabbix < schema.sql [root@localhost mysql]# mysql -uzabbix -p'zabbix123!' zabbix < images.sql [root@localhost mysql]# mysql -uzabbix -p'zabbix123!' zabbix < data.sql

配置源代码

[root@localhost mysql]# cd
[root@localhost ~]# cd zabbix-6.2.2
[root@localhost zabbix-6.2.2]# ./configure --enable-server --enable-agent --with-mysql  --with-net-snmp --with-libcurl --with-libxml2
[root@localhost zabbix-6.2.2]# make && make install

//配置zabbix_server.conf文件
[root@localhost ~]# cd /usr/local/etc/
[root@localhost etc]# ls
zabbix_agentd.conf  zabbix_agentd.conf.d  zabbix_server.conf  zabbix_server.conf.d
[root@localhost etc]# vim zabbix_server.conf
DBPassword=zabbix123!
[root@localhost ~]# cd zabbix-6.2.2
[root@localhost zabbix-6.2.2]# zabbix_server 
[root@localhost zabbix-6.2.2]# zabbix_agentd 
[root@localhost ~]# ss -anlt
State   Recv-Q  Send-Q   Local Address:Port      Peer Address:Port  Process  
LISTEN  0       128            0.0.0.0:22             0.0.0.0:*              
LISTEN  0       128            0.0.0.0:10050          0.0.0.0:*              
LISTEN  0       128            0.0.0.0:10051          0.0.0.0:*              
LISTEN  0       128            0.0.0.0:9000           0.0.0.0:*              
LISTEN  0       128               [::]:22                [::]:*              
LISTEN  0       80                   *:3306                 *:*              
LISTEN  0       128                  *:80                   *:*

zabbix web界面安装前配置

[root@localhost ~]# sed -ri 's/(post_max_size =).*/\1 16M/g' /etc/php.ini
[root@localhost ~]# sed -ri 's/(max_execution_time =).*/\1 300/g' /etc/php.ini
[root@localhost ~]# sed -ri 's/(max_input_time =).*/\1 300/g' /etc/php.ini
[root@localhost ~]# sed -i '/;date.timezone/a date.timezone = Asia/Shanghai' /etc/php.ini
[root@localhost ~]# service php-fpm restart
[root@localhost zabbix-6.2.2]# cp -a ui/* /usr/local/apache/htdocs/zabbix.example.com/
cp: overwrite '/usr/local/apache/htdocs/zabbix.example.com/index.php'? y
[root@localhost zabbix-6.2.2]# chown -R apache.apache /usr/local/apache/htdocs

访问测试

image

image

image

image

image

image

image

image

zabbix客户端部署

#创建用户
[root@localhost ~]# useradd -rMs /sbin/nologin zabbix

#下载相关依赖包
[root@localhost ~]# dnf -y install make gcc gcc-c++ pcre-devel openssl openssl-devel

#下载,解压,编译安装zabbix_agentd
[root@localhost ~]# wget https://cdn.zabbix.com/zabbix/sources/stable/6.2/zabbix-6.2.2.tar.gz
[root@localhost ~]# tar -xf zabbix-6.2.2.tar.gz
[root@localhost ~]# cd zabbix-6.2.2
[root@localhost zabbix-6.2.2]# ./configure --enable-agent
[root@localhost zabbix-6.2.2]# make install

#修改配置文件
[root@localhost ~]# vim /usr/local/etc/zabbix_agentd.conf
Server=192.168.111.135			//修改为服务端IP地址

ServerActive=192.168.111.135			//agent主动模式

Hostname=zzzz			//zabbix系统内主机名

#启动并查看端口号
[root@localhost ~]# zabbix_agentd 
[root@localhost ~]# ss -anlt
State        Recv-Q       Send-Q             Local Address:Port               Peer Address:Port       Process       
LISTEN       0            128                      0.0.0.0:10050                   0.0.0.0:*                        
LISTEN       0            128                      0.0.0.0:22                      0.0.0.0:*                        
LISTEN       0            128                         [::]:22                         [::]:*                       

#关闭防火墙和selinux
[root@localhost ~]# systemctl disable --now firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# vim /etc/selinux/config 
SELINUX=disabled
首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇10_Linux基础-SHELL入门1 下一篇Ubuntu下安装多个JDK,并设置其中..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目