Debian10安装Zabbix教程 zabbix分为server端和agent端,本文分为两个部分分别讨论其安装方法。对于zabbix的agent端的不同环境也做了详细阐述。 Zabbix-se
zabbix分为server端和agent端,本文分为两个部分分别讨论其安装方法。对于zabbix的agent端的不同环境也做了详细阐述。
1、安装Apache httpd服务器
apt updateapt install -y apache2
安装成功后修改配置文件
sed -i "s/^ServerTokens OS$/ServerTokens Prod/" /etc/apache2/conf-enabled/security.confsed -i "s/^ServerSignature On$/ServerSignature Off/" /etc/apache2/conf-enabled/security.conf
重启apache2 服务
systemctl restart apache2
注:Apache2默认的端口为80,如果端口号被占用导致没有重启成功,则通过下面的方法修改端口号后重新启动
vim /etc/apache2/ports.conf 修改 Listen 9000
2、为Apache2安装php
apt-get -y install PHP php-pear php-cgi php-common libapache2-mod-php
为Apache2配置php**(root用户也要加sudo)**
sudo a2enconf php7.3-cgi systemctl reload apache2
修改Apache2的时区配置文件
vim /etc/php/7.3/apache2/php.ini
将时区修改为
Http://php.net/date.timezonedate.timezone = "Asia/Shanghai"
修改成功后重启Apache2
systemctl restart apache2
3、安装MariaDB数据库
执行命令
apt -y install mariadb-server
4、安装zabbix服务器
wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1%2Bbuster_all.debdpkg -i zabbix-release_5.0-1+buster_all.debapt update
安装zabbix-server(zabbix-server依赖Mysql、PHP,故同样会安装其他相关组件依赖)
apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf
安装成功以后进入mysql执行对应的sql创建zabbix的mysql用户
# mysql -uroot -ppassWordmysql> create database zabbix character set utf8 collate utf8_bin;mysql> create user zabbix@localhost identified by '123456';mysql> grant all privileges on zabbix.* to zabbix@localhost;mysql> quit;
然后把zabbix的数据导入到mysql**(这里会要求输入密码,注意是上一步创建用户输入的密码,时间略长耐心等待)**
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
vim /etc/zabbix/zabbix_server.conf
取消注释并添加密码**(这个密码是mysql创建zabbix用户的密码)**
DBPassword=123456
编辑 /etc/zabbix/apache.conf 文件取消php_value date.timezone注释选择正确的时区
修改为:php_value date.timezone Asia/Shanghai
启动服务**(该操作会设置系统启动时自动启动该服务)**
systemctl restart zabbix-server apache2systemctl enable zabbix-server apache2
1、添加apt库
wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1%2Bbuster_all.debdpkg -i zabbix-release_5.0-1+buster_all.debapt update
2、安装zabbix-agent
apt install zabbix-agent
3、修改配置文件使得指向zabbix-sever
vim /etc/zabbix/zabbix_agentd.conf
将server指向zabbix的server端
Server=172.21.1.42ServerActive=172.21.1.42Hostname=172.21.1.42(根据需要自行修改)
4、重新启动(机器启动就会启动该程序)
systemctl start zabbix-agentsystemctl enable zabbix-agent
//todo
如果apt速度慢请自行换apt源
修改**/etc/apt/sources.list** 文件替换为下面网易源**(该源为Debian10)**
deb http://mirrors.163.com/debian/ buster main non-free contribdeb http://mirrors.163.com/debian/ buster-updates main non-free contribdeb http://mirrors.163.com/debian/ buster-backports main non-free contribdeb-src http://mirrors.163.com/debian/ buster main non-free contribdeb-src http://mirrors.163.com/debian/ buster-updates main non-free contribdeb-src http://mirrors.163.com/debian/ buster-backports main non-free contribdeb http://mirrors.163.com/debian-security/ buster/updates main non-free contribdeb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
来源地址:https://blog.csdn.net/qicaixiao/article/details/127869844
--结束END--
本文标题: Debian10安装Zabbix教程
本文链接: https://lsjlt.com/news/391219.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0