Rocky linux - How to install Zabbix

명상록·2023년 4월 14일


목록 보기

설치 구성

[root@localhost /]# cat /etc/redhat-release
Rocky Linux release 8.7 (Green Obsidian)

[root@localhost /]# uname -r

[root@localhost /]# ip a
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:ca:18:fe brd ff:ff:ff:ff:ff:ff
    altname enp11s0
    inet brd scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::e1a5:bed9:3ff9:e496/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
  1. selinux disabled(/etc/selinux/config)

  2. zabbix install

dnf -y install
dnf -y install
dnf module install php:remi-7.4 -y
dnf install
dnf clean all
dnf -y install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf
zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
php -v //7.4

NOTE: php의 최소 버전이 7.4여야 하는데 간혹 php의 버전이 7.0으로 설치되면 zabbix 설치 단계에 오류가 발생한다.

  1. mariadb install

A. mariadb install

curl -LsS -O

bash mariadb_repo_setup --mariadb-server-version=10.11

dnf -y install mariadb-server && systemctl start mariadb && systemctl enable mariadb

B. Reset root password for database


Switch to unix_socket authentication [Y/n] y
Change the root password? [Y/n] y
New password: 'NEW root DB password'
Re-enter new password: 'NEW root DB password'
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

C. Create database

mysql -uroot -p'1234' -e "create database zabbix character set utf8mb4 collate utf8mb4_bin;"
mysql -uroot -p'1234' -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbixDBpass';"

D. Import initial schema and data

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p'zabbixDBpass' zabbix

E. Enter database password in Zabbix configuration file

vim /etc/zabbix/zabbix_server.conf

  1. Start Zabbix
    systemctl restart zabbix-server zabbix-agent
    systemctl enable zabbix-server zabbix-agent
    firewall-cmd --add-service={http,https} --permanent
    firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
    firewall-cmd --reload

  2. Zabbix frontend

A. Restart Apache web server

systemctl restart httpd php-fpm
systemctl enable httpd php-fpm

B. Connect to the server ip


zabbix 사용 조건

DB 연동

설치 요약


Username : Admin, Password : zabbix

zabbix 6.4 Dashboard

zabbix, MySQL 또는 Apache 서비스를 확인할 때 참고하세요.

Zabbix Server
systemctl <status/restart/start/stop> zabbix-server

MySQL/MariaDB Server
systemctl <status/restart/start/stop> mysql

Apache Server
systemctl <status/restart/start/stop> httpd

PHP FastCGI Process Manager
systemctl <status/restart/start/stop> php-fpm

Zabbix Agent
systemctl <status/restart/start/stop> zabbix-agent
등불은 꺼질 때까지 계속해서 환하게 빛을 비춘다.

0개의 댓글