Zabbix 安装
zabbix 监控简介
- Zabbix 是一个企业级分布式开源监控解决方案。
- Zabbix 支持主动轮询(polling)和被动捕获(trapping)。
- Zabbix所有的报表、统计数据和配置参数都可以通过基于 Web 的前端页面进行访问
Zabbix Agent
- 部署于被监控对象上
- 支持 Linux 和 Windows
实验 (安装 zabbix)
cat <<EOF > /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - \$basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/\$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - \$basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/\$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
EOF
yum install mariadb-server
vim /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
!includedir /etc/my.cnf.d
systemctl start mariadb
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
yum clean all
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by 'westos';
grant all privileges on zabbix.* to zabbix@localhost;
quit;
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pwestos zabbix
vim /etc/zabbix/zabbix_server.conf
……
DBPassword=westos
……
vim /etc/httpd/conf.d/zabbix.conf
……
php_value date.timezone Asia/shanghai
……
systemctl restart zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd